system.module 138 KB
Newer Older
Dries's avatar
   
Dries committed
1
2
<?php

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

8
9
10
/**
 * Maximum age of temporary files in seconds.
 */
11
const DRUPAL_MAXIMUM_TEMP_FILE_AGE = 21600;
12

13
14
15
/**
 * Default interval for automatic cron executions in seconds.
 */
16
const DRUPAL_CRON_DEFAULT_THRESHOLD = 10800;
17

18
19
20
/**
 * New users will be set to the default time zone at registration.
 */
21
const DRUPAL_USER_TIMEZONE_DEFAULT = 0;
22
23
24
25

/**
 * New users will get an empty time zone at registration.
 */
26
const DRUPAL_USER_TIMEZONE_EMPTY = 1;
27
28
29
30

/**
 * New users will select their own timezone at registration.
 */
31
const DRUPAL_USER_TIMEZONE_SELECT = 2;
32

33
34
35
 /**
 * Disabled option on forms and settings
 */
36
const DRUPAL_DISABLED = 0;
37
38
39
40

/**
 * Optional option on forms and settings
 */
41
const DRUPAL_OPTIONAL = 1;
42
43
44
45

/**
 * Required option on forms and settings
 */
46
const DRUPAL_REQUIRED = 2;
47

48
49
50
51
52
53
54
/**
 * Maximum number of values in a weight select element.
 *
 * If the number of values is over the maximum, a text field is used instead.
 */
const DRUPAL_WEIGHT_SELECT_MAX = 100;

55
/**
56
 * Return only visible regions.
57
58
 *
 * @see system_region_list()
59
 */
60
const REGIONS_VISIBLE = 'visible';
61
62

/**
63
 * Return all regions.
64
65
 *
 * @see system_region_list()
66
 */
67
const REGIONS_ALL = 'all';
68

Dries's avatar
   
Dries committed
69
/**
70
 * Implements hook_help().
Dries's avatar
   
Dries committed
71
 */
72
function system_help($path, $arg) {
73
74
  global $base_url;

75
  switch ($path) {
76
    case 'admin/help#system':
77
78
      $output = '';
      $output .= '<h3>' . t('About') . '</h3>';
79
      $output .= '<p>' . t('The System module is integral to the site, 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 and disabling 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. For more information, see the online handbook entry for <a href="@system">System module</a>.', array('@system' => 'http://drupal.org/handbook/modules/system')) . '</p>';
80
81
82
      $output .= '<h3>' . t('Uses') . '</h3>';
      $output .= '<dl>';
      $output .= '<dt>' . t('Managing modules') . '</dt>';
83
      $output .= '<dd>' . t('The System module allows users with the appropriate permissions to enable and disable modules on the <a href="@modules">Modules administration page</a>. Drupal comes with a number of core modules, and each module provides a discrete set of features and may be enabled or disabled depending on the needs of the site. Many 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/modules'), '@drupal-modules' => 'http://drupal.org/project/modules')) . '</dd>';
84
85
86
87
88
      $output .= '<dt>' . t('Managing themes') . '</dt>';
      $output .= '<dd>' . t('The System module allows users with the appropriate permissions to enable and disable themes on the <a href="@themes">Appearance administration page</a>. Themes 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')) . '</dd>';
      $output .= '<dt>' . t('Managing caching') . '</dt>';
      $output .= '<dd>' . t("The System module allows users with the appropriate permissions to manage caching on the <a href='@cache-settings'>Performance settings page</a>. Drupal has a robust caching system that allows the efficient re-use of previously-constructed web pages and web page components. Pages requested by anonymous users are stored in a compressed format; depending on your site configuration and the amount of your web traffic tied to anonymous visitors, the caching system may significantly increase the speed of your site.", array('@cache-settings' => url('admin/config/development/performance'))) . '</dd>';
      $output .= '<dt>' . t('Performing system maintenance') . '</dt>';
89
      $output .= '<dd>' . t('In order for the site and its modules to continue to operate well, a set of routine administrative operations must run on a regular basis. The System module manages this task by making use of a system cron job. You can verify the status of cron tasks by visiting the <a href="@status">Status report page</a>. For more information, see the online handbook entry for <a href="@handbook">configuring cron jobs</a>. You can set up cron job by visiting <a href="@cron">Cron configuration</a> page', array('@status' => url('admin/reports/status'), '@handbook' => 'http://drupal.org/cron', '@cron' => url('admin/config/system/cron'))) . '</dd>';
90
91
      $output .= '<dt>' . t('Configuring basic site settings') . '</dt>';
      $output .= '<dd>' . t('The System module also handles 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'))) . '</dd>';
92
93
      $output .= '<dt>' . t('Configuring actions') . '</dt>';
      $output .= '<dd>' . 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 <a href="@trigger-help">Trigger module</a>, 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. Visit the <a href="@actions">Actions page</a> to configure actions.', array('@trigger-help' => url('admin/help/trigger'), '@actions' => url('admin/config/system/actions'))) . '</dd>';
94
      $output .= '</dl>';
95
      return $output;
96
    case 'admin/index':
97
      return '<p>' . t('This page shows you all available administration tasks for each module.') . '</p>';
98
    case 'admin/appearance':
99
      $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>';
100
      return $output;
101
    case 'admin/appearance/settings/' . $arg[3]:
102
103
104
      $theme_list = list_themes();
      $theme = $theme_list[$arg[3]];
      return '<p>' . t('These options control the display settings for the %name theme. When your site is displayed using this theme, these settings will be used.', array('%name' => $theme->info['name'])) . '</p>';
105
    case 'admin/appearance/settings':
106
      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>';
107
    case 'admin/modules':
108
      $output = '<p>' . t('Download additional <a href="@modules">contributed modules</a> to extend Drupal\'s functionality.', array('@modules' => 'http://drupal.org/project/modules')) . '</p>';
109
110
      if (module_exists('update')) {
        if (update_manager_access()) {
111
          $output .= '<p>' . t('Regularly review and install <a href="@updates">available updates</a> to maintain a secure and current site. Always run the <a href="@update-php">update script</a> each time a module is updated.', array('@update-php' => $base_url . '/core/update.php', '@updates' => url('admin/reports/updates'))) . '</p>';
112
113
        }
        else {
114
          $output .= '<p>' . t('Regularly review <a href="@updates">available updates</a> to maintain a secure and current site. Always run the <a href="@update-php">update script</a> each time a module is updated.', array('@update-php' => $base_url . '/core/update.php', '@updates' => url('admin/reports/updates'))) . '</p>';
115
116
117
        }
      }
      else {
118
        $output .= '<p>' . t('Regularly review available updates to maintain a secure and current site. Always run the <a href="@update-php">update script</a> each time a module is updated. Enable the Update manager module to update and install modules and themes.', array('@update-php' => $base_url . '/core/update.php')) . '</p>';
119
      }
120
      return $output;
121
    case 'admin/modules/uninstall':
122
      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>.', array('@modules' => url('admin/modules'))) . '</p>';
123
    case 'admin/structure/block/manage':
124
      if ($arg[4] == 'system' && $arg[5] == 'powered-by') {
125
        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>';
126
      }
127
      break;
128
    case 'admin/config/development/maintenance':
129
130
      global $user;
      if ($user->uid == 1) {
131
        return '<p>' . t('Use maintenance mode when making major updates, particularly if the updates could disrupt visitors or the update process. Examples include upgrading, importing or exporting content, modifying a theme, modifying content types, and making backups.') . '</p>';
132
      }
133
      break;
134
135
    case 'admin/config/system/actions':
    case 'admin/config/system/actions/manage':
136
      $output = '';
137
      $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 need to be created and configured before they can be used because they have options that need to be specified; for example, sending an e-mail to a specified address or unpublishing content containing certain words. To create an advanced action, select the action from the drop-down list in the advanced action section below and click the <em>Create</em> button.') . '</p>';
138
      if (module_exists('trigger')) {
139
        $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>';
140
      }
141
      return $output;
142
    case 'admin/config/system/actions/configure':
143
      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").');
144
    case 'admin/config/people/ip-blocking':
145
      return '<p>' . t('IP addresses listed here are blocked from your site. Blocked addresses are completely forbidden from accessing the site and instead see a brief message explaining the situation.') . '</p>';
146
    case 'admin/reports/status':
147
      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>';
148
  }
Dries's avatar
   
Dries committed
149
150
}

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

Dries's avatar
   
Dries committed
211
/**
212
 * Implements hook_permission().
Dries's avatar
   
Dries committed
213
 */
214
function system_permission() {
215
  return array(
216
217
218
    'administer modules' => array(
      'title' => t('Administer modules'),
    ),
219
220
    'administer site configuration' => array(
      'title' => t('Administer site configuration'),
221
      'restrict access' => TRUE,
222
    ),
223
224
225
    'administer themes' => array(
      'title' => t('Administer themes'),
    ),
226
    'administer software updates' => array(
227
228
      'title' => t('Administer software updates'),
      'restrict access' => TRUE,
229
    ),
230
231
232
233
    'administer actions' => array(
      'title' => t('Administer actions'),
    ),
    'access administration pages' => array(
234
      'title' => t('Use the administration pages and help'),
235
    ),
236
    'access site in maintenance mode' => array(
237
      'title' => t('Use the site in maintenance mode'),
238
    ),
239
240
241
242
    'view the administration theme' => array(
      'title' => t('View the administration theme'),
      'description' => variable_get('admin_theme') ? '' : t('This is only used when the site is configured to use a separate administration theme on the <a href="@appearance-url">Appearance</a> page.', array('@appearance-url' => url('admin/appearance'))),
    ),
243
    'access site reports' => array(
244
      'title' => t('View site reports'),
245
246
247
248
    ),
    'block IP addresses' => array(
      'title' => t('Block IP addresses'),
    ),
249
  );
Dries's avatar
   
Dries committed
250
251
}

252
/**
253
 * Implements hook_hook_info().
254
255
256
257
258
 */
function system_hook_info() {
  $hooks['token_info'] = array(
    'group' => 'tokens',
  );
259
260
261
  $hooks['token_info_alter'] = array(
    'group' => 'tokens',
  );
262
263
264
  $hooks['tokens'] = array(
    'group' => 'tokens',
  );
265
266
267
268
  $hooks['tokens_alter'] = array(
    'group' => 'tokens',
  );

269
270
271
  return $hooks;
}

272
/**
273
 * Implements hook_entity_info().
274
275
276
277
278
 */
function system_entity_info() {
  return array(
    'file' => array(
      'label' => t('File'),
279
      'base table' => 'file_managed',
280
      'entity keys' => array(
281
        'id' => 'fid',
282
        'label' => 'filename',
283
284
285
286
287
288
      ),
      'static cache' => FALSE,
    ),
  );
}

289
/**
290
 * Implements hook_element_info().
291
 */
292
293
294
function system_element_info() {
  // Top level elements.
  $types['form'] = array(
295
296
    '#method' => 'post',
    '#action' => request_uri(),
297
    '#theme_wrappers' => array('form'),
298
  );
299
  $types['page'] = array(
300
301
    '#show_messages' => TRUE,
    '#theme' => 'page',
302
    '#theme_wrappers' => array('html'),
303
  );
304
  // By default, we don't want Ajax commands being rendered in the context of an
305
306
  // 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
307
  // debugging page that displays rather than executes Ajax commands).
308
309
310
311
  $types['ajax'] = array(
    '#header' => TRUE,
    '#commands' => array(),
    '#error' => NULL,
312
  );
313
314
  $types['html_tag'] = array(
    '#theme' => 'html_tag',
315
    '#pre_render' => array('drupal_pre_render_conditional_comments'),
316
317
318
    '#attributes' => array(),
    '#value' => NULL,
  );
319
320
321
322
323
324
  $types['styles'] = array(
    '#items' => array(),
    '#pre_render' => array('drupal_pre_render_styles'),
    '#group_callback' => 'drupal_group_css',
    '#aggregate_callback' => 'drupal_aggregate_css',
  );
325
326
327
328
329
330
  $types['scripts'] = array(
    '#items' => array(),
    '#pre_render' => array('drupal_pre_render_scripts'),
    '#group_callback' => 'drupal_group_js',
    '#aggregate_callback' => 'drupal_aggregate_js',
  );
331

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

469
470
  // Form structure.
  $types['item'] = array(
471
    '#markup' => '',
472
    '#pre_render' => array('drupal_pre_render_markup'),
473
    '#theme_wrappers' => array('form_element'),
474
  );
475
  $types['hidden'] = array(
476
    '#input' => TRUE,
477
    '#process' => array('ajax_process_form'),
478
    '#theme' => 'hidden',
479
  );
480
  $types['value'] = array(
481
482
    '#input' => TRUE,
  );
483
  $types['markup'] = array(
484
    '#markup' => '',
485
486
487
488
    '#pre_render' => array('drupal_pre_render_markup'),
  );
  $types['link'] = array(
    '#pre_render' => array('drupal_pre_render_link', 'drupal_pre_render_markup'),
489
  );
490
  $types['fieldset'] = array(
491
492
493
    '#collapsible' => FALSE,
    '#collapsed' => FALSE,
    '#value' => NULL,
494
    '#process' => array('form_process_fieldset', 'ajax_process_form'),
495
    '#pre_render' => array('form_pre_render_fieldset'),
496
    '#theme_wrappers' => array('fieldset'),
497
  );
498
  $types['vertical_tabs'] = array(
499
    '#theme_wrappers' => array('vertical_tabs'),
500
501
502
    '#default_tab' => '',
    '#process' => array('form_process_vertical_tabs'),
  );
503
504
505
506
507

  $types['container'] = array(
    '#theme_wrappers' => array('container'),
    '#process' => array('form_process_container'),
  );
508
509
510
511
512
  $types['actions'] = array(
    '#theme_wrappers' => array('container'),
    '#process' => array('form_process_actions', 'form_process_container'),
    '#weight' => 100,
  );
513

514
  $types['token'] = array(
515
    '#input' => TRUE,
516
    '#theme' => 'hidden',
517
518
  );

519
  return $types;
520
521
}

Dries's avatar
   
Dries committed
522
/**
523
 * Implements hook_menu().
Dries's avatar
   
Dries committed
524
 */
525
526
function system_menu() {
  $items['system/files'] = array(
527
    'title' => 'File download',
528
    'page callback' => 'file_download',
529
530
531
532
533
534
535
536
    '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'),
537
    'access callback' => TRUE,
538
539
    'type' => MENU_CALLBACK,
  );
540
  $items['system/ajax'] = array(
541
    'title' => 'AHAH callback',
542
    'page callback' => 'ajax_form_callback',
543
    'delivery callback' => 'ajax_deliver',
544
    'access callback' => TRUE,
545
    'theme callback' => 'ajax_base_page_theme',
546
    'type' => MENU_CALLBACK,
547
    'file path' => 'core/includes',
548
    'file' => 'form.inc',
549
  );
550
551
552
553
554
  $items['system/timezone'] = array(
    'title' => 'Time zone',
    'page callback' => 'system_timezone',
    'access callback' => TRUE,
    'type' => MENU_CALLBACK,
555
    'file' => 'system.admin.inc',
556
  );
557
  $items['admin'] = array(
558
    'title' => 'Administration',
559
    'access arguments' => array('access administration pages'),
560
    'page callback' => 'system_admin_menu_block_page',
561
    'weight' => 9,
562
    'menu_name' => 'management',
563
    'file' => 'system.admin.inc',
564
565
  );
  $items['admin/compact'] = array(
566
    'title' => 'Compact mode',
567
    'page callback' => 'system_admin_compact_page',
568
    'access arguments' => array('access administration pages'),
569
    'type' => MENU_CALLBACK,
570
    'file' => 'system.admin.inc',
571
  );
572
573
  $items['admin/tasks'] = array(
    'title' => 'Tasks',
574
    'type' => MENU_DEFAULT_LOCAL_TASK,
575
    'weight' => -20,
576
  );
577
578
579
  $items['admin/index'] = array(
    'title' => 'Index',
    'page callback' => 'system_admin_index',
580
    'access arguments' => array('access administration pages'),
581
    'type' => MENU_LOCAL_TASK,
582
    'weight' => -18,
583
    'file' => 'system.admin.inc',
584
  );
585

586
  // Menu items that are basically just menu blocks.
587
588
  $items['admin/structure'] = array(
    'title' => 'Structure',
589
    'description' => 'Administer blocks, content types, menus, etc.',
590
    'position' => 'right',
591
    'weight' => -8,
592
    'page callback' => 'system_admin_menu_block_page',
593
    'access arguments' => array('access administration pages'),
594
    'file' => 'system.admin.inc',
595
  );
596
597
598
  // Appearance.
  $items['admin/appearance'] = array(
    'title' => 'Appearance',
599
    'description' => 'Select and configure your themes.',
600
    'page callback' => 'system_themes_page',
601
    'access arguments' => array('administer themes'),
602
    'position' => 'left',
603
    'weight' => -6,
604
    'file' => 'system.admin.inc',
605
  );
606
  $items['admin/appearance/list'] = array(
607
    'title' => 'List',
608
    'description' => 'Select and configure your theme',
609
610
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -1,
611
    'file' => 'system.admin.inc',
612
  );
613
614
615
  $items['admin/appearance/enable'] = array(
    'title' => 'Enable theme',
    'page callback' => 'system_theme_enable',
616
    'access arguments' => array('administer themes'),
617
618
619
620
621
622
    'type' => MENU_CALLBACK,
    'file' => 'system.admin.inc',
  );
  $items['admin/appearance/disable'] = array(
    'title' => 'Disable theme',
    'page callback' => 'system_theme_disable',
623
    'access arguments' => array('administer themes'),
624
625
626
627
628
629
    'type' => MENU_CALLBACK,
    'file' => 'system.admin.inc',
  );
  $items['admin/appearance/default'] = array(
    'title' => 'Set default theme',
    'page callback' => 'system_theme_default',
630
    'access arguments' => array('administer themes'),
631
632
633
    'type' => MENU_CALLBACK,
    'file' => 'system.admin.inc',
  );
634
  $items['admin/appearance/settings'] = array(
635
    'title' => 'Settings',
636
    'description' => 'Configure default and theme specific settings.',
637
    'page callback' => 'drupal_get_form',
638
    'page arguments' => array('system_theme_settings'),
639
    'access arguments' => array('administer themes'),
640
    'type' => MENU_LOCAL_TASK,
641
    'file' => 'system.admin.inc',
642
    'weight' => 20,
643
  );
644
  // Theme configuration subtabs.
645
  $items['admin/appearance/settings/global'] = array(
646
    'title' => 'Global settings',
647
648
649
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -1,
  );
Dries's avatar
   
Dries committed
650

651
  foreach (list_themes() as $key => $theme) {
652
    $items['admin/appearance/settings/' . $theme->name] = array(
653
654
655
656
      'title' => $theme->info['name'],
      'page arguments' => array('system_theme_settings', $theme->name),
      'type' => MENU_LOCAL_TASK,
      'access callback' => '_system_themes_access',
657
      'access arguments' => array($key),
658
      'file' => 'system.admin.inc',
659
    );
Dries's avatar
   
Dries committed
660
  }
drumm's avatar
drumm committed
661

662
  // Modules.
663
  $items['admin/modules'] = array(
664
    'title' => 'Modules',
665
    'description' => 'Extend site functionality.',
666
667
    'page callback' => 'drupal_get_form',
    'page arguments' => array('system_modules'),
668
    'access arguments' => array('administer modules'),
669
    'file' => 'system.admin.inc',
670
    'weight' => -2,
671
  );
672
  $items['admin/modules/list'] = array(
673
    'title' => 'List',
674
675
    'type' => MENU_DEFAULT_LOCAL_TASK,
  );
676
  $items['admin/modules/list/confirm'] = array(
677
    'title' => 'List',
678
    'access arguments' => array('administer modules'),
679
    'type' => MENU_VISIBLE_IN_BREADCRUMB,
680
  );
681
  $items['admin/modules/uninstall'] = array(
682
    'title' => 'Uninstall',
683
    'page arguments' => array('system_modules_uninstall'),
684
    'access arguments' => array('administer modules'),
685
    'type' => MENU_LOCAL_TASK,
686
    'file' => 'system.admin.inc',
687
    'weight' => 20,
688
  );
689
  $items['admin/modules/uninstall/confirm'] = array(
690
    'title' => 'Uninstall',
691
    'access arguments' => array('administer modules'),
692
    'type' => MENU_VISIBLE_IN_BREADCRUMB,
693
694
695
    'file' => 'system.admin.inc',
  );

696
  // Configuration.
697
698
  $items['admin/config'] = array(
    'title' => 'Configuration',
699
    'description' => 'Administer settings.',
700
701
    'page callback' => 'system_admin_config_page',
    'access arguments' => array('access administration pages'),
702
    'file' => 'system.admin.inc',
703
704
  );

705
  // IP address blocking.
706
  $items['admin/config/people/ip-blocking'] = array(
707
708
709
710
    'title' => 'IP address blocking',
    'description' => 'Manage blocked IP addresses.',
    'page callback' => 'system_ip_blocking',
    'access arguments' => array('block IP addresses'),
711
    'file' => 'system.admin.inc',
712
    'weight' => 10,
713
  );
714
  $items['admin/config/people/ip-blocking/delete/%blocked_ip'] = array(
715
716
    'title' => 'Delete IP address',
    'page callback' => 'drupal_get_form',
717
    'page arguments' => array('system_ip_blocking_delete', 5),
718
    'access arguments' => array('block IP addresses'),
719
    'file' => 'system.admin.inc',
720
721
  );

722
  // Media settings.
723
  $items['admin/config/media'] = array(
724
725
726
    'title' => 'Media',
    'description' => 'Media tools.',
    'position' => 'left',
727
    'weight' => -10,
728
    'page callback' => 'system_admin_menu_block_page',
729
    'access arguments' => array('access administration pages'),
730
    'file' => 'system.admin.inc',
731
732
  );
  $items['admin/config/media/file-system'] = array(
733
    'title' => 'File system',
734
    'description' => 'Tell Drupal where to store uploaded files and how they are accessed.',
735
    'page callback' => 'drupal_get_form',