Пример #1
0
 function HTML_QuickForm_time($elementName = null, $elementLabel = null, $attributes = null, $properties = array())
 {
     if (isset($elementName)) {
         $start = isset($properties['starttime']) ? $properties['starttime'] : '08:00';
         $end = isset($properties['endtime']) ? $properties['endtime'] : '18:00';
         $interval = isset($properties['interval']) ? $properties['interval'] : '30';
         $format = isset($properties['format']) ? $properties['format'] : 'H:i';
         $properties['starttime'] = $start;
         $properties['endtime'] = $end;
         $properties['interval'] = $interval;
         $properties['format'] = $format;
         if (intval($properties['interval']) <= 0) {
             $properties['interval'] = 30;
         }
         $starttime = strtotime($properties['starttime']);
         $endtime = strtotime($properties['endtime']);
         $interval_seconds = intval($properties['interval']) * 60;
         $opts = array();
         $j = 0;
         for ($i = $starttime; $i <= $endtime; $i += $interval_seconds) {
             $opts[date('H:i:s', $i)] = date($properties['format'], $i);
             $j++;
         }
         parent::HTML_QuickForm_select($elementName, $elementLabel, $opts, $attributes);
     }
 }
Пример #2
0
 function MoodleQuickForm_selectwithlink($elementName = null, $elementLabel = null, $options = null, $attributes = null, $linkdata = null)
 {
     if (!empty($linkdata['link']) && !empty($linkdata['label'])) {
         $this->_link = $linkdata['link'];
         $this->_linklabel = $linkdata['label'];
     }
     if (!empty($linkdata['return'])) {
         $this->_linkreturn = $linkdata['return'];
     }
     parent::HTML_QuickForm_select($elementName, $elementLabel, $options, $attributes);
 }
Пример #3
0
 function MoodleQuickForm_select($elementName = null, $elementLabel = null, $options = null, $attributes = null)
 {
     parent::HTML_QuickForm_select($elementName, $elementLabel, $options, $attributes);
 }
Пример #4
0
 /**
  * Constructor.  Used to distinguish the attributes array which should be 
  * an associative array of options to either a typical HTML attribute string
  * or another associative array
  * 
  * @param  string    $elementName  select name attribute
  * @param  mixed     $elementLabel label(s) for the select
  * @param  mixed     $options      data to be used to populate options
  * @param  mixed     $attributes   an associative array of option value 
  *                                 -> attributes. Each attribute is either 
  *                                 a typical HTML attribute string or an
  *                                 associative array.
  *                                 NOTE: use "_qf_other" for the other radio
  *                                 button, "_qf_other_text" for the 
  *                                 text field and "_qf_all" to apply the
  *                                 attributes to all the option elements.
  * @return void
  */
 function HTML_QuickForm_altselect($elementName = null, $elementLabel = null, $options = null, $attributes = null)
 {
     if (func_get_args()) {
         HTML_QuickForm_select::HTML_QuickForm_select($elementName, $elementLabel, $options);
         $this->_individualAttributes = $attributes;
     }
 }
Пример #5
0
 /**
  * Initialises form element with loaded options
  * @param string $elementName Element name
  * @param string $elementLabel Text for element's <label> tag
  * @param array $options Initially selected options within the list
  * @param array(string => string) $attributes HTML attributes for the element
  * @version 2011071401
  * @since 2011071401
  */
 public function __construct($elementName = null, $elementLabel = null, $options = null, $attributes = null)
 {
     parent::HTML_QuickForm_select($elementName, $elementLabel, $options, $attributes);
 }