summaryrefslogtreecommitdiff
path: root/kolab.org/www/drupal-7.15/sites/all/modules/ctools/includes
diff options
context:
space:
mode:
authorTorsten Grote <grote@kolabsys.com>2012-08-27 12:47:35 (GMT)
committerTorsten Grote <grote@kolabsys.com>2012-08-27 12:47:35 (GMT)
commit7b5e4a2b04e4fb38485bc12965e07794388d0224 (patch)
tree42031777dcb7476a63e9d6080ab9b8eef8ebb6f0 /kolab.org/www/drupal-7.15/sites/all/modules/ctools/includes
parentee39408867ae52c2321036a67c472e684c1e1108 (diff)
downloadkolab.org-www-7b5e4a2b04e4fb38485bc12965e07794388d0224.tar.gz
updated ctools, ldap and views modules
Diffstat (limited to 'kolab.org/www/drupal-7.15/sites/all/modules/ctools/includes')
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/ctools/includes/context-task-handler.inc34
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/ctools/includes/context.inc2
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/ctools/includes/css.inc5
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/ctools/includes/export.inc7
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/ctools/includes/wizard.inc26
5 files changed, 52 insertions, 22 deletions
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/ctools/includes/context-task-handler.inc b/kolab.org/www/drupal-7.15/sites/all/modules/ctools/includes/context-task-handler.inc
index 10fd793..617f20e 100644
--- a/kolab.org/www/drupal-7.15/sites/all/modules/ctools/includes/context-task-handler.inc
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/ctools/includes/context-task-handler.inc
@@ -100,6 +100,24 @@ function ctools_context_handler_render_handler($task, $subtask, $handler, $conte
return NULL;
}
+ if ($page) {
+ if ($subtask) {
+ $task_name = page_manager_make_task_name($task['name'], $subtask['name']);
+ }
+ else {
+ $task_name = $task['name'];
+ }
+
+ page_manager_get_current_page(array(
+ 'name' => $task_name,
+ 'task' => $task,
+ 'subtask' => $subtask,
+ 'contexts' => $contexts,
+ 'arguments' => $args,
+ 'handler' => $handler,
+ ));
+ }
+
$info = $function($handler, $contexts, $args);
if (!$info) {
return NULL;
@@ -119,22 +137,6 @@ function ctools_context_handler_render_handler($task, $subtask, $handler, $conte
return $info;
}
- if ($subtask) {
- $task_name = page_manager_make_task_name($task['name'], $subtask['name']);
- }
- else {
- $task_name = $task['name'];
- }
-
- page_manager_get_current_page(array(
- 'name' => $task_name,
- 'task' => $task,
- 'subtask' => $subtask,
- 'contexts' => $contexts,
- 'arguments' => $args,
- 'handler' => $handler,
- ));
-
if (!empty($info['response code']) && $info['response code'] != 200) {
switch ($info['response code']) {
case 403:
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/ctools/includes/context.inc b/kolab.org/www/drupal-7.15/sites/all/modules/ctools/includes/context.inc
index 720a6fc..5c7a4ce 100644
--- a/kolab.org/www/drupal-7.15/sites/all/modules/ctools/includes/context.inc
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/ctools/includes/context.inc
@@ -633,7 +633,7 @@ function ctools_context_keyword_substitute($string, $keywords, $contexts, $conve
// Look for context matches we we only have to convert known matches.
$matches = array();
- if (preg_match_all('/%([a-zA-Z0-9%:_-]+)/us', $string, $matches)) {
+ if (preg_match_all('/%(%|[a-zA-Z0-9_-]+(?:\:[a-zA-Z0-9_-]+)?)/us', $string, $matches)) {
foreach ($matches[1] as $keyword) {
// Ignore anything it finds with %%.
if ($keyword[0] == '%') {
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/ctools/includes/css.inc b/kolab.org/www/drupal-7.15/sites/all/modules/ctools/includes/css.inc
index 8bc4c66..ee11d48 100644
--- a/kolab.org/www/drupal-7.15/sites/all/modules/ctools/includes/css.inc
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/ctools/includes/css.inc
@@ -284,8 +284,9 @@ function ctools_css_disassemble($css) {
$disassembled_css = array();
// Remove comments.
$css = preg_replace("/\/\*(.*)?\*\//Usi", "", $css);
- // Split out each statement
- $statements = preg_split('/[;}]/', $css);
+ // Split out each statement. Match either a right curly brace or a semi-colon
+ // that precedes a left curly brace with no right curly brace separating them.
+ $statements = preg_split('/}|;(?=[^}]*{)/', $css);
// If we have any statements, parse them.
if (!empty($statements)) {
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/ctools/includes/export.inc b/kolab.org/www/drupal-7.15/sites/all/modules/ctools/includes/export.inc
index dfbe74b..0b2ef46 100644
--- a/kolab.org/www/drupal-7.15/sites/all/modules/ctools/includes/export.inc
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/ctools/includes/export.inc
@@ -386,10 +386,15 @@ function ctools_export_crud_disable($table, $object) {
*/
function ctools_export_load_object($table, $type = 'all', $args = array()) {
$cache = &drupal_static(__FUNCTION__);
+ $cache_table_exists = &drupal_static(__FUNCTION__ . '_table_exists', array());
$cached_database = &drupal_static('ctools_export_load_object_all');
+ if (!array_key_exists($table, $cache_table_exists)) {
+ $cache_table_exists[$table] = db_table_exists($table);
+ }
+
$schema = ctools_export_get_schema($table);
- if (empty($schema) || !db_table_exists($table)) {
+ if (empty($schema) || !$cache_table_exists[$table]) {
return array();
}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/ctools/includes/wizard.inc b/kolab.org/www/drupal-7.15/sites/all/modules/ctools/includes/wizard.inc
index 946ed0f..6f5d794 100644
--- a/kolab.org/www/drupal-7.15/sites/all/modules/ctools/includes/wizard.inc
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/ctools/includes/wizard.inc
@@ -430,6 +430,12 @@ function ctools_wizard_submit(&$form, &$form_state) {
}
else if ($type == 'next') {
$form_state['redirect'] = ctools_wizard_get_path($form_state['form_info'], $form_state['clicked_button']['#next']);
+ if (!empty($_GET['destination'])) {
+ // We don't want drupal_goto redirect this request
+ // back. ctools_wizard_get_path ensures that the destination is
+ // carried over on subsequent pages.
+ unset($_GET['destination']);
+ }
}
else if (isset($form_state['form_info']['return path'])) {
$form_state['redirect'] = $form_state['form_info']['return path'];
@@ -449,11 +455,27 @@ function ctools_wizard_get_path($form_info, $step) {
foreach ($form_info['path'] as $id => $part) {
$form_info['path'][$id] = str_replace('%step', $step, $form_info['path'][$id]);
}
- return $form_info['path'];
+ $path = $form_info['path'];
}
else {
- return array(str_replace('%step', $step, $form_info['path']));
+ $path = array(str_replace('%step', $step, $form_info['path']));
+ }
+
+ // If destination is set, carry it over so it'll take effect when
+ // saving. The submit handler will unset destination to avoid drupal_goto
+ // redirecting us.
+ if (!empty($_GET['destination'])) {
+ // Ensure that options is an array.
+ if (!isset($path[1]) || !is_array($path[1])) {
+ $path[1] = array();
+ }
+ // Ensure that the query part of options is an array.
+ $path[1] += array('query' => array());
+ // Add the destination parameter, if not set already.
+ $path[1]['query'] += drupal_get_destination();
}
+
+ return $path;
}
/**