system.module 103 KB
Newer Older
Dries's avatar
 
Dries committed
1
<?php
2
// $Id$
Dries's avatar
 
Dries committed
3

Dries's avatar
 
Dries committed
4 5 6 7 8
/**
 * @file
 * Configuration system that lets administrators modify the workings of the site.
 */

9 10 11
/**
 * The current system version.
 */
12
define('VERSION', '7.0-dev');
13 14 15 16

/**
 * Core API compatibility.
 */
17
define('DRUPAL_CORE_COMPATIBILITY', '7.x');
18

19 20 21
/**
 * Minimum supported version of PHP.
 */
22
define('DRUPAL_MINIMUM_PHP',    '5.2.0');
23

24 25 26 27 28
/**
 * Minimum recommended value of PHP memory_limit.
 */
define('DRUPAL_MINIMUM_PHP_MEMORY_LIMIT',    '16M');

29 30 31
/**
 * Minimum supported version of MySQL, if it is used.
 */
32
define('DRUPAL_MINIMUM_MYSQL',  '5.0');
33 34 35 36

/**
 * Minimum supported version of PostgreSQL, if it is used.
 */
37
define('DRUPAL_MINIMUM_PGSQL',  '8.3');
38 39 40 41

/**
 * Maximum age of temporary files in seconds.
 */
42
define('DRUPAL_MAXIMUM_TEMP_FILE_AGE', 21600);
43

44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
/**
 * New users will be set to the default time zone at registration.
 */
define('DRUPAL_USER_TIMEZONE_DEFAULT', 0);

/**
 * New users will get an empty time zone at registration.
 */
define('DRUPAL_USER_TIMEZONE_EMPTY', 1);

/**
 * New users will select their own timezone at registration.
 */
define('DRUPAL_USER_TIMEZONE_SELECT', 2);

59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
 /**
 * Disabled option on forms and settings
 */
define('DRUPAL_DISABLED', 0);

/**
 * Optional option on forms and settings
 */
define('DRUPAL_OPTIONAL', 1);

/**
 * Required option on forms and settings
 */
define('DRUPAL_REQUIRED', 2);

74 75 76 77 78 79 80 81 82 83 84
/**
 * Return only visible regions. @see system_region_list().
 */
define('REGIONS_VISIBLE', 'visible');

/**
 * Return all visible regions. @see system_region_list().
 */
define('REGIONS_ALL', 'all');


Dries's avatar
 
Dries committed
85
/**
86
 * Implement hook_help().
Dries's avatar
 
Dries committed
87
 */
88
function system_help($path, $arg) {
89 90
  global $base_url;

91
  switch ($path) {
92
    case 'admin/help#system':
93 94
      $output = '<p>' . t('The system module is at the foundation of your Drupal website, and provides basic but extensible functionality for use by other modules and themes. Some integral elements of Drupal are contained in and managed by the system module, including caching, enabling or disabling of modules and themes, preparing and displaying the administrative page, and configuring fundamental site settings. A number of key system maintenance operations are also part of the system module.') . '</p>';
      $output .= '<p>' . t('The system module provides:') . '</p>';
95
      $output .= '<ul><li>' . t('support for enabling and disabling <a href="@modules">modules</a>. Drupal comes packaged with a number of core modules; each module provides a discrete set of features and may be enabled depending on the needs of your site. A wide array of additional modules contributed by members of the Drupal community are available for download at the <a href="@drupal-modules">Drupal.org module page</a>.', array('@modules' => url('admin/structure/modules'), '@drupal-modules' => 'http://drupal.org/project/modules')) . '</li>';
96
      $output .= '<li>' . t('support for enabling and disabling <a href="@themes">themes</a>, which determine the design and presentation of your site. Drupal comes packaged with several core themes and additional contributed themes are available at the <a href="@drupal-themes">Drupal.org theme page</a>.', array('@themes' => url('admin/appearance'), '@drupal-themes' => 'http://drupal.org/project/themes')) . '</li>';
97 98
      $output .= '<li>' . t('a robust <a href="@cache-settings">caching system</a> that allows the efficient re-use of previously-constructed web pages and web page components. Drupal stores the pages requested by anonymous users in a compressed format; depending on your site configuration and the amount of your web traffic tied to anonymous visitors, Drupal\'s caching system may significantly increase the speed of your site.', array('@cache-settings' => url('admin/settings/performance'))) . '</li>';
      $output .= '<li>' . t('a set of routine administrative operations that rely on a correctly-configured <a href="@cron">cron maintenance task</a> to run automatically. A number of other modules, including the feed aggregator, and search also rely on <a href="@cron">cron maintenance tasks</a>. For more information, see the online handbook entry for <a href="@handbook">configuring cron jobs</a>.', array('@cron' => url('admin/reports/status'), '@handbook' => 'http://drupal.org/cron')) . '</li>';
99
      $output .= '<li>' . t('basic configuration options for your site, including <a href="@regional-settings">date and time settings</a>, <a href="@file-system">file system settings</a>, <a href="@clean-url">clean URL support</a>, <a href="@site-info">site name and other information</a>, and a <a href="@maintenance-mode">maintenance mode</a> for taking your site temporarily offline.', array('@regional-settings' => url('admin/settings/regional-settings'), '@file-system' => url('admin/settings/file-system'), '@clean-url' => url('admin/settings/clean-urls'), '@site-info' => url('admin/settings/site-information'), '@maintenance-mode' => url('admin/config/development/maintenance'))) . '</li></ul>';
100
      $output .= '<p>' . t('For more information, see the online handbook entry for <a href="@system">System module</a>.', array('@system' => 'http://drupal.org/handbook/modules/system/')) . '</p>';
101
      return $output;
102
    case 'admin/by-module':
103
      return '<p>' . t('This page shows you all available administration tasks for each module.') . '</p>';
104
    case 'admin/appearance':
105 106
      $output = '<p>' . t('Select which themes are available to your users and specify the default theme. To configure site-wide display settings, click the "configure" task above. Alternatively, to override these settings in a specific theme, click the "configure" link for that theme. Note that different themes may have different regions available for displaying content; for consistency in presentation, you may wish to enable only one theme.') . '</p>';
      $output .= '<p>' . t('To change the appearance of your site, a number of <a href="@themes">contributed themes</a> are available.', array('@themes' => 'http://drupal.org/project/themes')) . '</p>';
107
      return $output;
108
    case 'admin/appearance/settings/' . $arg[4]:
109
      $reference = explode('.', $arg[4], 2);
110
      $theme = array_pop($reference);
111 112
      return '<p>' . t('These options control the display settings for the <code>%template</code> theme. When your site is displayed using this theme, these settings will be used. By clicking "Reset to defaults," you can choose to use the <a href="@global">global settings</a> for this theme.', array('%template' => $theme, '@global' => url('admin/appearance/settings'))) . '</p>';
    case 'admin/appearance/settings':
113
      return '<p>' . t('These options control the default display settings for your entire site, across all themes. Unless they have been overridden by a specific theme, these settings will be used.') . '</p>';
114
    case 'admin/structure/modules':
115 116
      $output = '<p>' . t('Modules are plugins that extend Drupal\'s core functionality. To further extend your site\'s functionality, a number of <a href="@modules">contributed modules</a> are available for download.', array('@permissions' => url('admin/settings/permissions'), '@modules' => 'http://drupal.org/project/modules')) . '</p>';
      $output .= '<p>' . t('Module-related tasks can be located on the <a href="@by-module">administration by module page</a>. New <a href="@permissions">module-related permissions</a> may also become available as new modules are enabled.', array('@by-module' => url('admin/by-module'), '@permissions' => url('admin/settings/permissions'))) . '</p>';
117
      $output .= '<p>' . t('Each time a module is updated, it is important that <a href="@update-php">update.php</a> is run. To help manage the update process, the <em>Update status</em> module, if enabled, provides <a href="@updates">information on new versions of modules (and themes)</a> as they are released. Regular review of the <a href="@updates">available updates page</a> is essential to maintaining a secure and current site.', array('@update-php' => $base_url . '/update.php', '@updates' => url('admin/reports/updates'))) . '</p>';
118
      return $output;
119 120 121
    case 'admin/structure/modules/uninstall':
      return '<p>' . t('The uninstall process removes all data related to a module. To uninstall a module, you must first disable it on the main <a href="@modules">modules page</a>. Not all modules support this feature.', array('@modules' => url('admin/structure/modules'))) . '</p>';
    case 'admin/structure/block/configure':
122
      if ($arg[4] == 'system' && $arg[5] == 'powered-by') {
123
        return '<p>' . t('The <em>Powered by Drupal</em> block is an optional link to the home page of the Drupal project. While there is absolutely no requirement that sites feature this link, it may be used to show support for Drupal.') . '</p>';
124
      }
125
      break;
126
    case 'admin/config/development/maintenance':
127 128 129 130
      global $user;
      if ($user->uid == 1) {
        return '<p>' . t('If you are upgrading to a newer version of Drupal or upgrading contributed modules or themes you may need to run !update-php.', array('!update-php' => l('update.php', 'update.php'))) . '</p>';
      }
131 132
    case 'admin/settings/actions':
    case 'admin/settings/actions/manage':
133 134
      $output = '<p>' . t('Actions are individual tasks that the system can do, such as unpublishing a piece of content or banning a user. Modules, such as the trigger module, can fire these actions when certain system events happen; for example, when a new post is added or when a user logs in. Modules may also provide additional actions.') . '</p>';
      $output .= '<p>' . t('There are two types of actions: simple and advanced. Simple actions do not require any additional configuration, and are listed here automatically. Advanced actions can do more than simple actions; for example, send an e-mail to a specified address, or check for certain words within a piece of content. These actions need to be created and configured first before they may be used. To create an advanced action, select the action from the drop-down below and click the <em>Create</em> button.') . '</p>';
135
      if (module_exists('trigger')) {
136
        $output .= '<p>' . t('You may proceed to the <a href="@url">Triggers</a> page to assign these actions to system events.', array('@url' => url('admin/structure/trigger'))) . '</p>';
137
      }
138
      return $output;
139 140
    case 'admin/settings/actions/configure':
      return t('An advanced action offers additional configuration options which may be filled out below. Changing the <em>Description</em> field is recommended, in order to better identify the precise action taking place. This description will be displayed in modules such as the trigger module when assigning actions to system events, so it is best if it is as descriptive as possible (for example, "Send e-mail to Moderation Team" rather than simply "Send e-mail").');
141
    case 'admin/settings/ip-blocking':
142
      return '<p>' . t('IP addresses listed here are blocked from your site before any modules are loaded. You may add IP addresses to the list, or delete existing entries.') . '</p>';
143
    case 'admin/reports/status':
144
      return '<p>' . t("Here you can find a short overview of your site's parameters as well as any problems detected with your installation. It may be useful to copy and paste this information into support requests filed on drupal.org's support forums and project issue queues.") . '</p>';
145
  }
Dries's avatar
 
Dries committed
146 147
}

148
/**
149
 * Implement hook_theme().
150
 */
151
function system_theme() {
152
  return array_merge(drupal_common_theme(), array(
153 154
    'system_themes_form' => array(
      'arguments' => array('form' => NULL),
155
      'file' => 'system.admin.inc',
156
    ),
157
    'system_modules_fieldset' => array(
158
      'arguments' => array('form' => NULL),
159
      'file' => 'system.admin.inc',
160
    ),
161 162
    'system_modules_incompatible' => array(
      'arguments' => array('message' => NULL),
163
      'file' => 'system.admin.inc',
164
    ),
165 166
    'system_modules_uninstall' => array(
      'arguments' => array('form' => NULL),
167
      'file' => 'system.admin.inc',
168 169 170
    ),
    'status_report' => array(
      'arguments' => array('requirements' => NULL),
171
      'file' => 'system.admin.inc',
172 173 174
    ),
    'admin_page' => array(
      'arguments' => array('blocks' => NULL),
175
      'file' => 'system.admin.inc',
176 177 178
    ),
    'admin_block' => array(
      'arguments' => array('block' => NULL),
179
      'file' => 'system.admin.inc',
180 181 182
    ),
    'admin_block_content' => array(
      'arguments' => array('content' => NULL),
183
      'file' => 'system.admin.inc',
184 185 186
    ),
    'system_admin_by_module' => array(
      'arguments' => array('menu_items' => NULL),
187
      'file' => 'system.admin.inc',
188
    ),
189 190 191
    'system_powered_by' => array(
      'arguments' => array('image_path' => NULL),
    ),
192 193 194 195 196 197
    'meta_generator_html' => array(
      'arguments' => array('version' => NULL),
    ),
    'meta_generator_header' => array(
      'arguments' => array('version' => NULL),
    ),
198
    'system_compact_link' => array(),
199 200
  ));
}
201

Dries's avatar
 
Dries committed
202
/**
203
 * Implement hook_permission().
Dries's avatar
 
Dries committed
204
 */
205
function system_permission() {
206
  return array(
207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234
    'administer site configuration' => array(
      'title' => t('Administer site configuration'),
      'description' => t('Configure site-wide settings such as module or theme administration settings.'),
    ),
    'administer actions' => array(
      'title' => t('Administer actions'),
      'description' => t('Manage the actions defined for your site.'),
    ),
    'administer files' => array(
      'title' => t('Administer files'),
      'description' => t('Manage user-uploaded files.'),
    ),
    'access administration pages' => array(
      'title' => t('Access administration pages'),
      'description' => t('View the administration panel and browse the help system.'),
    ),
    'access site reports' => array(
      'title' => t('Access site reports'),
      'description' => t('View reports from system logs and other status information.'),
    ),
    'select different theme' => array(
      'title' => t('Select different theme'),
      'description' => t('Select a theme other than the default theme set by the site administrator.'),
    ),
    'block IP addresses' => array(
      'title' => t('Block IP addresses'),
      'description' => t('Block IP addresses from accessing your site.'),
    ),
235
  );
Dries's avatar
 
Dries committed
236 237
}

238
/**
239
 * Implement hook_rdf_namespaces().
240 241 242 243 244 245 246 247 248 249 250 251 252
 */
function system_rdf_namespaces() {
  return array(
    'admin'    => 'http://webns.net/mvcb/',
    'content'  => 'http://purl.org/rss/1.0/modules/content/',
    'dc'       => 'http://purl.org/dc/elements/1.1/',
    'dcterms'  => 'http://purl.org/dc/terms/',
    'foaf'     => 'http://xmlns.com/foaf/0.1/',
    'owl'      => 'http://www.w3.org/2002/07/owl#',
    'rdf'      => 'http://www.w3.org/1999/02/22-rdf-syntax-ns#',
    'rdfs'     => 'http://www.w3.org/2000/01/rdf-schema#',
    'rss'      => 'http://purl.org/rss/1.0/',
    'sioc'     => 'http://rdfs.org/sioc/ns#',
253
    'xsd'      => 'http://www.w3.org/2001/XMLSchema',
254 255 256
  );
}

257
/**
258
 * Implement hook_elements().
259 260 261
 */
function system_elements() {
  // Top level form
262 263 264
  $type['form'] = array(
    '#method' => 'post',
    '#action' => request_uri(),
265
    '#theme_wrappers' => array('form'),
266 267
  );

268 269 270 271 272 273 274 275 276 277 278 279 280
  $type['page'] = array(
    '#show_messages' => TRUE,
    '#show_blocks' => TRUE,
    '#theme' => 'page',
  );

  $type['list'] = array(
    '#title' => '',
    '#list_type' => 'ul',
    '#attributes' => array(),
    '#items' => array(),
  );

281 282 283 284 285 286 287 288
  /**
   * Input elements.
   */
  $type['submit'] = array(
    '#input' => TRUE,
    '#name' => 'op',
    '#button_type' => 'submit',
    '#executes_submit_callback' => TRUE,
289
    '#process' => array('form_process_ahah'),
290
    '#theme_wrappers' => array('button'),
291 292 293 294 295 296 297
  );

  $type['button'] = array(
    '#input' => TRUE,
    '#name' => 'op',
    '#button_type' => 'submit',
    '#executes_submit_callback' => FALSE,
298
    '#process' => array('form_process_ahah'),
299
    '#theme_wrappers' => array('button'),
300 301 302 303 304 305
  );

  $type['image_button'] = array(
    '#input' => TRUE,
    '#button_type' => 'submit',
    '#executes_submit_callback' => TRUE,
306
    '#process' => array('form_process_ahah'),
307 308 309
    '#return_value' => TRUE,
    '#has_garbage_value' => TRUE,
    '#src' => NULL,
310
    '#theme_wrappers' => array('image_button'),
311 312 313 314 315 316 317
  );

  $type['textfield'] = array(
    '#input' => TRUE,
    '#size' => 60,
    '#maxlength' => 128,
    '#autocomplete_path' => FALSE,
318
    '#process' => array('form_process_text_format', 'form_process_ahah'),
319
    '#theme' => 'textfield',
320
    '#theme_wrappers' => array('form_element'),
321 322 323 324 325 326
  );

  $type['password'] = array(
    '#input' => TRUE,
    '#size' => 60,
    '#maxlength' => 128,
327
    '#process' => array('form_process_ahah'),
328
    '#theme' => 'password',
329
    '#theme_wrappers' => array('form_element'),
330 331 332 333
  );

  $type['password_confirm'] = array(
    '#input' => TRUE,
334
    '#process' => array('form_process_password_confirm'),
335
    '#theme_wrappers' => array('form_element'),
336 337 338 339 340 341 342
  );

  $type['textarea'] = array(
    '#input' => TRUE,
    '#cols' => 60,
    '#rows' => 5,
    '#resizable' => TRUE,
343
    '#process' => array('form_process_text_format', 'form_process_ahah'),
344
    '#theme' => 'textarea',
345
    '#theme_wrappers' => array('form_element'),
346 347 348 349
  );

  $type['radios'] = array(
    '#input' => TRUE,
350
    '#process' => array('form_process_radios'),
351
    '#theme_wrappers' => array('radios'),
352
    '#pre_render' => array('form_pre_render_conditional_form_element'),
353 354 355 356 357
  );

  $type['radio'] = array(
    '#input' => TRUE,
    '#default_value' => NULL,
358
    '#process' => array('form_process_ahah'),
359
    '#theme' => 'radio',
360
    '#theme_wrappers' => array('form_element'),
361
    '#form_element_skip_title' => TRUE,
362 363 364 365 366
  );

  $type['checkboxes'] = array(
    '#input' => TRUE,
    '#tree' => TRUE,
367
    '#process' => array('form_process_checkboxes'),
368
    '#theme_wrappers' => array('checkboxes'),
369
    '#pre_render' => array('form_pre_render_conditional_form_element'),
370 371 372 373 374
  );

  $type['checkbox'] = array(
    '#input' => TRUE,
    '#return_value' => 1,
375
    '#process' => array('form_process_ahah'),
376
    '#theme' => 'checkbox',
377
    '#theme_wrappers' => array('form_element'),
378
    '#form_element_skip_title' => TRUE,
379 380 381 382 383 384
  );

  $type['select'] = array(
    '#input' => TRUE,
    '#size' => 0,
    '#multiple' => FALSE,
385
    '#process' => array('form_process_ahah'),
386
    '#theme' => 'select',
387
    '#theme_wrappers' => array('form_element'),
388 389 390 391 392 393
  );

  $type['weight'] = array(
    '#input' => TRUE,
    '#delta' => 10,
    '#default_value' => 0,
394
    '#process' => array('form_process_weight', 'form_process_ahah'),
395 396 397 398 399
  );

  $type['date'] = array(
    '#input' => TRUE,
    '#element_validate' => array('date_validate'),
400
    '#process' => array('form_process_date'),
401
    '#theme' => 'date',
402
    '#theme_wrappers' => array('form_element'),
403 404 405 406 407
  );

  $type['file'] = array(
    '#input' => TRUE,
    '#size' => 60,
408
    '#theme' => 'file',
409
    '#theme_wrappers' => array('form_element'),
410
  );
411

412 413 414 415 416 417 418
  $type['tableselect'] = array(
    '#input' => TRUE,
    '#js_select' => TRUE,
    '#multiple' => TRUE,
    '#process' => array('form_process_tableselect'),
    '#options' => array(),
    '#empty' => '',
419
    '#theme' => 'tableselect'
420
  );
421 422 423 424 425

  /**
   * Form structure.
   */
  $type['item'] = array(
426
    '#markup' => '',
427
    '#theme' => 'markup',
428
    '#theme_wrappers' => array('form_element'),
429 430 431 432
  );

  $type['hidden'] = array(
    '#input' => TRUE,
433
    '#process' => array('form_process_ahah'),
434
    '#theme' => 'hidden',
435 436 437 438 439 440 441
  );

  $type['value'] = array(
    '#input' => TRUE,
  );

  $type['markup'] = array(
442 443
    '#markup' => '',
    '#theme' => 'markup',
444 445 446 447 448 449
  );

  $type['fieldset'] = array(
    '#collapsible' => FALSE,
    '#collapsed' => FALSE,
    '#value' => NULL,
450 451
    '#process' => array('form_process_fieldset', 'form_process_ahah'),
    '#pre_render' => array('form_pre_render_fieldset'),
452
    '#theme_wrappers' => array('fieldset'),
453 454
  );

455
  $type['vertical_tabs'] = array(
456
    '#theme_wrappers' => array('vertical_tabs'),
457 458 459 460
    '#default_tab' => '',
    '#process' => array('form_process_vertical_tabs'),
  );

461 462
  $type['token'] = array(
    '#input' => TRUE,
463
    '#theme' => array('hidden'),
464 465
  );

466 467 468
  return $type;
}

Dries's avatar
 
Dries committed
469
/**
470
 * Implement hook_menu().
Dries's avatar
 
Dries committed
471
 */
472 473
function system_menu() {
  $items['system/files'] = array(
474
    'title' => 'File download',
475 476
    'page callback' => 'file_download',
    'access callback' => TRUE,
477 478 479 480 481 482
    'type' => MENU_CALLBACK,
  );
  $items['system/ahah'] = array(
    'title' => 'AHAH callback',
    'page callback' => 'form_ahah_callback',
    'access callback' => TRUE,
483 484
    'type' => MENU_CALLBACK,
  );
485 486 487 488 489 490
  $items['system/timezone'] = array(
    'title' => 'Time zone',
    'page callback' => 'system_timezone',
    'access callback' => TRUE,
    'type' => MENU_CALLBACK,
  );
491
  $items['admin'] = array(
492
    'title' => 'Administer',
493 494 495
    'access arguments' => array('access administration pages'),
    'page callback' => 'system_main_admin_page',
    'weight' => 9,
496
    'menu_name' => 'management',
497 498
  );
  $items['admin/compact'] = array(
499
    'title' => 'Compact mode',
500
    'page callback' => 'system_admin_compact_page',
501
    'access arguments' => array('access administration pages'),
502 503 504
    'type' => MENU_CALLBACK,
  );
  $items['admin/by-task'] = array(
505
    'title' => 'By task',
506
    'page callback' => 'system_main_admin_page',
507
    'access arguments' => array('access administration pages'),
508 509 510
    'type' => MENU_DEFAULT_LOCAL_TASK,
  );
  $items['admin/by-module'] = array(
511
    'title' => 'By module',
512
    'page callback' => 'system_admin_by_module',
513
    'access arguments' => array('access administration pages'),
514 515 516
    'type' => MENU_LOCAL_TASK,
    'weight' => 2,
  );
517

518
  // Menu items that are basically just menu blocks.
519
  $items['admin/settings'] = array(
520
    'title' => 'Site configuration',
521
    'description' => 'Configure site settings.',
522
    'position' => 'right',
523
    'weight' => -2,
524
    'page callback' => 'system_settings_overview',
525 526
    'access callback' => 'system_admin_menu_block_access',
    'access arguments' => array('admin/settings', 'access administration pages'),
527
  );
528 529 530 531 532 533 534
  $items['admin/config'] = array(
    'title' => 'Configuration and modules',
    'page callback' => 'system_admin_config_page',
    'position' => 'right',
    'access callback' => array('system_admin_menu_block_access'),
    'access arguments' => array('admin/config', 'access administration pages'),
  );
535 536
  $items['admin/structure'] = array(
    'title' => 'Structure',
537
    'description' => 'Control how your site looks and feels.',
538
    'position' => 'right',
539
    'weight' => -8,
540
    'page callback' => 'system_admin_menu_block_page',
541
    'access callback' => 'system_admin_menu_block_access',
542
    'access arguments' => array('admin/structure', 'access administration pages'),
543
  );
544 545 546
  // Appearance.
  $items['admin/appearance'] = array(
    'title' => 'Appearance',
547
    'page callback' => 'drupal_get_form',
548
    'page arguments' => array('system_themes_form'),
549
    'access arguments' => array('administer site configuration'),
550
    'weight' => -6,
551
  );
552
  $items['admin/appearance/select'] = array(
553
    'title' => 'List',
554
    'description' => 'Select the default theme for your site.',
555 556 557
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -1,
  );
558
  $items['admin/appearance/settings'] = array(
559
    'title' => 'Configure',
560
    'page arguments' => array('system_theme_settings'),
561
    'access arguments' => array('administer site configuration'),
562 563
    'type' => MENU_LOCAL_TASK,
  );
564
  // Theme configuration subtabs.
565
  $items['admin/appearance/settings/global'] = array(
566
    'title' => 'Global settings',
567 568 569
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -1,
  );
Dries's avatar
 
Dries committed
570

571
  foreach (list_themes() as $theme) {
572
    $items['admin/appearance/settings/' . $theme->name] = array(
573 574 575 576 577 578
      'title' => $theme->info['name'],
      'page arguments' => array('system_theme_settings', $theme->name),
      'type' => MENU_LOCAL_TASK,
      'access callback' => '_system_themes_access',
      'access arguments' => array($theme),
    );
Dries's avatar
 
Dries committed
579
  }
drumm's avatar
drumm committed
580

581
  // Modules.
582
  $items['admin/structure/modules'] = array(
583 584
    'title' => 'Modules',
    'description' => 'Enable or disable add-on modules for your site.',
585 586
    'page callback' => 'drupal_get_form',
    'page arguments' => array('system_modules'),
587
    'access arguments' => array('administer site configuration'),
588
  );
589
  $items['admin/structure/modules/list'] = array(
590
    'title' => 'List',
591 592
    'type' => MENU_DEFAULT_LOCAL_TASK,
  );
593
  $items['admin/structure/modules/list/confirm'] = array(
594
    'title' => 'List',
595
    'access arguments' => array('administer site configuration'),
596 597
    'type' => MENU_CALLBACK,
  );
598
  $items['admin/structure/modules/uninstall'] = array(
599
    'title' => 'Uninstall',
600
    'page arguments' => array('system_modules_uninstall'),
601
    'access arguments' => array('administer site configuration'),
602 603
    'type' => MENU_LOCAL_TASK,
  );
604
  $items['admin/structure/modules/uninstall/confirm'] = array(
605
    'title' => 'Uninstall',
606
    'access arguments' => array('administer site configuration'),
607 608
    'type' => MENU_CALLBACK,
  );
Dries's avatar
 
Dries committed
609

610 611 612 613 614 615 616 617 618 619 620
  // Development menu category.
  $items['admin/development'] = array(
    'title' => 'Development',
    'description' => 'Development tools.',
    'position' => 'right',
    'weight' => -7,
    'page callback' => 'system_admin_menu_block_page',
    'access callback' => 'system_admin_menu_block_access',
    'access arguments' => array('admin/development', 'access administration pages'),
  );

621
  // Actions.
622
  $items['admin/settings/actions'] = array(
623 624 625 626 627
    'title' => 'Actions',
    'description' => 'Manage the actions defined for your site.',
    'access arguments' => array('administer actions'),
    'page callback' => 'system_actions_manage'
  );
628
  $items['admin/settings/actions/manage'] = array(
629 630 631 632 633 634
    'title' => 'Manage actions',
    'description' => 'Manage the actions defined for your site.',
    'page callback' => 'system_actions_manage',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -2,
  );
635 636
  $items['admin/settings/actions/configure'] = array(
    'title' => 'Configure an advanced action',
637 638
    'page callback' => 'drupal_get_form',
    'page arguments' => array('system_actions_configure'),
639
    'access arguments' => array('administer actions'),
640 641
    'type' => MENU_CALLBACK,
  );
642
  $items['admin/settings/actions/delete/%actions'] = array(
643 644 645 646
    'title' => 'Delete action',
    'description' => 'Delete an action.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('system_actions_delete_form', 4),
647
    'access arguments' => array('administer actions'),
648 649
    'type' => MENU_CALLBACK,
  );
650
  $items['admin/settings/actions/orphan'] = array(
651 652
    'title' => 'Remove orphans',
    'page callback' => 'system_actions_remove_orphans',
653
    'access arguments' => array('administer actions'),
654 655 656
    'type' => MENU_CALLBACK,
  );

657 658 659 660 661 662 663
  // IP address blocking.
  $items['admin/settings/ip-blocking'] = array(
    'title' => 'IP address blocking',
    'description' => 'Manage blocked IP addresses.',
    'page callback' => 'system_ip_blocking',
    'access arguments' => array('block IP addresses'),
  );
664 665 666 667 668 669 670
  $items['admin/settings/ip-blocking/%'] = array(
    'title' => 'IP address blocking',
    'description' => 'Manage blocked IP addresses.',
    'page callback' => 'system_ip_blocking',
    'access arguments' => array('block IP addresses'),
    'type' => MENU_CALLBACK,
  );
671 672 673 674 675 676 677 678
  $items['admin/settings/ip-blocking/delete/%blocked_ip'] = array(
    'title' => 'Delete IP address',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('system_ip_blocking_delete', 4),
    'access arguments' => array('block IP addresses'),
    'type' => MENU_CALLBACK,
  );

679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696
  // Configuration.
  $items['admin/config/development'] = array(
   'title' => 'Development',
   'description' => 'Development tools.',
   'position' => 'left',
   'weight' => 10,
   'page callback' => 'system_admin_menu_block_page',
   'access callback' => 'system_admin_menu_block_access',
   'access arguments' => array('admin/config/development', 'access administration pages'),
  );
  $items['admin/config/development/maintenance'] = array(
    'title' => 'Maintenance mode',
    'description' => 'Take the site offline for maintenance or bring it back online.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('system_site_maintenance_mode'),
    'access arguments' => array('administer site configuration'),
  );

697
  // Settings.
698
  $items['admin/settings/site-information'] = array(
699 700
    'title' => 'Site information',
    'description' => 'Change basic site information, such as the site name, slogan, e-mail address, mission, front page and more.',
701 702
    'page callback' => 'drupal_get_form',
    'page arguments' => array('system_site_information_settings'),
703
    'access arguments' => array('administer site configuration'),
704
  );
705
  $items['admin/settings/logging'] = array(
706
    'title' => 'Logging and errors',
707
    'description' => "Settings for logging and alerts modules. Various modules can route Drupal's system events to different destinations, such as syslog, database, email, etc.",
708
    'page callback' => 'drupal_get_form',
709
    'page arguments' => array('system_logging_settings'),
710
    'access arguments' => array('administer site configuration'),
711
  );
712 713
  $items['admin/settings/logging/settings'] = array(
    'title' => 'Settings',
714
    'access arguments' => array('administer site configuration'),
715 716
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -1,
717
  );
718
  $items['admin/settings/performance'] = array(
719
    'title' => 'Performance',
720
    'description' => 'Enable or disable page caching for anonymous users and set CSS and JS bandwidth optimization options.',
721 722
    'page callback' => 'drupal_get_form',
    'page arguments' => array('system_performance_settings'),
723
    'access arguments' => array('administer site configuration'),
724 725
  );
  $items['admin/settings/file-system'] = array(
726 727
    'title' => 'File system',
    'description' => 'Tell Drupal where to store uploaded files and how they are accessed.',
728 729
    'page callback' => 'drupal_get_form',
    'page arguments' => array('system_file_system_settings'),
730
    'access arguments' => array('administer site configuration'),
731 732
  );
  $items['admin/settings/image-toolkit'] = array(
733 734
    'title' => 'Image toolkit',
    'description' => 'Choose which image toolkit to use if you have installed optional toolkits.',
735 736
    'page callback' => 'drupal_get_form',
    'page arguments' => array('system_image_toolkit_settings'),
737
    'access arguments' => array('administer site configuration'),
738
  );
739
  $items['admin/settings/rss-publishing'] = array(
740
    'title' => 'RSS publishing',
741
    'description' => 'Configure the site description, the number of items per feed and whether feeds should be titles/teasers/full-text.',
742 743
    'page callback' => 'drupal_get_form',
    'page arguments' => array('system_rss_feeds_settings'),
744
    'access arguments' => array('administer site configuration'),
745
  );
746 747
  $items['admin/settings/regional-settings'] = array(
    'title' => 'Regional settings',
748
    'description' => "Settings for how Drupal displays date and time, as well as the system's default time zone.",
749
    'page callback' => 'drupal_get_form',
750
    'page arguments' => array('system_regional_settings'),
751
    'access arguments' => array('administer site configuration'),
752
  );
753
  $items['admin/settings/regional-settings/lookup'] = array(
754
    'title' => 'Date and time lookup',
755 756
    'type' => MENU_CALLBACK,
    'page callback' => 'system_date_time_lookup',
757
    'access arguments' => array('administer site configuration'),
758
  );
759
  $items['admin/settings/clean-urls'] = array(
760 761
    'title' => 'Clean URLs',
    'description' => 'Enable or disable clean URLs for your site.',
762 763
    'page callback' => 'drupal_get_form',
    'page arguments' => array('system_clean_url_settings'),
764
    'access arguments' => array('administer site configuration'),
765
  );
766 767 768 769 770 771 772
  $items['admin/settings/clean-urls/check'] = array(
    'title' => 'Clean URL check',
    'page callback' => 'drupal_json',
    'page arguments' => array(array('status' => TRUE)),
    'access callback' => TRUE,
    'type' => MENU_CALLBACK,
  );
773

774
  // Reports.
775 776 777
  $items['admin/reports'] = array(
    'title' => 'Reports',
    'description' => 'View reports from system logs and other status information.',
778
    'page callback' => 'system_admin_menu_block_page',
779 780
    'access callback' => 'system_admin_menu_block_access',
    'access arguments' => array('admin/reports', 'access site reports'),
781 782 783
    'weight' => 5,
    'position' => 'left',
  );
784
  $items['admin/reports/status'] = array(
785 786
    'title' => 'Status report',
    'description' => "Get a status report about your site's operation and any detected problems.",
787 788 789 790
    'page callback' => 'system_status',
    'weight' => 10,
    'access arguments' => array('administer site configuration'),
  );
791
  $items['admin/reports/status/run-cron'] = array(
792
    'title' => 'Run cron',
793
    'page callback' => 'system_run_cron',
794
    'access arguments' => array('administer site configuration'),
795 796
    'type' => MENU_CALLBACK,
  );
797
  $items['admin/reports/status/php'] = array(
798
    'title' => 'PHP',
799
    'page callback' => 'system_php',
800
    'access arguments' => array('administer site configuration'),
801 802
    'type' => MENU_CALLBACK,
  );
803
  // Default page for batch operations.
804 805 806 807 808
  $items['batch'] = array(
    'page callback' => 'system_batch_page',
    'access callback' => TRUE,
    'type' => MENU_CALLBACK,
  );
Dries's avatar
 
Dries committed
809
  return $items;
Dries's avatar
 
Dries committed
810 811
}

812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075