openrat-cms

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

FieldComponent.class.php (620B)


      1 <?php
      2 
      3 namespace template_engine\components;
      4 
      5 
      6 abstract class FieldComponent extends HtmlComponent
      7 {
      8 
      9     public $prefix;
     10     public $name;
     11     public $readonly = false;
     12 
     13 
     14     protected function outputNameAttribute() {
     15 
     16         $out = ' name="';
     17 
     18         if(isset($this->readonly))
     19             $out .= '<?php if ('.$this->value($this->prefix).') '."echo ".$this->value($this->prefix).".'_' ?>";
     20         $out .= $this->htmlvalue($this->name);
     21 
     22         if(isset($this->readonly))
     23             $out .= '<?php if ('.$this->value($this->readonly).') '."echo '_disabled' ?>";
     24         $out .= '"';
     25 
     26         return $out;
     27     }
     28 }