function _sweaver_menu in Sweaver 7
Same name and namespace in other branches
- 6 sweaver.registry.inc \_sweaver_menu()
Menu items.
1 call to _sweaver_menu()
- sweaver_menu in ./
sweaver.module - Implements hook_menu().
File
- ./
sweaver.registry.inc, line 11 - Registry for Sweaver.
Code
function _sweaver_menu() {
$weight = 0;
$items = array();
// The sweaver plugins administration.
$items['admin/config/user-interface/sweaver/plugins'] = array(
'title' => 'Plugins',
'type' => MENU_LOCAL_TASK,
'weight' => 2,
'access arguments' => array(
'configure sweaver',
),
'page callback' => 'drupal_get_form',
'page arguments' => array(
'sweaver_plugin_config_plugins',
),
'file' => 'sweaver.admin.inc',
);
$base = array(
'access arguments' => array(
'configure sweaver',
),
'page callback' => 'sweaver_menu_callback',
);
$sweaver = Sweaver::get_instance();
foreach (array_keys($sweaver
->get_plugins_registry(TRUE)) as $plugin_name) {
$sweaver_plugin = $sweaver
->get_plugin($plugin_name);
$page_arguments = array(
'plugin' => $plugin_name,
);
// Allow drupal to load even if sweaver update process gone wrong
if (is_object($sweaver_plugin)) {
$item = $sweaver_plugin
->sweaver_menu($weight, $page_arguments, $base);
$items += $item;
}
}
return $items;
}