You are here

public function sweaver_plugin_styles::sweaver_menu in Sweaver 6

Same name and namespace in other branches
  1. 7 plugins/sweaver_plugin_styles/sweaver_plugin_styles.inc \sweaver_plugin_styles::sweaver_menu()

Menu registry.

Overrides sweaver_plugin::sweaver_menu

File

plugins/sweaver_plugin_styles/sweaver_plugin_styles.inc, line 17
Styles plugin.

Class

sweaver_plugin_styles

Code

public function sweaver_menu(&$weight, $page_arguments, $base) {
  $items = array();
  $page_arguments = array(
    'plugin' => 'sweaver_plugin_styles',
  );

  // Styles administration.
  $items['admin/settings/sweaver/styles'] = $base + array(
    'title' => 'Styles',
    'page arguments' => array(
      $page_arguments,
    ),
    'type' => MENU_LOCAL_TASK,
    'weight' => $weight++,
  );

  // Enable a style
  $page_arguments['callback_method'] = 'sweaver_style_enable';
  $items['admin/settings/sweaver/styles/enable'] = $base + array(
    'title' => 'Enable style',
    'page arguments' => array(
      $page_arguments,
    ),
    'type' => MENU_CALLBACK,
  );

  // Disable a style
  $page_arguments['callback_method'] = 'sweaver_style_disable';
  $items['admin/settings/sweaver/styles/disable'] = $base + array(
    'title' => 'Disable style',
    'page arguments' => array(
      $page_arguments,
    ),
    'type' => MENU_CALLBACK,
  );

  // Delete a style.
  $page_arguments['callback_method'] = 'sweaver_style_confirm_form_delete';
  $items['admin/settings/sweaver/styles/delete'] = $base + array(
    'title' => 'Delete style',
    'page arguments' => array(
      $page_arguments,
    ),
    'type' => MENU_CALLBACK,
  );

  // Autosave callback.
  $base['access arguments'] = array(
    'use editor',
  );
  $page_arguments['callback_method'] = 'sweaver_autosave';
  $items['sweaver-autosave'] = $base + array(
    'title' => 'Autosave',
    'page arguments' => array(
      $page_arguments,
    ),
    'type' => MENU_CALLBACK,
  );
  return $items;
}