';
return html;
}
@@ -142,11 +142,11 @@
*/
Drupal.theme.prototype.CToolsModalThrobber = function () {
var html = '';
- html += '
';
- html += '
';
- html += Drupal.CTools.Modal.currentSettings.throbber;
- html += '
';
+ html += '
';
+ html += '
';
+ html += Drupal.CTools.Modal.currentSettings.throbber;
html += '
';
+ html += '
';
return html;
};
@@ -265,7 +265,10 @@
}
// An empty event means we were triggered via .click() and
// in jquery 1.4 this won't trigger a submit.
- if (event.bubbles == undefined) {
+ // We also have to check jQuery version to prevent
+ // IE8 + jQuery 1.4.4 to break on other events
+ // bound to the submit button.
+ if (jQuery.fn.jquery === '1.4' && typeof event.bubbles === "undefined") {
$(this.form).trigger('submit');
return false;
}
diff --git a/sites/all/modules/contrib/dev/ctools/js/stylizer.js b/sites/all/modules/contrib/dev/ctools/js/stylizer.js
index 16d6c49d..12ab7204 100644
--- a/sites/all/modules/contrib/dev/ctools/js/stylizer.js
+++ b/sites/all/modules/contrib/dev/ctools/js/stylizer.js
@@ -5,7 +5,7 @@
Drupal.CTools.Stylizer.addFarbtastic = function(context) {
// This behavior attaches by ID, so is only valid once on a page.
- if ($('ctools_stylizer_color_scheme_form .color-form.Stylizer-processed').size()) {
+ if ($('#ctools_stylizer_color_scheme_form .color-form.Stylizer-processed').size()) {
return;
}
diff --git a/sites/all/modules/contrib/dev/ctools/page_manager/page_manager.admin.inc b/sites/all/modules/contrib/dev/ctools/page_manager/page_manager.admin.inc
index 0f164fe5..2a78fd9f 100644
--- a/sites/all/modules/contrib/dev/ctools/page_manager/page_manager.admin.inc
+++ b/sites/all/modules/contrib/dev/ctools/page_manager/page_manager.admin.inc
@@ -1542,25 +1542,42 @@ function page_manager_handler_import_submit(&$form, &$form_state) {
* Rearrange the order of variants.
*/
function page_manager_handler_rearrange($form, &$form_state) {
+ ctools_include('context-task-handler');
$page = $form_state['page'];
$form['handlers'] = array('#tree' => TRUE);
+ // Get the number of variants to be displayed in order to set the delta
+ // to the proper value. This fixes problems in previous versions with sorting
+ // large numbers of variants.
+ $delta = count($page->handler_info)/2 + 1;
+
foreach ($page->handler_info as $id => $info) {
if ($info['changed'] & PAGE_MANAGER_CHANGED_DELETED) {
continue;
}
$handler = $page->handlers[$id];
$plugin = page_manager_get_task_handler($handler->handler);
-
+ $object = ctools_context_handler_get_task_object($page->task, $page->subtask, $handler);
+ $display = new stdClass();
+ $display->context = ctools_context_load_contexts($object, TRUE);
+ $content = page_manager_get_handler_title($plugin, $handler, $page->task, $page->subtask_id);
+ $access = ctools_access_group_summary(!empty($handler->conf['access']) ? $handler->conf['access'] : array(), $display->context);
+ if ($access) {
+ $access = t('This panel will be selected if @conditions.', array('@conditions' => $access));
+ }
+ else {
+ $access = t('This panel will always be selected.');
+ }
+ $content .= '
' . $access . '
';
$form['handlers'][$id]['title'] = array(
- '#markup' => page_manager_get_handler_title($plugin, $handler, $page->task, $page->subtask_id),
+ '#markup' => $content,
);
$form['handlers'][$id]['weight'] = array(
'#type' => 'weight',
'#default_value' => $info['weight'],
- '#delta' => 30,
+ '#delta' => $delta,
);
}
diff --git a/sites/all/modules/contrib/dev/ctools/page_manager/page_manager.info b/sites/all/modules/contrib/dev/ctools/page_manager/page_manager.info
index c7f4df3a..944c7976 100644
--- a/sites/all/modules/contrib/dev/ctools/page_manager/page_manager.info
+++ b/sites/all/modules/contrib/dev/ctools/page_manager/page_manager.info
@@ -5,9 +5,9 @@ dependencies[] = ctools
package = Chaos tool suite
version = CTOOLS_MODULE_VERSION
-; Information added by Drupal.org packaging script on 2015-08-19
-version = "7.x-1.9"
+; Information added by Drupal.org packaging script on 2016-10-16
+version = "7.x-1.11"
core = "7.x"
project = "ctools"
-datestamp = "1440020680"
+datestamp = "1476581654"
diff --git a/sites/all/modules/contrib/dev/ctools/page_manager/page_manager.module b/sites/all/modules/contrib/dev/ctools/page_manager/page_manager.module
index f3cb743e..a498f7fb 100644
--- a/sites/all/modules/contrib/dev/ctools/page_manager/page_manager.module
+++ b/sites/all/modules/contrib/dev/ctools/page_manager/page_manager.module
@@ -1202,7 +1202,7 @@ function page_manager_page_manager_pages_to_hook_code($names = array(), $name =
foreach ($objects as $object) {
// Have to implement our own because this export func sig requires it
$code .= $export['export callback']($object, TRUE, ' ');
- $code .= " \${$export['identifier']}s['" . check_plain($object->$export['key']) . "'] = \${$export['identifier']};\n\n";
+ $code .= " \${$export['identifier']}s['" . check_plain($object->{$export['key']}) . "'] = \${$export['identifier']};\n\n";
}
$code .= " return \${$export['identifier']}s;\n";
$code .= "}\n";
diff --git a/sites/all/modules/contrib/dev/ctools/page_manager/plugins/task_handlers/http_response.inc b/sites/all/modules/contrib/dev/ctools/page_manager/plugins/task_handlers/http_response.inc
index c4eba8e2..8fc0f256 100644
--- a/sites/all/modules/contrib/dev/ctools/page_manager/plugins/task_handlers/http_response.inc
+++ b/sites/all/modules/contrib/dev/ctools/page_manager/plugins/task_handlers/http_response.inc
@@ -3,7 +3,8 @@
/**
* @file
*
- * This is the task handler plugin to handle generating 403, 404 and 301 response codes.
+ * This is the task handler plugin to handle generating 403, 404, 301 and 302
+ * response codes.
*/
// Plugin definition
@@ -108,7 +109,8 @@ function page_manager_http_response_codes() {
403 => t('403 Access denied'),
404 => t('404 Page not found'),
410 => t('410 Gone'),
- 301 => t('301 Redirect'),
+ 301 => t('301 Permanent redirect'),
+ 302 => t('302 Temporary redirect'),
);
}
@@ -256,7 +258,7 @@ function page_manager_http_response_edit_settings($form, &$form_state) {
'#type' => 'textfield',
'#title' => t('Redirect destination'),
'#default_value' => $conf['destination'],
- '#dependency' => array('edit-code' => array(301)),
+ '#dependency' => array('edit-code' => array(301, 302)),
'#description' => t('Enter the path to redirect to. You may use keyword substitutions from contexts. You can use external urls (http://www.example.com/foo) or internal urls (node/1).'),
);
@@ -313,7 +315,7 @@ function page_manager_http_response_render($handler, $base_contexts, $args, $tes
}
$info['response code'] = $handler->conf['code'];
- if ($info['response code'] == 301) {
+ if ($info['response code'] == 301 || $info['response code'] == 302) {
$path = ctools_context_keyword_substitute($handler->conf['destination'], array(), $contexts);
$url = parse_url($path);
if (isset($url['query'])) {
diff --git a/sites/all/modules/contrib/dev/ctools/page_manager/plugins/tasks/page.admin.inc b/sites/all/modules/contrib/dev/ctools/page_manager/plugins/tasks/page.admin.inc
index 97bd37bc..5cc12834 100644
--- a/sites/all/modules/contrib/dev/ctools/page_manager/plugins/tasks/page.admin.inc
+++ b/sites/all/modules/contrib/dev/ctools/page_manager/plugins/tasks/page.admin.inc
@@ -698,7 +698,7 @@ function page_manager_page_form_menu($form, &$form_state) {
'#title' => t('Title'),
'#type' => 'textfield',
'#default_value' => $menu['title'],
- '#description' => t('If set to normal or tab, enter the text to use for the menu item.'),
+ '#description' => t('If set to normal or tab, enter the text to use for the menu item. Renaming the menu item using the Drupal menu system (admin/structure/menu) will override this, even if it is renamed again here.'),
'#dependency' => array('radio:menu[type]' => array('normal', 'tab', 'default tab', 'action')),
);
diff --git a/sites/all/modules/contrib/dev/ctools/plugins/access/query_string_exists.inc b/sites/all/modules/contrib/dev/ctools/plugins/access/query_string_exists.inc
new file mode 100644
index 00000000..abec5f7a
--- /dev/null
+++ b/sites/all/modules/contrib/dev/ctools/plugins/access/query_string_exists.inc
@@ -0,0 +1,44 @@
+ t('Query string exists'),
+ 'description' => t('Control access by whether or not a query string exists.'),
+ 'callback' => 'ctools_query_string_exists_ctools_access_check',
+ 'settings form' => 'ctools_query_string_exists_ctools_access_settings',
+ 'summary' => 'ctools_query_string_exists_ctools_access_summary',
+ 'defaults' => array('key' => ''),
+);
+
+/**
+ * Settings form.
+ */
+function ctools_query_string_exists_ctools_access_settings($form, &$form_state, $config) {
+ $form['settings']['key'] = array(
+ '#title' => t('Query string key'),
+ '#description' => t('Enter the key of the query string.'),
+ '#type' => 'textfield',
+ '#required' => TRUE,
+ '#default_value' => $config['key']
+ );
+
+ return $form;
+}
+
+/**
+ * Check for access.
+ */
+function ctools_query_string_exists_ctools_access_check($config, $context) {
+ return isset($_GET[$config['key']]);
+}
+
+/**
+ * Provide a summary description.
+ */
+function ctools_query_string_exists_ctools_access_summary($config, $context) {
+ return t('@identifier exists', array('@identifier' => $config['key']));
+}
diff --git a/sites/all/modules/contrib/dev/ctools/plugins/arguments/term.inc b/sites/all/modules/contrib/dev/ctools/plugins/arguments/term.inc
index 868c8aa5..65c87ac7 100644
--- a/sites/all/modules/contrib/dev/ctools/plugins/arguments/term.inc
+++ b/sites/all/modules/contrib/dev/ctools/plugins/arguments/term.inc
@@ -18,6 +18,7 @@ $plugin = array(
'context' => 'ctools_term_context',
'default' => array('input_form' => 'tid', 'breadcrumb' => TRUE, 'transform' => FALSE),
'settings form' => 'ctools_term_settings_form',
+ 'settings form validate' => 'ctools_term_settings_form_validate',
'placeholder form' => 'ctools_term_ctools_argument_placeholder',
'breadcrumb' => 'ctools_term_breadcrumb',
);
@@ -31,6 +32,16 @@ function ctools_term_context($arg = NULL, $conf = NULL, $empty = FALSE) {
return ctools_context_create_empty('entity:taxonomy_term');
}
+ if (isset($conf['vocabularies'])) {
+ $vocabularies = $conf['vocabularies'];
+ }
+ else {
+ $vids = isset($conf['vids']) ? $conf['vids'] : array();
+
+ // Convert legacy use of vids to machine names.
+ $vocabularies = _ctools_term_vocabulary_machine_name_convert($vids);
+ }
+
if (is_object($arg)) {
$term = $arg;
}
@@ -50,12 +61,11 @@ function ctools_term_context($arg = NULL, $conf = NULL, $empty = FALSE) {
}
$terms = taxonomy_get_term_by_name($arg);
-
- $conf['vids'] = is_array($conf['vids']) ? array_filter($conf['vids']) : NULL;
- if ((count($terms) > 1) && isset($conf['vids'])) {
+ // If only one term is found, fall through to vocabulary check below.
+ if ((count($terms) > 1) && $vocabularies) {
foreach ($terms as $potential) {
- foreach ($conf['vids'] as $vid => $active) {
- if ($active && $potential->vid == $vid) {
+ foreach ($vocabularies as $machine_name) {
+ if ($potential->vocabulary_machine_name == $machine_name) {
$term = $potential;
// break out of the foreaches AND the case
break 3;
@@ -72,7 +82,7 @@ function ctools_term_context($arg = NULL, $conf = NULL, $empty = FALSE) {
}
}
- if (!empty($conf['vids']) && array_filter($conf['vids']) && empty($conf['vids'][$term->vid])) {
+ if ($vocabularies && !isset($vocabularies[$term->vocabulary_machine_name])) {
return NULL;
}
@@ -98,13 +108,20 @@ function ctools_term_settings_form(&$form, &$form_state, $conf) {
$vocabularies = taxonomy_get_vocabularies();
$options = array();
foreach ($vocabularies as $vid => $vocab) {
- $options[$vid] = $vocab->name;
+ $options[$vocab->machine_name] = $vocab->name;
}
- $form['settings']['vids'] = array(
+
+ // Fallback on legacy 'vids', when no vocabularies are available.
+ if (empty($conf['vocabularies']) && !empty($conf['vids'])) {
+ $conf['vocabularies'] = _ctools_term_vocabulary_machine_name_convert(array_filter($conf['vids']));
+ unset($conf['vids']);
+ }
+
+ $form['settings']['vocabularies'] = array(
'#title' => t('Limit to these vocabularies'),
'#type' => 'checkboxes',
'#options' => $options,
- '#default_value' => !empty($conf['vids']) ? $conf['vids'] : array(),
+ '#default_value' => !empty($conf['vocabularies']) ? $conf['vocabularies'] : array(),
'#description' => t('If no vocabularies are checked, terms from all vocabularies will be accepted.'),
);
@@ -123,6 +140,12 @@ function ctools_term_settings_form(&$form, &$form_state, $conf) {
// return $form;
}
+function ctools_term_settings_form_validate (&$form, &$form_state) {
+ // Filter the selected vocabularies to avoid storing redundant data.
+ $vocabularies = array_filter($form_state['values']['settings']['vocabularies']);
+ form_set_value($form['settings']['vocabularies'], $vocabularies, $form_state);
+}
+
/**
* Form fragment to get an argument to convert a placeholder for preview.
*/
@@ -161,3 +184,20 @@ function ctools_term_breadcrumb($conf, $context) {
$breadcrumb = array_merge(drupal_get_breadcrumb(), array_reverse($breadcrumb));
drupal_set_breadcrumb($breadcrumb);
}
+
+/**
+ * Helper function to convert convert legacy vocabulary ids into machine names.
+ *
+ * @param array $vids
+ * Array of either vids.
+ * @return array
+ * A keyed array of machine names.
+ */
+function _ctools_term_vocabulary_machine_name_convert($vids) {
+ $vocabularies = taxonomy_vocabulary_load_multiple($vids);
+ $return = array();
+ foreach($vocabularies as $vocabulary) {
+ $return[$vocabulary->machine_name] = $vocabulary->machine_name;
+ }
+ return $return;
+}
diff --git a/sites/all/modules/contrib/dev/ctools/plugins/content_types/comment/comment_links.inc b/sites/all/modules/contrib/dev/ctools/plugins/content_types/comment/comment_links.inc
index c8fefcca..fcca9703 100644
--- a/sites/all/modules/contrib/dev/ctools/plugins/content_types/comment/comment_links.inc
+++ b/sites/all/modules/contrib/dev/ctools/plugins/content_types/comment/comment_links.inc
@@ -26,7 +26,7 @@ function ctools_comment_links_content_type_render($subtype, $conf, $panel_args,
return;
}
- $comment = isset($context->data) ? clone($context->data) : NULL;
+ $comment = isset($context->data) ? clone $context->data : NULL;
$block = new stdClass();
$block->module = 'comment';
$block->delta = $comment->cid;
diff --git a/sites/all/modules/contrib/dev/ctools/plugins/content_types/comment/comment_reply_form.inc b/sites/all/modules/contrib/dev/ctools/plugins/content_types/comment/comment_reply_form.inc
index c05effb6..bccba9a2 100644
--- a/sites/all/modules/contrib/dev/ctools/plugins/content_types/comment/comment_reply_form.inc
+++ b/sites/all/modules/contrib/dev/ctools/plugins/content_types/comment/comment_reply_form.inc
@@ -25,7 +25,7 @@ if (module_exists('comment')) {
function ctools_comment_reply_form_content_type_render($subtype, $conf, $panel_args, $context) {
- $comment = ($context[1]->identifier == t('No context')) ? NULL : clone($context[1]->data);
+ $comment = ($context[1]->identifier == t('No context')) ? NULL : clone $context[1]->data;
$block = new stdClass();
$block->module = 'comments';
if ($comment) $block->delta = $comment->cid;
diff --git a/sites/all/modules/contrib/dev/ctools/plugins/content_types/custom/custom.inc b/sites/all/modules/contrib/dev/ctools/plugins/content_types/custom/custom.inc
index ac2f2a3f..d9ac79f5 100644
--- a/sites/all/modules/contrib/dev/ctools/plugins/content_types/custom/custom.inc
+++ b/sites/all/modules/contrib/dev/ctools/plugins/content_types/custom/custom.inc
@@ -16,7 +16,7 @@
$plugin = array(
'title' => t('Custom content'),
'no title override' => TRUE,
- 'defaults' => array('admin_title' => '', 'title' => '', 'body' => '', 'format' => filter_default_format(), 'substitute' => TRUE),
+ 'defaults' => array('admin_title' => '', 'title' => '', 'title_heading' => 'h2', 'body' => '', 'format' => filter_default_format(), 'substitute' => TRUE),
'js' => array('misc/autocomplete.js', 'misc/textarea.js', 'misc/collapse.js'),
// Make sure the edit form is only used for some subtypes.
'edit form' => '',
@@ -135,6 +135,7 @@ function ctools_custom_content_type_get_conf($subtype, $conf) {
$settings = array(
'admin_title' => t('Missing/deleted content'),
'title' => '',
+ 'title_heading' => '',
'body' => '',
'format' => filter_default_format(),
'substitute' => TRUE,
@@ -180,6 +181,8 @@ function ctools_custom_content_type_render($subtype, $conf, $args, $contexts) {
$block = new stdClass();
$block->subtype = ++$delta;
$block->title = filter_xss_admin($settings['title']);
+ $block->title_heading = isset($settings['title_heading']) ? $settings['title_heading'] : 'h2';
+
// Add keyword substitutions if we were configured to do so.
$content = $settings['body'];
@@ -277,10 +280,36 @@ function ctools_custom_content_type_edit_form($form, &$form_state) {
'#description' => t('This title will be used administratively to identify this pane. If blank, the regular title will be used.'),
);
+ // Copy over the title override settings for a title heading.
+ $form['aligner_start'] = array(
+ '#markup' => '
',
+ );
+
$form['title'] = array(
'#type' => 'textfield',
'#default_value' => $settings['title'],
'#title' => t('Title'),
+ '#id' => 'override-title-textfield',
+ );
+
+ $form['title_heading'] = array(
+ '#type' => 'select',
+ '#default_value' => isset($settings['title_heading']) ? $settings['title_heading'] : 'h2',
+ '#options' => array(
+ 'h1' => t('h1'),
+ 'h2' => t('h2'),
+ 'h3' => t('h3'),
+ 'h4' => t('h4'),
+ 'h5' => t('h5'),
+ 'h6' => t('h6'),
+ 'div' => t('div'),
+ 'span' => t('span'),
+ ),
+ '#id' => 'override-title-heading',
+ );
+
+ $form['aligner_stop'] = array(
+ '#markup' => '
',
);
$form['body'] = array(
diff --git a/sites/all/modules/contrib/dev/ctools/plugins/content_types/entity_context/entity_field.inc b/sites/all/modules/contrib/dev/ctools/plugins/content_types/entity_context/entity_field.inc
index 65367a02..a70a8d9e 100644
--- a/sites/all/modules/contrib/dev/ctools/plugins/content_types/entity_context/entity_field.inc
+++ b/sites/all/modules/contrib/dev/ctools/plugins/content_types/entity_context/entity_field.inc
@@ -137,25 +137,24 @@ function ctools_entity_field_content_type_render($subtype, $conf, $panel_args, $
$field_settings['settings'] = $conf['formatter_settings'];
}
- $all_values = field_get_items($entity_type, $entity, $field_name, $language);
- if (!is_array($all_values)) {
- // Do not render if the field is empty.
- return;
- }
-
- // Reverse values.
- if (isset($conf['delta_reversed']) && $conf['delta_reversed']) {
- $all_values = array_reverse($all_values, TRUE);
- }
-
- if (isset($conf['delta_limit'])) {
- $offset = intval($conf['delta_offset']);
- $limit = !empty($conf['delta_limit']) ? $conf['delta_limit'] : NULL;
- $all_values = array_slice($all_values, $offset, $limit, TRUE);
- }
-
$clone = clone $entity;
- $clone->{$field_name}[$language] = $all_values;
+ $all_values = field_get_items($entity_type, $entity, $field_name, $language);
+
+ if (is_array($all_values)) {
+ // Reverse values.
+ if (isset($conf['delta_reversed']) && $conf['delta_reversed']) {
+ $all_values = array_reverse($all_values, TRUE);
+ }
+
+ if (isset($conf['delta_limit'])) {
+ $offset = intval($conf['delta_offset']);
+ $limit = !empty($conf['delta_limit']) ? $conf['delta_limit'] : NULL;
+ $all_values = array_slice($all_values, $offset, $limit, TRUE);
+ }
+
+ $clone->{$field_name}[$language] = $all_values;
+ }
+
$field_output = field_view_field($entity_type, $clone, $field_name, $field_settings, $language);
if (!empty($field_output) && !empty($conf['override_title'])) {
@@ -270,10 +269,7 @@ function ctools_entity_field_content_type_admin_title($subtype, $conf, $context)
$identifier = $context->identifier;
}
else {
- $type = 'ctools_entity_field_content_type_admin_title';
- $message = t('Context is missing for field: @name', array('@name' => $subtype));
- $variables = array($subtype, $conf, $context);
- watchdog($type, $message, $variables, $severity = WATCHDOG_NOTICE);
+ watchdog('ctools_entity_field_content_type_admin_title', 'Context is missing for field: @name', array('@name' => $subtype), WATCHDOG_NOTICE);
$identifier = t('Unknown');
}
diff --git a/sites/all/modules/contrib/dev/ctools/plugins/content_types/node/node.inc b/sites/all/modules/contrib/dev/ctools/plugins/content_types/node/node.inc
index 7e77194c..c49a71a6 100644
--- a/sites/all/modules/contrib/dev/ctools/plugins/content_types/node/node.inc
+++ b/sites/all/modules/contrib/dev/ctools/plugins/content_types/node/node.inc
@@ -66,7 +66,7 @@ function ctools_node_content_type_render($subtype, $conf, $panel_args) {
// Don't store viewed node data on the node, this can mess up other
// views of the node.
- $node = clone($node);
+ $node = clone $node;
$block->module = 'node';
$block->delta = $node->nid;
diff --git a/sites/all/modules/contrib/dev/ctools/plugins/content_types/node_context/node_attachments.inc b/sites/all/modules/contrib/dev/ctools/plugins/content_types/node_context/node_attachments.inc
index 380e2604..7142584a 100644
--- a/sites/all/modules/contrib/dev/ctools/plugins/content_types/node_context/node_attachments.inc
+++ b/sites/all/modules/contrib/dev/ctools/plugins/content_types/node_context/node_attachments.inc
@@ -14,7 +14,7 @@ $plugin = array(
);
function ctools_node_attachments_content_type_render($subtype, $conf, $panel_args, $context) {
- $node = isset($context->data) ? clone($context->data) : NULL;
+ $node = isset($context->data) ? clone $context->data : NULL;
$block = new stdClass();
$block->module = 'attachments';
diff --git a/sites/all/modules/contrib/dev/ctools/plugins/content_types/node_context/node_book_children.inc b/sites/all/modules/contrib/dev/ctools/plugins/content_types/node_context/node_book_children.inc
index 5d017c5c..a44ae2ba 100644
--- a/sites/all/modules/contrib/dev/ctools/plugins/content_types/node_context/node_book_children.inc
+++ b/sites/all/modules/contrib/dev/ctools/plugins/content_types/node_context/node_book_children.inc
@@ -16,7 +16,7 @@ if (module_exists('book')) {
}
function ctools_node_book_children_content_type_render($subtype, $conf, $panel_args, $context) {
- $node = isset($context->data) ? clone($context->data) : NULL;
+ $node = isset($context->data) ? clone $context->data : NULL;
$block = new stdClass();
$block->module = 'book_children';
diff --git a/sites/all/modules/contrib/dev/ctools/plugins/content_types/node_context/node_book_nav.inc b/sites/all/modules/contrib/dev/ctools/plugins/content_types/node_context/node_book_nav.inc
index 6c0d50df..403db8d1 100644
--- a/sites/all/modules/contrib/dev/ctools/plugins/content_types/node_context/node_book_nav.inc
+++ b/sites/all/modules/contrib/dev/ctools/plugins/content_types/node_context/node_book_nav.inc
@@ -16,7 +16,7 @@ if (module_exists('book')) {
}
function ctools_node_book_nav_content_type_render($subtype, $conf, $panel_args, $context) {
- $node = isset($context->data) ? clone($context->data) : NULL;
+ $node = isset($context->data) ? clone $context->data : NULL;
$block = new stdClass();
$block->module = 'book_nav';
diff --git a/sites/all/modules/contrib/dev/ctools/plugins/content_types/node_context/node_comment_form.inc b/sites/all/modules/contrib/dev/ctools/plugins/content_types/node_context/node_comment_form.inc
index c21e7bc7..5558a64b 100644
--- a/sites/all/modules/contrib/dev/ctools/plugins/content_types/node_context/node_comment_form.inc
+++ b/sites/all/modules/contrib/dev/ctools/plugins/content_types/node_context/node_comment_form.inc
@@ -17,7 +17,7 @@ if (module_exists('comment')) {
}
function ctools_node_comment_form_content_type_render($subtype, $conf, $panel_args, $context) {
- $node = isset($context->data) ? clone($context->data) : NULL;
+ $node = isset($context->data) ? clone $context->data : NULL;
$block = new stdClass();
$block->module = 'comments';
$block->delta = $node->nid;
diff --git a/sites/all/modules/contrib/dev/ctools/plugins/content_types/node_context/node_comment_wrapper.inc b/sites/all/modules/contrib/dev/ctools/plugins/content_types/node_context/node_comment_wrapper.inc
index 8e25429f..657a9e75 100644
--- a/sites/all/modules/contrib/dev/ctools/plugins/content_types/node_context/node_comment_wrapper.inc
+++ b/sites/all/modules/contrib/dev/ctools/plugins/content_types/node_context/node_comment_wrapper.inc
@@ -23,7 +23,7 @@ if (module_exists('comment')) {
* Render the node comments.
*/
function ctools_node_comment_wrapper_content_type_render($subtype, $conf, $panel_args, $context) {
- $node = isset($context->data) ? clone($context->data) : NULL;
+ $node = isset($context->data) ? clone $context->data : NULL;
$block = new stdClass();
$block->module = 'comments';
$block->delta = $node->nid;
@@ -77,7 +77,7 @@ function ctools_node_comment_wrapper_content_type_render($subtype, $conf, $panel
/**
* Returns an edit form for the comment wrapper.
- */
+ */
function ctools_node_comment_wrapper_content_type_edit_form($form, &$form_state) {
$conf = $form_state['conf'];
$form['mode'] = array(
diff --git a/sites/all/modules/contrib/dev/ctools/plugins/content_types/node_context/node_comments.inc b/sites/all/modules/contrib/dev/ctools/plugins/content_types/node_context/node_comments.inc
index 0f0033d2..8c17dc00 100644
--- a/sites/all/modules/contrib/dev/ctools/plugins/content_types/node_context/node_comments.inc
+++ b/sites/all/modules/contrib/dev/ctools/plugins/content_types/node_context/node_comments.inc
@@ -20,7 +20,7 @@ if (module_exists('comment')) {
}
function ctools_node_comments_content_type_render($subtype, $conf, $panel_args, $context) {
- $node = isset($context->data) ? clone($context->data) : NULL;
+ $node = isset($context->data) ? clone $context->data : NULL;
$block = new stdClass();
$block->module = 'comments';
$block->delta = $node->nid;
diff --git a/sites/all/modules/contrib/dev/ctools/plugins/content_types/node_context/node_content.inc b/sites/all/modules/contrib/dev/ctools/plugins/content_types/node_context/node_content.inc
index 38c5b574..03bedc66 100644
--- a/sites/all/modules/contrib/dev/ctools/plugins/content_types/node_context/node_content.inc
+++ b/sites/all/modules/contrib/dev/ctools/plugins/content_types/node_context/node_content.inc
@@ -31,7 +31,7 @@ function ctools_node_content_content_type_render($subtype, $conf, $panel_args, $
return;
}
- $node = isset($context->data) ? clone($context->data) : NULL;
+ $node = isset($context->data) ? clone $context->data : NULL;
$block = new stdClass();
$block->module = 'node';
$block->delta = $node->nid;
diff --git a/sites/all/modules/contrib/dev/ctools/plugins/content_types/node_context/node_links.inc b/sites/all/modules/contrib/dev/ctools/plugins/content_types/node_context/node_links.inc
index 6096a44f..96d7a5a9 100644
--- a/sites/all/modules/contrib/dev/ctools/plugins/content_types/node_context/node_links.inc
+++ b/sites/all/modules/contrib/dev/ctools/plugins/content_types/node_context/node_links.inc
@@ -29,7 +29,7 @@ function ctools_node_links_content_type_render($subtype, $conf, $panel_args, $co
return;
}
- $node = isset($context->data) ? clone($context->data) : NULL;
+ $node = isset($context->data) ? clone $context->data : NULL;
$block = new stdClass();
$block->module = 'node';
$block->delta = $node->nid;
diff --git a/sites/all/modules/contrib/dev/ctools/plugins/content_types/node_context/node_type_desc.inc b/sites/all/modules/contrib/dev/ctools/plugins/content_types/node_context/node_type_desc.inc
index f2005d08..b432c55a 100644
--- a/sites/all/modules/contrib/dev/ctools/plugins/content_types/node_context/node_type_desc.inc
+++ b/sites/all/modules/contrib/dev/ctools/plugins/content_types/node_context/node_type_desc.inc
@@ -18,7 +18,7 @@ $plugin = array(
* based on the module and delta supplied in the configuration.
*/
function ctools_node_type_desc_content_type_render($subtype, $conf, $panel_args, $context) {
- $node = isset($context->data) ? clone($context->data) : NULL;
+ $node = isset($context->data) ? clone $context->data : NULL;
$block = new stdClass();
$block->module = 'node_type';
diff --git a/sites/all/modules/contrib/dev/ctools/plugins/content_types/term_context/term_description.inc b/sites/all/modules/contrib/dev/ctools/plugins/content_types/term_context/term_description.inc
index f95c4f54..b1a231c1 100644
--- a/sites/all/modules/contrib/dev/ctools/plugins/content_types/term_context/term_description.inc
+++ b/sites/all/modules/contrib/dev/ctools/plugins/content_types/term_context/term_description.inc
@@ -14,7 +14,7 @@ $plugin = array(
);
function ctools_term_description_content_type_render($subtype, $conf, $panel_args, $context) {
- $term = isset($context->data) ? clone($context->data) : NULL;
+ $term = isset($context->data) ? clone $context->data : NULL;
$block = new stdClass();
$block->module = 'node_type';
diff --git a/sites/all/modules/contrib/dev/ctools/plugins/content_types/term_context/term_list.inc b/sites/all/modules/contrib/dev/ctools/plugins/content_types/term_context/term_list.inc
index 7c609fb4..b76ca1c9 100644
--- a/sites/all/modules/contrib/dev/ctools/plugins/content_types/term_context/term_list.inc
+++ b/sites/all/modules/contrib/dev/ctools/plugins/content_types/term_context/term_list.inc
@@ -21,7 +21,7 @@ $plugin = array(
);
function ctools_term_list_content_type_render($subtype, $conf, $panel_args, $context) {
- $term = isset($context->data) ? clone($context->data) : NULL;
+ $term = isset($context->data) ? clone $context->data : NULL;
$block = new stdClass();
$block->module = 'term-list';
$path = empty($conf['path']) ? 'taxonomy/term/%tid' : $conf['path'];
diff --git a/sites/all/modules/contrib/dev/ctools/plugins/content_types/user_context/profile_fields.inc b/sites/all/modules/contrib/dev/ctools/plugins/content_types/user_context/profile_fields.inc
index 55d5593d..1132bb73 100644
--- a/sites/all/modules/contrib/dev/ctools/plugins/content_types/user_context/profile_fields.inc
+++ b/sites/all/modules/contrib/dev/ctools/plugins/content_types/user_context/profile_fields.inc
@@ -21,7 +21,7 @@ if (module_exists('profile') && !(defined('MAINTENANCE_MODE') && MAINTENANCE_MOD
* 'Render' callback for the 'profile fields' content type.
*/
function ctools_profile_fields_content_type_render($subtype, $conf, $panel_args, $context) {
- $account = isset($context->data) ? clone($context->data) : NULL;
+ $account = isset($context->data) ? clone $context->data : NULL;
$block = new stdClass();
$block->module = 'profile fields';
diff --git a/sites/all/modules/contrib/dev/ctools/plugins/content_types/user_context/user_profile.inc b/sites/all/modules/contrib/dev/ctools/plugins/content_types/user_context/user_profile.inc
index 6c41882f..ad8e1e0a 100644
--- a/sites/all/modules/contrib/dev/ctools/plugins/content_types/user_context/user_profile.inc
+++ b/sites/all/modules/contrib/dev/ctools/plugins/content_types/user_context/user_profile.inc
@@ -20,7 +20,7 @@ $plugin = array(
* Render the user profile content type.
*/
function ctools_user_profile_content_type_render($subtype, $conf, $panel_args, $context) {
- $account = isset($context->data) ? clone($context->data) : NULL;
+ $account = isset($context->data) ? clone $context->data : NULL;
if (!$account) {
return NULL;
}
diff --git a/sites/all/modules/contrib/dev/ctools/plugins/content_types/user_context/user_signature.inc b/sites/all/modules/contrib/dev/ctools/plugins/content_types/user_context/user_signature.inc
index ca7550b2..accb58e4 100644
--- a/sites/all/modules/contrib/dev/ctools/plugins/content_types/user_context/user_signature.inc
+++ b/sites/all/modules/contrib/dev/ctools/plugins/content_types/user_context/user_signature.inc
@@ -13,7 +13,7 @@ $plugin = array(
);
function ctools_user_signature_content_type_render($subtype, $conf, $panel_args, $context) {
- $account = isset($context->data) ? clone($context->data) : NULL;
+ $account = isset($context->data) ? clone $context->data : NULL;
$block = new stdClass();
$block->module = 'user-signature';
diff --git a/sites/all/modules/contrib/dev/ctools/plugins/content_types/vocabulary_context/vocabulary_terms.inc b/sites/all/modules/contrib/dev/ctools/plugins/content_types/vocabulary_context/vocabulary_terms.inc
index 5f33a038..171eddd8 100644
--- a/sites/all/modules/contrib/dev/ctools/plugins/content_types/vocabulary_context/vocabulary_terms.inc
+++ b/sites/all/modules/contrib/dev/ctools/plugins/content_types/vocabulary_context/vocabulary_terms.inc
@@ -21,7 +21,7 @@ if (module_exists('taxonomy')) {
* list of terms for the input vocabulary.
*/
function ctools_vocabulary_terms_content_type_render($subtype, $conf, $panel_args, $context) {
- $vocab = isset($context->data) ? clone($context->data) : NULL;
+ $vocab = isset($context->data) ? clone $context->data : NULL;
$max_depth = (!empty($conf['max_depth']) ? (int)$conf['max_depth'] : NULL);
if ($conf['tree'] == FALSE) {
$terms = taxonomy_get_tree($vocab->vid, 0, $max_depth);
diff --git a/sites/all/modules/contrib/dev/ctools/plugins/contexts/query_string.inc b/sites/all/modules/contrib/dev/ctools/plugins/contexts/query_string.inc
new file mode 100644
index 00000000..e77c55fb
--- /dev/null
+++ b/sites/all/modules/contrib/dev/ctools/plugins/contexts/query_string.inc
@@ -0,0 +1,89 @@
+ t('Query string value'),
+ 'description' => t('A context that extracts a value from the query string.'),
+ 'context' => 'ctools_context_query_string_create_query_string',
+ 'context name' => 'query_string',
+ 'keyword' => 'query_string',
+ 'edit form' => 'ctools_context_query_string_settings_form',
+ 'convert list' => array(
+ 'raw' => t('Raw string'),
+ 'html_safe' => t('HTML-safe string'),
+ ),
+ 'convert' => 'ctools_context_query_string_convert',
+);
+
+/**
+ * Create a context from manual configuration.
+ */
+function ctools_context_query_string_create_query_string($empty, $data = NULL, $conf = FALSE) {
+ $context = new ctools_context('query_string');
+ $context->plugin = 'query_string';
+
+ if ($empty) {
+ return $context;
+ }
+
+ if ($conf) {
+ if (!empty($_GET[$data['key']])) {
+ $context->data = $_GET[$data['key']];
+ }
+ else {
+ $context->data = $data['fallback_value'];
+ }
+ }
+ return $context;
+}
+
+/**
+ * Form builder; settings for the context.
+ */
+function ctools_context_query_string_settings_form($form, &$form_state) {
+ $form['key'] = array(
+ '#title' => t('Query string key'),
+ '#description' => t('Enter the key of the value that must be returned from the query string.'),
+ '#type' => 'textfield',
+ '#required' => TRUE
+ );
+ if (isset($form_state['conf']['key'])) {
+ $form['key']['#default_value'] = $form_state['conf']['key'];
+ }
+ $form['fallback_value'] = array(
+ '#title' => t('Fallback value'),
+ '#description' => t('Enter a value that must be returned if the above specified key does not exist in the query string.'),
+ '#type' => 'textfield',
+ );
+ if (!empty($form_state['conf']['fallback_value'])) {
+ $form['fallback_value']['#default_value'] = $form_state['conf']['fallback_value'];
+ }
+ return $form;
+}
+
+/**
+ * Submit handler; settings form for the context.
+ */
+function ctools_context_query_string_settings_form_submit($form, &$form_state) {
+ $form_state['conf']['key'] = $form_state['values']['key'];
+ $form_state['conf']['fallback_value'] = $form_state['values']['fallback_value'];
+}
+
+/**
+ * Convert a context into a string.
+ */
+function ctools_context_query_string_convert($context, $type) {
+ switch ($type) {
+ case 'raw':
+ return $context->data;
+ case 'html_safe':
+ return check_plain($context->data);
+ }
+}
diff --git a/sites/all/modules/contrib/dev/ctools/plugins/relationships/entity_from_field.inc b/sites/all/modules/contrib/dev/ctools/plugins/relationships/entity_from_field.inc
index fdffc41c..a7f65919 100644
--- a/sites/all/modules/contrib/dev/ctools/plugins/relationships/entity_from_field.inc
+++ b/sites/all/modules/contrib/dev/ctools/plugins/relationships/entity_from_field.inc
@@ -185,7 +185,7 @@ function ctools_entity_from_field_context($context, $conf) {
$loaded_to_entity = array_shift($loaded_to_entity);
// Pass current user account and entity type to access callback.
- if (isset($to_entity_info['access callback']) && function_exists($to_entity_info['access callback']) && !call_user_func($to_entity_info['access callback'], 'view', $loaded_to_entity)) {
+ if (isset($to_entity_info['access callback']) && function_exists($to_entity_info['access callback']) && !call_user_func($to_entity_info['access callback'], 'view', $loaded_to_entity, $account, $to_entity)) {
return ctools_context_create_empty('entity:' . $to_entity, NULL);
}
else {
diff --git a/sites/all/modules/contrib/dev/ctools/plugins/relationships/entity_from_query_string.inc b/sites/all/modules/contrib/dev/ctools/plugins/relationships/entity_from_query_string.inc
new file mode 100644
index 00000000..8be3ceb3
--- /dev/null
+++ b/sites/all/modules/contrib/dev/ctools/plugins/relationships/entity_from_query_string.inc
@@ -0,0 +1,70 @@
+ t('Entity from query string'),
+ 'keyword' => 'query_string_entity',
+ 'description' => t('Entity from query string.'),
+ 'required context' => new ctools_context_required(t('Query string'), 'query_string'),
+ 'context' => 'ctools_entity_from_query_string_context',
+ 'edit form' => 'ctools_entity_from_query_string_settings_form',
+);
+
+/**
+ * Return a new context based on an existing context.
+ */
+function ctools_entity_from_query_string_context($context, $conf) {
+ $entity_type = $conf['entity_type'];
+
+ // If unset it wants a generic, unfilled context, which is just NULL.
+ if (empty($context->data) || !isset($context->data) || !is_numeric($context->data)) {
+ return ctools_context_create_empty('entity:' . $entity_type, NULL);
+ }
+
+ if (!empty($context->data) && is_numeric($context->data)) {
+ // Load the entity from the query string value.
+ $entity_id = $context->data;
+ $entity = entity_load_single($entity_type, $entity_id);
+
+ // Send it to ctools.
+ return ctools_context_create('entity:' . $entity_type, $entity);
+ }
+}
+
+/**
+ * Settings form for the relationship.
+ */
+function ctools_entity_from_query_string_settings_form($form, &$form_state) {
+
+ //Get all avalible enity types
+ foreach (entity_get_info() as $key => $value) {
+ $entity_types[$key] = $value['label'];
+ }
+
+ $form['entity_type'] = array(
+ '#title' => t('Entity type'),
+ '#description' => t('Choose entity type to load from query value'),
+ '#type' => 'select',
+ '#options' => $entity_types,
+ );
+ if (isset($form_state['conf']['entity_type'])) {
+ $form['entity_type']['#default_value'] = $form_state['conf']['entity_type'];
+ }
+
+ return $form;
+}
+
+/**
+ * Submit handler; settings form for the context.
+ */
+function ctools_entity_from_query_string_settings_form_submit($form, &$form_state) {
+ $form_state['conf']['entity_type'] = $form_state['values']['entity_type'];
+}
diff --git a/sites/all/modules/contrib/dev/ctools/plugins/relationships/user_category_edit_form_from_user.inc b/sites/all/modules/contrib/dev/ctools/plugins/relationships/user_category_edit_form_from_user.inc
index 28dac72c..44b56b9d 100644
--- a/sites/all/modules/contrib/dev/ctools/plugins/relationships/user_category_edit_form_from_user.inc
+++ b/sites/all/modules/contrib/dev/ctools/plugins/relationships/user_category_edit_form_from_user.inc
@@ -15,6 +15,8 @@ $plugin = array(
'description' => t('Adds user category edit form from a user context.'),
'required context' => new ctools_context_required(t('User'), 'user'),
'context' => 'ctools_user_category_edit_form_from_user_context',
+ 'edit form' => 'ctools_user_category_edit_form_from_user_settings_form',
+ 'defaults' => array('category' => NULL),
);
/**
@@ -25,7 +27,35 @@ function ctools_user_category_edit_form_from_user_context($context, $conf) {
return ctools_context_create_empty('user_edit_form', NULL);
}
+ if(!empty($conf['category'])) {
+ return ctools_context_create('user_edit_form', $context->data, array('category' => $conf['category']));
+ }
+
if (isset($context->data->user_category)) {
return ctools_context_create('user_edit_form', $context->data, array('category' => $context->data->user_category));
}
+
+ return ctools_context_create('user_edit_form', $context->data);
+}
+
+/**
+ * Settings form for the relationship.
+ */
+function ctools_user_category_edit_form_from_user_settings_form($form, &$form_state) {
+ $conf = $form_state['conf'];
+
+ $categories = _user_categories();
+ $options = array();
+ foreach($categories as $category) {
+ $options[$category['name']] = $category['title'];
+ }
+ $form['category'] = array(
+ '#type' => 'select',
+ '#title' => t('Category'),
+ '#options' => $options,
+ '#default_value' => isset($conf['category']) ? $conf['category'] : NULL,
+ '#empty_option' => 'Default',
+ );
+
+ return $form;
}
diff --git a/sites/all/modules/contrib/dev/ctools/stylizer/stylizer.info b/sites/all/modules/contrib/dev/ctools/stylizer/stylizer.info
index 9e9890ff..66957648 100644
--- a/sites/all/modules/contrib/dev/ctools/stylizer/stylizer.info
+++ b/sites/all/modules/contrib/dev/ctools/stylizer/stylizer.info
@@ -6,9 +6,9 @@ version = CTOOLS_MODULE_VERSION
dependencies[] = ctools
dependencies[] = color
-; Information added by Drupal.org packaging script on 2015-08-19
-version = "7.x-1.9"
+; Information added by Drupal.org packaging script on 2016-10-16
+version = "7.x-1.11"
core = "7.x"
project = "ctools"
-datestamp = "1440020680"
+datestamp = "1476581654"
diff --git a/sites/all/modules/contrib/dev/ctools/term_depth/plugins/access/term_depth.inc b/sites/all/modules/contrib/dev/ctools/term_depth/plugins/access/term_depth.inc
index ab05b609..7f714afa 100644
--- a/sites/all/modules/contrib/dev/ctools/term_depth/plugins/access/term_depth.inc
+++ b/sites/all/modules/contrib/dev/ctools/term_depth/plugins/access/term_depth.inc
@@ -25,28 +25,22 @@ $plugin = array(
* Settings form for the 'term depth' access plugin.
*/
function term_depth_term_depth_ctools_access_settings($form, &$form_state, $conf) {
- // If no configuration was saved before, set some defaults.
- if (empty($conf)) {
- $conf = array(
- 'vid' => 0,
- );
- }
- if (!isset($conf['vid'])) {
- $conf['vid'] = 0;
- }
-
+ $vocabularies = taxonomy_get_vocabularies();
+ $options = array();
// Loop over each of the configured vocabularies.
- foreach (taxonomy_get_vocabularies() as $vid => $vocabulary) {
- $options[$vid] = $vocabulary->name;
+ foreach ($vocabularies as $vid => $vocab) {
+ $options[$vocab->machine_name] = $vocab->name;
}
- $form['settings']['vid'] = array(
+ _term_depth_convert_config_vid_to_vocabulary_name($conf);
+
+ $form['settings']['vocabulary'] = array(
'#title' => t('Vocabulary'),
'#type' => 'select',
'#options' => $options,
'#description' => t('Select the vocabulary for this form. If there exists a parent term in that vocabulary, this access check will succeed.'),
- '#id' => 'ctools-select-vid',
- '#default_value' => $conf['vid'],
+ '#id' => 'ctools-select-vocabulary',
+ '#default_value' => !empty($conf['vocabulary']) ? $conf['vocabulary'] : array(),
'#required' => TRUE,
);
@@ -61,15 +55,24 @@ function term_depth_term_depth_ctools_access_settings($form, &$form_state, $conf
return $form;
}
+/**
+ * @param $conf
+ */
+function _term_depth_convert_config_vid_to_vocabulary_name(&$conf) {
+ // Fallback on legacy 'vid', when no vocabularies are available.
+ if (empty($conf['vocabulary']) && !empty($conf['vid'])) {
+ $conf['vocabulary'] = reset(_ctools_term_vocabulary_machine_name_convert(array($conf['vid'])));
+ unset($conf['vid']);
+ }
+}
+
/**
* Submit function for the access plugins settings.
*
- * We cast all settings to numbers to ensure they can be safely handled.
*/
function term_depth_term_depth_ctools_access_settings_submit($form, $form_state) {
- foreach (array('depth', 'vid') as $key) {
- $form_state['conf'][$key] = (integer) $form_state['values']['settings'][$key];
- }
+ $form_state['conf']['depth'] = (integer) $form_state['values']['settings']['depth'];
+ $form_state['conf']['vocabulary'] = array_filter($form_state['conf']['vocabulary']);
}
/**
@@ -82,10 +85,17 @@ function term_depth_term_depth_ctools_access_check($conf, $context) {
return FALSE;
}
- // Get the $vid.
- if (!isset($conf['vid'])) {
+ _term_depth_convert_config_vid_to_vocabulary_name($conf);
+
+ // Get the $vocabulary.
+ if (!isset($conf['vocabulary'])) {
return FALSE;
}
+ $vocab = taxonomy_vocabulary_machine_name_load($conf['vocabulary']);
+ if ($vocab->vid != $context->data->vid) {
+ return FALSE;
+ }
+
$depth = _term_depth($context->data->tid);
return ($depth == $conf['depth']);
@@ -95,9 +105,9 @@ function term_depth_term_depth_ctools_access_check($conf, $context) {
* Provide a summary description based upon the checked terms.
*/
function term_depth_term_depth_ctools_access_summary($conf, $context) {
- $vocab = taxonomy_vocabulary_load($conf['vid']);
-
- return t('"@term" has parent in vocabulary "@vocab" at @depth', array(
+ _term_depth_convert_config_vid_to_vocabulary_name($conf);
+ $vocab = taxonomy_vocabulary_machine_name_load($conf['vocabulary']);
+ return t('"@term" is in vocabulary "@vocab" at depth @depth', array(
'@term' => $context->identifier,
'@vocab' => $vocab->name,
'@depth' => $conf['depth'],
diff --git a/sites/all/modules/contrib/dev/ctools/term_depth/term_depth.info b/sites/all/modules/contrib/dev/ctools/term_depth/term_depth.info
index d6fa37fb..91701667 100644
--- a/sites/all/modules/contrib/dev/ctools/term_depth/term_depth.info
+++ b/sites/all/modules/contrib/dev/ctools/term_depth/term_depth.info
@@ -5,9 +5,9 @@ dependencies[] = ctools
package = Chaos tool suite
version = CTOOLS_MODULE_VERSION
-; Information added by Drupal.org packaging script on 2015-08-19
-version = "7.x-1.9"
+; Information added by Drupal.org packaging script on 2016-10-16
+version = "7.x-1.11"
core = "7.x"
project = "ctools"
-datestamp = "1440020680"
+datestamp = "1476581654"
diff --git a/sites/all/modules/contrib/dev/ctools/tests/ctools_export_test/ctools_export_test.info b/sites/all/modules/contrib/dev/ctools/tests/ctools_export_test/ctools_export_test.info
index e016aeb5..f2d96edc 100644
--- a/sites/all/modules/contrib/dev/ctools/tests/ctools_export_test/ctools_export_test.info
+++ b/sites/all/modules/contrib/dev/ctools/tests/ctools_export_test/ctools_export_test.info
@@ -8,9 +8,9 @@ hidden = TRUE
files[] = ctools_export.test
-; Information added by Drupal.org packaging script on 2015-08-19
-version = "7.x-1.9"
+; Information added by Drupal.org packaging script on 2016-10-16
+version = "7.x-1.11"
core = "7.x"
project = "ctools"
-datestamp = "1440020680"
+datestamp = "1476581654"
diff --git a/sites/all/modules/contrib/dev/ctools/tests/ctools_plugin_test.info b/sites/all/modules/contrib/dev/ctools/tests/ctools_plugin_test.info
index 15a510b6..bd906122 100644
--- a/sites/all/modules/contrib/dev/ctools/tests/ctools_plugin_test.info
+++ b/sites/all/modules/contrib/dev/ctools/tests/ctools_plugin_test.info
@@ -12,9 +12,9 @@ files[] = math_expression.test
files[] = math_expression_stack.test
hidden = TRUE
-; Information added by Drupal.org packaging script on 2015-08-19
-version = "7.x-1.9"
+; Information added by Drupal.org packaging script on 2016-10-16
+version = "7.x-1.11"
core = "7.x"
project = "ctools"
-datestamp = "1440020680"
+datestamp = "1476581654"
diff --git a/sites/all/modules/contrib/dev/ctools/views_content/plugins/content_types/views_panes.inc b/sites/all/modules/contrib/dev/ctools/views_content/plugins/content_types/views_panes.inc
index e4dded23..1147d26c 100644
--- a/sites/all/modules/contrib/dev/ctools/views_content/plugins/content_types/views_panes.inc
+++ b/sites/all/modules/contrib/dev/ctools/views_content/plugins/content_types/views_panes.inc
@@ -143,68 +143,11 @@ function views_content_views_panes_content_type_render($subtype, $conf, $panel_a
return;
}
+ $conf['pane_contexts'] = $contexts;
+ $conf['panel_args'] = $panel_args;
$view->display_handler->set_pane_conf($conf);
- $args = array();
- $arguments = $view->display_handler->get_option('arguments');
-
- $context_keys = isset($conf['context']) ? $conf['context'] : array();
- foreach ($view->display_handler->get_argument_input() as $id => $argument) {
- switch ($argument['type']) {
- case 'context':
- $key = array_shift($context_keys);
- if (isset($contexts[$key])) {
- if (strpos($argument['context'], '.')) {
- list($context, $converter) = explode('.', $argument['context'], 2);
- $args[] = ctools_context_convert_context($contexts[$key], $converter, array('sanitize' => FALSE));
- }
- else {
- $args[] = $contexts[$key]->argument;
- }
- }
- else {
- $args[] = isset($arguments[$id]['exception']['value']) ? $arguments[$id]['exception']['value'] : 'all';
- }
- break;
-
- case 'fixed':
- $args[] = $argument['fixed'];
- break;
-
- case 'panel':
- $args[] = isset($panel_args[$argument['panel']]) ? $panel_args[$argument['panel']] : NULL;
- break;
-
- case 'user':
- $args[] = (isset($conf['arguments'][$id]) && $conf['arguments'][$id] !== '') ? ctools_context_keyword_substitute($conf['arguments'][$id], array(), $contexts) : NULL;
- break;
-
- case 'wildcard':
- // Put in the wildcard.
- $args[] = isset($arguments[$id]['wildcard']) ? $arguments[$id]['wildcard'] : '*';
- break;
-
- case 'none':
- default:
- // Put in NULL.
- // views.module knows what to do with NULL (or missing) arguments
- $args[] = NULL;
- break;
- }
- }
-
- // remove any trailing NULL arguments as these are non-args:
- while (count($args) && end($args) === NULL) {
- array_pop($args);
- }
-
- $view->set_arguments($args);
-
$allow = $view->display_handler->get_option('allow');
-
- if (!empty($conf['path'])) {
- $conf['path'] = ctools_context_keyword_substitute($conf['path'], array(), $contexts);
- }
if ($allow['path_override'] && !empty($conf['path'])) {
$view->override_path = $conf['path'];
}
@@ -221,67 +164,6 @@ function views_content_views_panes_content_type_render($subtype, $conf, $panel_a
$block->title_link = $view->get_url();
}
- // more link
- if ($allow['more_link']) {
- if (empty($conf['more_link'])) {
- $view->display_handler->set_option('use_more', FALSE);
- }
- else {
- $view->display_handler->set_option('use_more', TRUE);
- // make sure the view runs the count query so we know whether or not the
- // more link applies.
- $view->get_total_rows = TRUE;
- }
- }
-
- if ($allow['items_per_page'] && isset($conf['items_per_page'])) {
- $view->set_items_per_page($conf['items_per_page']);
- }
-
- if ($allow['offset']) {
- $view->set_offset($conf['offset']);
- }
-
- if ($allow['use_pager']) {
- // Only set use_pager if they differ, this way we can avoid overwriting the
- // pager type that Views uses.
- $pager = $view->display_handler->get_option('pager');
- if ($conf['use_pager'] && ($pager['type'] == 'none' || $pager['type'] == 'some')) {
- $pager['type'] = 'full';
- }
- elseif (!$conf['use_pager'] && $pager['type'] != 'none' && $pager['type'] != 'some') {
- $pager['type'] = $view->get_items_per_page() || !empty($pager['options']['items_per_page']) ? 'some' : 'none';
- }
-
- if ($conf['use_pager']) {
- if (!isset($pager['options']['id']) || (isset($conf['pager_id']) && $pager['options']['id'] != $conf['pager_id'])) {
- $pager['options']['id'] = (int) $conf['pager_id'];
- }
- }
-
- $view->display_handler->set_option('pager', $pager);
- }
-
- if ($allow['fields_override']) {
- if ($conf['fields_override']) {
- $fields = $view->get_items('field');
- foreach ($fields as $field => $field_display) {
- $fields[$field]['exclude'] = empty($conf['fields_override'][$field]);
- }
- $view->display_handler->set_option('fields', $fields);
-
- }
- }
-
- if ($allow['exposed_form'] && !empty($conf['exposed'])) {
- foreach ($conf['exposed'] as $filter_name => $filter_value) {
- if (!is_array($filter_value)) {
- $conf['exposed'][$filter_name] = ctools_context_keyword_substitute($filter_value, array(), $contexts);
- }
- }
- $view->set_exposed_input($conf['exposed']);
- }
-
$stored_feeds = drupal_add_feed();
$block->content = $view->preview();
@@ -321,6 +203,10 @@ function views_content_views_panes_content_type_render($subtype, $conf, $panel_a
function views_content_views_panes_add_defaults(&$conf, $view) {
$pager = $view->display_handler->get_option('pager');
+ if (empty($conf)) {
+ $conf = array();
+ }
+
$conf += array(
'link_to_view' => $view->display_handler->get_option('link_to_view'),
'more_link' => $view->display_handler->get_option('use_more'),
diff --git a/sites/all/modules/contrib/dev/ctools/views_content/plugins/views/views_content.views.inc b/sites/all/modules/contrib/dev/ctools/views_content/plugins/views/views_content.views.inc
index 644ac547..186ef4f7 100644
--- a/sites/all/modules/contrib/dev/ctools/views_content/plugins/views/views_content.views.inc
+++ b/sites/all/modules/contrib/dev/ctools/views_content/plugins/views/views_content.views.inc
@@ -25,7 +25,7 @@ function views_content_views_plugins() {
'use more' => TRUE,
'accept attachments' => TRUE,
'help topic' => 'display-pane',
- 'contextual links locations' => array('panel_pane'),
+ 'contextual links locations' => array('panel_pane', 'view'),
),
'ctools_context' => array(
'title' => t('Context'),
diff --git a/sites/all/modules/contrib/dev/ctools/views_content/plugins/views/views_content_plugin_display_panel_pane.inc b/sites/all/modules/contrib/dev/ctools/views_content/plugins/views/views_content_plugin_display_panel_pane.inc
index e02f896a..bfc77e03 100644
--- a/sites/all/modules/contrib/dev/ctools/views_content/plugins/views/views_content_plugin_display_panel_pane.inc
+++ b/sites/all/modules/contrib/dev/ctools/views_content/plugins/views/views_content_plugin_display_panel_pane.inc
@@ -48,8 +48,12 @@ class views_content_plugin_display_panel_pane extends views_plugin_display {
return isset($this->has_pane_conf);
}
- function set_pane_conf($conf = array()) {
+ function set_pane_conf($conf = array(), $set_cache = TRUE) {
$this->set_option('pane_conf', $conf);
+ $this->view->dom_id = !empty($this->view->dom_id) ? $this->view->dom_id : md5($this->view->name . REQUEST_TIME . rand());
+ if ($set_cache) {
+ cache_set('view_panel_pane_' . $this->view->dom_id, $conf);
+ }
$this->has_pane_conf = TRUE;
}
@@ -412,5 +416,153 @@ class views_content_plugin_display_panel_pane extends views_plugin_display {
return empty($conf['exposed_form']);
}
+ /**
+ * Set the pane configuration options
+ * Done here in handler for reuse between views_content_views_panes_content_type_render
+ * and views_content_views_pre_view
+ */
+ function pane_process_conf() {
+ ctools_include('context');
+ $conf = $this->get_option('pane_conf');
+ if (!$conf) {
+ // See if dom id has been cached and get conf from there.
+ if (!empty($this->view->dom_id) && ($cache = cache_get('view_panel_pane_' . $this->view->dom_id))) {
+ $conf = $cache->data;
+ }
+ if (!$conf) {
+ return;
+ }
+ $this->set_pane_conf($conf);
+ }
+ $contexts = $conf['pane_contexts'];
+ $panel_args = $conf['panel_args'];
+ $args = array();
+ $arguments = $this->get_option('arguments');
+
+ $context_keys = isset($conf['context']) ? $conf['context'] : array();
+ foreach ($this->get_argument_input() as $id => $argument) {
+ switch ($argument['type']) {
+ case 'context':
+ $key = array_shift($context_keys);
+ if (isset($contexts[$key])) {
+ if (strpos($argument['context'], '.')) {
+ list($context, $converter) = explode('.', $argument['context'], 2);
+ $args[] = ctools_context_convert_context($contexts[$key], $converter, array('sanitize' => FALSE));
+ }
+ else {
+ $args[] = $contexts[$key]->argument;
+ }
+ }
+ else {
+ $args[] = isset($arguments[$id]['exception']['value']) ? $arguments[$id]['exception']['value'] : 'all';
+ }
+ break;
+
+ case 'fixed':
+ $args[] = $argument['fixed'];
+ break;
+
+ case 'panel':
+ $args[] = isset($panel_args[$argument['panel']]) ? $panel_args[$argument['panel']] : NULL;
+ break;
+
+ case 'user':
+ $args[] = (isset($conf['arguments'][$id]) && $conf['arguments'][$id] !== '') ? ctools_context_keyword_substitute($conf['arguments'][$id], array(), $contexts) : NULL;
+ break;
+
+ case 'wildcard':
+ // Put in the wildcard.
+ $args[] = isset($arguments[$id]['wildcard']) ? $arguments[$id]['wildcard'] : '*';
+ break;
+
+ case 'none':
+ default:
+ // Put in NULL.
+ // views.module knows what to do with NULL (or missing) arguments
+ $args[] = NULL;
+ break;
+ }
+ }
+
+ // remove any trailing NULL arguments as these are non-args:
+ while (count($args) && end($args) === NULL) {
+ array_pop($args);
+ }
+
+ $this->view->set_arguments($args);
+ $allow = $this->get_option('allow');
+
+ if (!empty($conf['path'])) {
+ $conf['path'] = ctools_context_keyword_substitute($conf['path'], array(), $contexts);
+ }
+ if ($allow['path_override'] && !empty($conf['path'])) {
+ $this->view->override_path = $conf['path'];
+ }
+ else if ($path = $this->get_option('inherit_panels_path')) {
+ $this->view->override_path = $_GET['q'];
+ }
+
+ // more link
+ if ($allow['more_link']) {
+ if (empty($conf['more_link'])) {
+ $this->set_option('use_more', FALSE);
+ }
+ else {
+ $this->set_option('use_more', TRUE);
+ // make sure the view runs the count query so we know whether or not the
+ // more link applies.
+ $this->view->get_total_rows = TRUE;
+ }
+ }
+
+ if ($allow['items_per_page'] && isset($conf['items_per_page'])) {
+ $this->view->set_items_per_page($conf['items_per_page']);
+ }
+
+ if ($allow['offset']) {
+ $this->view->set_offset($conf['offset']);
+ }
+
+ if ($allow['use_pager']) {
+ // Only set use_pager if they differ, this way we can avoid overwriting the
+ // pager type that Views uses.
+ $pager = $this->get_option('pager');
+ if ($conf['use_pager'] && ($pager['type'] == 'none' || $pager['type'] == 'some')) {
+ $pager['type'] = 'full';
+ }
+ elseif (!$conf['use_pager'] && $pager['type'] != 'none' && $pager['type'] != 'some') {
+ $pager['type'] = $this->view->get_items_per_page() || !empty($pager['options']['items_per_page']) ? 'some' : 'none';
+ }
+
+ if ($conf['use_pager']) {
+ if (!isset($pager['options']['id']) || (isset($conf['pager_id']) && $pager['options']['id'] != $conf['pager_id'])) {
+ $pager['options']['id'] = (int) $conf['pager_id'];
+ }
+ }
+
+ $this->set_option('pager', $pager);
+ }
+
+ if ($allow['fields_override']) {
+ if ($conf['fields_override']) {
+ $fields = $this->view->get_items('field');
+ foreach ($fields as $field => $field_display) {
+ $fields[$field]['exclude'] = empty($conf['fields_override'][$field]);
+ }
+ $this->set_option('fields', $fields);
+
+ }
+ }
+
+ if ($allow['exposed_form'] && !empty($conf['exposed'])) {
+ foreach ($conf['exposed'] as $filter_name => $filter_value) {
+ if (!is_array($filter_value)) {
+ $conf['exposed'][$filter_name] = ctools_context_keyword_substitute($filter_value, array(), $contexts);
+ }
+ }
+ $this->view->set_exposed_input($conf['exposed']);
+ }
+ }
+
}
diff --git a/sites/all/modules/contrib/dev/ctools/views_content/views_content.info b/sites/all/modules/contrib/dev/ctools/views_content/views_content.info
index 6e284018..84e2ae55 100644
--- a/sites/all/modules/contrib/dev/ctools/views_content/views_content.info
+++ b/sites/all/modules/contrib/dev/ctools/views_content/views_content.info
@@ -10,9 +10,9 @@ files[] = plugins/views/views_content_plugin_display_ctools_context.inc
files[] = plugins/views/views_content_plugin_display_panel_pane.inc
files[] = plugins/views/views_content_plugin_style_ctools_context.inc
-; Information added by Drupal.org packaging script on 2015-08-19
-version = "7.x-1.9"
+; Information added by Drupal.org packaging script on 2016-10-16
+version = "7.x-1.11"
core = "7.x"
project = "ctools"
-datestamp = "1440020680"
+datestamp = "1476581654"
diff --git a/sites/all/modules/contrib/dev/ctools/views_content/views_content.module b/sites/all/modules/contrib/dev/ctools/views_content/views_content.module
index 27a666ae..8d231464 100644
--- a/sites/all/modules/contrib/dev/ctools/views_content/views_content.module
+++ b/sites/all/modules/contrib/dev/ctools/views_content/views_content.module
@@ -295,3 +295,24 @@ function views_content_get_pane_links_alter(&$links, $pane, $content_type) {
);
}
}
+
+/**
+ * Implements hook_module_implements_alter()
+ */
+function views_content_module_implements_alter(&$implementations, $hook) {
+ if ($hook == 'views_pre_view') {
+ $group = $implementations['views_content'];
+ unset($implementations['views_content']);
+ $implementations = array('views_content' => $group) + $implementations;
+ }
+}
+
+/**
+ * Implements hook_views_pre_view()
+ */
+function views_content_views_pre_view(&$view) {
+ if (method_exists($view->display_handler, 'pane_process_conf')) {
+ // process the pane configuration to prevent loss when using ajax
+ $view->display_handler->pane_process_conf();
+ }
+}