17 require_once SQ_CORE_PACKAGE_PATH.
'/system/triggers/trigger_condition/trigger_condition.inc';
50 public static function evaluate($settings, &$state)
52 if (!isset($settings[
'field']))
return FALSE;
53 if (empty($settings[
'field']))
return FALSE;
56 if (!isset($state[
'event'][
'data'][
'fieldids']))
return FALSE;
57 if (empty($state[
'event'][
'data'][
'fieldids']))
return FALSE;
59 $fields_changed = $state[
'event'][
'data'][
'fieldids'];
61 if (in_array($settings[
'field'], $fields_changed))
return TRUE;
78 public static function getInterface($settings, $prefix, $write_access=FALSE)
81 $field = array_get_index($settings,
'field', 0);
86 echo translate(
'metadata_field');
87 echo asset_finder($prefix.
'[metadata_field]', $field, Array(
'metadata_field'=>
'D'));
89 echo translate(
'trigger_condition_metadata_field_updated_note');
92 echo translate(
'no_asset_selected');
94 echo get_asset_tag_line($field);
97 $contents = ob_get_contents();
117 if (empty($request_data)) {
118 return translate(
'trigger_input_data_error');
121 $options = array_get_index($request_data,
'metadata_field', Array());
122 $settings[
'field'] = array_get_index($options,
'assetid', 0);