17 require_once SQ_CORE_PACKAGE_PATH.
'/designs/design_area/design_area_edit_fns.inc';
41 parent::__construct();
42 $this->static_screens[
'details'][
'force_unlock'] = FALSE;
59 if ($asset->writeAccess(
'attributes')) {
60 asset_finder($prefix.
'_search_page', $asset->attr(
'search_page_assetid'), Array(
'search_page' =>
'D'));
63 $search_pageid = $asset->attr(
'search_page_assetid');
64 if ($search_pageid > 0) {
65 echo get_asset_tag_line($search_pageid);
67 echo translate(
'sch_no_search_page_specified');
87 if (isset($_POST[$prefix.
'_search_page'][
'assetid'])) {
88 if ($_POST[$prefix.
'_search_page'][
'assetid'] > 0) {
89 $asset->setAttrValue(
'search_page_assetid', $_POST[$prefix.
'_search_page'][
'assetid']);
91 $asset->setAttrValue(
'search_page_assetid', 0);
111 if ($asset->writeAccess(
'attributes')) {
112 asset_finder($prefix.
'_submit_image', $asset->attr(
'submit_image_assetid'), Array(
'file' =>
'D'));
115 $submit_imageid = $asset->attr(
'submit_image_assetid');
116 if ($submit_imageid > 0) {
117 echo get_asset_tag_line($submit_imageid);
119 echo translate(
'sch_box_no_submit_image_specified');
139 if (!isset($_POST[$prefix.
'_submit_image'][
'assetid'])) {
143 if ($_POST[$prefix.
'_submit_image'][
'assetid'] > 0) {
144 return $asset->setAttrValue(
'submit_image_assetid', $_POST[$prefix.
'_submit_image'][
'assetid']);
146 return $asset->setAttrValue(
'submit_image_assetid', 0);
164 if (!$asset->writeAccess(
'attributes')) {
165 echo $asset->attr(
'category_set');
169 $search_assetid = $asset->attr(
'search_page_assetid');
170 if (empty($search_assetid))
return FALSE;
172 $search_page = $GLOBALS[
'SQ_SYSTEM']->am->getAsset($search_assetid);
174 $categories[
''] =
'-- Please Select --';
175 foreach (array_keys($search_page->attr(
'categories')) as $category_id) {
176 $categories[$category_id] = $category_id;
179 combo_box($prefix.
'_category_set', $categories, FALSE, $asset->attr(
'category_set'));
197 if (!$asset->writeAccess(
'attributes'))
return FALSE;
199 if (!isset($_POST[$prefix.
'_category_set'])) {
203 $new_category_set = $_POST[$prefix.
'_category_set'];
206 if ($new_category_set != $asset->attr(
'category_set')) {
207 $asset->setAttrValue(
'category_show_empty', TRUE);
208 $asset->setAttrValue(
'category_default',
'');
210 $asset->setAttrValue(
'category_set', $new_category_set);
229 $search_assetid = $asset->attr(
'search_page_assetid');
230 if (empty($search_assetid))
return FALSE;
232 $search_page = $GLOBALS[
'SQ_SYSTEM']->am->getAsset($search_assetid);
234 $categories = Array();
235 $category_sets = $search_page->attr(
'categories');
236 $category_set = $category_sets[$asset->attr(
'category_set')];
238 if ($asset->attr(
'category_show_empty')) {
239 $categories[
''] = $category_set[
'unselected_text'];
242 foreach ($category_set[
'options'] as $category_id => $category_data) {
243 $categories[$category_id] = $category_data[
'full_name'];
246 if (!$asset->writeAccess(
'attributes')) {
247 echo $categories[$asset->attr(
'category_default')];
250 combo_box($prefix.
'_category_default', $categories, FALSE, $asset->attr(
'category_default'));
269 if (!$asset->writeAccess(
'attributes'))
return FALSE;
271 if (!isset($_POST[$prefix.
'_category_default'])) {
275 $asset->setAttrValue(
'category_default', $_POST[$prefix.
'_category_default']);
295 if ($asset->writeAccess(
'attributes')) {
296 $search_page = $GLOBALS[
'SQ_SYSTEM']->am->getAsset($asset->attr(
'search_page_assetid'));
297 $fields = $search_page->attr(
'fields');
298 if (is_scalar($fields)) {
299 $fields = unserialize($fields);
303 foreach ($fields as $field_name => $field) {
304 $field_description = $fields[$field_name];
305 $field_description = $field_name.
' ';
306 $options[$field_name] = $field_description;
309 if ($asset->attr(
'field_name') != array_keys($fields)) {
310 $options = array_merge(Array(
'' =>
'None'), $options);
312 combo_box($prefix.
'_field_name', $options, FALSE, $asset->attr(
'field_name'));
315 echo $asset->attr(
'field_name');
334 if (!isset($_POST[$prefix.
'_field_name'])) {
338 return $asset->setAttrValue(
'field_name', $_POST[$prefix.
'_field_name']);
356 $assetid = $owner->attr(
'search_page_assetid');
357 if (!$assetid)
return FALSE;
358 $asset = $GLOBALS[
'SQ_SYSTEM']->am->getAsset($assetid);
359 if (!$asset->id)
return FALSE;
360 return $asset->type() ==
'search_page';
382 return $owner->attr(
'category_set') !=
'';
400 return !$owner->attr(
'submit_button');