summaryrefslogtreecommitdiff
path: root/kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins
diff options
context:
space:
mode:
authorTorsten Grote <t@grobox.de>2014-03-26 14:49:27 (GMT)
committerTorsten Grote <t@grobox.de>2014-03-26 14:49:27 (GMT)
commit2a4fb496aefa326019008b73a237d08ace558a37 (patch)
treec72172b16387c107f56bc74a33367c0c1f18d1e5 /kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins
parent059014fd0353a4ab2158b617e92f3dd735b5ef7d (diff)
parent7d56a926f3dfb5a75cb1c0bed7621bf6994a8528 (diff)
downloadkolab.org-www-2a4fb496aefa326019008b73a237d08ace558a37.tar.gz
Merge branch 'master' into productionproduction
Diffstat (limited to 'kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins')
-rw-r--r--kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/access/entity_field_value.inc6
-rw-r--r--kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/access/term_vocabulary.inc60
-rw-r--r--kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/arguments/rid.inc2
-rw-r--r--kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/content_types/block/block.inc40
-rw-r--r--kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/content_types/comment/comment_reply_form.inc2
-rw-r--r--kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/content_types/custom/custom.inc5
-rw-r--r--kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/content_types/entity_context/entity_field.inc18
-rw-r--r--kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/content_types/entity_context/entity_field_extra.inc22
-rw-r--r--kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/content_types/form/entity_form_field.inc5
-rw-r--r--kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/content_types/page/page_slogan.inc4
-rw-r--r--kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/content_types/token/token.inc11
-rw-r--r--kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/content_types/user_context/profile_fields.inc2
-rw-r--r--kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/contexts/token.inc3
-rw-r--r--kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/export_ui/ctools_export_ui.class.php10
-rw-r--r--kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/relationships/book_parent.inc4
-rw-r--r--kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/relationships/entity_from_field.inc12
-rw-r--r--kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/relationships/terms_from_node.inc2
17 files changed, 155 insertions, 53 deletions
diff --git a/kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/access/entity_field_value.inc b/kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/access/entity_field_value.inc
index e5857d8..ab36ca9 100644
--- a/kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/access/entity_field_value.inc
+++ b/kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/access/entity_field_value.inc
@@ -139,6 +139,12 @@ function ctools_entity_field_value_ctools_access_settings_submit($form, &$form_s
* Check for access.
*/
function ctools_entity_field_value_ctools_access_check($conf, $context, $plugin) {
+ if (!isset($context->data)) {
+ // If the context doesn't exist -- for example, a newly added entity
+ // reference is used as a pane visibility criteria -- we deny access.
+ return FALSE;
+ }
+
list($parent, $entity_type, $bundle_type, $field_name) = explode(':', $plugin['name']);
if ($field_items = field_get_items($entity_type, $context->data, $field_name)) {
diff --git a/kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/access/term_vocabulary.inc b/kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/access/term_vocabulary.inc
index 644600f..b003138 100644
--- a/kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/access/term_vocabulary.inc
+++ b/kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/access/term_vocabulary.inc
@@ -17,7 +17,11 @@ $plugin = array(
'settings form' => 'ctools_term_vocabulary_ctools_access_settings',
'settings form submit' => 'ctools_term_vocabulary_ctools_access_settings_submit',
'summary' => 'ctools_term_vocabulary_ctools_access_summary',
- 'required context' => new ctools_context_required(t('Vocabulary'), array('taxonomy_term', 'terms', 'taxonomy_vocabulary')),
+ 'required context' => new ctools_context_required(t('Vocabulary'), array(
+ 'taxonomy_term',
+ 'terms',
+ 'taxonomy_vocabulary'
+ )),
);
/**
@@ -27,15 +31,17 @@ function ctools_term_vocabulary_ctools_access_settings($form, &$form_state, $con
$options = array();
$vocabularies = taxonomy_get_vocabularies();
foreach ($vocabularies as $voc) {
- $options[$voc->vid] = check_plain($voc->name);
+ $options[$voc->machine_name] = check_plain($voc->name);
}
- $form['settings']['vids'] = array(
+ _ctools_term_vocabulary_ctools_access_map_vids($conf);
+
+ $form['settings']['machine_name'] = array(
'#type' => 'checkboxes',
'#title' => t('Vocabularies'),
'#options' => $options,
'#description' => t('Only the checked vocabularies will be valid.'),
- '#default_value' => $conf['vids'],
+ '#default_value' => $conf['machine_name'],
);
return $form;
}
@@ -44,7 +50,7 @@ function ctools_term_vocabulary_ctools_access_settings($form, &$form_state, $con
* Compress the term_vocabularys allowed to the minimum.
*/
function ctools_term_vocabulary_ctools_access_settings_submit($form, &$form_state) {
- $form_state['values']['settings']['vids'] = array_filter($form_state['values']['settings']['vids']);
+ $form_state['values']['settings']['machine_name'] = array_filter($form_state['values']['settings']['machine_name']);
}
/**
@@ -53,11 +59,13 @@ function ctools_term_vocabulary_ctools_access_settings_submit($form, &$form_stat
function ctools_term_vocabulary_ctools_access_check($conf, $context) {
// As far as I know there should always be a context at this point, but this
// is safe.
- if (empty($context) || empty($context->data) || empty($context->data->vid)) {
+ if (empty($context) || empty($context->data) || empty($context->data->vocabulary_machine_name)) {
return FALSE;
}
- if (array_filter($conf['vids']) && empty($conf['vids'][$context->data->vid])) {
+ _ctools_term_vocabulary_ctools_access_map_vids($conf);
+
+ if (array_filter($conf['machine_name']) && empty($conf['machine_name'][$context->data->vocabulary_machine_name])) {
return FALSE;
}
@@ -73,15 +81,47 @@ function ctools_term_vocabulary_ctools_access_summary($conf, $context) {
}
$vocabularies = taxonomy_get_vocabularies();
+ _ctools_term_vocabulary_ctools_access_map_vids($conf);
+
$names = array();
- foreach (array_filter($conf['vids']) as $vid) {
- $names[] = check_plain($vocabularies[$vid]->name);
+ if (!empty($conf['machine_name'])) {
+ foreach (array_filter($conf['machine_name']) as $machine_name) {
+ foreach ($vocabularies as $vocabulary) {
+ if ($vocabulary->machine_name === $machine_name) {
+ $names[] = check_plain($vocabulary->name);
+ continue;
+ }
+ }
+ }
}
if (empty($names)) {
return t('@identifier is any vocabulary', array('@identifier' => $context->identifier));
}
- return format_plural(count($names), '@identifier vocabulary is "@vids"', '@identifier vocabulary is one of "@vids"', array('@vids' => implode(', ', $names), '@identifier' => $context->identifier));
+ return format_plural(count($names), '@identifier vocabulary is "@machine_names"', '@identifier vocabulary is one of "@machine_names"', array(
+ '@machine_names' => implode(', ', $names),
+ '@identifier' => $context->identifier
+ ));
}
+/**
+ * Helper function to map the vids from old features to the new machine_name.
+ *
+ * Add the machine_name key to $conf if the vids key exist.
+ *
+ * @param array $conf
+ * The configuration of this plugin.
+ */
+function _ctools_term_vocabulary_ctools_access_map_vids(&$conf) {
+ if (!empty($conf['vids'])) {
+ $conf['machine_name'] = array();
+ $vocabularies = taxonomy_get_vocabularies();
+ foreach ($conf['vids'] as $vid) {
+ $machine_name = $vocabularies[$vid]->machine_name;
+ $conf['machine_name'][$machine_name] = $vocabularies[$vid]->machine_name;
+ }
+ }
+}
+
+
diff --git a/kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/arguments/rid.inc b/kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/arguments/rid.inc
index dd30848..2661153 100644
--- a/kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/arguments/rid.inc
+++ b/kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/arguments/rid.inc
@@ -39,7 +39,7 @@ function ctools_argument_rid_context($arg = NULL, $conf = NULL, $empty = FALSE)
return FALSE;
}
- $nid = db_query('SELECT nid FROM {node_revisions} WHERE vid = :vid', array(':vid' => $arg))->fetchField();
+ $nid = db_query('SELECT nid FROM {node_revision} WHERE vid = :vid', array(':vid' => $arg))->fetchField();
$node = node_load($nid, $arg);
if (!$node) {
return FALSE;
diff --git a/kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/content_types/block/block.inc b/kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/content_types/block/block.inc
index 9d55e8a..7c551b9 100644
--- a/kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/content_types/block/block.inc
+++ b/kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/content_types/block/block.inc
@@ -40,6 +40,11 @@ function ctools_block_content_type_content_type($subtype_id) {
* of the form "$module . '_ctools_block_info'".
*/
function ctools_block_content_type_content_types() {
+ $types = &drupal_static(__FUNCTION__);
+ if (isset($types)) {
+ return $types;
+ }
+
$types = array();
foreach (module_implements('block_info') as $module) {
$module_blocks = module_invoke($module, 'block_info');
@@ -156,14 +161,16 @@ function ctools_block_content_type_render($subtype, $conf) {
$block->module = $module;
$block->delta = $delta;
- if ($module == 'block' && !empty($info) && isset($info->title)) {
- $block->title = $info->title;
- }
- else if (isset($block->subject)) {
- $block->title = $block->subject;
- }
- else {
- $block->title = NULL;
+ if (!isset($block->title)) {
+ if ($module == 'block' && !empty($info) && isset($info->title)) {
+ $block->title = $info->title;
+ }
+ else if (isset($block->subject)) {
+ $block->title = $block->subject;
+ }
+ else {
+ $block->title = NULL;
+ }
}
if (module_exists('block') && user_access('administer blocks')) {
@@ -286,13 +293,18 @@ 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);
- // Sanitize the block because <script> tags can hose javascript up:
- if (!empty($block->content)) {
- $block->content = filter_xss_admin($block->content);
- }
+ if (!empty($block)) {
+ // Sanitize the block because <script> tags can hose javascript up:
+ if (!empty($block->content)) {
+ $block->content = filter_xss_admin(render($block->content));
+ }
- if (!empty($block) && !empty($block->subject)) {
- $block->title = $block->subject;
+ if (!empty($block->subject)) {
+ $block->title = $block->subject;
+ }
+ elseif (empty($block->title)) {
+ $block->title = t('No title');
+ }
return $block;
}
}
diff --git a/kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/content_types/comment/comment_reply_form.inc b/kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/content_types/comment/comment_reply_form.inc
index f31a702..c05effb 100644
--- a/kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/content_types/comment/comment_reply_form.inc
+++ b/kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/content_types/comment/comment_reply_form.inc
@@ -25,7 +25,7 @@ if (module_exists('comment')) {
function ctools_comment_reply_form_content_type_render($subtype, $conf, $panel_args, $context) {
- $comment = ($context[1]->identifier == 'No context') ? NULL : clone($context[1]->data);
+ $comment = ($context[1]->identifier == t('No context')) ? NULL : clone($context[1]->data);
$block = new stdClass();
$block->module = 'comments';
if ($comment) $block->delta = $comment->cid;
diff --git a/kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/content_types/custom/custom.inc b/kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/content_types/custom/custom.inc
index 4853feb..ac2f2a3 100644
--- a/kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/content_types/custom/custom.inc
+++ b/kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/content_types/custom/custom.inc
@@ -45,6 +45,11 @@ function ctools_custom_content_type_content_type($subtype_id) {
* Return all custom content types available.
*/
function ctools_custom_content_type_content_types() {
+ $types = &drupal_static(__FUNCTION__);
+ if (isset($types)) {
+ return $types;
+ }
+
ctools_include('export');
$types = array();
$types['custom'] = _ctools_default_content_type_content_type();
diff --git a/kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/content_types/entity_context/entity_field.inc b/kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/content_types/entity_context/entity_field.inc
index 2da4044..d7d6319 100644
--- a/kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/content_types/entity_context/entity_field.inc
+++ b/kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/content_types/entity_context/entity_field.inc
@@ -38,27 +38,33 @@ function ctools_entity_field_content_type_content_types() {
$context_types = array();
$entities = entity_get_info();
+ $description = t('Field on the referenced entity.');
+ $styles = t('Formatter Styles');
+ $categories = array();
foreach ($entities as $entity_type => $entity) {
+ $category = t(ucfirst($entity_type));
+ $categories[$entity_type] = $category;
foreach ($entity['bundles'] as $type => $bundle) {
foreach (field_info_instances($entity_type, $type) as $field_name => $field) {
if (!isset($types[$entity_type . ':' . $field_name])) {
+ $label = t($field['label']);
$types[$entity_type . ':' . $field_name] = array(
- 'category' => t(ucfirst($entity_type)),
+ 'category' => $category,
'icon' => 'icon_field.png',
'title' => t('Field: @widget_label (@field_name)', array(
- '@widget_label' => t($field['label']),
+ '@widget_label' => $label,
'@field_name' => $field_name,
)),
- 'description' => t('Field on the referenced entity.'),
+ 'description' => $description,
'edit form' => array(
'ctools_entity_field_content_type_formatter_options' => array(
'default' => TRUE,
'title' => t('Formatter options for: @widget_label (@field_name)', array(
- '@widget_label' => t($field['label']),
+ '@widget_label' => $label,
'@field_name' => $field_name,
)),
),
- 'ctools_entity_field_content_type_formatter_styles' => t('Formatter Styles'),
+ 'ctools_entity_field_content_type_formatter_styles' => $styles,
),
);
}
@@ -70,7 +76,7 @@ function ctools_entity_field_content_type_content_types() {
// Create the required context for each field related to the bundle types.
foreach ($types as $key => $field_content_type) {
list($entity_type, $field_name) = explode(':', $key, 2);
- $types[$key]['required context'] = new ctools_context_required(t(ucfirst($entity_type)), $entity_type, array(
+ $types[$key]['required context'] = new ctools_context_required($categories[$entity_type], $entity_type, array(
'type' => array_keys($context_types[$key]['types']),
));
unset($context_types[$key]['types']);
diff --git a/kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/content_types/entity_context/entity_field_extra.inc b/kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/content_types/entity_context/entity_field_extra.inc
index 807969c..6a59ed4 100644
--- a/kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/content_types/entity_context/entity_field_extra.inc
+++ b/kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/content_types/entity_context/entity_field_extra.inc
@@ -25,6 +25,11 @@ function ctools_entity_field_extra_content_type_content_type($subtype) {
*/
function ctools_entity_field_extra_content_type_content_types() {
// This will hold all the individual field content types.
+ $types = &drupal_static(__FUNCTION__);
+ if (isset($types)) {
+ return $types;
+ }
+
$types = array();
$context_types = array();
$entities = entity_get_info();
@@ -97,13 +102,20 @@ function ctools_entity_field_extra_content_type_render($subtype, $conf, $panel_a
$entity = clone $context->data;
list($entity_type, $field_name) = explode(':', $subtype, 2);
list($id, $vid, $bundle) = entity_extract_ids($entity_type, $entity);
-
- // Invoke the view-hook to get the extra field.
- $entity->content = array();
$langcode = $GLOBALS['language_content']->language;
- module_invoke_all($entity_type . '_view', $entity, $conf['view_mode'], $langcode);
- module_invoke_all('entity_view', $entity, $entity_type, $conf['view_mode'], $langcode);
+ $function = $entity_type . '_view';
+ if (in_array($entity_type, array('node', 'taxonomy_term', 'user')) && function_exists($function)) {
+ // Call known ENTITY_view() to get the extra field.
+ $entity->content = $function($entity, $conf['view_mode'], $langcode);
+ }
+ else {
+ // Invoke the view-hook to get the extra field.
+ $entity->content = array();
+
+ module_invoke_all($entity_type . '_view', $entity, $conf['view_mode'], $langcode);
+ module_invoke_all('entity_view', $entity, $entity_type, $conf['view_mode'], $langcode);
+ }
if (isset($entity->content[$field_name])) {
// Build the content type block.
diff --git a/kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/content_types/form/entity_form_field.inc b/kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/content_types/form/entity_form_field.inc
index 56fb76a..a030f69 100644
--- a/kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/content_types/form/entity_form_field.inc
+++ b/kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/content_types/form/entity_form_field.inc
@@ -30,6 +30,11 @@ function ctools_entity_form_field_content_type_content_type($subtype) {
*/
function ctools_entity_form_field_content_type_content_types() {
// This will hold all the individual field content types.
+ $types = &drupal_static(__FUNCTION__);
+ if (isset($types)) {
+ return $types;
+ }
+
$types = array();
$content_types = array();
$entities = entity_get_info();
diff --git a/kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/content_types/page/page_slogan.inc b/kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/content_types/page/page_slogan.inc
index 58f913f..d5cba38 100644
--- a/kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/content_types/page/page_slogan.inc
+++ b/kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/content_types/page/page_slogan.inc
@@ -14,7 +14,7 @@ $plugin = array(
'title' => t('Site slogan'),
'single' => TRUE,
'icon' => 'icon_page.png',
- 'description' => t('Add the slogan trail as content.'),
+ 'description' => t("Add the site's slogan as content."),
'category' => t('Page elements'),
'render last' => TRUE,
);
@@ -26,7 +26,7 @@ $plugin = array(
*/
function ctools_page_slogan_content_type_render($subtype, $conf, $panel_args) {
$block = new stdClass();
- $block->content = (theme_get_setting('toggle_slogan') ? filter_xss_admin(variable_get('site_slogan', '')) : '');
+ $block->content = filter_xss_admin(variable_get('site_slogan', ''));
return $block;
}
diff --git a/kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/content_types/token/token.inc b/kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/content_types/token/token.inc
index c43abd2..7b6f7fc 100644
--- a/kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/content_types/token/token.inc
+++ b/kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/content_types/token/token.inc
@@ -33,19 +33,26 @@ function ctools_token_content_type_content_type($subtype) {
*/
function ctools_token_content_type_content_types() {
// This will hold all the properties.
+ $types = &drupal_static(__FUNCTION__);
+ if (isset($types)) {
+ return $types;
+ }
+
$types = array();
$info = token_info();
foreach ($info['tokens'] as $entity_type => $tokens) {
+ $category = t('@entity (tokens)', array('@entity' => ucfirst($entity_type)));
+ $context = new ctools_context_required(t(ucfirst($entity_type)), $entity_type);
foreach ($tokens as $name => $token) {
if (!empty($token['name'])) {
$token += array('description' => '');
$types[$entity_type . ':' . $name] = array(
- 'category' => t('@entity (tokens)', array('@entity' => ucfirst($entity_type))),
+ 'category' => $category,
'icon' => 'icon_token.png',
'title' => $token['name'],
'description' => $token['description'],
- 'required context' => new ctools_context_required(t(ucfirst($entity_type)), $entity_type),
+ 'required context' => $context,
);
}
}
diff --git a/kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/content_types/user_context/profile_fields.inc b/kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/content_types/user_context/profile_fields.inc
index 2633fd3..55d5593 100644
--- a/kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/content_types/user_context/profile_fields.inc
+++ b/kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/content_types/user_context/profile_fields.inc
@@ -1,6 +1,6 @@
<?php
-if (module_exists('profile') && !is_null(profile_user_categories())) {
+if (module_exists('profile') && !(defined('MAINTENANCE_MODE') && MAINTENANCE_MODE == 'update') && !is_null(profile_user_categories())) {
/**
* Plugins are described by creating a $plugin array which will be used
* by the system that includes this file.
diff --git a/kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/contexts/token.inc b/kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/contexts/token.inc
index 5138b1c..0445576 100644
--- a/kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/contexts/token.inc
+++ b/kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/contexts/token.inc
@@ -51,8 +51,9 @@ function ctools_context_token_convert_list() {
function ctools_context_token_convert($context, $token) {
$tokens = token_info();
list($type, $token) = explode(':', $token, 2);
+ $parts = explode(':', $token, 2);
$real_type = isset($tokens['types'][$type]['type']) ? $tokens['types'][$type]['type'] : $type;
- if (isset($tokens['tokens'][$real_type][$token])) {
+ if (isset($tokens['tokens'][$real_type][$parts[0]])) {
$values = token_generate($type, array($token => $token));
if (isset($values[$token])) {
return $values[$token];
diff --git a/kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/export_ui/ctools_export_ui.class.php b/kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/export_ui/ctools_export_ui.class.php
index 4b44c4a..1048e19 100644
--- a/kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/export_ui/ctools_export_ui.class.php
+++ b/kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/export_ui/ctools_export_ui.class.php
@@ -152,7 +152,7 @@ class ctools_export_ui {
if (isset($input['op']) && $input['op'] == t('Reset')) {
unset($_SESSION['ctools_export_ui'][$this->plugin['name']]);
if (!$js) {
- return drupal_goto($_GET['q']);
+ drupal_goto($_GET['q']);
}
// clear everything but form id, form build id and form token:
$keys = array_keys($input);
@@ -665,7 +665,7 @@ class ctools_export_ui {
);
$output = $this->edit_execute_form($form_state);
- if (!empty($form_state['executed'])) {
+ if (!empty($form_state['executed']) && empty($form_state['rebuild'])) {
$this->redirect($form_state['op'], $form_state['item']);
}
@@ -701,7 +701,7 @@ class ctools_export_ui {
);
$output = $this->edit_execute_form($form_state);
- if (!empty($form_state['executed'])) {
+ if (!empty($form_state['executed']) && empty($form_state['rebuild'])) {
$this->redirect($form_state['op'], $form_state['item']);
}
@@ -749,7 +749,7 @@ class ctools_export_ui {
);
$output = $this->edit_execute_form($form_state);
- if (!empty($form_state['executed'])) {
+ if (!empty($form_state['executed']) && empty($form_state['rebuild'])) {
$this->redirect($form_state['op'], $form_state['item']);
}
@@ -778,7 +778,7 @@ class ctools_export_ui {
*/
function edit_execute_form_standard(&$form_state) {
$output = drupal_build_form('ctools_export_ui_edit_item_form', $form_state);
- if (!empty($form_state['executed'])) {
+ if (!empty($form_state['executed']) && empty($form_state['rebuild'])) {
$this->edit_save_form($form_state);
}
diff --git a/kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/relationships/book_parent.inc b/kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/relationships/book_parent.inc
index c49db76..30ada4a 100644
--- a/kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/relationships/book_parent.inc
+++ b/kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/relationships/book_parent.inc
@@ -42,7 +42,9 @@ function ctools_book_parent_context($context, $conf) {
// Load the node.
$node = node_load($nid);
// Generate the context.
- return ctools_context_create('node', $node);
+ if (node_access('view', $node)) {
+ return ctools_context_create('node', $node);
+ }
}
}
else {
diff --git a/kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/relationships/entity_from_field.inc b/kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/relationships/entity_from_field.inc
index 52c62f9..15f712b 100644
--- a/kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/relationships/entity_from_field.inc
+++ b/kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/relationships/entity_from_field.inc
@@ -173,11 +173,17 @@ function ctools_entity_from_field_context($context, $conf) {
if (isset($items[$delta])) {
ctools_include('fields');
$to_entity_info = entity_get_info($to_entity);
+
$plugin_info = ctools_get_relationship($conf['name']);
$to_entity_id = $items[$delta][$plugin_info['source key']];
-
- // Send it to ctools.
- return ctools_context_create('entity:' . $to_entity, $to_entity_id);
+ $loaded_to_entity = array_shift(entity_load($to_entity, array($to_entity_id)));
+ if(function_exists($to_entity_info['access callback']) && !call_user_func($to_entity_info['access callback'], 'view', $loaded_to_entity)) {
+ return ctools_context_create_empty('entity:' . $to_entity, NULL);
+ }
+ else {
+ // Send it to ctools.
+ return ctools_context_create('entity:' . $to_entity, $to_entity_id);
+ }
}
else {
// In case that delta was empty.
diff --git a/kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/relationships/terms_from_node.inc b/kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/relationships/terms_from_node.inc
index 6ade53b..07081f2 100644
--- a/kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/relationships/terms_from_node.inc
+++ b/kolab.org/www/drupal-7.26/sites/all/modules/ctools/plugins/relationships/terms_from_node.inc
@@ -35,7 +35,7 @@ function ctools_terms_from_node_context($context, $conf) {
$fields = field_info_instances('node', $node->type);
foreach ($fields as $name => $info) {
$field_info = field_info_field($name);
- if ($field_info['type'] == 'taxonomy_term_reference' && (empty($conf['vocabulary']) || $conf['vocabulary'][$field_info['settings']['allowed_values'][0]['vocabulary']])) {
+ if ($field_info['type'] == 'taxonomy_term_reference' && (empty($conf['vocabulary']) || !empty($conf['vocabulary'][$field_info['settings']['allowed_values'][0]['vocabulary']]))) {
$items = field_get_items('node', $node, $name);
if (is_array($items)) {
foreach ($items as $item) {