/[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.838 - (show annotations) (download) (as text)
Sun Nov 8 10:29:23 2009 UTC (2 weeks, 6 days ago) by webchick
Branch: MAIN
CVS Tags: DRUPAL-7-0-UNSTABLE-10
Changes since 1.837: +15 -3 lines
File MIME type: text/x-php
#622766 by sun: Add contextual links UI as a JS library.
1 <?php
2 // $Id: system.module,v 1.837 2009/11/07 13:35:21 dries 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 contextual links' => array(
221 'title' => t('Access contextual links'),
222 'description' => t('Use contextual links to perform actions related to elements on a page.'),
223 ),
224 'access site in maintenance mode' => array(
225 'title' => t('Access site in maintenance mode'),
226 'description' => t('Log in when the site is in maintenance mode.'),
227 ),
228 'access site reports' => array(
229 'title' => t('Access site reports'),
230 'description' => t('View reports from system logs and other status information.'),
231 ),
232 'block IP addresses' => array(
233 'title' => t('Block IP addresses'),
234 'description' => t('Block IP addresses from accessing your site.'),
235 ),
236 );
237 }
238
239 /**
240 * Implement hook_rdf_namespaces().
241 */
242 function system_rdf_namespaces() {
243 return array(
244 'admin' => 'http://webns.net/mvcb/',
245 'content' => 'http://purl.org/rss/1.0/modules/content/',
246 'dc' => 'http://purl.org/dc/terms/',
247 'foaf' => 'http://xmlns.com/foaf/0.1/',
248 'owl' => 'http://www.w3.org/2002/07/owl#',
249 'rdf' => 'http://www.w3.org/1999/02/22-rdf-syntax-ns#',
250 'rdfs' => 'http://www.w3.org/2000/01/rdf-schema#',
251 'rss' => 'http://purl.org/rss/1.0/',
252 'tags' => 'http://www.holygoat.co.uk/owl/redwood/0.1/tags/',
253 'sioc' => 'http://rdfs.org/sioc/ns#',
254 'sioct' => 'http://rdfs.org/sioc/types#',
255 'ctag' => 'http://commontag.org/ns#',
256 'skos' => 'http://www.w3.org/2004/02/skos/core#',
257 'xsd' => 'http://www.w3.org/2001/XMLSchema#',
258 );
259 }
260
261 /**
262 * Implement hook_hook_info().
263 */
264 function system_hook_info() {
265 $hooks['token_info'] = array(
266 'group' => 'tokens',
267 );
268 $hooks['tokens'] = array(
269 'group' => 'tokens',
270 );
271 return $hooks;
272 }
273
274 /**
275 * Implement hook_entity_info().
276 */
277 function system_entity_info() {
278 return array(
279 'file' => array(
280 'label' => t('File'),
281 'base table' => 'file',
282 'object keys' => array(
283 'id' => 'fid',
284 ),
285 'static cache' => FALSE,
286 ),
287 );
288 }
289
290 /**
291 * Implement hook_element_info().
292 */
293 function system_element_info() {
294 // Top level elements.
295 $types['form'] = array(
296 '#method' => 'post',
297 '#action' => request_uri(),
298 '#theme_wrappers' => array('form'),
299 );
300 $types['page'] = array(
301 '#show_messages' => TRUE,
302 '#theme' => 'page',
303 '#theme_wrappers' => array('html'),
304 );
305 $types['list'] = array(
306 '#title' => '',
307 '#list_type' => 'ul',
308 '#attributes' => array(),
309 '#items' => array(),
310 );
311 // By default, we don't want AJAX commands being rendered in the context of an
312 // HTML page, so we don't provide defaults for #theme or #theme_wrappers.
313 // However, modules can set these properties (for example, to provide an HTML
314 // debugging page that displays rather than executes AJAX commands).
315 $types['ajax_commands'] = array(
316 '#ajax_commands' => array(),
317 );
318
319 $types['html_tag'] = array(
320 '#theme' => 'html_tag',
321 '#attributes' => array(),
322 '#value' => NULL,
323 );
324
325 // Input elements.
326 $types['submit'] = array(
327 '#input' => TRUE,
328 '#name' => 'op',
329 '#button_type' => 'submit',
330 '#executes_submit_callback' => TRUE,
331 '#process' => array('ajax_process_form'),
332 '#theme_wrappers' => array('button'),
333 );
334 $types['button'] = array(
335 '#input' => TRUE,
336 '#name' => 'op',
337 '#button_type' => 'submit',
338 '#executes_submit_callback' => FALSE,
339 '#process' => array('ajax_process_form'),
340 '#theme_wrappers' => array('button'),
341 );
342 $types['image_button'] = array(
343 '#input' => TRUE,
344 '#button_type' => 'submit',
345 '#executes_submit_callback' => TRUE,
346 '#process' => array('ajax_process_form'),
347 '#return_value' => TRUE,
348 '#has_garbage_value' => TRUE,
349 '#src' => NULL,
350 '#theme_wrappers' => array('image_button'),
351 );
352 $types['textfield'] = array(
353 '#input' => TRUE,
354 '#size' => 60,
355 '#maxlength' => 128,
356 '#autocomplete_path' => FALSE,
357 '#process' => array('form_process_text_format', 'ajax_process_form'),
358 '#theme' => 'textfield',
359 '#theme_wrappers' => array('form_element'),
360 );
361 $types['password'] = array(
362 '#input' => TRUE,
363 '#size' => 60,
364 '#maxlength' => 128,
365 '#process' => array('ajax_process_form'),
366 '#theme' => 'password',
367 '#theme_wrappers' => array('form_element'),
368 );
369 $types['password_confirm'] = array(
370 '#input' => TRUE,
371 '#process' => array('form_process_password_confirm'),
372 '#theme_wrappers' => array('form_element'),
373 );
374 $types['textarea'] = array(
375 '#input' => TRUE,
376 '#cols' => 60,
377 '#rows' => 5,
378 '#resizable' => TRUE,
379 '#process' => array('form_process_text_format', 'ajax_process_form'),
380 '#theme' => 'textarea',
381 '#theme_wrappers' => array('form_element'),
382 );
383 $types['radios'] = array(
384 '#input' => TRUE,
385 '#process' => array('form_process_radios'),
386 '#theme_wrappers' => array('radios'),
387 '#pre_render' => array('form_pre_render_conditional_form_element'),
388 );
389 $types['radio'] = array(
390 '#input' => TRUE,
391 '#default_value' => NULL,
392 '#process' => array('ajax_process_form'),
393 '#theme' => 'radio',
394 '#theme_wrappers' => array('form_element'),
395 '#form_element_skip_title' => TRUE,
396 );
397 $types['checkboxes'] = array(
398 '#input' => TRUE,
399 '#tree' => TRUE,
400 '#process' => array('form_process_checkboxes'),
401 '#theme_wrappers' => array('checkboxes'),
402 '#pre_render' => array('form_pre_render_conditional_form_element'),
403 );
404 $types['checkbox'] = array(
405 '#input' => TRUE,
406 '#return_value' => 1,
407 '#process' => array('ajax_process_form'),
408 '#theme' => 'checkbox',
409 '#theme_wrappers' => array('form_element'),
410 '#form_element_skip_title' => TRUE,
411 );
412 $types['select'] = array(
413 '#input' => TRUE,
414 '#size' => 0,
415 '#multiple' => FALSE,
416 '#process' => array('ajax_process_form'),
417 '#theme' => 'select',
418 '#theme_wrappers' => array('form_element'),
419 );
420 $types['weight'] = array(
421 '#input' => TRUE,
422 '#delta' => 10,
423 '#default_value' => 0,
424 '#process' => array('form_process_weight', 'ajax_process_form'),
425 );
426 $types['date'] = array(
427 '#input' => TRUE,
428 '#element_validate' => array('date_validate'),
429 '#process' => array('form_process_date'),
430 '#theme' => 'date',
431 '#theme_wrappers' => array('form_element'),
432 );
433 $types['file'] = array(
434 '#input' => TRUE,
435 '#size' => 60,
436 '#theme' => 'file',
437 '#theme_wrappers' => array('form_element'),
438 );
439 $types['tableselect'] = array(
440 '#input' => TRUE,
441 '#js_select' => TRUE,
442 '#multiple' => TRUE,
443 '#process' => array('form_process_tableselect'),
444 '#options' => array(),
445 '#empty' => '',
446 '#theme' => 'tableselect',
447 );
448
449 // Form structure.
450 $types['item'] = array(
451 '#markup' => '',
452 '#pre_render' => array('drupal_pre_render_markup'),
453 '#theme_wrappers' => array('form_element'),
454 );
455 $types['hidden'] = array(
456 '#input' => TRUE,
457 '#process' => array('ajax_process_form'),
458 '#theme' => 'hidden',
459 );
460 $types['value'] = array(
461 '#input' => TRUE,
462 );
463 $types['markup'] = array(
464 '#markup' => '',
465 '#pre_render' => array('drupal_pre_render_markup'),
466 );
467 $types['link'] = array(
468 '#pre_render' => array('drupal_pre_render_link', 'drupal_pre_render_markup'),
469 );
470 $types['fieldset'] = array(
471 '#collapsible' => FALSE,
472 '#collapsed' => FALSE,
473 '#value' => NULL,
474 '#process' => array('form_process_fieldset', 'ajax_process_form'),
475 '#pre_render' => array('form_pre_render_fieldset'),
476 '#theme_wrappers' => array('fieldset'),
477 );
478 $types['vertical_tabs'] = array(
479 '#theme_wrappers' => array('vertical_tabs'),
480 '#default_tab' => '',
481 '#process' => array('form_process_vertical_tabs'),
482 );
483
484 $types['container'] = array(
485 '#theme_wrappers' => array('container'),
486 '#process' => array('form_process_container'),
487 );
488
489 $types['token'] = array(
490 '#input' => TRUE,
491 '#theme' => array('hidden'),
492 );
493
494 return $types;
495 }
496
497 /**
498 * Implement hook_menu().
499 */
500 function system_menu() {
501 $items['system/files'] = array(
502 'title' => 'File download',
503 'page callback' => 'file_download',
504 'page arguments' => array('private'),
505 'access callback' => TRUE,
506 'type' => MENU_CALLBACK,
507 );
508 $items['system/temporary'] = array(
509 'title' => 'Temporary files',
510 'page callback' => 'file_download',
511 'page arguments' => array('temporary'),
512 'access callback' => TRUE,
513 'type' => MENU_CALLBACK,
514 );
515 $items['system/ajax'] = array(
516 'title' => 'AHAH callback',
517 'page callback' => 'ajax_form_callback',
518 'delivery callback' => 'ajax_deliver',
519 'access callback' => TRUE,
520 'type' => MENU_CALLBACK,
521 'file path' => 'includes',
522 'file' => 'form.inc',
523 );
524 $items['system/timezone'] = array(
525 'title' => 'Time zone',
526 'page callback' => 'system_timezone',
527 'access callback' => TRUE,
528 'type' => MENU_CALLBACK,
529 'file' => 'system.admin.inc',
530 );
531 $items['system/run-cron-image'] = array(
532 'title' => 'Execute cron',
533 'page callback' => 'system_run_cron_image',
534 'access callback' => 'system_run_cron_image_access',
535 'type' => MENU_CALLBACK,
536 'file' => 'system.admin.inc',
537 );
538 $items['admin'] = array(
539 'title' => 'Administer',
540 'access arguments' => array('access administration pages'),
541 'page callback' => 'system_main_admin_page',
542 'weight' => 9,
543 'menu_name' => 'management',
544 'theme callback' => 'variable_get',
545 'theme arguments' => array('admin_theme'),
546 'file' => 'system.admin.inc',
547 );
548 $items['admin/compact'] = array(
549 'title' => 'Compact mode',
550 'page callback' => 'system_admin_compact_page',
551 'access arguments' => array('access administration pages'),
552 'type' => MENU_CALLBACK,
553 'file' => 'system.admin.inc',
554 );
555 $items['admin/by-task'] = array(
556 'title' => 'By task',
557 'page callback' => 'system_main_admin_page',
558 'access arguments' => array('access administration pages'),
559 'type' => MENU_DEFAULT_LOCAL_TASK,
560 'file' => 'system.admin.inc',
561 );
562 $items['admin/by-module'] = array(
563 'title' => 'By module',
564 'page callback' => 'system_admin_by_module',
565 'access arguments' => array('access administration pages'),
566 'type' => MENU_LOCAL_TASK,
567 'weight' => 2,
568 'file' => 'system.admin.inc',
569 );
570
571 // Menu items that are basically just menu blocks.
572 $items['admin/structure'] = array(
573 'title' => 'Structure',
574 'description' => 'Control how your site looks and feels.',
575 'position' => 'right',
576 'weight' => -8,
577 'page callback' => 'system_admin_menu_block_page',
578 'access arguments' => array('access administration pages'),
579 'file' => 'system.admin.inc',
580 );
581 // Appearance.
582 $items['admin/appearance'] = array(
583 'title' => 'Appearance',
584 'description' => 'Select and configure your site theme.',
585 'page callback' => 'drupal_get_form',
586 'page arguments' => array('system_themes_form'),
587 'access arguments' => array('administer site configuration'),
588 'position' => 'left',
589 'weight' => -6,
590 'file' => 'system.admin.inc',
591 );
592 $items['admin/appearance/select'] = array(
593 'title' => 'List',
594 'description' => 'Select the default theme for your site.',
595 'type' => MENU_DEFAULT_LOCAL_TASK,
596 'weight' => -1,
597 'file' => 'system.admin.inc',
598 );
599 $items['admin/appearance/settings'] = array(
600 'title' => 'Configure',
601 'description' => 'Configure default and theme specific settings.',
602 'page arguments' => array('system_theme_settings'),
603 'access arguments' => array('administer site configuration'),
604 'type' => MENU_LOCAL_TASK,
605 'file' => 'system.admin.inc',
606 );
607 // Theme configuration subtabs.
608 $items['admin/appearance/settings/global'] = array(
609 'title' => 'Global settings',
610 'type' => MENU_DEFAULT_LOCAL_TASK,
611 'weight' => -1,
612 );
613
614 foreach (list_themes() as $theme) {
615 $items['admin/appearance/settings/' . $theme->name] = array(
616 'title' => $theme->info['name'],
617 'page arguments' => array('system_theme_settings', $theme->name),
618 'type' => MENU_LOCAL_TASK,
619 'access callback' => '_system_themes_access',
620 'access arguments' => array($theme),
621 'file' => 'system.admin.inc',
622 );
623 }
624
625 // Configuration and modules.
626 $items['admin/config'] = array(
627 'title' => 'Configuration and modules',
628 'page callback' => 'system_admin_config_page',
629 'access arguments' => array('access administration pages'),
630 'file' => 'system.admin.inc',
631 );
632 $items['admin/config/config'] = array(
633 'title' => 'Configuration',
634 'access arguments' => array('administer site configuration'),
635 'type' => MENU_DEFAULT_LOCAL_TASK,
636 'weight' => -10,
637 'file' => 'system.admin.inc',
638 );
639 $items['admin/config/modules'] = array(
640 'title' => 'Modules',
641 'description' => 'Enable or disable add-on modules for your site.',
642 'page callback' => 'drupal_get_form',
643 'page arguments' => array('system_modules'),
644 'access arguments' => array('administer site configuration'),
645 'file' => 'system.admin.inc',
646 'type' => MENU_LOCAL_TASK,
647 'weight' => 10,
648 );
649 $items['admin/config/modules/list'] = array(
650 'title' => 'List',
651 'type' => MENU_DEFAULT_LOCAL_TASK,
652 );
653 $items['admin/config/modules/list/confirm'] = array(
654 'title' => 'List',
655 'access arguments' => array('administer site configuration'),
656 'type' => MENU_CALLBACK,
657 );
658 $items['admin/config/modules/uninstall'] = array(
659 'title' => 'Uninstall',
660 'page arguments' => array('system_modules_uninstall'),
661 'access arguments' => array('administer site configuration'),
662 'type' => MENU_LOCAL_TASK,
663 'file' => 'system.admin.inc',
664 );
665 $items['admin/config/modules/uninstall/confirm'] = array(
666 'title' => 'Uninstall',
667 'access arguments' => array('administer site configuration'),
668 'type' => MENU_CALLBACK,
669 'file' => 'system.admin.inc',
670 );
671
672 // Actions.
673 $items['admin/config/system/actions'] = array(
674 'title' => 'Actions',
675 'description' => 'Manage the actions defined for your site.',
676 'access arguments' => array('administer actions'),
677 'page callback' => 'system_actions_manage',
678 'file' => 'system.admin.inc',
679 );
680 $items['admin/config/system/actions/manage'] = array(
681 'title' => 'Manage actions',
682 'description' => 'Manage the actions defined for your site.',
683 'page callback' => 'system_actions_manage',
684 'type' => MENU_DEFAULT_LOCAL_TASK,
685 'weight' => -2,
686 'file' => 'system.admin.inc',
687 );
688 $items['admin/config/system/actions/configure'] = array(
689 'title' => 'Configure an advanced action',
690 'page callback' => 'drupal_get_form',
691 'page arguments' => array('system_actions_configure'),
692 'access arguments' => array('administer actions'),
693 'type' => MENU_CALLBACK,
694 'file' => 'system.admin.inc',
695 );
696 $items['admin/config/system/actions/delete/%actions'] = array(
697 'title' => 'Delete action',
698 'description' => 'Delete an action.',
699 'page callback' => 'drupal_get_form',
700 'page arguments' => array('system_actions_delete_form', 5),
701 'access arguments' => array('administer actions'),
702 'type' => MENU_CALLBACK,
703 'file' => 'system.admin.inc',
704 );
705 $items['admin/config/system/actions/orphan'] = array(
706 'title' => 'Remove orphans',
707 'page callback' => 'system_actions_remove_orphans',
708 'access arguments' => array('administer actions'),
709 'type' => MENU_CALLBACK,
710 'file' => 'system.admin.inc',
711 );
712
713 // IP address blocking.
714 $items['admin/config/people/ip-blocking'] = array(
715 'title' => 'IP address blocking',
716 'description' => 'Manage blocked IP addresses.',
717 'page callback' => 'system_ip_blocking',
718 'access arguments' => array('block IP addresses'),
719 'file' => 'system.admin.inc',
720 );
721 $items['admin/config/people/ip-blocking/%'] = array(
722 'title' => 'IP address blocking',
723 'description' => 'Manage blocked IP addresses.',
724 'page callback' => 'system_ip_blocking',
725 'access arguments' => array('block IP addresses'),
726 'type' => MENU_CALLBACK,
727 'file' => 'system.admin.inc',
728 );
729 $items['admin/config/people/ip-blocking/delete/%blocked_ip'] = array(
730 'title' => 'Delete IP address',
731 'page callback' => 'drupal_get_form',
732 'page arguments' => array('system_ip_blocking_delete', 5),
733 'access arguments' => array('block IP addresses'),
734 'type' => MENU_CALLBACK,
735 'file' => 'system.admin.inc',
736 );
737
738 // Configuration.
739 $items['admin/config/development'] = array(
740 'title' => 'Development',
741 'description' => 'Development tools.',
742 'position' => 'left',
743 'weight' => 10,
744 'page callback' => 'system_admin_menu_block_page',
745 'access arguments' => array('access administration pages'),
746 'file' => 'system.admin.inc',
747 );
748 $items['admin/config/development/maintenance'] = array(
749 'title' => 'Maintenance mode',
750 'description' => 'Take the site offline for maintenance or bring it back online.',
751 'page callback' => 'drupal_get_form',
752 'page arguments' => array('system_site_maintenance_mode'),
753 'access arguments' => array('administer site configuration'),
754 'file' => 'system.admin.inc',
755 );
756 $items['admin/config/development/performance'] = array(
757 'title' => 'Performance',
758 'description' => 'Enable or disable page caching for anonymous users and set CSS and JS bandwidth optimization options.',
759 'page callback' => 'drupal_get_form',
760 'page arguments' => array('system_performance_settings'),
761 'access arguments' => array('administer site configuration'),
762 'file' => 'system.admin.inc',
763 );
764 $items['admin/config/media'] = array(
765 'title' => 'Media',
766 'description' => 'Media tools.',
767 'position' => 'left',
768 'weight' => 10,
769 'page callback' => 'system_admin_menu_block_page',
770 'access arguments' => array('access administration pages'),
771 'file' => 'system.admin.inc',
772 );
773 $items['admin/config/media/file-system'] = array(
774 'title' => 'File system',
775 'description' => 'Tell Drupal where to store uploaded files and how they are accessed.',
776 'page callback' => 'drupal_get_form',
777 'page arguments' => array('system_file_system_settings'),
778 'access arguments' => array('administer site configuration'),
779 'file' => 'system.admin.inc',
780 );
781 $items['admin/config/media/image-toolkit'] = array(
782 'title' => 'Image toolkit',
783 'description' => 'Choose which image toolkit to use if you have installed optional toolkits.',
784 'page callback' => 'drupal_get_form',
785 'page arguments' => array('system_image_toolkit_settings'),
786 'access arguments' => array('administer site configuration'),
787 'file' => 'system.admin.inc',
788 );
789 $items['admin/config/services'] = array(
790 'title' => 'Web services',
791 'description' => 'Tools related to web services.',
792 'page callback' => 'system_admin_menu_block_page',
793 'access arguments' => array('access administration pages'),
794 'file' => 'system.admin.inc',
795 );
796 $items['admin/config/services/rss-publishing'] = array(
797 'title' => 'RSS publishing',
798 'description' => 'Configure the site description, the number of items per feed and whether feeds should be titles/teasers/full-text.',
799 'page callback' => 'drupal_get_form',
800 'page arguments' => array('system_rss_feeds_settings'),
801 'access arguments' => array('administer site configuration'),
802 'file' => 'system.admin.inc',
803 );
804 $items['admin/config/development/logging'] = array(
805 'title' => 'Logging and errors',
806 'description' => "Settings for logging and alerts modules. Various modules can route Drupal's system events to different destinations, such as syslog, database, email, etc.",
807 'page callback' => 'drupal_get_form',
808 'page arguments' => array('system_logging_settings'),
809 'access arguments' => array('administer site configuration'),
810 'file' => 'system.admin.inc',
811 );
812
813 // Regional and date settings.
814 $items['admin/config/regional'] = array(
815 'title' => 'Regional and language',
816 'description' => 'Regional settings, localization and translation.',
817 'position' => 'left',
818 'weight' => -7,
819 'page callback' => 'system_admin_menu_block_page',
820 'access arguments' => array('access administration pages'),
821 'file' => 'system.admin.inc',
822 );
823 $items['admin/config/regional/settings'] = array(
824 'title' => 'Regional settings',
825 'description' => "Settings for the site's default time zone and country.",
826 'page callback' => 'drupal_get_form',
827 'page arguments' => array('system_regional_settings'),
828 'access arguments' => array('administer site configuration'),
829 'weight' => -10,
830 'file' => 'system.admin.inc',
831 );
832 $items['admin/config/regional/date-time'] = array(
833 'title' => 'Date and time',
834 'description' => 'Configure display formats for date and time.',
835 'page callback' => 'drupal_get_form',
836 'page arguments' => array('system_date_time_settings'),
837 'access arguments' => array('administer site configuration'),
838 'weight' => -9,
839 'file' => 'system.admin.inc',
840 );
841 $items['admin/config/regional/date-time/types'] = array(
842 'title' => 'Types',
843 'description' => 'Configure display formats for date and time.',
844 'page callback' => 'drupal_get_form',
845 'page arguments' => array('system_date_time_settings'),
846 'access arguments' => array('administer site configuration'),
847 'type' => MENU_DEFAULT_LOCAL_TASK,
848 'weight' => -10,
849 'file' => 'system.admin.inc',
850 );
851 $items['admin/config/regional/date-time/types/add'] = array(
852 'title' => 'Add date type',
853 'description' => 'Add new date type.',
854 'page callback' => 'drupal_get_form',
855 'page arguments' => array('system_add_date_format_type_form'),
856 'access arguments' => array('administer site configuration'),
857 'type' => MENU_LOCAL_ACTION,
858 'weight' => -10,
859 'file' => 'system.admin.inc',
860 );
861 $items['admin/config/regional/date-time/types/%/delete'] = array(
862 'title' => 'Delete date type',
863 'description' => 'Allow users to delete a configured date type.',
864 'type' => MENU_CALLBACK,
865 'page callback' => 'drupal_get_form',
866 'page arguments' => array('system_delete_date_format_type_form', 5),
867 'access arguments' => array('administer site configuration'),
868 'file' => 'system.admin.inc',
869 );
870 $items['admin/config/regional/date-time/formats'] = array(
871 'title' => 'Formats',
872 'description' => 'Configure display format strings for date and time.',
873 'page callback' => 'system_date_time_formats',
874 'access arguments' => array('administer site configuration'),
875 'type' => MENU_LOCAL_TASK,
876 'weight' => -9,
877 'file' => 'system.admin.inc',
878 );
879 $items['admin/config/regional/date-time/formats/add'] = array(
880 'title' => 'Add format',
881 'description' => 'Allow users to add additional date formats.',
882 'type' => MENU_LOCAL_ACTION,
883 'page callback' => 'drupal_get_form',
884 'page arguments' => array('system_configure_date_formats_form'),
885 'access arguments' => array('administer site configuration'),
886 'weight' => -10,
887 'file' => 'system.admin.inc',
888 );
889 $items['admin/config/regional/date-time/formats/%/edit'] = array(
890 'title' => 'Edit date format',
891 'description' => 'Allow users to edit a configured date format.',
892 'type' => MENU_CALLBACK,
893 'page callback' => 'drupal_get_form',
894 'page arguments' => array('system_configure_date_formats_form', 5),
895 'access arguments' => array('administer site configuration'),
896 'file' => 'system.admin.inc',
897 );
898 $items['admin/config/regional/date-time/formats/%/delete'] = array(
899 'title' => 'Delete date format',
900 'description' => 'Allow users to delete a configured date format.',
901 'type' => MENU_CALLBACK,
902 'page callback' => 'drupal_get_form',
903 'page arguments' => array('system_date_delete_format_form', 5),
904 'access arguments' => array('administer site configuration'),
905 'file' => 'system.admin.inc',
906 );
907 $items['admin/config/regional/date-time/formats/lookup'] = array(
908 'title' => 'Date and time lookup',
909 'type' => MENU_CALLBACK,
910 'page callback' => 'system_date_time_lookup',
911 'access arguments' => array('administer site configuration'),
912 'file' => 'system.admin.inc',
913 );
914
915 $items['admin/config/search'] = array(
916 'title' => 'Search and metadata',
917 'description' => 'Local site search, metadata and SEO.',
918 'page callback' => 'system_admin_menu_block_page',
919 'access arguments' => array('access administration pages'),
920 'file' => 'system.admin.inc',
921 );
922 $items['admin/config/search/clean-urls'] = array(
923 'title' => 'Clean URLs',
924 'description' => 'Enable or disable clean URLs for your site.',
925 'page callback' => 'drupal_get_form',
926 'page arguments' => array('system_clean_url_settings'),
927 'access arguments' => array('administer site configuration'),
928 'file' => 'system.admin.inc',
929 );
930 $items['admin/config/search/clean-urls/check'] = array(
931 'title' => 'Clean URL check',
932 'page callback' => 'drupal_json_output',
933 'page arguments' => array(array('status' => TRUE)),
934 'access callback' => TRUE,
935 'type' => MENU_CALLBACK,
936 'file' => 'system.admin.inc',
937 );
938 $items['admin/config/content'] = array(
939 'title' => 'Content authoring',
940 'description' => 'Settings related to formatting and authoring content.',
941 'position' => 'right',
942 'weight' => 5,
943 'page callback' => 'system_admin_menu_block_page',
944 'access arguments' => array('access administration pages'),
945 'file' => 'system.admin.inc',
946 );
947 $items['admin/config/system'] = array(
948 'title' => 'System',
949 'description' => 'General system related configuration.',
950 'position' => 'right',
951 'weight' => -5,
952 'page callback' => 'system_admin_menu_block_page',
953 'access arguments' => array('access administration pages'),
954 'file' => 'system.admin.inc',
955 );
956 $items['admin/config/system/site-information'] = array(
957 'title' => 'Site information',
958 'description' => 'Change basic site name, e-mail address, slogan, default front page, number of posts per page, error pages and cron.',
959 'page callback' => 'drupal_get_form',
960 'page arguments' => array('system_site_information_settings'),
961 'access arguments' => array('administer site configuration'),
962 'file' => 'system.admin.inc',
963 'weight' => -10,
964 );
965
966 // Reports.
967 $items['admin/reports'] = array(
968 'title' => 'Reports',
969 'description' => 'View reports from system logs and other status information.',
970 'page callback' => 'system_admin_menu_block_page',
971 'access arguments' => array('access site reports'),
972 'weight' => 5,
973 'position' => 'left',
974 'file' => 'system.admin.inc',
975 );
976 $items['admin/reports/status'] = array(
977 'title' => 'Status report',
978 'description' => "Get a status report about your site's operation and any detected problems.",
979 'page callback' => 'system_status',
980 'weight' => 10,
981 'access arguments' => array('administer site configuration'),
982 'file' => 'system.admin.inc',
983 );
984 $items['admin/reports/status/run-cron'] = array(
985 'title' => 'Run cron',
986 'page callback' => 'system_run_cron',
987 'access arguments' => array('administer site configuration'),
988 'type' => MENU_CALLBACK,
989 'file' => 'system.admin.inc',
990 );
991 $items['admin/reports/status/php'] = array(
992 'title' => 'PHP',
993 'page callback' => 'system_php',
994 'access arguments' => array('administer site configuration'),
995 'type' => MENU_CALLBACK,
996 'file' => 'system.admin.inc',
997 );
998 // Default page for batch operations.
999 $items['batch'] = array(
1000 'page callback' => 'system_batch_page',
1001 'access callback' => TRUE,
1002 'theme callback' => '_system_batch_theme',
1003 'type' => MENU_CALLBACK,
1004 'file' => 'system.admin.inc',
1005 );
1006 return $items;
1007 }
1008
1009 /**
1010 * Theme callback for the default batch page.
1011 */
1012 function _system_batch_theme() {
1013 // Retrieve the current state of the batch.
1014 $batch = &batch_get();
1015 if (!$batch && isset($_REQUEST['id'])) {
1016 require_once DRUPAL_ROOT . '/includes/batch.inc';
1017 $batch = batch_load($_REQUEST['id']);
1018 }
1019 // Use the same theme as the page that started the batch.
1020 if (!empty($batch['theme'])) {
1021 return $batch['theme'];
1022 }
1023 }
1024
1025 /**
1026 * Implementation of hook_library().
1027 */
1028 function system_library() {
1029 // jQuery.
1030 $libraries['jquery'] = array(
1031 'title' => 'jQuery',
1032 'website' => 'http://jquery.com',
1033 'version' => '1.3.2',
1034 'js' => array(
1035 'misc/jquery.js' => array('weight' => JS_LIBRARY - 20),
1036 ),
1037 );
1038
1039 // jQuery Once.
1040 $libraries['once'] = array(
1041 'title' => 'jQuery Once',
1042 'website' => 'http://plugins.jquery.com/project/once',
1043 'version' => '1.2',
1044 'js' => array(
1045 'misc/jquery.once.js' => array('weight' => JS_LIBRARY - 19),
1046 ),
1047 );
1048
1049 // jQuery Form Plugin.
1050 $libraries['form'] = array(
1051 'title' => 'jQuery Form Plugin',
1052 'website' => 'http://malsup.com/jquery/form/',
1053 'version' => '2.16',
1054 'js' => array(
1055 'misc/jquery.form.js' => array(),
1056 ),
1057 );
1058
1059 // Contextual links.
1060 $libraries['contextual-links'] = array(
1061 'title' => 'Contextual links',
1062 'website' => 'http://drupal.org/node/473268',
1063 'version' => '1.0',
1064 'js' => array(
1065 'misc/contextual_links.js' => array(),
1066 ),
1067 'css' => array(
1068 'misc/contextual_links.css' => array(),
1069