Exemple #1
0
 protected function _getHtmlAttributes()
 {
     $attributes = array();
     $attributes['type'] = "hidden";
     $attributes['value'] = String::escape($this->getValue());
     return $attributes;
 }
Exemple #2
0
 protected function _getHtmlAttributes()
 {
     $attributes = array();
     $attributes['type'] = "hidden";
     $attributes['value'] = String::escape($this->getValue());
     if ($this->hasReadonly() && $this->getReadonly() === true) {
         $attributes['readonly'] = 'readonly';
     }
     return $attributes;
 }
Exemple #3
0
 protected function _getHtmlAttributes()
 {
     $attributes = array();
     $attributes['type'] = "hidden";
     if ($this->getMode() === self::MODE_NEW) {
         $attributes['value'] = $this->getDefault();
     } else {
         $attributes['value'] = String::escape($this->getValue());
     }
     return $attributes;
 }
Exemple #4
0
 protected function _getHtmlAttributes()
 {
     $attributes = array();
     $attributes['type'] = "number";
     $attributes['step'] = "any";
     $attributes['value'] = String::escape($this->getValue());
     $attributes['maxlength'] = $this->getLength();
     if ($this->getIsAutoIncrement() === true || $this->hasReadonly() && $this->getReadonly() === true) {
         $attributes['readonly'] = "readonly";
     }
     return $attributes;
 }
Exemple #5
0
 protected function _getHtmlAttributes()
 {
     $attributes = array();
     $attributes['type'] = 'time';
     if ($this->getValue()) {
         $attributes['value'] = String::escape(date('H:i', strtotime($this->getValue())));
     } else {
         $attributes['value'] = '';
     }
     if ($this->hasReadonly() && $this->getReadonly() === true) {
         $attributes['readonly'] = 'readonly';
     }
     return $attributes;
 }
Exemple #6
0
 protected function _getHtmlAttributes()
 {
     $attributes = array();
     if ($this->hasReadonly() && $this->getReadonly() === true) {
         $attributes['value'] = String::escape($this->getValue());
         $attributes['type'] = "text";
         $attributes['readonly'] = "readonly";
     } else {
         if ($this->getValue()) {
             $attributes['value'] = String::escape(date('Y-m-d', strtotime($this->getValue())));
         }
         $attributes['type'] = "date";
     }
     return $attributes;
 }
Exemple #7
0
 protected function _getHtmlAttributes()
 {
     $attributes = array();
     $attributes['type'] = "text";
     $attributes['value'] = String::escape($this->getValue());
     $attributes['maxlength'] = String::escape($this->getLength());
     if ($this->hasReadonly() && $this->getReadonly() === true) {
         $attributes['readonly'] = "readonly";
     }
     if ($this->hasEmphasis() && $this->getEmphasis() === true) {
         $attributes['class'] = "emphasis";
     }
     if ($this->hasPlaceholder()) {
         $attributes['placeholder'] = $this->getPlaceholder();
     }
     return $attributes;
 }
Exemple #8
0
 public function getParam($key, $default = null, $type = self::TYPE_STRING, $post = false)
 {
     $data = $this->_data;
     if ($post === true) {
         $data = $this->getPostData();
     }
     if (isset($data[$key])) {
         switch ($type) {
             case self::TYPE_HTML:
                 if ($this->autoCleanHtml() === true) {
                     return String::clean($data[$key]);
                 } else {
                     return $data[$key];
                 }
                 break;
             case self::TYPE_INTEGER:
                 return (int) $data[$key];
                 break;
             case self::TYPE_FLOAT:
                 return (double) $data[$key];
                 break;
             case self::TYPE_RAW:
                 return $data[$key];
                 break;
             case self::TYPE_STRING:
             default:
                 if ($this->autoEscapeString() === true) {
                     if (is_array($data[$key])) {
                         array_walk($data[$key], array("Ajde_Component_String", "escape"));
                         return $data[$key];
                     } else {
                         return String::escape($data[$key]);
                     }
                 } else {
                     return $data[$key];
                 }
         }
     } else {
         if (isset($default)) {
             return $default;
         } else {
             // TODO:
             throw new Exception("Parameter '{$key}' not present in request and no default value given");
         }
     }
 }