You are here

function contemplate_menu in Content Templates (Contemplate) 5

Same name and namespace in other branches
  1. 6 contemplate.module \contemplate_menu()
  2. 7 contemplate.module \contemplate_menu()

Implementation of hook_menu().

File

./contemplate.module, line 48
Create templates to customize teaser and body content.

Code

function contemplate_menu($may_cache) {
  $items = array();
  if ($may_cache) {
    $items[] = array(
      'path' => 'admin/content/templates',
      'title' => t('Content templates'),
      'description' => t('Create templates to customize output of teaser and body content.'),
      'access' => user_access('administer templates'),
      'callback' => 'contemplate_edit_type',
    );
    $items[] = array(
      'path' => 'admin/settings/contemplate',
      'title' => t('Content Template Settings'),
      'callback' => 'drupal_get_form',
      'callback arguments' => array(
        'contemplate_system_settings',
      ),
      'access' => user_access('administer templates'),
    );
  }
  else {
    if (arg(0) == 'admin' && arg(1) == 'content' && arg(2) == 'types' && arg(3)) {
      $access = user_access('administer templates');
      $items[] = array(
        'path' => 'admin/content/types/' . arg(3) . '/template',
        'title' => t('Template'),
        'callback' => 'contemplate_edit_type',
        'access' => $access,
        'callback arguments' => array(
          arg(3),
        ),
        'type' => MENU_LOCAL_TASK,
        'weight' => 7,
      );
    }
  }
  return $items;
}