18 require_once SQ_CORE_PACKAGE_PATH.
'/designs/design_area/design_area_edit_fns.inc';
41 parent::__construct();
58 $type_codes = $asset->
attr(
'type_codes');
59 $paint_with = $asset->
attr(
'paint_with');
60 $paint_layout = $asset->
attr(
'paint_layout');
61 $type_code_restrictions = Array();
62 if (is_array($type_codes)) {
63 foreach ($type_codes as $type_code) {
64 $type_code_restrictions[$type_code] =
'D';
69 <table
class=
"sq-backend-table">
71 <td
class=
"sq-backend-table-cell-alt"><b><?php echo translate(
'nest_content_menu_nesting') ?></b></td>
74 <td
class=
"sq-backend-table-cell">
76 asset_finder($prefix.
'_assetid', $asset->
_getNestAssetInfo(
'minorid'), $type_code_restrictions);
81 <td
class=
"sq-backend-table-cell-alt"><b><?php echo translate(
'nest_content_menu_paint_with'); ?></b></td>
84 <td
class=
"sq-backend-table-cell">
85 <input name=
"<?php echo $prefix ?>_paint_with" type=
"radio" value=
"raw" <?php
if ($paint_with ==
'raw') { ?>checked=
"checked"<?php } ?>> <?php echo translate(
'nest_content_menu_paint_raw'); ?><br />
86 <input name=
"<?php echo $prefix ?>_paint_with" type=
"radio" value=
"default" <?php
if ($paint_with ==
'default') { ?>checked=
"checked"<?php } ?>> <?php echo translate(
'nest_content_menu_paint_default'); ?><br />
87 <input name=
"<?php echo $prefix ?>_paint_with" type=
"radio" value=
"arbitrary" <?php
if ($paint_with ==
'arbitrary') { ?>checked=
"checked"<?php } ?>><?php
88 echo translate(
'nest_content_menu_paint_arbitrary');
89 asset_finder($prefix.
'_paint_layout', $paint_layout, Array(
'paint_layout_page' =>
'D'));
96 $link_asset = $GLOBALS[
'SQ_SYSTEM']->am->getAsset($asset->
_getNestAssetInfo(
'minorid'));
97 if (!is_null($link_asset)) {
98 echo get_asset_tag_line($link_asset->id);
119 if (!isset($_POST[$prefix.
'_assetid'][
'assetid'])) {
123 $assetid = (int) $_POST[$prefix.
'_assetid'][
'assetid'];
126 $GLOBALS[
'SQ_SYSTEM']->changeDatabaseConnection(
'db2');
127 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'BEGIN');
130 if (isset($_POST[$prefix.
'_paint_layout'][
'assetid'])) {
131 $paint_layout = $_POST[$prefix.
'_paint_layout'][
'assetid'];
135 if (isset($_POST[$prefix.
'_paint_with'])) {
136 $paint_with = $_POST[$prefix.
'_paint_with'];
137 if (($paint_with != (
'raw'||
'default'||
'arbitrary'))) {
145 if ($asset->
_getNestAssetInfo(
'minorid') != $_POST[$prefix.
'_assetid'][
'assetid']) {
149 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'ROLLBACK');
150 $GLOBALS[
'SQ_SYSTEM']->restoreDatabaseConnection();
157 $link_asset = $GLOBALS[
'SQ_SYSTEM']->am->getAsset($assetid);
158 if (is_null($link_asset)) {
159 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'ROLLBACK');
160 $GLOBALS[
'SQ_SYSTEM']->restoreDatabaseConnection();
163 if (!$asset->
createLink($link_asset, SQ_LINK_NOTICE,
'nest_content_asset')) {
164 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'ROLLBACK');
165 $GLOBALS[
'SQ_SYSTEM']->restoreDatabaseConnection();
172 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'COMMIT');
173 $GLOBALS[
'SQ_SYSTEM']->restoreDatabaseConnection();