You are here

function styleswitcher_menu in Style Switcher 6.2

Same name and namespace in other branches
  1. 7.2 styleswitcher.module \styleswitcher_menu()
  2. 7 styleswitcher.module \styleswitcher_menu()

Implements hook_menu().

File

./styleswitcher.module, line 157
Module's hooks implementations and helper functions.

Code

function styleswitcher_menu() {
  $items['admin/settings/styleswitcher'] = array(
    'title' => 'Styleswitcher',
    'description' => 'Configure Styleswitcher module.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'styleswitcher_admin',
    ),
    'access arguments' => array(
      'administer styleswitcher',
    ),
    'file' => 'styleswitcher.admin.inc',
  );
  $items['admin/settings/styleswitcher/global'] = array(
    'title' => 'Global settings',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -1,
  );
  foreach (list_themes() as $theme) {
    $items['admin/settings/styleswitcher/settings/' . $theme->name] = array(
      'title' => $theme->info['name'],
      'description' => 'Configure theme-specific styles settings.',
      'page callback' => 'drupal_get_form',
      'page arguments' => array(
        'styleswitcher_config_theme',
        4,
      ),
      'access callback' => '_styleswitcher_config_theme_access',
      'access arguments' => array(
        $theme,
      ),
      'type' => MENU_LOCAL_TASK,
      'file' => 'styleswitcher.admin.inc',
    );
  }
  $items['admin/settings/styleswitcher/add'] = array(
    'title' => 'Add style',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'styleswitcher_style_form',
    ),
    'access arguments' => array(
      'administer styleswitcher',
    ),
    'type' => MENU_LOCAL_TASK,
    'file' => 'styleswitcher.admin.inc',
  );
  $items['admin/settings/styleswitcher/custom/%styleswitcher_style'] = array(
    'title' => 'Edit',
    'title callback' => 'styleswitcher_style_title',
    'title arguments' => array(
      4,
    ),
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'styleswitcher_style_form',
      4,
    ),
    'load arguments' => array(
      '',
      'custom',
    ),
    'access arguments' => array(
      'administer styleswitcher',
    ),
    'file' => 'styleswitcher.admin.inc',
  );
  $items['admin/settings/styleswitcher/custom/%styleswitcher_style/edit'] = array(
    'title' => 'Edit',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    // D6 needs load arguments here too.
    'load arguments' => array(
      '',
      'custom',
    ),
  );
  $items['admin/settings/styleswitcher/custom/%styleswitcher_style/delete'] = array(
    'title' => 'Delete',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'styleswitcher_style_delete_form',
      4,
    ),
    'load arguments' => array(
      '',
      'custom',
    ),
    'access arguments' => array(
      'administer styleswitcher',
    ),
    'file' => 'styleswitcher.admin.inc',
  );

  // The theme argument must be set for next routes to know what the page user
  // came from and what theme was used there.
  $items['styleswitcher/switch/%/%/%styleswitcher_style'] = array(
    'title' => 'Styleswitcher',
    'page callback' => 'styleswitcher_switch',
    'page arguments' => array(
      4,
    ),
    'load arguments' => array(
      2,
      3,
    ),
    'access callback' => '_styleswitcher_theme_access',
    'access arguments' => array(
      2,
    ),
    'type' => MENU_CALLBACK,
  );
  $items['styleswitcher/css/%'] = array(
    'title' => 'Styleswitcher',
    'page callback' => 'styleswitcher_css',
    'page arguments' => array(
      2,
    ),
    'access callback' => '_styleswitcher_theme_access',
    'access arguments' => array(
      2,
    ),
    'type' => MENU_CALLBACK,
  );
  return $items;
}