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

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

  $types['container'] = array(
    '#theme_wrappers' => array('container'),
    '#process' => array('form_process_container'),
  );
495
496
497
498
499
  $types['actions'] = array(
    '#theme_wrappers' => array('container'),
    '#process' => array('form_process_actions', 'form_process_container'),
    '#weight' => 100,
  );
500

501
  $types['token'] = array(
502
    '#input' => TRUE,
503
    '#theme' => 'hidden',
504
505
  );

506
  return $types;
507
508
}

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

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

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

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

683
  // Configuration.
684
685
  $items['admin/config'] = array(
    'title' => 'Configuration',
686
    'description' => 'Administer settings.',
687
688
    'page callback' => 'system_admin_config_page',
    'access arguments' => array('access administration pages'),
689
    'file' => 'system.admin.inc',
690
691
  );

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

709
  // Media settings.
710
  $items['admin/config/media'] = array(
711
712
713
    'title' => 'Media',
    'description' => 'Media tools.',
    'position' => 'left',
714
    'weight' => -10,
715
    'page callback' => 'system_admin_menu_block_page',
716
    'access arguments' => array('access administration pages'),
717
    'file' => 'system.admin.inc',
718
719
  );
  $items['admin/config/media/file-system'] = array(
720
    'title' => 'File system',
721
    'description' => 'Tell Drupal where to store uploaded files and how they are accessed.',
722
    'page callback' => 'drupal_get_form',
723
    'page arguments' => array('system_file_system_settings'),
724
    'access arguments' => array('administer site configuration'),
725
    'weight' => -10,
726
    'file' => 'system.admin.inc',
727
  );
728
  $items['admin/config/media/image-toolkit'] = array(
729
730
    'title' => 'Image toolkit',
    'description' => 'Choose which image toolkit to use if you have installed optional toolkits.',
731
    'page callback' => 'drupal_get_form',
732
    'page arguments' => array('system_image_toolkit_settings'),
733
    'access arguments' => array('administer site configuration'),
734
    'weight' => 20,
735
736
    'file' => 'system.admin.inc',
  );
737
738

  // Service settings.
739
740
741
  $items['admin/config/services'] = array(
    'title' => 'Web services',
    'description' => 'Tools related to web services.',
742
743
    'position' => 'right',
    'weight' => 0,
744
    'page callback' => 'system_admin_menu_block_page',
745
    'access arguments' => array('access administration pages'),
746
747
    'file' => 'system.admin.inc',
  );