summaryrefslogtreecommitdiff
path: root/kolab.org
diff options
context:
space:
mode:
authorTorsten Grote <grote@kolabsys.com>2014-01-23 14:26:35 (GMT)
committerTorsten Grote <grote@kolabsys.com>2014-01-23 14:26:35 (GMT)
commitbb4c82f7ff77a04d0b9e8920fe6cad35a3280ad0 (patch)
tree9eddc7db98cba6766948572f5f030dc4b6d480c0 /kolab.org
parent9ec77367e92d9c9dd55f6b4f3d88b09f18e56b49 (diff)
downloadkolab.org-www-bb4c82f7ff77a04d0b9e8920fe6cad35a3280ad0.tar.gz
update Chaos tool suite module as well
Diffstat (limited to 'kolab.org')
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/ctools/API.txt6
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/ctools/bulk_export/bulk_export.info6
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/ctools/css/button.css3
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/ctools/css/dropbutton.css1
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/ctools/ctools.api.php61
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/ctools/ctools.info6
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/ctools/ctools.install26
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/ctools/ctools.module95
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/ctools/ctools_access_ruleset/ctools_access_ruleset.info6
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/ctools/ctools_access_ruleset/ctools_access_ruleset.install2
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/ctools/ctools_ajax_sample/ctools_ajax_sample.info6
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/ctools/ctools_custom_content/ctools_custom_content.info6
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/ctools/ctools_plugin_example/ctools_plugin_example.info6
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/ctools/ctools_plugin_example/ctools_plugin_example.module4
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/ctools/ctools_plugin_example/plugins/content_types/no_context_content_type.inc4
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/ctools/drush/ctools.drush.inc6
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/ctools/help/plugins-implementing.html13
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/ctools/help/plugins.html4
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/ctools/includes/action-links.theme.inc33
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/ctools/includes/content.menu.inc15
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/ctools/includes/content.plugin-type.inc2
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/ctools/includes/context-task-handler.inc6
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/ctools/includes/context.inc13
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/ctools/includes/dropbutton.theme.inc3
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/ctools/includes/dropdown.theme.inc3
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/ctools/includes/fields.inc4
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/ctools/includes/plugins.inc2
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/ctools/js/auto-submit.js9
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/ctools/js/dependent.js2
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/ctools/js/dropbutton.js1
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/ctools/js/modal.js4
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/ctools/page_manager/page_manager.admin.inc6
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/ctools/page_manager/page_manager.api.php39
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/ctools/page_manager/page_manager.info6
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/ctools/page_manager/page_manager.module3
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/ctools/page_manager/plugins/task_handlers/http_response.inc5
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/ctools/page_manager/plugins/tasks/comment_reply.inc162
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/ctools/page_manager/plugins/tasks/term_view.inc72
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/ctools/page_manager/plugins/tasks/user_edit.inc15
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/ctools/plugins/access/entity_bundle.inc1
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/ctools/plugins/access/entity_field_value.inc58
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/ctools/plugins/arguments/user_edit.inc1
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/ctools/plugins/content_types/block/block.inc16
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/ctools/plugins/content_types/comment/comment_reply_form.inc50
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/ctools/plugins/content_types/form/entity_form_field.inc7
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/ctools/plugins/content_types/node_context/node_title.inc49
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/ctools/plugins/content_types/node_form/node_form_language.inc41
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/ctools/plugins/content_types/page/page_actions.inc2
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/ctools/plugins/content_types/term_context/term_list.inc2
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/ctools/plugins/content_types/user_context/user_profile.inc2
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/ctools/plugins/contexts/string.inc4
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/ctools/plugins/contexts/user_edit_form.inc25
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/ctools/plugins/relationships/user_category_edit_form_from_user.inc31
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/ctools/stylizer/stylizer.info6
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/ctools/tests/context.test4
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/ctools/tests/ctools_export_test/ctools_export_test.info6
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/ctools/tests/ctools_plugin_test.info8
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/ctools/tests/math_expression.test129
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/ctools/tests/math_expression_stack.test63
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/ctools/views_content/plugins/content_types/views.inc2
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/ctools/views_content/plugins/content_types/views_panes.inc2
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/ctools/views_content/plugins/relationships/view_from_argument.inc3
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/ctools/views_content/views_content.info6
63 files changed, 1029 insertions, 155 deletions
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/API.txt b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/API.txt
index 2df7e22..e0441d6 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/API.txt
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/API.txt
@@ -1,8 +1,12 @@
-Current API Version: 2.0.5
+Current API Version: 2.0.8
Please note that the API version is an internal number and does not match release numbers. It is entirely possible that releases will not increase the API version number, and increasing this number too often would burden contrib module maintainers who need to keep up with API changes.
This file contains a log of changes to the API.
+API Version 2.0.8
+ Introduce ctools_class_add().
+ Introduce ctools_class_remove().
+
API Version 2.0.7
All ctools object cache database functions can now accept session_id as an optional
argument to facilitate using non-session id keys.
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/bulk_export/bulk_export.info b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/bulk_export/bulk_export.info
index 6f57712..d27ea9a 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/bulk_export/bulk_export.info
+++ b/kolab.org/www/drupal-7.18/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-18
-version = "7.x-1.2"
+; Information added by drupal.org packaging script on 2013-04-03
+version = "7.x-1.3"
core = "7.x"
project = "ctools"
-datestamp = "1345319204"
+datestamp = "1365013512"
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/css/button.css b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/css/button.css
index 91a6044..15e484b 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/css/button.css
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/css/button.css
@@ -1,4 +1,3 @@
-/* $Id$ */
.ctools-button-processed {
border-style: solid;
@@ -29,4 +28,4 @@
.ctools-button li a {
padding-left: 12px;
padding-right: 12px;
-} \ No newline at end of file
+}
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/css/dropbutton.css b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/css/dropbutton.css
index 7825111..5e3ea24 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/css/dropbutton.css
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/css/dropbutton.css
@@ -1,4 +1,3 @@
-/* $Id$ */
.ctools-dropbutton-processed {
padding-right: 18px;
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/ctools.api.php b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/ctools.api.php
index 1aef57c..a7ab783 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/ctools.api.php
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/ctools.api.php
@@ -203,5 +203,66 @@ function hook_ctools_content_subtype_alter($subtype, $plugin) {
}
/**
+ * Alter the definition of an entity context plugin.
+ *
+ * @param array $plugin
+ * An associative array defining a plugin.
+ * @param array $entity
+ * The entity info array of a specific entity type.
+ * @param string $plugin_id
+ * The plugin ID, in the format NAME:KEY.
+ */
+function hook_ctools_entity_context_alter(&$plugin, &$entity, $plugin_id) {
+ ctools_include('context');
+ switch ($plugin_id) {
+ case 'entity_id:taxonomy_term':
+ $plugin['no ui'] = TRUE;
+ case 'entity:user':
+ $plugin = ctools_get_context('user');
+ unset($plugin['no ui']);
+ unset($plugin['no required context ui']);
+ break;
+ }
+}
+
+/**
+ * Alter the definition of entity context plugins.
+ *
+ * @param array $plugins
+ * An associative array of plugin definitions, keyed by plugin ID.
+ *
+ * @see hook_ctools_entity_context_alter()
+ */
+function hook_ctools_entity_contexts_alter(&$plugins) {
+ $plugins['entity_id:taxonomy_term']['no ui'] = TRUE;
+}
+
+/**
+ * Change cleanstring settings.
+ *
+ * @param array $settings
+ * An associative array of cleanstring settings.
+ *
+ * @see ctools_cleanstring()
+ */
+function hook_ctools_cleanstring_alter(&$settings) {
+ // Convert all strings to lower case.
+ $settings['lower case'] = TRUE;
+}
+
+/**
+ * Change cleanstring settings for a specific clean ID.
+ *
+ * @param array $settings
+ * An associative array of cleanstring settings.
+ *
+ * @see ctools_cleanstring()
+ */
+function hook_ctools_cleanstring_CLEAN_ID_alter(&$settings) {
+ // Convert all strings to lower case.
+ $settings['lower case'] = TRUE;
+}
+
+/**
* @} End of "addtogroup hooks".
*/
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/ctools.info b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/ctools.info
index c3e56fb..8a7b0b6 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/ctools.info
+++ b/kolab.org/www/drupal-7.18/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-18
-version = "7.x-1.2"
+; Information added by drupal.org packaging script on 2013-04-03
+version = "7.x-1.3"
core = "7.x"
project = "ctools"
-datestamp = "1345319204"
+datestamp = "1365013512"
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/ctools.install b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/ctools.install
index 4a6f55c..1f961f1 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/ctools.install
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/ctools.install
@@ -26,7 +26,7 @@ function ctools_requirements($phase) {
}
if (!function_exists('error_get_last')) {
- $requirements['ctools_php_52']['title'] = t('CTools PHP requirements');
+ $requirements['ctools_php_52']['title'] = t('CTools PHP requirements');
$requirements['ctools_php_52']['description'] = t('CTools requires certain features only available in PHP 5.2.0 or higher.');
$requirements['ctools_php_52']['severity'] = REQUIREMENT_WARNING;
$requirements['ctools_php_52']['value'] = t('PHP !version', array('!version' => phpversion()));
@@ -52,6 +52,14 @@ function ctools_schema_2() {
// update the 'name' field to be 128 bytes long:
$schema['ctools_object_cache']['fields']['name']['length'] = 128;
+ // Update the 'data' field to be type 'blob'.
+ $schema['ctools_object_cache']['fields']['data'] = array(
+ 'type' => 'blob',
+ 'size' => 'big',
+ 'description' => 'Serialized data being stored.',
+ 'serialize' => TRUE,
+ );
+
// DO NOT MODIFY THIS TABLE -- this definition is used to create the table.
// Changes to this table must be made in schema_3 or higher.
$schema['ctools_css_cache'] = array(
@@ -194,4 +202,18 @@ function ctools_update_6007() {
return $ret;
}
-
+/**
+ * ctools_object_cache needs to be defined as a blob.
+ */
+function ctools_update_6008() {
+ db_delete('ctools_object_cache')
+ ->execute();
+
+ db_change_field('ctools_object_cache', 'data', 'data', array(
+ 'type' => 'blob',
+ 'size' => 'big',
+ 'description' => 'Serialized data being stored.',
+ 'serialize' => TRUE,
+ )
+ );
+}
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/ctools.module b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/ctools.module
index 7dfc989..f014e74 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/ctools.module
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/ctools.module
@@ -367,6 +367,52 @@ function ctools_set_no_blocks($blocks = FALSE) {
$status = $blocks;
}
+/**
+ * Add an array of classes to the body.
+ *
+ * @param mixed $classes
+ * A string or an array of class strings to add.
+ * @param string $hook
+ * The theme hook to add the class to. The default is 'html' which will
+ * affect the body tag.
+ */
+function ctools_class_add($classes, $hook = 'html') {
+ if (!is_array($classes)) {
+ $classes = array($classes);
+ }
+
+ $static = &drupal_static('ctools_process_classes', array());
+ if (!isset($static[$hook]['add'])) {
+ $static[$hook]['add'] = array();
+ }
+ foreach ($classes as $class) {
+ $static[$hook]['add'][] = $class;
+ }
+}
+
+/**
+ * Remove an array of classes from the body.
+ *
+ * @param mixed $classes
+ * A string or an array of class strings to remove.
+ * @param string $hook
+ * The theme hook to remove the class from. The default is 'html' which will
+ * affect the body tag.
+ */
+function ctools_class_remove($classes, $hook = 'html') {
+ if (!is_array($classes)) {
+ $classes = array($classes);
+ }
+
+ $static = &drupal_static('ctools_process_classes', array());
+ if (!isset($static[$hook]['remove'])) {
+ $static[$hook]['remove'] = array();
+ }
+ foreach ($classes as $class) {
+ $static[$hook]['remove'][] = $class;
+ }
+}
+
// -----------------------------------------------------------------------
// Drupal core hooks
@@ -574,6 +620,36 @@ function ctools_page_token_processing($children, $elements) {
return $children;
}
+/**
+ * Implements hook_process().
+ *
+ * Add and remove CSS classes from the variables array. We use process so that
+ * we alter anything added in the preprocess hooks.
+ */
+function ctools_process(&$variables, $hook) {
+ if (!isset($variables['classes'])) {
+ return;
+ }
+
+ $classes = drupal_static('ctools_process_classes', array());
+
+ // Process the classses to add.
+ if (!empty($classes[$hook]['add'])) {
+ $add_classes = array_map('drupal_clean_css_identifier', $classes[$hook]['add']);
+ $variables['classes_array'] = array_unique(array_merge($variables['classes_array'], $add_classes));
+ }
+
+ // Process the classes to remove.
+ if (!empty($classes[$hook]['remove'])) {
+ $remove_classes = array_map('drupal_clean_css_identifier', $classes[$hook]['remove']);
+ $variables['classes_array'] = array_diff($variables['classes_array'], $remove_classes);
+ }
+
+ // Since this runs after template_process(), we need to re-implode the
+ // classes array.
+ $variables['classes'] = implode(' ', $variables['classes_array']);
+}
+
// -----------------------------------------------------------------------
// Menu callbacks that must be in the .module file.
@@ -699,22 +775,6 @@ function ctools_export_ui_task_access($plugin_name, $op, $item = NULL) {
}
/**
- * Cache callback on behalf of ctools_export_ui.
- */
-function ctools_export_ui_context_cache_get($plugin_name, $key) {
- dsm('should not be called!');
- return;
-}
-
-/**
- * Cache callback on behalf of ctools_export_ui.
- */
-function ctools_export_ui_context_cache_set($plugin_name, $key, $item) {
- dsm('should not be called!');
- return;
-}
-
-/**
* Callback for access control ajax form on behalf of export ui.
*
* Returns the cached access config and contexts used.
@@ -815,6 +875,9 @@ function ctools_ajax_theme_callback() {
}
}
+/**
+ * Implements hook_ctools_entity_context_alter().
+ */
function ctools_ctools_entity_context_alter(&$plugin, &$entity, $plugin_id) {
ctools_include('context');
switch ($plugin_id) {
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/ctools_access_ruleset/ctools_access_ruleset.info b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/ctools_access_ruleset/ctools_access_ruleset.info
index 04c92c3..1019253 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/ctools_access_ruleset/ctools_access_ruleset.info
+++ b/kolab.org/www/drupal-7.18/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-18
-version = "7.x-1.2"
+; Information added by drupal.org packaging script on 2013-04-03
+version = "7.x-1.3"
core = "7.x"
project = "ctools"
-datestamp = "1345319204"
+datestamp = "1365013512"
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/ctools_access_ruleset/ctools_access_ruleset.install b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/ctools_access_ruleset/ctools_access_ruleset.install
index b1613d8..3f00877 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/ctools_access_ruleset/ctools_access_ruleset.install
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/ctools_access_ruleset/ctools_access_ruleset.install
@@ -17,7 +17,7 @@ function ctools_access_ruleset_schema_1() {
'bulk export' => TRUE,
'primary key' => 'rsid',
'api' => array(
- 'owner' => 'ctools',
+ 'owner' => 'ctools_access_ruleset',
'api' => 'ctools_rulesets',
'minimum_version' => 1,
'current_version' => 1,
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/ctools_ajax_sample/ctools_ajax_sample.info b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/ctools_ajax_sample/ctools_ajax_sample.info
index bbf708c..03ccb34 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/ctools_ajax_sample/ctools_ajax_sample.info
+++ b/kolab.org/www/drupal-7.18/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-18
-version = "7.x-1.2"
+; Information added by drupal.org packaging script on 2013-04-03
+version = "7.x-1.3"
core = "7.x"
project = "ctools"
-datestamp = "1345319204"
+datestamp = "1365013512"
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/ctools_custom_content/ctools_custom_content.info b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/ctools_custom_content/ctools_custom_content.info
index b56e3be..d9c4567 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/ctools_custom_content/ctools_custom_content.info
+++ b/kolab.org/www/drupal-7.18/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-18
-version = "7.x-1.2"
+; Information added by drupal.org packaging script on 2013-04-03
+version = "7.x-1.3"
core = "7.x"
project = "ctools"
-datestamp = "1345319204"
+datestamp = "1365013512"
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/ctools_plugin_example/ctools_plugin_example.info b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/ctools_plugin_example/ctools_plugin_example.info
index c9f12e7..e4fa534 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/ctools_plugin_example/ctools_plugin_example.info
+++ b/kolab.org/www/drupal-7.18/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-18
-version = "7.x-1.2"
+; Information added by drupal.org packaging script on 2013-04-03
+version = "7.x-1.3"
core = "7.x"
project = "ctools"
-datestamp = "1345319204"
+datestamp = "1365013512"
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/ctools_plugin_example/ctools_plugin_example.module b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/ctools_plugin_example/ctools_plugin_example.module
index 442969d..01d5338 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/ctools_plugin_example/ctools_plugin_example.module
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/ctools_plugin_example/ctools_plugin_example.module
@@ -85,8 +85,8 @@ function ctools_plugin_example_explanation_page() {
You can find it in %path.',
array(
'@demo_url' => url('ctools_plugin_example/xxxxx'),
- '!ctools_plugin_example_help' => theme('advanced_help_topic', 'ctools_plugin_example', 'Chaos-Tools--CTools--Plugin-Examples', 'title'),
- '!ctools_help' => theme('advanced_help_topic', 'ctools', 'plugins', 'title'),
+ '!ctools_plugin_example_help' => theme('advanced_help_topic', array('module' => 'ctools_plugin_example', 'topic' => 'Chaos-Tools--CTools--Plugin-Examples', 'type' => 'title')),
+ '!ctools_help' => theme('advanced_help_topic', array('module' => 'ctools', 'topic' => 'plugins', 'type' => 'title')),
'%path' => drupal_get_path('module', 'ctools_plugin_example'),
)) . '</p>';
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/ctools_plugin_example/plugins/content_types/no_context_content_type.inc b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/ctools_plugin_example/plugins/content_types/no_context_content_type.inc
index 8b73408..3c02ab8 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/ctools_plugin_example/plugins/content_types/no_context_content_type.inc
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/ctools_plugin_example/plugins/content_types/no_context_content_type.inc
@@ -53,8 +53,8 @@ $plugin = array(
function no_context_content_type_render($subtype, $conf, $args, $context) {
$block = new stdClass();
- $ctools_help = theme('advanced_help_topic', 'ctools', 'plugins', 'title');
- $ctools_plugin_example_help = theme('advanced_help_topic', 'ctools_plugin_example', 'Chaos-Tools--CTools--Plugin-Examples', 'title');
+ $ctools_help = theme('advanced_help_topic', array('module' => 'ctools', 'topic' => 'plugins', 'type' => 'title'));
+ $ctools_plugin_example_help = theme('advanced_help_topic', array('module' => 'ctools_plugin_example', 'topic' => 'Chaos-Tools--CTools--Plugin-Examples', 'type' => 'title'));
// The title actually used in rendering
$block->title = check_plain("No-context content type");
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/drush/ctools.drush.inc b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/drush/ctools.drush.inc
index bf1df1f..1862dbe 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/drush/ctools.drush.inc
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/drush/ctools.drush.inc
@@ -381,6 +381,7 @@ function ctools_drush_export_info() {
// Get info on these tables, or all tables if none specified.
$info = _ctools_drush_export_info($table_names, $load);
+ $schemas = $info['schemas'];
$exportables = $info['exportables'];
if (empty($exportables)) {
@@ -416,11 +417,12 @@ function ctools_drush_export_info() {
}
// Build a tabular output as default.
else {
- $header = $tables_only ? array() : array(dt('Base table'), dt('Exportables'));
+ $header = $tables_only ? array() : array(dt('Module'), dt('Base table'), dt('Exportables'));
$rows = array();
foreach ($exportables as $table => $info) {
if (is_array($info)) {
$row = array(
+ $schemas[$table]['module'],
$table,
// Machine name is better for this?
shellColours::getColouredOutput(implode("\n", array_keys($info)), 'light_green') . "\n",
@@ -434,7 +436,7 @@ function ctools_drush_export_info() {
if (!empty($rows)) {
drush_print("\n");
array_unshift($rows, $header);
- drush_print_table($rows, TRUE, array(20));
+ drush_print_table($rows, TRUE, array(20, 20));
drush_print(dt('Total exportables found: !total', array('!total' => $exportable_counts['total'])));
foreach ($exportable_counts['exportables'] as $table_name => $count) {
drush_print(dt('!table_name (!count)', array('!table_name' => $table_name, '!count' => $count)), 2);
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/help/plugins-implementing.html b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/help/plugins-implementing.html
index 070f08d..c95e72d 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/help/plugins-implementing.html
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/help/plugins-implementing.html
@@ -1,6 +1,7 @@
-<p>To implement plugins, you need to implement a single hook in your module to tell the system where your plugins live, and then you need to implement one or more .inc files that contain the plugin data.</p>
+<p>There are two parts to implementing a plugin: telling the system where it is, and implementing one or more .inc files that contain the plugin data.</p>
-<h2>Telling it where your plugins live</h2>
+<h2>Telling the system where your plugins live</h2>
+<h3>How a module implements plugins</h3>
<p>To implement any plugins at all, you must implement a single function for all plugins: <strong>hook_ctools_plugin_directory</strong>. Every time a module loads plugins, this hook will be called to see which modules implement those plugins and in what directory those plugins will live.</p>
<pre>
@@ -30,13 +31,13 @@ plugins/
my_content_type.inc
layouts/
my_layout.inc
- my_laout.css
+ my_layout.css
my_layout.tpl.php
my_layout_image.png
</pre>
-<h2>How a theme can implement plugins</h2>
-<p>Themes can implement plugins if the plugin owner specified that it's possible in its hook_ctools_api_TYPE() call. If so, it is generally exactly the same as modules, except for one important difference: themes don't get hook_ctools_plugin_directory(). Instead, themes add a line to their info file:</p>
+<h3>How a theme implements plugins</h3>
+<p>Themes can implement plugins if the plugin owner specified that it's possible in its hook_ctools_plugin_type() call. If so, it is generally exactly the same as modules, except for one important difference: themes don't get hook_ctools_plugin_directory(). Instead, themes add a line to their .info file:</p>
<pre>
plugins[module][type] = directory
@@ -54,7 +55,7 @@ $plugin = array(
);
</pre>
-<p>Several values will be filled in for you automatically, but you can override them if necessary. They include 'name', 'path', 'file' and 'module'. Additionally, the plugin can owner can provide other defaults as well.</p>
+<p>Several values will be filled in for you automatically, but you can override them if necessary. They include 'name', 'path', 'file' and 'module'. Additionally, the plugin owner can provide other defaults as well.</p>
<p>There are no required keys by the plugin system itself. The only requirements in the $plugin array will be defined by the plugin type.</p>
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/help/plugins.html b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/help/plugins.html
index b948411..1e64da0 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/help/plugins.html
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/help/plugins.html
@@ -1,5 +1,5 @@
<p>The plugins tool allows a module to allow <b>other</b> modules (and themes!) to provide plugins which provide some kind of functionality or some kind of task. For example, in Panels there are several types of plugins: Content types (which are like blocks), layouts (which are page layouts) and styles (which can be used to style a panel). Each plugin is represented by a .inc file, and the functionality they offer can differ wildly.</p>
-<p>A module which uses plugins can implement a hook describing the plugin (which is not necessary, as defaults will be filled in) and then calls a ctools function which loads either all the known plugins (used for listing/choosing) or loads a specific plugin (used when its known which plugin is needed). From the perspective of the plugin system, a plugin is a packet of data, usually some printable info and a list of callbacks. It is up to the module implementing plugins to determine what that info means and what the callbacks do.</p>
+<p>A module which uses plugins can implement a hook describing the plugin (which is not necessary, as defaults will be filled in) and then calls a ctools function which loads either all the known plugins (used for listing/choosing) or a specific plugin (used when it's known which plugin is needed). From the perspective of the plugin system, a plugin is a packet of data, usually some printable info and a list of callbacks. It is up to the module implementing plugins to determine what that info means and what the callbacks do.</p>
-<p>A module which implements plugins must first implement the <strong>hook_ctools_plugin_directory</strong> function, which simply tells the system which plugins are supported and what directory to look in. Each plugin will then be in a .inc file in the directory supplied. The .inc file will contain a specially named hook which returns the data necessary to implement the plugin.</p> \ No newline at end of file
+<p>A module which implements plugins must first implement the <strong>hook_ctools_plugin_directory</strong> function, which simply tells the system which plugins are supported and what directory to look in. Each plugin will then be in a separate .inc file in the directory supplied. The .inc file will contain a specially named hook which returns the data necessary to implement the plugin.</p>
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/includes/action-links.theme.inc b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/includes/action-links.theme.inc
new file mode 100644
index 0000000..3a2398a
--- /dev/null
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/includes/action-links.theme.inc
@@ -0,0 +1,33 @@
+<?php
+/**
+ * @file
+ * Theme function for wrapping menu local actions.
+ */
+
+/**
+ * Delegated implementation of hook_theme()
+ */
+function ctools_action_links_theme(&$items) {
+ $items['ctools_menu_local_actions_wrapper'] = array(
+ 'render element' => 'links',
+ 'file' => 'includes/action-links.theme.inc',
+ );
+}
+
+/**
+ * Render a menu local actions wrapper.
+ *
+ * @param $links
+ * Local actions links.
+ * @param $attributes
+ * An array of attributes to append to the wrapper.
+ */
+function theme_ctools_menu_local_actions_wrapper($variables) {
+ $links = drupal_render($variables['links']);
+
+ if (empty($links)) {
+ return;
+ }
+
+ return '<ul class="action-links">' . $links . '</ul>';
+} \ No newline at end of file
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/includes/content.menu.inc b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/includes/content.menu.inc
index 11a686a..93884fc 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/includes/content.menu.inc
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/includes/content.menu.inc
@@ -50,6 +50,21 @@ function ctools_content_autocomplete_entity($type, $string = '') {
$matches = array();
if ($type == 'node') {
+ if (!user_access('bypass node access')) {
+ // If the user is able to view their own unpublished nodes, allow them
+ // to see these in addition to published nodes.
+ if (user_access('view own unpublished content')) {
+ $query->condition(db_or()
+ ->condition('b.status', NODE_PUBLISHED)
+ ->condition('b.uid', $GLOBALS['user']->uid)
+ );
+ }
+ else {
+ // If not, restrict the query to published nodes.
+ $query->condition('b.status', NODE_PUBLISHED);
+ }
+ }
+
$query->addTag('node_access');
$query->join('users', 'u', 'b.uid = u.uid');
$query->addField('u', 'name', 'name');
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/includes/content.plugin-type.inc b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/includes/content.plugin-type.inc
index 4c767ae..a0debc3 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/includes/content.plugin-type.inc
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/includes/content.plugin-type.inc
@@ -10,7 +10,7 @@ function ctools_content_plugin_type(&$items) {
'cache' => FALSE,
'process' => array(
'function' => 'ctools_content_process',
- 'file' => 'export-ui.inc',
+ 'file' => 'content.inc',
'path' => drupal_get_path('module', 'ctools') . '/includes',
),
);
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/includes/context-task-handler.inc b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/includes/context-task-handler.inc
index 617f20e..37aa6df 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/includes/context-task-handler.inc
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/includes/context-task-handler.inc
@@ -143,6 +143,10 @@ function ctools_context_handler_render_handler($task, $subtask, $handler, $conte
return MENU_ACCESS_DENIED;
case 404:
return MENU_NOT_FOUND;
+ case 410:
+ drupal_add_http_header('Status', '410 Gone');
+ drupal_exit();
+ break;
case 301:
case 302:
case 303:
@@ -451,7 +455,7 @@ function ctools_context_handler_edit_criteria($form, &$form_state) {
ctools_include('ajax');
ctools_modal_add_plugin_js(ctools_get_access_plugins());
ctools_include('context-access-admin');
- $form_state['module'] = 'page_manager_task_handler';
+ $form_state['module'] = (isset($form_state['module'])) ? $form_state['module'] : 'page_manager_task_handler';
// Encode a bunch of info into the argument so we can get our cache later
$form_state['callback argument'] = $form_state['task_name'] . '*' . $form_state['handler']->name;
$form_state['access'] = $form_state['handler']->conf['access'];
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/includes/context.inc b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/includes/context.inc
index 5c7a4ce..93be748 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/includes/context.inc
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/includes/context.inc
@@ -508,6 +508,17 @@ function ctools_context_get_all_converters() {
/**
* Let the context convert an argument based upon the converter that was given.
+ *
+ * @param $context
+ * The context object
+ * @param $converter
+ * The converter to use, which should be a string provided by the converter list.
+ * @param $converter_options
+ * A n array of options to pass on to the generation function. For contexts
+ * that use token module, of particular use is 'sanitize' => FALSE which can
+ * get raw tokens. This should ONLY be used in values that will later be
+ * treated as unsafe user input since these values are by themselves unsafe.
+ * It is particularly useful to get raw values from Field API.
*/
function ctools_context_convert_context($context, $converter, $converter_options = array()) {
// Contexts without plugins might be optional placeholders.
@@ -633,7 +644,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_-]+(?:\:[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.18/sites/all/modules/ctools/includes/dropbutton.theme.inc b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/includes/dropbutton.theme.inc
index 0848666..fcdd5a3 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/includes/dropbutton.theme.inc
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/includes/dropbutton.theme.inc
@@ -1,10 +1,11 @@
<?php
-// $Id$
/**
* @file
* Provide a javascript based dropbutton menu.
*
+ * An example are the edit/disable/delete links on the views listing page.
+ *
* The dropbutton menu will show up as a button with a clickable twisty pointer
* to the right. When clicked the button will expand, showing the list of links.
*
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/includes/dropdown.theme.inc b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/includes/dropdown.theme.inc
index 2e21559..7e748f5 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/includes/dropdown.theme.inc
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/includes/dropdown.theme.inc
@@ -4,6 +4,9 @@
* @file
* Provide a javascript based dropdown menu.
*
+ * An example are the dropdown settings in the panels ui, like for adding
+ * new panes.
+ *
* The dropdown menu will show up as a clickable link; when clicked,
* a small menu will slide down beneath it, showing the list of links.
*
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/includes/fields.inc b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/includes/fields.inc
index dcd6139..162262c 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/includes/fields.inc
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/includes/fields.inc
@@ -170,6 +170,8 @@ function ctools_field_label($field_name) {
*
* @param $field_name
* Either a field instance object or the name of the field.
+ * If the 'field' key is populated it will be used as the field
+ * settings.
* @param $op
* Possible operations include:
* - form
@@ -222,6 +224,7 @@ function ctools_field_label($field_name) {
function ctools_field_invoke_field($field_name, $op, $entity_type, $entity, &$a = NULL, &$b = NULL, $options = array()) {
if (is_array($field_name)) {
$instance = $field_name;
+ $field = empty($field_name['field']) ? field_info_field($instance['field_name']) : $field_name['field'];
$field_name = $instance['field_name'];
}
else {
@@ -245,7 +248,6 @@ function ctools_field_invoke_field($field_name, $op, $entity_type, $entity, &$a
// Everything from here is unmodified code from _field_invoke() formerly
// inside a foreach loop over the instances.
- $field = field_info_field($field_name);
$function = $options['default'] ? 'field_default_' . $op : $field['module'] . '_field_' . $op;
if (function_exists($function)) {
// Determine the list of languages to iterate on.
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/includes/plugins.inc b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/includes/plugins.inc
index 2dbdd48..0363fcb 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/includes/plugins.inc
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/includes/plugins.inc
@@ -440,7 +440,7 @@ function ctools_plugin_load_includes($info, $filename = NULL) {
$all_files[$info['module']][$info['type']] = array();
// Load all our plugins.
$directories = ctools_plugin_get_directories($info);
- $extension = empty($info['info file']) ? $info['extension'] : 'info';
+ $extension = (empty($info['info file']) || ($info['extension'] != 'inc')) ? $info['extension'] : 'info';
foreach ($directories as $module => $path) {
$all_files[$info['module']][$info['type']][$module] = file_scan_directory($path, '/\.' . $extension . '$/', array('key' => 'name'));
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/js/auto-submit.js b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/js/auto-submit.js
index 890dd1f..a3e9aa4 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/js/auto-submit.js
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/js/auto-submit.js
@@ -45,11 +45,11 @@ 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, .ctools-auto-submit-exclude)')
+ .filter('form, select, input:not(:text, :submit)')
.once('ctools-auto-submit')
.change(function (e) {
// don't trigger on text change for full-form
- if ($(e.target).is(':not(:text, :submit)')) {
+ if ($(e.target).is(':not(:text, :submit, .ctools-auto-submit-exclude)')) {
triggerSubmit.call(e.target.form);
}
});
@@ -88,6 +88,11 @@ Drupal.behaviors.CToolsAutoSubmit = {
if ($.inArray(e.keyCode, discardKeyCode) === -1) {
timeoutID = setTimeout($.proxy(triggerSubmit, this.form), 500);
}
+ })
+ .bind('change', function (e) {
+ if ($.inArray(e.keyCode, discardKeyCode) === -1) {
+ timeoutID = setTimeout($.proxy(triggerSubmit, this.form), 500);
+ }
});
});
}
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/js/dependent.js b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/js/dependent.js
index 07ff021..e9e2447 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/js/dependent.js
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/js/dependent.js
@@ -97,7 +97,7 @@
else {
switch ($(trigger).attr('type')) {
case 'checkbox':
- var val = $(trigger).attr('checked') || 0;
+ var val = $(trigger).attr('checked') ? true : false;
if (val) {
$(trigger).siblings('label').removeClass('hidden-options').addClass('expanded-options');
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/js/dropbutton.js b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/js/dropbutton.js
index 49bc107..f505550 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/js/dropbutton.js
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/js/dropbutton.js
@@ -1,4 +1,3 @@
-// $Id$
/**
* @file
* Implement a simple, clickable dropbutton menu.
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/js/modal.js b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/js/modal.js
index 5b417d0..831649f 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/js/modal.js
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/js/modal.js
@@ -399,7 +399,7 @@
}
var parents = $(target).parents().get();
- for (var i in $(target).parents().get()) {
+ for (var i = 0; i < parents.length; ++i) {
var position = $(parents[i]).css('position');
if (position == 'absolute' || position == 'fixed') {
return true;
@@ -434,7 +434,7 @@
}
};
- $(document).bind('keypress', modalEventEscapeCloseHandler);
+ $(document).bind('keydown', modalEventEscapeCloseHandler);
// Close the open modal content and backdrop
function close() {
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/page_manager/page_manager.admin.inc b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/page_manager/page_manager.admin.inc
index c01961b..3dce041 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/page_manager/page_manager.admin.inc
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/page_manager/page_manager.admin.inc
@@ -158,7 +158,7 @@ function page_manager_get_pages($tasks, &$pages, $task_id = NULL) {
$visible_path = '';
if (!empty($task['admin path'])) {
foreach (explode('/', $task['admin path']) as $bit) {
- if ($bit[0] != '!') {
+ if (isset($bit[0]) && $bit[0] != '!') {
$path[] = $bit;
}
}
@@ -1126,9 +1126,11 @@ function page_manager_render_operations(&$page, $operations, $active_trail, $att
// We only render an li for things in the same nav tree.
if (empty($operation['location']) || $operation['location'] == $location) {
if (!is_array($attributes['class'])) {
- dsm($attributes['class']);
+ $attributes['class'] = array($attributes['class']);
}
+
$class = empty($attributes['class']) || !is_array($attributes['class']) ? array() : $attributes['class'];
+
if ($id == $first) {
$class[] = 'operation-first';
}
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/page_manager/page_manager.api.php b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/page_manager/page_manager.api.php
new file mode 100644
index 0000000..03e2e75
--- /dev/null
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/page_manager/page_manager.api.php
@@ -0,0 +1,39 @@
+<?php
+
+/**
+ * @file
+ * Describe hooks provided by the Page Manager module.
+ */
+
+/**
+ * @addtogroup hooks
+ * @{
+ */
+
+/**
+ * @todo.
+ *
+ * @param array $result
+ * @todo.
+ * @param object $page
+ * @todo.
+ */
+function hook_page_manager_operations_alter(&$result, &$page) {
+ // @todo.
+}
+
+/**
+ * @todo.
+ *
+ * @param array $operations
+ * @todo.
+ * @param object $handler
+ * @todo.
+ */
+function hook_page_manager_variant_operations_alter(&$operations, &$handler) {
+ // @todo.
+}
+
+/**
+ * @} End of "addtogroup hooks".
+ */
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/page_manager/page_manager.info b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/page_manager/page_manager.info
index d3e3588..76095ff 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/page_manager/page_manager.info
+++ b/kolab.org/www/drupal-7.18/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-18
-version = "7.x-1.2"
+; Information added by drupal.org packaging script on 2013-04-03
+version = "7.x-1.3"
core = "7.x"
project = "ctools"
-datestamp = "1345319204"
+datestamp = "1365013512"
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/page_manager/page_manager.module b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/page_manager/page_manager.module
index 62f6d27..da99a57 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/page_manager/page_manager.module
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/page_manager/page_manager.module
@@ -838,9 +838,6 @@ function page_manager_get_task_subtasks($task) {
if (is_array($retval)) {
return $retval;
}
- else {
- dsm($retval);
- }
}
return array();
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/page_manager/plugins/task_handlers/http_response.inc b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/page_manager/plugins/task_handlers/http_response.inc
index c11dcd7..e5c0141 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/page_manager/plugins/task_handlers/http_response.inc
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/page_manager/plugins/task_handlers/http_response.inc
@@ -105,8 +105,9 @@ $plugin = array(
*/
function page_manager_http_response_codes() {
return array(
- 404 => t('404 Page not found'),
403 => t('403 Access denied'),
+ 404 => t('404 Page not found'),
+ 410 => t('410 Gone'),
301 => t('301 Redirect'),
);
}
@@ -282,4 +283,4 @@ function page_manager_http_response_render($handler, $base_contexts, $args, $tes
}
return $info;
-} \ No newline at end of file
+}
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/page_manager/plugins/tasks/comment_reply.inc b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/page_manager/plugins/tasks/comment_reply.inc
new file mode 100644
index 0000000..0fcf9e2
--- /dev/null
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/page_manager/plugins/tasks/comment_reply.inc
@@ -0,0 +1,162 @@
+<?php
+/**
+ * Specialized implementation of hook_page_manager_task_tasks(). See api-task.html for
+ * more information.
+ */
+function page_manager_comment_reply_page_manager_tasks() {
+ if (!module_exists('comment')) {
+ return;
+ }
+
+ return array(
+ // This is a 'page' task and will fall under the page admin UI
+ 'task type' => 'page',
+
+ 'title' => t('Comment Reply page'),
+ 'admin title' => t('Comment Reply page'),
+ 'admin description' => t('When enabled, this overrides the default Drupal behavior for the site contact page at <em>/contact</em>. If no variant is selected, the default Drupal contact form will be used.'),
+ 'admin path' => 'comment/reply/%node',
+
+ // Menu hooks so that we can alter the node/%node menu entry to point to us.
+ 'hook menu alter' => 'page_manager_comment_reply_menu_alter',
+
+ // This is task uses 'context' handlers and must implement these to give the
+ // handler data it needs.
+ 'handler type' => 'context',
+ 'get arguments' => 'page_manager_comment_reply_get_arguments',
+ 'get context placeholders' => 'page_manager_comment_reply_get_contexts',
+
+ // Allow this to be enabled or disabled:
+ 'disabled' => variable_get('page_manager_comment_reply_disabled', TRUE),
+ 'enable callback' => 'page_manager_comment_reply_enable',
+ 'access callback' => 'page_manager_comment_reply_check',
+ );
+}
+
+/**
+ * Callback to enable/disable the page from the UI.
+ */
+function page_manager_comment_reply_enable($cache, $status) {
+ variable_set('page_manager_comment_reply_disabled', $status);
+ // Set a global flag so that the menu routine knows it needs
+ // to set a message if enabling cannot be done.
+ if (!$status) {
+ $GLOBALS['page_manager_enabling_comment_reply'] = TRUE;
+ }
+}
+
+
+/**
+ * Entry point for our overridden comment.
+ *
+ */
+function page_manager_comment_reply_page($node, $pid = NULL){
+ // Load my task plugin
+ $task = page_manager_get_task('comment_reply');
+
+ // Load the node into a context.
+ ctools_include('context');
+ ctools_include('context-task-handler');
+
+ $contexts = ctools_context_handler_get_task_contexts($task, '', array($node, $pid));
+
+ if (array_key_exists('argument_cid_3', $contexts) && $contexts['argument_cid_3']->data->nid != $node->nid) {
+ // Attempting to reply to a comment not belonging to the current nid.
+ drupal_set_message(t('The comment you are replying to does not exist.'), 'error');
+ drupal_goto("node/$node->nid");
+ }
+
+ $output = ctools_context_handler_render($task, '', $contexts, array($node, $pid));
+ if ($output != FALSE) {
+ return $output;
+ }
+
+ $function = 'comment_reply';
+ foreach (module_implements('page_manager_override') as $module) {
+ $call = $module . '_page_manager_override';
+ if (($rc = $call('comment_reply')) && function_exists($rc)) {
+ $function = $rc;
+ break;
+ }
+ }
+
+ module_load_include('inc', 'comment', 'comment.pages');
+ return $function($node, $pid);
+}
+
+/**
+ * Callback to get arguments provided by this task handler.
+ *
+ * Since this is the node view and there is no UI on the arguments, we
+ * create dummy arguments that contain the needed data.
+ */
+function page_manager_comment_reply_get_arguments($task, $subtask_id) {
+ return array(
+ array(
+ 'keyword' => 'node',
+ 'identifier' => t('Node being commented on'),
+ 'id' => 2,
+ 'name' => 'entity_id:node',
+ 'settings' => array(),
+ ),
+ array(
+ 'keyword' => 'comment',
+ 'identifier' => t('Comment being replied to'),
+ 'id' => 3,
+ 'name' => 'entity_id:comment',
+ 'settings' => array(),
+ ),
+ );
+}
+
+/**
+ * Callback to get context placeholders provided by this handler.
+ */
+function page_manager_comment_reply_get_contexts($task, $subtask_id) {
+ return ctools_context_get_placeholders_from_argument(page_manager_comment_reply_get_arguments($task, $subtask_id));
+}
+
+/**
+ * Callback defined by page_manager_node_view_page_manager_tasks().
+ *
+ * Alter the node view input so that node view comes to us rather than the
+ * normal node view process.
+ */
+function page_manager_comment_reply_menu_alter(&$items, $task) {
+ if (variable_get('page_manager_comment_reply_disabled', TRUE)) {
+ return;
+ }
+ // Override the node view handler for our purpose.
+ $callback = $items['comment/reply/%node']['page callback'];
+ if ($callback == 'comment_reply' || variable_get('page_manager_override_anyway', FALSE)) {
+ $items['comment/reply/%node']['page callback'] = 'page_manager_comment_reply_page';
+ $items['comment/reply/%node']['file path'] = $task['path'];
+ $items['comment/reply/%node']['file'] = $task['file'];
+ }
+ else {
+ // automatically disable this task if it cannot be enabled.
+ variable_set('page_manager_comment_reply_disabled', TRUE);
+ if (!empty($GLOBALS['page_manager_enabling_comment_reply'])) {
+ drupal_set_message(t('Page manager module is unable to enable comment/reply/%node because some other module already has overridden with %callback.', array('%callback' => $callback)), 'error');
+ }
+ }
+
+ // @todo override node revision handler as well?
+}
+
+/**
+ * Callback to determine if a page is accessible.
+ *
+ * @param $task
+ * The task plugin.
+ * @param $subtask_id
+ * The subtask id
+ * @param $contexts
+ * The contexts loaded for the task.
+ * @return
+ * TRUE if the current user can access the page.
+ */
+function page_manager_comment_reply_access_check($task, $subtask_id, $contexts) {
+ $context = reset($contexts);
+ return TRUE;
+}
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/page_manager/plugins/tasks/term_view.inc b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/page_manager/plugins/tasks/term_view.inc
index 6933a54..e276570 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/page_manager/plugins/tasks/term_view.inc
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/page_manager/plugins/tasks/term_view.inc
@@ -106,44 +106,90 @@ function page_manager_term_view_menu_alter(&$items, $task) {
* to run with it. If no one does, it passes through to Drupal core's
* term view, which is term_page_view().
*/
-function page_manager_term_view_page($term) {
- // Assign the term name as the page title, just as the original page
- // callback did.
+function page_manager_term_view_page($term, $depth = NULL) {
+ // Prep the term to be displayed so all of the regular hooks are triggered.
+ // Rather than calling taxonomy_term_page() directly, as it that would
+ // potentially load nodes that were not necessary, execute some of the code
+ // prior to identifying the correct CTools or Page Manager task handler and
+ // only proceed with the rest of the code if necessary.
+
+ // Assign the term name as the page title.
drupal_set_title($term->name);
- // While we ordinarily should never actually get feeds through here,
- // just in case
+ // If there is a menu link to this term, the link becomes the last part
+ // of the active trail, and the link name becomes the page title.
+ // Thus, we must explicitly set the page title to be the node title.
+ $uri = entity_uri('taxonomy_term', $term);
+
+ // Set the term path as the canonical URL to prevent duplicate content.
+ drupal_add_html_head_link(array('rel' => 'canonical', 'href' => url($uri['path'], $uri['options'])), TRUE);
+ // Set the non-aliased path as a default shortlink.
+ drupal_add_html_head_link(array('rel' => 'shortlink', 'href' => url($uri['path'], array_merge($uri['options'], array('alias' => TRUE)))), TRUE);
+
+ // Trigger the main
+ $build = taxonomy_term_show($term);
+
// Load my task plugin
$task = page_manager_get_task('term_view');
// Load the term into a context.
ctools_include('context');
ctools_include('context-task-handler');
- $contexts = ctools_context_handler_get_task_contexts($task, '', array($term));
+ $contexts = ctools_context_handler_get_task_contexts($task, '', array($term, $depth));
if (empty($contexts)) {
return drupal_not_found();
}
+ // Build the full output using the configured CTools plugin.
$output = ctools_context_handler_render($task, '', $contexts, array($term->tid));
if ($output !== FALSE) {
return $output;
}
- $function = 'taxonomy_term_page';
+ // Try loading an override plugin.
foreach (module_implements('page_manager_override') as $module) {
$call = $module . '_page_manager_override';
if (($rc = $call('term_view')) && function_exists($rc)) {
- $function = $rc;
- break;
+ return $rc($node);
}
}
- // Otherwise, fall back.
- if ($function == 'taxonomy_term_page') {
- module_load_include('inc', 'taxonomy', 'taxonomy.pages');
+ // Otherwise, fall back to replicating the output normally generated by
+ // taxonomy_term_page().
+
+ // Build breadcrumb based on the hierarchy of the term.
+ $current = (object) array(
+ 'tid' => $term->tid,
+ );
+ // @todo This overrides any other possible breadcrumb and is a pure hard-coded
+ // presumption. Make this behavior configurable per vocabulary or term.
+ $breadcrumb = array();
+ while ($parents = taxonomy_get_parents($current->tid)) {
+ $current = array_shift($parents);
+ $breadcrumb[] = l($current->name, 'taxonomy/term/' . $current->tid);
+ }
+ $breadcrumb[] = l(t('Home'), NULL);
+ $breadcrumb = array_reverse($breadcrumb);
+ drupal_set_breadcrumb($breadcrumb);
+ drupal_add_feed('taxonomy/term/' . $term->tid . '/feed', 'RSS - ' . $term->name);
+
+ if ($nids = taxonomy_select_nodes($term->tid, TRUE, variable_get('default_nodes_main', 10))) {
+ $nodes = node_load_multiple($nids);
+ $build += node_view_multiple($nodes);
+ $build['pager'] = array(
+ '#theme' => 'pager',
+ '#weight' => 5,
+ );
+ }
+ else {
+ $build['no_content'] = array(
+ '#prefix' => '<p>',
+ '#markup' => t('There is currently no content classified with this term.'),
+ '#suffix' => '</p>',
+ );
}
- return $function($term);
+ return $build;
}
/**
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/page_manager/plugins/tasks/user_edit.inc b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/page_manager/plugins/tasks/user_edit.inc
index 3d98426..6d0135d 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/page_manager/plugins/tasks/user_edit.inc
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/page_manager/plugins/tasks/user_edit.inc
@@ -52,6 +52,17 @@ function page_manager_user_edit_menu_alter(&$items, $task) {
$items['user/%user/edit']['page arguments'] = array(1);
$items['user/%user/edit']['file path'] = $task['path'];
$items['user/%user/edit']['file'] = $task['file'];
+ if (($categories = _user_categories()) && (count($categories) > 1)) {
+ foreach ($categories as $key => $category) {
+ // 'account' is already handled by the MENU_DEFAULT_LOCAL_TASK.
+ if ($category['name'] != 'account') {
+ $items['user/%user_category/edit/' . $category['name']]['page callback'] = 'page_manager_user_edit_page';
+ $items['user/%user_category/edit/' . $category['name']]['page arguments'] = array(1, 3);
+ $items['user/%user_category/edit/' . $category['name']]['file path'] = $task['path'];
+ $items['user/%user_category/edit/' . $category['name']]['file'] = $task['file'];
+ }
+ }
+ }
}
else {
// automatically disable this task if it cannot be enabled.
@@ -69,7 +80,9 @@ function page_manager_user_edit_menu_alter(&$items, $task) {
* to run with it. If no one does, it passes through to Drupal core's
* user edit, which is drupal_get_form('user_profile_form',$account).
*/
-function page_manager_user_edit_page($account) {
+function page_manager_user_edit_page($account, $category = 'account') {
+ // Store the category on the user for later usage.
+ $account->user_category = $category;
// Load my task plugin:
$task = page_manager_get_task('user_edit');
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/plugins/access/entity_bundle.inc b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/plugins/access/entity_bundle.inc
index ed68096..e07a048 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/plugins/access/entity_bundle.inc
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/plugins/access/entity_bundle.inc
@@ -1,5 +1,4 @@
<?php
-// $Id$
/**
* @file
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/plugins/access/entity_field_value.inc b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/plugins/access/entity_field_value.inc
index 59b01fb..e5857d8 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/plugins/access/entity_field_value.inc
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/plugins/access/entity_field_value.inc
@@ -98,6 +98,7 @@ function ctools_entity_field_value_ctools_access_settings($form, &$form_state, $
foreach (element_children($form['settings']) as $element) {
unset($form['settings'][$element]['#weight']);
}
+
// Need more logic here to handle compound fields.
foreach ($columns as $column) {
if (isset($conf[$column]) && is_array($conf[$column])) {
@@ -105,12 +106,13 @@ function ctools_entity_field_value_ctools_access_settings($form, &$form_state, $
if (is_numeric($delta) && is_array($conf_value)) {
$form['settings'][$field_name][LANGUAGE_NONE][$delta]['value']['#default_value'] = $conf_value['value'];
}
- else {
- $form['settings'][$field_name][LANGUAGE_NONE]['#default_value'] = $conf[$column];
- }
}
}
+ else {
+ $form['settings'][$field_name][LANGUAGE_NONE]['#default_value'] = $conf[$column];
+ }
}
+
return $form;
}
@@ -148,29 +150,29 @@ function ctools_entity_field_value_ctools_access_check($conf, $context, $plugin)
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) {
- $conf_value_array = _ctools_entity_field_value_ctools_access_get_conf_field_values($values, $langcode);
- if (empty($conf_value_array)) {
- return FALSE;
- }
+ if (isset($conf[$field_name])) {
+ // We have settings for this field.
+ $conf_value_array = _ctools_entity_field_value_ctools_access_get_conf_field_values($conf[$field_name], $langcode);
+ if (empty($conf_value_array)) {
+ return FALSE;
+ }
- // Check field value.
- foreach ($field_items as $field_value) {
- 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;
- }
+ // Check field value.
+ foreach ($field_items as $field_value) {
+ foreach ($field_value as $field_column => $value) {
+ // Iterate through config values.
+ foreach ($conf_value_array as $conf_value) {
+ // Check access only for stored in config column values.
+ if (isset($conf_value[$field_column]) && $value == $conf_value[$field_column]) {
+ return TRUE;
}
}
}
}
}
}
+
return FALSE;
}
@@ -221,15 +223,17 @@ function ctools_entity_field_value_ctools_access_summary($conf, $context, $plugi
$options = array('language' => LANGUAGE_NONE);
ctools_include('fields');
$display = field_get_display($instance, $view_mode, $entity);
- $display['type'] = 'list_default';
- $function = $display['module'] . '_field_formatter_view';
- $items = isset($entity->{$field_name}[LANGUAGE_NONE]) ? $entity->{$field_name}[LANGUAGE_NONE] : array();
- if (function_exists($function)) {
- $elements = $function($entity_type, $entity, $field, $instance, LANGUAGE_NONE, $items, $display);
- }
- $value_keys = array_keys($values);
- foreach ($value_keys as $key => $value) {
- $values[$value] = $elements[$key]['#markup'];
+ if (isset($display['module'])) {
+ $display['type'] = 'list_default';
+ $function = $display['module'] . '_field_formatter_view';
+ $items = isset($entity->{$field_name}[LANGUAGE_NONE]) ? $entity->{$field_name}[LANGUAGE_NONE] : array();
+ if (function_exists($function)) {
+ $elements = $function($entity_type, $entity, $field, $instance, LANGUAGE_NONE, $items, $display);
+ }
+ $value_keys = array_keys($values);
+ foreach ($value_keys as $key => $value) {
+ $values[$value] = isset($elements[$key]['#markup']) ? $elements[$key]['#markup'] : '';
+ }
}
$values = array_merge($keys, $values);
return t($string, $values);
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/plugins/arguments/user_edit.inc b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/plugins/arguments/user_edit.inc
index fc77f80..32b2b81 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/plugins/arguments/user_edit.inc
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/plugins/arguments/user_edit.inc
@@ -44,5 +44,4 @@ function ctools_user_edit_context($arg = NULL, $conf = NULL, $empty = FALSE) {
// This will perform a node_access check, so we don't have to.
return ctools_context_create('user_edit_form', $account);
- return NULL;
} \ No newline at end of file
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/plugins/content_types/block/block.inc b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/plugins/content_types/block/block.inc
index f5b0063..9d55e8a 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/plugins/content_types/block/block.inc
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/plugins/content_types/block/block.inc
@@ -85,6 +85,10 @@ function _ctools_block_content_type_content_type($module, $delta, $block) {
* doesn't cache its results anyway.
*/
function _ctools_block_load_blocks() {
+ if (!module_exists('block')) {
+ return array();
+ }
+
$blocks = &drupal_static(__FUNCTION__, NULL);
if (!isset($blocks)) {
global $theme_key;
@@ -142,8 +146,8 @@ function ctools_block_content_type_render($subtype, $conf) {
// 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;
}
+ $block = (object) $block;
if (empty($block)) {
return;
@@ -152,7 +156,7 @@ function ctools_block_content_type_render($subtype, $conf) {
$block->module = $module;
$block->delta = $delta;
- if ($module == 'block') {
+ if ($module == 'block' && !empty($info) && isset($info->title)) {
$block->title = $info->title;
}
else if (isset($block->subject)) {
@@ -280,7 +284,7 @@ function ctools_block_content_type_admin_title($subtype, $conf) {
*/
function ctools_block_content_type_admin_info($subtype, $conf) {
list($module, $delta) = _ctools_block_get_module_delta($subtype, $conf);
- $block = (object) module_invoke($module, 'block', 'view', $delta);
+ $block = (object) module_invoke($module, 'block_view', $delta);
// Sanitize the block because <script> tags can hose javascript up:
if (!empty($block->content)) {
@@ -493,11 +497,11 @@ function ctools_user_login_pane_render($subtype, $conf, $panel_args, $contexts)
$info->module = $module;
$info->delta = $delta;
- $block = new stdClass;
- $block->subject = t('User login');
+ $block = array();
+ $block['subject'] = t('User login');
// Manually set the content (rather than invoking block_view) because the
// block implementation won't render on certain URLs.
- $block->content = drupal_get_form('user_login_block');
+ $block['content'] = drupal_get_form('user_login_block');
// Allow modules to modify the block before it is viewed, via either
// hook_block_view_alter() or hook_block_view_MODULE_DELTA_alter().
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/plugins/content_types/comment/comment_reply_form.inc b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/plugins/content_types/comment/comment_reply_form.inc
new file mode 100644
index 0000000..f31a702
--- /dev/null
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/plugins/content_types/comment/comment_reply_form.inc
@@ -0,0 +1,50 @@
+<?php
+
+/**
+ * @file
+ * Ctools content-type plugin to provide a comment-reply form (replying either
+ * to a node or to another comment).
+ */
+
+// Only provide the plugin in the comment module is enabled.
+if (module_exists('comment')) {
+ $plugin = array(
+ 'single' => TRUE,
+ 'title' => t('Comment Reply Form'),
+ 'icon' => 'icon_comment.png',
+ 'description' => t('A form to add a new comment reply.'),
+ 'required context' => array(
+ new ctools_context_required(t('Node'), 'node'),
+ new ctools_context_optional(t('Comment'), 'comment'),
+ ),
+ 'category' => t('Comment'),
+ 'render callback' => 'ctools_comment_reply_form_content_type_render',
+ 'defaults' => array('anon_links' => false),
+ );
+}
+
+function ctools_comment_reply_form_content_type_render($subtype, $conf, $panel_args, $context) {
+
+ $comment = ($context[1]->identifier == 'No context') ? NULL : clone($context[1]->data);
+ $block = new stdClass();
+ $block->module = 'comments';
+ if ($comment) $block->delta = $comment->cid;
+ $block->title = t('Add comment');
+ $node = $context[0]->data;
+
+ module_load_include('inc', 'comment', 'comment.pages');
+ $block->content = comment_reply($node, ($comment ? $comment->cid : NULL));
+
+ return $block;
+}
+
+function ctools_comment_reply_form_content_type_admin_title($subtype, $conf, $context) {
+ return t('"@s" comment form', array('@s' => $context[0]->identifier));
+}
+
+function ctools_comment_reply_form_content_type_edit_form($form, &$form_state) {
+ return $form;
+}
+
+function ctools_comment_reply_form_content_type_edit_form_submit($form, &$form_state) {
+}
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/plugins/content_types/form/entity_form_field.inc b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/plugins/content_types/form/entity_form_field.inc
index 0183fc6..56fb76a 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/plugins/content_types/form/entity_form_field.inc
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/plugins/content_types/form/entity_form_field.inc
@@ -104,7 +104,12 @@ function ctools_entity_form_field_content_type_render($subtype, $conf, $panel_ar
function ctools_entity_form_field_content_type_admin_title($subtype, $conf, $context) {
list($entity_type, $field_name) = explode(':', $subtype, 2);
- $field = field_info_instance($entity_type, $field_name, $context->restrictions['type'][0]);
+ if (!empty($context->restrictions)) {
+ $field = field_info_instance($entity_type, $field_name, $context->restrictions['type'][0]);
+ }
+ else {
+ $field = array('label' => $subtype);
+ }
return t('"@s" @field form', array('@s' => $context->identifier, '@field' => $field['label']));
}
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/plugins/content_types/node_context/node_title.inc b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/plugins/content_types/node_context/node_title.inc
index 6a52306..bec8982 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/plugins/content_types/node_context/node_title.inc
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/plugins/content_types/node_context/node_title.inc
@@ -13,6 +13,9 @@ $plugin = array(
'category' => t('Node'),
'defaults' => array(
'link' => TRUE,
+ 'markup' => 'none',
+ 'id' => '',
+ 'class' => '',
),
);
@@ -30,11 +33,27 @@ function ctools_node_title_content_type_render($subtype, $conf, $panel_args, $co
// Load information about the node type.
$type = node_type_get_type($node);
+ // Generate the title
+ $content = !empty($conf['link']) ? l($node->title, 'node/' . $node->nid) : check_plain($node->title);
+
+ // Build any surrounding markup if so configured
+ if (isset($conf['markup']) && $conf['markup'] != 'none') {
+ $markup = '<' . $conf['markup'];
+ if (!empty($conf['id'])) {
+ $markup .= ' id="' . $conf['id'] . '"';
+ }
+ if (!empty($conf['class'])) {
+ $markup .= ' class="' . $conf['class'] . '"';
+ }
+ $markup .= '>' . $content . '</' . $conf['markup'] . '>' . "\n";
+ $content = $markup;
+ }
+
// Build the content type block.
$block = new stdClass();
$block->module = 'node_title';
$block->title = $type->title_label;
- $block->content = !empty($conf['link']) ? l($node->title, 'node/' . $node->nid) : check_plain($node->title);
+ $block->content = $content;
$block->delta = $node->nid;
return $block;
@@ -46,6 +65,34 @@ function ctools_node_title_content_type_render($subtype, $conf, $panel_args, $co
function ctools_node_title_content_type_edit_form($form, &$form_state) {
$conf = $form_state['conf'];
+ $form['markup'] = array(
+ '#title' => t('Title tag'),
+ '#type' => 'select',
+ '#options' => array(
+ 'none' => t('- No tag -'),
+ 'h1' => t('h1'),
+ 'h2' => t('h2'),
+ 'h3' => t('h3'),
+ 'h4' => t('h4'),
+ 'h5' => t('h5'),
+ 'h6' => t('h6'),
+ 'div' => t('div'),
+ ),
+ '#default_value' => $conf['markup'],
+ );
+
+ $form['id'] = array(
+ '#title' => t('CSS id to use'),
+ '#type' => 'textfield',
+ '#default_value' => $conf['id'],
+ );
+
+ $form['class'] = array(
+ '#title' => t('CSS class to use'),
+ '#type' => 'textfield',
+ '#default_value' => $conf['class'],
+ );
+
$form['link'] = array(
'#title' => t('Link to node'),
'#type' => 'checkbox',
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/plugins/content_types/node_form/node_form_language.inc b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/plugins/content_types/node_form/node_form_language.inc
new file mode 100644
index 0000000..2043c1c
--- /dev/null
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/plugins/content_types/node_form/node_form_language.inc
@@ -0,0 +1,41 @@
+<?php
+
+/**
+ * Plugins are described by creating a $plugin array which will be used
+ * by the system that includes this file.
+ */
+$plugin = array(
+ 'single' => TRUE,
+ 'icon' => 'icon_node_form.png',
+ 'title' => t('Node form languages'),
+ 'description' => t('The language selection form.'),
+ 'required context' => new ctools_context_required(t('Form'), 'node_form'),
+ 'category' => t('Form'),
+);
+
+function ctools_node_form_language_content_type_render($subtype, $conf, $panel_args, &$context) {
+ $block = new stdClass();
+ $block->module = t('node_form');
+
+ $block->delta = 'language-options';
+
+ if (isset($context->form)) {
+ if (!empty($context->form['language'])) {
+ $block->content['language'] = $context->form['language'];
+ unset($context->form['language']);
+ }
+ }
+ else {
+ $block->content = t('Node language form.');
+ }
+ return $block;
+}
+
+function ctools_node_form_language_content_type_admin_title($subtype, $conf, $context) {
+ return t('"@s" node form language field', array('@s' => $context->identifier));
+}
+
+function ctools_node_form_language_content_type_edit_form($form, &$form_state) {
+ // provide a blank form so we have a place to have context setting.
+ return $form;
+} \ No newline at end of file
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/plugins/content_types/page/page_actions.inc b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/plugins/content_types/page/page_actions.inc
index e8762d4..c20c408 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/plugins/content_types/page/page_actions.inc
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/plugins/content_types/page/page_actions.inc
@@ -26,7 +26,7 @@ $plugin = array(
*/
function ctools_page_actions_content_type_render($subtype, $conf, $panel_args) {
$block = new stdClass();
- $block->content = menu_local_actions();
+ $block->content = theme('ctools_menu_local_actions_wrapper', array('links' => menu_local_actions()));
return $block;
}
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/plugins/content_types/term_context/term_list.inc b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/plugins/content_types/term_context/term_list.inc
index 4585611..dc3124b 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/plugins/content_types/term_context/term_list.inc
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/plugins/content_types/term_context/term_list.inc
@@ -49,7 +49,7 @@ function ctools_term_list_content_type_render($subtype, $conf, $panel_args, $con
case 'parent':
$terms = taxonomy_get_parents($term->tid);
- $block->title = format_plural(count($terms), 'Parent term', 'Parent terms');
+ $block->title = count($terms) == 1 ? t('Parent term') : t('Parent terms');
break;
case 'sibling':
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/plugins/content_types/user_context/user_profile.inc b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/plugins/content_types/user_context/user_profile.inc
index 3e769d6..6c41882 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/plugins/content_types/user_context/user_profile.inc
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/plugins/content_types/user_context/user_profile.inc
@@ -21,7 +21,7 @@ $plugin = array(
*/
function ctools_user_profile_content_type_render($subtype, $conf, $panel_args, $context) {
$account = isset($context->data) ? clone($context->data) : NULL;
- if (!$account || ($account->access == 0 && !user_access('administer users'))) {
+ if (!$account) {
return NULL;
}
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/plugins/contexts/string.inc b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/plugins/contexts/string.inc
index c53acae..0ea5e52 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/plugins/contexts/string.inc
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/plugins/contexts/string.inc
@@ -15,7 +15,7 @@ $plugin = array(
'description' => t('A context that is just a string.'),
'context' => 'ctools_context_create_string',
'keyword' => 'string',
- 'no ui' => TRUE,
+ 'no ui' => FALSE,
'context name' => 'string',
'convert list' => array(
'raw' => t('Raw string'),
@@ -45,7 +45,7 @@ function ctools_context_create_string($empty, $data = NULL, $conf = FALSE) {
if ($data !== FALSE ) {
$context->data = $data;
- $context->title = check_plain($data);
+ $context->title = ($conf) ? check_plain($data['identifier']) : check_plain($data);
return $context;
}
}
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/plugins/contexts/user_edit_form.inc b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/plugins/contexts/user_edit_form.inc
index 89ee2b4..da0cca0 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/plugins/contexts/user_edit_form.inc
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/plugins/contexts/user_edit_form.inc
@@ -30,16 +30,29 @@ $plugin = array(
* are not always created from the UI.
*/
function ctools_context_create_user_edit_form($empty, $user = NULL, $conf = FALSE) {
- static $created;
+ // Determine the user category.
+ $category = !empty($conf['category']) ? $conf['category'] : FALSE;
+ unset($conf['category']);
+
+ // Return previously created contexts, per category.
+ static $created = array();
+ if (!empty($created[$category])) {
+ return $created[$category];
+ }
+ // If no category was specified, use the default 'account'.
+ if (!$category) {
+ $category = 'account';
+ }
+
$context = new ctools_context(array('form', 'user_edit', 'user_form', 'user_edit_form', 'user', 'entity:user'));
+ // Store this context for later.
+ $created[$category] = $context;
$context->plugin = 'user_edit_form';
-
- if ($empty || (isset($created) && $created)) {
+ if ($empty) {
return $context;
}
- $created = TRUE;
- if ($conf) {
+ if (!empty($conf)) {
// In this case, $user is actually our $conf array.
$uid = is_array($user) && isset($user['uid']) ? $user['uid'] : (is_object($user) ? $user->uid : 0);
@@ -58,7 +71,7 @@ function ctools_context_create_user_edit_form($empty, $user = NULL, $conf = FALS
if (!empty($user)) {
$form_id = 'user_profile_form';
- $form_state = array('want form' => TRUE, 'build_info' => array('args' => array($user)));
+ $form_state = array('want form' => TRUE, 'build_info' => array('args' => array($user, $category)));
$file = drupal_get_path('module', 'user') . '/user.pages.inc';
require_once DRUPAL_ROOT . '/' . $file;
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/plugins/relationships/user_category_edit_form_from_user.inc b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/plugins/relationships/user_category_edit_form_from_user.inc
new file mode 100644
index 0000000..28dac72
--- /dev/null
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/plugins/relationships/user_category_edit_form_from_user.inc
@@ -0,0 +1,31 @@
+<?php
+
+/**
+ * @file
+ * Plugin to provide an relationship handler for term from node.
+ */
+
+/**
+ * Plugins are described by creating a $plugin array which will be used
+ * by the system that includes this file.
+ */
+$plugin = array(
+ 'title' => t('User category edit form from user'),
+ 'keyword' => 'user_category_form',
+ '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',
+);
+
+/**
+ * Return a new context based on an existing context.
+ */
+function ctools_user_category_edit_form_from_user_context($context, $conf) {
+ if (empty($context->data)) {
+ return ctools_context_create_empty('user_edit_form', NULL);
+ }
+
+ if (isset($context->data->user_category)) {
+ return ctools_context_create('user_edit_form', $context->data, array('category' => $context->data->user_category));
+ }
+}
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/stylizer/stylizer.info b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/stylizer/stylizer.info
index 9c7f117..888cc8e 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/stylizer/stylizer.info
+++ b/kolab.org/www/drupal-7.18/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-18
-version = "7.x-1.2"
+; Information added by drupal.org packaging script on 2013-04-03
+version = "7.x-1.3"
core = "7.x"
project = "ctools"
-datestamp = "1345319204"
+datestamp = "1365013512"
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/tests/context.test b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/tests/context.test
index b5f6fb1..bdf14e3 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/tests/context.test
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/tests/context.test
@@ -23,6 +23,10 @@ class CtoolsContextKeywordsSubstitutionTestCase extends DrupalWebTestCase {
// Run tests on some edge cases.
$checks = array(
+ '%node:changed:raw:' => array(
+ "{$node->changed}:",
+ t('Multi-level token has been replaced. Colon left untouched.'),
+ ),
'%node:title' => array(
"{$node->title}",
t('Keyword and converter have been replaced.'),
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/tests/ctools_export_test/ctools_export_test.info b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/tests/ctools_export_test/ctools_export_test.info
index 2d975c3..669c4ae 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/tests/ctools_export_test/ctools_export_test.info
+++ b/kolab.org/www/drupal-7.18/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-18
-version = "7.x-1.2"
+; Information added by drupal.org packaging script on 2013-04-03
+version = "7.x-1.3"
core = "7.x"
project = "ctools"
-datestamp = "1345319204"
+datestamp = "1365013512"
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/tests/ctools_plugin_test.info b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/tests/ctools_plugin_test.info
index 6d5e9cd..5bb61ed 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/tests/ctools_plugin_test.info
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/tests/ctools_plugin_test.info
@@ -7,11 +7,13 @@ files[] = ctools.plugins.test
files[] = object_cache.test
files[] = css.test
files[] = context.test
+files[] = math_expression.test
+files[] = math_expression_stack.test
hidden = TRUE
-; Information added by drupal.org packaging script on 2012-08-18
-version = "7.x-1.2"
+; Information added by drupal.org packaging script on 2013-04-03
+version = "7.x-1.3"
core = "7.x"
project = "ctools"
-datestamp = "1345319204"
+datestamp = "1365013512"
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/tests/math_expression.test b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/tests/math_expression.test
new file mode 100644
index 0000000..730e079
--- /dev/null
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/tests/math_expression.test
@@ -0,0 +1,129 @@
+<?php
+
+/**
+ * @file
+ * Contains \CtoolsMathExpressionTestCase.
+ */
+
+/**
+ * Tests the MathExpression library of ctools.
+ */
+class CtoolsMathExpressionTestCase extends DrupalWebTestCase {
+ public static function getInfo() {
+ return array(
+ 'name' => 'CTools math expression tests',
+ 'description' => 'Test the math expression library of ctools.',
+ 'group' => 'Chaos Tools Suite',
+ );
+ }
+
+ public function setUp() {
+ parent::setUp('ctools', 'ctools_plugin_test');
+ }
+
+ /**
+ * Returns a random double between 0 and 1.
+ */
+ protected function rand01() {
+ return rand(0, PHP_INT_MAX) / PHP_INT_MAX;
+ }
+
+ /**
+ * A custom assertion with checks the values in a certain range.
+ */
+ protected function assertFloat($first, $second, $delta = 0.0000001, $message = '', $group = 'Other') {
+ return $this->assert(abs($first - $second) <= $delta, $message ? $message : t('Value @first is equal to value @second.', array('@first' => var_export($first, TRUE), '@second' => var_export($second, TRUE))), $group);
+ }
+
+ public function testArithmetic() {
+ $math_expression = new ctools_math_expr();
+
+ // Test constant expressions.
+ $this->assertEqual($math_expression->e('2'), 2);
+ $random_number = rand(0, 10);
+ $this->assertEqual($random_number, $math_expression->e((string) $random_number));
+
+ // Test simple arithmetic.
+ $random_number_a = rand(5, 10);
+ $random_number_b = rand(5, 10);
+ $this->assertEqual($random_number_a + $random_number_b, $math_expression->e("$random_number_a + $random_number_b"));
+ $this->assertEqual($random_number_a - $random_number_b, $math_expression->e("$random_number_a - $random_number_b"));
+ $this->assertEqual($random_number_a * $random_number_b, $math_expression->e("$random_number_a * $random_number_b"));
+ $this->assertEqual($random_number_a / $random_number_b, $math_expression->e("$random_number_a / $random_number_b"));
+
+ // Test Associative property.
+ $random_number_c = rand(5, 10);
+ $this->assertEqual($math_expression->e("$random_number_a + ($random_number_b + $random_number_c)"), $math_expression->e("($random_number_a + $random_number_b) + $random_number_c"));
+ $this->assertEqual($math_expression->e("$random_number_a * ($random_number_b * $random_number_c)"), $math_expression->e("($random_number_a * $random_number_b) * $random_number_c"));
+
+ // Test Commutative property.
+ $this->assertEqual($math_expression->e("$random_number_a + $random_number_b"), $math_expression->e("$random_number_b + $random_number_a"));
+ $this->assertEqual($math_expression->e("$random_number_a * $random_number_b"), $math_expression->e("$random_number_b * $random_number_a"));
+
+ // Test Distributive property.
+ $this->assertEqual($math_expression->e("($random_number_a + $random_number_b) * $random_number_c"), $math_expression->e("($random_number_a * $random_number_c + $random_number_b * $random_number_c)"));
+
+ $this->assertEqual(pow($random_number_a, $random_number_b), $math_expression->e("$random_number_a ^ $random_number_b"));
+ }
+
+ public function testBuildInFunctions() {
+ $math_expression = new ctools_math_expr();
+
+ // @todo: maybe run this code multiple times to test different values.
+ $random_double = $this->rand01();
+ $random_int = rand(5, 10);
+ $this->assertFloat(sin($random_double), $math_expression->e("sin($random_double)"));
+ $this->assertFloat(cos($random_double), $math_expression->e("cos($random_double)"));
+ $this->assertFloat(tan($random_double), $math_expression->e("tan($random_double)"));
+ $this->assertFloat(exp($random_double), $math_expression->e("exp($random_double)"));
+ $this->assertFloat(sqrt($random_double), $math_expression->e("sqrt($random_double)"));
+ $this->assertFloat(log($random_double), $math_expression->e("ln($random_double)"));
+ $this->assertFloat(round($random_double), $math_expression->e("round($random_double)"));
+ $this->assertFloat(abs($random_double + $random_int), $math_expression->e('abs(' . ($random_double + $random_int) . ')'));
+ $this->assertEqual(round($random_double + $random_int), $math_expression->e('round(' . ($random_double + $random_int) . ')'));
+ $this->assertEqual(ceil($random_double + $random_int), $math_expression->e('ceil(' . ($random_double + $random_int) . ')'));
+ $this->assertEqual(floor($random_double + $random_int), $math_expression->e('floor(' . ($random_double + $random_int) . ')'));
+
+ // @fixme: you can't run time without an argument.
+ $this->assertFloat(time(), $math_expression->e('time(1)'));
+
+ $random_double_a = $this->rand01();
+ $random_double_b = $this->rand01();
+ // @fixme: max/min don't work at the moment.
+// $this->assertFloat(max($random_double_a, $random_double_b), $math_expression->e("max($random_double_a, $random_double_b)"));
+// $this->assertFloat(min($random_double_a, $random_double_b), $math_expression->e("min($random_double_a, $random_double_b)"));
+ }
+
+ public function testVariables() {
+ $math_expression = new ctools_math_expr();
+
+ $random_number_a = rand(5, 10);
+ $random_number_b = rand(5, 10);
+
+ // Store the first random number and use it on calculations.
+ $math_expression->e("var = $random_number_a");
+ $this->assertEqual($random_number_a + $random_number_b, $math_expression->e("var + $random_number_b"));
+ $this->assertEqual($random_number_a * $random_number_b, $math_expression->e("var * $random_number_b"));
+ $this->assertEqual($random_number_a - $random_number_b, $math_expression->e("var - $random_number_b"));
+ $this->assertEqual($random_number_a / $random_number_b, $math_expression->e("var / $random_number_b"));
+ }
+
+ public function testCustomFunctions() {
+ $math_expression = new ctools_math_expr();
+
+ $random_number_a = rand(5, 10);
+ $random_number_b = rand(5, 10);
+
+ // Create a one-argument function.
+ $math_expression->e("f(x) = 2 * x");
+ $this->assertEqual($random_number_a * 2, $math_expression->e("f($random_number_a)"));
+ $this->assertEqual($random_number_b * 2, $math_expression->e("f($random_number_b)"));
+
+ // Create a two-argument function.
+ $math_expression->e("g(x, y) = 2 * x + y");
+ $this->assertEqual($random_number_a * 2 + $random_number_b, $math_expression->e("g($random_number_a, $random_number_b)"));
+
+ // Use a custom function in another function.
+ $this->assertEqual(($random_number_a * 2 + $random_number_b) * 2, $math_expression->e("f(g($random_number_a, $random_number_b))"));
+ }
+}
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/tests/math_expression_stack.test b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/tests/math_expression_stack.test
new file mode 100644
index 0000000..8143a55
--- /dev/null
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/tests/math_expression_stack.test
@@ -0,0 +1,63 @@
+<?php
+
+/**
+ * @file
+ * Contains \CtoolsMathExpressionStackTestCase
+ */
+
+/**
+ * Tests the simple MathExpressionStack class.
+ */
+class CtoolsMathExpressionStackTestCase extends DrupalWebTestCase {
+ public static function getInfo() {
+ return array(
+ 'name' => 'CTools math expression stack tests',
+ 'description' => 'Test the stack class of the math expression library.',
+ 'group' => 'Chaos Tools Suite',
+ );
+ }
+
+ public function setUp() {
+ parent::setUp('ctools', 'ctools_plugin_test');
+ }
+
+ public function testStack() {
+ $stack = new ctools_math_expr_stack();
+
+ // Test the empty stack.
+ $this->assertNull($stack->last());
+ $this->assertNull($stack->pop());
+
+ // Add an element and see whether it's the right element.
+ $value = $this->randomName();
+ $stack->push($value);
+ $this->assertIdentical($value, $stack->last());
+ $this->assertIdentical($value, $stack->pop());
+ $this->assertNull($stack->pop());
+
+ // Add multiple elements and see whether they are returned in the right order.
+ $values = array($this->randomName(), $this->randomName(), $this->randomName());
+ foreach ($values as $value) {
+ $stack->push($value);
+ }
+
+ // Test the different elements at different positions with the last() method.
+ $count = count($values);
+ foreach ($values as $key => $value) {
+ $this->assertEqual($value, $stack->last($count - $key));
+ }
+
+ // Pass in a non-valid number to last.
+ $non_valid_number = rand(10, 20);
+ $this->assertNull($stack->last($non_valid_number));
+
+ // Test the order of the poping.
+ $values = array_reverse($values);
+ foreach ($values as $key => $value) {
+ $this->assertEqual($stack->last(), $value);
+ $this->assertEqual($stack->pop(), $value);
+ }
+ $this->assertNull($stack->pop());
+
+ }
+}
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/views_content/plugins/content_types/views.inc b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/views_content/plugins/content_types/views.inc
index deea741..262d81d 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/views_content/plugins/content_types/views.inc
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/views_content/plugins/content_types/views.inc
@@ -144,7 +144,7 @@ function views_content_views_content_type_render($subtype, $conf, $panel_args, $
list($cid, $converter) = explode('.', $context_info, 2);
}
if (!empty($contexts[$cid])) {
- $arg = ctools_context_convert_context($contexts[$cid], $converter);
+ $arg = ctools_context_convert_context($contexts[$cid], $converter, array('sanitize' => FALSE));
array_splice($args, $count, 0, array($arg));
}
else {
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/views_content/plugins/content_types/views_panes.inc b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/views_content/plugins/content_types/views_panes.inc
index a27a26c..10a6a83 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/views_content/plugins/content_types/views_panes.inc
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/views_content/plugins/content_types/views_panes.inc
@@ -156,7 +156,7 @@ function views_content_views_panes_content_type_render($subtype, $conf, $panel_a
if (isset($contexts[$key])) {
if (strpos($argument['context'], '.')) {
list($context, $converter) = explode('.', $argument['context'], 2);
- $args[] = ctools_context_convert_context($contexts[$key], $converter);
+ $args[] = ctools_context_convert_context($contexts[$key], $converter, array('sanitize' => FALSE));
}
else {
$args[] = $contexts[$key]->argument;
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/views_content/plugins/relationships/view_from_argument.inc b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/views_content/plugins/relationships/view_from_argument.inc
index 4da5fe5..cefc6db 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/views_content/plugins/relationships/view_from_argument.inc
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/views_content/plugins/relationships/view_from_argument.inc
@@ -1,5 +1,4 @@
<?php
-// $Id$
/**
* @file
@@ -77,7 +76,7 @@ function views_content_view_from_argument_context($contexts, $conf) {
if (isset($contexts [$key])) {
if (strpos($argument['context'], '.')) {
list($context, $converter) = explode('.', $argument['context'], 2);
- $args[] = ctools_context_convert_context($contexts[$key], $converter);
+ $args[] = ctools_context_convert_context($contexts[$key], $converter, array('sanitize' => FALSE));
}
else {
$args[] = $contexts[$key]->argument;
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/views_content/views_content.info b/kolab.org/www/drupal-7.18/sites/all/modules/ctools/views_content/views_content.info
index cd7ce44..1782d37 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/ctools/views_content/views_content.info
+++ b/kolab.org/www/drupal-7.18/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-18
-version = "7.x-1.2"
+; Information added by drupal.org packaging script on 2013-04-03
+version = "7.x-1.3"
core = "7.x"
project = "ctools"
-datestamp = "1345319204"
+datestamp = "1365013512"