18 require_once SQ_CORE_PACKAGE_PATH.
'/designs/design_area/design_area.inc';
43 parent::__construct($assetid);
60 if ($name ==
'type_codes') {
61 if (!is_array($value)) {
62 $value = preg_split(
'/[ ,]+/', (
string) $value);
64 foreach ($value as $type_code) {
65 if (!$GLOBALS[
'SQ_SYSTEM']->am->installed($type_code)) {
66 trigger_localised_error(
'CORE0145', E_USER_WARNING, $type_code);
72 return parent::setAttrValue($name, $value);
93 SQ_LINK_TYPE_1 => Array(),
94 SQ_LINK_TYPE_2 => Array(),
95 SQ_LINK_TYPE_3 => Array(),
96 SQ_LINK_NOTICE => Array(
120 if ((empty($this->_tmp[
'nest_assetid'])) || (!isset($this->_tmp[
'nest_assetid']))) {
121 $this->_tmp[
'nest_assetid'] = $GLOBALS[
'SQ_SYSTEM']->am->getLink($this->
id, SQ_LINK_NOTICE,
'', TRUE,
'nest_content_asset');
123 return (empty($this->_tmp[
'nest_assetid'])) ? NULL : $this->_tmp[
'nest_assetid'][$field];
136 parent::linksUpdated();
137 unset($this->_tmp[
'nest_assetid']);
151 return !(empty($assetid));
165 $paint_layout_id = (int) $this->
attr(
'paint_layout');
166 $paint_with = (string) $this->
attr(
'paint_with');
168 $nest_content_'.$this->attr(
'id_name').
'_paint_layout = NULL;
169 $nest_content_'.$this->
attr(
'id_name').
'_asset = $GLOBALS[\'SQ_SYSTEM\']->am->getAsset('.$assetid.
');';
170 if (!empty($paint_layout_id) && $paint_with ==
'arbitrary') {
171 echo
'$nest_content_'.$this->attr(
'id_name').
'_paint_layout = $GLOBALS[\'SQ_SYSTEM\']->am->getAsset('.$paint_layout_id.
');';
173 echo
'$nest_content_'.$this->attr(
'id_name').
'_paint_with = \''.$paint_with.
'\';
176 }//end _printInitCode()
188 protected function _printPaintingCode()
191 if (!is_null($nest_content_
'.$this->attr('id_name
').'_asset)) {
192 if ($nest_content_
'.$this->attr('id_name
').'_asset->readAccess()) {
194 switch ($nest_content_
'.$this->attr('id_name
').'_paint_with) {
196 if (!is_null($nest_content_'.$this->attr(
'id_name').
'_paint_layout)) {
197 $switched_frontend = FALSE;
198 if ($GLOBALS[\'SQ_SYSTEM\']->frontend_asset->id !== $this->id) {
199 $current_frontend_asset =& $GLOBALS[\'SQ_SYSTEM\']->frontend_asset;
200 $GLOBALS[\'SQ_SYSTEM\']->frontend_asset =& $nest_content_'.$this->
attr(
'id_name').
'_asset;
201 $switched_frontend = TRUE;
203 $nest_content_'.$this->
attr(
'id_name').
'_paint_layout->paint($nest_content_'.$this->
attr(
'id_name').
'_asset);
205 if ($switched_frontend) {
206 $GLOBALS[\'SQ_SYSTEM\']->frontend_asset =& $current_frontend_asset;
209 $nest_content_'.$this->
attr(
'id_name').
'_asset->printBody();
214 $nest_content_'.$this->
attr(
'id_name').
'_asset->printBodyWithPaintLayout();
218 $nest_content_'.$this->
attr(
'id_name').
'_asset->printBody();
221 $body = ob_get_clean();