system.module 124 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
/**
 * Maximum age of temporary files in seconds.
 */
12
define('DRUPAL_MAXIMUM_TEMP_FILE_AGE', 21600);
13

14
15
16
17
18
/**
 * Default interval for automatic cron executions in seconds.
 */
define('DRUPAL_CRON_DEFAULT_THRESHOLD', 10800);

19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/**
 * 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);

34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
 /**
 * 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);

49
50
51
52
53
54
55
56
57
58
59
/**
 * 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
60
/**
61
 * Implement hook_help().
Dries's avatar
   
Dries committed
62
 */
63
function system_help($path, $arg) {
64
65
  global $base_url;

66
  switch ($path) {
67
    case 'admin/help#system':
68
69
      $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>';
70
      $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>';
71
      $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>';
72
      $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>';
73
      $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>';
74
      $output .= '<li>' . t('basic configuration options for your site, including <a href="@date-time-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('@date-time-settings' => url('admin/config/regional/date-time'), '@file-system' => url('admin/config/media/file-system'), '@clean-url' => url('admin/config/search/clean-urls'), '@site-info' => url('admin/config/system/site-information'), '@maintenance-mode' => url('admin/config/development/maintenance'))) . '</li></ul>';
75
      $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>';
76
      return $output;
77
    case 'admin/by-module':
78
      return '<p>' . t('This page shows you all available administration tasks for each module.') . '</p>';
79
    case 'admin/appearance':
80
      $output = '<p>' . t('Set and configure the default theme for your website.  Alternative <a href="@themes">themes</a> are available.', array('@themes' => 'http://drupal.org/project/themes')) . '</p>';
81
      return $output;
82
83
    case 'admin/appearance/settings/' . $arg[3]:
      $reference = explode('.', $arg[3], 2);
84
      $theme = array_pop($reference);
85
86
      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':
87
      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>';
88
    case 'admin/config/modules':
89
90
      $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>';
91
92
93
94
95
96
97
98
99
100
101
      if (module_exists('update')) {
        if (update_manager_access()) {
          $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 manager</em> module provides <a href="@updates">information on new versions of modules (and themes)</a> as they are released, and allows you to <a href="@update-manager-update">upgrade any missing updates</a> or <a href="@update-manager-install">install new modules and themes</a>. 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'), '@update-manager-update' => url('admin/config/modules/update'), '@update-manager-install' => url('admin/config/modules/install'))) . '</p>';
        }
        else {
          $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 manager</em> module 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>';
        }
      }
      else {
        $output .= '<p>' . t('Each time a module is updated, it is important that <a href="@update-php">update.php</a> is run. If you enable the <em>Update manager</em> module, it will provide a report about new versions of modules (and themes) as they are released, can notify you via e-mail if your site is out of date, and let you install missing updates. Regular review of available updates is essential to maintaining a secure and current site.', array('@update-php' => $base_url . '/update.php')) . '</p>';
      }
102
      return $output;
103
104
    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>';
105
    case 'admin/structure/block/manage':
106
      if ($arg[4] == 'system' && $arg[5] == 'powered-by') {
107
        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>';
108
      }
109
      break;
110
    case 'admin/config/development/maintenance':
111
112
113
114
      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>';
      }
115
116
    case 'admin/config/system/actions':
    case 'admin/config/system/actions/manage':
117
118
      $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>';
119
      if (module_exists('trigger')) {
120
        $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>';
121
      }
122
      return $output;
123
    case 'admin/config/system/actions/configure':
124
      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").');
125
    case 'admin/config/people/ip-blocking':
126
      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>';
127
    case 'admin/reports/status':
128
      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>';
129
  }
Dries's avatar
   
Dries committed
130
131
}

132
/**
133
 * Implement hook_theme().
134
 */
135
function system_theme() {
136
  return array_merge(drupal_common_theme(), array(
137
    'system_themes_form' => array(
138
      'render element' => 'form',
139
      'file' => 'system.admin.inc',
140
    ),
141
    'system_settings_form' => array(
142
      'render element' => 'form',
143
144
    ),
    'confirm_form' => array(
145
      'render element' => 'form',
146
    ),
147
    'system_modules_fieldset' => array(
148
      'render element' => 'form',
149
      'file' => 'system.admin.inc',
150
    ),
151
    'system_modules_incompatible' => array(
152
      'variables' => array('message' => NULL),
153
      'file' => 'system.admin.inc',
154
    ),
155
    'system_modules_uninstall' => array(
156
      'render element' => 'form',
157
      'file' => 'system.admin.inc',
158
159
    ),
    'status_report' => array(
160
      'render element' => 'requirements',
161
      'file' => 'system.admin.inc',
162
163
    ),
    'admin_page' => array(
164
      'variables' => array('blocks' => NULL),
165
      'file' => 'system.admin.inc',
166
167
    ),
    'admin_block' => array(
168
      'variables' => array('block' => NULL),
169
      'file' => 'system.admin.inc',
170
171
    ),
    'admin_block_content' => array(
172
      'variables' => array('content' => NULL),
173
      'file' => 'system.admin.inc',
174
175
    ),
    'system_admin_by_module' => array(
176
      'variables' => array('menu_items' => NULL),
177
      'file' => 'system.admin.inc',
178
    ),
179
    'system_powered_by' => array(
180
      'variables' => array(),
181
    ),
182
183
    'system_compact_link' => array(
      'variables' => array(),
184
    ),
185
    'system_run_cron_image' => array(
186
      'variables' => array('image_path' => NULL),
187
    ),
188
    'system_date_time_settings' => array(
189
      'render element' => 'form',
190
191
      'file' => 'system.admin.inc',
    ),
192
193
  ));
}
194

Dries's avatar
   
Dries committed
195
/**
196
 * Implement hook_permission().
Dries's avatar
   
Dries committed
197
 */
198
function system_permission() {
199
  return array(
200
201
202
203
    'administer site configuration' => array(
      'title' => t('Administer site configuration'),
      'description' => t('Configure site-wide settings such as module or theme administration settings.'),
    ),
204
205
206
207
    'administer software updates' => array(
      'title' => t('Administer software updates'),
      'description' => t('Run the update.php script.'),
    ),
208
209
210
211
212
213
214
215
216
217
218
219
    '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.'),
    ),
220
221
222
223
    'access site in maintenance mode' => array(
      'title' => t('Access site in maintenance mode'),
      'description' => t('Log in when the site is in maintenance mode.'),
    ),
224
225
226
227
228
229
230
231
    '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.'),
    ),
232
  );
Dries's avatar
   
Dries committed
233
234
}

235
/**
236
 * Implement hook_rdf_namespaces().
237
238
239
240
241
 */
function system_rdf_namespaces() {
  return array(
    'admin'    => 'http://webns.net/mvcb/',
    'content'  => 'http://purl.org/rss/1.0/modules/content/',
242
    'dc'       => 'http://purl.org/dc/terms/',
243
244
245
246
247
    '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/',
248
    'tags'     => 'http://www.holygoat.co.uk/owl/redwood/0.1/tags/',
249
    'sioc'     => 'http://rdfs.org/sioc/ns#',
250
251
252
253
    'sioct'    => 'http://rdfs.org/sioc/types#',
    'ctag'     => 'http://commontag.org/ns#',
    'skos'     => 'http://www.w3.org/2004/02/skos/core#',
    'xsd'      => 'http://www.w3.org/2001/XMLSchema#',
254
255
256
  );
}

257
258
259
260
261
262
263
264
265
266
267
268
269
/**
 * Implement hook_hook_info().
 */
function system_hook_info() {
  $hooks['token_info'] = array(
    'group' => 'tokens',
  );
  $hooks['tokens'] = array(
    'group' => 'tokens',
  );
  return $hooks;
}

270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
/**
 * 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,
    ),
  );
}

286
/**
287
 * Implement hook_element_info().
288
 */
289
290
291
function system_element_info() {
  // Top level elements.
  $types['form'] = array(
292
293
    '#method' => 'post',
    '#action' => request_uri(),
294
    '#theme_wrappers' => array('form'),
295
  );
296
  $types['page'] = array(
297
298
    '#show_messages' => TRUE,
    '#theme' => 'page',
299
    '#theme_wrappers' => array('html'),
300
  );
301
  $types['list'] = array(
302
303
304
305
306
    '#title' => '',
    '#list_type' => 'ul',
    '#attributes' => array(),
    '#items' => array(),
  );
307
308
309
310
311
312
313
  // By default, we don't want AJAX commands being rendered in the context of an
  // HTML page, so we don't provide defaults for #theme or #theme_wrappers.
  // However, modules can set these properties (for example, to provide an HTML
  // debugging page that displays rather than executes AJAX commands).
  $types['ajax_commands'] = array(
    '#ajax_commands' => array(),
  );
314

315
316
317
318
319
320
  $types['html_tag'] = array(
    '#theme' => 'html_tag',
    '#attributes' => array(),
    '#value' => NULL,
  );

321
322
  // Input elements.
  $types['submit'] = array(
323
324
325
326
    '#input' => TRUE,
    '#name' => 'op',
    '#button_type' => 'submit',
    '#executes_submit_callback' => TRUE,
327
    '#process' => array('ajax_process_form'),
328
    '#theme_wrappers' => array('button'),
329
  );
330
  $types['button'] = array(
331
332
333
334
    '#input' => TRUE,
    '#name' => 'op',
    '#button_type' => 'submit',
    '#executes_submit_callback' => FALSE,
335
    '#process' => array('ajax_process_form'),
336
    '#theme_wrappers' => array('button'),
337
  );
338
  $types['image_button'] = array(
339
340
341
    '#input' => TRUE,
    '#button_type' => 'submit',
    '#executes_submit_callback' => TRUE,
342
    '#process' => array('ajax_process_form'),
343
344
345
    '#return_value' => TRUE,
    '#has_garbage_value' => TRUE,
    '#src' => NULL,
346
    '#theme_wrappers' => array('image_button'),
347
  );
348
  $types['textfield'] = array(
349
350
351
352
    '#input' => TRUE,
    '#size' => 60,
    '#maxlength' => 128,
    '#autocomplete_path' => FALSE,
353
    '#process' => array('form_process_text_format', 'ajax_process_form'),
354
    '#theme' => 'textfield',
355
    '#theme_wrappers' => array('form_element'),
356
  );
357
  $types['password'] = array(
358
359
360
    '#input' => TRUE,
    '#size' => 60,
    '#maxlength' => 128,
361
    '#process' => array('ajax_process_form'),
362
    '#theme' => 'password',
363
    '#theme_wrappers' => array('form_element'),
364
  );
365
  $types['password_confirm'] = array(
366
    '#input' => TRUE,
367
    '#process' => array('form_process_password_confirm'),
368
    '#theme_wrappers' => array('form_element'),
369
  );
370
  $types['textarea'] = array(
371
372
373
374
    '#input' => TRUE,
    '#cols' => 60,
    '#rows' => 5,
    '#resizable' => TRUE,
375
    '#process' => array('form_process_text_format', 'ajax_process_form'),
376
    '#theme' => 'textarea',
377
    '#theme_wrappers' => array('form_element'),
378
  );
379
  $types['radios'] = array(
380
    '#input' => TRUE,
381
    '#process' => array('form_process_radios'),
382
    '#theme_wrappers' => array('radios'),
383
    '#pre_render' => array('form_pre_render_conditional_form_element'),
384
  );
385
  $types['radio'] = array(
386
387
    '#input' => TRUE,
    '#default_value' => NULL,
388
    '#process' => array('ajax_process_form'),
389
    '#theme' => 'radio',
390
    '#theme_wrappers' => array('form_element'),
391
    '#form_element_skip_title' => TRUE,
392
  );
393
  $types['checkboxes'] = array(
394
395
    '#input' => TRUE,
    '#tree' => TRUE,
396
    '#process' => array('form_process_checkboxes'),
397
    '#theme_wrappers' => array('checkboxes'),
398
    '#pre_render' => array('form_pre_render_conditional_form_element'),
399
  );
400
  $types['checkbox'] = array(
401
402
    '#input' => TRUE,
    '#return_value' => 1,
403
    '#process' => array('ajax_process_form'),
404
    '#theme' => 'checkbox',
405
    '#theme_wrappers' => array('form_element'),
406
    '#form_element_skip_title' => TRUE,
407
  );
408
  $types['select'] = array(
409
410
411
    '#input' => TRUE,
    '#size' => 0,
    '#multiple' => FALSE,
412
    '#process' => array('ajax_process_form'),
413
    '#theme' => 'select',
414
    '#theme_wrappers' => array('form_element'),
415
  );
416
  $types['weight'] = array(
417
418
419
    '#input' => TRUE,
    '#delta' => 10,
    '#default_value' => 0,
420
    '#process' => array('form_process_weight', 'ajax_process_form'),
421
  );
422
  $types['date'] = array(
423
424
    '#input' => TRUE,
    '#element_validate' => array('date_validate'),
425
    '#process' => array('form_process_date'),
426
    '#theme' => 'date',
427
    '#theme_wrappers' => array('form_element'),
428
  );
429
  $types['file'] = array(
430
431
    '#input' => TRUE,
    '#size' => 60,
432
    '#theme' => 'file',
433
    '#theme_wrappers' => array('form_element'),
434
  );
435
  $types['tableselect'] = array(
436
437
438
439
440
441
    '#input' => TRUE,
    '#js_select' => TRUE,
    '#multiple' => TRUE,
    '#process' => array('form_process_tableselect'),
    '#options' => array(),
    '#empty' => '',
442
    '#theme' => 'tableselect',
443
  );
444

445
446
  // Form structure.
  $types['item'] = array(
447
    '#markup' => '',
448
    '#pre_render' => array('drupal_pre_render_markup'),
449
    '#theme_wrappers' => array('form_element'),
450
  );
451
  $types['hidden'] = array(
452
    '#input' => TRUE,
453
    '#process' => array('ajax_process_form'),
454
    '#theme' => 'hidden',
455
  );
456
  $types['value'] = array(
457
458
    '#input' => TRUE,
  );
459
  $types['markup'] = array(
460
    '#markup' => '',
461
462
463
464
    '#pre_render' => array('drupal_pre_render_markup'),
  );
  $types['link'] = array(
    '#pre_render' => array('drupal_pre_render_link', 'drupal_pre_render_markup'),
465
  );
466
  $types['fieldset'] = array(
467
468
469
    '#collapsible' => FALSE,
    '#collapsed' => FALSE,
    '#value' => NULL,
470
    '#process' => array('form_process_fieldset', 'ajax_process_form'),
471
    '#pre_render' => array('form_pre_render_fieldset'),
472
    '#theme_wrappers' => array('fieldset'),
473
  );
474
  $types['vertical_tabs'] = array(
475
    '#theme_wrappers' => array('vertical_tabs'),
476
477
478
    '#default_tab' => '',
    '#process' => array('form_process_vertical_tabs'),
  );
479
480
481
482
483
484

  $types['container'] = array(
    '#theme_wrappers' => array('container'),
    '#process' => array('form_process_container'),
  );

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

490
  return $types;
491
492
}

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
    'delivery callback' => 'ajax_deliver',
515
    'access callback' => TRUE,
516
    'type' => MENU_CALLBACK,
517
518
    'file path' => 'includes',
    'file' => 'form.inc',
519
  );
520
521
522
523
524
  $items['system/timezone'] = array(
    'title' => 'Time zone',
    'page callback' => 'system_timezone',
    'access callback' => TRUE,
    'type' => MENU_CALLBACK,
525
    'file' => 'system.admin.inc',
526
  );
527
528
529
530
531
  $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,
532
    'file' => 'system.admin.inc',
533
  );
534
  $items['admin'] = array(
535
    'title' => 'Administer',
536
537
538
    'access arguments' => array('access administration pages'),
    'page callback' => 'system_main_admin_page',
    'weight' => 9,
539
    'menu_name' => 'management',
540
541
    'theme callback' => 'variable_get',
    'theme arguments' => array('admin_theme'),
542
    'file' => 'system.admin.inc',
543
544
  );
  $items['admin/compact'] = array(
545
    'title' => 'Compact mode',
546
    'page callback' => 'system_admin_compact_page',
547
    'access arguments' => array('access administration pages'),
548
    'type' => MENU_CALLBACK,
549
    'file' => 'system.admin.inc',
550
551
  );
  $items['admin/by-task'] = array(
552
    'title' => 'By task',
553
    'page callback' => 'system_main_admin_page',
554
    'access arguments' => array('access administration pages'),
555
    'type' => MENU_DEFAULT_LOCAL_TASK,
556
    'file' => 'system.admin.inc',
557
558
  );
  $items['admin/by-module'] = array(
559
    'title' => 'By module',
560
    'page callback' => 'system_admin_by_module',
561
    'access arguments' => array('access administration pages'),
562
563
    'type' => MENU_LOCAL_TASK,
    'weight' => 2,
564
    'file' => 'system.admin.inc',
565
  );
566

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

610
  foreach (list_themes() as $theme) {
611
    $items['admin/appearance/settings/' . $theme->name] = array(
612
613
614
615
616
      '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),
617
      'file' => 'system.admin.inc',
618
    );
Dries's avatar
   
Dries committed
619
  }
drumm's avatar
drumm committed
620

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

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

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

734
735
  // Configuration.
  $items['admin/config/development'] = array(
736
737
738
739
740
    'title' => 'Development',
    'description' => 'Development tools.',
    'position' => 'left',
    'weight' => 10,
    'page callback' => 'system_admin_menu_block_page',
741
    'access arguments' => array('access administration pages'),
742
    'file' => 'system.admin.inc',
743
744
745
746
747
748
749
  );
  $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'),
750
    'file' => 'system.admin.inc',
751
  );
752
753
754
755
756
757
  $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'),
758
    'file' => 'system.admin.inc',
759
  );
760
  $items['admin/config/media'] = array(
761
762
763
764
765
    'title' => 'Media',
    'description' => 'Media tools.',
    'position' => 'left',
    'weight' => 10,
    'page callback' => 'system_admin_menu_block_page',
766
    'access arguments' => array('access administration pages'),
767
    'file' => 'system.admin.inc',
768
769
  );
  $items['admin/config/media/file-system'] = array(
770
    'title' => 'File system',
771
    'description' => 'Tell Drupal where to store uploaded files and how they are accessed.',
772
    'page callback' => 'drupal_get_form',
773
    'page arguments' => array('system_file_system_settings'),
774
    'access arguments' => array('administer site configuration'),
775
    'file' => 'system.admin.inc',
776
  );
777
778
779
    $items['admin/config/media/image-toolkit'] = array(
    'title' => 'Image toolkit',
    'description' => 'Choose which image toolkit to use if you have installed optional toolkits.',