You are here

function patterns_menu in Patterns 5

Same name and namespace in other branches
  1. 6.2 patterns.module \patterns_menu()
  2. 6 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($may_cache) {
  $items = array();
  if ($may_cache) {
    $items[] = array(
      'path' => 'admin/build/patterns',
      'description' => t('Administer patterns available for your site'),
      'access' => user_access('administer patterns'),
      'title' => t('Patterns'),
      'callback' => 'patterns_list',
      'type' => MENU_NORMAL_ITEM,
    );
    $items[] = array(
      'path' => 'admin/build/patterns/list',
      'title' => t('List'),
      'callback' => 'patterns_list',
      'type' => MENU_DEFAULT_LOCAL_TASK,
      'weight' => -10,
    );

    //     $items[] = array('path' => 'admin/build/patterns/settings',
    //       'title' => t('Settings'),
    //       'callback' => 'drupal_get_form',
    //       'callback arguments' => array('patterns_settings'),
    //       'type' => MENU_LOCAL_TASK,
    //       'weight' => 10
    //     );
    $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/edit',
      'title' => t('Edit Pattern'),
      'callback' => 'drupal_get_form',
      'callback arguments' => array(
        'patterns_edit',
      ),
      '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/enable',
      'access' => user_access('administer patterns'),
      'title' => t('Enable Pattern'),
      'callback' => 'drupal_get_form',
      'callback arguments' => array(
        'patterns_enable_pattern',
      ),
      '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[] = array(
      'path' => 'admin/build/patterns/modules',
      'access' => user_access('administer patterns'),
      'title' => t('Pattern Modules'),
      'callback' => 'patterns_modules_page',
      '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[] = array(
      'path' => 'admin/build/patterns/import',
      'access' => user_access('administer patterns'),
      'title' => t('Import'),
      'callback' => 'drupal_get_form',
      'callback arguments' => array(
        'patterns_import_source',
      ),
      'type' => MENU_LOCAL_TASK,
    );
    $items[] = array(
      'path' => 'admin/build/patterns/import/xmltext',
      'access' => user_access('administer patterns'),
      'title' => t('Import via XML Source'),
      'type' => MENU_DEFAULT_LOCAL_TASK,
    );
    $items[] = array(
      'path' => 'admin/build/patterns/import/xmlfile',
      'access' => user_access('administer patterns'),
      'title' => t('Import via XML File'),
      'callback' => 'drupal_get_form',
      'callback arguments' => array(
        'patterns_import_file',
      ),
      'type' => MENU_LOCAL_TASK,
    );
    $items[] = array(
      'path' => 'admin/build/patterns/import/xmlurl',
      'access' => user_access('administer patterns'),
      'title' => t('Import via XML URL'),
      'callback' => 'drupal_get_form',
      'callback arguments' => array(
        'patterns_import_url',
      ),
      'type' => MENU_LOCAL_TASK,
    );

    //     $items[] = array('path' => 'admin/build/patterns/import/server',
    //       'access' => user_access('administer patterns'),
    //       'title' => t('Import via Patterns Server'),
    //       'callback' => 'drupal_get_form',
    //       'callback arguments' => array('patterns_import_server'),
    //       'type' => MENU_LOCAL_TASK
    //     );
  }
  return $items;
}