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[
'css_assetid']) || (!isset($this->_tmp[
'css_assetid']))) {
121 $this->_tmp[
'css_assetid'] = $GLOBALS[
'SQ_SYSTEM']->am->getLink($this->
id, SQ_LINK_NOTICE,
'', TRUE,
'linked_css_asset');
123 return (empty($this->_tmp[
'css_assetid'])) ? NULL : $this->_tmp[
'css_assetid'][$field];
136 parent::linksUpdated();
137 unset($this->_tmp[
'css_assetid']);
157 if (empty($css_assetid))
return TRUE;
159 $css_asset = $GLOBALS[
'SQ_SYSTEM']->am->getAsset($css_assetid);
160 $cache_file_assetid = $css_asset->getCacheFileId();
168 $linked_css_'.$this->attr(
'id_name').
'_url = $GLOBALS[\'SQ_SYSTEM\']->am->getAssetURL('.$cache_file_assetid.
');
169 $css_attr = $GLOBALS[\'SQ_SYSTEM\']->am->getAllAttributeValues('.$css_assetid.
', \'design_css\');
171 if (!empty($linked_css_'.$this->
attr(
'id_name').
'_url)) {
172 $served_by_apache = strpos($linked_css_'.$this->
attr(
'id_name').
'_url, \'/__data/\') !== FALSE || (SQ_CONF_STATIC_ROOT_URL && strpos($linked_css_'.$this->
attr(
'id_name').
'_url, SQ_CONF_STATIC_ROOT_URL.\'/\') !== FALSE);
173 if ($served_by_apache && (isset($css_attr[\'static_url_versioning\'][\'value\']) && ($css_attr[\'static_url_versioning\'][\'value\'] == 1))) {
174 $cache_file_version = $GLOBALS[\'SQ_SYSTEM\']->am->getAssetInfo('.$cache_file_assetid.
', Array(), TRUE, \'version\');
175 if (!empty($cache_file_version['.$cache_file_assetid.
'])) $linked_css_'.$this->
attr(
'id_name').
'_url .= \'?v=\'.$cache_file_version['.$cache_file_assetid.
'];
179 if (empty($linked_css_'.$this->
attr(
'id_name').
'_url) || (isset($css_attr[\'cache_css\'][\'value\']) && ($css_attr[\'cache_css\'][\'value\'] == 0))) {
180 $linked_css_'.$this->
attr(
'id_name').
'_url = $GLOBALS[\'SQ_SYSTEM\']->am->getAssetURL('.$css_assetid.
');
183 if (!empty($linked_css_'.$this->
attr(
'id_name').
'_url)) {
187 switch ($this->
attr(
'tag_type')) {
189 echo
'<link rel="stylesheet" type="text/css" href="',
'<',
'?php echo $linked_css_'.$this->attr(
'id_name').
'_url; ?',
'>',
'"';
190 echo
' media="', $this->
attr(
'media'),
'" />
194 echo
'@import url(',
'<',
'?php echo $linked_css_'.$this->attr(
'id_name').
'_url; ?',
'>);