system.module 104 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/settings/maintenance-mode'))) . '</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 127 128 129 130
    case 'admin/settings/maintenance-mode':
      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_theme_select_form' => array(
      'arguments' => array('form' => NULL),
155
      'file' => 'system.admin.inc',
156 157 158
    ),
    'system_themes_form' => array(
      'arguments' => array('form' => NULL),
159
      'file' => 'system.admin.inc',
160
    ),
161
    'system_modules_fieldset' => array(
162
      'arguments' => array('form' => NULL),
163
      'file' => 'system.admin.inc',
164
    ),
165 166
    'system_modules_incompatible' => array(
      'arguments' => array('message' => NULL),
167
      'file' => 'system.admin.inc',
168
    ),
169 170
    'system_modules_uninstall' => array(
      'arguments' => array('form' => NULL),
171
      'file' => 'system.admin.inc',
172 173 174
    ),
    'status_report' => array(
      'arguments' => array('requirements' => NULL),
175
      'file' => 'system.admin.inc',
176 177 178
    ),
    'admin_page' => array(
      'arguments' => array('blocks' => NULL),
179
      'file' => 'system.admin.inc',
180 181 182
    ),
    'admin_block' => array(
      'arguments' => array('block' => NULL),
183
      'file' => 'system.admin.inc',
184 185 186
    ),
    'admin_block_content' => array(
      'arguments' => array('content' => NULL),
187
      'file' => 'system.admin.inc',
188 189 190
    ),
    'system_admin_by_module' => array(
      'arguments' => array('menu_items' => NULL),
191
      'file' => 'system.admin.inc',
192
    ),
193 194 195
    'system_powered_by' => array(
      'arguments' => array('image_path' => NULL),
    ),
196 197 198 199 200 201
    'meta_generator_html' => array(
      'arguments' => array('version' => NULL),
    ),
    'meta_generator_header' => array(
      'arguments' => array('version' => NULL),
    ),
202
    'system_compact_link' => array(),
203 204
  ));
}
205

Dries's avatar
 
Dries committed
206
/**
207
 * Implement hook_permission().
Dries's avatar
 
Dries committed
208
 */
209
function system_permission() {
210
  return array(
211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238
    '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.'),
    ),
239
  );
Dries's avatar
 
Dries committed
240 241
}

242
/**
243
 * Implement hook_rdf_namespaces().
244 245 246 247 248 249 250 251 252 253 254 255 256
 */
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#',
257
    'xsd'      => 'http://www.w3.org/2001/XMLSchema',
258 259 260
  );
}

261
/**
262
 * Implement hook_elements().
263 264 265
 */
function system_elements() {
  // Top level form
266 267 268
  $type['form'] = array(
    '#method' => 'post',
    '#action' => request_uri(),
269
    '#theme_wrapper' => 'form',
270 271
  );

272 273 274 275 276 277 278 279 280 281 282 283 284
  $type['page'] = array(
    '#show_messages' => TRUE,
    '#show_blocks' => TRUE,
    '#theme' => 'page',
  );

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

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

  $type['button'] = array(
    '#input' => TRUE,
    '#name' => 'op',
    '#button_type' => 'submit',
    '#executes_submit_callback' => FALSE,
302
    '#process' => array('form_process_ahah'),
303
    '#theme_wrapper' => 'button',
304 305 306 307 308 309
  );

  $type['image_button'] = array(
    '#input' => TRUE,
    '#button_type' => 'submit',
    '#executes_submit_callback' => TRUE,
310
    '#process' => array('form_process_ahah'),
311 312 313
    '#return_value' => TRUE,
    '#has_garbage_value' => TRUE,
    '#src' => NULL,
314
    '#theme_wrapper' => 'image_button',
315 316 317 318 319 320 321
  );

  $type['textfield'] = array(
    '#input' => TRUE,
    '#size' => 60,
    '#maxlength' => 128,
    '#autocomplete_path' => FALSE,
322
    '#process' => array('form_process_text_format', 'form_process_ahah'),
323 324
    '#theme' => 'textfield',
    '#theme_wrapper' => 'form_element',
325 326 327 328 329 330
  );

  $type['password'] = array(
    '#input' => TRUE,
    '#size' => 60,
    '#maxlength' => 128,
331
    '#process' => array('form_process_ahah'),
332 333
    '#theme' => 'password',
    '#theme_wrapper' => 'form_element',
334 335 336 337
  );

  $type['password_confirm'] = array(
    '#input' => TRUE,
338
    '#process' => array('form_process_password_confirm'),
339
    '#theme_wrapper' => 'form_element',
340 341 342 343 344 345 346
  );

  $type['textarea'] = array(
    '#input' => TRUE,
    '#cols' => 60,
    '#rows' => 5,
    '#resizable' => TRUE,
347
    '#process' => array('form_process_text_format', 'form_process_ahah'),
348 349
    '#theme' => 'textarea',
    '#theme_wrapper' => 'form_element',
350 351 352 353
  );

  $type['radios'] = array(
    '#input' => TRUE,
354
    '#process' => array('form_process_radios'),
355 356
    '#theme_wrapper' => 'radios',
    '#pre_render' => array('form_pre_render_conditional_form_element'),
357 358 359 360 361
  );

  $type['radio'] = array(
    '#input' => TRUE,
    '#default_value' => NULL,
362
    '#process' => array('form_process_ahah'),
363 364 365
    '#theme' => 'radio',
    '#theme_wrapper' => 'form_element',
    '#form_element_skip_title' => TRUE,
366 367 368 369 370
  );

  $type['checkboxes'] = array(
    '#input' => TRUE,
    '#tree' => TRUE,
371
    '#process' => array('form_process_checkboxes'),
372 373
    '#theme_wrapper' => 'checkboxes',
    '#pre_render' => array('form_pre_render_conditional_form_element'),
374 375 376 377 378
  );

  $type['checkbox'] = array(
    '#input' => TRUE,
    '#return_value' => 1,
379
    '#process' => array('form_process_ahah'),
380 381 382
    '#theme' => 'checkbox',
    '#theme_wrapper' => 'form_element',
    '#form_element_skip_title' => TRUE,
383 384 385 386 387 388
  );

  $type['select'] = array(
    '#input' => TRUE,
    '#size' => 0,
    '#multiple' => FALSE,
389
    '#process' => array('form_process_ahah'),
390 391
    '#theme' => 'select',
    '#theme_wrapper' => 'form_element',
392 393 394 395 396 397
  );

  $type['weight'] = array(
    '#input' => TRUE,
    '#delta' => 10,
    '#default_value' => 0,
398
    '#process' => array('form_process_weight', 'form_process_ahah'),
399 400 401 402 403
  );

  $type['date'] = array(
    '#input' => TRUE,
    '#element_validate' => array('date_validate'),
404
    '#process' => array('form_process_date'),
405 406
    '#theme' => 'date',
    '#theme_wrapper' => 'form_element',
407 408 409 410 411
  );

  $type['file'] = array(
    '#input' => TRUE,
    '#size' => 60,
412 413
    '#theme' => 'file',
    '#theme_wrapper' => 'form_element',
414
  );
415

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

  /**
   * Form structure.
   */
  $type['item'] = array(
430
    '#markup' => '',
431 432
    '#theme' => 'markup',
    '#theme_wrapper' => 'form_element',
433 434 435 436
  );

  $type['hidden'] = array(
    '#input' => TRUE,
437
    '#process' => array('form_process_ahah'),
438
    '#theme' => 'hidden',
439 440 441 442 443 444 445
  );

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

  $type['markup'] = array(
446 447
    '#markup' => '',
    '#theme' => 'markup',
448 449 450 451 452 453
  );

  $type['fieldset'] = array(
    '#collapsible' => FALSE,
    '#collapsed' => FALSE,
    '#value' => NULL,
454 455
    '#process' => array('form_process_fieldset', 'form_process_ahah'),
    '#pre_render' => array('form_pre_render_fieldset'),
456
    '#theme_wrapper' => 'fieldset',
457 458
  );

459 460 461 462 463 464
  $type['vertical_tabs'] = array(
    '#theme_wrapper' => 'vertical_tabs',
    '#default_tab' => '',
    '#process' => array('form_process_vertical_tabs'),
  );

465 466
  $type['token'] = array(
    '#input' => TRUE,
467
    '#theme' => array('hidden'),
468 469
  );

470 471 472
  return $type;
}

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

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

568
  foreach (list_themes() as $theme) {
569
    $items['admin/appearance/settings/' . $theme->name] = array(
570 571 572 573 574 575
      '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
576
  }
drumm's avatar
drumm committed
577

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

607 608 609 610 611 612 613 614 615 616 617
  // 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'),
  );

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

654 655 656 657 658 659 660
  // 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'),
  );
661 662 663 664 665 666 667
  $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,
  );
668 669 670 671 672 673 674 675
  $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,
  );

676
  // Settings.
677
  $items['admin/settings/site-information'] = array(
678 679
    'title' => 'Site information',
    'description' => 'Change basic site information, such as the site name, slogan, e-mail address, mission, front page and more.',
680 681
    'page callback' => 'drupal_get_form',
    'page arguments' => array('system_site_information_settings'),
682
    'access arguments' => array('administer site configuration'),
683
  );
684
  $items['admin/settings/logging'] = array(
685
    'title' => 'Logging and errors',
686
    'description' => "Settings for logging and alerts modules. Various modules can route Drupal's system events to different destinations, such as syslog, database, email, etc.",
687
    'page callback' => 'drupal_get_form',
688
    'page arguments' => array('system_logging_settings'),
689
    'access arguments' => array('administer site configuration'),
690
  );
691 692
  $items['admin/settings/logging/settings'] = array(
    'title' => 'Settings',
693
    'access arguments' => array('administer site configuration'),
694 695
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -1,
696
  );
697
  $items['admin/settings/performance'] = array(
698
    'title' => 'Performance',
699
    'description' => 'Enable or disable page caching for anonymous users and set CSS and JS bandwidth optimization options.',
700 701
    'page callback' => 'drupal_get_form',
    'page arguments' => array('system_performance_settings'),
702
    'access arguments' => array('administer site configuration'),
703 704
  );
  $items['admin/settings/file-system'] = array(
705 706
    'title' => 'File system',
    'description' => 'Tell Drupal where to store uploaded files and how they are accessed.',
707 708
    'page callback' => 'drupal_get_form',
    'page arguments' => array('system_file_system_settings'),
709
    'access arguments' => array('administer site configuration'),
710 711
  );
  $items['admin/settings/image-toolkit'] = array(
712 713
    'title' => 'Image toolkit',
    'description' => 'Choose which image toolkit to use if you have installed optional toolkits.',
714 715
    'page callback' => 'drupal_get_form',
    'page arguments' => array('system_image_toolkit_settings'),
716
    'access arguments' => array('administer site configuration'),
717
  );
718
  $items['admin/settings/rss-publishing'] = array(
719
    'title' => 'RSS publishing',
720
    'description' => 'Configure the site description, the number of items per feed and whether feeds should be titles/teasers/full-text.',
721 722
    'page callback' => 'drupal_get_form',
    'page arguments' => array('system_rss_feeds_settings'),
723
    'access arguments' => array('administer site configuration'),
724
  );
725 726
  $items['admin/settings/regional-settings'] = array(
    'title' => 'Regional settings',
727
    'description' => "Settings for how Drupal displays date and time, as well as the system's default time zone.",
728
    'page callback' => 'drupal_get_form',
729
    'page arguments' => array('system_regional_settings'),
730
    'access arguments' => array('administer site configuration'),
731
  );
732
  $items['admin/settings/regional-settings/lookup'] = array(
733
    'title' => 'Date and time lookup',
734 735
    'type' => MENU_CALLBACK,
    'page callback' => 'system_date_time_lookup',
736
    'access arguments' => array('administer site configuration'),
737
  );
738 739
  $items['admin/settings/maintenance-mode'] = array(
    'title' => 'Maintenance mode',
740
    'description' => 'Take the site offline for maintenance or bring it back online.',
741
    'page callback' => 'drupal_get_form',
742
    'page arguments' => array('system_site_maintenance_mode'),
743
    'access arguments' => array('administer site configuration'),
744 745
  );
  $items['admin/settings/clean-urls'] = array(
746 747
    'title' => 'Clean URLs',
    'description' => 'Enable or disable clean URLs for your site.',
748 749
    'page callback' => 'drupal_get_form',
    'page arguments' => array('system_clean_url_settings'),
750
    'access arguments' => array('administer site configuration'),
751
  );
752 753 754 755 756 757 758
  $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,
  );
759

760
  // Reports.
761 762 763
  $items['admin/reports'] = array(
    'title' => 'Reports',
    'description' => 'View reports from system logs and other status information.',
764
    'page callback' => 'system_admin_menu_block_page',
765 766
    'access callback' => 'system_admin_menu_block_access',
    'access arguments' => array('admin/reports', 'access site reports'),
767 768 769
    'weight' => 5,
    'position' => 'left',
  );
770
  $items['admin/reports/status'] = array(
771 772
    'title' => 'Status report',
    'description' => "Get a status report about your site's operation and any detected problems.",
773 774 775 776
    'page callback' => 'system_status',
    'weight' => 10,
    'access arguments' => array('administer site configuration'),
  );
777
  $items['admin/reports/status/run-cron'] = array(
778
    'title' => 'Run cron',
779
    'page callback' => 'system_run_cron',
780
    'access arguments' => array('administer site configuration'),
781 782
    'type' => MENU_CALLBACK,
  );
783
  $items['admin/reports/status/php'] = array(
784
    'title' => 'PHP',
785
    'page callback' => 'system_php',
786
    'access arguments' => array('administer site configuration'),
787 788
    'type' => MENU_CALLBACK,
  );
789
  // Default page for batch operations.
790 791 792 793 794
  $items['batch'] = array(
    'page callback' => 'system_batch_page',
    'access callback' => TRUE,
    'type' => MENU_CALLBACK,
  );
Dries's avatar
 
Dries committed
795
  return $items;
Dries's avatar
 
Dries committed
796 797
}

798 799 800 801 802 803 804 805 806 807 808 809 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