updated drupal core to 7.43
This commit is contained in:
@@ -363,6 +363,31 @@ function hook_block_list_alter(&$blocks) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Act on block cache ID (cid) parts before the cid is generated.
|
||||
*
|
||||
* This hook allows you to add, remove or modify the custom keys used to
|
||||
* generate a block cache ID (by default, these keys are set to the block
|
||||
* module and delta). These keys will be combined with the standard ones
|
||||
* provided by drupal_render_cid_parts() to generate the final block cache ID.
|
||||
*
|
||||
* To change the cache granularity used by drupal_render_cid_parts(), this hook
|
||||
* cannot be used; instead, set the 'cache' key in the block's definition in
|
||||
* hook_block_info().
|
||||
*
|
||||
* @params $cid_parts
|
||||
* An array of elements used to build the cid.
|
||||
* @param $block
|
||||
* The block object being acted on.
|
||||
*
|
||||
* @see _block_get_cache_id()
|
||||
*/
|
||||
function hook_block_cid_parts_alter(&$cid_parts, $block) {
|
||||
global $user;
|
||||
// This example shows how to cache a block based on the user's timezone.
|
||||
$cid_parts[] = $user->timezone;
|
||||
}
|
||||
|
||||
/**
|
||||
* @} End of "addtogroup hooks".
|
||||
*/
|
||||
|
@@ -6,8 +6,8 @@ core = 7.x
|
||||
files[] = block.test
|
||||
configure = admin/structure/block
|
||||
|
||||
; Information added by Drupal.org packaging script on 2015-08-19
|
||||
version = "7.39"
|
||||
; Information added by Drupal.org packaging script on 2016-02-24
|
||||
version = "7.43"
|
||||
project = "drupal"
|
||||
datestamp = "1440020197"
|
||||
datestamp = "1456343506"
|
||||
|
||||
|
@@ -24,7 +24,7 @@ Drupal.behaviors.blockSettingsSummary = {
|
||||
$('fieldset#edit-node-type', context).drupalSetSummary(function (context) {
|
||||
var vals = [];
|
||||
$('input[type="checkbox"]:checked', context).each(function () {
|
||||
vals.push($.trim($(this).next('label').text()));
|
||||
vals.push($.trim($(this).next('label').html()));
|
||||
});
|
||||
if (!vals.length) {
|
||||
vals.push(Drupal.t('Not restricted'));
|
||||
@@ -35,7 +35,7 @@ Drupal.behaviors.blockSettingsSummary = {
|
||||
$('fieldset#edit-role', context).drupalSetSummary(function (context) {
|
||||
var vals = [];
|
||||
$('input[type="checkbox"]:checked', context).each(function () {
|
||||
vals.push($.trim($(this).next('label').text()));
|
||||
vals.push($.trim($(this).next('label').html()));
|
||||
});
|
||||
if (!vals.length) {
|
||||
vals.push(Drupal.t('Not restricted'));
|
||||
@@ -49,7 +49,7 @@ Drupal.behaviors.blockSettingsSummary = {
|
||||
return Drupal.t('Not customizable');
|
||||
}
|
||||
else {
|
||||
return $radio.next('label').text();
|
||||
return $radio.next('label').html();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@@ -16,7 +16,7 @@ define('BLOCK_REGION_NONE', -1);
|
||||
define('BLOCK_CUSTOM_FIXED', 0);
|
||||
|
||||
/**
|
||||
* Shows this block by default, but lets individual users hide it.
|
||||
* Shows this block by default, but lets individual users hide it.
|
||||
*/
|
||||
define('BLOCK_CUSTOM_ENABLED', 1);
|
||||
|
||||
@@ -59,6 +59,7 @@ function block_help($path, $arg) {
|
||||
$output .= '<dd>' . t('Users with the <em>Administer blocks</em> permission can <a href="@block-add">add custom blocks</a>, which are then listed on the <a href="@blocks">Blocks administration page</a>. Once created, custom blocks behave just like default and module-generated blocks.', array('@blocks' => url('admin/structure/block'), '@block-add' => url('admin/structure/block/add'))) . '</dd>';
|
||||
$output .= '</dl>';
|
||||
return $output;
|
||||
|
||||
case 'admin/structure/block/add':
|
||||
return '<p>' . t('Use this page to create a new custom block.') . '</p>';
|
||||
}
|
||||
@@ -189,6 +190,7 @@ function _block_themes_access($theme) {
|
||||
* @param $theme
|
||||
* The theme whose blocks are being configured. If not set, the default theme
|
||||
* is assumed.
|
||||
*
|
||||
* @return
|
||||
* The theme that should be used for the block configuration page, or NULL
|
||||
* to indicate that the default theme should be used.
|
||||
@@ -343,14 +345,17 @@ function _block_get_renderable_array($list = array()) {
|
||||
// to perform contextual actions on the help block, and the links needlessly
|
||||
// draw attention on it.
|
||||
if ($key != 'system_main' && $key != 'system_help') {
|
||||
$build[$key]['#contextual_links']['block'] = array('admin/structure/block/manage', array($block->module, $block->delta));
|
||||
$build[$key]['#contextual_links']['block'] = array(
|
||||
'admin/structure/block/manage',
|
||||
array($block->module, $block->delta),
|
||||
);
|
||||
}
|
||||
|
||||
$build[$key] += array(
|
||||
'#block' => $block,
|
||||
'#weight' => ++$weight,
|
||||
);
|
||||
$build[$key]['#theme_wrappers'][] ='block';
|
||||
$build[$key]['#theme_wrappers'][] = 'block';
|
||||
}
|
||||
$build['#sorted'] = TRUE;
|
||||
return $build;
|
||||
@@ -386,18 +391,20 @@ function _block_rehash($theme = NULL) {
|
||||
// Gather the blocks defined by modules.
|
||||
foreach (module_implements('block_info') as $module) {
|
||||
$module_blocks = module_invoke($module, 'block_info');
|
||||
$delta_list = array();
|
||||
foreach ($module_blocks as $delta => $block) {
|
||||
// Compile a condition to retrieve this block from the database.
|
||||
$condition = db_and()
|
||||
->condition('module', $module)
|
||||
->condition('delta', $delta);
|
||||
$or->condition($condition);
|
||||
// Add identifiers.
|
||||
$delta_list[] = $delta;
|
||||
$block['module'] = $module;
|
||||
$block['delta'] = $delta;
|
||||
$block['theme'] = $theme;
|
||||
$block['delta'] = $delta;
|
||||
$block['theme'] = $theme;
|
||||
$current_blocks[$module][$delta] = $block;
|
||||
}
|
||||
if (!empty($delta_list)) {
|
||||
$condition = db_and()->condition('module', $module)->condition('delta', $delta_list);
|
||||
$or->condition($condition);
|
||||
}
|
||||
}
|
||||
// Save the blocks defined in code for alter context.
|
||||
$code_blocks = $current_blocks;
|
||||
@@ -644,7 +651,8 @@ function block_theme_initialize($theme) {
|
||||
$regions = system_region_list($theme, REGIONS_VISIBLE);
|
||||
$result = db_query("SELECT * FROM {block} WHERE theme = :theme", array(':theme' => $default_theme), array('fetch' => PDO::FETCH_ASSOC));
|
||||
foreach ($result as $block) {
|
||||
// If the region isn't supported by the theme, assign the block to the theme's default region.
|
||||
// If the region isn't supported by the theme, assign the block to the
|
||||
// theme's default region.
|
||||
if ($block['status'] && !isset($regions[$block['region']])) {
|
||||
$block['region'] = system_default_region($theme);
|
||||
}
|
||||
@@ -812,17 +820,18 @@ function block_block_list_alter(&$blocks) {
|
||||
// with different case. Ex: /Page, /page, /PAGE.
|
||||
$pages = drupal_strtolower($block->pages);
|
||||
if ($block->visibility < BLOCK_VISIBILITY_PHP) {
|
||||
// Convert the Drupal path to lowercase
|
||||
// Convert the Drupal path to lowercase.
|
||||
$path = drupal_strtolower(drupal_get_path_alias($_GET['q']));
|
||||
// Compare the lowercase internal and lowercase path alias (if any).
|
||||
$page_match = drupal_match_path($path, $pages);
|
||||
if ($path != $_GET['q']) {
|
||||
$page_match = $page_match || drupal_match_path($_GET['q'], $pages);
|
||||
}
|
||||
// When $block->visibility has a value of 0 (BLOCK_VISIBILITY_NOTLISTED),
|
||||
// the block is displayed on all pages except those listed in $block->pages.
|
||||
// When set to 1 (BLOCK_VISIBILITY_LISTED), it is displayed only on those
|
||||
// pages listed in $block->pages.
|
||||
// When $block->visibility has a value of 0
|
||||
// (BLOCK_VISIBILITY_NOTLISTED), the block is displayed on all pages
|
||||
// except those listed in $block->pages. When set to 1
|
||||
// (BLOCK_VISIBILITY_LISTED), it is displayed only on those pages
|
||||
// listed in $block->pages.
|
||||
$page_match = !($block->visibility xor $page_match);
|
||||
}
|
||||
elseif (module_exists('php')) {
|
||||
@@ -845,7 +854,8 @@ function block_block_list_alter(&$blocks) {
|
||||
* Render the content and subject for a set of blocks.
|
||||
*
|
||||
* @param $region_blocks
|
||||
* An array of block objects such as returned for one region by _block_load_blocks().
|
||||
* An array of block objects such as returned for one region by
|
||||
* _block_load_blocks().
|
||||
*
|
||||
* @return
|
||||
* An array of visible blocks as expected by drupal_render().
|
||||
@@ -953,6 +963,8 @@ function _block_render_blocks($region_blocks) {
|
||||
* Theme and language contexts are automatically differentiated.
|
||||
*
|
||||
* @param $block
|
||||
* The block to get the cache_id from.
|
||||
*
|
||||
* @return
|
||||
* The string used as cache_id for the block.
|
||||
*/
|
||||
@@ -967,6 +979,7 @@ function _block_get_cache_id($block) {
|
||||
// Start with common sub-patterns: block identification, theme, language.
|
||||
$cid_parts[] = $block->module;
|
||||
$cid_parts[] = $block->delta;
|
||||
drupal_alter('block_cid_parts', $cid_parts, $block);
|
||||
$cid_parts = array_merge($cid_parts, drupal_render_cid_parts($block->cache));
|
||||
|
||||
return implode(':', $cid_parts);
|
||||
|
@@ -5,8 +5,8 @@ version = VERSION
|
||||
core = 7.x
|
||||
hidden = TRUE
|
||||
|
||||
; Information added by Drupal.org packaging script on 2015-08-19
|
||||
version = "7.39"
|
||||
; Information added by Drupal.org packaging script on 2016-02-24
|
||||
version = "7.43"
|
||||
project = "drupal"
|
||||
datestamp = "1440020197"
|
||||
datestamp = "1456343506"
|
||||
|
||||
|
@@ -13,8 +13,8 @@ regions[footer] = Footer
|
||||
regions[highlighted] = Highlighted
|
||||
regions[help] = Help
|
||||
|
||||
; Information added by Drupal.org packaging script on 2015-08-19
|
||||
version = "7.39"
|
||||
; Information added by Drupal.org packaging script on 2016-02-24
|
||||
version = "7.43"
|
||||
project = "drupal"
|
||||
datestamp = "1440020197"
|
||||
datestamp = "1456343506"
|
||||
|
||||
|
Reference in New Issue
Block a user