system.module 125 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
 * Return only visible regions.
51 52
 *
 * @see system_region_list()
53 54 55 56
 */
define('REGIONS_VISIBLE', 'visible');

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

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

69
  switch ($path) {
70
    case 'admin/help#system':
71 72
      $output = '';
      $output .= '<h3>' . t('About') . '</h3>';
73
      $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>';
74 75 76
      $output .= '<h3>' . t('Uses') . '</h3>';
      $output .= '<dl>';
      $output .= '<dt>' . t('Managing modules') . '</dt>';
77
      $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>';
78 79 80 81 82
      $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>';
83
      $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>';
84 85
      $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>';
86 87
      $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>';
88
      $output .= '</dl>';
89
      return $output;
90
    case 'admin/by-module':
91
      return '<p>' . t('This page shows you all available administration tasks for each module.') . '</p>';
92
    case 'admin/appearance':
93
      $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>';
94
      return $output;
95
    case 'admin/appearance/settings/' . $arg[3]:
96 97 98
      $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>';
99
    case 'admin/appearance/settings':
100
      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>';
101
    case 'admin/modules':
102
      $output = '<p>' . t('Download additional <a href="@modules">contributed modules</a> to extend Drupal\'s functionality.', array('@modules' => 'http://drupal.org/project/modules')) . '</p>';
103 104
      if (module_exists('update')) {
        if (update_manager_access()) {
105
          $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>';
106 107
        }
        else {
108
          $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>';
109 110 111
        }
      }
      else {
112
        $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>';
113
      }
114
      return $output;
115 116
    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>';
117
    case 'admin/structure/block/manage':
118
      if ($arg[4] == 'system' && $arg[5] == 'powered-by') {
119
        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>';
120
      }
121
      break;
122
    case 'admin/config/development/maintenance':
123 124
      global $user;
      if ($user->uid == 1) {
125
        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>';
126
      }
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_by_module' => 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
    'access site reports' => array(
233
      'title' => t('View site reports'),
234 235 236 237
    ),
    'block IP addresses' => array(
      'title' => t('Block IP addresses'),
    ),
238
  );
Dries's avatar
 
Dries committed
239 240
}

241
/**
242
 * Implements hook_hook_info().
243 244 245 246 247
 */
function system_hook_info() {
  $hooks['token_info'] = array(
    'group' => 'tokens',
  );
248 249 250
  $hooks['token_info_alter'] = array(
    'group' => 'tokens',
  );
251 252 253 254 255 256
  $hooks['tokens'] = array(
    'group' => 'tokens',
  );
  return $hooks;
}

257
/**
258
 * Implements hook_entity_info().
259 260 261 262 263
 */
function system_entity_info() {
  return array(
    'file' => array(
      'label' => t('File'),
264
      'base table' => 'file_managed',
265
      'entity keys' => array(
266 267 268 269 270 271 272
        'id' => 'fid',
      ),
      'static cache' => FALSE,
    ),
  );
}

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

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

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

  $types['container'] = array(
    '#theme_wrappers' => array('container'),
    '#process' => array('form_process_container'),
  );
475 476 477 478 479
  $types['actions'] = array(
    '#theme_wrappers' => array('container'),
    '#process' => array('form_process_actions', 'form_process_container'),
    '#weight' => 100,
  );
480

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

486
  return $types;
487 488
}

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

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

621
  foreach (list_themes() as $theme) {
622
    $items['admin/appearance/settings/' . $theme->name] = array(
623 624 625 626 627
      '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),
628
      'file' => 'system.admin.inc',
629
    );
Dries's avatar
 
Dries committed
630
  }
drumm's avatar
drumm committed
631

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

666
  // Configuration.
667 668
  $items['admin/config'] = array(
    'title' => 'Configuration',
669
    'description' => 'Administer settings',
670 671
    'page callback' => 'system_admin_config_page',
    'access arguments' => array('access administration pages'),
672
    'file' => 'system.admin.inc',
673 674
  );

675
  // IP address blocking.
676
  $items['admin/config/people/ip-blocking'] = array(
677 678 679 680
    'title' => 'IP address blocking',
    'description' => 'Manage blocked IP addresses.',
    'page callback' => 'system_ip_blocking',
    'access arguments' => array('block IP addresses'),
681
    'file' => 'system.admin.inc',
682
    'weight' => 10,
683
  );
684
  $items['admin/config/people/ip-blocking/delete/%blocked_ip'] = array(
685 686
    'title' => 'Delete IP address',
    'page callback' => 'drupal_get_form',
687
    'page arguments' => array('system_ip_blocking_delete', 5),
688 689
    'access arguments' => array('block IP addresses'),
    'type' => MENU_CALLBACK,
690
    'file' => 'system.admin.inc',
691 692
  );

693
  // Media settings.
694
  $items['admin/config/media'] = array(
695 696 697
    'title' => 'Media',
    'description' => 'Media tools.',
    'position' => 'left',
698
    'weight' => -10,
699
    'page callback' => 'system_admin_menu_block_page',
700
    'access arguments' => array('access administration pages'),
701
    'file' => 'system.admin.inc',
702 703
  );
  $items['admin/config/media/file-system'] = array(
704
    'title' => 'File system',
705
    'description' => 'Tell Drupal where to store uploaded files and how they are accessed.',
706
    'page callback' => 'drupal_get_form',
707
    'page arguments' => array('system_file_system_settings'),