예제 #1
0
 /**
  * A private method to initialise the day span selector element.
  *
  * @access pivate
  */
 function _initDaySpanSelector()
 {
     require_once MAX_PATH . '/lib/max/Admin/UI/FieldFactory.php';
     $aPeriod = array();
     $aPeriod['period_preset'] = MAX_getStoredValue('period_preset', 'today');
     $aPeriod['period_start'] = MAX_getStoredValue('period_start', date('Y-m-d'));
     $aPeriod['period_end'] = MAX_getStoredValue('period_end', date('Y-m-d'));
     $this->oDaySpanSelector =& FieldFactory::newField('day-span');
     $this->oDaySpanSelector->_name = 'period';
     $this->oDaySpanSelector->enableAutoSubmit();
     $this->oDaySpanSelector->setValueFromArray($aPeriod);
     $this->aDates = array('day_begin' => $this->oDaySpanSelector->getStartDate(), 'day_end' => $this->oDaySpanSelector->getEndDate());
     if (!is_null($this->aDates['day_begin'])) {
         $this->aDates['day_begin'] = $this->aDates['day_begin']->format('%Y-%m-%d');
         $this->aDates['day_end'] = $this->aDates['day_end']->format('%Y-%m-%d');
     } else {
         $this->aDates = array();
     }
     $this->aGlobalPrefs['period_preset'] = $this->oDaySpanSelector->_fieldSelectionValue;
     $this->aGlobalPrefs['period_start'] = $this->aDates['day_begin'];
     $this->aGlobalPrefs['period_end'] = $this->aDates['day_end'];
 }
 function OA_Admin_UI_Audit_DaySpanField($name = 'AuditDaySpanField', $fieldSelectionDefault = 'all_events', $aFieldSelectionNames = null)
 {
     parent::Admin_UI_DaySpanField($name, $fieldSelectionDefault, $aFieldSelectionNames);
     $this->oTrans = new OX_Translation();
 }
 function __construct($name = 'AuditDaySpanField', $fieldSelectionDefault = 'all_events', $aFieldSelectionNames = null)
 {
     parent::__construct($name, $fieldSelectionDefault, $aFieldSelectionNames);
     $this->oTrans = new OX_Translation();
 }