summaryrefslogtreecommitdiff
path: root/kolab.org/www/drupal-7.15/sites/all/modules/ctools
diff options
context:
space:
mode:
authorTorsten Grote <grote@kolabsys.com>2012-08-27 12:47:35 (GMT)
committerTorsten Grote <grote@kolabsys.com>2012-08-27 12:47:35 (GMT)
commit7b5e4a2b04e4fb38485bc12965e07794388d0224 (patch)
tree42031777dcb7476a63e9d6080ab9b8eef8ebb6f0 /kolab.org/www/drupal-7.15/sites/all/modules/ctools
parentee39408867ae52c2321036a67c472e684c1e1108 (diff)
downloadkolab.org-www-7b5e4a2b04e4fb38485bc12965e07794388d0224.tar.gz
updated ctools, ldap and views modules
Diffstat (limited to 'kolab.org/www/drupal-7.15/sites/all/modules/ctools')
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/ctools/bulk_export/bulk_export.info6
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/ctools/ctools.info6
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/ctools/ctools_access_ruleset/ctools_access_ruleset.info6
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/ctools/ctools_ajax_sample/ctools_ajax_sample.info6
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/ctools/ctools_custom_content/ctools_custom_content.info6
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/ctools/ctools_custom_content/ctools_custom_content.install2
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/ctools/ctools_plugin_example/ctools_plugin_example.info6
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/ctools/help/plugins-creating.html4
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/ctools/includes/context-task-handler.inc34
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/ctools/includes/context.inc2
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/ctools/includes/css.inc5
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/ctools/includes/export.inc7
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/ctools/includes/wizard.inc26
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/ctools/js/auto-submit.js9
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/ctools/js/modal.js5
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/ctools/page_manager/page_manager.info6
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/ctools/page_manager/page_manager.install2
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/ctools/page_manager/page_manager.module38
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/ctools/plugins/access/entity_field_value.inc22
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/ctools/plugins/content_types/block/block.inc70
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/ctools/plugins/content_types/entity_context/entity_field.inc2
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/ctools/plugins/content_types/node_form/node_form_author.inc2
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/ctools/plugins/content_types/node_form/node_form_publishing.inc2
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/ctools/plugins/content_types/term_context/term_description.inc2
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/ctools/stylizer/stylizer.info6
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/ctools/tests/context.test58
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/ctools/tests/css.test12
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/ctools/tests/ctools_export_test/ctools_export_test.info6
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/ctools/tests/ctools_plugin_test.info7
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/ctools/views_content/views_content.info6
30 files changed, 294 insertions, 77 deletions
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/ctools/bulk_export/bulk_export.info b/kolab.org/www/drupal-7.15/sites/all/modules/ctools/bulk_export/bulk_export.info
index 790561c..6f57712 100644
--- a/kolab.org/www/drupal-7.15/sites/all/modules/ctools/bulk_export/bulk_export.info
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/ctools/bulk_export/bulk_export.info
@@ -4,9 +4,9 @@ core = 7.x
dependencies[] = ctools
package = Chaos tool suite
-; Information added by drupal.org packaging script on 2012-08-08
-version = "7.x-1.1"
+; Information added by drupal.org packaging script on 2012-08-18
+version = "7.x-1.2"
core = "7.x"
project = "ctools"
-datestamp = "1344463011"
+datestamp = "1345319204"
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/ctools/ctools.info b/kolab.org/www/drupal-7.15/sites/all/modules/ctools/ctools.info
index 2ccf719..c3e56fb 100644
--- a/kolab.org/www/drupal-7.15/sites/all/modules/ctools/ctools.info
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/ctools/ctools.info
@@ -6,9 +6,9 @@ files[] = includes/context.inc
files[] = includes/math-expr.inc
files[] = includes/stylizer.inc
-; Information added by drupal.org packaging script on 2012-08-08
-version = "7.x-1.1"
+; Information added by drupal.org packaging script on 2012-08-18
+version = "7.x-1.2"
core = "7.x"
project = "ctools"
-datestamp = "1344463011"
+datestamp = "1345319204"
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/ctools/ctools_access_ruleset/ctools_access_ruleset.info b/kolab.org/www/drupal-7.15/sites/all/modules/ctools/ctools_access_ruleset/ctools_access_ruleset.info
index 4562d7a..04c92c3 100644
--- a/kolab.org/www/drupal-7.15/sites/all/modules/ctools/ctools_access_ruleset/ctools_access_ruleset.info
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/ctools/ctools_access_ruleset/ctools_access_ruleset.info
@@ -4,9 +4,9 @@ core = 7.x
package = Chaos tool suite
dependencies[] = ctools
-; Information added by drupal.org packaging script on 2012-08-08
-version = "7.x-1.1"
+; Information added by drupal.org packaging script on 2012-08-18
+version = "7.x-1.2"
core = "7.x"
project = "ctools"
-datestamp = "1344463011"
+datestamp = "1345319204"
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/ctools/ctools_ajax_sample/ctools_ajax_sample.info b/kolab.org/www/drupal-7.15/sites/all/modules/ctools/ctools_ajax_sample/ctools_ajax_sample.info
index 056083d..bbf708c 100644
--- a/kolab.org/www/drupal-7.15/sites/all/modules/ctools/ctools_ajax_sample/ctools_ajax_sample.info
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/ctools/ctools_ajax_sample/ctools_ajax_sample.info
@@ -4,9 +4,9 @@ package = Chaos tool suite
dependencies[] = ctools
core = 7.x
-; Information added by drupal.org packaging script on 2012-08-08
-version = "7.x-1.1"
+; Information added by drupal.org packaging script on 2012-08-18
+version = "7.x-1.2"
core = "7.x"
project = "ctools"
-datestamp = "1344463011"
+datestamp = "1345319204"
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/ctools/ctools_custom_content/ctools_custom_content.info b/kolab.org/www/drupal-7.15/sites/all/modules/ctools/ctools_custom_content/ctools_custom_content.info
index 75a2a93..b56e3be 100644
--- a/kolab.org/www/drupal-7.15/sites/all/modules/ctools/ctools_custom_content/ctools_custom_content.info
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/ctools/ctools_custom_content/ctools_custom_content.info
@@ -4,9 +4,9 @@ core = 7.x
package = Chaos tool suite
dependencies[] = ctools
-; Information added by drupal.org packaging script on 2012-08-08
-version = "7.x-1.1"
+; Information added by drupal.org packaging script on 2012-08-18
+version = "7.x-1.2"
core = "7.x"
project = "ctools"
-datestamp = "1344463011"
+datestamp = "1345319204"
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/ctools/ctools_custom_content/ctools_custom_content.install b/kolab.org/www/drupal-7.15/sites/all/modules/ctools/ctools_custom_content/ctools_custom_content.install
index 8348434..b4512f2 100644
--- a/kolab.org/www/drupal-7.15/sites/all/modules/ctools/ctools_custom_content/ctools_custom_content.install
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/ctools/ctools_custom_content/ctools_custom_content.install
@@ -17,7 +17,7 @@ function ctools_custom_content_schema_1() {
'bulk export' => TRUE,
'primary key' => 'cid',
'api' => array(
- 'owner' => 'ctools',
+ 'owner' => 'ctools_custom_content',
'api' => 'ctools_content',
'minimum_version' => 1,
'current_version' => 1,
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/ctools/ctools_plugin_example/ctools_plugin_example.info b/kolab.org/www/drupal-7.15/sites/all/modules/ctools/ctools_plugin_example/ctools_plugin_example.info
index 3b11096..c9f12e7 100644
--- a/kolab.org/www/drupal-7.15/sites/all/modules/ctools/ctools_plugin_example/ctools_plugin_example.info
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/ctools/ctools_plugin_example/ctools_plugin_example.info
@@ -7,9 +7,9 @@ dependencies[] = page_manager
dependencies[] = advanced_help
core = 7.x
-; Information added by drupal.org packaging script on 2012-08-08
-version = "7.x-1.1"
+; Information added by drupal.org packaging script on 2012-08-18
+version = "7.x-1.2"
core = "7.x"
project = "ctools"
-datestamp = "1344463011"
+datestamp = "1345319204"
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/ctools/help/plugins-creating.html b/kolab.org/www/drupal-7.15/sites/all/modules/ctools/help/plugins-creating.html
index 186bb74..29a9014 100644
--- a/kolab.org/www/drupal-7.15/sites/all/modules/ctools/help/plugins-creating.html
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/ctools/help/plugins-creating.html
@@ -1,7 +1,7 @@
There are two primary pieces to using plugins. The first is getting the data, and the second is using the data.
<h2>Defining a plugin</h2>
-To define that you offer a plugin that modules can implement, you first must implement hook_ctools_plugin_type() to tell the plugin system about your plugin.
+To define that you offer a plugin that modules can implement, you first must implement hook_ctools_plugin_type() to tell the plugin system about your plugin.
<pre>
/**
@@ -49,7 +49,7 @@ The following information can be specified for each plugin type:
<dd><em>Defaults to:</em> <strong>FALSE</strong></dd>
<dd>If set to TRUE, the plugin type can automatically have 'child plugins' meaning each plugin can actually provide multiple plugins. This is mostly used for plugins that store some of their information in the database, such as views, blocks or exportable custom versions of plugins.</dd>
<dd>To implement, each plugin can have a 'get child' and 'get children' callback. Both of these should be implemented for performance reasons, since it is best to avoid getting all children if necessary, but if 'get child' is not implemented, it will fall back to 'get children' if it has to.</dd>
-<dd>Child plugins should be named parent:child, with the : being the separator, so that it knows which parent plugin to ask for teh child. The 'get children' method should at least return the parent plugin as part of the list, unless it wants the parent plugin itself to not be a choosable option, which is not unheard of. </dd>
+<dd>Child plugins should be named parent:child, with the : being the separator, so that it knows which parent plugin to ask for the child. The 'get children' method should at least return the parent plugin as part of the list, unless it wants the parent plugin itself to not be a choosable option, which is not unheard of. </dd>
<dd>'get children' arguments are ($plugin, $parent) and 'get child' arguments are ($plugin, $parent, $child).
</dl>
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/ctools/includes/context-task-handler.inc b/kolab.org/www/drupal-7.15/sites/all/modules/ctools/includes/context-task-handler.inc
index 10fd793..617f20e 100644
--- a/kolab.org/www/drupal-7.15/sites/all/modules/ctools/includes/context-task-handler.inc
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/ctools/includes/context-task-handler.inc
@@ -100,6 +100,24 @@ function ctools_context_handler_render_handler($task, $subtask, $handler, $conte
return NULL;
}
+ if ($page) {
+ if ($subtask) {
+ $task_name = page_manager_make_task_name($task['name'], $subtask['name']);
+ }
+ else {
+ $task_name = $task['name'];
+ }
+
+ page_manager_get_current_page(array(
+ 'name' => $task_name,
+ 'task' => $task,
+ 'subtask' => $subtask,
+ 'contexts' => $contexts,
+ 'arguments' => $args,
+ 'handler' => $handler,
+ ));
+ }
+
$info = $function($handler, $contexts, $args);
if (!$info) {
return NULL;
@@ -119,22 +137,6 @@ function ctools_context_handler_render_handler($task, $subtask, $handler, $conte
return $info;
}
- if ($subtask) {
- $task_name = page_manager_make_task_name($task['name'], $subtask['name']);
- }
- else {
- $task_name = $task['name'];
- }
-
- page_manager_get_current_page(array(
- 'name' => $task_name,
- 'task' => $task,
- 'subtask' => $subtask,
- 'contexts' => $contexts,
- 'arguments' => $args,
- 'handler' => $handler,
- ));
-
if (!empty($info['response code']) && $info['response code'] != 200) {
switch ($info['response code']) {
case 403:
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/ctools/includes/context.inc b/kolab.org/www/drupal-7.15/sites/all/modules/ctools/includes/context.inc
index 720a6fc..5c7a4ce 100644
--- a/kolab.org/www/drupal-7.15/sites/all/modules/ctools/includes/context.inc
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/ctools/includes/context.inc
@@ -633,7 +633,7 @@ function ctools_context_keyword_substitute($string, $keywords, $contexts, $conve
// Look for context matches we we only have to convert known matches.
$matches = array();
- if (preg_match_all('/%([a-zA-Z0-9%:_-]+)/us', $string, $matches)) {
+ if (preg_match_all('/%(%|[a-zA-Z0-9_-]+(?:\:[a-zA-Z0-9_-]+)?)/us', $string, $matches)) {
foreach ($matches[1] as $keyword) {
// Ignore anything it finds with %%.
if ($keyword[0] == '%') {
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/ctools/includes/css.inc b/kolab.org/www/drupal-7.15/sites/all/modules/ctools/includes/css.inc
index 8bc4c66..ee11d48 100644
--- a/kolab.org/www/drupal-7.15/sites/all/modules/ctools/includes/css.inc
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/ctools/includes/css.inc
@@ -284,8 +284,9 @@ function ctools_css_disassemble($css) {
$disassembled_css = array();
// Remove comments.
$css = preg_replace("/\/\*(.*)?\*\//Usi", "", $css);
- // Split out each statement
- $statements = preg_split('/[;}]/', $css);
+ // Split out each statement. Match either a right curly brace or a semi-colon
+ // that precedes a left curly brace with no right curly brace separating them.
+ $statements = preg_split('/}|;(?=[^}]*{)/', $css);
// If we have any statements, parse them.
if (!empty($statements)) {
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/ctools/includes/export.inc b/kolab.org/www/drupal-7.15/sites/all/modules/ctools/includes/export.inc
index dfbe74b..0b2ef46 100644
--- a/kolab.org/www/drupal-7.15/sites/all/modules/ctools/includes/export.inc
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/ctools/includes/export.inc
@@ -386,10 +386,15 @@ function ctools_export_crud_disable($table, $object) {
*/
function ctools_export_load_object($table, $type = 'all', $args = array()) {
$cache = &drupal_static(__FUNCTION__);
+ $cache_table_exists = &drupal_static(__FUNCTION__ . '_table_exists', array());
$cached_database = &drupal_static('ctools_export_load_object_all');
+ if (!array_key_exists($table, $cache_table_exists)) {
+ $cache_table_exists[$table] = db_table_exists($table);
+ }
+
$schema = ctools_export_get_schema($table);
- if (empty($schema) || !db_table_exists($table)) {
+ if (empty($schema) || !$cache_table_exists[$table]) {
return array();
}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/ctools/includes/wizard.inc b/kolab.org/www/drupal-7.15/sites/all/modules/ctools/includes/wizard.inc
index 946ed0f..6f5d794 100644
--- a/kolab.org/www/drupal-7.15/sites/all/modules/ctools/includes/wizard.inc
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/ctools/includes/wizard.inc
@@ -430,6 +430,12 @@ function ctools_wizard_submit(&$form, &$form_state) {
}
else if ($type == 'next') {
$form_state['redirect'] = ctools_wizard_get_path($form_state['form_info'], $form_state['clicked_button']['#next']);
+ if (!empty($_GET['destination'])) {
+ // We don't want drupal_goto redirect this request
+ // back. ctools_wizard_get_path ensures that the destination is
+ // carried over on subsequent pages.
+ unset($_GET['destination']);
+ }
}
else if (isset($form_state['form_info']['return path'])) {
$form_state['redirect'] = $form_state['form_info']['return path'];
@@ -449,11 +455,27 @@ function ctools_wizard_get_path($form_info, $step) {
foreach ($form_info['path'] as $id => $part) {
$form_info['path'][$id] = str_replace('%step', $step, $form_info['path'][$id]);
}
- return $form_info['path'];
+ $path = $form_info['path'];
}
else {
- return array(str_replace('%step', $step, $form_info['path']));
+ $path = array(str_replace('%step', $step, $form_info['path']));
+ }
+
+ // If destination is set, carry it over so it'll take effect when
+ // saving. The submit handler will unset destination to avoid drupal_goto
+ // redirecting us.
+ if (!empty($_GET['destination'])) {
+ // Ensure that options is an array.
+ if (!isset($path[1]) || !is_array($path[1])) {
+ $path[1] = array();
+ }
+ // Ensure that the query part of options is an array.
+ $path[1] += array('query' => array());
+ // Add the destination parameter, if not set already.
+ $path[1]['query'] += drupal_get_destination();
}
+
+ return $path;
}
/**
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/ctools/js/auto-submit.js b/kolab.org/www/drupal-7.15/sites/all/modules/ctools/js/auto-submit.js
index 59178c4..890dd1f 100644
--- a/kolab.org/www/drupal-7.15/sites/all/modules/ctools/js/auto-submit.js
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/ctools/js/auto-submit.js
@@ -16,6 +16,12 @@
* '#attributes' => array('class' => array('ctools-auto-submit-full-form')),
* @endcode
*
+ * If you want to exclude a field from the ctool-auto-submit-full-form auto submission,
+ * add the class ctools-auto-submit-exclude to the form element. With FAPI, add:
+ * @code
+ * '#attributes' => array('class' => array('ctools-auto-submit-exclude')),
+ * @endcode
+ *
* Finally, you have to identify which button you want clicked for autosubmit.
* The behavior of this button will be honored if it's ajaxy or not:
* @code
@@ -39,7 +45,7 @@ Drupal.behaviors.CToolsAutoSubmit = {
// the change event bubbles so we only need to bind it to the outer form
$('form.ctools-auto-submit-full-form', context)
.add('.ctools-auto-submit', context)
- .filter('form, select, input:not(:text, :submit)')
+ .filter('form, select, input:not(:text, :submit, .ctools-auto-submit-exclude)')
.once('ctools-auto-submit')
.change(function (e) {
// don't trigger on text change for full-form
@@ -68,6 +74,7 @@ Drupal.behaviors.CToolsAutoSubmit = {
];
// Don't wait for change event on textfields
$('.ctools-auto-submit-full-form input:text, input:text.ctools-auto-submit', context)
+ .filter(':not(.ctools-auto-submit-exclude)')
.once('ctools-auto-submit', function () {
// each textinput element has his own timeout
var timeoutID = 0;
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/ctools/js/modal.js b/kolab.org/www/drupal-7.15/sites/all/modules/ctools/js/modal.js
index 1376d82..5b417d0 100644
--- a/kolab.org/www/drupal-7.15/sites/all/modules/ctools/js/modal.js
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/ctools/js/modal.js
@@ -278,7 +278,10 @@
Drupal.CTools.Modal.show(Drupal.CTools.Modal.getSettings(ajax.element));
}
$('#modal-title').html(response.title);
- $('#modal-content').html(response.output);
+ // Simulate an actual page load by scrolling to the top after adding the
+ // content. This is helpful for allowing users to see error messages at the
+ // top of a form, etc.
+ $('#modal-content').html(response.output).scrollTop(0);
Drupal.attachBehaviors();
}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/ctools/page_manager/page_manager.info b/kolab.org/www/drupal-7.15/sites/all/modules/ctools/page_manager/page_manager.info
index 780c115..d3e3588 100644
--- a/kolab.org/www/drupal-7.15/sites/all/modules/ctools/page_manager/page_manager.info
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/ctools/page_manager/page_manager.info
@@ -4,9 +4,9 @@ core = 7.x
dependencies[] = ctools
package = Chaos tool suite
-; Information added by drupal.org packaging script on 2012-08-08
-version = "7.x-1.1"
+; Information added by drupal.org packaging script on 2012-08-18
+version = "7.x-1.2"
core = "7.x"
project = "ctools"
-datestamp = "1344463011"
+datestamp = "1345319204"
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/ctools/page_manager/page_manager.install b/kolab.org/www/drupal-7.15/sites/all/modules/ctools/page_manager/page_manager.install
index ad2781c..b170ce7 100644
--- a/kolab.org/www/drupal-7.15/sites/all/modules/ctools/page_manager/page_manager.install
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/ctools/page_manager/page_manager.install
@@ -23,6 +23,8 @@ function page_manager_schema_1() {
'identifier' => 'handler',
'bulk export' => TRUE,
'export callback' => 'page_manager_export_task_handler',
+ 'load callback' => 'page_manager_export_task_handler_load',
+ 'delete callback' => 'page_manager_delete_task_handler',
'primary key' => 'did',
'api' => array(
'owner' => 'page_manager',
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/ctools/page_manager/page_manager.module b/kolab.org/www/drupal-7.15/sites/all/modules/ctools/page_manager/page_manager.module
index 6d6c199..62f6d27 100644
--- a/kolab.org/www/drupal-7.15/sites/all/modules/ctools/page_manager/page_manager.module
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/ctools/page_manager/page_manager.module
@@ -696,6 +696,44 @@ function page_manager_export_task_handler($handler, $indent = '') {
}
/**
+ * Loads page manager handler for export.
+ *
+ * Callback to load page manager handler within ctools_export_crud_load().
+ *
+ * @param string $name
+ * The name of the handler to load.
+ *
+ * @return
+ * Loaded page manager handler object, extended with external properties.
+ */
+function page_manager_export_task_handler_load($name) {
+ $table = 'page_manager_handlers';
+ $schema = ctools_export_get_schema($table);
+ $export = $schema['export'];
+
+ $result = ctools_export_load_object($table, 'names', array($name));
+ if (isset($result[$name])) {
+ $handler = $result[$name];
+
+ // Weight is stored in additional table so that in-code task handlers
+ // don't need to get written to the database just because they have their
+ // weight changed. Therefore, handler could have no correspondent database
+ // entry. Revert will not be performed for this handler and the weight
+ // will not be reverted. To make possible revert of the weight field
+ // export_type must simulate that the handler is stored in the database.
+ $handler->export_type = EXPORT_IN_DATABASE;
+
+ // Also, page manager handler weight should be overriden with correspondent
+ // weight from page_manager_weights table, if there is one.
+ $result = db_query('SELECT weight FROM {page_manager_weights} WHERE name = (:names)', array(':names' => $handler->name))->fetchField();
+ if (is_numeric($result)) {
+ $handler->weight = $result;
+ }
+ return $handler;
+ }
+}
+
+/**
* Create a new task handler object.
*
* @param $plugin
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/ctools/plugins/access/entity_field_value.inc b/kolab.org/www/drupal-7.15/sites/all/modules/ctools/plugins/access/entity_field_value.inc
index 1fb1fe8..59b01fb 100644
--- a/kolab.org/www/drupal-7.15/sites/all/modules/ctools/plugins/access/entity_field_value.inc
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/ctools/plugins/access/entity_field_value.inc
@@ -141,7 +141,13 @@ function ctools_entity_field_value_ctools_access_check($conf, $context, $plugin)
if ($field_items = field_get_items($entity_type, $context->data, $field_name)) {
$langcode = field_language($entity_type, $context->data, $field_name);
-
+ // Get field storage columns.
+ $instance = field_info_instance($entity_type, $field_name, $bundle_type);
+ $field = field_info_field_by_id($instance['field_id']);
+ $columns = array();
+ foreach ($field['columns'] as $column => $attributes) {
+ $columns[$column] = _field_sql_storage_columnname($field_name, $column);
+ }
foreach ($conf as $potential_field => $values) {
if ($field_name === $potential_field) {
@@ -152,8 +158,14 @@ function ctools_entity_field_value_ctools_access_check($conf, $context, $plugin)
// Check field value.
foreach ($field_items as $field_value) {
- if (in_array($field_value['value'], $conf_value_array)) {
- return TRUE;
+ foreach ($field_value as $field_column => $value) {
+ // Iterate through config values.
+ foreach ($conf_value_array as $conf_value) {
+ //
+ if ($value == $conf_value[$field_column]) {
+ return TRUE;
+ }
+ }
}
}
}
@@ -168,8 +180,8 @@ function _ctools_entity_field_value_ctools_access_get_conf_field_values($values,
}
$conf_values = array();
- foreach ($values[$langcode] as $value) {
- $conf_values[] = $value['value'];
+ foreach ($values[$langcode] as $delta => $value) {
+ $conf_values[$delta] = $value;
}
return $conf_values;
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/ctools/plugins/content_types/block/block.inc b/kolab.org/www/drupal-7.15/sites/all/modules/ctools/plugins/content_types/block/block.inc
index 866f72e..f5b0063 100644
--- a/kolab.org/www/drupal-7.15/sites/all/modules/ctools/plugins/content_types/block/block.inc
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/ctools/plugins/content_types/block/block.inc
@@ -78,21 +78,72 @@ function _ctools_block_content_type_content_type($module, $delta, $block) {
}
/**
+ * Load block info from the database.
+ *
+ * This is copied from _block_load_blocks(). It doesn't use that
+ * function because _block_load_blocks sorts by region, and it
+ * doesn't cache its results anyway.
+ */
+function _ctools_block_load_blocks() {
+ $blocks = &drupal_static(__FUNCTION__, NULL);
+ if (!isset($blocks)) {
+ global $theme_key;
+
+ $query = db_select('block', 'b');
+ $result = $query
+ ->fields('b')
+ ->condition('b.theme', $theme_key)
+ ->orderBy('b.region')
+ ->orderBy('b.weight')
+ ->orderBy('b.module')
+ ->addTag('block_load')
+ ->addTag('translatable')
+ ->execute();
+
+ $block_info = $result->fetchAllAssoc('bid');
+ // Allow modules to modify the block list.
+ drupal_alter('block_list', $block_info);
+
+ $blocks = array();
+ foreach ($block_info as $block) {
+ $blocks["{$block->module}_{$block->delta}"] = $block;
+ }
+ }
+
+ return $blocks;
+}
+
+/**
+ * Fetch the stored info for a block.
+ *
+ * The primary reason to use this is so that modules which perform alters
+ * can have their alters make it to the block.
+ */
+function _ctools_get_block_info($module, $delta) {
+ $blocks = _ctools_block_load_blocks();
+
+ $key = $module . '_' . $delta;
+ if (isset($blocks[$key])) {
+ return $blocks[$key];
+ }
+}
+
+/**
* Output function for the 'block' content type. Outputs a block
* based on the module and delta supplied in the configuration.
*/
function ctools_block_content_type_render($subtype, $conf) {
list($module, $delta) = _ctools_block_get_module_delta($subtype, $conf);
- $info = new stdClass;
- $info->module = $module;
- $info->delta = $delta;
+ $info = _ctools_get_block_info($module, $delta);
$block = module_invoke($module, 'block_view', $delta);
- // Allow modules to modify the block before it is viewed, via either
- // hook_block_view_alter() or hook_block_view_MODULE_DELTA_alter().
- drupal_alter(array('block_view', "block_view_{$module}_{$delta}"), $block, $info);
- $block = (object) $block;
+ if (!empty($info)) {
+ // Allow modules to modify the block before it is viewed, via either
+ // hook_block_view_alter() or hook_block_view_MODULE_DELTA_alter().
+ drupal_alter(array('block_view', "block_view_{$module}_{$delta}"), $block, $info);
+ $block = (object) $block;
+ }
if (empty($block)) {
return;
@@ -101,7 +152,10 @@ function ctools_block_content_type_render($subtype, $conf) {
$block->module = $module;
$block->delta = $delta;
- if (isset($block->subject)) {
+ if ($module == 'block') {
+ $block->title = $info->title;
+ }
+ else if (isset($block->subject)) {
$block->title = $block->subject;
}
else {
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/ctools/plugins/content_types/entity_context/entity_field.inc b/kolab.org/www/drupal-7.15/sites/all/modules/ctools/plugins/content_types/entity_context/entity_field.inc
index fb3fad2..2da4044 100644
--- a/kolab.org/www/drupal-7.15/sites/all/modules/ctools/plugins/content_types/entity_context/entity_field.inc
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/ctools/plugins/content_types/entity_context/entity_field.inc
@@ -154,7 +154,7 @@ function ctools_entity_field_content_type_render($subtype, $conf, $panel_args, $
$clone->{$field_name}[$language] = $all_values;
$field_output = field_view_field($entity_type, $clone, $field_name, $field_settings, $language);
- if (!empty($conf['override_title'])) {
+ if (!empty($field_output) && !empty($conf['override_title'])) {
$field_output['#title'] = filter_xss_admin($conf['override_title_text']);
}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/ctools/plugins/content_types/node_form/node_form_author.inc b/kolab.org/www/drupal-7.15/sites/all/modules/ctools/plugins/content_types/node_form/node_form_author.inc
index 5cb6a34..350df40 100644
--- a/kolab.org/www/drupal-7.15/sites/all/modules/ctools/plugins/content_types/node_form/node_form_author.inc
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/ctools/plugins/content_types/node_form/node_form_author.inc
@@ -43,7 +43,7 @@ function ctools_node_form_author_content_type_render($subtype, $conf, $panel_arg
}
function ctools_node_form_author_content_type_admin_title($subtype, $conf, $context) {
- return t('"@s" node form publishing options', array('@s' => $context->identifier));
+ return t('"@s" node form author information', array('@s' => $context->identifier));
}
function ctools_node_form_author_content_type_edit_form($form, &$form_state) {
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/ctools/plugins/content_types/node_form/node_form_publishing.inc b/kolab.org/www/drupal-7.15/sites/all/modules/ctools/plugins/content_types/node_form/node_form_publishing.inc
index 3f3cf25..e73cff2 100644
--- a/kolab.org/www/drupal-7.15/sites/all/modules/ctools/plugins/content_types/node_form/node_form_publishing.inc
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/ctools/plugins/content_types/node_form/node_form_publishing.inc
@@ -45,7 +45,7 @@ function ctools_node_form_publishing_content_type_render($subtype, $conf, $panel
}
function ctools_node_form_publishing_content_type_admin_title($subtype, $conf, $context) {
- return t('"@s" node form author information', array('@s' => $context->identifier));
+ return t('"@s" node form publishing options', array('@s' => $context->identifier));
}
function ctools_node_form_publishing_content_type_edit_form($form, &$form_state) {
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/ctools/plugins/content_types/term_context/term_description.inc b/kolab.org/www/drupal-7.15/sites/all/modules/ctools/plugins/content_types/term_context/term_description.inc
index 35988e6..2b953ed 100644
--- a/kolab.org/www/drupal-7.15/sites/all/modules/ctools/plugins/content_types/term_context/term_description.inc
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/ctools/plugins/content_types/term_context/term_description.inc
@@ -20,7 +20,7 @@ function ctools_term_description_content_type_render($subtype, $conf, $panel_arg
$block->title = $term->name;
if ($term) {
- $block->content = _filter_autop(filter_xss_admin($term->description));
+ $block->content = check_markup($term->description, $term->format, '', TRUE);
$block->delta = $term->tid;
if (user_access('administer taxonomy')) {
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/ctools/stylizer/stylizer.info b/kolab.org/www/drupal-7.15/sites/all/modules/ctools/stylizer/stylizer.info
index b407b95..9c7f117 100644
--- a/kolab.org/www/drupal-7.15/sites/all/modules/ctools/stylizer/stylizer.info
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/ctools/stylizer/stylizer.info
@@ -5,9 +5,9 @@ package = Chaos tool suite
dependencies[] = ctools
dependencies[] = color
-; Information added by drupal.org packaging script on 2012-08-08
-version = "7.x-1.1"
+; Information added by drupal.org packaging script on 2012-08-18
+version = "7.x-1.2"
core = "7.x"
project = "ctools"
-datestamp = "1344463011"
+datestamp = "1345319204"
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/ctools/tests/context.test b/kolab.org/www/drupal-7.15/sites/all/modules/ctools/tests/context.test
new file mode 100644
index 0000000..b5f6fb1
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/ctools/tests/context.test
@@ -0,0 +1,58 @@
+<?php
+
+class CtoolsContextKeywordsSubstitutionTestCase extends DrupalWebTestCase {
+ public static function getInfo() {
+ return array(
+ 'name' => 'Keywords substitution',
+ 'description' => 'Verify that keywords are properly replaced with data.',
+ 'group' => 'Chaos Tools Suite',
+ );
+ }
+
+ public function setUp() {
+ parent::setUp('ctools');
+
+ ctools_include('context');
+ }
+
+ public function testKeywordsSubstitution() {
+ // Create node context for substitution.
+ $node = $this->drupalCreateNode();
+ $context = ctools_context_create('node', $node);
+ $contexts = array('argument_1' => $context);
+
+ // Run tests on some edge cases.
+ $checks = array(
+ '%node:title' => array(
+ "{$node->title}",
+ t('Keyword and converter have been replaced.'),
+ ),
+ '%%node:title' => array(
+ "%node:title",
+ t('Keyword after escaped percent sign left untouched.'),
+ ),
+ '%node:title%node:nid' => array(
+ "{$node->title}{$node->nid}",
+ t('Multiple substitutions have been replaced.'),
+ ),
+ '%node:title:' => array(
+ "{$node->title}:",
+ t('Colon after keyword and converter left untouched.'),
+ ),
+ '%node:title%%' => array(
+ "{$node->title}%",
+ t('Escaped percent sign after keyword and converter left untouched.'),
+ ),
+ '%%%node:title' => array(
+ "%{$node->title}",
+ t('Keyword after escaped and unescaped percent sign has been replaced.'),
+ ),
+ );
+ foreach ($checks as $string => $expectations) {
+ list($expected_result, $message) = $expectations;
+ $actual_result = ctools_context_keyword_substitute($string, array(), $contexts);
+ $this->assertEqual($actual_result, $expected_result, $message);
+ }
+ }
+
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/ctools/tests/css.test b/kolab.org/www/drupal-7.15/sites/all/modules/ctools/tests/css.test
index 039e975..4a5200c 100644
--- a/kolab.org/www/drupal-7.15/sites/all/modules/ctools/tests/css.test
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/ctools/tests/css.test
@@ -65,5 +65,17 @@ class CtoolsCssTestCase extends DrupalWebTestCase {
$font_size = (strpos($filtered, 'font-size:12px;') !== FALSE);
$color = (strpos($filtered, 'color:blue') !== FALSE);
$this->assertTrue($font_size && $color, 'Multiple properties are merged.');
+
+ $css = '@import url("other.css");p {color: red;}';
+ $filtered = ctools_css_filter($css);
+ $other_css = (strpos($filtered, 'other.css') === FALSE);
+ $color = (strpos($filtered, 'color:red') !== FALSE);
+ $this->assertTrue($other_css && $color, 'CSS is properly sanitized.');
+
+ $css = ';p {color: red; font-size: 12px;}';
+ $filtered = ctools_css_filter($css);
+ $font_size = (strpos($filtered, 'font-size:12px;') !== FALSE);
+ $color = (strpos($filtered, 'color:red') !== FALSE);
+ $this->assertTrue($font_size && $color, 'Multiple properties are retained.');
}
}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/ctools/tests/ctools_export_test/ctools_export_test.info b/kolab.org/www/drupal-7.15/sites/all/modules/ctools/tests/ctools_export_test/ctools_export_test.info
index 55bcba9..2d975c3 100644
--- a/kolab.org/www/drupal-7.15/sites/all/modules/ctools/tests/ctools_export_test/ctools_export_test.info
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/ctools/tests/ctools_export_test/ctools_export_test.info
@@ -7,9 +7,9 @@ hidden = TRUE
files[] = ctools_export.test
-; Information added by drupal.org packaging script on 2012-08-08
-version = "7.x-1.1"
+; Information added by drupal.org packaging script on 2012-08-18
+version = "7.x-1.2"
core = "7.x"
project = "ctools"
-datestamp = "1344463011"
+datestamp = "1345319204"
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/ctools/tests/ctools_plugin_test.info b/kolab.org/www/drupal-7.15/sites/all/modules/ctools/tests/ctools_plugin_test.info
index cf4bf9c..6d5e9cd 100644
--- a/kolab.org/www/drupal-7.15/sites/all/modules/ctools/tests/ctools_plugin_test.info
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/ctools/tests/ctools_plugin_test.info
@@ -6,11 +6,12 @@ dependencies[] = ctools
files[] = ctools.plugins.test
files[] = object_cache.test
files[] = css.test
+files[] = context.test
hidden = TRUE
-; Information added by drupal.org packaging script on 2012-08-08
-version = "7.x-1.1"
+; Information added by drupal.org packaging script on 2012-08-18
+version = "7.x-1.2"
core = "7.x"
project = "ctools"
-datestamp = "1344463011"
+datestamp = "1345319204"
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/ctools/views_content/views_content.info b/kolab.org/www/drupal-7.15/sites/all/modules/ctools/views_content/views_content.info
index 040ea0c..cd7ce44 100644
--- a/kolab.org/www/drupal-7.15/sites/all/modules/ctools/views_content/views_content.info
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/ctools/views_content/views_content.info
@@ -9,9 +9,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 2012-08-08
-version = "7.x-1.1"
+; Information added by drupal.org packaging script on 2012-08-18
+version = "7.x-1.2"
core = "7.x"
project = "ctools"
-datestamp = "1344463011"
+datestamp = "1345319204"