openrat-cms

# OpenRat Content Management System
git clone http://git.code.weiherhei.de/openrat-cms.git
Log | Files | Refs

Radio.class.php (1198B)


      1 <?php
      2 
      3 namespace template_engine\components;
      4 
      5 class RadioComponent extends FieldComponent
      6 {
      7 
      8 	// Bisher nicht in Benutzung.
      9 	public $readonly = false;
     10 
     11 	public $value;
     12 
     13 	public $prefix='';
     14 
     15 	public $suffix='';
     16 
     17 	public $class = '';
     18 
     19 	public $onchange;
     20 
     21 	public $children;
     22 
     23 	public $checked;
     24 
     25 	public $label = '';
     26 
     27 	public function begin()
     28 	{
     29         if   ( $this->label )
     30             echo '<label class="or-form-row"><span class="or-form-label"></span><span class="or-form-input">';
     31 
     32 
     33 		echo '<input ';
     34         echo ' class="'.$this->htmlvalue($this->class).'"';
     35 		echo ' type="radio"';
     36 		echo ' id="<?php echo REQUEST_ID ?>_'.$this->htmlvalue($this->name).'_'.$this->htmlvalue($this->value).'"';
     37 
     38 		echo parent::outputNameAttribute();
     39 		//"<? php if ( $attr_readonly ) echo ' disabled="disabled"' ? >
     40 		echo ' value="'.$this->htmlvalue($this->value).'"';
     41 
     42         echo '<?php if(';
     43 		echo ''.''.$this->value($this->value).'==@$'.$this->varname($this->name);
     44 		if(isset($this->checked))
     45 			echo '||'.$this->value($this->checked);
     46 		echo ")echo ' checked=\"checked\"'".' ?>';
     47 
     48 		echo ' />';
     49 
     50         if   ( $this->label )
     51             echo '&nbsp;'.lang($this->label).' </span></label>';
     52 
     53     }
     54 }
     55 
     56 ?>