Esempio n. 1
0
 /**
  * @param string $name
  * @param null   $value
  *
  * @return string
  */
 protected function getInputBox($name = RokCommon_Filter_Type::JAVASCRIPT_NAME_VARIABLE, $value = null)
 {
     if (null == $value) {
         $date = new RokCommon_Date();
         $value = $date->toFormat('%Y-%m-%d');
     }
     return '<input type="text" name="' . $name . '" value="' . $value . '" class="' . $this->type . '" data-key="' . $this->type . '"/><a href="#" title="Select Date" class="date-picker"><i class="icon tool date"></i></a>';
 }
Esempio n. 2
0
 protected function getOptions()
 {
     $now = new RokCommon_Date();
     // Initialize variables.
     $options = array();
     $translation = $this->element['translation'] ? $this->element['translation'] : true;
     foreach ($this->element->children() as $option) {
         // Only add <option /> elements.
         if ($option->getName() != 'option') {
             continue;
         }
         // Create a new option object based on the <option /> element.
         $tmp = RokCommon_Config_HTML_Select::option((string) $option['value'], (string) $now->toFormat($option['value']), 'value', 'text', (string) $option['disabled'] == 'true');
         // Set some option attributes.
         $tmp->class = (string) $option['class'];
         // Set some JavaScript option attributes.
         $tmp->onclick = (string) $option['onclick'];
         // Add the option object to the result set.
         $options[] = $tmp;
     }
     reset($options);
     return $options;
 }