/[drupal]/contributions/modules/taxonomy_menu/taxonomy_menu.inc
ViewVC logotype

Diff of /contributions/modules/taxonomy_menu/taxonomy_menu.inc

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.2.2.3, Sun Feb 1 02:40:09 2009 UTC revision 1.2.2.4, Sun Feb 1 02:56:10 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: taxonomy_menu.inc,v 1.2.2.2 2008/09/09 11:54:04 afief Exp $  // $Id: taxonomy_menu.inc,v 1.2.2.3 2009/02/01 02:40:09 indytechcook Exp $
3    
4  /**  /**
5   * @author Jonathan Chaffer   <jchaffer@structureinteractive.com>   * @author Jonathan Chaffer   <jchaffer@structureinteractive.com>
# Line 24  function _taxonomy_menu_admin(&$form_sta Line 24  function _taxonomy_menu_admin(&$form_sta
24    
25    // If the Views module is enabled, add some special    // If the Views module is enabled, add some special
26    // new features    // new features
27  //   if (module_exists('views')) {    if (module_exists('views')) {
28  //     // Add the Views file with more functions      // Add a new options on Categories
29  //     require_once(drupal_get_path('module', 'views') .'/views_cache.inc');      $options[TAXONOMY_MENU_VIEW] = t('Views');
30  //  
31  //     // Add a new options on Categories      // Now get a list of Views
32  //     $options[TAXONOMY_MENU_VIEW] = t('Views');      foreach (views_get_all_views() as $view => $viewdata) {
33  //        $views_list[$view] = $viewdata->name;
34  //     // Get the list of User generated views      }
35  //     $views = db_query("SELECT * FROM {view_view}");    }
 //     while ($view = db_fetch_array($views)) {  
 //       $views_list[$view['name']] = $view['page_title'];  
 //     }  
 //  
 //     // Now get a list of default Views  
 //     foreach (_views_get_default_views() as $view => $viewdata) {  
 //       $views_list[$view] = $viewdata->name;  
 //     }  
 //   }  
36    
37    // If the Taxonomy Default module is enabled, add some special    // If the Taxonomy Default module is enabled, add some special
38    // new features    // new features
# Line 64  function _taxonomy_menu_admin(&$form_sta Line 55  function _taxonomy_menu_admin(&$form_sta
55      );      );
56    
57      // In case of View options selected, select Views      // In case of View options selected, select Views
58  //     if (module_exists('views')) {      if (module_exists('views')) {
59  //       $form[$vocab->vid]['taxonomy_menu_show_view_'. $vocab->vid] = array(        $form[$vocab->vid]['taxonomy_menu_show_views_'. $vocab->vid] = array(
60  //         '#default_value'  => variable_get('taxonomy_menu_show_view_'. $vocab->vid, ''),          '#default_value'  => variable_get('taxonomy_menu_show_views_'. $vocab->vid, ''),
61  //         '#options'        => $views_list,          '#options'        => $views_list,
62  //         '#title'          => t('Views available'),          '#title'          => t('Views available'),
63  //         '#type'           => 'select'          '#type'           => 'select'
64  //       );        );
65  //     }      }
66    }    }
67    
68    // General options    // General options
# Line 126  function _taxonomy_menu_admin_submit($fo Line 117  function _taxonomy_menu_admin_submit($fo
117      variable_set('taxonomy_menu_show_'. $vocab->vid,      variable_set('taxonomy_menu_show_'. $vocab->vid,
118        $form_state['values']['taxonomy_menu_show_'. $vocab->vid]);        $form_state['values']['taxonomy_menu_show_'. $vocab->vid]);
119      variable_set('taxonomy_menu_show_views_'. $vocab->vid,      variable_set('taxonomy_menu_show_views_'. $vocab->vid,
120        $form_state['values']['taxonomy_menu_show_view_'. $vocab->vid]);        $form_state['values']['taxonomy_menu_show_views_'. $vocab->vid]);
121    }    }
122    
123    // Rebuild the menu to include these features    // Rebuild the menu to include these features
# Line 317  function _taxonomy_menu_page() { Line 308  function _taxonomy_menu_page() {
308        }        }
309    
310        // Embed the views output into the page        // Embed the views output into the page
311        $output = views_build_view('embed',        $view = views_get_view(variable_get('taxonomy_menu_show_views_'. $vid, ''));
312          views_get_view(variable_get('taxonomy_menu_show_views_'. $vid, '')),        $output = $view->execute_display('embed', $arguments);
         $arguments, FALSE, NULL);  
313      }      }
314      elseif (variable_get('taxonomy_menu_show_'. $vid, TAXONOMY_MENU_NONE) == TAXONOMY_MENU_DEFAULT_TAX) {      elseif (variable_get('taxonomy_menu_show_'. $vid, TAXONOMY_MENU_NONE) == TAXONOMY_MENU_DEFAULT_TAX) {
315    

Legend:
Removed from v.1.2.2.3  
changed lines
  Added in v.1.2.2.4

  ViewVC Help
Powered by ViewVC 1.1.2