| 1 |
<?php |
<?php |
| 2 |
// $Id: taxonomy_browser.module,v 1.19.2.27 2008/06/16 19:09:14 nancyw Exp $ |
// $Id: taxonomy_browser.module,v 1.19.2.28 2008/06/20 04:08:03 nancyw Exp $ |
| 3 |
// Original by Moshe Weitzman (weitzmna@tejasa.com) |
// Original by Moshe Weitzman (weitzmna@tejasa.com) |
| 4 |
|
|
| 5 |
/** |
/** |
| 174 |
$select[$vocabulary->vid] = $vocabulary->name; |
$select[$vocabulary->vid] = $vocabulary->name; |
| 175 |
} |
} |
| 176 |
|
|
| 177 |
|
$current_vocabs = variable_get('taxonomy_browser_vocabularies', array()); |
| 178 |
|
// Occasionally we get a 0 vid in the array. |
| 179 |
|
unset($current_vocabs[0]); |
| 180 |
|
|
| 181 |
$form['taxonomy_browser_vocabularies'] = array( |
$form['taxonomy_browser_vocabularies'] = array( |
| 182 |
'#title' => t('Included Vocabularies'), |
'#title' => t('Included Vocabularies'), |
| 183 |
'#type' => 'checkboxes', |
'#type' => 'checkboxes', |
| 184 |
'#default_value' => variable_get('taxonomy_browser_vocabularies', array()), |
'#default_value' => $current_vocabs, |
| 185 |
'#options' => $select, |
'#options' => $select, |
| 186 |
'#description' => t('Select the vocabularies the user can select from on the category browser page.'), |
'#description' => t('Select the vocabularies the user can select from on the category browser page.'), |
| 187 |
'#prefix' => '<div class="taxonomy_browser_checkboxes">', |
'#prefix' => '<div class="taxonomy_browser_checkboxes">', |
| 297 |
); |
); |
| 298 |
|
|
| 299 |
$vocabularies = array_filter(variable_get('taxonomy_browser_vocabularies', array())); |
$vocabularies = array_filter(variable_get('taxonomy_browser_vocabularies', array())); |
| 300 |
// drupal_set_message('variable: '. print_r($vocabularies, true)); |
// Occasionally we get a 0 vid in the array. |
| 301 |
|
unset($vocabularies[0]); |
| 302 |
|
|
| 303 |
// Has the admin selected any vocabs? |
// Has the admin selected any vocabs? |
| 304 |
if (count($vocabularies) == 0) { |
if (count($vocabularies) == 0) { |
| 305 |
$vocabs = taxonomy_get_vocabularies(); |
$vocabs = taxonomy_get_vocabularies(); |
| 306 |
foreach ($vocabs as $vocabulary) { |
foreach ($vocabs as $vocabulary) { |
| 307 |
$vocabularies[$vocabulary->vid] = 1; |
$vocabularies[$vocabulary->vid] = 1; |
| 308 |
} |
} |
|
// drupal_set_message('all: '. print_r($vocabularies, true)); |
|
| 309 |
} |
} |
| 310 |
|
|
| 311 |
if ($allow_children) { |
if ($allow_children) { |