You are here

function stringoverrides_menu in String Overrides 5

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

Implementation of hook_menu()

File

./stringoverrides.module, line 43
Configuration interface to provide a quick and easy way of replacing text.

Code

function stringoverrides_menu($may_cache) {
  $items = array();
  if ($may_cache) {
    $items[] = array(
      'path' => 'admin/settings/stringoverrides',
      'title' => t('String overrides'),
      'description' => t('Provides a quick and easy way of replacing text on the site.'),
      'callback' => 'drupal_get_form',
      'callback arguments' => array(
        'stringoverrides_admin',
      ),
      'access' => user_access('administer string overrides'),
      'type' => MENU_NORMAL_ITEM,
    );
    $items[] = array(
      'path' => 'admin/settings/stringoverrides/overrides',
      'title' => t('Overrides'),
      'callback' => 'drupal_get_form',
      'callback arguments' => array(
        'stringoverrides_admin',
      ),
      'access' => user_access('administer string overrides'),
      'type' => MENU_DEFAULT_LOCAL_TASK,
      'weight' => -10,
    );
    $items[] = array(
      'path' => 'admin/settings/stringoverrides/import',
      'title' => t('Import'),
      'callback' => 'drupal_get_form',
      'callback arguments' => array(
        'stringoverrides_admin_import',
      ),
      'access' => user_access('administer string overrides'),
      'type' => MENU_LOCAL_TASK,
    );
    $items[] = array(
      'path' => 'admin/settings/stringoverrides/export',
      'title' => t('Export'),
      'callback' => 'drupal_get_form',
      'callback arguments' => array(
        'stringoverrides_admin_export',
      ),
      'access' => user_access('administer string overrides'),
      'type' => MENU_LOCAL_TASK,
      'weight' => 1,
    );
  }
  elseif (strpos($_GET['q'], 'admin/settings/stringoverrides') === 0) {
    include_once drupal_get_path('module', 'stringoverrides') . '/stringoverrides.admin.inc';
  }
  return $items;
}