diff options
Diffstat (limited to 'modules/system')
30 files changed, 225 insertions, 138 deletions
diff --git a/modules/system/html.tpl.php b/modules/system/html.tpl.php index 8d560b1a4..0e012774d 100644 --- a/modules/system/html.tpl.php +++ b/modules/system/html.tpl.php @@ -1,5 +1,4 @@ <?php -// $Id$ /** * @file diff --git a/modules/system/image.gd.inc b/modules/system/image.gd.inc index b10595f47..a3f76d4a6 100644 --- a/modules/system/image.gd.inc +++ b/modules/system/image.gd.inc @@ -1,5 +1,4 @@ <?php -// $Id$ /** * @file diff --git a/modules/system/maintenance-page.tpl.php b/modules/system/maintenance-page.tpl.php index f0aec34c9..31de3bb23 100644 --- a/modules/system/maintenance-page.tpl.php +++ b/modules/system/maintenance-page.tpl.php @@ -1,5 +1,4 @@ <?php -// $Id$ /** * @file diff --git a/modules/system/page.tpl.php b/modules/system/page.tpl.php index 704ec5c30..8ffe82aa6 100644 --- a/modules/system/page.tpl.php +++ b/modules/system/page.tpl.php @@ -1,5 +1,4 @@ <?php -// $Id$ /** * @file diff --git a/modules/system/region.tpl.php b/modules/system/region.tpl.php index 1980c225d..b29e24f01 100644 --- a/modules/system/region.tpl.php +++ b/modules/system/region.tpl.php @@ -1,5 +1,4 @@ <?php -// $Id$ /** * @file diff --git a/modules/system/system.admin-rtl.css b/modules/system/system.admin-rtl.css index 959613ca4..362a406c5 100644 --- a/modules/system/system.admin-rtl.css +++ b/modules/system/system.admin-rtl.css @@ -1,4 +1,3 @@ -/* $Id$ */ /** * @file diff --git a/modules/system/system.admin.css b/modules/system/system.admin.css index adcc369fd..43340b58d 100644 --- a/modules/system/system.admin.css +++ b/modules/system/system.admin.css @@ -1,4 +1,3 @@ -/* $Id$ */ /** * @file diff --git a/modules/system/system.admin.inc b/modules/system/system.admin.inc index 3be8ea184..9e7d69dd3 100644 --- a/modules/system/system.admin.inc +++ b/modules/system/system.admin.inc @@ -1,5 +1,4 @@ <?php -// $Id$ /** * @file @@ -55,6 +54,7 @@ function system_admin_config_page() { /** * Provide a single block from the administration menu as a page. + * * This function is often a destination for these blocks. * For example, 'admin/structure/types' needs to have a destination to be valid * in the Drupal menu system, but too much information there might be @@ -158,7 +158,6 @@ function system_themes_page() { 'alt' => t('Screenshot for !theme theme', array('!theme' => $theme->info['name'])), 'title' => t('Screenshot for !theme theme', array('!theme' => $theme->info['name'])), 'attributes' => array('class' => array('screenshot')), - 'getsize' => FALSE, ); break; } @@ -350,6 +349,14 @@ function system_theme_default() { } // Set the default theme. variable_set('theme_default', $theme); + + // Rebuild the menu. This duplicates the menu_rebuild() in theme_enable(). + // However, modules must know the current default theme in order to use + // this information in hook_menu() or hook_menu_alter() implementations, + // and doing the variable_set() before the theme_enable() could result + // in a race condition where the theme is default but not enabled. + menu_rebuild(); + // The status message depends on whether an admin theme is currently in use: // a value of 0 means the admin theme is set to be the default theme. $admin_theme = variable_get('admin_theme', 0); @@ -1030,7 +1037,7 @@ function system_modules_confirm_form($modules, $storage) { '@module' => $name, '@depends' => implode(', ', $info['depends']), ); - $items[] = format_plural(count($info['depends']), 'The @module module is missing, so the following module will be disabled: @depends.', 'The @module module is missing, so the following module will be disabled: @depends.', $t_argument); + $items[] = format_plural(count($info['depends']), 'The @module module is missing, so the following module will be disabled: @depends.', 'The @module module is missing, so the following modules will be disabled: @depends.', $t_argument); } $form['text'] = array('#markup' => theme('item_list', array('items' => $items))); @@ -1182,11 +1189,6 @@ function system_modules_submit($form, &$form_state) { } $form_state['redirect'] = 'admin/modules'; - - // Notify locale module about module changes, so translations can be - // imported. This might start a batch, and only return to the redirect - // path after that. - module_invoke('locale', 'system_update', $actions['install']); } /** diff --git a/modules/system/system.api.php b/modules/system/system.api.php index fcc3a37c3..c7db6f1dd 100644 --- a/modules/system/system.api.php +++ b/modules/system/system.api.php @@ -1,5 +1,4 @@ <?php -// $Id$ /** * @file @@ -76,6 +75,7 @@ function hook_hook_info_alter(&$hooks) { * Leave blank to use the DrupalDefaultEntityController implementation. * - base table: (used by DrupalDefaultEntityController) The name of the * entity type's base table. + * - revision table: The name of the entity type's revision table (if any). * - static cache: (used by DrupalDefaultEntityController) FALSE to disable * static caching of entities during a page request. Defaults to TRUE. * - field cache: (used by Field API loading and saving of field data) FALSE @@ -87,17 +87,18 @@ function hook_hook_info_alter(&$hooks) { * - uri callback: A function taking an entity as argument and returning the * uri elements of the entity, e.g. 'path' and 'options'. The actual entity * uri can be constructed by passing these elements to url(). - * - label callback: (optional) A function taking an entity as argument and - * returning the label of the entity. The entity label is the main string - * associated with an entity; for example, the title of a node or the - * subject of a comment. If there is an entity object property that defines - * the label, use the 'label' element of the 'entity keys' return - * value component to provide this information (see below). If more complex - * logic is needed to determine the label of an entity, you can instead - * specify a callback function here, which will be called to determine the - * entity label. See also the entity_label() function, which implements this - * logic. - * - fieldable: Set to TRUE if you want your entity type to be fieldable. + * - label callback: (optional) A function taking an entity and an entity type + * as arguments and returning the label of the entity. The entity label is + * the main string associated with an entity; for example, the title of a + * node or the subject of a comment. If there is an entity object property + * that defines the label, use the 'label' element of the 'entity keys' + * return value component to provide this information (see below). If more + * complex logic is needed to determine the label of an entity, you can + * instead specify a callback function here, which will be called to + * determine the entity label. See also the entity_label() function, which + * implements this logic. + * - fieldable: Set to TRUE if you want your entity type to accept fields + * being attached to it. * - translation: An associative array of modules registered as field * translation handlers. Array keys are the module names, array values * can be any data structure the module uses to provide field translation. @@ -123,12 +124,15 @@ function hook_hook_info_alter(&$hooks) { * build the label, a 'label callback' should be defined instead (see * the 'label callback' section above for details). * - bundle keys: An array describing how the Field API can extract the - * information it needs from the bundle objects for this type (e.g - * $vocabulary objects for terms; not applicable for nodes). This entry can - * be omitted if this type's bundles do not exist as standalone objects. - * Elements: - * - bundle: The name of the property that contains the name of the bundle - * object. + * information it needs from the bundle objects for this type. This entry + * is required if the 'path' provided in the 'bundles'/'admin' section + * identifies the bundle using a named menu placeholder whose loader + * callback returns an object (e.g., $vocabulary for taxonomy terms, or + * $node_type for nodes). If the path does not include the bundle, or the + * bundle is just a string rather than an automatically loaded object, then + * this can be omitted. Elements: + * - bundle: The name of the property of the bundle object that contains + * the name of the bundle object. * - bundles: An array describing all bundles for this object type. Keys are * bundles machine names, as found in the objects' 'bundle' property * (defined in the 'entity keys' entry above). Elements: @@ -142,9 +146,9 @@ function hook_hook_info_alter(&$hooks) { * Elements: * - path: the path of the bundle's main administration page, as defined * in hook_menu(). If the path includes a placeholder for the bundle, - * the 'bundle argument', 'bundle helper' and 'real path' keys below - * are required. - * - bundle argument: The position of the placeholder in 'path', if any. + * the 'bundle argument' and 'real path' keys below are required. + * - bundle argument: The position of the bundle placeholder in 'path', if + * any. * - real path: The actual path (no placeholder) of the bundle's main * administration page. This will be used to generate links. * - access callback: As in hook_menu(). 'user_access' will be assumed if @@ -498,8 +502,10 @@ function hook_admin_paths_alter(&$paths) { * The entities keyed by entity ID. * @param $type * The type of entities being loaded (i.e. node, user, comment). + * @param $langcode + * The language to display the entity in. */ -function hook_entity_prepare_view($entities, $type) { +function hook_entity_prepare_view($entities, $type, $langcode) { // Load a specific node into the user object for later theming. if ($type == 'user') { $nodes = mymodule_get_user_nodes(array_keys($entities)); @@ -512,8 +518,6 @@ function hook_entity_prepare_view($entities, $type) { /** * Perform periodic actions. * - * This hook will only be called if cron.php is run (e.g. by crontab). - * * Modules that require some commands to be executed periodically can * implement hook_cron(). The engine will then call the hook whenever a cron * run happens, as defined by the administrator. Typical tasks managed by @@ -649,7 +653,7 @@ function hook_element_info() { * A module may implement this hook in order to alter the element type defaults * defined by a module. * - * @param &$type + * @param $type * All element type defaults as collected by hook_element_info(). * * @see hook_element_info() @@ -821,7 +825,7 @@ function hook_css_alter(&$css) { } /** - * Alter the commands that are sent to the user through the AJAX framework. + * Alter the commands that are sent to the user through the Ajax framework. * * @param $commands * An array of all commands that will be sent to the user. @@ -871,7 +875,7 @@ function hook_page_build(&$page) { * * This hook is invoked by menu_get_item() and allows for run-time alteration of router * information (page_callback, title, and so on) before it is translated and checked for - * access. The passed in $router_item is statically cached for the current request, so this + * access. The passed-in $router_item is statically cached for the current request, so this * hook is only invoked once for any router item that is retrieved via menu_get_item(). * * Usually, modules will only want to inspect the router item and conditionally @@ -922,6 +926,7 @@ function hook_menu_get_item_alter(&$router_item, $path, $original_map) { * $items['abc/def'] = array( * 'page callback' => 'mymodule_abc_view', * ); + * return $items; * } * * function mymodule_abc_view($ghi = 0, $jkl = '') { @@ -950,6 +955,7 @@ function hook_menu_get_item_alter(&$router_item, $path, $original_map) { * 'page callback' => 'mymodule_abc_view', * 'page arguments' => array(1, 'foo'), * ); + * return $items; * } * @endcode * When path 'abc/def' is requested, the page callback function will get 'def' @@ -1836,7 +1842,7 @@ function hook_mail_alter(&$message) { * hook in order to reorder the implementing modules, which are otherwise * ordered by the module's system weight. * - * @param &$implementations + * @param $implementations * An array keyed by the module's name. The value of each item corresponds * to a $group, which is usually FALSE, unless the implementation is in a * file named $module.$group.inc. @@ -1863,7 +1869,7 @@ function hook_module_implements_alter(&$implementations, $hook) { * add to or alter the data generated by reading the .info file with * drupal_parse_info_file(). * - * @param &$info + * @param $info * The .info file contents, passed by reference so that it can be altered. * @param $file * Full information about the module or theme, including $file->name, and @@ -1904,9 +1910,19 @@ function hook_system_info_alter(&$info, $file, $type) { * have inherent security risks across a variety of potential use cases * (for example, the "administer filters" and "bypass node access" * permissions provided by Drupal core). When set to TRUE, a standard - * warning message defined in user_admin_permissions() will be associated - * with the permission and displayed with it on the permission - * administration page. Defaults to FALSE. + * warning message defined in user_admin_permissions() and output via + * theme_user_permission_description() will be associated with the + * permission and displayed with it on the permission administration page. + * Defaults to FALSE. + * - warning: (optional) A translated warning message to display for this + * permission on the permission administration page. This warning overrides + * the automatic warning generated by 'restrict access' being set to TRUE. + * This should rarely be used, since it is important for all permissions to + * have a clear, consistent security warning that is the same across the + * site. Use the 'description' key instead to provide any information that + * is specific to the permission you are defining. + * + * @see theme_user_permission_description() */ function hook_permission() { return array( @@ -2353,7 +2369,7 @@ function hook_flush_caches() { * enable hooks are invoked. * * @param $modules - * An array of the installed modules. + * An array of the modules that were installed. * * @see module_enable() * @see hook_modules_enabled() @@ -2375,7 +2391,7 @@ function hook_modules_installed($modules) { * invoked. * * @param $modules - * An array of the enabled modules. + * An array of the modules that were enabled. * * @see hook_enable() * @see hook_modules_installed() @@ -2396,7 +2412,7 @@ function hook_modules_enabled($modules) { * is only called on the module actually being disabled. * * @param $modules - * An array of the disabled modules. + * An array of the modules that were disabled. * * @see hook_disable() * @see hook_modules_uninstalled() @@ -2414,11 +2430,11 @@ function hook_modules_disabled($modules) { * modules a chance to perform actions when a module is uninstalled, whereas * hook_uninstall() is only called on the module actually being uninstalled. * - * It is recommended that you implement this module if your module - * stores data that may have been set by other modules. + * It is recommended that you implement this hook if your module stores + * data that may have been set by other modules. * * @param $modules - * An array of the uninstalled modules. + * An array of the modules that were uninstalled. * * @see hook_uninstall() * @see hook_modules_disabled() @@ -2547,7 +2563,7 @@ function hook_file_load($files) { * * @see file_validate() */ -function hook_file_validate(&$file) { +function hook_file_validate($file) { $errors = array(); if (empty($file->filename)) { @@ -2747,9 +2763,10 @@ function hook_file_url_alter(&$uri) { /** * Check installation requirements and do status reporting. * - * This hook has two closely related uses, determined by the $phase argument: - * checking installation requirements ($phase == 'install') - * and status reporting ($phase == 'runtime'). + * This hook has three closely related uses, determined by the $phase argument: + * - Checking installation requirements ($phase == 'install'). + * - Checking update requirements ($phase == 'update'). + * - Status reporting ($phase == 'runtime'). * * Note that this hook, like all others dealing with installation and updates, * must reside in a module_name.install file, or it will not properly abort @@ -3502,11 +3519,11 @@ function hook_install_tasks() { /** * Change the page the user is sent to by drupal_goto(). * - * @param &$path + * @param $path * A Drupal path or a full URL. - * @param &$options + * @param $options * An associative array of additional URL options to pass to url(). - * @param &$http_response_code + * @param $http_response_code * The HTTP status code to use for the redirection. See drupal_goto() for more * information. */ @@ -3889,7 +3906,7 @@ function hook_date_formats_alter(&$formats) { function hook_page_delivery_callback_alter(&$callback) { // jQuery sets a HTTP_X_REQUESTED_WITH header of 'XMLHttpRequest'. // If a page would normally be delivered as an html page, and it is called - // from jQuery, deliver it instead as an AJAX response. + // from jQuery, deliver it instead as an Ajax response. if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest' && $callback == 'drupal_deliver_html_page') { $callback = 'ajax_deliver'; } @@ -3975,7 +3992,7 @@ function hook_url_outbound_alter(&$path, &$options, $original_path) { * displayed. Can be used to ensure user privacy in situations where * $account->name is too revealing. * - * @param &$name + * @param $name * The string that format_username() will return. * * @param $account diff --git a/modules/system/system.archiver.inc b/modules/system/system.archiver.inc index 5a0972840..c37f07daa 100644 --- a/modules/system/system.archiver.inc +++ b/modules/system/system.archiver.inc @@ -1,5 +1,4 @@ <?php -// $Id$ /** * @file diff --git a/modules/system/system.base-rtl.css b/modules/system/system.base-rtl.css index 16b92de6f..9099c9d72 100644 --- a/modules/system/system.base-rtl.css +++ b/modules/system/system.base-rtl.css @@ -1,4 +1,3 @@ -/* $Id$ */ /** * @file diff --git a/modules/system/system.base.css b/modules/system/system.base.css index 088cda882..a6748de42 100644 --- a/modules/system/system.base.css +++ b/modules/system/system.base.css @@ -1,4 +1,3 @@ -/* $Id$ */ /** * @file diff --git a/modules/system/system.cron.js b/modules/system/system.cron.js index 01809b096..af17dab52 100644 --- a/modules/system/system.cron.js +++ b/modules/system/system.cron.js @@ -1,4 +1,3 @@ -// $Id$ (function ($) { /** diff --git a/modules/system/system.info b/modules/system/system.info index 7ce48ed35..28abf663a 100644 --- a/modules/system/system.info +++ b/modules/system/system.info @@ -1,4 +1,3 @@ -; $Id$ name = System description = Handles general site configuration for administrators. package = Core diff --git a/modules/system/system.install b/modules/system/system.install index eb6d01736..e06744460 100644 --- a/modules/system/system.install +++ b/modules/system/system.install @@ -1,5 +1,4 @@ <?php -// $Id$ /** * @file @@ -33,7 +32,7 @@ function system_requirements($phase) { // is not running the default install profile. $profile = drupal_get_profile(); if ($profile != 'standard') { - $info = install_profile_info($profile); + $info = system_get_info('module', $profile); $requirements['install_profile'] = array( 'title' => $t('Install profile'), 'value' => $t('%profile_name (%profile-%version)', array( @@ -953,33 +952,6 @@ function system_schema() { ), ); - $schema['history'] = array( - 'description' => 'A record of which {users} have read which {node}s.', - 'fields' => array( - 'uid' => array( - 'description' => 'The {users}.uid that read the {node} nid.', - 'type' => 'int', - 'not null' => TRUE, - 'default' => 0, - ), - 'nid' => array( - 'description' => 'The {node}.nid that was read.', - 'type' => 'int', - 'not null' => TRUE, - 'default' => 0, - ), - 'timestamp' => array( - 'description' => 'The Unix timestamp at which the read occurred.', - 'type' => 'int', - 'not null' => TRUE, - 'default' => 0, - ), - ), - 'primary key' => array('uid', 'nid'), - 'indexes' => array( - 'nid' => array('nid'), - ), - ); $schema['menu_router'] = array( 'description' => 'Maps paths to various callbacks (access, page and title)', 'fields' => array( @@ -1555,7 +1527,7 @@ function system_schema() { 'default' => '', ), 'type' => array( - 'description' => 'The type of the item, either module, theme, theme_engine, or profile.', + 'description' => 'The type of the item, either module, theme, or theme_engine.', 'type' => 'varchar', 'length' => 12, 'not null' => TRUE, @@ -2973,6 +2945,27 @@ function system_update_7069() { } /** + * Remove the obsolete 'drupal_badge_color' and 'drupal_badge_size' variables. + */ +function system_update_7070() { + variable_del('drupal_badge_color'); + variable_del('drupal_badge_size'); +} + +/** + * Add index missed during upgrade, and fix field default. + */ +function system_update_7071() { + db_drop_index('date_format_type', 'title'); + db_add_index('date_format_type', 'title', array('title')); + db_change_field('registry', 'filename', 'filename', array( + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + )); +} + +/** * @} End of "defgroup updates-6.x-to-7.x" * The next series of updates should start at 8000. */ diff --git a/modules/system/system.js b/modules/system/system.js index 3cee79f30..5446d28a3 100644 --- a/modules/system/system.js +++ b/modules/system/system.js @@ -1,4 +1,3 @@ -// $Id$ (function ($) { /** @@ -114,19 +113,6 @@ Drupal.behaviors.dateTime = { } }; -/** - * Show the powered by Drupal image preview - */ -Drupal.behaviors.poweredByPreview = { - attach: function (context, settings) { - $('#edit-color, #edit-size').change(function () { - var path = settings.basePath + 'misc/' + $('#edit-color').val() + '-' + $('#edit-size').val() + '.png'; - $('img.powered-by-preview').attr('src', path); - }); - } -}; - - /** * Show/hide settings for page caching depending on whether page caching is * enabled or not. diff --git a/modules/system/system.mail.inc b/modules/system/system.mail.inc index 181c3c4f7..ef50642c5 100644 --- a/modules/system/system.mail.inc +++ b/modules/system/system.mail.inc @@ -1,5 +1,4 @@ <?php -// $Id$ /** * @file diff --git a/modules/system/system.maintenance.css b/modules/system/system.maintenance.css index a4a64c17e..5543c2db8 100644 --- a/modules/system/system.maintenance.css +++ b/modules/system/system.maintenance.css @@ -1,4 +1,3 @@ -/* $Id$ */ /** * Update styles diff --git a/modules/system/system.menus-rtl.css b/modules/system/system.menus-rtl.css index 8c27ccb48..be85245b2 100644 --- a/modules/system/system.menus-rtl.css +++ b/modules/system/system.menus-rtl.css @@ -1,4 +1,3 @@ -/* $Id$ */ /** * @file diff --git a/modules/system/system.menus.css b/modules/system/system.menus.css index ec9003b87..514b02952 100644 --- a/modules/system/system.menus.css +++ b/modules/system/system.menus.css @@ -1,4 +1,3 @@ -/* $Id$ */ /** * @file diff --git a/modules/system/system.messages-rtl.css b/modules/system/system.messages-rtl.css new file mode 100644 index 000000000..445417b08 --- /dev/null +++ b/modules/system/system.messages-rtl.css @@ -0,0 +1,13 @@ + +/** + * @file + * RTL Styles for system messages. + */ + +div.messages { + background-position: 99% 8px; + padding: 10px 50px 10px 10px; +} +div.messages ul { + margin: 0 1em 0 0; +} diff --git a/modules/system/system.messages.css b/modules/system/system.messages.css index 46338f46d..ffd4e8efc 100644 --- a/modules/system/system.messages.css +++ b/modules/system/system.messages.css @@ -1,4 +1,3 @@ -/* $Id$ */ /** * @file diff --git a/modules/system/system.module b/modules/system/system.module index b5dfc5498..5af9ad4ee 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -1,5 +1,4 @@ <?php -// $Id$ /** * @file @@ -295,10 +294,10 @@ function system_element_info() { '#theme' => 'page', '#theme_wrappers' => array('html'), ); - // By default, we don't want AJAX commands being rendered in the context of an + // 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). + // debugging page that displays rather than executes Ajax commands). $types['ajax'] = array( '#header' => TRUE, '#commands' => array(), @@ -1079,7 +1078,7 @@ function _system_batch_theme() { * Implements hook_library(). */ function system_library() { - // Drupal's AJAX framework. + // Drupal's Ajax framework. $libraries['drupal.ajax'] = array( 'title' => 'Drupal AJAX', 'website' => 'http://api.drupal.org/api/drupal/includes--ajax.inc/group/ajax/7', @@ -2387,9 +2386,14 @@ function _system_rebuild_module_data() { drupal_alter('system_info', $modules[$key]->info, $modules[$key], $type); } - // The install profile is required, if it's a valid module. if (isset($modules[$profile])) { + // The install profile is required, if it's a valid module. $modules[$profile]->info['required'] = TRUE; + // Add a default distribution name if the profile did not provide one. This + // matches the default value used in install_profile_info(). + if (!isset($modules[$profile]->info['distribution_name'])) { + $modules[$profile]->info['distribution_name'] = 'Drupal'; + } } return $modules; @@ -2677,7 +2681,7 @@ function system_region_list($theme_key, $show = REGIONS_ALL) { // If requested, suppress hidden regions. See block_admin_display_form(). foreach ($info['regions'] as $name => $label) { if ($show == REGIONS_ALL || !isset($info['regions_hidden']) || !in_array($name, $info['regions_hidden'])) { - $list[$name] = $label; + $list[$name] = t($label); } } @@ -3451,7 +3455,7 @@ function system_page_alter(&$page) { */ function system_run_automated_cron() { // If the site is not fully installed, suppress the automated cron run. - // Otherwise it could be triggered prematurely by AJAX requests during + // Otherwise it could be triggered prematurely by Ajax requests during // installation. if (($threshold = variable_get('cron_safe_threshold', DRUPAL_CRON_DEFAULT_THRESHOLD)) > 0 && variable_get('install_task') == 'done') { $cron_last = variable_get('cron_last', NULL); diff --git a/modules/system/system.queue.inc b/modules/system/system.queue.inc index b6cf96e07..806015c24 100644 --- a/modules/system/system.queue.inc +++ b/modules/system/system.queue.inc @@ -1,5 +1,4 @@ <?php -// $Id$ /** * @file diff --git a/modules/system/system.test b/modules/system/system.test index 549df44b0..be4e36698 100644 --- a/modules/system/system.test +++ b/modules/system/system.test @@ -1,5 +1,9 @@ <?php -// $Id$ + +/** + * @file + * Tests for system.module. + */ /** * Helper class for module test cases. @@ -1355,7 +1359,7 @@ class SystemThemeFunctionalTest extends DrupalWebTestCase { function setUp() { parent::setUp(); - $this->admin_user = $this->drupalCreateUser(array('access administration pages', 'view the administration theme', 'administer themes', 'bypass node access')); + $this->admin_user = $this->drupalCreateUser(array('access administration pages', 'view the administration theme', 'administer themes', 'bypass node access', 'administer blocks')); $this->drupalLogin($this->admin_user); $this->node = $this->drupalCreateNode(); } @@ -1439,6 +1443,26 @@ class SystemThemeFunctionalTest extends DrupalWebTestCase { $this->drupalGet('node/add'); $this->assertRaw('themes/bartik', t('Site default theme used on the add content page.')); } + + /** + * Test switching the default theme. + */ + function testSwitchDefaultTheme() { + // Enable "stark" and set it as the default theme. + theme_enable(array('stark')); + $this->drupalGet('admin/appearance'); + $this->clickLink(t('Set default'), 1); + $this->assertTrue(variable_get('theme_default', '') == 'stark', t('Site default theme switched successfully.')); + + // Test the default theme on the secondary links (blocks admin page). + $this->drupalGet('admin/structure/block'); + $this->assertText('Stark(' . t('active tab') . ')', t('Default local task on blocks admin page is the default theme.')); + // Switch back to Bartik and test again to test that the menu cache is cleared. + $this->drupalGet('admin/appearance'); + $this->clickLink(t('Set default'), 0); + $this->drupalGet('admin/structure/block'); + $this->assertText('Bartik(' . t('active tab') . ')', t('Default local task on blocks admin page has changed.')); + } } @@ -1571,13 +1595,13 @@ class TokenReplaceTestCase extends DrupalWebTestCase { // Test that the clear parameter cleans out non-existent tokens. $result = token_replace($source, array('node' => $node), array('language' => $language, 'clear' => TRUE)); - $result = $this->assertFalse(strcmp($target, $result), 'Valid tokens replaced while invalid tokens cleared out.'); + $result = $this->assertEqual($target, $result, 'Valid tokens replaced while invalid tokens cleared out.'); // Test without using the clear parameter (non-existant token untouched). $target .= '[user:name]'; $target .= '[bogus:token]'; $result = token_replace($source, array('node' => $node), array('language' => $language)); - $this->assertFalse(strcmp($target, $result), 'Valid tokens replaced while invalid tokens ignored.'); + $this->assertEqual($target, $result, 'Valid tokens replaced while invalid tokens ignored.'); // Check that the results of token_generate are sanitized properly. This does NOT // test the cleanliness of every token -- just that the $sanitize flag is being @@ -1585,10 +1609,39 @@ class TokenReplaceTestCase extends DrupalWebTestCase { // token, [node:title]. $raw_tokens = array('title' => '[node:title]'); $generated = token_generate('node', $raw_tokens, array('node' => $node)); - $this->assertFalse(strcmp($generated['[node:title]'], check_plain($node->title)), t('Token sanitized.')); + $this->assertEqual($generated['[node:title]'], check_plain($node->title), t('Token sanitized.')); $generated = token_generate('node', $raw_tokens, array('node' => $node), array('sanitize' => FALSE)); - $this->assertFalse(strcmp($generated['[node:title]'], $node->title), t('Unsanitized token generated properly.')); + $this->assertEqual($generated['[node:title]'], $node->title, t('Unsanitized token generated properly.')); + } + + /** + * Test whether token-replacement works in various contexts. + */ + function testSystemTokenRecognition() { + global $language; + + // Generate prefixes and suffixes for the token context. + $tests = array( + array('prefix' => 'this is the ', 'suffix' => ' site'), + array('prefix' => 'this is the', 'suffix' => 'site'), + array('prefix' => '[', 'suffix' => ']'), + array('prefix' => '', 'suffix' => ']]]'), + array('prefix' => '[[[', 'suffix' => ''), + array('prefix' => ':[:', 'suffix' => '--]'), + array('prefix' => '-[-', 'suffix' => ':]:'), + array('prefix' => '[:', 'suffix' => ']'), + array('prefix' => '[site:', 'suffix' => ':name]'), + array('prefix' => '[site:', 'suffix' => ']'), + ); + + // Check if the token is recognized in each of the contexts. + foreach ($tests as $test) { + $input = $test['prefix'] . '[site:name]' . $test['suffix']; + $expected = $test['prefix'] . 'Drupal' . $test['suffix']; + $output = token_replace($input, array(), array('language' => $language)); + $this->assertTrue($output == $expected, t('Token recognized in string %string', array('%string' => $input))); + } } /** @@ -1620,7 +1673,7 @@ class TokenReplaceTestCase extends DrupalWebTestCase { foreach ($tests as $input => $expected) { $output = token_replace($input, array(), array('language' => $language)); - $this->assertFalse(strcmp($output, $expected), t('Sanitized system site information token %token replaced.', array('%token' => $input))); + $this->assertEqual($output, $expected, t('Sanitized system site information token %token replaced.', array('%token' => $input))); } // Generate and test unsanitized tokens. @@ -1629,7 +1682,7 @@ class TokenReplaceTestCase extends DrupalWebTestCase { foreach ($tests as $input => $expected) { $output = token_replace($input, array(), array('language' => $language, 'sanitize' => FALSE)); - $this->assertFalse(strcmp($output, $expected), t('Unsanitized system site information token %token replaced.', array('%token' => $input))); + $this->assertEqual($output, $expected, t('Unsanitized system site information token %token replaced.', array('%token' => $input))); } } @@ -1656,7 +1709,7 @@ class TokenReplaceTestCase extends DrupalWebTestCase { foreach ($tests as $input => $expected) { $output = token_replace($input, array('date' => $date), array('language' => $language)); - $this->assertFalse(strcmp($output, $expected), t('Date token %token replaced.', array('%token' => $input))); + $this->assertEqual($output, $expected, t('Date token %token replaced.', array('%token' => $input))); } } } @@ -2145,3 +2198,37 @@ class SystemAuthorizeCase extends DrupalWebTestCase { $this->assertText('System Test Username'); } } + +/** + * Test the handling of requests containing 'index.php'. + */ +class SystemIndexPhpTest extends DrupalWebTestCase { + public static function getInfo() { + return array( + 'name' => 'Index.php handling', + 'description' => "Test the handling of requests containing 'index.php'.", + 'group' => 'System', + ); + } + + function setUp() { + parent::setUp(); + } + + /** + * Test index.php handling. + */ + function testIndexPhpHandling() { + $index_php = $GLOBALS['base_url'] . '/index.php'; + + $this->drupalGet($index_php, array('external' => TRUE)); + $this->assertResponse(200, t('Make sure index.php returns a valid page.')); + + $this->drupalGet($index_php, array('external' => TRUE, 'query' => array('q' => 'user'))); + $this->assertResponse(200, t('Make sure index.php?q=user returns a valid page.')); + + $this->drupalGet($index_php .'/user', array('external' => TRUE)); + $this->assertResponse(404, t("Make sure index.php/user returns a 'page not found'.")); + } +} + diff --git a/modules/system/system.theme-rtl.css b/modules/system/system.theme-rtl.css index 1dd7e6dd5..0cd7fa643 100644 --- a/modules/system/system.theme-rtl.css +++ b/modules/system/system.theme-rtl.css @@ -1,4 +1,3 @@ -/* $Id$ */ /** * @file diff --git a/modules/system/system.theme.css b/modules/system/system.theme.css index eb37db267..73cebee73 100644 --- a/modules/system/system.theme.css +++ b/modules/system/system.theme.css @@ -1,4 +1,3 @@ -/* $Id$ */ /** * @file diff --git a/modules/system/system.tokens.inc b/modules/system/system.tokens.inc index 6ce9971b1..27d7dfdb0 100644 --- a/modules/system/system.tokens.inc +++ b/modules/system/system.tokens.inc @@ -1,5 +1,4 @@ <?php -// $Id$ /** * @file diff --git a/modules/system/system.updater.inc b/modules/system/system.updater.inc index 92a1529af..0df1ad955 100644 --- a/modules/system/system.updater.inc +++ b/modules/system/system.updater.inc @@ -1,5 +1,4 @@ <?php -// $Id$ /** * @file diff --git a/modules/system/theme.api.php b/modules/system/theme.api.php index 2284a7c76..7fee81cb6 100644 --- a/modules/system/theme.api.php +++ b/modules/system/theme.api.php @@ -1,5 +1,4 @@ <?php -// $Id$ /** * @defgroup themeable Default theme implementations @@ -100,6 +99,8 @@ function hook_form_system_theme_settings_alter(&$form, &$form_state) { * It is called for all invocations of theme(), to allow modules to add to * or override variables for all theme hooks. * + * For more detailed information, see theme(). + * * @param $variables * The variables array (modify in place). * @param $hook @@ -146,6 +147,8 @@ function hook_preprocess(&$variables, $hook) { * hook. It should only be used if a module needs to override or add to the * theme preprocessing for a theme hook it didn't define. * + * For more detailed information, see theme(). + * * @param $variables * The variables array (modify in place). */ @@ -162,6 +165,8 @@ function hook_preprocess_HOOK(&$variables) { * It is called for all invocations of theme(), to allow modules to add to * or override variables for all theme hooks. * + * For more detailed information, see theme(). + * * @param $variables * The variables array (modify in place). * @param $hook @@ -188,6 +193,8 @@ function hook_process(&$variables, $hook) { * hook. It should only be used if a module needs to override or add to the * theme processing for a theme hook it didn't define. * + * For more detailed information, see theme(). + * * @param $variables * The variables array (modify in place). */ |