18 require_once SQ_CORE_PACKAGE_PATH.
'/designs/design_area/design_area_edit_fns.inc';
41 parent::__construct();
58 if ($asset->writeAccess(
'links')) {
59 $type_code_restrictions[
'design_css'] =
'D';
60 $type_code_restrictions[
'design_css_customisation'] =
'D';
61 asset_finder($prefix.
'_assetid', $asset->getLinkedCSSInfo(
'minorid'), $type_code_restrictions);
63 }
else if ($asset->getLinkedCSSInfo(
'minorid')) {
64 $link_asset = $GLOBALS[
'SQ_SYSTEM']->am->getAsset($asset->getLinkedCSSInfo(
'minorid'));
65 if (!is_null($link_asset)) {
66 echo get_asset_tag_line($link_asset->id);
88 if ($asset->writeAccess(
'attributes')) {
90 $options[
'link_tag'] =
'Link tag';
91 $options[
'import_tag'] =
'@import tag';
92 combo_box($prefix.
'_tag_type', $options, FALSE, $asset->attr(
'tag_type'));
94 switch ($asset->attr(
'tag_type')) {
121 if ($asset->writeAccess(
'attributes')) {
123 $options[
'all'] =
'All';
124 $options[
'aural'] =
'Aural';
125 $options[
'braille'] =
'Braille';
126 $options[
'embossed'] =
'Embossed';
127 $options[
'handheld'] =
'Handheld';
128 $options[
'print'] =
'Print';
129 $options[
'projection'] =
'Projection';
130 $options[
'screen'] =
'Screen';
131 $options[
'tty'] =
'TTY';
132 $options[
'tv'] =
'TV';
133 combo_box($prefix.
'_media', $options, FALSE, $asset->attr(
'media'));
135 echo $asset->attr(
'media');
155 $tag_type = (int) (isset($_POST[$prefix.
'_tag_type'])) ? $_POST[$prefix.
'_tag_type'] :
'';
156 return $asset->setAttrValue(
'tag_type', $tag_type);
173 $media = (int) (isset($_POST[$prefix.
'_media'])) ? $_POST[$prefix.
'_media'] :
'';
174 return $asset->setAttrValue(
'media', $media);
191 if (!isset($_POST[$prefix.
'_assetid'][
'assetid'])) {
195 if ($asset->getLinkedCSSInfo(
'minorid') == $_POST[$prefix.
'_assetid'][
'assetid']) {
199 $assetid = (int) $_POST[$prefix.
'_assetid'][
'assetid'];
202 $GLOBALS[
'SQ_SYSTEM']->changeDatabaseConnection(
'db2');
203 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'BEGIN');
206 if ($old_linkid = $asset->getLinkedCSSInfo(
'linkid')) {
207 if (!$asset->deleteLink($old_linkid)) {
208 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'ROLLBACK');
209 $GLOBALS[
'SQ_SYSTEM']->restoreDatabaseConnection();
216 $link_asset = $GLOBALS[
'SQ_SYSTEM']->am->getAsset($assetid);
217 if (is_null($link_asset)) {
218 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'ROLLBACK');
219 $GLOBALS[
'SQ_SYSTEM']->restoreDatabaseConnection();
222 if (!$asset->createLink($link_asset, SQ_LINK_NOTICE,
'linked_css_asset')) {
223 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'ROLLBACK');
224 $GLOBALS[
'SQ_SYSTEM']->restoreDatabaseConnection();
230 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'COMMIT');
231 $GLOBALS[
'SQ_SYSTEM']->restoreDatabaseConnection();