Parcourir la source

Update ctools 7.x-1.11

opi il y a 8 ans
Parent
commit
5ce3ebcbe9
26 fichiers modifiés avec 528 ajouts et 170 suppressions
  1. 3 3
      sites/all/modules/ctools/bulk_export/bulk_export.info
  2. 60 0
      sites/all/modules/ctools/css/modal-rtl.css
  3. 3 3
      sites/all/modules/ctools/ctools.info
  4. 3 3
      sites/all/modules/ctools/ctools.module
  5. 3 3
      sites/all/modules/ctools/ctools_access_ruleset/ctools_access_ruleset.info
  6. 3 3
      sites/all/modules/ctools/ctools_ajax_sample/ctools_ajax_sample.info
  7. 3 3
      sites/all/modules/ctools/ctools_custom_content/ctools_custom_content.info
  8. 3 3
      sites/all/modules/ctools/ctools_plugin_example/ctools_plugin_example.info
  9. 2 1
      sites/all/modules/ctools/includes/export.inc
  10. 5 3
      sites/all/modules/ctools/js/auto-submit.js
  11. 6 1
      sites/all/modules/ctools/page_manager/page_manager.admin.inc
  12. 3 3
      sites/all/modules/ctools/page_manager/page_manager.info
  13. 6 4
      sites/all/modules/ctools/page_manager/plugins/task_handlers/http_response.inc
  14. 1 1
      sites/all/modules/ctools/page_manager/plugins/tasks/page.admin.inc
  15. 44 0
      sites/all/modules/ctools/plugins/access/query_string_exists.inc
  16. 89 0
      sites/all/modules/ctools/plugins/contexts/query_string.inc
  17. 70 0
      sites/all/modules/ctools/plugins/relationships/entity_from_query_string.inc
  18. 30 0
      sites/all/modules/ctools/plugins/relationships/user_category_edit_form_from_user.inc
  19. 3 3
      sites/all/modules/ctools/stylizer/stylizer.info
  20. 3 3
      sites/all/modules/ctools/term_depth/term_depth.info
  21. 3 3
      sites/all/modules/ctools/tests/ctools_export_test/ctools_export_test.info
  22. 3 3
      sites/all/modules/ctools/tests/ctools_plugin_test.info
  23. 2 120
      sites/all/modules/ctools/views_content/plugins/content_types/views_panes.inc
  24. 153 1
      sites/all/modules/ctools/views_content/plugins/views/views_content_plugin_display_panel_pane.inc
  25. 3 3
      sites/all/modules/ctools/views_content/views_content.info
  26. 21 0
      sites/all/modules/ctools/views_content/views_content.module

+ 3 - 3
sites/all/modules/ctools/bulk_export/bulk_export.info

@@ -6,9 +6,9 @@ package = Chaos tool suite
 version = CTOOLS_MODULE_VERSION
 version = CTOOLS_MODULE_VERSION
 
 
 
 
-; Information added by Drupal.org packaging script on 2016-08-17
-version = "7.x-1.10"
+; Information added by Drupal.org packaging script on 2016-10-16
+version = "7.x-1.11"
 core = "7.x"
 core = "7.x"
 project = "ctools"
 project = "ctools"
-datestamp = "1471454104"
+datestamp = "1476581654"
 
 

+ 60 - 0
sites/all/modules/ctools/css/modal-rtl.css

@@ -0,0 +1,60 @@
+div.ctools-modal-content {
+  text-align: right;
+}
+
+div.ctools-modal-content .modal-header {
+  background-color: #2385c2;
+  padding: 0 1em 0 .25em;
+}
+
+div.ctools-modal-content a.close {
+  color: white;
+  float: left;
+}
+
+/** modal forms CSS **/
+div.ctools-modal-content .form-item label {
+  float: right;
+}
+
+div.ctools-modal-content .form-item .description {
+  clear: right;
+}
+
+div.ctools-modal-content .form-item .description .tips {
+  margin-left: 0;
+  margin-right: 2em;
+}
+
+div.ctools-modal-content fieldset,
+div.ctools-modal-content .form-radios,
+div.ctools-modal-content .form-checkboxes {
+  clear: right;
+}
+
+div.ctools-modal-content .resizable-textarea {
+  margin-left: 5em;
+  margin-right: 15em;
+}
+
+div.ctools-modal-content .container-inline .form-item {
+  margin-right: 0;
+  margin-left: 2em;
+}
+
+div.ctools-modal-content label.hidden-options {
+  background-position: left;
+  padding-right: 0;
+  padding-left: 12px;
+}
+
+div.ctools-modal-content label.expanded-options {
+  background-position: left;
+  padding-right: 0;
+  padding-left: 16px;
+}
+
+div.ctools-modal-content .dependent-options {
+  padding-left: 0;
+  padding-right: 30px;
+}

+ 3 - 3
sites/all/modules/ctools/ctools.info

@@ -8,9 +8,9 @@ files[] = includes/math-expr.inc
 files[] = includes/stylizer.inc
 files[] = includes/stylizer.inc
 files[] = tests/css_cache.test
 files[] = tests/css_cache.test
 
 
-; Information added by Drupal.org packaging script on 2016-08-17
-version = "7.x-1.10"
+; Information added by Drupal.org packaging script on 2016-10-16
+version = "7.x-1.11"
 core = "7.x"
 core = "7.x"
 project = "ctools"
 project = "ctools"
-datestamp = "1471454104"
+datestamp = "1476581654"
 
 

+ 3 - 3
sites/all/modules/ctools/ctools.module

@@ -9,7 +9,7 @@
  * must be implemented in the module file.
  * must be implemented in the module file.
  */
  */
 
 
-define('CTOOLS_API_VERSION', '2.0.8');
+define('CTOOLS_API_VERSION', '2.0.9');
 
 
 /**
 /**
  * The current working ctools version.
  * The current working ctools version.
@@ -23,7 +23,7 @@ define('CTOOLS_API_VERSION', '2.0.8');
  *   ; Requires CTools v7.x-1.4 or newer.
  *   ; Requires CTools v7.x-1.4 or newer.
  *   dependencies[] = ctools (>=1.4)
  *   dependencies[] = ctools (>=1.4)
  */
  */
-define('CTOOLS_MODULE_VERSION', '7.x-1.10');
+define('CTOOLS_MODULE_VERSION', '7.x-1.11');
 
 
 /**
 /**
  * Test the CTools API version.
  * Test the CTools API version.
@@ -760,7 +760,7 @@ function ctools_process(&$variables, $hook) {
 
 
   // Update the classes within the attributes array to match the classes array
   // Update the classes within the attributes array to match the classes array
   if (isset($variables['attributes_array']['class'])) {
   if (isset($variables['attributes_array']['class'])) {
-    $variables['attributes_array']['class'] = $variables['classes_array'];
+    $variables['attributes_array']['class'] = array_unique(array_merge($variables['classes_array'], $variables['attributes_array']['class']));
     $variables['attributes'] = $variables['attributes_array'] ? drupal_attributes($variables['attributes_array']) : '';
     $variables['attributes'] = $variables['attributes_array'] ? drupal_attributes($variables['attributes_array']) : '';
   }
   }
 
 

+ 3 - 3
sites/all/modules/ctools/ctools_access_ruleset/ctools_access_ruleset.info

@@ -5,9 +5,9 @@ package = Chaos tool suite
 version = CTOOLS_MODULE_VERSION
 version = CTOOLS_MODULE_VERSION
 dependencies[] = ctools
 dependencies[] = ctools
 
 
-; Information added by Drupal.org packaging script on 2016-08-17
-version = "7.x-1.10"
+; Information added by Drupal.org packaging script on 2016-10-16
+version = "7.x-1.11"
 core = "7.x"
 core = "7.x"
 project = "ctools"
 project = "ctools"
-datestamp = "1471454104"
+datestamp = "1476581654"
 
 

+ 3 - 3
sites/all/modules/ctools/ctools_ajax_sample/ctools_ajax_sample.info

@@ -5,9 +5,9 @@ version = CTOOLS_MODULE_VERSION
 dependencies[] = ctools
 dependencies[] = ctools
 core = 7.x
 core = 7.x
 
 
-; Information added by Drupal.org packaging script on 2016-08-17
-version = "7.x-1.10"
+; Information added by Drupal.org packaging script on 2016-10-16
+version = "7.x-1.11"
 core = "7.x"
 core = "7.x"
 project = "ctools"
 project = "ctools"
-datestamp = "1471454104"
+datestamp = "1476581654"
 
 

+ 3 - 3
sites/all/modules/ctools/ctools_custom_content/ctools_custom_content.info

@@ -5,9 +5,9 @@ package = Chaos tool suite
 version = CTOOLS_MODULE_VERSION
 version = CTOOLS_MODULE_VERSION
 dependencies[] = ctools
 dependencies[] = ctools
 
 
-; Information added by Drupal.org packaging script on 2016-08-17
-version = "7.x-1.10"
+; Information added by Drupal.org packaging script on 2016-10-16
+version = "7.x-1.11"
 core = "7.x"
 core = "7.x"
 project = "ctools"
 project = "ctools"
-datestamp = "1471454104"
+datestamp = "1476581654"
 
 

+ 3 - 3
sites/all/modules/ctools/ctools_plugin_example/ctools_plugin_example.info

@@ -8,9 +8,9 @@ dependencies[] = page_manager
 dependencies[] = advanced_help
 dependencies[] = advanced_help
 core = 7.x
 core = 7.x
 
 
-; Information added by Drupal.org packaging script on 2016-08-17
-version = "7.x-1.10"
+; Information added by Drupal.org packaging script on 2016-10-16
+version = "7.x-1.11"
 core = "7.x"
 core = "7.x"
 project = "ctools"
 project = "ctools"
-datestamp = "1471454104"
+datestamp = "1476581654"
 
 

+ 2 - 1
sites/all/modules/ctools/includes/export.inc

@@ -902,7 +902,8 @@ function ctools_export_object($table, $object, $indent = '', $identifier = NULL,
   $output = $indent . '$' . $identifier . ' = new ' . get_class($object) . "();\n";
   $output = $indent . '$' . $identifier . ' = new ' . get_class($object) . "();\n";
 
 
   if ($schema['export']['can disable']) {
   if ($schema['export']['can disable']) {
-    $output .= $indent . '$' . $identifier . '->disabled = FALSE; /* Edit this to true to make a default ' . $identifier . ' disabled initially */' . "\n";
+    $disabled = !isset($object->disabled) || $object->disabled != TRUE ? 'FALSE' : 'TRUE';
+    $output .= $indent . '$' . $identifier . '->disabled = ' . $disabled . '; /* Edit this to true to make a default ' . $identifier . ' disabled initially */' . "\n";
   }
   }
   if (!empty($schema['export']['api']['current_version'])) {
   if (!empty($schema['export']['api']['current_version'])) {
     $output .= $indent . '$' . $identifier . '->api_version = ' . $schema['export']['api']['current_version'] . ";\n";
     $output .= $indent . '$' . $identifier . '->api_version = ' . $schema['export']['api']['current_version'] . ";\n";

+ 5 - 3
sites/all/modules/ctools/js/auto-submit.js

@@ -36,9 +36,11 @@ Drupal.behaviors.CToolsAutoSubmit = {
   attach: function(context) {
   attach: function(context) {
     // 'this' references the form element
     // 'this' references the form element
     function triggerSubmit (e) {
     function triggerSubmit (e) {
-      var $this = $(this);
-      if (!$this.hasClass('ctools-ajaxing')) {
-        $this.find('.ctools-auto-submit-click').click();
+      if ($.contains(document.body, this)) {
+        var $this = $(this);
+        if (!$this.hasClass('ctools-ajaxing')) {
+          $this.find('.ctools-auto-submit-click').click();
+        }
       }
       }
     }
     }
 
 

+ 6 - 1
sites/all/modules/ctools/page_manager/page_manager.admin.inc

@@ -1547,6 +1547,11 @@ function page_manager_handler_rearrange($form, &$form_state) {
 
 
   $form['handlers'] = array('#tree' => TRUE);
   $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) {
   foreach ($page->handler_info as $id => $info) {
     if ($info['changed'] & PAGE_MANAGER_CHANGED_DELETED) {
     if ($info['changed'] & PAGE_MANAGER_CHANGED_DELETED) {
       continue;
       continue;
@@ -1572,7 +1577,7 @@ function page_manager_handler_rearrange($form, &$form_state) {
     $form['handlers'][$id]['weight'] = array(
     $form['handlers'][$id]['weight'] = array(
       '#type' => 'weight',
       '#type' => 'weight',
       '#default_value' => $info['weight'],
       '#default_value' => $info['weight'],
-      '#delta' => 30,
+      '#delta' => $delta,
     );
     );
   }
   }
 
 

+ 3 - 3
sites/all/modules/ctools/page_manager/page_manager.info

@@ -5,9 +5,9 @@ dependencies[] = ctools
 package = Chaos tool suite
 package = Chaos tool suite
 version = CTOOLS_MODULE_VERSION
 version = CTOOLS_MODULE_VERSION
 
 
-; Information added by Drupal.org packaging script on 2016-08-17
-version = "7.x-1.10"
+; Information added by Drupal.org packaging script on 2016-10-16
+version = "7.x-1.11"
 core = "7.x"
 core = "7.x"
 project = "ctools"
 project = "ctools"
-datestamp = "1471454104"
+datestamp = "1476581654"
 
 

+ 6 - 4
sites/all/modules/ctools/page_manager/plugins/task_handlers/http_response.inc

@@ -3,7 +3,8 @@
 /**
 /**
  * @file
  * @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
 // Plugin definition
@@ -108,7 +109,8 @@ function page_manager_http_response_codes() {
     403 => t('403 Access denied'),
     403 => t('403 Access denied'),
     404 => t('404 Page not found'),
     404 => t('404 Page not found'),
     410 => t('410 Gone'),
     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',
     '#type' => 'textfield',
     '#title' => t('Redirect destination'),
     '#title' => t('Redirect destination'),
     '#default_value' => $conf['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).'),
     '#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'];
   $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);
     $path = ctools_context_keyword_substitute($handler->conf['destination'], array(), $contexts);
     $url = parse_url($path);
     $url = parse_url($path);
     if (isset($url['query'])) {
     if (isset($url['query'])) {

+ 1 - 1
sites/all/modules/ctools/page_manager/plugins/tasks/page.admin.inc

@@ -698,7 +698,7 @@ function page_manager_page_form_menu($form, &$form_state) {
     '#title' => t('Title'),
     '#title' => t('Title'),
     '#type' => 'textfield',
     '#type' => 'textfield',
     '#default_value' => $menu['title'],
     '#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')),
     '#dependency' => array('radio:menu[type]' => array('normal', 'tab', 'default tab', 'action')),
   );
   );
 
 

+ 44 - 0
sites/all/modules/ctools/plugins/access/query_string_exists.inc

@@ -0,0 +1,44 @@
+<?php
+
+/**
+ * @file
+ * Plugin for controlling access based on the existence of a query string.
+ */
+
+$plugin = array(
+  'title' => 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']));
+}

+ 89 - 0
sites/all/modules/ctools/plugins/contexts/query_string.inc

@@ -0,0 +1,89 @@
+<?php
+
+/**
+ * @file query_string.inc
+ * Context plugin that can extract arbitrary values from the query string.
+ */
+
+/**
+ * $plugin array which will be used by the system that includes this file.
+ */
+$plugin = array(
+  'title' => 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);
+  }
+}

+ 70 - 0
sites/all/modules/ctools/plugins/relationships/entity_from_query_string.inc

@@ -0,0 +1,70 @@
+<?php
+
+/**
+ * @file
+ * Plugin to provide an relationship handler for entities from query string.
+ */
+
+/**
+ * Plugins are described by creating a $plugin array which will be used
+ * by the system that includes this file.
+ */
+$plugin = array(
+  'title' => 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'];
+}

+ 30 - 0
sites/all/modules/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.'),
   'description' => t('Adds user category edit form from a user context.'),
   'required context' => new ctools_context_required(t('User'), 'user'),
   'required context' => new ctools_context_required(t('User'), 'user'),
   'context' => 'ctools_user_category_edit_form_from_user_context',
   '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);
     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)) {
   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, 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;
 }
 }

+ 3 - 3
sites/all/modules/ctools/stylizer/stylizer.info

@@ -6,9 +6,9 @@ version = CTOOLS_MODULE_VERSION
 dependencies[] = ctools
 dependencies[] = ctools
 dependencies[] = color
 dependencies[] = color
 
 
-; Information added by Drupal.org packaging script on 2016-08-17
-version = "7.x-1.10"
+; Information added by Drupal.org packaging script on 2016-10-16
+version = "7.x-1.11"
 core = "7.x"
 core = "7.x"
 project = "ctools"
 project = "ctools"
-datestamp = "1471454104"
+datestamp = "1476581654"
 
 

+ 3 - 3
sites/all/modules/ctools/term_depth/term_depth.info

@@ -5,9 +5,9 @@ dependencies[] = ctools
 package = Chaos tool suite
 package = Chaos tool suite
 version = CTOOLS_MODULE_VERSION
 version = CTOOLS_MODULE_VERSION
 
 
-; Information added by Drupal.org packaging script on 2016-08-17
-version = "7.x-1.10"
+; Information added by Drupal.org packaging script on 2016-10-16
+version = "7.x-1.11"
 core = "7.x"
 core = "7.x"
 project = "ctools"
 project = "ctools"
-datestamp = "1471454104"
+datestamp = "1476581654"
 
 

+ 3 - 3
sites/all/modules/ctools/tests/ctools_export_test/ctools_export_test.info

@@ -8,9 +8,9 @@ hidden = TRUE
 
 
 files[] = ctools_export.test
 files[] = ctools_export.test
 
 
-; Information added by Drupal.org packaging script on 2016-08-17
-version = "7.x-1.10"
+; Information added by Drupal.org packaging script on 2016-10-16
+version = "7.x-1.11"
 core = "7.x"
 core = "7.x"
 project = "ctools"
 project = "ctools"
-datestamp = "1471454104"
+datestamp = "1476581654"
 
 

+ 3 - 3
sites/all/modules/ctools/tests/ctools_plugin_test.info

@@ -12,9 +12,9 @@ files[] = math_expression.test
 files[] = math_expression_stack.test
 files[] = math_expression_stack.test
 hidden = TRUE
 hidden = TRUE
 
 
-; Information added by Drupal.org packaging script on 2016-08-17
-version = "7.x-1.10"
+; Information added by Drupal.org packaging script on 2016-10-16
+version = "7.x-1.11"
 core = "7.x"
 core = "7.x"
 project = "ctools"
 project = "ctools"
-datestamp = "1471454104"
+datestamp = "1476581654"
 
 

+ 2 - 120
sites/all/modules/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;
     return;
   }
   }
 
 
+  $conf['pane_contexts'] = $contexts;
+  $conf['panel_args'] = $panel_args;
   $view->display_handler->set_pane_conf($conf);
   $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');
   $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'])) {
   if ($allow['path_override'] && !empty($conf['path'])) {
     $view->override_path = $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();
     $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();
   $stored_feeds = drupal_add_feed();
 
 
   $block->content = $view->preview();
   $block->content = $view->preview();

+ 153 - 1
sites/all/modules/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);
     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->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;
     $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']);
     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']);
+    }
+  }
+
 }
 }
 
 

+ 3 - 3
sites/all/modules/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_display_panel_pane.inc
 files[] = plugins/views/views_content_plugin_style_ctools_context.inc
 files[] = plugins/views/views_content_plugin_style_ctools_context.inc
 
 
-; Information added by Drupal.org packaging script on 2016-08-17
-version = "7.x-1.10"
+; Information added by Drupal.org packaging script on 2016-10-16
+version = "7.x-1.11"
 core = "7.x"
 core = "7.x"
 project = "ctools"
 project = "ctools"
-datestamp = "1471454104"
+datestamp = "1476581654"
 
 

+ 21 - 0
sites/all/modules/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();
+  }
+}