contact_menu

Хочешь помочь с переводом? Это очень просто и быстро. Лишь зарегистрируйся, и можешь тут же начать переводить.

modules/contact/contact.module, строка 42

Версии
5
contact_menu($may_cache)
6
contact_menu()

Реализация hook_menu().

Код

<?php
function contact_menu($may_cache) {
  $items = array();
  if ($may_cache) {
    $items[] = array('path' => 'admin/build/contact',
      'title' => t('Contact form'),
      'description' => t('Create a system contact form and set up categories for the form to use.'),
      'callback' => 'contact_admin_categories',
      'access' => user_access('administer site configuration'),
    );
    $items[] = array('path' => 'admin/build/contact/list',
      'title' => t('List'),
      'callback' => 'contact_admin_categories',
      'access' => user_access('administer site configuration'),
      'type' => MENU_DEFAULT_LOCAL_TASK,
    );
    $items[] = array('path' => 'admin/build/contact/add',
      'title' => t('Add category'),
      'callback' => 'drupal_get_form',
      'callback arguments' => array('contact_admin_edit'),
      'access' => user_access('administer site configuration'),
      'type' => MENU_LOCAL_TASK,
      'weight' => 1,
    );
    $items[] = array('path' => 'admin/build/contact/edit',
      'title' => t('Edit contact category'),
      'callback' => 'drupal_get_form',
      'callback arguments' => array('contact_admin_edit'),
      'access' => user_access('administer site configuration'),
      'type' => MENU_CALLBACK,
    );
    $items[] = array('path' => 'admin/build/contact/delete',
      'title' => t('Delete contact'),
      'callback' => 'drupal_get_form',
      'callback arguments' => array('contact_admin_delete'),
      'access' => user_access('administer site configuration'),
      'type' => MENU_CALLBACK,
    );
    $items[] = array('path' => 'admin/build/contact/settings',
      'title' => t('Settings'),
      'callback' => 'drupal_get_form',
      'callback arguments' => array('contact_admin_settings'),
      'access' => user_access('administer site configuration'),
      'type' => MENU_LOCAL_TASK,
      'weight' => 2,
    );
    $items[] = array('path' => 'contact',
      'title' => t('Contact'),
      'callback' => 'contact_site_page',
      'access' => user_access('access site-wide contact form'),
      'type' => MENU_SUGGESTED_ITEM,
    );
  }
  else {
    if (arg(0) == 'user' && is_numeric(arg(1))) {
      global $user;
      $account = user_load(array('uid' => arg(1)));
      if (($user->uid != $account->uid && $account->contact) || user_access('administer users')) {
        $items[] = array('path' => 'user/'. arg(1) .'/contact',
          'title' => t('Contact'),
          'callback' => 'contact_user_page',
          'type' => MENU_LOCAL_TASK,
          'access' => $user->uid,
          'weight' => 2,
        );
      }
    }
  }

  return $items;
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии

Вход в систему