Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
page_calendar_restricted_edit_fns.inc
1 <?php
18 require_once SQ_CORE_PACKAGE_PATH.'/page/page_edit_fns.inc';
19 require_once SQ_PACKAGES_PATH.'/calendar/page_templates/page_calendar_rolling/page_calendar_rolling_edit_fns.inc';
20 
21 
22 
35 {
36 
37 
42  function __construct()
43  {
44  parent::__construct();
45  }//end constructor
46 
57  function paintEventSources(&$asset, &$o, $prefix)
58  {
59  if ($asset->writeAccess('attributes')) {
60  multiple_asset_finder($prefix.'_event_sources', array_keys($asset->attr('root_nodes')));
61  return TRUE;
62  } else {
63  $infos = $GLOBALS['SQ_SYSTEM']->am->getAssetInfo(array_keys($asset->attr('root_nodes')), '', TRUE, 'name');
64  ?><ul style="margin: 1px 15px;"><?php
65  foreach ($infos as $id => $name) {
66  echo '<li>'.get_asset_tag_line($id).'</li>';
67  }
68  ?></ul><?php
69  return FALSE;
70  }
71 
72  }//end paintEventSources()
73 
74 
85  function processEventSources(&$asset, &$o, $prefix)
86  {
87  if (isset($_POST[$prefix.'_event_sources'])) {
88  $root_nodes = Array();
89  foreach ($_POST[$prefix.'_event_sources'] as $source) {
90  if (!empty($source['assetid'])) {
91  $root_nodes[$source['assetid']] = 1;
92  }
93  }
94  return $asset->setAttrValue('root_nodes', $root_nodes);
95  }
96  return FALSE;
97 
98  }//end processEventSources()
99 
100 
101 }//end class
102 ?>