18 require_once SQ_PACKAGES_PATH.
'/cms/page_templates/page_asset_listing/page_asset_listing_edit_fns.inc';
41 parent::__construct();
42 $this->static_screens[
'details'][
'force_unlock'] = FALSE;
55 $write_access = $asset->writeAccess(
'attributes');
56 $var_list = $asset->attr(
'dynamic_vars');
58 $o->openSection(
'Data Mappings');
60 $map = $asset->getAttribute(
'parameter_map');
62 $parameter_names = $map->getParameters();
64 foreach ($var_list as $var_name => $default) {
65 $map->setParameter($var_name,
'Variable: '.$var_name);
68 $map->paint($prefix.
'_parameter_map', !$write_access);
71 $o->sectionNote(translate(
'trim_ds_search_default_options_note'));
87 $write_access = $asset->writeAccess(
'attributes');
88 if (!$write_access)
return FALSE;
89 $var_name_pattern =
'/^[a-zA-Z_\-0-9\.]+$/';
90 $var_list = ($asset->attr(
'dynamic_vars'));
92 $map = $asset->getAttribute(
'parameter_map');
94 $map->process($prefix.
'_parameter_map');
96 $asset->setAttrValue(
'parameter_map', unserialize($map->value));
116 $bodycopy_link = $GLOBALS[
'SQ_SYSTEM']->am->getLinks($asset->id, SQ_LINK_TYPE_2,
'bodycopy', TRUE,
'major',
'page_contents',
'1',
'1');
118 if (!empty($bodycopy_link)) {
119 $bodycopy = $GLOBALS[
'SQ_SYSTEM']->am->getAsset($bodycopy_link[0][
'minorid'],
'bodycopy');
121 if (is_null($bodycopy)) {
122 trigger_localised_error(
'CORE0016', E_USER_ERROR, $asset->name);
127 $o->setRedirect($bodycopy->getBackendHref(
'contents'));
131 $_SESSION[
'sq_nav_history'][(count($_SESSION[
'sq_nav_history']) - 1)][
'screen'] =
'details';
146 $wa = $asset->writeAccess(
'attributes');
148 $default_icon_size = $asset->attr(
'default_icon_size');
149 $default_width = $asset->attr(
'default_icon_width');
150 $default_height = $asset->attr(
'default_icon_height');
152 $o->openField(
'Default Icon Size');
154 check_box($prefix.
'_use_default',
'1', $default_icon_size,
'
155 if (this.checked==1) {
156 document.getElementById("'.$prefix.
'_default_icon_width").disabled=true;
157 document.getElementById("'.$prefix.
'_default_icon_height").disabled=true;
159 document.getElementById("'.$prefix.
'_default_icon_width").disabled=false;
160 document.getElementById("'.$prefix.
'_default_icon_height").disabled=false;
163 echo
' Use Default Size<br /><br />';
164 $extra = $default_icon_size ?
'disabled=true' :
'';
165 text_box($prefix.
'_default_icon_width', $default_width, 5,
'', FALSE, $extra);echo
' px';
166 $o->note(
'Icon Width');
167 text_box($prefix.
'_default_icon_height', $default_height, 5,
'', FALSE, $extra);echo
' px';
168 $o->note(
'Icon Height');
170 echo $default_width.
' px';
171 $o->note(
'Icon Width');
172 echo $default_height.
' px';
173 $o->note(
'Icon Height');
191 $wa = $asset->writeAccess(
'attributes');
192 $default_width = $asset->attr(
'default_icon_width');
193 $default_height = $asset->attr(
'default_icon_height');
194 $default_size = $asset->attr(
'default_icon_size');
196 $attr_change = FALSE;
197 $new_default_size = isset($_POST[$prefix.
'_use_default']) ? $_POST[$prefix.
'_use_default'] : FALSE;
198 if (!is_null($new_default_size) && $new_default_size != $default_size) {
200 $asset->setAttrValue(
'default_icon_size', $new_default_size);
203 if ($new_default_size != 1) {
204 $new_width = isset($_POST[$prefix.
'_default_icon_width']) ? $_POST[$prefix.
'_default_icon_width'] :
'';
205 $new_height = isset($_POST[$prefix.
'_default_icon_height']) ? $_POST[$prefix.
'_default_icon_height'] :
'';
206 if (!empty($new_width) && $new_width != $default_width) {
207 $asset->setAttrValue(
'default_icon_width', $new_width);
210 if (!empty($new_height) && $new_height != $default_height) {
211 $asset->setAttrValue(
'default_icon_height', $new_height);
216 if ($attr_change) $asset->saveAttributes();
231 $wa = $asset->writeAccess(
'attributes');
233 $api_key = $asset->attr(
'api_key');
234 $default_latitude = $asset->attr(
'default_latitude');
235 $default_longitude = $asset->attr(
'default_longitude');
236 $default_zoom_level = $asset->attr(
'default_zoom_level');
238 $o->openField(
'Default Map Center');
240 text_box($prefix.
'_default_latitude', $default_latitude, 20,
'', FALSE,
'onFocus="this.style.color = \'black\';"');
241 if (!empty($api_key)) {?>
243 <a href=
"javascript:switch_display();" style=
"text-decoration:none;border:none;">
244 <img src=
"<?php echo sq_web_path('data').'/asset_types/google_map/images/globe.png'?>" border=
"0" title=
"Pick From Map" style=
"position:relative;top:5px;" />
247 $o->note(
'The default Latitude of the map');
248 text_box($prefix.
'_default_longitude', $default_longitude, 20,
'', FALSE,
'onFocus="this.style.color = \'black\';"');
249 if (!empty($api_key)) {?>
251 <a href=
"javascript:switch_display();">
252 <img src=
"<?php echo sq_web_path('data').'/asset_types/google_map/images/globe.png'?>" border=
"0" title=
"Pick From Map" style=
"position:relative;top:5px;" />
255 $o->note(
'The default Longitude of the map');
256 text_box($prefix.
'_default_zoom_level', $default_zoom_level, 20,
'', FALSE,
'onFocus="this.style.color = \'black\';"');
257 if (!empty($api_key)) {?>
259 <a href=
"javascript:switch_display();">
260 <img src=
"<?php echo sq_web_path('data').'/asset_types/google_map/images/globe.png'?>" border=
"0" title=
"Pick From Map" style=
"position:relative;top:5px;" />
263 $o->note(
'The default Zoom Level of the map');
266 echo $default_latitude;
267 $o->note(
'The default Latitude of the map');
268 echo $default_longitude;
269 $o->note(
'The default Longitude of the map');
270 echo $default_zoom_level;
271 $o->note(
'The default Zoom Level of the map');
276 if (!empty($api_key) && $wa) {
279 <div
id=
"map" style=
"width:100%;height:250px;border:1px solid;display:none;">
282 <script src=
"<?php echo (current_protocol()); ?>://maps.googleapis.com/maps/api/js?key=<?php echo $api_key; ?>&sensor=false" type=
"text/javascript"></script>
283 <script type=
"text/javascript">
285 function init_picker() {
288 center:
new google.maps.LatLng(<?php echo $default_latitude; ?>, <?php echo $default_longitude; ?>),
289 zoom: <?php echo $default_zoom_level; ?>,
290 mapTypeId: google.maps.MapTypeId.ROADMAP
292 map =
new google.maps.Map(document.getElementById(
"map"), mapOptions);
293 google.maps.event.addListener(map,
'click',
function(event) {
294 var lng =
event.latLng.lng();
295 var lat =
event.latLng.lat()
296 document.getElementById(
'<?php echo $prefix; ?>_default_latitude').style.color =
'red';
297 document.getElementById(
'<?php echo $prefix; ?>_default_latitude').value = lat;
299 document.getElementById(
'<?php echo $prefix; ?>_default_longitude').style.color =
'red';
300 document.getElementById(
'<?php echo $prefix; ?>_default_longitude').value = lng;
303 google.maps.event.addListener(map,
'zoom_changed',
function() {
304 var zoomLevel = map.getZoom();
305 document.getElementById(
'<?php echo $prefix; ?>_default_zoom_level').style.color =
'red';
306 document.getElementById(
'<?php echo $prefix; ?>_default_zoom_level').value = zoomLevel;
311 function switch_display()
313 var new_display_val =
'block';
314 var display_val = document.getElementById(
'map').style.display;
315 if (display_val !=
'none') {
316 new_display_val =
'none';
318 document.getElementById(
'map').style.display = new_display_val;
319 if (loaded ==
false) {
340 $wa = $asset->writeAccess(
'attributes');
341 $default_latitude = $asset->attr(
'default_latitude');
342 $default_longitude = $asset->attr(
'default_longitude');
343 $default_zoom_level = $asset->attr(
'default_zoom_level');
345 $attr_change = FALSE;
346 $new_default_latitude = isset($_POST[$prefix.
'_default_latitude']) ? $_POST[$prefix.
'_default_latitude'] :
'';
347 if (!is_null($new_default_latitude) && $new_default_latitude != $default_latitude) {
349 $asset->setAttrValue(
'default_latitude', $new_default_latitude);
352 $new_default_longitude = isset($_POST[$prefix.
'_default_longitude']) ? $_POST[$prefix.
'_default_longitude'] :
'';
353 if (!is_null($new_default_longitude) && $new_default_longitude != $default_longitude) {
355 $asset->setAttrValue(
'default_longitude', $new_default_longitude);
358 $new_default_zoom_level = isset($_POST[$prefix.
'_default_zoom_level']) ? $_POST[$prefix.
'_default_zoom_level'] :
'';
359 if (!is_null($new_default_zoom_level) && $new_default_zoom_level != $default_zoom_level) {
361 $asset->setAttrValue(
'default_zoom_level', $new_default_zoom_level);
364 if ($attr_change) $asset->saveAttributes();
379 $wa = $asset->writeAccess(
'attributes');
380 $use_google_marker_icon = $asset->attr(
'use_google_marker_icon');
381 $default_marker_icon = $asset->attr(
'default_marker_icon');
383 $o->openField(
'Default Marker Icon URL');
385 check_box($prefix.
'_use_default_marker_icon',
'1', $use_google_marker_icon,
'
386 if (this.checked==1) {
387 document.getElementById("'.$prefix.
'_default_marker_icon_url").disabled=true;
389 document.getElementById("'.$prefix.
'_default_marker_icon_url").disabled=false;
392 echo
' Use Google Default Marker<br /><br />';
393 $extra = $use_google_marker_icon ?
'disabled=true' :
'';
394 text_box($prefix.
'_default_marker_icon_url', $default_marker_icon, empty($default_marker_icon) ? 25 : strlen($default_marker_icon),
'', FALSE, $extra);;
395 $o->note(
'The URL to default icon for markers on the map');
397 echo $default_marker_icon;
398 $o->note(
'The URL to default icon for markers on the map');
417 $wa = $asset->writeAccess(
'attributes');
418 $default_marker_icon = $asset->attr(
'default_marker_icon');
419 $use_google_marker_icon = $asset->attr(
'use_google_marker_icon');
421 $attr_change = FALSE;
422 $new_use_google_marker_icon = isset($_POST[$prefix.
'_use_default_marker_icon']) ? $_POST[$prefix.
'_use_default_marker_icon'] : FALSE;
423 if (!is_null($new_use_google_marker_icon) && $new_use_google_marker_icon != $use_google_marker_icon) {
425 $asset->setAttrValue(
'use_google_marker_icon', $new_use_google_marker_icon);
427 if ($new_use_google_marker_icon != 1) {
428 $new_default_marker_icon = isset($_POST[$prefix.
'_default_marker_icon_url']) ? $_POST[$prefix.
'_default_marker_icon_url'] :
'';
429 if (!is_null($new_default_marker_icon) && $new_default_marker_icon != $default_marker_icon) {
430 $asset->setAttrValue(
'default_marker_icon', $new_default_marker_icon);
435 if ($attr_change) $asset->saveAttributes();
454 $wa = $asset->writeAccess(
'attributes');
456 $enable_listing = $asset->attr(
'enable_listing');
457 $listing_root_nodes = $asset->attr(
'listing_root_nodes');
458 if (!is_array($listing_root_nodes))
459 $listing_root_nodes = unserialize($listing_root_nodes);
461 bam($listing_root_nodes);
462 $default_listing_asset = $asset->attr(
'default_listing_asset');
463 $extra_custom = $enable_listing ?
'' :
' disabled="disabled"';
464 $extra_fields = $enable_listing&&$default_listing_asset ?
'' :
' disabled="disabled"';
466 if (!$enable_listing) {
467 echo
'<span style="color:red;">Listing Feature is not enabled.</span>';
470 if (!empty($listing_root_nodes)) {
471 $o->openSection(
'Listing Nodes');
475 <div
id=
"<?php echo $prefix ?>_mandatory_fields" style=
"padding: 0.5em 0px 2em 0px">
476 <table style=
"width:90%;padding-left: 30px;">
478 <td
class=
"sq-backend-table-cell" style=
"width:118px;padding-left:15px">Type Name</td>
479 <td
class=
"sq-backend-table-cell">Listing Root Node Options</td>
481 <td
class=
"sq-backend-table-cell"><?php echo translate(
'delete_question'); ?>
485 foreach ($listing_root_nodes as $node_info) {
486 if (is_string($node_info)) $node_info = unserialize($node_info);
489 <td
class=
"sq-backend-table-cell" style=
"width:118px;padding-left:15px;">
490 <strong><?php echo $node_info[
'type_name'] ?></strong>
493 <td
class=
"sq-backend-table-cell">
496 asset_finder($prefix.
'[existing_nodes]', $node_info[
'root_assetid'], Array(
'page_asset_listing'));
498 echo get_asset_tag_line($node_info[
'root_assetid']);
501 <?php
if (isset($node_info[
'icon_url'])) { ?>
502 <br /><span>Default Icon URL: <b><?php echo $node_info[
'icon_url'] ?></b></span>
504 if (isset($node_info[
'use_google_location_asset'])) {
505 $use_default = !empty($node_info[
'use_google_location_asset']);
508 <br /><span>Use Default Google Location
Asset: <b><?php echo $use_default ?
'Yes' :
'No' ; ?></b></span><br />
510 if (isset($node_info[
'latitude_keyword'])) {
512 <br /><span>Latitude Keyword: <b><?php echo $node_info[
'latitude_keyword']; ?></b></span>
515 if (isset($node_info[
'longitude_keyword'])) {
517 <br /><span>Longitude Keyword: <b><?php echo $node_info[
'longitude_keyword']; ?></b></span>
520 if (isset($node_info[
'description_keyword'])) {
522 <br /><span>Description Keyword: <b><?php echo $node_info[
'description_keyword']; ?></b></span>
525 if (isset($node_info[
'icon_url_keyword'])) {
527 <br /><span>Icon URL Keyword: <b><?php echo $node_info[
'icon_url_keyword']; ?></b></span>
534 <td
class=
"sq-backend-table-cell"><?php check_box($prefix.
'[delete]['.$node_info[
'root_assetid'].
']', $node_info[
'root_assetid'], FALSE); ?></td>
549 $o->openSection(
'Add New Listing Node');
552 $o->openField(
'New Root Node');
553 asset_finder($prefix.
'_new_root_node',
'', Array(
'page_asset_listing' =>
'D'));
554 $o->note(
'Select an Asset Listing to use');
557 $o->openField(
'Type Name');
558 text_box($prefix.
'_new_type_name',
'', 25);
559 $o->note(
'The Type Name associate with the listed assets');
562 $o->openField(
'Icon URL');
563 text_box($prefix.
'_new_icon_url',
'', 25);
564 $o->note(
'The Icon URL for these listed assets');
567 $o->openField(
'Use Default Google Location Asset');
568 check_box($prefix.
'_new_use_google_location_asset',
'1', TRUE,
'display_keywords();');
574 <script type=
"text/javascript">
575 function display_keywords()
577 var new_display_val =
'block';
578 var display_val = document.getElementById(
'keyword_div').style.display;
579 if (display_val !=
'none') {
580 new_display_val =
'none';
582 document.getElementById(
'keyword_div').style.display = new_display_val;
586 <div
id=
"keyword_div" style=
"width:100%;height:auto;border:0px solid;display:none;">
587 <table style=
"width:auto;padding-left: 0px;">
589 <td width=
"150" style=
"font-weight:bold;padding-left:44px;">Location Name Keyword</td>
590 <td><?php text_box($prefix.
'_new_location_name_keyword',
'', 25); ?></td>
593 <td width=
"150" style=
"font-weight:bold;padding-left:44px;">Latitude Keyword</td>
594 <td><?php text_box($prefix.
'_new_latitude_keyword',
'', 25); ?></td>
597 <td style=
"font-weight:bold;padding-left:44px;">Longitude Keyword</td>
598 <td><?php text_box($prefix.
'_new_longitude_keyword',
'', 25); ?></td>
601 <td style=
"font-weight:bold;padding-left:44px;">Description Keyword</td>
602 <td><?php text_box($prefix.
'_new_description_keyword',
'', 25); ?></td>
605 <td style=
"font-weight:bold;padding-left:44px;">Icon URL Keyword</td>
606 <td><?php text_box($prefix.
'_new_icon_url_keyword',
'', 25); ?></td>
609 <p style=
"padding-left:44px;">Use Keywords to specify custom fields. (Example: %asset_metadata_fieldname%)</p>
610 <table style=
"width:auto;padding-left: 0px;">
612 <td width=
"150" style=
"font-weight:bold;padding-left:44px;"><br />Custom Popup
Layout<br /></td>
613 <td><?php check_box($prefix.
'_new_use_asset_listing_bodycopy',
'1', TRUE); ?><br /><br /></td>
642 $wa = $asset->writeAccess(
'attributes');
644 $enable_listing = $asset->attr(
'enable_listing');
645 $listing_root_nodes = ($asset->attr(
'listing_root_nodes'));
646 $listing_root_nodes = unserialize($listing_root_nodes);
648 $default_listing_asset = $asset->attr(
'default_listing_asset');
650 $new_root_node = isset($_POST[$prefix.
'_new_root_node']) ? $_POST[$prefix.
'_new_root_node'] :
'';
651 $new_type_name = isset($_POST[$prefix.
'_new_type_name']) ? $_POST[$prefix.
'_new_type_name'] :
'';
652 $new_icon_url = isset($_POST[$prefix.
'_new_icon_url']) ? $_POST[$prefix.
'_new_icon_url'] :
'';
653 $new_use_google_location_asset = isset($_POST[$prefix.
'_new_use_google_location_asset']) ? $_POST[$prefix.
'_new_use_google_location_asset'] :
'';
655 $new_location_name_keyword = isset($_POST[$prefix.
'_new_location_name_keyword']) ? $_POST[$prefix.
'_new_location_name_keyword'] :
'';
656 $new_latitude_keyword = isset($_POST[$prefix.
'_new_latitude_keyword']) ? $_POST[$prefix.
'_new_latitude_keyword'] :
'';
657 $new_longitude_keyword = isset($_POST[$prefix.
'_new_longitude_keyword']) ? $_POST[$prefix.
'_new_longitude_keyword'] :
'';
658 $new_description_node = isset($_POST[$prefix.
'_new_description_keyword']) ? $_POST[$prefix.
'_new_description_keyword'] :
'';
659 $new_icon_url_node = isset($_POST[$prefix.
'_new_icon_url_keyword']) ? $_POST[$prefix.
'_new_icon_url_keyword'] :
'';
661 $delete_list = isset($_POST[$prefix][
'delete']) ? $_POST[$prefix][
'delete'] : Array();
663 $attr_change = FALSE;
664 $new_root_node_options = Array();
666 if (!empty($new_root_node) && !empty($new_root_node[
'assetid']) && $wa) {
667 $new_root_node_options = Array (
668 'root_assetid' => $new_root_node[
'assetid'],
671 if (!empty($new_type_name)) {
672 $new_root_node_options[
'type_name'] = $new_type_name;
674 if (!empty($new_icon_url)) {
675 $new_root_node_options[
'icon_url'] = $new_icon_url;
677 if (!is_null($new_use_google_location_asset)) {
678 $new_root_node_options[
'use_google_location_asset'] = $new_use_google_location_asset;
681 if (($new_use_google_location_asset == 0)) {
682 if (!empty($new_location_name_keyword)) {
683 $new_root_node_options[
'location_name_keyword'] = $new_location_name_keyword;
685 if (!empty($new_latitude_keyword)) {
686 $new_root_node_options[
'latitude_keyword'] = $new_latitude_keyword;
688 if (!empty($new_latitude_keyword)) {
689 $new_root_node_options[
'latitude_keyword'] = $new_latitude_keyword;
691 if (!empty($new_longitude_keyword)) {
692 $new_root_node_options[
'longitude_keyword'] = $new_longitude_keyword;
694 if (!empty($new_description_node)) {
695 $new_root_node_options[
'description_keyword'] = $new_description_node;
697 if (!empty($new_icon_url_node)) {
698 $new_root_node_options[
'icon_url_keyword'] = $new_icon_url_node;
702 $listing_root_nodes[$new_root_node[
'assetid']] = $new_root_node_options;
703 $asset->setAttrValue(
'listing_root_nodes', $listing_root_nodes);
707 if (!empty($delete_list)) {
708 foreach ($delete_list as $node_id => $id_node) {
709 if (isset($listing_root_nodes[$node_id])) {
710 unset($listing_root_nodes[$node_id]);
711 $asset->setAttrValue(
'listing_root_nodes', $listing_root_nodes);
717 if ($attr_change) $asset->saveAttributes();
736 $wa = $asset->writeAccess(
'attributes');
737 parent::paintAssetTypes($asset, $o, $prefix);
738 $types = $asset->attr(
'types');
739 $keywords_list = $asset->attr(
'asset_types_keywords');
742 foreach ($types as $type_code => $inherit) {
743 if ($type_code !==
'google_map_location') {
746 <div
id=
"<?php echo $prefix ?>_mandatory_fields" style=
"padding: 0.5em 0px 0px 30px;margin-left:75px;">
747 <?php
if (!isset($keywords_list[$type_code])) echo
'Type code '.ucwords(str_replace(
'_',
' ', $type_code)) .
' is not of type Google Map Location, Mapping of keywords is required.'; ?>
748 <p
class=
"sq-backend-section-subheading"><?php echo
'Keyword mapping for '.ucwords(str_replace(
'_',
' ', $type_code)); ?></p>
750 <div
id=
"<?php echo $prefix ?>_connector_div" style=
"padding: 0px 0px 2em 30px;">
751 <table
class=
"sq-backend-table" style=
"width:100%">
753 <td width=
"100"><p></p>Location Name keyword</td>
756 echo array_get_index($keywords_list[$type_code],
'name_keyword',
'');
758 text_box($prefix.
'_'.$type_code.
'_name_keyword', array_get_index($keywords_list[$type_code],
'name_keyword',
''), 50);
763 <td width=
"100"><p></p>Latitude keyword</td>
766 echo array_get_index($keywords_list[$type_code],
'latitude_keyword',
'');
768 text_box($prefix.
'_'.$type_code.
'_latitude_keyword', array_get_index($keywords_list[$type_code],
'latitude_keyword',
''), 50);
773 <td width=
"100"><p></p>Longitude keyword</td>
776 echo array_get_index($keywords_list[$type_code],
'longitude_keyword',
'');
778 text_box($prefix.
'_'.$type_code.
'_longitude_keyword', array_get_index($keywords_list[$type_code],
'longitude_keyword',
''), 50);
783 <td width=
"100"><p></p>Description keyword</td>
786 echo array_get_index($keywords_list[$type_code],
'description_keyword',
'');
788 text_box($prefix.
'_'.$type_code.
'_description_keyword', array_get_index($keywords_list[$type_code],
'description_keyword',
''), 50);
793 <td width=
"100"><p></p>Icon URL keyword</td>
796 echo array_get_index($keywords_list[$type_code],
'icon_url_keyword',
'');
798 text_box($prefix.
'_'.$type_code.
'_icon_url_keyword', array_get_index($keywords_list[$type_code],
'icon_url_keyword',
''), 50);
803 <td width=
"100"><p></p>Address Keyword</td>
806 echo array_get_index($keywords_list[$type_code],
'address_keyword',
'');
808 text_box($prefix.
'_'.$type_code.
'_address_keyword', array_get_index($keywords_list[$type_code],
'address_keyword',
''), 50);
837 parent::processAssetTypes($asset, $o, $prefix);
840 $types = $asset->attr(
'types');
841 $keywords_list = $asset->attr(
'asset_types_keywords');
843 foreach ($types as $type_code => $inherit) {
844 if ($type_code !==
'google_map_location') {
846 $keywords_list[$type_code][
'name_keyword'] = array_get_index($_POST, $prefix.
'_'.$type_code.
'_name_keyword', NULL);
847 $keywords_list[$type_code][
'latitude_keyword'] = array_get_index($_POST, $prefix.
'_'.$type_code.
'_latitude_keyword', NULL);
848 $keywords_list[$type_code][
'longitude_keyword'] = array_get_index($_POST, $prefix.
'_'.$type_code.
'_longitude_keyword', NULL);
849 $keywords_list[$type_code][
'description_keyword'] = array_get_index($_POST, $prefix.
'_'.$type_code.
'_description_keyword', NULL);
850 $keywords_list[$type_code][
'icon_url_keyword'] = array_get_index($_POST, $prefix.
'_'.$type_code.
'_icon_url_keyword', NULL);
851 $keywords_list[$type_code][
'address_keyword'] = array_get_index($_POST, $prefix.
'_'.$type_code.
'_address_keyword', NULL);
854 $asset->setAttrValue(
'asset_types_keywords', $keywords_list);
867 $wa = $asset->writeAccess(
'attributes');
869 $o->openField(
'Map Initialisation');
870 $map_code = $asset->attr(
'map_code');
872 text_area($prefix.
'_map_code', $map_code, 100, 10);
874 echo nl2br(htmlentities($map_code));
878 $street_view = $asset->attr(
'enable_street_view');
879 $extra =
'disabled=disabled';
881 $o->openField(
'Standalone Street View Initialisation');
882 $street_view_code = $asset->attr(
'street_view_code');
884 text_area($prefix.
'_street_view_code', $street_view_code, 100, 10, FALSE, $street_view ?
'' : $extra);
886 echo nl2br(htmlentities($street_view_code));
903 $wa = $asset->writeAccess(
'attributes');
904 if (isset($_POST[$prefix.
'_map_code'])) {
905 $new_map_code = $_POST[$prefix.
'_map_code'];
906 $map_code = $asset->attr(
'map_code');
907 if ($new_map_code != $map_code) {
908 $asset->setAttrValue(
'map_code', $new_map_code);
912 if (isset($_POST[$prefix.
'_street_view_code'])) {
913 $new_street_view_code = $_POST[$prefix.
'_street_view_code'];
914 $street_view_code = $asset->attr(
'street_view_code');
915 if ($new_street_view_code != $street_view_code) {
916 $asset->setAttrValue(
'street_view_code', $new_street_view_code);