contrib modules security updates
This commit is contained in:
@@ -9,6 +9,8 @@
|
||||
* Preprocess the primary entry level theme.
|
||||
*/
|
||||
function template_preprocess_panels_add_content_modal(&$vars) {
|
||||
$vars['categories_array'] = array();
|
||||
|
||||
// Process the list of categories.
|
||||
foreach ($vars['categories'] as $key => $category_info) {
|
||||
// 'root' category is actually displayed under the categories, so
|
||||
@@ -77,7 +79,10 @@ function template_preprocess_panels_add_content_link(&$vars) {
|
||||
$vars['description'] = isset($vars['content_type']['description']) ? $vars['content_type']['description'] : $vars['title'];
|
||||
$vars['icon'] = ctools_content_admin_icon($vars['content_type']);
|
||||
$vars['url'] = $vars['renderer']->get_url('add-pane', $vars['region'], $vars['content_type']['type_name'], $vars['content_type']['subtype_name']);
|
||||
|
||||
$vars['image_button'] = ctools_ajax_image_button($vars['icon'], $vars['url'], $vars['description'], 'panels-modal-add-config');
|
||||
$vars['text_button'] = ctools_ajax_text_button($vars['title'], $vars['url'], $vars['description'], 'panels-modal-add-config');
|
||||
$subtype_class = 'add-content-link-' . str_replace('_', '-', $vars['content_type']['subtype_name']);
|
||||
$vars['image_button'] = ctools_ajax_image_button($vars['icon'], $vars['url'], $vars['description'], $subtype_class . '-image-button panels-modal-add-config');
|
||||
$vars['text_button'] = ctools_ajax_text_button($vars['title'], $vars['url'], $vars['description'], $subtype_class . '-text-button panels-modal-add-config');
|
||||
if (function_exists('ctools_ajax_icon_text_button')) {
|
||||
$vars['icon_text_button'] = ctools_ajax_icon_text_button($vars['title'], $vars['icon'], $vars['url'], $vars['description'], $subtype_class . '-icon-text-button panels-modal-add-config');
|
||||
}
|
||||
}
|
||||
|
@@ -89,7 +89,7 @@ class panels_allowed_layouts {
|
||||
* as allowed or not allowed on the initial call to panels_allowed_layouts::set_allowed()
|
||||
*
|
||||
*/
|
||||
function panels_allowed_layouts($start_allowed = TRUE) {
|
||||
function __construct($start_allowed = TRUE) {
|
||||
// TODO would be nice if there was a way to just fetch the names easily
|
||||
foreach ($this->list_layouts() as $layout_name) {
|
||||
$this->allowed_layout_settings[$layout_name] = $start_allowed ? 1 : 0;
|
||||
@@ -352,11 +352,21 @@ function panels_common_settings_submit($form, &$form_state) {
|
||||
$module_name = $form_state['values']['module_name'];
|
||||
variable_set($module_name . '_default', $form_state['values']['panels_common_default']);
|
||||
if (!$form_state['skip']) {
|
||||
// merge the broken apart array neatly back together
|
||||
$allowed = $form_state['values']['allowed'];
|
||||
// Merge the broken apart array neatly back together.
|
||||
$allowed_content_types = array();
|
||||
foreach ($form_state['values']['allowed'] as $allowed) {
|
||||
$allowed_content_types = array_merge($allowed_content_types, $form_state['values']['content_types'][$allowed]['options']);
|
||||
$values = $form_state['values']['content_types'][$allowed]['options'];
|
||||
// If new content of the type is not added, storing a lisy of disabled
|
||||
// content is not needed.
|
||||
if (!$form_state['values']['panels_common_default'][$allowed]) {
|
||||
$values = array_filter($values);
|
||||
}
|
||||
$allowed_content_types = array_merge($allowed_content_types, $values);
|
||||
}
|
||||
// Values from checkboxes are the same string as they key, but we only need
|
||||
// to store the boolean value.
|
||||
foreach ($allowed_content_types as &$value) {
|
||||
$value = (bool) $value;
|
||||
}
|
||||
variable_set($module_name . '_allowed_types', $allowed_content_types);
|
||||
}
|
||||
|
@@ -240,7 +240,7 @@ function panels_edit_display_settings_form($form, &$form_state) {
|
||||
'#type' => 'textfield',
|
||||
'#default_value' => $display->title,
|
||||
'#title' => t('Title'),
|
||||
'#description' => t('The title of this panel. If left blank, a default title may be used. Set to No Title if you want the title to actually be blank.'),
|
||||
'#description' => t('The title of this panel. If left blank, a default title may be used. If you want the title actually to be blank, change the "Title type" dropdown from "Manually Set" to "No Title".'),
|
||||
'#process' => array('ctools_dependent_process'),
|
||||
'#dependency' => array('edit-display-title-hide-title' => array(PANELS_TITLE_FIXED)),
|
||||
'#maxlength' => 255,
|
||||
|
@@ -94,6 +94,7 @@ function panels_choose_layout($form, &$form_state) {
|
||||
}
|
||||
}
|
||||
|
||||
ctools_add_js('panels-base', 'panels');
|
||||
ctools_add_js('layout', 'panels');
|
||||
|
||||
$form['categories'] = array(
|
||||
@@ -320,6 +321,8 @@ function panels_change_layout_submit($form, &$form_state) {
|
||||
$display->panels = $content;
|
||||
|
||||
$display->layout = $form_state['layout'];
|
||||
|
||||
panels_edit_display_settings_form_submit($form, $form_state);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -125,7 +125,7 @@ class panels_cache_object {
|
||||
/**
|
||||
* When constructed, take a snapshot of our existing out of band data.
|
||||
*/
|
||||
function panels_cache_object() {
|
||||
function __construct() {
|
||||
$this->head = drupal_add_html_head();
|
||||
$this->css = drupal_add_css();
|
||||
$this->tokens = ctools_set_page_token();
|
||||
@@ -173,15 +173,36 @@ class panels_cache_object {
|
||||
$start = $this->js;
|
||||
$this->js = array();
|
||||
|
||||
// Use the advanced mapping function from Drupal >= 7.23 if available.
|
||||
$array_mapping_func = function_exists('drupal_array_diff_assoc_recursive') ? 'drupal_array_diff_assoc_recursive' : 'array_diff_assoc';
|
||||
|
||||
// If there are any differences between the old and the new javascript then
|
||||
// store them to be added later.
|
||||
if ($diff = array_diff_assoc($js, $start)) {
|
||||
$this->js = $diff;
|
||||
}
|
||||
|
||||
// Special case the settings key and get the difference of the data.
|
||||
if ($settings_diff = array_diff_assoc($js['settings']['data'], $start['settings']['data'])) {
|
||||
$this->js['settings'] = $settings_diff;
|
||||
if ($diff = $array_mapping_func($js, $start)) {
|
||||
// Iterate over the diff to ensure we keep the keys on merge and don't add
|
||||
// unnecessary items.
|
||||
foreach ($diff as $key => $diff_data) {
|
||||
// Special case the settings key and get the difference of the data.
|
||||
if ($key === 'settings') {
|
||||
// Iterate over the diff to ensure we keep the keys on merge and don't
|
||||
// add unnecessary items.
|
||||
if (isset($diff[$key]['data'])) {
|
||||
foreach ($diff[$key]['data'] as $settings_key => $settings_data) {
|
||||
// Merge the changes with the base to get a complete settings
|
||||
// array.
|
||||
$this->js[$key]['data'][] = drupal_array_merge_deep($settings_data, $diff[$key]['data'][$settings_key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
$this->js[$key] = $diff_data;
|
||||
// Check if the key was present already and if so merge the changes
|
||||
// with the original data to get the full settings array.
|
||||
if (isset($start[$key])) {
|
||||
$this->js[$key] = drupal_array_merge_deep($start[$key], $this->js[$key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// And for tokens:
|
||||
@@ -213,7 +234,7 @@ class panels_cache_object {
|
||||
drupal_add_js($args['data'], $args);
|
||||
}
|
||||
else {
|
||||
foreach ($args as $setting) {
|
||||
foreach ($args['data'] as $setting) {
|
||||
drupal_add_js($setting, 'setting');
|
||||
}
|
||||
}
|
||||
@@ -457,6 +478,31 @@ function panels_get_renderer_pipelines($sort = TRUE) {
|
||||
return $pipelines;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch metadata on a specific panels_storage plugin.
|
||||
*
|
||||
* @param $storage
|
||||
* Name of a panel_storage plugin.
|
||||
*
|
||||
* @return
|
||||
* An array with information about the requested panels_storage plugin
|
||||
*/
|
||||
function panels_get_panels_storage_plugin($storage) {
|
||||
ctools_include('plugins');
|
||||
return ctools_get_plugins('panels', 'panels_storage', $storage);
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch metadata for all panels_storage plugins.
|
||||
*
|
||||
* @return
|
||||
* An array of arrays with information about all available panels_storage plugins.
|
||||
*/
|
||||
function panels_get_panels_storage_plugins() {
|
||||
ctools_include('plugins');
|
||||
return ctools_get_plugins('panels', 'panels_storage');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a function from a plugin, if it exists.
|
||||
*
|
||||
|
Reference in New Issue
Block a user