openrat-cms

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

ButtonComponent.class.php (1236B)


      1 <?php
      2 
      3 namespace template_engine\components\html\component_button;
      4 
      5 use cms\base\Startup;
      6 use template_engine\components\html\Component;
      7 use template_engine\element\Element;
      8 
      9 /* @DEPRECATED */
     10 class ButtonComponent extends Component
     11 {
     12 
     13 	public $type = 'submit';
     14 	public $class = 'ok';
     15 	public $src;
     16 	public $text = 'button_ok';
     17 	public $value = 'ok';
     18 	
     19 	private $tmp_src;
     20 
     21 	public function createElement()
     22 	{
     23 		return new Element(null);
     24 	}
     25 
     26 	protected function unused_begin()
     27 	{
     28 		echo <<<'HTML'
     29 		<div class="invisible">
     30 HTML;
     31 		
     32 		if ($this->type == 'ok')
     33 			$this->type = 'submit';
     34 		
     35 		if (! empty($this->src))
     36 		{
     37 			$this->type = 'image';
     38 			$this->tmp_src = $image_dir . 'icon_' . $this->src . Startup::IMG_ICON_EXT;
     39 		}
     40 		else
     41 		{
     42 			$this->tmp_src = '';
     43 		}
     44 		
     45 		if (! empty($this->type))
     46 		{
     47 			?>
     48 <input type="<?php echo $this->type ?>" <?php if(isset($this->src)) { ?>
     49 	src="<?php $this->tmp_src ?>" <?php } ?>
     50 	name="<?php echo $this->value ?>" class="%class%"
     51 	title="<?php echo \cms\base\Language::lang($this->text.'_DESC') ?>"
     52 	value="&nbsp;&nbsp;&nbsp;&nbsp;<?php echo langHtml($this->text) ?>&nbsp;&nbsp;&nbsp;&nbsp;" /><?php unset($this->src); ?>
     53 	<?php
     54 		
     55 }
     56 	}
     57 
     58 	protected function end()
     59 	{
     60 		echo "</div>";
     61 	}
     62 }
     63 
     64 ?>