| 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> |
| 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 |
| 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 |
| 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 |
| 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 |
|
|