18 require_once SQ_CORE_PACKAGE_PATH.
'/designs/design_area/design_area_edit_fns.inc';
41 parent::__construct();
58 $declared_vars = Array();
60 foreach ($contents as $index => $element) {
61 if ($element[
'_type'] !=
'TAG' || $element[
'operation'] !=
'declare') {
66 if (empty($element[
'attributes'][
'name']) || empty($element[
'attributes'][
'type'])) {
67 trigger_localised_error(
'CORE0141', E_USER_WARNING);
71 if (!isset($element[
'attributes'][
'value'])) {
72 $element[
'attributes'][
'value'] =
'';
74 if (!isset($element[
'attributes'][
'description'])) {
75 $element[
'attributes'][
'description'] =
'';
78 $name = preg_replace(
'/[^a-z0-9_]/i',
'_', $element[
'attributes'][
'name']);
79 if ($name != $element[
'attributes'][
'name']) {
80 trigger_localised_error(
'CORE0150', E_USER_WARNING, $element[
'attributes'][
'name'], $asset->
attr(
'id_name'), $name);
84 if (!$GLOBALS[
'SQ_SYSTEM']->am->validAttributeType($element[
'attributes'][
'type'])) {
85 trigger_localised_error(
'CORE0152', E_USER_WARNING, $name, $asset->
attr(
'id_name'), $element[
'attributes'][
'type']);
90 require_once(SQ_ATTRIBUTES_PATH.
'/'.$element[
'attributes'][
'type'].
'/'.$element[
'attributes'][
'type'].
'.inc');
91 $class =
'Asset_Attribute_'.$element[
'attributes'][
'type'];
93 if (!$attr->validateValue($element[
'attributes'][
'value'])) {
94 trigger_localised_error(
'CORE0151', E_USER_WARNING, $name, $asset->
attr(
'id_name'), $element[
'attributes'][
'value'], $element[
'attributes'][
'type']);
98 $declared_vars[$name] = Array(
99 'type' => $element[
'attributes'][
'type'],
100 'value' => $element[
'attributes'][
'value'],
101 'description' => $element[
'attributes'][
'description'],
106 $GLOBALS[
'SQ_PROCESSED_DESIGN_AREAS'][$asset->
attr(
'id_name')] = TRUE;
107 return $asset->
setAttrValue(
'declared_vars', $declared_vars);
127 foreach ($attrs as $name => $attr) {
130 $attr->paint($prefix.
'_'.$name);
134 if ($asset->vars[
'declared_vars'][
'value'][$name][
'description']) {
135 $o->
note($asset->vars[
'declared_vars'][
'value'][$name][
'description']);
157 $declared_vars = $asset->
attr(
'declared_vars');
158 foreach ($attrs as $name => $attr) {
159 $attr->process($prefix.
'_'.$name);
160 if ($attr->processed) {
161 $declared_vars[$name][
'value'] = $attr->value;