You are here

function _sweaver_menu in Sweaver 6

Same name and namespace in other branches
  1. 7 sweaver.registry.inc \_sweaver_menu()

Menu items.

1 call to _sweaver_menu()
sweaver_menu in ./sweaver.module
Implementation of 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/settings/sweaver/plugins'] = array(
    'title' => 'Plugins',
    'description' => 'Sweaver plugin settings',
    '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,
    );
    $item = $sweaver_plugin
      ->sweaver_menu($weight, $page_arguments, $base);
    $items += $item;
  }
  return $items;
}