Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
calendar_event_modification_edit_fns.inc
1 <?php
17 require_once dirname(__FILE__).'/../../calendar_event/calendar_event_edit_fns.inc';
18 
31 {
32 
33 
39  {
40  $this->Calendar_Event_Edit_Fns();
41 
42  }//end constructor
43 
44 
57  function paintDateTimeChooser(&$asset, &$o, $prefix)
58  {
59  if ($asset->writeAccess('attributes')) {
60  $start_date_attr =& $asset->getAttribute('start_date');
61  if (($ts = $start_date_attr->getTimestamp()) == -1) {
62  $ts = 0;
63  }
64  $this->printDateChooser($prefix.'_start', $ts);
65  hidden_field($prefix.'_start_end_chooser_printed', 1);
66  } else {
67  echo $asset->getFriendlyDatesAndTimes();
68  }
69 
70  }//end paintDateTimeChooser()
71 
72 
83  function processDateTimeChooser(&$asset, &$o, $prefix)
84  {
85  return $this->processStartEndChooser($asset, $o, $prefix);
86 
87  }//end processDateTimeChooser()
88 
89 
100  function paintRecurringEventChooser(&$asset, &$o, $prefix)
101  {
102  $modified_event_asset = NULL;
103  if ($asset->id) {
104  $recurring_event_ids = array_keys($GLOBALS['SQ_SYSTEM']->am->getParents($asset->id, 'calendar_event_recurring', FALSE));
105  if (!empty($recurring_event_ids)) {
106  $modified_event_asset =& $GLOBALS['SQ_SYSTEM']->am->getAsset($recurring_event_ids[0]);
107  }
108  }
109  if (!is_null($modified_event_asset)) {
110  echo get_asset_tag_line($modified_event_asset->id);
111  } else {
112  echo translate('cal_event_modify_no_event_selected');
113  }
114 
115  }//end paintRecurringEventChooser()
116 
117 
128  function processRecurringEventChooser(&$asset, &$o, $prefix)
129  {
130  // not doing anything here; the field is processed in saveAttributes() because
131  // we need an ID first
132  return TRUE;
133 
134  }//end processRecurringEventChooser()
135 
136 
137 }//end class
138 
139 ?>