system.module 123 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
145
      'file' => 'system.admin.inc',
    ),
    'confirm_form' => array(
146
      'render element' => 'form',
147
    ),
148
    'system_modules_fieldset' => array(
149
      'render element' => 'form',
150
      'file' => 'system.admin.inc',
151
    ),
152
    'system_modules_incompatible' => array(
153
      'variables' => array('message' => NULL),
154
      'file' => 'system.admin.inc',
155
    ),
156
    'system_modules_uninstall' => array(
157
      'render element' => 'form',
158
      'file' => 'system.admin.inc',
159
160
    ),
    'status_report' => array(
161
      'render element' => 'requirements',
162
      'file' => 'system.admin.inc',
163
164
    ),
    'admin_page' => array(
165
      'variables' => array('blocks' => NULL),
166
      'file' => 'system.admin.inc',
167
168
    ),
    'admin_block' => array(
169
      'variables' => array('block' => NULL),
170
      'file' => 'system.admin.inc',
171
172
    ),
    'admin_block_content' => array(
173
      'variables' => array('content' => NULL),
174
      'file' => 'system.admin.inc',
175
176
    ),
    'system_admin_by_module' => array(
177
      'variables' => array('menu_items' => NULL),
178
      'file' => 'system.admin.inc',
179
    ),
180
    'system_powered_by' => array(
181
      'variables' => array(),
182
    ),
183
    'meta_generator_html' => array(
184
      'variables' => array('version' => NULL),
185
186
    ),
    'meta_generator_header' => array(
187
188
189
190
      'variables' => array('version' => NULL),
    ),
    'system_compact_link' => array(
      'variables' => array(),
191
    ),
192
    'system_run_cron_image' => array(
193
      'variables' => array('image_path' => NULL),
194
    ),
195
    'system_date_time_settings' => array(
196
      'render element' => 'form',
197
198
      'file' => 'system.admin.inc',
    ),
199
200
  ));
}
201

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

242
/**
243
 * Implement hook_rdf_namespaces().
244
245
246
247
248
 */
function system_rdf_namespaces() {
  return array(
    'admin'    => 'http://webns.net/mvcb/',
    'content'  => 'http://purl.org/rss/1.0/modules/content/',
249
    'dc'       => 'http://purl.org/dc/terms/',
250
251
252
253
254
    '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/',
255
    'tags'     => 'http://www.holygoat.co.uk/owl/redwood/0.1/tags/',
256
    'sioc'     => 'http://rdfs.org/sioc/ns#',
257
258
259
260
    '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#',
261
262
263
  );
}

264
265
266
267
268
269
270
271
272
273
274
275
276
/**
 * Implement hook_hook_info().
 */
function system_hook_info() {
  $hooks['token_info'] = array(
    'group' => 'tokens',
  );
  $hooks['tokens'] = array(
    'group' => 'tokens',
  );
  return $hooks;
}

277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
/**
 * 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,
    ),
  );
}

293
/**
294
 * Implement hook_element_info().
295
 */
296
297
298
function system_element_info() {
  // Top level elements.
  $types['form'] = array(
299
300
    '#method' => 'post',
    '#action' => request_uri(),
301
    '#theme_wrappers' => array('form'),
302
  );
303
  $types['page'] = array(
304
305
    '#show_messages' => TRUE,
    '#theme' => 'page',
306
    '#theme_wrappers' => array('html'),
307
  );
308
  $types['list'] = array(
309
310
311
312
313
    '#title' => '',
    '#list_type' => 'ul',
    '#attributes' => array(),
    '#items' => array(),
  );
314
315
316
317
318
319
320
  // 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(),
  );
321

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

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

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

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

488
  return $types;
489
490
}

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

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

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

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

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

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

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