openrat-cms

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

commit 73c0b0926484e69fd70000ba9ab7e6e04f104eaf
parent 6bea187f3f18ce2afc518ad09427fcb8b9c3d9ee
Author: Jan Dankert <devnull@localhost>
Date:   Sun,  3 Dec 2017 02:04:18 +0100

Komponente "radio" umgestellt auf eine Klasse.

Diffstat:
themes/default/include/html/image/image-begin.inc.php | 57---------------------------------------------------------
themes/default/include/html/newline/Newline.class.php | 13+++++++++++++
themes/default/include/html/newline/newline-begin.inc.php | 2--
themes/default/include/html/page/Window.class.php | 9+++++++++
themes/default/include/html/radio/Radio.class.php | 45+++++++++++++++++++++++++++++++++++++++++++++
themes/default/include/html/radio/radio-begin.inc.php | 34----------------------------------
themes/default/include/html/radiobox/Radiobox.class.php | 4++--
themes/default/include/html/selectbox/Selectbox.class.php | 2+-
8 files changed, 70 insertions(+), 96 deletions(-)

diff --git a/themes/default/include/html/image/image-begin.inc.php b/themes/default/include/html/image/image-begin.inc.php @@ -1,56 +0,0 @@ -<?php - -/* #IF-ATTR elementtype# */ - $attr_tmp_image_file = $image_dir.'icon_el_'.$attr_elementtype.IMG_ICON_EXT; - $attr_size = '16x16'; -/* #END-IF# */ - -/* #IF-ATTR type# */ - $attr_tmp_image_file = $image_dir.'icon_'.$attr_type.IMG_ICON_EXT; - $attr_size = '16x16'; -/* #END-IF# */ - -/* #IF-ATTR icon# */ - if ( is_file($image_dir.'icon/'.$attr_icon.IMG_ICON_EXT) ) - $attr_tmp_image_file = $image_dir.'icon/'.$attr_icon.IMG_ICON_EXT; - elseif ( is_file($image_dir.'icon/'.$attr_icon.IMG_EXT) ) - $attr_tmp_image_file = $image_dir.'icon/'.$attr_icon.IMG_EXT; - elseif ( is_file($image_dir.'icon_'.$attr_icon.IMG_ICON_EXT) ) - $attr_tmp_image_file = $image_dir.'icon_'.$attr_icon.IMG_ICON_EXT; - elseif ( is_file($image_dir.'icon_'.$attr_icon.IMG_EXT) ) - $attr_tmp_image_file = $image_dir.'icon_'.$attr_icon.IMG_EXT; - else - $attr_tmp_image_file = 'about:blank'; - - $attr_size = '16x16'; -/* #END-IF# */ - -/* #IF-ATTR notice# */ - $attr_tmp_image_file = $image_dir.'notice_'.$attr_notice.IMG_ICON_EXT; - $attr_size = '16x16'; -/* #END-IF# */ - -/* #IF-ATTR tree# */ - $attr_tmp_image_file = $image_dir.'tree_'.$attr_tree.IMG_EXT; - $attr_size = '18x18'; -/* #END-IF# */ - -/* #IF-ATTR url# */ - $attr_tmp_image_file = $attr_url; -/* #END-IF# */ - -/* #IF-ATTR fileext# */ - $attr_tmp_image_file = $image_dir.$attr_fileext; -/* #END-IF# */ - -/* #IF-ATTR file# */ - $attr_tmp_image_file = $image_dir.$attr_file.IMG_ICON_EXT; -/* #END-IF# */ - -/* #IF-ATTR title# */ - $attr_tmp_title = $attr_title; -/* #ELSE# */ - $attr_tmp_title = basename($attr_tmp_image_file); -/* #END-IF# */ - -?><img alt="<?php echo $attr_tmp_title; if (isset($attr_size)) { echo ' ('; list($attr_tmp_width,$attr_tmp_height)=explode('x',$attr_size);echo $attr_tmp_width.'x'.$attr_tmp_height; echo')';} ?>" src="<?php echo $attr_tmp_image_file ?>" border="0"<?php if(isset($attr_align)) echo ' align="'.$attr_align.'"' ?><?php if (isset($attr_size)) { list($attr_tmp_width,$attr_tmp_height)=explode('x',$attr_size);echo ' width="'.$attr_tmp_width.'" height="'.$attr_tmp_height.'"';} ?> />- \ No newline at end of file diff --git a/themes/default/include/html/newline/Newline.class.php b/themes/default/include/html/newline/Newline.class.php @@ -0,0 +1,12 @@ +<?php + +class NewlineComponent extends Component +{ + + public function begin() + { + echo '<br/>'; + } +} + +?>+ \ No newline at end of file diff --git a/themes/default/include/html/newline/newline-begin.inc.php b/themes/default/include/html/newline/newline-begin.inc.php @@ -1 +0,0 @@ -<br/>- \ No newline at end of file diff --git a/themes/default/include/html/page/Window.class.php b/themes/default/include/html/page/Window.class.php @@ -0,0 +1,8 @@ +<?php + +class WindowComponent extends Component +{ +} + + +?>+ \ No newline at end of file diff --git a/themes/default/include/html/radio/Radio.class.php b/themes/default/include/html/radio/Radio.class.php @@ -0,0 +1,44 @@ +<?php + +class RadioComponent extends Component +{ + + // Bisher nicht in Benutzung. + public $readonly = false; + + public $name; + + public $value; + + public $prefix=''; + + public $suffix=''; + + public $class; + + public $onchange; + + public $children; + + public $checked; + + public function begin() + { + echo '<input '; + echo ' class="radio"'; + echo ' type="radio"'; + echo ' id="<?php echo REQUEST_ID ?>_'.$this->htmlvalue($this->name).'_'.$this->htmlvalue($this->value).'"'; + echo ' name="'.$this->htmlvalue($this->prefix).$this->htmlvalue($this->name).'"'; + //"<? php if ( $attr_readonly ) echo ' disabled="disabled"' ? > + echo ' value="'.$this->htmlvalue($this->value).'"'; + echo '<?php if('; + echo ''.''.$this->value($this->value).'==@$'.$this->varname($this->name); + if(isset($this->checked)) + echo '||'.$this->value($this->checked); + echo ")echo ' checked=\"checked\"'".' ?>'; + + echo ' />'; + } +} + +?>+ \ No newline at end of file diff --git a/themes/default/include/html/radio/radio-begin.inc.php b/themes/default/include/html/radio/radio-begin.inc.php @@ -1,33 +0,0 @@ -<?php - if ($this->isEditable() && !$this->isEditMode()) $attr_readonly=true; - - if ( isset($$attr_name) ) - $attr_tmp_default = $$attr_name; - elseif ( isset($attr_default) ) - $attr_tmp_default = $attr_default; - else - $attr_tmp_default = ''; - - ?><input onclick="" class="radio" type="radio" id="<?php echo REQUEST_ID ?>_<?php echo $attr_name.'_'.$attr_value ?>" name="<?php echo $attr_prefix.$attr_name ?>"<?php if ( $attr_readonly ) echo ' disabled="disabled"' ?> value="<?php echo $attr_value ?>"<?php if($attr_value==$attr_tmp_default||@$attr_checked) echo ' checked="checked"' ?> /> - -<?php /* #IF-ATTR deactivated-children# */ ?> -<script name="Javascript" type="text/javascript"> -<!-- -<?php foreach(explode(',',$attr_children) as $attr_tmp_child) { if (empty($attr_tmp_child)) continue; ?> -var e = document.getElementById('<?php echo REQUEST_ID ?>_<?php echo $attr_tmp_child ?>'); -e.disabled = true; -<?php } ?> - -function <?php echo $attr_name.'_'.$attr_value ?>_valueChanged(element) -{ - for(i=0; i<document.forms[0].elements.length; i++) - if (document.forms[0].elements[i].type == 'text') - document.forms[0].elements[i].disabled = true; - <?php foreach(explode(',',$attr_children) as $attr_tmp_child) { if (empty($attr_tmp_child)) continue; ?> - var e = document.getElementById('<?php echo REQUEST_ID ?>_<?php echo $attr_tmp_child ?>'); - e.disabled = false; - <?php } ?> -} -//--> -</script> -<?php /* #END-IF# */ ?>- \ No newline at end of file diff --git a/themes/default/include/html/radiobox/Radiobox.class.php b/themes/default/include/html/radiobox/Radiobox.class.php @@ -21,8 +21,8 @@ class RadioboxComponent extends Component if ( isset($this->default)) $value = $this->value($this->default); - else - $value = '$'.$this->varname($this->name); + else + $value = '$'.$this->varname($this->name); echo '<?php component_radio_box('.$this->value($this->name).',$'.$this->varname($this->list).','.$value.') ?>'; } diff --git a/themes/default/include/html/selectbox/Selectbox.class.php b/themes/default/include/html/selectbox/Selectbox.class.php @@ -47,7 +47,6 @@ class SelectboxComponent extends Component public function begin() { - $this->include( 'selectbox/component-select-box.php'); echo '<div class="inputholder">'; echo '<select '; @@ -70,6 +69,7 @@ class SelectboxComponent extends Component else $value = '$'.$this->varname($this->name); + $this->include( 'selectbox/component-select-box.php'); echo '<?php component_select_option_list($'.$this->varname($this->list).','.$value.','.intval(boolval($this->addempty)).','.intval(boolval($this->lang)).') ?>'; // Keine Einträge in der Liste, wir benötigen ein verstecktes Feld.