openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 7c2e27e0e156a8607b6bf53dbe452d03dcd4c0f9
parent bf0bec05b832dcf2a13024f8322ae023fd2352ab
Author: Jan Dankert <devnull@localhost>
Date:   Wed, 29 Nov 2017 22:46:40 +0100

Komponente "upload" umgestellt auf eine Klasse.

Diffstat:
themes/default/include/elements.ini.php | 17+++++++----------
themes/default/include/html/upload/Upload.class.php | 36++++++++++++++++++++++++++++++++++++
themes/default/include/html/upload/upload-begin.inc.php | 2--
3 files changed, 43 insertions(+), 12 deletions(-)

diff --git a/themes/default/include/elements.ini.php b/themes/default/include/elements.ini.php @@ -5,15 +5,12 @@ output = button = -checkbox = default:false,readonly:false,name:* +checkbox = column = width,style,class,colspan,rowspan,header:false,title,url,action,id,name date = dummy = focus = form = -frame = file,name,scrolling -frameset = rows,columns -frameset-page=menu group = hidden = name:*,default header = name:,views,back:false @@ -38,11 +35,11 @@ row = class,classes,id selectbox= list:*,name:*,default,onchange:,title:,class:,addempty:false,multiple:false,size:1,lang:false radiobox = list:*,name:*,default,onchange:,title:,class: selector = types:,name,id,folderid,param -set = var:*,value,key +set = table = class,width:100%,space:0px,padding:0px,widths,rowclasses,columnclasses text = title,class:text,var,text,key,textvar,raw,maxlength,value,suffix,prefix,accesskey,escape:true,type,cut:both tree = tree -upload = name:*,class:upload,maxlength,size:40,multiple:false -user = user -window = title,name,icon,widths,width:93%,rowclasses:oddCOMMAeven,columnclasses:1COMMA2COMMA3 -qrcode = value- \ No newline at end of file +upload = +user = +window = +qrcode = + \ No newline at end of file diff --git a/themes/default/include/html/upload/Upload.class.php b/themes/default/include/html/upload/Upload.class.php @@ -0,0 +1,35 @@ +<?php + +class UploadComponent extends Component +{ + public $size = 40; + public $name; + public $multiple = false; + public $class = 'upload'; + public $maxlength = ''; + + public function begin() + { + $class = $this->htmlvalue($this->class); + $name = $this->htmlvalue($this->name); + $size = $this->htmlvalue($this->size); + $request_id = REQUEST_ID; + + if ( !empty($this->maxlength)) + $maxlength = ' maxlength="'.$this->htmlvalue($this->maxlength).'"'; + else + $maxlength = ''; + + if ( $this->multiple ) + $multiple = ' multiple="multiple"'; + else + $multiple = ''; + + echo <<<HTML +<input size="$size" id="{$request_id}_{$name}" type="file"$maxlength name="$name" class="$class" $multiple /> +HTML; + } +} + + +?>+ \ No newline at end of file diff --git a/themes/default/include/html/upload/upload-begin.inc.php b/themes/default/include/html/upload/upload-begin.inc.php @@ -1 +0,0 @@ -<input size="<?php echo $attr_size ?>" id="<?php echo REQUEST_ID ?>_<?php echo $attr_name ?>" type="file" <?php if (isset($attr_maxlength))echo ' maxlength="'.$attr_maxlength.'"' ?> name="<?php echo $attr_name ?>" class="<?php echo $attr_class ?>" <?php echo ($attr_multiple=='true'?' multiple':'') ?> />- \ No newline at end of file