/[drupal]/drupal/modules/system/system.module
ViewVC logotype

Contents of /drupal/modules/system/system.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.836 - (show annotations) (download) (as text)
Tue Nov 3 06:47:23 2009 UTC (3 weeks, 5 days ago) by webchick
Branch: MAIN
Changes since 1.835: +7 -41 lines
File MIME type: text/x-php
#552478 by pwolanin, samj, dropcube, and sun: Improve link/header API and support on node/comment pages rel=canonical and rel=shortlink standards.
1 <?php
2 // $Id: system.module,v 1.835 2009/11/03 05:27:18 webchick Exp $
3
4 /**
5 * @file
6 * Configuration system that lets administrators modify the workings of the site.
7 */
8
9 /**
10 * Maximum age of temporary files in seconds.
11 */
12 define('DRUPAL_MAXIMUM_TEMP_FILE_AGE', 21600);
13
14 /**
15 * Default interval for automatic cron executions in seconds.
16 */
17 define('DRUPAL_CRON_DEFAULT_THRESHOLD', 10800);
18
19 /**
20 * New users will be set to the default time zone at registration.
21 */
22 define('DRUPAL_USER_TIMEZONE_DEFAULT', 0);
23
24 /**
25 * New users will get an empty time zone at registration.
26 */
27 define('DRUPAL_USER_TIMEZONE_EMPTY', 1);
28
29 /**
30 * New users will select their own timezone at registration.
31 */
32 define('DRUPAL_USER_TIMEZONE_SELECT', 2);
33
34 /**
35 * Disabled option on forms and settings
36 */
37 define('DRUPAL_DISABLED', 0);
38
39 /**
40 * Optional option on forms and settings
41 */
42 define('DRUPAL_OPTIONAL', 1);
43
44 /**
45 * Required option on forms and settings
46 */
47 define('DRUPAL_REQUIRED', 2);
48
49 /**
50 * Return only visible regions. @see system_region_list().
51 */
52 define('REGIONS_VISIBLE', 'visible');
53
54 /**
55 * Return all visible regions. @see system_region_list().
56 */
57 define('REGIONS_ALL', 'all');
58
59
60 /**
61 * Implement hook_help().
62 */
63 function system_help($path, $arg) {
64 global $base_url;
65
66 switch ($path) {
67 case 'admin/help#system':
68 $output = '<p>' . t('The system module is at the foundation of your Drupal website, 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 or disabling of 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.') . '</p>';
69 $output .= '<p>' . t('The system module provides:') . '</p>';
70 $output .= '<ul><li>' . t('support for enabling and disabling <a href="@modules">modules</a>. Drupal comes packaged with a number of core modules; each module provides a discrete set of features and may be enabled depending on the needs of your site. A wide array of 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/config/modules'), '@drupal-modules' => 'http://drupal.org/project/modules')) . '</li>';
71 $output .= '<li>' . t('support for enabling and disabling <a href="@themes">themes</a>, which 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')) . '</li>';
72 $output .= '<li>' . t('a robust <a href="@cache-settings">caching system</a> that allows the efficient re-use of previously-constructed web pages and web page components. Drupal stores the pages requested by anonymous users in a compressed format; depending on your site configuration and the amount of your web traffic tied to anonymous visitors, Drupal\'s caching system may significantly increase the speed of your site.', array('@cache-settings' => url('admin/config/development/performance'))) . '</li>';
73 $output .= '<li>' . t('a set of routine administrative operations that rely on a correctly-configured <a href="@cron">cron maintenance task</a> to run automatically. A number of other modules, including the feed aggregator, and search also rely on <a href="@cron">cron maintenance tasks</a>. For more information, see the online handbook entry for <a href="@handbook">configuring cron jobs</a>.', array('@cron' => url('admin/reports/status'), '@handbook' => 'http://drupal.org/cron')) . '</li>';
74 $output .= '<li>' . t('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'))) . '</li></ul>';
75 $output .= '<p>' . t('For more information, see the online handbook entry for <a href="@system">System module</a>.', array('@system' => 'http://drupal.org/handbook/modules/system/')) . '</p>';
76 return $output;
77 case 'admin/by-module':
78 return '<p>' . t('This page shows you all available administration tasks for each module.') . '</p>';
79 case 'admin/appearance':
80 $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>';
81 return $output;
82 case 'admin/appearance/settings/' . $arg[3]:
83 $reference = explode('.', $arg[3], 2);
84 $theme = array_pop($reference);
85 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. By clicking "Reset to defaults," you can choose to use the <a href="@global">global settings</a> for this theme.', array('%template' => $theme, '@global' => url('admin/appearance/settings'))) . '</p>';
86 case 'admin/appearance/settings':
87 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>';
88 case 'admin/config/modules':
89 $output = '<p>' . t('Modules are plugins that extend Drupal\'s core functionality. To further extend your site\'s functionality, a number of <a href="@modules">contributed modules</a> are available for download.', array('@permissions' => url('admin/config/people/permissions'), '@modules' => 'http://drupal.org/project/modules')) . '</p>';
90 $output .= '<p>' . t('Module-related tasks can be located on the <a href="@by-module">administration by module page</a>. New <a href="@permissions">module-related permissions</a> may also become available as new modules are enabled.', array('@by-module' => url('admin/by-module'), '@permissions' => url('admin/config/people/permissions'))) . '</p>';
91 if (module_exists('update')) {
92 if (update_manager_access()) {
93 $output .= '<p>' . t('Each time a module is updated, it is important that <a href="@update-php">update.php</a> is run. To help manage the update process, the <em>Update manager</em> module provides <a href="@updates">information on new versions of modules (and themes)</a> as they are released, and allows you to <a href="@update-manager-update">upgrade any missing updates</a> or <a href="@update-manager-install">install new modules and themes</a>. Regular review of the <a href="@updates">available updates page</a> is essential to maintaining a secure and current site.', array('@update-php' => $base_url . '/update.php', '@updates' => url('admin/reports/updates'), '@update-manager-update' => url('admin/config/modules/update'), '@update-manager-install' => url('admin/config/modules/install'))) . '</p>';
94 }
95 else {
96 $output .= '<p>' . t('Each time a module is updated, it is important that <a href="@update-php">update.php</a> is run. To help manage the update process, the <em>Update manager</em> module provides <a href="@updates">information on new versions of modules (and themes)</a> as they are released. Regular review of the <a href="@updates">available updates page</a> is essential to maintaining a secure and current site.', array('@update-php' => $base_url . '/update.php', '@updates' => url('admin/reports/updates'))) . '</p>';
97 }
98 }
99 else {
100 $output .= '<p>' . t('Each time a module is updated, it is important that <a href="@update-php">update.php</a> is run. If you enable the <em>Update manager</em> module, it will provide a report about new versions of modules (and themes) as they are released, can notify you via e-mail if your site is out of date, and let you install missing updates. Regular review of available updates is essential to maintaining a secure and current site.', array('@update-php' => $base_url . '/update.php')) . '</p>';
101 }
102 return $output;
103 case 'admin/config/modules/uninstall':
104 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/config/modules'))) . '</p>';
105 case 'admin/structure/block/manage':
106 if ($arg[4] == 'system' && $arg[5] == 'powered-by') {
107 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>';
108 }
109 break;
110 case 'admin/config/development/maintenance':
111 global $user;
112 if ($user->uid == 1) {
113 return '<p>' . t('If you are upgrading to a newer version of Drupal or upgrading contributed modules or themes you may need to run !update-php.', array('!update-php' => l('update.php', 'update.php'))) . '</p>';
114 }
115 case 'admin/config/system/actions':
116 case 'admin/config/system/actions/manage':
117 $output = '<p>' . 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 trigger module, 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.') . '</p>';
118 $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 can do more than simple actions; for example, send an e-mail to a specified address, or check for certain words within a piece of content. These actions need to be created and configured first before they may be used. To create an advanced action, select the action from the drop-down below and click the <em>Create</em> button.') . '</p>';
119 if (module_exists('trigger')) {
120 $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>';
121 }
122 return $output;
123 case 'admin/config/system/actions/configure':
124 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").');
125 case 'admin/config/people/ip-blocking':
126 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>';
127 case 'admin/reports/status':
128 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>';
129 }
130 }
131
132 /**
133 * Implement hook_theme().
134 */
135 function system_theme() {
136 return array_merge(drupal_common_theme(), array(
137 'system_themes_form' => array(
138 'render element' => 'form',
139 'file' => 'system.admin.inc',
140 ),
141 'system_settings_form' => array(
142 'render element' => 'form',
143 ),
144 'confirm_form' => array(
145 'render element' => 'form',
146 ),
147 'system_modules_fieldset' => array(
148 'render element' => 'form',
149 'file' => 'system.admin.inc',
150 ),
151 'system_modules_incompatible' => array(
152 'variables' => array('message' => NULL),
153 'file' => 'system.admin.inc',
154 ),
155 'system_modules_uninstall' => array(
156 'render element' => 'form',
157 'file' => 'system.admin.inc',
158 ),
159 'status_report' => array(
160 'render element' => 'requirements',
161 'file' => 'system.admin.inc',
162 ),
163 'admin_page' => array(
164 'variables' => array('blocks' => NULL),
165 'file' => 'system.admin.inc',
166 ),
167 'admin_block' => array(
168 'variables' => array('block' => NULL),
169 'file' => 'system.admin.inc',
170 ),
171 'admin_block_content' => array(
172 'variables' => array('content' => NULL),
173 'file' => 'system.admin.inc',
174 ),
175 'system_admin_by_module' => array(
176 'variables' => array('menu_items' => NULL),
177 'file' => 'system.admin.inc',
178 ),
179 'system_powered_by' => array(
180 'variables' => array(),
181 ),
182 'system_compact_link' => array(
183 'variables' => array(),
184 ),
185 'system_run_cron_image' => array(
186 'variables' => array('image_path' => NULL),
187 ),
188 'system_date_time_settings' => array(
189 'render element' => 'form',
190 'file' => 'system.admin.inc',
191 ),
192 ));
193 }
194
195 /**
196 * Implement hook_permission().
197 */
198 function system_permission() {
199 return array(
200 'administer site configuration' => array(
201 'title' => t('Administer site configuration'),
202 'description' => t('Configure site-wide settings such as module or theme administration settings.'),
203 ),
204 'administer software updates' => array(
205 'title' => t('Administer software updates'),
206 'description' => t('Run the update.php script.'),
207 ),
208 'administer actions' => array(
209 'title' => t('Administer actions'),
210 'description' => t('Manage the actions defined for your site.'),
211 ),
212 'administer files' => array(
213 'title' => t('Administer files'),
214 'description' => t('Manage user-uploaded files.'),
215 ),
216 'access administration pages' => array(
217 'title' => t('Access administration pages'),
218 'description' => t('View the administration panel and browse the help system.'),
219 ),
220 'access site in maintenance mode' => array(
221 'title' => t('Access site in maintenance mode'),
222 'description' => t('Log in when the site is in maintenance mode.'),
223 ),
224 'access site reports' => array(
225 'title' => t('Access site reports'),
226 'description' => t('View reports from system logs and other status information.'),
227 ),
228 'block IP addresses' => array(
229 'title' => t('Block IP addresses'),
230 'description' => t('Block IP addresses from accessing your site.'),
231 ),
232 );
233 }
234
235 /**
236 * Implement hook_rdf_namespaces().
237 */
238 function system_rdf_namespaces() {
239 return array(
240 'admin' => 'http://webns.net/mvcb/',
241 'content' => 'http://purl.org/rss/1.0/modules/content/',
242 'dc' => 'http://purl.org/dc/terms/',
243 'foaf' => 'http://xmlns.com/foaf/0.1/',
244 'owl' => 'http://www.w3.org/2002/07/owl#',
245 'rdf' => 'http://www.w3.org/1999/02/22-rdf-syntax-ns#',
246 'rdfs' => 'http://www.w3.org/2000/01/rdf-schema#',
247 'rss' => 'http://purl.org/rss/1.0/',
248 'tags' => 'http://www.holygoat.co.uk/owl/redwood/0.1/tags/',
249 'sioc' => 'http://rdfs.org/sioc/ns#',
250 'sioct' => 'http://rdfs.org/sioc/types#',
251 'ctag' => 'http://commontag.org/ns#',
252 'skos' => 'http://www.w3.org/2004/02/skos/core#',
253 'xsd' => 'http://www.w3.org/2001/XMLSchema#',
254 );
255 }
256
257 /**
258 * Implement hook_hook_info().
259 */
260 function system_hook_info() {
261 $hooks['token_info'] = array(
262 'group' => 'tokens',
263 );
264 $hooks['tokens'] = array(
265 'group' => 'tokens',
266 );
267 return $hooks;
268 }
269
270 /**
271 * Implement hook_entity_info().
272 */
273 function system_entity_info() {
274 return array(
275 'file' => array(
276 'label' => t('File'),
277 'base table' => 'file',
278 'object keys' => array(
279 'id' => 'fid',
280 ),
281 'static cache' => FALSE,
282 ),
283 );
284 }
285
286 /**
287 * Implement hook_element_info().
288 */
289 function system_element_info() {
290 // Top level elements.
291 $types['form'] = array(
292 '#method' => 'post',
293 '#action' => request_uri(),
294 '#theme_wrappers' => array('form'),
295 );
296 $types['page'] = array(
297 '#show_messages' => TRUE,
298 '#theme' => 'page',
299 '#theme_wrappers' => array('html'),
300 );
301 $types['list'] = array(
302 '#title' => '',
303 '#list_type' => 'ul',
304 '#attributes' => array(),
305 '#items' => array(),
306 );
307 // By default, we don't want AJAX commands being rendered in the context of an
308 // HTML page, so we don't provide defaults for #theme or #theme_wrappers.
309 // However, modules can set these properties (for example, to provide an HTML
310 // debugging page that displays rather than executes AJAX commands).
311 $types['ajax_commands'] = array(
312 '#ajax_commands' => array(),
313 );
314
315 $types['html_tag'] = array(
316 '#theme' => 'html_tag',
317 '#attributes' => array(),
318 '#value' => NULL,
319 );
320
321 // Input elements.
322 $types['submit'] = array(
323 '#input' => TRUE,
324 '#name' => 'op',
325 '#button_type' => 'submit',
326 '#executes_submit_callback' => TRUE,
327 '#process' => array('ajax_process_form'),
328 '#theme_wrappers' => array('button'),
329 );
330 $types['button'] = array(
331 '#input' => TRUE,
332 '#name' => 'op',
333 '#button_type' => 'submit',
334 '#executes_submit_callback' => FALSE,
335 '#process' => array('ajax_process_form'),
336 '#theme_wrappers' => array('button'),
337 );
338 $types['image_button'] = array(
339 '#input' => TRUE,
340 '#button_type' => 'submit',
341 '#executes_submit_callback' => TRUE,
342 '#process' => array('ajax_process_form'),
343 '#return_value' => TRUE,
344 '#has_garbage_value' => TRUE,
345 '#src' => NULL,
346 '#theme_wrappers' => array('image_button'),
347 );
348 $types['textfield'] = array(
349 '#input' => TRUE,
350 '#size' => 60,
351 '#maxlength' => 128,
352 '#autocomplete_path' => FALSE,
353 '#process' => array('form_process_text_format', 'ajax_process_form'),
354 '#theme' => 'textfield',
355 '#theme_wrappers' => array('form_element'),
356 );
357 $types['password'] = array(
358 '#input' => TRUE,
359 '#size' => 60,
360 '#maxlength' => 128,
361 '#process' => array('ajax_process_form'),
362 '#theme' => 'password',
363 '#theme_wrappers' => array('form_element'),
364 );
365 $types['password_confirm'] = array(
366 '#input' => TRUE,
367 '#process' => array('form_process_password_confirm'),
368 '#theme_wrappers' => array('form_element'),
369 );
370 $types['textarea'] = array(
371 '#input' => TRUE,
372 '#cols' => 60,
373 '#rows' => 5,
374 '#resizable' => TRUE,
375 '#process' => array('form_process_text_format', 'ajax_process_form'),
376 '#theme' => 'textarea',
377 '#theme_wrappers' => array('form_element'),
378 );
379 $types['radios'] = array(
380 '#input' => TRUE,
381 '#process' => array('form_process_radios'),
382 '#theme_wrappers' => array('radios'),
383 '#pre_render' => array('form_pre_render_conditional_form_element'),
384 );
385 $types['radio'] = array(
386 '#input' => TRUE,
387 '#default_value' => NULL,
388 '#process' => array('ajax_process_form'),
389 '#theme' => 'radio',
390 '#theme_wrappers' => array('form_element'),
391 '#form_element_skip_title' => TRUE,
392 );
393 $types['checkboxes'] = array(
394 '#input' => TRUE,
395 '#tree' => TRUE,
396 '#process' => array('form_process_checkboxes'),
397 '#theme_wrappers' => array('checkboxes'),
398 '#pre_render' => array('form_pre_render_conditional_form_element'),
399 );
400 $types['checkbox'] = array(
401 '#input' => TRUE,
402 '#return_value' => 1,
403 '#process' => array('ajax_process_form'),
404 '#theme' => 'checkbox',
405 '#theme_wrappers' => array('form_element'),
406 '#form_element_skip_title' => TRUE,
407 );
408 $types['select'] = array(
409 '#input' => TRUE,
410 '#size' => 0,
411 '#multiple' => FALSE,
412 '#process' => array('ajax_process_form'),
413 '#theme' => 'select',
414 '#theme_wrappers' => array('form_element'),
415 );
416 $types['weight'] = array(
417 '#input' => TRUE,
418 '#delta' => 10,
419 '#default_value' => 0,
420 '#process' => array('form_process_weight', 'ajax_process_form'),
421 );
422 $types['date'] = array(
423 '#input' => TRUE,
424 '#element_validate' => array('date_validate'),
425 '#process' => array('form_process_date'),
426 '#theme' => 'date',
427 '#theme_wrappers' => array('form_element'),
428 );
429 $types['file'] = array(
430 '#input' => TRUE,
431 '#size' => 60,
432 '#theme' => 'file',
433 '#theme_wrappers' => array('form_element'),
434 );
435 $types['tableselect'] = array(
436 '#input' => TRUE,
437 '#js_select' => TRUE,
438 '#multiple' => TRUE,
439 '#process' => array('form_process_tableselect'),
440 '#options' => array(),
441 '#empty' => '',
442 '#theme' => 'tableselect',
443 );
444
445 // Form structure.
446 $types['item'] = array(
447 '#markup' => '',
448 '#pre_render' => array('drupal_pre_render_markup'),
449 '#theme_wrappers' => array('form_element'),
450 );
451 $types['hidden'] = array(
452 '#input' => TRUE,
453 '#process' => array('ajax_process_form'),
454 '#theme' => 'hidden',
455 );
456 $types['value'] = array(
457 '#input' => TRUE,
458 );
459 $types['markup'] = array(
460 '#markup' => '',
461 '#pre_render' => array('drupal_pre_render_markup'),
462 );
463 $types['link'] = array(
464 '#pre_render' => array('drupal_pre_render_link', 'drupal_pre_render_markup'),
465 );
466 $types['fieldset'] = array(
467 '#collapsible' => FALSE,
468 '#collapsed' => FALSE,
469 '#value' => NULL,
470 '#process' => array('form_process_fieldset', 'ajax_process_form'),
471 '#pre_render' => array('form_pre_render_fieldset'),
472 '#theme_wrappers' => array('fieldset'),
473 );
474 $types['vertical_tabs'] = array(
475 '#theme_wrappers' => array('vertical_tabs'),
476 '#default_tab' => '',
477 '#process' => array('form_process_vertical_tabs'),
478 );
479
480 $types['container'] = array(
481 '#theme_wrappers' => array('container'),
482 '#process' => array('form_process_container'),
483 );
484
485 $types['token'] = array(
486 '#input' => TRUE,
487 '#theme' => array('hidden'),
488 );
489
490 return $types;
491 }
492
493 /**
494 * Implement hook_menu().
495 */
496 function system_menu() {
497 $items['system/files'] = array(
498 'title' => 'File download',
499 'page callback' => 'file_download',
500 'page arguments' => array('private'),
501 'access callback' => TRUE,
502 'type' => MENU_CALLBACK,
503 );
504 $items['system/temporary'] = array(
505 'title' => 'Temporary files',
506 'page callback' => 'file_download',
507 'page arguments' => array('temporary'),
508 'access callback' => TRUE,
509 'type' => MENU_CALLBACK,
510 );
511 $items['system/ajax'] = array(
512 'title' => 'AHAH callback',
513 'page callback' => 'ajax_form_callback',
514 'delivery callback' => 'ajax_deliver',
515 'access callback' => TRUE,
516 'type' => MENU_CALLBACK,
517 'file path' => 'includes',
518 'file' => 'form.inc',
519 );
520 $items['system/timezone'] = array(
521 'title' => 'Time zone',
522 'page callback' => 'system_timezone',
523 'access callback' => TRUE,
524 'type' => MENU_CALLBACK,
525 'file' => 'system.admin.inc',
526 );
527 $items['system/run-cron-image'] = array(
528 'title' => 'Execute cron',
529 'page callback' => 'system_run_cron_image',
530 'access callback' => 'system_run_cron_image_access',
531 'type' => MENU_CALLBACK,
532 'file' => 'system.admin.inc',
533 );
534 $items['admin'] = array(
535 'title' => 'Administer',
536 'access arguments' => array('access administration pages'),
537 'page callback' => 'system_main_admin_page',
538 'weight' => 9,
539 'menu_name' => 'management',
540 'theme callback' => 'variable_get',
541 'theme arguments' => array('admin_theme'),
542 'file' => 'system.admin.inc',
543 );
544 $items['admin/compact'] = array(
545 'title' => 'Compact mode',
546 'page callback' => 'system_admin_compact_page',
547 'access arguments' => array('access administration pages'),
548 'type' => MENU_CALLBACK,
549 'file' => 'system.admin.inc',
550 );
551 $items['admin/by-task'] = array(
552 'title' => 'By task',
553 'page callback' => 'system_main_admin_page',
554 'access arguments' => array('access administration pages'),
555 'type' => MENU_DEFAULT_LOCAL_TASK,
556 'file' => 'system.admin.inc',
557 );
558 $items['admin/by-module'] = array(
559 'title' => 'By module',
560 'page callback' => 'system_admin_by_module',
561 'access arguments' => array('access administration pages'),
562 'type' => MENU_LOCAL_TASK,
563 'weight' => 2,
564 'file' => 'system.admin.inc',
565 );
566
567 // Menu items that are basically just menu blocks.
568 $items['admin/structure'] = array(
569 'title' => 'Structure',
570 'description' => 'Control how your site looks and feels.',
571 'position' => 'right',
572 'weight' => -8,
573 'page callback' => 'system_admin_menu_block_page',
574 'access arguments' => array('access administration pages'),
575 'file' => 'system.admin.inc',
576 );
577 // Appearance.
578 $items['admin/appearance'] = array(
579 'title' => 'Appearance',
580 'description' => 'Select and configure your site theme.',
581 'page callback' => 'drupal_get_form',
582 'page arguments' => array('system_themes_form'),
583 'access arguments' => array('administer site configuration'),
584 'position' => 'left',
585 'weight' => -6,
586 'file' => 'system.admin.inc',
587 );
588 $items['admin/appearance/select'] = array(
589 'title' => 'List',
590 'description' => 'Select the default theme for your site.',
591 'type' => MENU_DEFAULT_LOCAL_TASK,
592 'weight' => -1,
593 'file' => 'system.admin.inc',
594 );
595 $items['admin/appearance/settings'] = array(
596 'title' => 'Configure',
597 'description' => 'Configure default and theme specific settings.',
598 'page arguments' => array('system_theme_settings'),
599 'access arguments' => array('administer site configuration'),
600 'type' => MENU_LOCAL_TASK,
601 'file' => 'system.admin.inc',
602 );
603 // Theme configuration subtabs.
604 $items['admin/appearance/settings/global'] = array(
605 'title' => 'Global settings',
606 'type' => MENU_DEFAULT_LOCAL_TASK,
607 'weight' => -1,
608 );
609
610 foreach (list_themes() as $theme) {
611 $items['admin/appearance/settings/' . $theme->name] = array(
612 'title' => $theme->info['name'],
613 'page arguments' => array('system_theme_settings', $theme->name),
614 'type' => MENU_LOCAL_TASK,
615 'access callback' => '_system_themes_access',
616 'access arguments' => array($theme),
617 'file' => 'system.admin.inc',
618 );
619 }
620
621 // Configuration and modules.
622 $items['admin/config'] = array(
623 'title' => 'Configuration and modules',
624 'page callback' => 'system_admin_config_page',
625 'access arguments' => array('access administration pages'),
626 'file' => 'system.admin.inc',
627 );
628 $items['admin/config/config'] = array(
629 'title' => 'Configuration',
630 'access arguments' => array('administer site configuration'),
631 'type' => MENU_DEFAULT_LOCAL_TASK,
632 'weight' => -10,
633 'file' => 'system.admin.inc',
634 );
635 $items['admin/config/modules'] = array(
636 'title' => 'Modules',
637 'description' => 'Enable or disable add-on modules for your site.',
638 'page callback' => 'drupal_get_form',
639 'page arguments' => array('system_modules'),
640 'access arguments' => array('administer site configuration'),
641 'file' => 'system.admin.inc',
642 'type' => MENU_LOCAL_TASK,
643 'weight' => 10,
644 );
645 $items['admin/config/modules/list'] = array(
646 'title' => 'List',
647 'type' => MENU_DEFAULT_LOCAL_TASK,
648 );
649 $items['admin/config/modules/list/confirm'] = array(
650 'title' => 'List',
651 'access arguments' => array('administer site configuration'),
652 'type' => MENU_CALLBACK,
653 );
654 $items['admin/config/modules/uninstall'] = array(
655 'title' => 'Uninstall',
656 'page arguments' => array('system_modules_uninstall'),
657 'access arguments' => array('administer site configuration'),
658 'type' => MENU_LOCAL_TASK,
659 'file' => 'system.admin.inc',
660 );
661 $items['admin/config/modules/uninstall/confirm'] = array(
662 'title' => 'Uninstall',
663 'access arguments' => array('administer site configuration'),
664 'type' => MENU_CALLBACK,
665 'file' => 'system.admin.inc',
666 );
667
668 // Actions.
669 $items['admin/config/system/actions'] = array(
670 'title' => 'Actions',
671 'description' => 'Manage the actions defined for your site.',
672 'access arguments' => array('administer actions'),
673 'page callback' => 'system_actions_manage',
674 'file' => 'system.admin.inc',
675 );
676 $items['admin/config/system/actions/manage'] = array(
677 'title' => 'Manage actions',
678 'description' => 'Manage the actions defined for your site.',
679 'page callback' => 'system_actions_manage',
680 'type' => MENU_DEFAULT_LOCAL_TASK,
681 'weight' => -2,
682 'file' => 'system.admin.inc',
683 );
684 $items['admin/config/system/actions/configure'] = array(
685 'title' => 'Configure an advanced action',
686 'page callback' => 'drupal_get_form',
687 'page arguments' => array('system_actions_configure'),
688 'access arguments' => array('administer actions'),
689 'type' => MENU_CALLBACK,
690 'file' => 'system.admin.inc',
691 );
692 $items['admin/config/system/actions/delete/%actions'] = array(
693 'title' => 'Delete action',
694 'description' => 'Delete an action.',
695 'page callback' => 'drupal_get_form',
696 'page arguments' => array('system_actions_delete_form', 5),
697 'access arguments' => array('administer actions'),
698 'type' => MENU_CALLBACK,
699 'file' => 'system.admin.inc',
700 );
701 $items['admin/config/system/actions/orphan'] = array(
702 'title' => 'Remove orphans',
703 'page callback' => 'system_actions_remove_orphans',
704 'access arguments' => array('administer actions'),
705 'type' => MENU_CALLBACK,
706 'file' => 'system.admin.inc',
707 );
708
709 // IP address blocking.
710 $items['admin/config/people/ip-blocking'] = array(
711 'title' => 'IP address blocking',
712 'description' => 'Manage blocked IP addresses.',
713 'page callback' => 'system_ip_blocking',
714 'access arguments' => array('block IP addresses'),
715 'file' => 'system.admin.inc',
716 );
717 $items['admin/config/people/ip-blocking/%'] = array(
718 'title' => 'IP address blocking',
719 'description' => 'Manage blocked IP addresses.',
720 'page callback' => 'system_ip_blocking',
721 'access arguments' => array('block IP addresses'),
722 'type' => MENU_CALLBACK,
723 'file' => 'system.admin.inc',
724 );
725 $items['admin/config/people/ip-blocking/delete/%blocked_ip'] = array(
726 'title' => 'Delete IP address',
727 'page callback' => 'drupal_get_form',
728 'page arguments' => array('system_ip_blocking_delete', 5),
729 'access arguments' => array('block IP addresses'),
730 'type' => MENU_CALLBACK,
731 'file' => 'system.admin.inc',
732 );
733
734 // Configuration.
735 $items['admin/config/development'] = array(
736 'title' => 'Development',
737 'description' => 'Development tools.',
738 'position' => 'left',
739 'weight' => 10,
740 'page callback' => 'system_admin_menu_block_page',
741 'access arguments' => array('access administration pages'),
742 'file' => 'system.admin.inc',
743 );
744 $items['admin/config/development/maintenance'] = array(
745 'title' => 'Maintenance mode',
746 'description' => 'Take the site offline for maintenance or bring it back online.',
747 'page callback' => 'drupal_get_form',
748 'page arguments' => array('system_site_maintenance_mode'),
749 'access arguments' => array('administer site configuration'),
750 'file' => 'system.admin.inc',
751 );
752 $items['admin/config/development/performance'] = array(
753 'title' => 'Performance',
754 'description' => 'Enable or disable page caching for anonymous users and set CSS and JS bandwidth optimization options.',
755 'page callback' => 'drupal_get_form',
756 'page arguments' => array('system_performance_settings'),
757 'access arguments' => array('administer site configuration'),
758 'file' => 'system.admin.inc',
759 );
760 $items['admin/config/media'] = array(
761 'title' => 'Media',
762 'description' => 'Media tools.',
763 'position' => 'left',
764 'weight' => 10,
765 'page callback' => 'system_admin_menu_block_page',
766 'access arguments' => array('access administration pages'),
767 'file' => 'system.admin.inc',
768 );
769 $items['admin/config/media/file-system'] = array(
770 'title' => 'File system',
771 'description' => 'Tell Drupal where to store uploaded files and how they are accessed.',
772 'page callback' => 'drupal_get_form',
773 'page arguments' => array('system_file_system_settings'),
774 'access arguments' => array('administer site configuration'),
775 'file' => 'system.admin.inc',
776 );
777 $items['admin/config/media/image-toolkit'] = array(
778 'title' => 'Image toolkit',
779 'description' => 'Choose which image toolkit to use if you have installed optional toolkits.',
780 'page callback' => 'drupal_get_form',
781 'page arguments' => array('system_image_toolkit_settings'),
782 'access arguments' => array('administer site configuration'),
783 'file' => 'system.admin.inc',
784 );
785 $items['admin/config/services'] = array(
786 'title' => 'Web services',
787 'description' => 'Tools related to web services.',
788 'page callback' => 'system_admin_menu_block_page',
789 'access arguments' => array('access administration pages'),
790 'file' => 'system.admin.inc',
791 );
792 $items['admin/config/services/rss-publishing'] = array(
793 'title' => 'RSS publishing',
794 'description' => 'Configure the site description, the number of items per feed and whether feeds should be titles/teasers/full-text.',
795 'page callback' => 'drupal_get_form',
796 'page arguments' => array('system_rss_feeds_settings'),
797 'access arguments' => array('administer site configuration'),
798 'file' => 'system.admin.inc',
799 );
800 $items['admin/config/development/logging'] = array(
801 'title' => 'Logging and errors',
802 'description' => "Settings for logging and alerts modules. Various modules can route Drupal's system events to different destinations, such as syslog, database, email, etc.",
803 'page callback' => 'drupal_get_form',
804 'page arguments' => array('system_logging_settings'),
805 'access arguments' => array('administer site configuration'),
806 'file' => 'system.admin.inc',
807 );
808
809 // Regional and date settings.
810 $items['admin/config/regional'] = array(
811 'title' => 'Regional and language',
812 'description' => 'Regional settings, localization and translation.',
813 'position' => 'left',
814 'weight' => -7,
815 'page callback' => 'system_admin_menu_block_page',
816 'access arguments' => array('access administration pages'),
817 'file' => 'system.admin.inc',
818 );
819 $items['admin/config/regional/settings'] = array(
820 'title' => 'Regional settings',
821 'description' => "Settings for the site's default time zone and country.",
822 'page callback' => 'drupal_get_form',
823 'page arguments' => array('system_regional_settings'),
824 'access arguments' => array('administer site configuration'),
825 'weight' => -10,
826 'file' => 'system.admin.inc',
827 );
828 $items['admin/config/regional/date-time'] = array(
829 'title' => 'Date and time',
830 'description' => 'Configure display formats for date and time.',
831 'page callback' => 'drupal_get_form',
832 'page arguments' => array('system_date_time_settings'),
833 'access arguments' => array('administer site configuration'),
834 'weight' => -9,
835 'file' => 'system.admin.inc',
836 );
837 $items['admin/config/regional/date-time/types'] = array(
838 'title' => 'Types',
839 'description' => 'Configure display formats for date and time.',
840 'page callback' => 'drupal_get_form',
841 'page arguments' => array('system_date_time_settings'),
842 'access arguments' => array('administer site configuration'),
843 'type' => MENU_DEFAULT_LOCAL_TASK,
844 'weight' => -10,
845 'file' => 'system.admin.inc',
846 );
847 $items['admin/config/regional/date-time/types/add'] = array(
848 'title' => 'Add date type',
849 'description' => 'Add new date type.',
850 'page callback' => 'drupal_get_form',
851 'page arguments' => array('system_add_date_format_type_form'),
852 'access arguments' => array('administer site configuration'),
853 'type' => MENU_LOCAL_ACTION,
854 'weight' => -10,
855 'file' => 'system.admin.inc',
856 );
857 $items['admin/config/regional/date-time/types/%/delete'] = array(
858 'title' => 'Delete date type',
859 'description' => 'Allow users to delete a configured date type.',
860 'type' => MENU_CALLBACK,
861 'page callback' => 'drupal_get_form',
862 'page arguments' => array('system_delete_date_format_type_form', 5),
863 'access arguments' => array('administer site configuration'),
864 'file' => 'system.admin.inc',
865 );
866 $items['admin/config/regional/date-time/formats'] = array(
867 'title' => 'Formats',
868 'description' => 'Configure display format strings for date and time.',
869 'page callback' => 'system_date_time_formats',
870 'access arguments' => array('administer site configuration'),
871 'type' => MENU_LOCAL_TASK,
872 'weight' => -9,
873 'file' => 'system.admin.inc',
874 );
875 $items['admin/config/regional/date-time/formats/add'] = array(
876 'title' => 'Add format',
877 'description' => 'Allow users to add additional date formats.',
878 'type' => MENU_LOCAL_ACTION,
879 'page callback' => 'drupal_get_form',
880 'page arguments' => array('system_configure_date_formats_form'),
881 'access arguments' => array('administer site configuration'),
882 'weight' => -10,
883 'file' => 'system.admin.inc',
884 );
885 $items['admin/config/regional/date-time/formats/%/edit'] = array(
886 'title' => 'Edit date format',
887 'description' => 'Allow users to edit a configured date format.',
888 'type' => MENU_CALLBACK,
889 'page callback' => 'drupal_get_form',
890 'page arguments' => array('system_configure_date_formats_form', 5),
891 'access arguments' => array('administer site configuration'),
892 'file' => 'system.admin.inc',
893 );
894 $items['admin/config/regional/date-time/formats/%/delete'] = array(
895 'title' => 'Delete date format',
896 'description' => 'Allow users to delete a configured date format.',
897 'type' => MENU_CALLBACK,
898 'page callback' => 'drupal_get_form',
899 'page arguments' => array('system_date_delete_format_form', 5),
900 'access arguments' => array('administer site configuration'),
901 'file' => 'system.admin.inc',
902 );
903 $items['admin/config/regional/date-time/formats/lookup'] = array(
904 'title' => 'Date and time lookup',
905 'type' => MENU_CALLBACK,
906 'page callback' => 'system_date_time_lookup',
907 'access arguments' => array('administer site configuration'),
908 'file' => 'system.admin.inc',
909 );
910
911 $items['admin/config/search'] = array(
912 'title' => 'Search and metadata',
913 'description' => 'Local site search, metadata and SEO.',
914 'page callback' => 'system_admin_menu_block_page',
915 'access arguments' => array('access administration pages'),
916 'file' => 'system.admin.inc',
917 );
918 $items['admin/config/search/clean-urls'] = array(
919 'title' => 'Clean URLs',
920 'description' => 'Enable or disable clean URLs for your site.',
921 'page callback' => 'drupal_get_form',
922 'page arguments' => array('system_clean_url_settings'),
923 'access arguments' => array('administer site configuration'),
924 'file' => 'system.admin.inc',
925 );
926 $items['admin/config/search/clean-urls/check'] = array(
927 'title' => 'Clean URL check',
928 'page callback' => 'drupal_json_output',
929 'page arguments' => array(array('status' => TRUE)),
930 'access callback' => TRUE,
931 'type' => MENU_CALLBACK,
932 'file' => 'system.admin.inc',
933 );
934 $items['admin/config/content'] = array(
935 'title' => 'Content authoring',
936 'description' => 'Settings related to formatting and authoring content.',
937 'position' => 'right',
938 'weight' => 5,
939 'page callback' => 'system_admin_menu_block_page',
940 'access arguments' => array('access administration pages'),
941 'file' => 'system.admin.inc',
942 );
943 $items['admin/config/system'] = array(
944 'title' => 'System',
945 'description' => 'General system related configuration.',
946 'position' => 'right',
947 'weight' => -5,
948 'page callback' => 'system_admin_menu_block_page',
949 'access arguments' => array('access administration pages'),
950 'file' => 'system.admin.inc',
951 );
952 $items['admin/config/system/site-information'] = array(
953 'title' => 'Site information',
954 'description' => 'Change basic site name, e-mail address, slogan, default front page, number of posts per page, error pages and cron.',
955 'page callback' => 'drupal_get_form',
956 'page arguments' => array('system_site_information_settings'),
957 'access arguments' => array('administer site configuration'),
958 'file' => 'system.admin.inc',
959 'weight' => -10,
960 );
961
962 // Reports.
963 $items['admin/reports'] = array(
964 'title' => 'Reports',
965 'description' => 'View reports from system logs and other status information.',
966 'page callback' => 'system_admin_menu_block_page',
967 'access arguments' => array('access site reports'),
968 'weight' => 5,
969 'position' => 'left',
970 'file' => 'system.admin.inc',
971 );
972 $items['admin/reports/status'] = array(
973 'title' => 'Status report',
974 'description' => "Get a status report about your site's operation and any detected problems.",
975 'page callback' => 'system_status',
976 'weight' => 10,
977 'access arguments' => array('administer site configuration'),
978 'file' => 'system.admin.inc',
979 );
980 $items['admin/reports/status/run-cron'] = array(
981 'title' => 'Run cron',
982 'page callback' => 'system_run_cron',
983 'access arguments' => array('administer site configuration'),
984 'type' => MENU_CALLBACK,
985 'file' => 'system.admin.inc',
986 );
987 $items['admin/reports/status/php'] = array(
988 'title' => 'PHP',
989 'page callback' => 'system_php',
990 'access arguments' => array('administer site configuration'),
991 'type' => MENU_CALLBACK,
992 'file' => 'system.admin.inc',
993 );
994 // Default page for batch operations.
995 $items['batch'] = array(
996 'page callback' => 'system_batch_page',
997 'access callback' => TRUE,
998 'theme callback' => '_system_batch_theme',
999 'type' => MENU_CALLBACK,
1000 'file' => 'system.admin.inc',
1001 );
1002 return $items;
1003 }
1004
1005 /**
1006 * Theme callback for the default batch page.
1007 */
1008 function _system_batch_theme() {
1009 // Retrieve the current state of the batch.
1010 $batch = &batch_get();
1011 if (!$batch && isset($_REQUEST['id'])) {
1012 require_once DRUPAL_ROOT . '/includes/batch.inc';
1013 $batch = batch_load($_REQUEST['id']);
1014 }
1015 // Use the same theme as the page that started the batch.
1016 if (!empty($batch['theme'])) {
1017 return $batch['theme'];
1018 }
1019 }
1020
1021 /**
1022 * Implementation of hook_library().
1023 */
1024 function system_library() {
1025 // jQuery.
1026 $libraries['jquery'] = array(
1027 'title' => 'jQuery',
1028 'website' => 'http://jquery.com',
1029 'version' => '1.3.2',
1030 'js' => array(
1031 'misc/jquery.js' => array('weight' => JS_LIBRARY - 20),
1032 ),
1033 );
1034
1035 // jQuery Once.
1036 $libraries['once'] = array(
1037 'title' => 'jQuery Once',
1038 'website' => 'http://plugins.jquery.com/project/once',
1039 'version' => '1.2',
1040 'js' => array(
1041 'misc/jquery.once.js' => array('weight' => JS_LIBRARY - 19),
1042 ),
1043 );
1044
1045 // jQuery Form Plugin.
1046 $libraries['form'] = array(
1047 'title' => 'jQuery Form Plugin',
1048 'website' => 'http://malsup.com/jquery/form/',
1049 'version' => '2.16',
1050 'js' => array(
1051 'misc/jquery.form.js' => array(),
1052 ),
1053 );
1054
1055 // Vertical Tabs.
1056 $libraries['vertical-tabs'] = array(
1057 'title' => 'Vertical Tabs',
1058 'website' => 'http://drupal.org/node/323112',
1059 'version' => '1.0',
1060 'js' => array(
1061 'misc/vertical-tabs.js' => array(),
1062 ),
1063 'css' => array(
1064 'misc/vertical-tabs.css' => array(),
1065 ),
1066 );
1067
1068 // Farbtastic.
1069 $libraries['farbtastic'] = array(
1070 'title' => 'Farbtastic', <