system.module 137 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
define('DRUPAL_MAXIMUM_TEMP_FILE_AGE', 21600);
12

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

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

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

48
/**
49
 * Return only visible regions.
50
51
 *
 * @see system_region_list()
52
53
54
55
 */
define('REGIONS_VISIBLE', 'visible');

/**
56
 * Return all regions.
57
58
 *
 * @see system_region_list()
59
60
61
 */
define('REGIONS_ALL', 'all');

Dries's avatar
   
Dries committed
62
/**
63
 * Implements hook_help().
Dries's avatar
   
Dries committed
64
 */
65
function system_help($path, $arg) {
66
67
  global $base_url;

68
  switch ($path) {
69
    case 'admin/help#system':
70
71
      $output = '';
      $output .= '<h3>' . t('About') . '</h3>';
72
      $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>';
73
74
75
      $output .= '<h3>' . t('Uses') . '</h3>';
      $output .= '<dl>';
      $output .= '<dt>' . t('Managing modules') . '</dt>';
76
      $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>';
77
78
79
80
81
      $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>';
82
      $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>';
83
84
      $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>';
85
86
      $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>';
87
      $output .= '</dl>';
88
      return $output;
89
    case 'admin/index':
90
      return '<p>' . t('This page shows you all available administration tasks for each module.') . '</p>';
91
    case 'admin/appearance':
92
      $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>';
93
      return $output;
94
    case 'admin/appearance/settings/' . $arg[3]:
95
96
97
      $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>';
98
    case 'admin/appearance/settings':
99
      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>';
100
    case 'admin/modules':
101
      $output = '<p>' . t('Download additional <a href="@modules">contributed modules</a> to extend Drupal\'s functionality.', array('@modules' => 'http://drupal.org/project/modules')) . '</p>';
102
103
      if (module_exists('update')) {
        if (update_manager_access()) {
104
          $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>';
105
106
        }
        else {
107
          $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>';
108
109
110
        }
      }
      else {
111
        $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>';
112
      }
113
      return $output;
114
    case 'admin/modules/uninstall':
115
      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>';
116
    case 'admin/structure/block/manage':
117
      if ($arg[4] == 'system' && $arg[5] == 'powered-by') {
118
        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>';
119
      }
120
      break;
121
    case 'admin/config/development/maintenance':
122
123
      global $user;
      if ($user->uid == 1) {
124
        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>';
125
      }
126
      break;
127
128
    case 'admin/config/system/actions':
    case 'admin/config/system/actions/manage':
129
      $output = '';
130
      $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>';
131
      if (module_exists('trigger')) {
132
        $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>';
133
      }
134
      return $output;
135
    case 'admin/config/system/actions/configure':
136
      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").');
137
    case 'admin/config/people/ip-blocking':
138
      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>';
139
    case 'admin/reports/status':
140
      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>';
141
  }
Dries's avatar
   
Dries committed
142
143
}

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

Dries's avatar
   
Dries committed
204
/**
205
 * Implements hook_permission().
Dries's avatar
   
Dries committed
206
 */
207
function system_permission() {
208
  return array(
209
210
211
    'administer modules' => array(
      'title' => t('Administer modules'),
    ),
212
213
    'administer site configuration' => array(
      'title' => t('Administer site configuration'),
214
      'restrict access' => TRUE,
215
    ),
216
217
218
    'administer themes' => array(
      'title' => t('Administer themes'),
    ),
219
    'administer software updates' => array(
220
221
      'title' => t('Administer software updates'),
      'restrict access' => TRUE,
222
    ),
223
224
225
226
    'administer actions' => array(
      'title' => t('Administer actions'),
    ),
    'access administration pages' => array(
227
      'title' => t('Use the administration pages and help'),
228
    ),
229
    'access site in maintenance mode' => array(
230
      'title' => t('Use the site in maintenance mode'),
231
    ),
232
233
234
235
    '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'))),
    ),
236
    'access site reports' => array(
237
      'title' => t('View site reports'),
238
239
240
241
    ),
    'block IP addresses' => array(
      'title' => t('Block IP addresses'),
    ),
242
  );
Dries's avatar
   
Dries committed
243
244
}

245
/**
246
 * Implements hook_hook_info().
247
248
249
250
251
 */
function system_hook_info() {
  $hooks['token_info'] = array(
    'group' => 'tokens',
  );
252
253
254
  $hooks['token_info_alter'] = array(
    'group' => 'tokens',
  );
255
256
257
  $hooks['tokens'] = array(
    'group' => 'tokens',
  );
258
259
260
261
  $hooks['tokens_alter'] = array(
    'group' => 'tokens',
  );

262
263
264
  return $hooks;
}

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

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

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

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

  $types['container'] = array(
    '#theme_wrappers' => array('container'),
    '#process' => array('form_process_container'),
  );
501
502
503
504
505
  $types['actions'] = array(
    '#theme_wrappers' => array('container'),
    '#process' => array('form_process_actions', 'form_process_container'),
    '#weight' => 100,
  );
506

507
  $types['token'] = array(
508
    '#input' => TRUE,
509
    '#theme' => 'hidden',
510
511
  );

512
  return $types;
513
514
}

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

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

644
  foreach (list_themes() as $key => $theme) {
645
    $items['admin/appearance/settings/' . $theme->name] = array(
646
647
648
649
      'title' => $theme->info['name'],
      'page arguments' => array('system_theme_settings', $theme->name),
      'type' => MENU_LOCAL_TASK,
      'access callback' => '_system_themes_access',
650
      'access arguments' => array($key),
651
      'file' => 'system.admin.inc',
652
    );
Dries's avatar
   
Dries committed
653
  }
drumm's avatar
drumm committed
654

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

689
  // Configuration.
690
691
  $items['admin/config'] = array(
    'title' => 'Configuration',
692
    'description' => 'Administer settings.',
693
694
    'page callback' => 'system_admin_config_page',
    'access arguments' => array('access administration pages'),
695
    'file' => 'system.admin.inc',
696
697
  );

698
  // IP address blocking.
699
  $items['admin/config/people/ip-blocking'] = array(
700
701
702
703
    'title' => 'IP address blocking',
    'description' => 'Manage blocked IP addresses.',
    'page callback' => 'system_ip_blocking',
    'access arguments' => array('block IP addresses'),
704
    'file' => 'system.admin.inc',
705
    'weight' => 10,
706
  );
707
  $items['admin/config/people/ip-blocking/delete/%blocked_ip'] = array(
708
709
    'title' => 'Delete IP address',
    'page callback' => 'drupal_get_form',
710
    'page arguments' => array('system_ip_blocking_delete', 5),
711
    'access arguments' => array('block IP addresses'),
712
    'file' => 'system.admin.inc',
713
714
  );

715
  // Media settings.
716
  $items['admin/config/media'] = array(
717
718
719
    'title' => 'Media',
    'description' => 'Media tools.',
    'position' => 'left',
720
    'weight' => -10,
721
    'page callback' => 'system_admin_menu_block_page',
722
    'access arguments' => array('access administration pages'),
723
    'file' => 'system.admin.inc',
724
725
  );
  $items['admin/config/media/file-system'] = array(
726
    'title' => 'File system',
727
    'description' => 'Tell Drupal where to store uploaded files and how they are accessed.',