@@ -39,6 +39,8 @@
|
||||
* @see template_preprocess()
|
||||
* @see template_preprocess_html()
|
||||
* @see template_process()
|
||||
*
|
||||
* @ingroup themeable
|
||||
*/
|
||||
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN"
|
||||
"http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">
|
||||
|
@@ -9,6 +9,8 @@
|
||||
*
|
||||
* @see template_preprocess()
|
||||
* @see template_preprocess_maintenance_page()
|
||||
*
|
||||
* @ingroup themeable
|
||||
*/
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
|
@@ -68,6 +68,8 @@
|
||||
* @see template_preprocess_page()
|
||||
* @see template_process()
|
||||
* @see html.tpl.php
|
||||
*
|
||||
* @ingroup themeable
|
||||
*/
|
||||
?>
|
||||
|
||||
|
@@ -24,6 +24,8 @@
|
||||
* @see template_preprocess()
|
||||
* @see template_preprocess_region()
|
||||
* @see template_process()
|
||||
*
|
||||
* @ingroup themeable
|
||||
*/
|
||||
?>
|
||||
<?php if ($content): ?>
|
||||
|
@@ -691,8 +691,16 @@ function _system_theme_settings_validate_path($path) {
|
||||
* Process system_theme_settings form submissions.
|
||||
*/
|
||||
function system_theme_settings_submit($form, &$form_state) {
|
||||
// Exclude unnecessary elements before saving.
|
||||
form_state_values_clean($form_state);
|
||||
|
||||
$values = $form_state['values'];
|
||||
|
||||
// Extract the name of the theme from the submitted form values, then remove
|
||||
// it from the array so that it is not saved as part of the variable.
|
||||
$key = $values['var'];
|
||||
unset($values['var']);
|
||||
|
||||
// If the user uploaded a new logo or favicon, save it to a permanent location
|
||||
// and use it in place of the default theme-provided file.
|
||||
if ($file = $values['logo_upload']) {
|
||||
@@ -722,10 +730,7 @@ function system_theme_settings_submit($form, &$form_state) {
|
||||
if (empty($values['default_favicon']) && !empty($values['favicon_path'])) {
|
||||
$values['favicon_mimetype'] = file_get_mimetype($values['favicon_path']);
|
||||
}
|
||||
$key = $values['var'];
|
||||
|
||||
// Exclude unnecessary elements before saving.
|
||||
unset($values['var'], $values['submit'], $values['reset'], $values['form_id'], $values['op'], $values['form_build_id'], $values['form_token']);
|
||||
variable_set($key, $values);
|
||||
drupal_set_message(t('The configuration options have been saved.'));
|
||||
|
||||
@@ -808,7 +813,7 @@ function system_modules($form, $form_state = array()) {
|
||||
// Used when checking if module implements a help page.
|
||||
$help_arg = module_exists('help') ? drupal_help_arg() : FALSE;
|
||||
|
||||
// Used when displaying modules that are required by the install profile.
|
||||
// Used when displaying modules that are required by the installation profile.
|
||||
require_once DRUPAL_ROOT . '/includes/install.inc';
|
||||
$distribution_name = check_plain(drupal_install_profile_distribution_name());
|
||||
|
||||
@@ -1269,8 +1274,8 @@ function system_modules_uninstall($form, $form_state = NULL) {
|
||||
'#title_display' => 'invisible',
|
||||
);
|
||||
// All modules which depend on this one must be uninstalled first, before
|
||||
// we can allow this module to be uninstalled. (The install profile is
|
||||
// excluded from this list.)
|
||||
// we can allow this module to be uninstalled. (The installation profile
|
||||
// is excluded from this list.)
|
||||
foreach (array_keys($module->required_by) as $dependent) {
|
||||
if ($dependent != $profile && drupal_get_installed_schema_version($dependent) != SCHEMA_UNINSTALLED) {
|
||||
$dependent_name = isset($all_modules[$dependent]->info['name']) ? $all_modules[$dependent]->info['name'] : $dependent;
|
||||
|
@@ -85,8 +85,8 @@ function hook_hook_info_alter(&$hooks) {
|
||||
* - load hook: The name of the hook which should be invoked by
|
||||
* DrupalDefaultEntityController:attachLoad(), for example 'node_load'.
|
||||
* - 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().
|
||||
* 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 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
|
||||
@@ -465,6 +465,24 @@ function hook_entity_view_alter(&$build, $type) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Change the view mode of an entity that is being displayed.
|
||||
*
|
||||
* @param string $view_mode
|
||||
* The view_mode that is to be used to display the entity.
|
||||
* @param array $context
|
||||
* Array with contextual information, including:
|
||||
* - entity_type: The type of the entity that is being viewed.
|
||||
* - entity: The entity object.
|
||||
* - langcode: The langcode the entity is being viewed in.
|
||||
*/
|
||||
function hook_entity_view_mode_alter(&$view_mode, $context) {
|
||||
// For nodes, change the view mode when it is teaser.
|
||||
if ($context['entity_type'] == 'node' && $view_mode == 'teaser') {
|
||||
$view_mode = 'my_custom_view_mode';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Define administrative paths.
|
||||
*
|
||||
@@ -623,7 +641,7 @@ function hook_cron_queue_info_alter(&$queues) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows modules to declare their own Forms API element types and specify their
|
||||
* Allows modules to declare their own Form API element types and specify their
|
||||
* default values.
|
||||
*
|
||||
* This hook allows modules to declare their own form element types and to
|
||||
@@ -689,7 +707,8 @@ function hook_element_info_alter(&$type) {
|
||||
* Perform cleanup tasks.
|
||||
*
|
||||
* This hook is run at the end of each page request. It is often used for
|
||||
* page logging and specialized cleanup. This hook MUST NOT print anything.
|
||||
* page logging and specialized cleanup. This hook MUST NOT print anything
|
||||
* because by the time it runs the response is already sent to the browser.
|
||||
*
|
||||
* Only use this hook if your code must run even for cached page views.
|
||||
* If you have code which must run once on all non-cached pages, use
|
||||
@@ -1040,7 +1059,7 @@ function hook_menu_get_item_alter(&$router_item, $path, $original_map) {
|
||||
* This 'abc' object will then be passed into the callback functions defined
|
||||
* for the menu item, such as the page callback function mymodule_abc_edit()
|
||||
* to replace the integer 1 in the argument array. Note that a load function
|
||||
* should return FALSE when it is unable to provide a loadable object. For
|
||||
* should return FALSE when it is unable to provide a loadable object. For
|
||||
* example, the node_load() function for the 'node/%node/edit' menu item will
|
||||
* return FALSE for the path 'node/999/edit' if a node with a node ID of 999
|
||||
* does not exist. The menu routing system will return a 404 error in this case.
|
||||
@@ -1632,6 +1651,7 @@ function hook_page_alter(&$page) {
|
||||
*
|
||||
* @see hook_form_BASE_FORM_ID_alter()
|
||||
* @see hook_form_FORM_ID_alter()
|
||||
* @see forms_api_reference.html
|
||||
*/
|
||||
function hook_form_alter(&$form, &$form_state, $form_id) {
|
||||
if (isset($form['type']) && $form['type']['#value'] . '_node_settings' == $form_id) {
|
||||
@@ -1668,6 +1688,7 @@ function hook_form_alter(&$form, &$form_state, $form_id) {
|
||||
* @see hook_form_alter()
|
||||
* @see hook_form_BASE_FORM_ID_alter()
|
||||
* @see drupal_prepare_form()
|
||||
* @see forms_api_reference.html
|
||||
*/
|
||||
function hook_form_FORM_ID_alter(&$form, &$form_state, $form_id) {
|
||||
// Modification for the form with the given form ID goes here. For example, if
|
||||
@@ -1959,7 +1980,7 @@ function hook_mail_alter(&$message) {
|
||||
* purposes of hook_module_implements_alter(), these variants are treated as
|
||||
* a single hook. Thus, to ensure that your implementation of
|
||||
* hook_form_FORM_ID_alter() is called at the right time, you will have to
|
||||
* have to change the order of hook_form_alter() implementation in
|
||||
* change the order of hook_form_alter() implementation in
|
||||
* hook_module_implements_alter().
|
||||
*
|
||||
* @param $implementations
|
||||
@@ -2147,6 +2168,9 @@ function hook_permission() {
|
||||
* registers the 'node' theme hook, 'theme_node' will be assigned to its
|
||||
* function. If the chameleon theme registers the node hook, it will be
|
||||
* assigned 'chameleon_node' as its function.
|
||||
* - base hook: A string declaring the base theme hook if this theme
|
||||
* implementation is actually implementing a suggestion for another theme
|
||||
* hook.
|
||||
* - pattern: A regular expression pattern to be used to allow this theme
|
||||
* implementation to have a dynamic name. The convention is to use __ to
|
||||
* differentiate the dynamic portion of the theme. For example, to allow
|
||||
@@ -2958,7 +2982,7 @@ function hook_file_url_alter(&$uri) {
|
||||
* The returned 'requirements' will be listed on the status report in the
|
||||
* administration section, with indication of the severity level.
|
||||
* Moreover, any requirement with a severity of REQUIREMENT_ERROR severity will
|
||||
* result in a notice on the the administration overview page.
|
||||
* result in a notice on the administration configuration page.
|
||||
*
|
||||
* @param $phase
|
||||
* The phase in which requirements are checked:
|
||||
@@ -2983,7 +3007,7 @@ function hook_file_url_alter(&$uri) {
|
||||
*/
|
||||
function hook_requirements($phase) {
|
||||
$requirements = array();
|
||||
// Ensure translations don't break at install time
|
||||
// Ensure translations don't break during installation.
|
||||
$t = get_t();
|
||||
|
||||
// Report Drupal version
|
||||
@@ -3035,7 +3059,7 @@ function hook_requirements($phase) {
|
||||
* more tables and their related keys and indexes. A schema is defined by
|
||||
* hook_schema() which must live in your module's .install file.
|
||||
*
|
||||
* This hook is called at both install and uninstall time, and in the latter
|
||||
* This hook is called at install and uninstall time, and in the latter
|
||||
* case, it cannot rely on the .module file being loaded or hooks being known.
|
||||
* If the .module file is needed, it may be loaded with drupal_load().
|
||||
*
|
||||
@@ -3284,6 +3308,17 @@ function hook_install() {
|
||||
* the same directory as mymodule.module. Drupal core's updates are implemented
|
||||
* using the system module as a name and stored in database/updates.inc.
|
||||
*
|
||||
* Not all module functions are available from within a hook_update_N() function.
|
||||
* In order to call a function from your mymodule.module or an include file,
|
||||
* you need to explicitly load that file first.
|
||||
*
|
||||
* During database updates the schema of any module could be out of date. For
|
||||
* this reason, caution is needed when using any API function within an update
|
||||
* function - particularly CRUD functions, functions that depend on the schema
|
||||
* (for example by using drupal_write_record()), and any functions that invoke
|
||||
* hooks. See @link update_api Update versions of API functions @endlink for
|
||||
* details.
|
||||
*
|
||||
* If your update task is potentially time-consuming, you'll need to implement a
|
||||
* multipass update to avoid PHP timeouts. Multipass updates use the $sandbox
|
||||
* parameter provided by the batch API (normally, $context['sandbox']) to store
|
||||
@@ -3308,6 +3343,7 @@ function hook_install() {
|
||||
*
|
||||
* @see batch
|
||||
* @see schemaapi
|
||||
* @see update_api
|
||||
* @see hook_update_last_removed()
|
||||
* @see update_get_update_list()
|
||||
*/
|
||||
@@ -3735,7 +3771,7 @@ function hook_drupal_goto_alter(&$path, &$options, &$http_response_code) {
|
||||
function hook_html_head_alter(&$head_elements) {
|
||||
foreach ($head_elements as $key => $element) {
|
||||
if (isset($element['#attributes']['rel']) && $element['#attributes']['rel'] == 'canonical') {
|
||||
// I want a custom canonical url.
|
||||
// I want a custom canonical URL.
|
||||
$head_elements[$key]['#attributes']['href'] = mymodule_canonical_url();
|
||||
}
|
||||
}
|
||||
@@ -4631,3 +4667,114 @@ function hook_filetransfer_info_alter(&$filetransfer_info) {
|
||||
/**
|
||||
* @} End of "addtogroup hooks".
|
||||
*/
|
||||
|
||||
/**
|
||||
* @defgroup update_api Update versions of API functions
|
||||
* @{
|
||||
* Functions that are similar to normal API functions, but do not invoke hooks.
|
||||
*
|
||||
* These simplified versions of core API functions are provided for use by
|
||||
* update functions (hook_update_N() implementations).
|
||||
*
|
||||
* During database updates the schema of any module could be out of date. For
|
||||
* this reason, caution is needed when using any API function within an update
|
||||
* function - particularly CRUD functions, functions that depend on the schema
|
||||
* (for example by using drupal_write_record()), and any functions that invoke
|
||||
* hooks.
|
||||
*
|
||||
* Instead, a simplified utility function should be used. If a utility version
|
||||
* of the API function you require does not already exist, then you should
|
||||
* create a new function. The new utility function should be named
|
||||
* _update_N_mymodule_my_function(). N is the schema version the function acts
|
||||
* on (the schema version is the number N from the hook_update_N()
|
||||
* implementation where this schema was introduced, or a number following the
|
||||
* same numbering scheme), and mymodule_my_function is the name of the original
|
||||
* API function including the module's name.
|
||||
*
|
||||
* Examples:
|
||||
* - _update_6000_mymodule_save(): This function performs a save operation
|
||||
* without invoking any hooks using the 6.x schema.
|
||||
* - _update_7000_mymodule_save(): This function performs the same save
|
||||
* operation using the 7.x schema.
|
||||
*
|
||||
* The utility function should not invoke any hooks, and should perform database
|
||||
* operations using functions from the
|
||||
* @link database Database abstraction layer, @endlink
|
||||
* like db_insert(), db_update(), db_delete(), db_query(), and so on.
|
||||
*
|
||||
* If a change to the schema necessitates a change to the utility function, a
|
||||
* new function should be created with a name based on the version of the schema
|
||||
* it acts on. See _update_7000_bar_get_types() and _update_7001_bar_get_types()
|
||||
* in the code examples that follow.
|
||||
*
|
||||
* For example, foo.install could contain:
|
||||
* @code
|
||||
* function foo_update_dependencies() {
|
||||
* // foo_update_7010() needs to run after bar_update_7000().
|
||||
* $dependencies['foo'][7010] = array(
|
||||
* 'bar' => 7000,
|
||||
* );
|
||||
*
|
||||
* // foo_update_7036() needs to run after bar_update_7001().
|
||||
* $dependencies['foo'][7036] = array(
|
||||
* 'bar' => 7001,
|
||||
* );
|
||||
*
|
||||
* return $dependencies;
|
||||
* }
|
||||
*
|
||||
* function foo_update_7000() {
|
||||
* // No updates have been run on the {bar_types} table yet, so this needs
|
||||
* // to work with the 6.x schema.
|
||||
* foreach (_update_6000_bar_get_types() as $type) {
|
||||
* // Rename a variable.
|
||||
* }
|
||||
* }
|
||||
*
|
||||
* function foo_update_7010() {
|
||||
* // Since foo_update_7010() is going to run after bar_update_7000(), it
|
||||
* // needs to operate on the new schema, not the old one.
|
||||
* foreach (_update_7000_bar_get_types() as $type) {
|
||||
* // Rename a different variable.
|
||||
* }
|
||||
* }
|
||||
*
|
||||
* function foo_update_7036() {
|
||||
* // This update will run after bar_update_7001().
|
||||
* foreach (_update_7001_bar_get_types() as $type) {
|
||||
* }
|
||||
* }
|
||||
* @endcode
|
||||
*
|
||||
* And bar.install could contain:
|
||||
* @code
|
||||
* function bar_update_7000() {
|
||||
* // Type and bundle are confusing, so we renamed the table.
|
||||
* db_rename_table('bar_types', 'bar_bundles');
|
||||
* }
|
||||
*
|
||||
* function bar_update_7001() {
|
||||
* // Database table names should be singular when possible.
|
||||
* db_rename_table('bar_bundles', 'bar_bundle');
|
||||
* }
|
||||
*
|
||||
* function _update_6000_bar_get_types() {
|
||||
* db_query('SELECT * FROM {bar_types}')->fetchAll();
|
||||
* }
|
||||
*
|
||||
* function _update_7000_bar_get_types() {
|
||||
* db_query('SELECT * FROM {bar_bundles'})->fetchAll();
|
||||
* }
|
||||
*
|
||||
* function _update_7001_bar_get_types() {
|
||||
* db_query('SELECT * FROM {bar_bundle}')->fetchAll();
|
||||
* }
|
||||
* @endcode
|
||||
*
|
||||
* @see hook_update_N()
|
||||
* @see hook_update_dependencies()
|
||||
*/
|
||||
|
||||
/**
|
||||
* @} End of "defgroup update_api".
|
||||
*/
|
||||
|
@@ -231,6 +231,8 @@ html.js .js-hide {
|
||||
position: absolute !important;
|
||||
clip: rect(1px 1px 1px 1px); /* IE6, IE7 */
|
||||
clip: rect(1px, 1px, 1px, 1px);
|
||||
overflow: hidden;
|
||||
height: 1px;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -241,6 +243,8 @@ html.js .js-hide {
|
||||
.element-invisible.element-focusable:focus {
|
||||
position: static !important;
|
||||
clip: auto;
|
||||
overflow: visible;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -12,8 +12,8 @@ files[] = system.test
|
||||
required = TRUE
|
||||
configure = admin/config/system
|
||||
|
||||
; Information added by drupal.org packaging script on 2012-10-17
|
||||
version = "7.16"
|
||||
; Information added by drupal.org packaging script on 2012-11-07
|
||||
version = "7.17"
|
||||
project = "drupal"
|
||||
datestamp = "1350508567"
|
||||
datestamp = "1352325357"
|
||||
|
||||
|
@@ -16,7 +16,7 @@
|
||||
function system_requirements($phase) {
|
||||
global $base_url;
|
||||
$requirements = array();
|
||||
// Ensure translations don't break at install time
|
||||
// Ensure translations don't break during installation.
|
||||
$t = get_t();
|
||||
|
||||
// Report Drupal version
|
||||
@@ -28,8 +28,8 @@ function system_requirements($phase) {
|
||||
'weight' => -10,
|
||||
);
|
||||
|
||||
// Display the currently active install profile, if the site
|
||||
// is not running the default install profile.
|
||||
// Display the currently active installation profile, if the site
|
||||
// is not running the default installation profile.
|
||||
$profile = drupal_get_profile();
|
||||
if ($profile != 'standard') {
|
||||
$info = system_get_info('module', $profile);
|
||||
@@ -308,7 +308,7 @@ function system_requirements($phase) {
|
||||
variable_get('file_private_path', FALSE),
|
||||
);
|
||||
|
||||
// Do not check for the temporary files directory at install time
|
||||
// Do not check for the temporary files directory during installation
|
||||
// unless it has been set in settings.php. In this case the user has
|
||||
// no alternative but to fix the directory if it is not writable.
|
||||
if ($phase == 'install') {
|
||||
@@ -412,7 +412,7 @@ function system_requirements($phase) {
|
||||
$profile = drupal_get_profile();
|
||||
$files = system_rebuild_module_data();
|
||||
foreach ($files as $module => $file) {
|
||||
// Ignore disabled modules and install profiles.
|
||||
// Ignore disabled modules and installation profiles.
|
||||
if (!$file->status || $module == $profile) {
|
||||
continue;
|
||||
}
|
||||
@@ -810,7 +810,6 @@ function system_schema() {
|
||||
'length' => 255,
|
||||
'not null' => TRUE,
|
||||
'default' => '',
|
||||
'binary' => TRUE,
|
||||
),
|
||||
'uri' => array(
|
||||
'description' => 'The URI to access the file (either local or remote).',
|
||||
@@ -1689,6 +1688,12 @@ function system_update_dependencies() {
|
||||
'block' => 7002,
|
||||
);
|
||||
|
||||
// system_update_7061() queries the {node_revision} table, so it must run
|
||||
// after node_update_7001(), which renames the {node_revisions} table.
|
||||
$dependencies['system'][7061] = array(
|
||||
'node' => 7001,
|
||||
);
|
||||
|
||||
// system_update_7067() migrates role permissions and therefore must run
|
||||
// after the {role} and {role_permission} tables are properly set up, which
|
||||
// happens in user_update_7007().
|
||||
@@ -1711,17 +1716,18 @@ function system_update_dependencies() {
|
||||
function system_update_7000() {
|
||||
$result = db_query("SELECT rid, perm FROM {permission} ORDER BY rid");
|
||||
foreach ($result as $role) {
|
||||
$renamed_permission = preg_replace('/(?<=^|,\ )create\ blog\ entries(?=,|$)/', 'create blog content', $role->perm);
|
||||
$renamed_permission = preg_replace('/(?<=^|,\ )edit\ own\ blog\ entries(?=,|$)/', 'edit own blog content', $role->perm);
|
||||
$renamed_permission = preg_replace('/(?<=^|,\ )edit\ any\ blog\ entry(?=,|$)/', 'edit any blog content', $role->perm);
|
||||
$renamed_permission = preg_replace('/(?<=^|,\ )delete\ own\ blog\ entries(?=,|$)/', 'delete own blog content', $role->perm);
|
||||
$renamed_permission = preg_replace('/(?<=^|,\ )delete\ any\ blog\ entry(?=,|$)/', 'delete any blog content', $role->perm);
|
||||
$renamed_permission = $role->perm;
|
||||
$renamed_permission = preg_replace('/(?<=^|,\ )create\ blog\ entries(?=,|$)/', 'create blog content', $renamed_permission);
|
||||
$renamed_permission = preg_replace('/(?<=^|,\ )edit\ own\ blog\ entries(?=,|$)/', 'edit own blog content', $renamed_permission);
|
||||
$renamed_permission = preg_replace('/(?<=^|,\ )edit\ any\ blog\ entry(?=,|$)/', 'edit any blog content', $renamed_permission);
|
||||
$renamed_permission = preg_replace('/(?<=^|,\ )delete\ own\ blog\ entries(?=,|$)/', 'delete own blog content', $renamed_permission);
|
||||
$renamed_permission = preg_replace('/(?<=^|,\ )delete\ any\ blog\ entry(?=,|$)/', 'delete any blog content', $renamed_permission);
|
||||
|
||||
$renamed_permission = preg_replace('/(?<=^|,\ )create\ forum\ topics(?=,|$)/', 'create forum content', $role->perm);
|
||||
$renamed_permission = preg_replace('/(?<=^|,\ )delete\ any\ forum\ topic(?=,|$)/', 'delete any forum content', $role->perm);
|
||||
$renamed_permission = preg_replace('/(?<=^|,\ )delete\ own\ forum\ topics(?=,|$)/', 'delete own forum content', $role->perm);
|
||||
$renamed_permission = preg_replace('/(?<=^|,\ )edit\ any\ forum\ topic(?=,|$)/', 'edit any forum content', $role->perm);
|
||||
$renamed_permission = preg_replace('/(?<=^|,\ )edit\ own\ forum\ topics(?=,|$)/', 'edit own forum content', $role->perm);
|
||||
$renamed_permission = preg_replace('/(?<=^|,\ )create\ forum\ topics(?=,|$)/', 'create forum content', $renamed_permission);
|
||||
$renamed_permission = preg_replace('/(?<=^|,\ )delete\ any\ forum\ topic(?=,|$)/', 'delete any forum content', $renamed_permission);
|
||||
$renamed_permission = preg_replace('/(?<=^|,\ )delete\ own\ forum\ topics(?=,|$)/', 'delete own forum content', $renamed_permission);
|
||||
$renamed_permission = preg_replace('/(?<=^|,\ )edit\ any\ forum\ topic(?=,|$)/', 'edit any forum content', $renamed_permission);
|
||||
$renamed_permission = preg_replace('/(?<=^|,\ )edit\ own\ forum\ topics(?=,|$)/', 'edit own forum content', $renamed_permission);
|
||||
|
||||
if ($renamed_permission != $role->perm) {
|
||||
db_update('permission')
|
||||
@@ -2729,6 +2735,26 @@ function system_update_7061(&$sandbox) {
|
||||
}
|
||||
|
||||
if (!isset($sandbox['progress'])) {
|
||||
// Delete stale rows from {upload} where the fid is not in the {files} table.
|
||||
db_delete('upload')
|
||||
->notExists(
|
||||
db_select('files', 'f')
|
||||
->fields('f', array('fid'))
|
||||
->where('f.fid = {upload}.fid')
|
||||
)
|
||||
->execute();
|
||||
|
||||
// Delete stale rows from {upload} where the vid is not in the
|
||||
// {node_revision} table. The table has already been renamed in
|
||||
// node_update_7001().
|
||||
db_delete('upload')
|
||||
->notExists(
|
||||
db_select('node_revision', 'nr')
|
||||
->fields('nr', array('vid'))
|
||||
->where('nr.vid = {upload}.vid')
|
||||
)
|
||||
->execute();
|
||||
|
||||
// Retrieve a list of node revisions that have uploaded files attached.
|
||||
// DISTINCT queries are expensive, especially when paged, so we store the
|
||||
// data in its own table for the duration of the update.
|
||||
@@ -2793,7 +2819,7 @@ function system_update_7061(&$sandbox) {
|
||||
$scheme = file_default_scheme() . '://';
|
||||
foreach ($node_revisions as $vid => $revision) {
|
||||
foreach ($revision['file'][LANGUAGE_NONE] as $delta => $file) {
|
||||
// We will convert filepaths to uri using the default scheme
|
||||
// We will convert filepaths to URI using the default scheme
|
||||
// and stripping off the existing file directory path.
|
||||
$file['uri'] = $scheme . preg_replace('!^' . preg_quote($basename) . '!', '', $file['filepath']);
|
||||
$file['uri'] = file_stream_wrapper_uri_normalize($file['uri']);
|
||||
@@ -2958,8 +2984,9 @@ function system_update_7069() {
|
||||
*/
|
||||
|
||||
/**
|
||||
* @defgroup updates-7.x-extra Extra system updates for 7.x
|
||||
* @defgroup updates-7.x-extra Extra updates for 7.x
|
||||
* @{
|
||||
* Update functions between 7.x versions.
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -3024,6 +3051,41 @@ function system_update_7074() {
|
||||
// PostgreSQL.
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert menu_links query strings into arrays.
|
||||
*/
|
||||
function system_update_7076() {
|
||||
$query = db_select('menu_links', 'ml', array('fetch' => PDO::FETCH_ASSOC))
|
||||
->fields('ml', array('mlid', 'options'));
|
||||
foreach ($query->execute() as $menu_link) {
|
||||
if (strpos($menu_link['options'], 'query') !== FALSE) {
|
||||
$menu_link['options'] = unserialize($menu_link['options']);
|
||||
if (isset($menu_link['options']['query']) && is_string($menu_link['options']['query'])) {
|
||||
$menu_link['options']['query'] = drupal_get_query_array($menu_link['options']['query']);
|
||||
db_update('menu_links')
|
||||
->fields(array(
|
||||
'options' => serialize($menu_link['options']),
|
||||
))
|
||||
->condition('mlid', $menu_link['mlid'], '=')
|
||||
->execute();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Revert {file_managed}.filename changed to a binary column.
|
||||
*/
|
||||
function system_update_7077() {
|
||||
db_change_field('file_managed', 'filename', 'filename', array(
|
||||
'description' => 'Name of the file with no path components. This may differ from the basename of the URI if the file is renamed to avoid overwriting an existing file.',
|
||||
'type' => 'varchar',
|
||||
'length' => 255,
|
||||
'not null' => TRUE,
|
||||
'default' => '',
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* @} End of "defgroup updates-7.x-extra".
|
||||
* The next series of updates should start at 8000.
|
||||
|
@@ -1740,16 +1740,27 @@ function _system_themes_access($theme) {
|
||||
/**
|
||||
* Setup a given callback to run via authorize.php with elevated privileges.
|
||||
*
|
||||
* To use authorize.php, certain variables must be stashed into $_SESSION.
|
||||
* This function sets up all the necessary $_SESSION variables, then returns
|
||||
* the full path to authorize.php so the caller can redirect to authorize.php.
|
||||
* That initiates the workflow that will eventually lead to the callback being
|
||||
* invoked. The callback will be invoked at a low bootstrap level, without all
|
||||
* modules being invoked, so it needs to be careful not to assume any code
|
||||
* exists.
|
||||
* To use authorize.php, certain variables must be stashed into $_SESSION. This
|
||||
* function sets up all the necessary $_SESSION variables. The calling function
|
||||
* should then redirect to authorize.php, using the full path returned by
|
||||
* system_authorized_get_url(). That initiates the workflow that will eventually
|
||||
* lead to the callback being invoked. The callback will be invoked at a low
|
||||
* bootstrap level, without all modules being invoked, so it needs to be careful
|
||||
* not to assume any code exists. Example (system_authorized_run()):
|
||||
* @code
|
||||
* system_authorized_init($callback, $file, $arguments, $page_title);
|
||||
* drupal_goto(system_authorized_get_url());
|
||||
* @endcode
|
||||
* Example (update_manager_install_form_submit()):
|
||||
* @code
|
||||
* system_authorized_init('update_authorize_run_install',
|
||||
* drupal_get_path('module', 'update') . '/update.authorize.inc',
|
||||
* $arguments, t('Update manager'));
|
||||
* $form_state['redirect'] = system_authorized_get_url();
|
||||
* @endcode
|
||||
*
|
||||
* @param $callback
|
||||
* The name of the function to invoke one the user authorizes the operation.
|
||||
* The name of the function to invoke once the user authorizes the operation.
|
||||
* @param $file
|
||||
* The full path to the file where the callback function is implemented.
|
||||
* @param $arguments
|
||||
@@ -1785,11 +1796,13 @@ function system_authorized_init($callback, $file, $arguments = array(), $page_ti
|
||||
* @param array $options
|
||||
* Optional array of options to pass to url().
|
||||
* @return
|
||||
* The full URL to authorize.php, using https if available.
|
||||
* The full URL to authorize.php, using HTTPS if available.
|
||||
*
|
||||
* @see system_authorized_init()
|
||||
*/
|
||||
function system_authorized_get_url(array $options = array()) {
|
||||
global $base_url;
|
||||
// Force https if available, regardless of what the caller specifies.
|
||||
// Force HTTPS if available, regardless of what the caller specifies.
|
||||
$options['https'] = TRUE;
|
||||
// We prefix with $base_url so we get a full path even if clean URLs are
|
||||
// disabled.
|
||||
@@ -2348,14 +2361,14 @@ function _system_rebuild_module_data() {
|
||||
// Find modules
|
||||
$modules = drupal_system_listing('/^' . DRUPAL_PHP_FUNCTION_PATTERN . '\.module$/', 'modules', 'name', 0);
|
||||
|
||||
// Include the install profile in modules that are loaded.
|
||||
// Include the installation profile in modules that are loaded.
|
||||
$profile = drupal_get_profile();
|
||||
$modules[$profile] = new stdClass();
|
||||
$modules[$profile]->name = $profile;
|
||||
$modules[$profile]->uri = 'profiles/' . $profile . '/' . $profile . '.profile';
|
||||
$modules[$profile]->filename = $profile . '.profile';
|
||||
|
||||
// Install profile hooks are always executed last.
|
||||
// Installation profile hooks are always executed last.
|
||||
$modules[$profile]->weight = 1000;
|
||||
|
||||
// Set defaults for module info.
|
||||
@@ -2396,7 +2409,7 @@ function _system_rebuild_module_data() {
|
||||
$module->info['scripts'] = _system_info_add_path($module->info['scripts'], $path);
|
||||
}
|
||||
|
||||
// Install profiles are hidden by default, unless explicitly specified
|
||||
// Installation profiles are hidden by default, unless explicitly specified
|
||||
// otherwise in the .info file.
|
||||
if ($key == $profile && !isset($modules[$key]->info['hidden'])) {
|
||||
$modules[$key]->info['hidden'] = TRUE;
|
||||
@@ -2409,7 +2422,7 @@ function _system_rebuild_module_data() {
|
||||
}
|
||||
|
||||
if (isset($modules[$profile])) {
|
||||
// The install profile is required, if it's a valid module.
|
||||
// The installation 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().
|
||||
@@ -3759,7 +3772,7 @@ function _system_date_formats_build() {
|
||||
}
|
||||
|
||||
// Get custom formats added to the database by the end user.
|
||||
$result = db_query('SELECT df.dfid, df.format, df.type, df.locked, dfl.language FROM {date_formats} df LEFT JOIN {date_format_type} dft ON df.type = dft.type LEFT JOIN {date_format_locale} dfl ON df.format = dfl.format AND df.type = dfl.type ORDER BY df.type, df.format');
|
||||
$result = db_query('SELECT df.dfid, df.format, df.type, df.locked, dfl.language FROM {date_formats} df LEFT JOIN {date_format_locale} dfl ON df.format = dfl.format AND df.type = dfl.type ORDER BY df.type, df.format');
|
||||
foreach ($result as $record) {
|
||||
// If this date type isn't set, initialise the array.
|
||||
if (!isset($date_formats[$record->type])) {
|
||||
|
@@ -70,8 +70,8 @@
|
||||
* Allow themes to alter the theme-specific settings form.
|
||||
*
|
||||
* With this hook, themes can alter the theme-specific settings form in any way
|
||||
* allowable by Drupal's Forms API, such as adding form elements, changing
|
||||
* default values and removing form elements. See the Forms API documentation on
|
||||
* allowable by Drupal's Form API, such as adding form elements, changing
|
||||
* default values and removing form elements. See the Form API documentation on
|
||||
* api.drupal.org for detailed information.
|
||||
*
|
||||
* Note that the base theme's form alterations will be run before any sub-theme
|
||||
|
Reference in New Issue
Block a user