updated drupal core to 7.51
This commit is contained in:
@@ -2705,10 +2705,17 @@ function system_find_base_themes($themes, $key, $used_keys = array()) {
|
||||
* @param $show
|
||||
* Possible values: REGIONS_ALL or REGIONS_VISIBLE. Visible excludes hidden
|
||||
* regions.
|
||||
* @return
|
||||
* An array of regions in the form $region['name'] = 'description'.
|
||||
* @param bool $labels
|
||||
* (optional) Boolean to specify whether the human readable machine names
|
||||
* should be returned or not. Defaults to TRUE, but calling code can set
|
||||
* this to FALSE for better performance, if it only needs machine names.
|
||||
*
|
||||
* @return array
|
||||
* An associative array of regions in the form $region['name'] = 'description'
|
||||
* if $labels is set to TRUE, or $region['name'] = 'name', if $labels is set
|
||||
* to FALSE.
|
||||
*/
|
||||
function system_region_list($theme_key, $show = REGIONS_ALL) {
|
||||
function system_region_list($theme_key, $show = REGIONS_ALL, $labels = TRUE) {
|
||||
$themes = list_themes();
|
||||
if (!isset($themes[$theme_key])) {
|
||||
return array();
|
||||
@@ -2719,10 +2726,14 @@ 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] = t($label);
|
||||
if ($labels) {
|
||||
$list[$name] = t($label);
|
||||
}
|
||||
else {
|
||||
$list[$name] = $name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $list;
|
||||
}
|
||||
|
||||
@@ -2743,12 +2754,13 @@ function system_system_info_alter(&$info, $file, $type) {
|
||||
*
|
||||
* @param $theme
|
||||
* The name of a theme.
|
||||
*
|
||||
* @return
|
||||
* A string that is the region name.
|
||||
*/
|
||||
function system_default_region($theme) {
|
||||
$regions = array_keys(system_region_list($theme, REGIONS_VISIBLE));
|
||||
return isset($regions[0]) ? $regions[0] : '';
|
||||
$regions = system_region_list($theme, REGIONS_VISIBLE, FALSE);
|
||||
return $regions ? reset($regions) : '';
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -3317,7 +3329,7 @@ function system_goto_action_form($context) {
|
||||
$form['url'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('URL'),
|
||||
'#description' => t('The URL to which the user should be redirected. This can be an internal URL like node/1234 or an external URL like http://drupal.org.'),
|
||||
'#description' => t('The URL to which the user should be redirected. This can be an internal path like node/1234 or an external URL like http://example.com.'),
|
||||
'#default_value' => isset($context['url']) ? $context['url'] : '',
|
||||
'#required' => TRUE,
|
||||
);
|
||||
@@ -3354,7 +3366,8 @@ function system_goto_action($entity, $context) {
|
||||
*/
|
||||
function system_block_ip_action() {
|
||||
$ip = ip_address();
|
||||
db_insert('blocked_ips')
|
||||
db_merge('blocked_ips')
|
||||
->key(array('ip' => $ip))
|
||||
->fields(array('ip' => $ip))
|
||||
->execute();
|
||||
watchdog('action', 'Banned IP address %ip', array('%ip' => $ip));
|
||||
@@ -3516,8 +3529,7 @@ function system_retrieve_file($url, $destination = NULL, $managed = FALSE, $repl
|
||||
function system_page_alter(&$page) {
|
||||
// Find all non-empty page regions, and add a theme wrapper function that
|
||||
// allows them to be consistently themed.
|
||||
$regions = system_region_list($GLOBALS['theme']);
|
||||
foreach (array_keys($regions) as $region) {
|
||||
foreach (system_region_list($GLOBALS['theme'], REGIONS_ALL, FALSE) as $region) {
|
||||
if (!empty($page[$region])) {
|
||||
$page[$region]['#theme_wrappers'][] = 'region';
|
||||
$page[$region]['#region'] = $region;
|
||||
|
||||
Reference in New Issue
Block a user