17 require_once SQ_CORE_PACKAGE_PATH.
'/designs/design_area/design_area_edit_fns.inc';
40 $this->static_screens[
'details'][
'force_unlock'] = FALSE;
41 parent::__construct();
57 $then_element = FALSE;
58 $else_element = FALSE;
65 $condition = $asset->
attr(
'condition');
66 if (!$GLOBALS[
'SQ_SYSTEM']->am->installed(
'condition_'.$condition)) {
67 trigger_localised_error(
'CORE0148', E_USER_WARNING, $condition, $asset->name);
72 foreach ($contents as $index => $element) {
73 if ($element[
'_type'] !=
'TAG')
continue;
75 switch ($element[
'operation']) {
78 if (!$asset->
setAttrValue(
'then_contents', $element[
'contents'])) {
82 trigger_localised_error(
'CORE0214', E_USER_WARNING, $asset->name);
89 array_splice($contents, $index, 1);
94 if (!$asset->
setAttrValue(
'else_contents', $element[
'contents'])) {
98 trigger_localised_error(
'CORE0147', E_USER_WARNING, $asset->name);
102 $else_element = TRUE;
105 array_splice($contents, $index, 1);
112 if (!$then_element && !$else_element) {
113 trigger_localised_error(
'CORE0169', E_USER_WARNING, $asset->name);
117 $GLOBALS[
'SQ_PROCESSED_DESIGN_AREAS'][$asset->
attr(
'id_name')] = TRUE;
135 $names = $GLOBALS[
'SQ_SYSTEM']->am->getTypeInfo($GLOBALS[
'SQ_SYSTEM']->am->getTypeDescendants(
'condition'),
'name');
137 combo_box($prefix.
'_condition_type', $names, FALSE,
'condition_'.$asset->attr(
'condition'));
140 echo array_get_index($names,
'condition_'.$asset->
attr(
'condition'), $asset->
attr(
'condition'));
159 if (isset($_POST[$prefix.
'_condition_type']) && ($_POST[$prefix.
'_condition_type'] !=
'condition_'.$asset->attr(
'condition'))) {
160 $this->_tmp[
'condition_type_changed'] = TRUE;
161 return $asset->
setAttrValue(
'condition', substr($_POST[$prefix.
'_condition_type'], strlen(
'condition_')));
180 echo translate(
'condition_'.$asset->
attr(
'condition').
'_true');
181 $edit_fns_classname =
'condition_'.$asset->attr(
'condition').
'_edit_fns';
182 $GLOBALS[
'SQ_SYSTEM']->am->includeAsset(
'condition_'.$asset->
attr(
'condition'), TRUE);
183 call_user_func(Array($edit_fns_classname,
'paintEditInterface'), $asset->
attr(
'condition_data'), $o, $prefix.
'_condition', $asset->
writeAccess(
'attributes'), Array());
200 if (!array_get_index($this->_tmp,
'condition_type_changed')) {
201 $edit_fns_classname =
'condition_'.$asset->attr(
'condition').
'_edit_fns';
202 $GLOBALS[
'SQ_SYSTEM']->am->includeAsset(
'condition_'.$asset->
attr(
'condition'), TRUE);
203 $res = call_user_func(Array($edit_fns_classname,
'processEditInterface'), $o, $prefix.
'_condition');