energine
[ class tree: energine ] [ index: energine ] [ all elements ]

Source for file Button.class.php

Documentation is available at Button.class.php

  1. <?php
  2. /**
  3.  * Содержит класс Button
  4.  *
  5.  * @package energine
  6.  * @subpackage share
  7.  * @author dr.Pavka
  8.  * @copyright Energine 2006
  9.  * @version $Id$
  10.  */
  11.  
  12.  
  13. /**
  14.  * Кнопка панели инструментов
  15.  *
  16.  * @package energine
  17.  * @subpackage share
  18.  * @author dr.Pavka
  19.  */
  20. class Button extends Control {
  21.  
  22.     /**
  23.      * Конструктор
  24.      *
  25.      * @return type 
  26.      * @access public
  27.      */
  28.     public function __construct($id$action false$image false$title false$tooltip false{
  29.         parent::__construct($id);
  30.         $this->type = 'button';
  31.         if ($action)  $this->setAttribute('action',  $action);
  32.         if ($image)   $this->setAttribute('image',   $image);
  33.         if ($title)   $this->setAttribute('title',   $title);
  34.         if ($tooltip$this->setAttribute('tooltip'$tooltip);
  35.     }
  36.  
  37.     /**
  38.      * Устанавливает название кнопки
  39.      *
  40.      * @return void 
  41.      * @access public
  42.      */
  43.     public function setTitle($title{
  44.         $this->setAttribute('title'$title);
  45.     }
  46.  
  47.     /**
  48.      * Возвращает название кнопки
  49.      *
  50.      * @return string 
  51.      * @access public
  52.      */
  53.     public function getTitle({
  54.         return $this->getAttribute('title');
  55.     }
  56.  
  57.     /**
  58.      * Возвращает имя действия
  59.      *
  60.      * @return string 
  61.      * @access public
  62.      */
  63.     public function getAction({
  64.         return $this->getAttribute('action');
  65.     }
  66.  
  67.     /**
  68.      * Возвращает путь к изображению
  69.      *
  70.      * @return string 
  71.      * @access public
  72.      */
  73.     public function getImage({
  74.         return $this->getAttribute('image');
  75.     }
  76.  
  77.     /**
  78.      * Устанавливает всплывающую подсказку
  79.      *
  80.      * @param string 
  81.      * @return string 
  82.      * @access public
  83.      */
  84.     public function setTooltip($tooltip{
  85.          $this->setAttribute('tooltip'$tooltip);
  86.     }
  87.  
  88.     /**
  89.      * Возвращает всплывающую подсказку
  90.      *
  91.      * @return string 
  92.      * @access public
  93.      */
  94.     public function getTooltip({
  95.         return $this->getAttribute('tooltip');
  96.     }
  97. }
В создании документации нам помог: phpDocumentor