You are here

public function sweaver_plugin_styles::sweaver_menu in Sweaver 7

Same name and namespace in other branches
  1. 6 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/config/user-interface/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/config/user-interface/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/config/user-interface/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/config/user-interface/sweaver/styles/delete'] = $base + array(
    'title' => 'Delete style',
    'page arguments' => array(
      $page_arguments,
    ),
    'type' => MENU_CALLBACK,
  );

  // Set to default a style
  $page_arguments['callback_method'] = 'sweaver_style_set_to_default';
  $items['admin/config/user-interface/sweaver/styles/default'] = $base + array(
    'title' => 'Set to default',
    'page arguments' => array(
      $page_arguments,
    ),
    'type' => MENU_CALLBACK,
  );

  // Downlaod a style
  $page_arguments['callback_method'] = 'sweaver_style_export';
  $items['admin/config/user-interface/sweaver/styles/export'] = $base + array(
    'title' => 'Exportation options',
    '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;
}