You are here

function patterns_menu in Patterns 6

Same name and namespace in other branches
  1. 5 patterns.module \patterns_menu()
  2. 6.2 patterns.module \patterns_menu()
  3. 7.2 patterns.module \patterns_menu()
  4. 7 patterns.module \patterns_menu()

Implementation of hook_menu().

File

./patterns.module, line 35
Enables extremely simple adding/removing features to your site with minimal to no configuration

Code

function patterns_menu() {
  $items = array();
  $items['admin/build/patterns'] = array(
    'title' => 'Patterns',
    'description' => 'Administer patterns available for your site',
    'page callback' => 'patterns_list',
    'access arguments' => array(
      'administer patterns',
    ),
  );
  $items['admin/build/patterns/list'] = array(
    'title' => 'List',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -10,
  );
  $items['admin/build/patterns/edit'] = array(
    'title' => 'Edit Pattern',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'patterns_edit',
    ),
    'access arguments' => array(
      'administer patterns',
    ),
    'type' => MENU_CALLBACK,
  );
  $items['admin/build/patterns/enable'] = array(
    'title' => 'Enable Pattern',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'patterns_enable_pattern',
    ),
    'access arguments' => array(
      'administer patterns',
    ),
    'type' => MENU_CALLBACK,
  );
  $items['admin/build/patterns/publish'] = array(
    'title' => 'Publish Pattern',
    'page callback' => 'patterns_publish_pattern',
    'access arguments' => array(
      'administer patterns',
    ),
    'type' => MENU_CALLBACK,
  );
  $items['admin/build/patterns/unpublish'] = array(
    'title' => 'Unpublish Pattern',
    'page callback' => 'patterns_unpublish_pattern',
    'access arguments' => array(
      'administer patterns',
    ),
    'type' => MENU_CALLBACK,
  );
  $items['patterns.xml'] = array(
    'title' => 'Published Patterns',
    'page callback' => 'patterns_feed',
    'access callback' => TRUE,
    'type' => MENU_CALLBACK,
  );
  $items['admin/build/patterns/settings'] = array(
    'title' => 'Settings',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'patterns_settings',
    ),
    'access arguments' => array(
      'administer patterns',
    ),
    'type' => MENU_LOCAL_TASK,
    'weight' => 10,
  );
  $items['admin/build/patterns/get'] = array(
    'title' => 'Download Pattern Source',
    'page callback' => 'patterns_get_source',
    'access callback' => TRUE,
    'type' => MENU_CALLBACK,
  );

  //     $items[] = array('path' => 'admin/build/patterns/configure',
  //       'title' => t('Configure Pattern'),
  //       'callback' => 'drupal_get_form',
  //       'callback arguments' => array('patterns_configure_pattern'),
  //       'type' => MENU_CALLBACK
  //     );
  //     $items[] = array('path' => 'admin/build/patterns/info',
  //       'title' => t('Pattern Details'),
  //       'callback' => 'patterns_info',
  //       'type' => MENU_CALLBACK
  //     );
  //     $items[] = array('path' => 'admin/build/patterns/disable',
  //       'access' => user_access('administer patterns'),
  //       'title' => t('Disable Pattern'),
  //       'callback' => 'drupal_get_form',
  //       'callback arguments' => array('patterns_disable_pattern'),
  //       'type' => MENU_CALLBACK
  //     );
  $items['admin/build/patterns/modules'] = array(
    'title' => 'Pattern Modules',
    'page callback' => 'patterns_modules_page',
    'access arguments' => array(
      'administer patterns',
    ),
    'type' => MENU_CALLBACK,
  );

  //     $items[] = array('path' => 'admin/build/patterns/revert',
  //       'access' => user_access('administer patterns'),
  //       'title' => t('Revert Pattern'),
  //       'callback' => 'patterns_revert',
  //       'type' => MENU_CALLBACK
  //     );
  $items['admin/build/patterns/import'] = array(
    'title' => 'Import',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'patterns_import_source',
    ),
    'access arguments' => array(
      'administer patterns',
    ),
    'type' => MENU_LOCAL_TASK,
  );
  $items['admin/build/patterns/import/source'] = array(
    'title' => 'Import Source Code',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -10,
  );
  $items['admin/build/patterns/import/file'] = array(
    'title' => 'Import File',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'patterns_import_file',
    ),
    'access arguments' => array(
      'administer patterns',
    ),
    'type' => MENU_LOCAL_TASK,
  );
  $items['admin/build/patterns/import/url'] = array(
    'title' => 'Import from URL',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'patterns_import_url',
    ),
    'access arguments' => array(
      'administer patterns',
    ),
    'type' => MENU_LOCAL_TASK,
  );
  $items['admin/build/patterns/server'] = array(
    'title' => 'Patterns Server',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'patterns_import_server',
    ),
    'access arguments' => array(
      'administer patterns',
    ),
    'type' => MENU_LOCAL_TASK,
    'weight' => -5,
  );
  return $items;
}