17 require_once SQ_INCLUDE_PATH.
'/asset_edit/asset_edit_fns.inc';
18 require_once SQ_INCLUDE_PATH.
'/asset_edit_interface.inc';
43 $this->static_screens[
'details'][
'force_unlock'] = FALSE;
44 parent::__construct();
46 unset($this->static_screens[
'settings']);
47 unset($this->static_screens[
'preview']);
48 unset($this->static_screens[
'lookupValues']);
49 unset($this->static_screens[
'web_paths']);
50 unset($this->static_screens[
'metadata']);
51 unset($this->static_screens[
'metadataSchemas']);
52 unset($this->static_screens[
'workflow']);
53 unset($this->static_screens[
'tagging']);
54 unset($this->static_screens[
'roles']);
55 unset($this->static_screens[
'permissions']);
56 unset($this->static_screens[
'dependants']);
57 unset($this->static_screens[
'linking']);
58 unset($this->static_screens[
'layouts']);
75 if (!$asset->
writeAccess(
'attributes'))
return FALSE;
77 $types = $GLOBALS[
'SQ_SYSTEM']->am->getTypeList();
78 asset_type_chooser($prefix.
'_layouts', TRUE, Array());
97 if (isset($_POST[$prefix.
'_layouts']) && !empty($_POST[$prefix.
'_layouts'])) {
98 $layouts = $asset->
attr(
'layouts');
99 foreach ($_POST[$prefix.
'_layouts'] as $type_code) {
101 if (in_array($type_code, $asset->
attr(
'layouts'))) {
104 if (!empty($type_code)) $layouts[$type_code] = Array();
128 $layouts = $asset->
attr(
'layouts');
129 if (empty($layouts)) {
130 $o->
note(translate(
'no_layouts_defined'));
135 foreach ($layouts as $type_code => $screens) {
137 $uc_type_code = ucwords(str_replace(
'_',
' ', $type_code));
143 check_box($prefix.
'_remove_type_code['.$type_code.
']');
144 label(translate(
'remove_customisations_for', $uc_type_code), $prefix.
'_remove_type_code['.$type_code.
']');
151 if (empty($screens)) {
152 $o->
note(translate(
'no_layouts_for_screens', $uc_type_code));
155 <table
class=
"sq-backend-table">
157 <td
class=
"sq-backend-table-header" width=
"33%"><?php echo translate(
'screen_name'); ?></td>
158 <td
class=
"sq-backend-table-header" width=
"33%"><?php echo translate(
'layout'); ?></td>
159 <?php
if ($write_access) {
161 <td align=
"center" class=
"sq-backend-table-header" width=
"33%"><?php echo translate(
'remove'); ?></td>
169 foreach ($screens as $screen => $assetid) {
172 <td
class=
"sq-backend-table-cell">
173 <?php echo ucfirst($screen) ?>
175 <td
class=
"sq-backend-table-cell">
178 asset_finder($prefix.
'_find['.$type_code.
'@'.$screen.
']', $assetid, Array(
'layout' =>
'I'));
180 if (empty($assetid)) {
181 echo
'<em>'.translate(
'none').
'</em>';
183 echo get_asset_tag_line($assetid);
188 <?php
if ($write_access) {
190 <td align=
"center" class=
"sq-backend-table-cell">
191 <?php check_box($prefix.
'_remove_screen['.$type_code.
'@'.$screen.
']'); ?>
206 <br /><?php echo translate(
'add_layout'); ?>:
210 $GLOBALS[
'SQ_SYSTEM']->am->includeAsset($type_code);
211 $as =
new $type_code();
212 $ef = $as->getEditFns();
214 $screens = Array(
'');
215 foreach (array_keys($ef->static_screens) as $screen) {
216 $screens[] = $screen;
218 foreach (array_keys($ei->getScreens()) as $screen) {
219 $screens[] = $screen;
223 $screens = array_unique(array_diff($screens, array_keys($layouts[$type_code])));
225 $uc_screens = Array();
226 foreach ($screens as $screen) {
227 $uc_screens[$screen] = ucfirst($screen);
230 combo_box($prefix.
'_screens['.$type_code.
']', $uc_screens, FALSE, Array());
238 return $write_access;
258 if (isset($_POST[$prefix.
'_screens'])) {
259 $layouts = $asset->
attr(
'layouts');
260 foreach ($_POST[$prefix.
'_screens'] as $type_code => $screen) {
261 if (!$screen)
continue;
262 if (!isset($layouts[$type_code])) {
263 $layouts[$type_code] = Array();
265 $layouts[$type_code][$screen] = 0;
270 if (isset($_POST[$prefix.
'_find'])) {
271 foreach ($_POST[$prefix.
'_find'] as $info => $assetid) {
272 if (!isset($assetid[
'assetid']) || !$assetid[
'assetid']) {
275 list($type_code, $screen) = explode(
'@', $info);
276 $layouts[$type_code][$screen] = $assetid[
'assetid'];
282 if (isset($_POST[$prefix.
'_remove_screen'])) {
283 foreach (array_keys($_POST[$prefix.
'_remove_screen']) as $info) {
284 list($type_code, $screen) = explode(
'@', $info);
285 unset($layouts[$type_code][$screen]);
291 if (isset($_POST[$prefix.
'_remove_type_code'])) {
292 foreach (array_keys($_POST[$prefix.
'_remove_type_code']) as $type_code) {
293 unset($layouts[$type_code]);