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
/**
 * 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
59
/**
60
 * Implements hook_help().
Dries's avatar
   
Dries committed
61
 */
62
function system_help($path, $arg) {
63
64
  global $base_url;

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

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

Dries's avatar
   
Dries committed
200
/**
201
 * Implements hook_permission().
Dries's avatar
   
Dries committed
202
 */
203
function system_permission() {
204
  return array(
205
206
207
    'administer modules' => array(
      'title' => t('Administer modules'),
    ),
208
209
    'administer site configuration' => array(
      'title' => t('Administer site configuration'),
210
      'restrict access' => TRUE,
211
    ),
212
213
214
    'administer themes' => array(
      'title' => t('Administer themes'),
    ),
215
    'administer software updates' => array(
216
      'title' => t('Run software updates'),
217
    ),
218
219
220
221
    'administer actions' => array(
      'title' => t('Administer actions'),
    ),
    'access administration pages' => array(
222
      'title' => t('Use the administration pages and help'),
223
    ),
224
    'access site in maintenance mode' => array(
225
      'title' => t('Use the site in maintenance mode'),
226
    ),
227
    'access site reports' => array(
228
      'title' => t('View site reports'),
229
230
231
232
    ),
    'block IP addresses' => array(
      'title' => t('Block IP addresses'),
    ),
233
  );
Dries's avatar
   
Dries committed
234
235
}

236
/**
237
 * Implements hook_hook_info().
238
239
240
241
242
 */
function system_hook_info() {
  $hooks['token_info'] = array(
    'group' => 'tokens',
  );
243
244
245
  $hooks['token_info_alter'] = array(
    'group' => 'tokens',
  );
246
247
248
249
250
251
  $hooks['tokens'] = array(
    'group' => 'tokens',
  );
  return $hooks;
}

252
/**
253
 * Implements hook_entity_info().
254
255
256
257
258
259
260
261
262
263
264
265
266
267
 */
function system_entity_info() {
  return array(
    'file' => array(
      'label' => t('File'),
      'base table' => 'file',
      'object keys' => array(
        'id' => 'fid',
      ),
      'static cache' => FALSE,
    ),
  );
}

268
/**
269
 * Implements hook_element_info().
270
 */
271
272
273
function system_element_info() {
  // Top level elements.
  $types['form'] = array(
274
275
    '#method' => 'post',
    '#action' => request_uri(),
276
    '#theme_wrappers' => array('form'),
277
  );
278
  $types['page'] = array(
279
280
    '#show_messages' => TRUE,
    '#theme' => 'page',
281
    '#theme_wrappers' => array('html'),
282
  );
283
  $types['list'] = array(
284
285
286
287
288
    '#title' => '',
    '#list_type' => 'ul',
    '#attributes' => array(),
    '#items' => array(),
  );
289
290
291
292
  // 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).
293
294
295
296
  $types['ajax'] = array(
    '#header' => TRUE,
    '#commands' => array(),
    '#error' => NULL,
297
  );
298
299
  $types['html_tag'] = array(
    '#theme' => 'html_tag',
300
    '#pre_render' => array('drupal_pre_render_conditional_comments'),
301
302
303
    '#attributes' => array(),
    '#value' => NULL,
  );
304
305
306
307
308
309
  $types['styles'] = array(
    '#items' => array(),
    '#pre_render' => array('drupal_pre_render_styles'),
    '#group_callback' => 'drupal_group_css',
    '#aggregate_callback' => 'drupal_aggregate_css',
  );
310

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

435
436
  // Form structure.
  $types['item'] = array(
437
    '#markup' => '',
438
    '#pre_render' => array('drupal_pre_render_markup'),
439
    '#theme_wrappers' => array('form_element'),
440
  );
441
  $types['hidden'] = array(
442
    '#input' => TRUE,
443
    '#process' => array('ajax_process_form'),
444
    '#theme' => 'hidden',
445
  );
446
  $types['value'] = array(
447
448
    '#input' => TRUE,
  );
449
  $types['markup'] = array(
450
    '#markup' => '',
451
452
453
454
    '#pre_render' => array('drupal_pre_render_markup'),
  );
  $types['link'] = array(
    '#pre_render' => array('drupal_pre_render_link', 'drupal_pre_render_markup'),
455
  );
456
  $types['fieldset'] = array(
457
458
459
    '#collapsible' => FALSE,
    '#collapsed' => FALSE,
    '#value' => NULL,
460
    '#process' => array('form_process_fieldset', 'ajax_process_form'),
461
    '#pre_render' => array('form_pre_render_fieldset'),
462
    '#theme_wrappers' => array('fieldset'),
463
  );
464
  $types['vertical_tabs'] = array(
465
    '#theme_wrappers' => array('vertical_tabs'),
466
467
468
    '#default_tab' => '',
    '#process' => array('form_process_vertical_tabs'),
  );
469
470
471
472
473
474

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

475
  $types['token'] = array(
476
    '#input' => TRUE,
477
    '#theme' => 'hidden',
478
479
  );

480
  return $types;
481
482
}

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

550
  // Menu items that are basically just menu blocks.
551
552
  $items['admin/structure'] = array(
    'title' => 'Structure',
553
    'description' => 'Administer blocks, content types, menus, etc.',
554
    'position' => 'right',
555
    'weight' => -8,
556
    'page callback' => 'system_admin_menu_block_page',
557
    'access arguments' => array('access administration pages'),
558
    'file' => 'system.admin.inc',
559
  );
560
561
562
  // Appearance.
  $items['admin/appearance'] = array(
    'title' => 'Appearance',
563
    'description' => 'Select and configure your themes',
564
    'page callback' => 'system_themes_page',
565
    'access arguments' => array('administer themes'),
566
    'position' => 'left',
567
    'weight' => -6,
568
    'file' => 'system.admin.inc',
569
  );
570
  $items['admin/appearance/list'] = array(
571
    'title' => 'List',
572
    'description' => 'Select and configure your theme',
573
574
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -1,
575
    'file' => 'system.admin.inc',
576
  );
577
578
579
  $items['admin/appearance/enable'] = array(
    'title' => 'Enable theme',
    'page callback' => 'system_theme_enable',
580
    'access arguments' => array('administer themes'),
581
582
583
584
585
586
    'type' => MENU_CALLBACK,
    'file' => 'system.admin.inc',
  );
  $items['admin/appearance/disable'] = array(
    'title' => 'Disable theme',
    'page callback' => 'system_theme_disable',
587
    'access arguments' => array('administer themes'),
588
589
590
591
592
593
    'type' => MENU_CALLBACK,
    'file' => 'system.admin.inc',
  );
  $items['admin/appearance/default'] = array(
    'title' => 'Set default theme',
    'page callback' => 'system_theme_default',
594
    'access arguments' => array('administer themes'),
595
596
597
    'type' => MENU_CALLBACK,
    'file' => 'system.admin.inc',
  );
598
  $items['admin/appearance/settings'] = array(
599
    'title' => 'Settings',
600
    'description' => 'Configure default and theme specific settings.',
601
    'page callback' => 'drupal_get_form',
602
    'page arguments' => array('system_theme_settings'),
603
    'access arguments' => array('administer themes'),
604
    'type' => MENU_LOCAL_TASK,
605
    'file' => 'system.admin.inc',
606
    'weight' => 20,
607
  );
608
  // Theme configuration subtabs.
609
  $items['admin/appearance/settings/global'] = array(
610
    'title' => 'Global settings',
611
612
613
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -1,
  );
Dries's avatar
   
Dries committed
614

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

626
  // Modules.
627
  $items['admin/modules'] = array(
628
    'title' => 'Modules',
629
    'description' => 'Enable or disable modules',
630
631
    'page callback' => 'drupal_get_form',
    'page arguments' => array('system_modules'),
632
    'access arguments' => array('administer modules'),
633
    'file' => 'system.admin.inc',
634
    'weight' => -2,
635
  );
636
  $items['admin/modules/list'] = array(
637
    'title' => 'List',
638
639
    'type' => MENU_DEFAULT_LOCAL_TASK,
  );
640
  $items['admin/modules/list/confirm'] = array(
641
    'title' => 'List',
642
    'access arguments' => array('administer modules'),
643
644
    'type' => MENU_CALLBACK,
  );
645
  $items['admin/modules/uninstall'] = array(
646
    'title' => 'Uninstall',
647
    'page arguments' => array('system_modules_uninstall'),
648
    'access arguments' => array('administer modules'),
649
    'type' => MENU_LOCAL_TASK,
650
    'file' => 'system.admin.inc',
651
    'weight' => 20,
652
  );
653
  $items['admin/modules/uninstall/confirm'] = array(
654
    'title' => 'Uninstall',
655
    'access arguments' => array('administer modules'),
656
    'type' => MENU_CALLBACK,
657
658
659
    'file' => 'system.admin.inc',
  );

660
  // Configuration.
661
662
  $items['admin/config'] = array(
    'title' => 'Configuration',
663
    'description' => 'Administer settings',
664
665
    'page callback' => 'system_admin_config_page',
    'access arguments' => array('access administration pages'),
666
    'file' => 'system.admin.inc',
667
668
  );

669
  // IP address blocking.
670
  $items['admin/config/people/ip-blocking'] = array(
671
672
673
674
    'title' => 'IP address blocking',
    'description' => 'Manage blocked IP addresses.',
    'page callback' => 'system_ip_blocking',
    'access arguments' => array('block IP addresses'),
675
    'file' => 'system.admin.inc',
676
  );
677
  $items['admin/config/people/ip-blocking/delete/%blocked_ip'] = array(
678
679
    'title' => 'Delete IP address',
    'page callback' => 'drupal_get_form',
680
    'page arguments' => array('system_ip_blocking_delete', 5),
681
682
    'access arguments' => array('block IP addresses'),
    'type' => MENU_CALLBACK,
683
    'file' => 'system.admin.inc',
684
685
  );

686
  // Media settings.
687
  $items['admin/config/media'] = array(
688
689
690
691
692
    'title' => 'Media',
    'description' => 'Media tools.',
    'position' => 'left',
    'weight' => 10,
    'page callback' => 'system_admin_menu_block_page',
693
    'access arguments' => array('access administration pages'),
694
    'file' => 'system.admin.inc',
695
696
  );
  $items['admin/config/media/file-system'] = array(
697
    'title' => 'File system',
698
    'description' => 'Tell Drupal where to store uploaded files and how they are accessed.',
699
    'page callback' => 'drupal_get_form',
700
    'page arguments' => array('system_file_system_settings'),
701
    'access arguments' => array('administer site configuration'),
702
    'weight' => 10,
703
    'file' => 'system.admin.inc',
704
  );
705
706
707
    $items['admin/config/media/image-toolkit'] = array(
    'title' => 'Image toolkit',
    'description' => 'Choose which image toolkit to use if you have installed optional toolkits.',
708
    'page callback' => 'drupal_get_form',
709
    'page arguments' => array('system_image_toolkit_settings'),
710
    'access arguments' => array('administer site configuration'),
711
    'weight' => 20,
712
713
    'file' => 'system.admin.inc',
  );
714
715

  // Service settings.
716
717
718
719
  $items['admin/config/services'] = array(
    'title' => 'Web services',
    'description' => 'Tools related to web services.',
    'page callback' => 'system_admin_menu_block_page',
720
    'access arguments' => array('access administration pages'),
721
722
    'file' => 'system.admin.inc',
  );
723
724
725
726
727
728
729
730
  $items['admin/config/services/rss-publishing'] = array(
    'title' => 'RSS publishing',
    'description' => 'Configure the site description, the number of items per feed and whether feeds should be titles/teasers/full-text.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('system_rss_feeds_settings'),
    'access arguments' => array('administer site configuration'),
    'file' => 'system.admin.inc',
  );
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747

  // Development settings.
  $items['admin/config/development'] = array(
    'title' => 'Development',
    'description' => 'Development tools.',
    'position' => 'left',
    'weight' => 10,
    'page callback' => 'system_admin_menu_block_page',
    'access arguments' => array('access administration pages'),
    'file' => 'system.admin.inc',
  );
  $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
    'weight' => 50,
749
750
751
752
753
754
755
756
    'file' => 'system.admin.inc',
  );
  $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'),
757
    'weight' => -10,
758
759
    'file' => 'system.admin.inc',
  );