public function PowerMenuTaxonomyHandler::configurationForm in Power Menu 7.2
Overrides PowerMenuHandlerInterface::configurationForm
See also
PowerMenuHandlerInterface::configurationForm()
File
- plugins/
menu_handlers/ PowerMenuTaxonomyHandler.class.php, line 13
Class
- PowerMenuTaxonomyHandler
- Implementation of the interface PowerMenuHandlerInterface.
Code
public function configurationForm() {
$form = array();
$form['note'] = array(
'#markup' => '<p><strong>' . t('Choose the vocabulary which is going to reflect the structure of your menu.') . '</strong></p><p>' . t('You
can associate each taxonomy therm from the selected vocabulary to a menu link. Has an entity a taxonomy term from this vocabulary associated,
the plugin sets the active trail to the menu link associated with this taxonomy term.') . '</p>',
);
$taxonomies = taxonomy_get_vocabularies();
$options = array();
foreach ($taxonomies as $value) {
$options[$value->vid] = $value->name;
}
$vocabulary = variable_get('power_menu_taxonomy_vocabulary', array(
'vid' => NULL,
'machine_name' => NULL,
));
$form['power_menu_taxonomy']['vocabulary'] = array(
'#type' => 'select',
'#options' => $options,
'#default_value' => $vocabulary['vid'],
);
$form['power_menu_taxonomy']['default_enable_create_term'] = array(
'#title' => t('Enable creating a new term when making a new menu link, otherwise it must be enabled first'),
'#description' => t('Always enable the term creation when creating a new menu link.'),
'#type' => 'checkbox',
'#default_value' => variable_get('power_menu_taxonomy_default_enable_create_term', TRUE),
);
$form['power_menu_taxonomy']['create_term_always'] = array(
'#title' => t('Create always new terms'),
'#description' => t('Do always create a new term, also when a term with the name of the menu-item exists in the selected vocabulary.'),
'#type' => 'checkbox',
'#default_value' => variable_get('power_menu_taxonomy_create_term_always', FALSE),
);
$form['power_menu_taxonomy']['force_term_selection'] = array(
'#title' => t('Force term selection'),
'#description' => t('Always force the user to select a term or create a new one, on menu item creation or update.'),
'#type' => 'checkbox',
'#default_value' => variable_get('power_menu_taxonomy_force_term_selection', TRUE),
);
$form['power_menu_taxonomy']['show_menu_link_info'] = array(
'#title' => t('Show associated menu-link information'),
'#description' => t('Show the associated menu-link information on the term overview page.'),
'#type' => 'checkbox',
'#default_value' => variable_get('power_menu_taxonomy_show_menu_link_info', FALSE),
);
return $form;
}