18 require_once SQ_CORE_PACKAGE_PATH.
'/page/page_edit_fns.inc';
41 parent::__construct();
42 $this->static_screens[
'details'][
'force_unlock'] = FALSE;
43 $this->static_screens[
'details'][
'lock_type'] =
'content';
60 $root_link = $GLOBALS[
'SQ_SYSTEM']->am->getLink($asset->id, SQ_LINK_NOTICE,
'', FALSE,
'root');
61 $write_access = $asset->writeAccess(
'links');
65 if (!empty($root_link)) {
66 echo get_asset_tag_line($root_link[
'minorid']);
68 echo translate(
'cms_no_root_node');
71 asset_finder($prefix.
'_rootid', (!empty($root_link)) ? $root_link[
'minorid'] :
'');
91 if (!isset($_POST[$prefix.
'_rootid'][
'assetid']) || (isset($asset->_tmp[
'reverting_to_system_version']) && $asset->_tmp[
'reverting_to_system_version'])) {
94 $new_root = $_POST[$prefix.
'_rootid'][
'assetid'];
97 $root_link = $GLOBALS[
'SQ_SYSTEM']->am->getLink($asset->id, SQ_LINK_NOTICE,
'', FALSE,
'root');
100 if (!empty($root_link) && $root_link[
'minorid'] == $new_root) {
106 $GLOBALS[
'SQ_SYSTEM']->changeDatabaseConnection(
'db2');
107 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'BEGIN');
110 if (!empty($root_link) && !$GLOBALS[
'SQ_SYSTEM']->am->deleteAssetLink($root_link[
'linkid'])) {
112 }
else if ($new_root) {
113 $root = $GLOBALS[
'SQ_SYSTEM']->am->getAsset($new_root);
114 if (!is_null($root)) {
115 if (!$asset->createLink($root, SQ_LINK_NOTICE,
'root')) {
117 trigger_localised_error(
'CMS0016', E_USER_WARNING, $root->name, $root->id);
123 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'COMMIT');
125 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'ROLLBACK');
128 $GLOBALS[
'SQ_SYSTEM']->restoreDatabaseConnection();
146 $write_access = $asset->writeAccess(
'attributes');
147 $curr_list = $asset->attr(
'exclude_list');
150 multiple_asset_finder($prefix.
'_exclude_list', $curr_list, Array(
'asset' =>
'D'));
152 if (empty($curr_list)) {
153 echo translate(
'cms_no_assets_excluded');
155 ?><ul style=
"margin:1px 15px;"><?php
156 foreach ($curr_list as $assetid) {
157 echo
'<li>'.get_asset_tag_line($assetid).
'</li>';
163 return $write_access;
180 $exclude_post = array_get_index($_POST, $prefix.
'_exclude_list', Array());
181 $exclude_list = Array();
183 foreach ($exclude_post as $exclude_item) {
184 if (!empty($exclude_item[
'assetid'])) {
185 $exclude_list[$exclude_item[
'assetid']] = $exclude_item[
'assetid'];
189 return $asset->setAttrValue(
'exclude_list', $exclude_list);
206 $write_access = $asset->writeAccess(
'attributes');
207 $curr_list = $asset->attr(
'include_types');
210 asset_type_chooser($prefix.
'_include_types', TRUE, $curr_list, NULL, TRUE, TRUE);
212 if (empty($curr_list)) {
213 echo translate(
'cms_page_site_map_all_asset_types_included');
215 ?><ul style=
"margin:1px 15px;"><?php
217 $type_inherit = Array();
218 if (isset($curr_list[
'inherit'])) {
219 $type_inherit = $curr_list[
'inherit'];
222 foreach ($curr_list[
'type_code'] as $type_code) {
223 if (!empty($type_code)) {
225 if (!empty($type_inherit)) {
226 $inherit = array_shift($type_inherit);
229 $type_name = $GLOBALS[
'SQ_SYSTEM']->am->getTypeInfo($type_code,
'name');
231 get_asset_type_icon($type_code);
235 echo
' ('.translate(
'cms_page_site_map_inherits_child_types').
')';
245 return $write_access;
262 $exclude_types = Array();
263 if (isset($_POST[$prefix.
'_include_types']) && !empty($_POST[$prefix.
'_include_types'][
'type_code'][0])) {
264 $exclude_types = $_POST[$prefix.
'_include_types'];
267 return $asset->setAttrValue(
'include_types', $exclude_types);
284 $write_access = $asset->writeAccess(
'attributes');
286 $formats = $asset->attr(
'display_formats');
290 $formats[] = Array();
291 }
else if (empty($formats)) {
292 echo translate(
'cms_page_site_map_no_display_formats');
298 <table
class=
"sq-backend-table">
300 <th><?php echo translate(
'asset_type'); ?></th><?php echo (!$write_access ?
'<th>'.translate(
'inherit').
'</th>' :
''); ?><th><?php echo translate(
'format'); ?></th><?php echo ($write_access ?
'<th>'.translate(
'delete').
'</th>' :
''); ?>
303 foreach ($formats as $key => $format) {
304 $row_prefix = $prefix.
'_display_formats['.$key.
']';
305 if (empty($format)) {
306 $current_type = Array();
308 $current_type = Array(
310 'inherit' => $format[
'inherit'],
318 <td
class=
"sq-backend-table-cell"><?php asset_type_chooser($row_prefix.
'[type]', FALSE, $current_type, NULL, FALSE, TRUE); ?></td>
319 <td
class=
"sq-backend-table-cell"><?php text_box($row_prefix.
'[format]', array_get_index($format,
'format',
''), 70); ?></td>
320 <td
class=
"sq-backend-table-cell"><?php check_box($row_prefix.
'[delete]'); ?></td>
324 <td
class=
"sq-backend-table-cell"><?php get_asset_type_icon($key); echo $GLOBALS[
'SQ_SYSTEM']->am->getTypeInfo($key,
'name'); ?></td>
325 <td
class=
"sq-backend-table-cell"><?php echo ($format[
'inherit'] ? translate(
'yes') : translate(
'no')); ?></td>
326 <td
class=
"sq-backend-table-cell"><?php echo $format[
'format']; ?></td>
354 if (isset($_POST[$prefix.
'_display_formats'])) {
357 foreach ($_POST[$prefix.
'_display_formats'] as $type => $format) {
358 if (isset($format[
'delete']) || empty($format[
'format'])) {
362 $formats[$format[
'type'][
'type_code']] = Array(
363 'inherit' => $format[
'type'][
'inherit'],
364 'format' => $format[
'format'],
368 if ($asset->setAttrValue(
'display_formats', $formats)) {