summaryrefslogtreecommitdiff
path: root/kolab.org/www/drupal-7.15/sites/all/modules/ctools/plugins/access/entity_field_value.inc
diff options
context:
space:
mode:
Diffstat (limited to 'kolab.org/www/drupal-7.15/sites/all/modules/ctools/plugins/access/entity_field_value.inc')
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/ctools/plugins/access/entity_field_value.inc22
1 files changed, 17 insertions, 5 deletions
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/ctools/plugins/access/entity_field_value.inc b/kolab.org/www/drupal-7.15/sites/all/modules/ctools/plugins/access/entity_field_value.inc
index 1fb1fe8..59b01fb 100644
--- a/kolab.org/www/drupal-7.15/sites/all/modules/ctools/plugins/access/entity_field_value.inc
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/ctools/plugins/access/entity_field_value.inc
@@ -141,7 +141,13 @@ function ctools_entity_field_value_ctools_access_check($conf, $context, $plugin)
if ($field_items = field_get_items($entity_type, $context->data, $field_name)) {
$langcode = field_language($entity_type, $context->data, $field_name);
-
+ // Get field storage columns.
+ $instance = field_info_instance($entity_type, $field_name, $bundle_type);
+ $field = field_info_field_by_id($instance['field_id']);
+ $columns = array();
+ foreach ($field['columns'] as $column => $attributes) {
+ $columns[$column] = _field_sql_storage_columnname($field_name, $column);
+ }
foreach ($conf as $potential_field => $values) {
if ($field_name === $potential_field) {
@@ -152,8 +158,14 @@ function ctools_entity_field_value_ctools_access_check($conf, $context, $plugin)
// Check field value.
foreach ($field_items as $field_value) {
- if (in_array($field_value['value'], $conf_value_array)) {
- return TRUE;
+ foreach ($field_value as $field_column => $value) {
+ // Iterate through config values.
+ foreach ($conf_value_array as $conf_value) {
+ //
+ if ($value == $conf_value[$field_column]) {
+ return TRUE;
+ }
+ }
}
}
}
@@ -168,8 +180,8 @@ function _ctools_entity_field_value_ctools_access_get_conf_field_values($values,
}
$conf_values = array();
- foreach ($values[$langcode] as $value) {
- $conf_values[] = $value['value'];
+ foreach ($values[$langcode] as $delta => $value) {
+ $conf_values[$delta] = $value;
}
return $conf_values;