Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
layout_edit_fns.inc
1 <?php
18 require_once SQ_CORE_PACKAGE_PATH.'/bodycopy/bodycopy/bodycopy_edit_fns.inc';
19 
32 {
33 
34 
39  function __construct()
40  {
41  parent::__construct();
42 
43  }//end constructor
44 
45 
56  public function paintLimboKeywords(Layout $asset, Backend_Outputter $o, $prefix)
57  {
58  ?>
59  <p>Click here for <a href="#" onClick="javascript: var win = window.open('<?php echo sq_web_path('data')?>/asset_types/layout/popups/print_limbo_keywords.php', 'keywords', 'toolbar=0,menubar=0,location=0,status=0,scrollbars=1,resizable=1,width=580,height=520')">a list of specific asset keywords available for use in Simple Edit Mode</a>.</p>
60  <?php
61 
62  }//end paintLimboKeywords()
63 
64 
75  public function processLimboKeywords(Layout $asset, Backend_Outputter $o, $prefix)
76  {
77  return TRUE;
78 
79  }//end processLimboKeywords()
80 
81 
92  public function paintLayout(Layout $asset, Backend_Outputter $o, $prefix)
93  {
94  return parent::paintBodycopy($asset, $o, $prefix);
95 
96  }//end paintLayout()
97 
98 
109  public function processLayout(Layout $asset, Backend_Outputter $o, $prefix)
110  {
111  return parent::processBodycopy($asset, $o, $prefix);
112 
113  }//end processLayout()
114 
115 
126  public function paintLayoutOptions(Layout $asset, Backend_Outputter $o, $prefix)
127  {
128  $write_access = $asset->writeAccess('attributes');
129 
130  $layout_display_options = $asset->attr('options');
131 
132  $show_cascade_metadata_field = FALSE;
133  if (isset($layout_display_options['show_cascade_metadata_field'])) {
134  $show_cascade_metadata_field = $layout_display_options['show_cascade_metadata_field'];
135  }
136 
137  if ($write_access) {
138  check_box($prefix.'[show_cascade_metadata_field]', 1, $show_cascade_metadata_field);
139  label(translate('core_layout_show_cascade_metadata_field'), $prefix.'[show_cascade_metadata_field]');
140  } else {
141  ?>
142  <img src="<?php echo sq_web_path('lib'); ?>/web/images/<?php echo ($show_cascade_metadata_field ? 'tick' : 'cross'); ?>.gif" width="15" height="15" />
143  <?php
144  echo translate('core_layout_show_cascade_metadata_field');
145  }
146 
147  return TRUE;
148 
149  }//end paintLayoutOptions()
150 
151 
162  public function processLayoutOptions(Layout $asset, Backend_Outputter $o, $prefix)
163  {
164  $write_access = $asset->writeAccess('attributes');
165 
166  if ($write_access) {
167  $layout_display_options = $asset->attr('options');
168 
169  // With checkboxes, default to unset unless it is set, in which case set the value. Now we're all set
170  $layout_display_options['show_cascade_metadata_field'] = FALSE;
171 
172  if (isset($_POST[$prefix]['show_cascade_metadata_field'])) {
173  $layout_display_options['show_cascade_metadata_field'] = (bool) $_POST[$prefix]['show_cascade_metadata_field'];
174  }
175 
176  $asset->setAttrValue('options', $layout_display_options);
177  $asset->saveAttributes();
178  }
179 
180  return TRUE;
181 
182  }//end processLayoutOptions()
183 
184 
185 }//end class
186 
187 ?>