system.module 109 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
/**
 * Default interval for automatic cron executions in seconds.
 */
define('DRUPAL_CRON_DEFAULT_THRESHOLD', 10800);

49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/**
 * 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);

64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
 /**
 * 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);

79
80
81
82
83
84
85
86
87
88
89
/**
 * 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
90
/**
91
 * Implement hook_help().
Dries's avatar
   
Dries committed
92
 */
93
function system_help($path, $arg) {
94
95
  global $base_url;

96
  switch ($path) {
97
    case 'admin/help#system':
98
99
      $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>';
100
      $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/config/modules'), '@drupal-modules' => 'http://drupal.org/project/modules')) . '</li>';
101
      $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>';
102
      $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/config/development/performance'))) . '</li>';
103
      $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>';
104
      $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/config/regional/settings'), '@file-system' => url('admin/config/media/file-system'), '@clean-url' => url('admin/config/search/clean-urls'), '@site-info' => url('admin/settings/site-information'), '@maintenance-mode' => url('admin/config/development/maintenance'))) . '</li></ul>';
105
      $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>';
106
      return $output;
107
    case 'admin/by-module':
108
      return '<p>' . t('This page shows you all available administration tasks for each module.') . '</p>';
109
    case 'admin/appearance':
110
      $output = '<p>' . t('Select the default theme for Drupal. 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.') . '</p>';
111
      $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>';
112
      return $output;
113
    case 'admin/appearance/settings/' . $arg[4]:
114
      $reference = explode('.', $arg[4], 2);
115
      $theme = array_pop($reference);
116
117
      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':
118
      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>';
119
    case 'admin/config/modules':
120
121
      $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/config/people/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/config/people/permissions'))) . '</p>';
122
      $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>';
123
      return $output;
124
125
    case 'admin/config/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/config/modules'))) . '</p>';
126
    case 'admin/structure/block/configure':
127
      if ($arg[4] == 'system' && $arg[5] == 'powered-by') {
128
        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>';
129
      }
130
      break;
131
    case 'admin/config/development/maintenance':
132
133
134
135
      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>';
      }
136
137
    case 'admin/settings/actions':
    case 'admin/settings/actions/manage':
138
139
      $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>';
140
      if (module_exists('trigger')) {
141
        $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>';
142
      }
143
      return $output;
144
145
    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").');
146
    case 'admin/config/people/ip-blocking':
147
      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>';
148
    case 'admin/reports/status':
149
      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>';
150
  }
Dries's avatar
   
Dries committed
151
152
}

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

Dries's avatar
   
Dries committed
210
/**
211
 * Implement hook_permission().
Dries's avatar
   
Dries committed
212
 */
213
function system_permission() {
214
  return array(
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
    '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.'),
    ),
231
232
233
234
    'access site in maintenance mode' => array(
      'title' => t('Access site in maintenance mode'),
      'description' => t('Log in when the site is in maintenance mode.'),
    ),
235
236
237
238
239
240
241
242
    'access site reports' => array(
      'title' => t('Access site reports'),
      'description' => t('View reports from system logs and other status information.'),
    ),
    'block IP addresses' => array(
      'title' => t('Block IP addresses'),
      'description' => t('Block IP addresses from accessing your site.'),
    ),
243
  );
Dries's avatar
   
Dries committed
244
245
}

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

265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
/**
 * Implement hook_entity_info().
 */
function system_entity_info() {
  return array(
    'file' => array(
      'label' => t('File'),
      'base table' => 'file',
      'object keys' => array(
        'id' => 'fid',
      ),
      'static cache' => FALSE,
    ),
  );
}

281
/**
282
 * Implement hook_elements().
283
284
285
 */
function system_elements() {
  // Top level form
286
287
288
  $type['form'] = array(
    '#method' => 'post',
    '#action' => request_uri(),
289
    '#theme_wrappers' => array('form'),
290
291
  );

292
293
294
295
296
297
298
299
300
301
302
303
304
  $type['page'] = array(
    '#show_messages' => TRUE,
    '#show_blocks' => TRUE,
    '#theme' => 'page',
  );

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

305
306
307
308
309
310
311
312
  /**
   * Input elements.
   */
  $type['submit'] = array(
    '#input' => TRUE,
    '#name' => 'op',
    '#button_type' => 'submit',
    '#executes_submit_callback' => TRUE,
313
    '#process' => array('ajax_process_form'),
314
    '#theme_wrappers' => array('button'),
315
316
317
318
319
320
321
  );

  $type['button'] = array(
    '#input' => TRUE,
    '#name' => 'op',
    '#button_type' => 'submit',
    '#executes_submit_callback' => FALSE,
322
    '#process' => array('ajax_process_form'),
323
    '#theme_wrappers' => array('button'),
324
325
326
327
328
329
  );

  $type['image_button'] = array(
    '#input' => TRUE,
    '#button_type' => 'submit',
    '#executes_submit_callback' => TRUE,
330
    '#process' => array('ajax_process_form'),
331
332
333
    '#return_value' => TRUE,
    '#has_garbage_value' => TRUE,
    '#src' => NULL,
334
    '#theme_wrappers' => array('image_button'),
335
336
337
338
339
340
341
  );

  $type['textfield'] = array(
    '#input' => TRUE,
    '#size' => 60,
    '#maxlength' => 128,
    '#autocomplete_path' => FALSE,
342
    '#process' => array('form_process_text_format', 'ajax_process_form'),
343
    '#theme' => 'textfield',
344
    '#theme_wrappers' => array('form_element'),
345
346
347
348
349
350
  );

  $type['password'] = array(
    '#input' => TRUE,
    '#size' => 60,
    '#maxlength' => 128,
351
    '#process' => array('ajax_process_form'),
352
    '#theme' => 'password',
353
    '#theme_wrappers' => array('form_element'),
354
355
356
357
  );

  $type['password_confirm'] = array(
    '#input' => TRUE,
358
    '#process' => array('form_process_password_confirm'),
359
    '#theme_wrappers' => array('form_element'),
360
361
362
363
364
365
366
  );

  $type['textarea'] = array(
    '#input' => TRUE,
    '#cols' => 60,
    '#rows' => 5,
    '#resizable' => TRUE,
367
    '#process' => array('form_process_text_format', 'ajax_process_form'),
368
    '#theme' => 'textarea',
369
    '#theme_wrappers' => array('form_element'),
370
371
372
373
  );

  $type['radios'] = array(
    '#input' => TRUE,
374
    '#process' => array('form_process_radios'),
375
    '#theme_wrappers' => array('radios'),
376
    '#pre_render' => array('form_pre_render_conditional_form_element'),
377
378
379
380
381
  );

  $type['radio'] = array(
    '#input' => TRUE,
    '#default_value' => NULL,
382
    '#process' => array('ajax_process_form'),
383
    '#theme' => 'radio',
384
    '#theme_wrappers' => array('form_element'),
385
    '#form_element_skip_title' => TRUE,
386
387
388
389
390
  );

  $type['checkboxes'] = array(
    '#input' => TRUE,
    '#tree' => TRUE,
391
    '#process' => array('form_process_checkboxes'),
392
    '#theme_wrappers' => array('checkboxes'),
393
    '#pre_render' => array('form_pre_render_conditional_form_element'),
394
395
396
397
398
  );

  $type['checkbox'] = array(
    '#input' => TRUE,
    '#return_value' => 1,
399
    '#process' => array('ajax_process_form'),
400
    '#theme' => 'checkbox',
401
    '#theme_wrappers' => array('form_element'),
402
    '#form_element_skip_title' => TRUE,
403
404
405
406
407
408
  );

  $type['select'] = array(
    '#input' => TRUE,
    '#size' => 0,
    '#multiple' => FALSE,
409
    '#process' => array('ajax_process_form'),
410
    '#theme' => 'select',
411
    '#theme_wrappers' => array('form_element'),
412
413
414
415
416
417
  );

  $type['weight'] = array(
    '#input' => TRUE,
    '#delta' => 10,
    '#default_value' => 0,
418
    '#process' => array('form_process_weight', 'ajax_process_form'),
419
420
421
422
423
  );

  $type['date'] = array(
    '#input' => TRUE,
    '#element_validate' => array('date_validate'),
424
    '#process' => array('form_process_date'),
425
    '#theme' => 'date',
426
    '#theme_wrappers' => array('form_element'),
427
428
429
430
431
  );

  $type['file'] = array(
    '#input' => TRUE,
    '#size' => 60,
432
    '#theme' => 'file',
433
    '#theme_wrappers' => array('form_element'),
434
  );
435

436
437
438
439
440
441
442
  $type['tableselect'] = array(
    '#input' => TRUE,
    '#js_select' => TRUE,
    '#multiple' => TRUE,
    '#process' => array('form_process_tableselect'),
    '#options' => array(),
    '#empty' => '',
443
    '#theme' => 'tableselect'
444
  );
445
446
447
448
449

  /**
   * Form structure.
   */
  $type['item'] = array(
450
    '#markup' => '',
451
    '#theme' => 'markup',
452
    '#theme_wrappers' => array('form_element'),
453
454
455
456
  );

  $type['hidden'] = array(
    '#input' => TRUE,
457
    '#process' => array('ajax_process_form'),
458
    '#theme' => 'hidden',
459
460
461
462
463
464
465
  );

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

  $type['markup'] = array(
466
467
    '#markup' => '',
    '#theme' => 'markup',
468
469
470
471
472
473
  );

  $type['fieldset'] = array(
    '#collapsible' => FALSE,
    '#collapsed' => FALSE,
    '#value' => NULL,
474
    '#process' => array('form_process_fieldset', 'ajax_process_form'),
475
    '#pre_render' => array('form_pre_render_fieldset'),
476
    '#theme_wrappers' => array('fieldset'),
477
478
  );

479
  $type['vertical_tabs'] = array(
480
    '#theme_wrappers' => array('vertical_tabs'),
481
482
483
484
    '#default_tab' => '',
    '#process' => array('form_process_vertical_tabs'),
  );

485
486
  $type['token'] = array(
    '#input' => TRUE,
487
    '#theme' => array('hidden'),
488
489
  );

490
491
492
  return $type;
}

Dries's avatar
   
Dries committed
493
/**
494
 * Implement hook_menu().
Dries's avatar
   
Dries committed
495
 */
496
497
function system_menu() {
  $items['system/files'] = array(
498
    'title' => 'File download',
499
    'page callback' => 'file_download',
500
501
502
503
504
505
506
507
    'page arguments' => array('private'),
    'access callback' => TRUE,
    'type' => MENU_CALLBACK,
  );
  $items['system/temporary'] = array(
    'title' => 'Temporary files',
    'page callback' => 'file_download',
    'page arguments' => array('temporary'),
508
    'access callback' => TRUE,
509
510
    'type' => MENU_CALLBACK,
  );
511
  $items['system/ajax'] = array(
512
    'title' => 'AHAH callback',
513
    'page callback' => 'ajax_form_callback',
514
    'access callback' => TRUE,
515
    'type' => MENU_CALLBACK,
516
517
    'file path' => 'includes',
    'file' => 'form.inc',
518
  );
519
520
521
522
523
  $items['system/timezone'] = array(
    'title' => 'Time zone',
    'page callback' => 'system_timezone',
    'access callback' => TRUE,
    'type' => MENU_CALLBACK,
524
    'file' => 'system.admin.inc',
525
  );
526
527
528
529
530
  $items['system/run-cron-image'] = array(
    'title' => 'Execute cron',
    'page callback' => 'system_run_cron_image',
    'access callback' => 'system_run_cron_image_access',
    'type' => MENU_CALLBACK,
531
    'file' => 'system.admin.inc',
532
  );
533
  $items['admin'] = array(
534
    'title' => 'Administer',
535
536
537
    'access arguments' => array('access administration pages'),
    'page callback' => 'system_main_admin_page',
    'weight' => 9,
538
    'menu_name' => 'management',
539
    'file' => 'system.admin.inc',
540
541
  );
  $items['admin/compact'] = array(
542
    'title' => 'Compact mode',
543
    'page callback' => 'system_admin_compact_page',
544
    'access arguments' => array('access administration pages'),
545
    'type' => MENU_CALLBACK,
546
    'file' => 'system.admin.inc',
547
548
  );
  $items['admin/by-task'] = array(
549
    'title' => 'By task',
550
    'page callback' => 'system_main_admin_page',
551
    'access arguments' => array('access administration pages'),
552
    'type' => MENU_DEFAULT_LOCAL_TASK,
553
    'file' => 'system.admin.inc',
554
555
  );
  $items['admin/by-module'] = array(
556
    'title' => 'By module',
557
    'page callback' => 'system_admin_by_module',
558
    'access arguments' => array('access administration pages'),
559
560
    'type' => MENU_LOCAL_TASK,
    'weight' => 2,
561
    'file' => 'system.admin.inc',
562
  );
563

564
  // Menu items that are basically just menu blocks.
565
  $items['admin/settings'] = array(
566
    'title' => 'Site configuration',
567
    'description' => 'Configure site settings.',
568
    'position' => 'right',
569
    'weight' => -2,
570
    'page callback' => 'system_settings_overview',
571
572
    'access callback' => 'system_admin_menu_block_access',
    'access arguments' => array('admin/settings', 'access administration pages'),
573
    'file' => 'system.admin.inc',
574
  );
575
576
  $items['admin/structure'] = array(
    'title' => 'Structure',
577
    'description' => 'Control how your site looks and feels.',
578
    'position' => 'right',
579
    'weight' => -8,
580
    'page callback' => 'system_admin_menu_block_page',
581
    'access callback' => 'system_admin_menu_block_access',
582
    'access arguments' => array('admin/structure', 'access administration pages'),
583
    'file' => 'system.admin.inc',
584
  );
585
586
587
  // Appearance.
  $items['admin/appearance'] = array(
    'title' => 'Appearance',
588
    'description' => 'Select and configure your site theme.',
589
    'page callback' => 'drupal_get_form',
590
    'page arguments' => array('system_themes_form'),
591
    'access arguments' => array('administer site configuration'),
592
    'position' => 'left',
593
    'weight' => -6,
594
    'file' => 'system.admin.inc',
595
  );
596
  $items['admin/appearance/select'] = array(
597
    'title' => 'List',
598
    'description' => 'Select the default theme for your site.',
599
600
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -1,
601
    'file' => 'system.admin.inc',
602
  );
603
  $items['admin/appearance/settings'] = array(
604
    'title' => 'Configure',
605
    'page arguments' => array('system_theme_settings'),
606
    'access arguments' => array('administer site configuration'),
607
    'type' => MENU_LOCAL_TASK,
608
    'file' => 'system.admin.inc',
609
  );
610
  // Theme configuration subtabs.
611
  $items['admin/appearance/settings/global'] = array(
612
    'title' => 'Global settings',
613
614
615
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -1,
  );
Dries's avatar
   
Dries committed
616

617
  foreach (list_themes() as $theme) {
618
    $items['admin/appearance/settings/' . $theme->name] = array(
619
620
621
622
623
      '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),
624
      'file' => 'system.admin.inc',
625
    );
Dries's avatar
   
Dries committed
626
  }
drumm's avatar
drumm committed
627

628
629
630
631
632
  // Configuration and modules.
  $items['admin/config'] = array(
    'title' => 'Configuration and modules',
    'page callback' => 'system_admin_config_page',
    'access arguments' => array('access administration pages'),
633
    'file' => 'system.admin.inc',
634
635
636
637
638
639
  );
  $items['admin/config/config'] = array(
    'title' => 'Configuration',
    'access arguments' => array('administer site configuration'),
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -10,
640
    'file' => 'system.admin.inc',
641
642
  );
  $items['admin/config/modules'] = array(
643
644
    'title' => 'Modules',
    'description' => 'Enable or disable add-on modules for your site.',
645
646
    'page callback' => 'drupal_get_form',
    'page arguments' => array('system_modules'),
647
    'access arguments' => array('administer site configuration'),
648
    'file' => 'system.admin.inc',
649
650
    'type' => MENU_LOCAL_TASK,
    'weight' => 10,
651
  );
652
  $items['admin/config/modules/list'] = array(
653
    'title' => 'List',
654
655
    'type' => MENU_DEFAULT_LOCAL_TASK,
  );
656
  $items['admin/config/modules/list/confirm'] = array(
657
    'title' => 'List',
658
    'access arguments' => array('administer site configuration'),
659
660
    'type' => MENU_CALLBACK,
  );
661
  $items['admin/config/modules/uninstall'] = array(
662
    'title' => 'Uninstall',
663
    'page arguments' => array('system_modules_uninstall'),
664
    'access arguments' => array('administer site configuration'),
665
    'type' => MENU_LOCAL_TASK,
666
    'file' => 'system.admin.inc',
667
  );
668
  $items['admin/config/modules/uninstall/confirm'] = array(
669
    'title' => 'Uninstall',
670
    'access arguments' => array('administer site configuration'),
671
    'type' => MENU_CALLBACK,
672
673
674
    'file' => 'system.admin.inc',
  );

675
  // Actions.
676
  $items['admin/settings/actions'] = array(
677
678
679
    'title' => 'Actions',
    'description' => 'Manage the actions defined for your site.',
    'access arguments' => array('administer actions'),
680
681
    'page callback' => 'system_actions_manage',
    'file' => 'system.admin.inc',
682
  );
683
  $items['admin/settings/actions/manage'] = array(
684
685
686
687
688
    'title' => 'Manage actions',
    'description' => 'Manage the actions defined for your site.',
    'page callback' => 'system_actions_manage',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -2,
689
    'file' => 'system.admin.inc',
690
  );
691
692
  $items['admin/settings/actions/configure'] = array(
    'title' => 'Configure an advanced action',
693
694
    'page callback' => 'drupal_get_form',
    'page arguments' => array('system_actions_configure'),
695
    'access arguments' => array('administer actions'),
696
    'type' => MENU_CALLBACK,
697
    'file' => 'system.admin.inc',
698
  );
699
  $items['admin/settings/actions/delete/%actions'] = array(
700
701
702
703
    'title' => 'Delete action',
    'description' => 'Delete an action.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('system_actions_delete_form', 4),
704
    'access arguments' => array('administer actions'),
705
    'type' => MENU_CALLBACK,
706
    'file' => 'system.admin.inc',
707
  );
708
  $items['admin/settings/actions/orphan'] = array(
709
710
    'title' => 'Remove orphans',
    'page callback' => 'system_actions_remove_orphans',
711
    'access arguments' => array('administer actions'),
712
    'type' => MENU_CALLBACK,
713
    'file' => 'system.admin.inc',
714
715
  );

716
  // IP address blocking.
717
  $items['admin/config/people/ip-blocking'] = array(
718
719
720
721
    'title' => 'IP address blocking',
    'description' => 'Manage blocked IP addresses.',
    'page callback' => 'system_ip_blocking',
    'access arguments' => array('block IP addresses'),
722
    'file' => 'system.admin.inc',
723
  );
724
  $items['admin/config/people/ip-blocking/%'] = array(
725
726
727
728
729
    'title' => 'IP address blocking',
    'description' => 'Manage blocked IP addresses.',
    'page callback' => 'system_ip_blocking',
    'access arguments' => array('block IP addresses'),
    'type' => MENU_CALLBACK,
730
    'file' => 'system.admin.inc',
731
  );
732
  $items['admin/config/people/ip-blocking/delete/%blocked_ip'] = array(
733
734
    'title' => 'Delete IP address',
    'page callback' => 'drupal_get_form',
735
    'page arguments' => array('system_ip_blocking_delete', 5),
736
737
    'access arguments' => array('block IP addresses'),
    'type' => MENU_CALLBACK,
738
    'file' => 'system.admin.inc',
739
740
  );

741
742
  // Configuration.
  $items['admin/config/development'] = array(
743
744
745
746
747
748
749
750
    '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'),
    'file' => 'system.admin.inc',
751
752
753
754
755
756
757
  );
  $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'),
758
    'file' => 'system.admin.inc',
759
  );
760
761
762
763
764
765
  $items['admin/config/development/performance'] = array(
    'title' => 'Performance',
    'description' => 'Enable or disable page caching for anonymous users and set CSS and JS bandwidth optimization options.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('system_performance_settings'),
    'access arguments' => array('administer site configuration'),
766
    'file' => 'system.admin.inc',
767
  );
768
  $items['admin/config/media'] = array(
769
770
771
772
773
774
775
776
    'title' => 'Media',
    'description' => 'Media tools.',
    'position' => 'left',
    'weight' => 10,
    'page callback' => 'system_admin_menu_block_page',
    'access callback' => 'system_admin_menu_block_access',
    'access arguments' => array('admin/config/media', 'access administration pages'),
    'file' => 'system.admin.inc',
777
778
  );
  $items['admin/config/media/file-system'] = array(
779
    'title' => 'File system',
780
    'description' => 'Tell Drupal where to store uploaded files and how they are accessed.',
781
    'page callback' => 'drupal_get_form',
782
    'page arguments' => array('system_file_system_settings'),
783
    'access arguments' => array('administer site configuration'),
784
    'file' => 'system.admin.inc',
785
  );
786
787
788
    $items['admin/config/media/image-toolkit'] = array(
    'title' => 'Image toolkit',
    'description' => 'Choose which image toolkit to use if you have installed optional toolkits.',
789
    'page callback' => 'drupal_get_form',
790
    'page arguments' => array('system_image_toolkit_settings'),
791
    'access arguments' => array('administer site configuration'),
792
793
    'file' => 'system.admin.inc',
  );
794
795
796
797
798
799
800
801
  $items['admin/config/services'] = array(
    'title' => 'Web services',
    'description' => 'Tools related to web services.',
    'page callback' => 'system_admin_menu_block_page',
    'access callback' => 'system_admin_menu_block_access',
    'access arguments' => array('admin/config/services', 'access administration pages'),
    'file' => 'system.admin.inc',
  );
802
803
804
805
806
807
808
809
  $items['admin/config/services/rss-publishing'] = array(
    'title' => 'RSS publishing',
    'description' => 'Configure the site description, the number of items per feed and whether feeds should be titles/teasers/full-text.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('system_rss_feeds_settings'),
    'access arguments' => array('administer site configuration'),
    'file' => 'system.admin.inc',
  );
810
  $items['admin/config/development/logging'] = array(
811
812
    'title' => 'Logging and errors',
    'description' => "Settings for logging and alerts modules. Various modules can route Drupal's system events to different destinations, such as syslog, database, email, etc.",
813
    'page callback' => 'drupal_get_form',
814
    'page arguments' => array('system_logging_settings'),
815
    'access arguments' => array('administer site configuration'),
816
    'file' => 'system.admin.inc',
817
  );
818
  $items['admin/config/regional'] = array(
819
820
821
822
823
824
825
826
    'title' => 'Regional and language',
    'description' => 'Regional settings, localization and translation.',
    'position' => 'left',
    'weight' => -7,
    'page callback' => 'system_admin_menu_block_page',
    'access callback' => 'system_admin_menu_block_access',
    'access arguments' => array('admin/config/regional', 'access administration pages'),
    'file' => 'system.admin.inc',
827
828
829
830
831
832
833
834
  );
  $items['admin/config/regional/settings'] = array(
    'title' => 'Regional settings',
    'description' => "Settings for how Drupal displays date and time, as well as the system's default time zone.",
    'page callback' => 'drupal_get_form',
    'page arguments' => array('system_regional_settings'),
    'access arguments' => array('administer site configuration'),
    'weight' => -10,
835
    'file' => 'system.admin.inc',
836
837
838
839
840
841
  );
  $items['admin/config/regional/settings/lookup'] = array(
    'title' => 'Date and time lookup',
    'type' => MENU_CALLBACK,
    'page callback' => 'system_date_time_lookup',
    'access arguments' => array('administer site configuration'),
842
    'file' => 'system.admin.inc',
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
  $items['admin/config/search'] = array(
    'title' => 'Search and metadata',
    'description' => 'Local site search, metadata and SEO.',
    'page callback' => 'system_admin_menu_block_page',
    'access callback' => 'system_admin_menu_block_access',
    'access arguments' => array('admin/config/search', 'access administration pages'),
    'file' => 'system.admin.inc',
  );
  $items['admin/config/search/clean-urls'] = array(
    'title' => 'Clean URLs',
    'description' => 'Enable or disable clean URLs for your site.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('system_clean_url_settings'),
    'access arguments' => array('administer site configuration'),
    'file' => 'system.admin.inc',
  );
  $items['admin/config/search/clean-urls/check'] = array(
    'title' => 'Clean URL check',
    'page callback' => 'drupal_json',
    'page arguments' => array(array('status' => TRUE)),
    'access callback' => TRUE,
    'type' => MENU_CALLBACK,
    'file' => 'system.admin.inc',
  );
868

869
870
871
872
  // Settings.
  $items['admin/settings/site-information'] = array(
    'title' => 'Site information',
    'description' => 'Change basic site information, such as the site name, slogan, e-mail address, mission, front page and more.',
873
    'page callback' => 'drupal_get_form',
874
    'page arguments' => array('system_site_information_settings'),
875
    'access arguments' => array('administer site configuration'),
876
    'file' => 'system.admin.inc',
877
878
  );

879
  // Reports.
880
881
882
  $items['admin/reports'] = array(
    'title' => 'Reports',
    'description' => 'View reports from system logs and other status information.',
883
    'page callback' => 'system_admin_menu_block_page',
884
885
    'access callback' => 'system_admin_menu_block_access',
    'access arguments' => array('admin/reports', 'access site reports'),
886
887
    'weight' => 5,
    'position' => 'left',
888
    'file' => 'system.admin.inc',
889
  );
890
  $items['admin/reports/status'] = array(
891
892
    'title' => 'Status report',
    'description' => "Get a status report about your site's operation and any detected problems.",
893
894
895
    'page callback' => 'system_status',
    'weight' => 10,
    'access arguments' => array('administer site configuration'),
896
    'file' => 'system.admin.inc',
897
  );
898
  $items['admin/reports/status/run-cron'] = array(
899
    'title' => 'Run cron',
900
    'page callback' => 'system_run_cron',
901
    'access arguments' => array('administer site configuration'),
902
    'type' => MENU_CALLBACK,
903
    'file' => 'system.admin.inc',
904
  );
905
  $items['admin/reports/status/php'] = array(
906
    'title' => 'PHP',
907
    'page callback' => 'system_php',
908
    'access arguments' => array('administer site configuration'),
909
    'type' => MENU_CALLBACK,
910
    'file' => 'system.admin.inc',
911
  );
912