17 require_once SQ_CORE_PACKAGE_PATH.
'/system/conditions/condition/condition.inc';
42 parent::__construct($assetid);
58 return $condition_data[
'logical_keywords'];
74 $condition_data[
'logical_keywords'] = $logical_keywords;
92 if (!empty($condition_data[
'operator']) && !empty($condition_data[
'logical_keywords'])) {
94 foreach ($condition_data[
'logical_keywords'] as $keyword => $value) {
95 if (preg_match(
'/^globals_/', $keyword)) {
96 $value =
'%'.$keyword.
'%';
97 replace_global_keywords($value);
101 $condition_data[
'logical_keywords'][$keyword] = $value;
104 switch ($condition_data[
'operator']) {
107 foreach ($condition_data[
'logical_keywords'] as $logical_value) {
108 if (!$logical_value) {
117 foreach ($condition_data[
'logical_keywords'] as $logical_value) {
118 if ($logical_value) {
146 public static function updateKeywords(Array $logical_keywords, Array &$condition_data)
148 $condition_logical_keywords = self::getLogicalKeywords($condition_data);
149 foreach (array_keys($condition_logical_keywords) as $condition_logical_keyword_name) {
150 $condition_logical_keywords[$condition_logical_keyword_name] = isset($logical_keywords[$condition_logical_keyword_name]) ? $logical_keywords[$condition_logical_keyword_name] :
'';
153 self::setLogicalKeywords($condition_data, $condition_logical_keywords);
173 return array_keys(self::getLogicalKeywords($condition_data));