Fix private field filter

This commit is contained in:
Nathan Gray 2013-11-27 17:17:37 +00:00
parent 26639f56f9
commit 407f3d673e
2 changed files with 16 additions and 10 deletions

View File

@ -126,17 +126,19 @@ class etemplate_widget_customfields extends etemplate_widget_transformer
} }
// Filter fields // Filter fields
if($this->attrs['field-names']) if($this->attrs['field-names'])
{ {
if($this->attrs['field-names'][0] == '!') { if($this->attrs['field-names'][0] == '!') {
$negate_field_filter = true; $negate_field_filter = true;
$this->attrs['field-names'] = substr($this->attrs['field_names'],1); $this->attrs['field-names'] = substr($this->attrs['field_names'],1);
} }
$field_filter = explode(',', $this->attrs['field_names']); $field_filter = explode(',', $this->attrs['field_names']);
} }
$fields = $customfields; $fields = $customfields;
$use_private = self::expand_name($this->attrs['use-private'],0,0); $use_private = self::expand_name($this->attrs['use-private'],0,0,'','',self::$cont);
$this->attrs['sub-type'] = self::expand_name($this->attrs['sub-type'],0,0,'','',self::$cont);
foreach((array)$fields as $key => $field) foreach((array)$fields as $key => $field)
{ {
// remove private or non-private cf's, if only one kind should be displayed // remove private or non-private cf's, if only one kind should be displayed

View File

@ -46,10 +46,14 @@ var et2_customfields_list = et2_valueWidget.extend([et2_IDetachedDOM, et2_IInput
"default": "", "default": "",
"type": "any", // String or array "type": "any", // String or array
"description": "Filter displayed custom fields by their 'type2' attribute" "description": "Filter displayed custom fields by their 'type2' attribute"
},
'private': {
ignore: true,
type: 'boolean'
} }
}, },
legacyOptions: ["type_filter"], // Field restriction & private done server-side legacyOptions: ["type_filter","private"], // Field restriction & private done server-side
prefix: '#', prefix: '#',