示例#1
0
文件: File.php 项目: nabble/ajde
 protected function _getHtmlAttributes()
 {
     $attributes = [];
     $attributes['type'] = 'hidden';
     $attributes['value'] = Ajde_Component_String::escape($this->getValue());
     return $attributes;
 }
示例#2
0
 protected function _getHtmlAttributes()
 {
     $attributes = '';
     $attributes .= ' type="hidden" ';
     $attributes .= ' value="' . Ajde_Component_String::escape($this->getValue()) . '" ';
     return $attributes;
 }
示例#3
0
 protected function _getHtmlAttributes()
 {
     $attributes = '';
     $attributes .= ' type="text" ';
     $attributes .= ' value="' . Ajde_Component_String::escape($this->getValue()) . '" ';
     if ($this->hasReadonly() && $this->getReadonly() === true) {
         $attributes .= ' readonly="readonly" ';
     }
     return $attributes;
 }
示例#4
0
文件: Timespan.php 项目: nabble/ajde
 protected function _getHtmlAttributes()
 {
     $attributes = [];
     $attributes['type'] = 'hidden';
     $attributes['value'] = Ajde_Component_String::escape($this->getValue());
     if ($this->hasReadonly() && $this->getReadonly() === true) {
         $attributes['readonly'] = 'readonly';
     }
     return $attributes;
 }
示例#5
0
文件: Publish.php 项目: nabble/ajde
 protected function _getHtmlAttributes()
 {
     $attributes = [];
     $attributes['type'] = 'hidden';
     if ($this->getMode() === self::MODE_NEW) {
         $attributes['value'] = $this->getDefault();
     } else {
         $attributes['value'] = Ajde_Component_String::escape($this->getValue());
     }
     return $attributes;
 }
示例#6
0
 protected function _getHtmlAttributes()
 {
     $attributes = '';
     $attributes .= ' type="number" ';
     $attributes .= ' step="any" ';
     $attributes .= ' value="' . Ajde_Component_String::escape($this->getValue()) . '" ';
     $attributes .= ' maxlength="' . $this->getLength() . '" ';
     if ($this->getIsAutoIncrement() === true) {
         $attributes .= ' readonly="readonly" ';
     }
     return $attributes;
 }
示例#7
0
文件: Numeric.php 项目: nabble/ajde
 protected function _getHtmlAttributes()
 {
     $attributes = [];
     $attributes['type'] = 'number';
     $attributes['step'] = 'any';
     $attributes['value'] = Ajde_Component_String::escape($this->getValue());
     $attributes['maxlength'] = $this->getLength();
     if ($this->getIsAutoIncrement() === true || $this->hasReadonly() && $this->getReadonly() === true) {
         $attributes['readonly'] = 'readonly';
     }
     return $attributes;
 }
示例#8
0
文件: Time.php 项目: nabble/ajde
 protected function _getHtmlAttributes()
 {
     $attributes = [];
     $attributes['type'] = 'time';
     if ($this->getValue()) {
         $attributes['value'] = Ajde_Component_String::escape(date('H:i', strtotime($this->getValue())));
     } else {
         $attributes['value'] = '';
     }
     if ($this->hasReadonly() && $this->getReadonly() === true) {
         $attributes['readonly'] = 'readonly';
     }
     return $attributes;
 }
示例#9
0
文件: Text.php 项目: nabble/ajde
 protected function _getHtmlAttributes()
 {
     $attributes = [];
     $attributes['type'] = 'text';
     $attributes['value'] = Ajde_Component_String::escape($this->getValue());
     $attributes['maxlength'] = Ajde_Component_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;
 }
示例#10
0
文件: Request.php 项目: nabble/ajde
 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 Ajde_Component_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], ['Ajde_Component_String', 'escape']);
                         return $data[$key];
                     } else {
                         return Ajde_Component_String::escape($data[$key]);
                     }
                 } else {
                     return $data[$key];
                 }
         }
     } else {
         if (isset($default)) {
             return $default;
         } else {
             // TODO:
             throw new Ajde_Exception("Parameter '{$key}' not present in request and no default value given");
         }
     }
 }
示例#11
0
function _e($var)
{
    return Ajde_Component_String::escape($var);
}