web/Zend/Dojo/Form/Element/HorizontalSlider.php
changeset 0 4eba9c11703f
equal deleted inserted replaced
-1:000000000000 0:4eba9c11703f
       
     1 <?php
       
     2 /**
       
     3  * Zend Framework
       
     4  *
       
     5  * LICENSE
       
     6  *
       
     7  * This source file is subject to the new BSD license that is bundled
       
     8  * with this package in the file LICENSE.txt.
       
     9  * It is also available through the world-wide-web at this URL:
       
    10  * http://framework.zend.com/license/new-bsd
       
    11  * If you did not receive a copy of the license and are unable to
       
    12  * obtain it through the world-wide-web, please send an email
       
    13  * to license@zend.com so we can send you a copy immediately.
       
    14  *
       
    15  * @category   Zend
       
    16  * @package    Zend_Dojo
       
    17  * @subpackage Form_Element
       
    18  * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
       
    19  * @license    http://framework.zend.com/license/new-bsd     New BSD License
       
    20  */
       
    21 
       
    22 /** Zend_Dojo_Form_Element_Slider */
       
    23 require_once 'Zend/Dojo/Form/Element/Slider.php';
       
    24 
       
    25 /**
       
    26  * HorizontalSlider dijit
       
    27  *
       
    28  * @uses       Zend_Dojo_Form_Element_Slider
       
    29  * @package    Zend_Dojo
       
    30  * @subpackage Form_Element
       
    31  * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
       
    32  * @license    http://framework.zend.com/license/new-bsd     New BSD License
       
    33  * @version    $Id: HorizontalSlider.php 20096 2010-01-06 02:05:09Z bkarwin $
       
    34  */
       
    35 class Zend_Dojo_Form_Element_HorizontalSlider extends Zend_Dojo_Form_Element_Slider
       
    36 {
       
    37     /**
       
    38      * Use HorizontalSlider dijit view helper
       
    39      * @var string
       
    40      */
       
    41     public $helper = 'HorizontalSlider';
       
    42 
       
    43     /**
       
    44      * Get top decoration data
       
    45      *
       
    46      * @return array
       
    47      */
       
    48     public function getTopDecoration()
       
    49     {
       
    50         if ($this->hasDijitParam('topDecoration')) {
       
    51             return $this->getDijitParam('topDecoration');
       
    52         }
       
    53         return array();
       
    54     }
       
    55 
       
    56     /**
       
    57      * Set dijit to use with top decoration
       
    58      *
       
    59      * @param mixed $dijit
       
    60      * @return Zend_Dojo_Form_Element_HorizontalSlider
       
    61      */
       
    62     public function setTopDecorationDijit($dijit)
       
    63     {
       
    64         $decoration = $this->getTopDecoration();
       
    65         $decoration['dijit'] = (string) $dijit;
       
    66         $this->setDijitParam('topDecoration', $decoration);
       
    67         return $this;
       
    68     }
       
    69 
       
    70     /**
       
    71      * Set container to use with top decoration
       
    72      *
       
    73      * @param mixed $container
       
    74      * @return Zend_Dojo_Form_Element_HorizontalSlider
       
    75      */
       
    76     public function setTopDecorationContainer($container)
       
    77     {
       
    78         $decoration = $this->getTopDecoration();
       
    79         $decoration['container'] = (string) $container;
       
    80         $this->setDijitParam('topDecoration', $decoration);
       
    81         return $this;
       
    82     }
       
    83 
       
    84     /**
       
    85      * Set labels to use with top decoration
       
    86      *
       
    87      * @param  array $labels
       
    88      * @return Zend_Dojo_Form_Element_HorizontalSlider
       
    89      */
       
    90     public function setTopDecorationLabels(array $labels)
       
    91     {
       
    92         $decoration = $this->getTopDecoration();
       
    93         $decoration['labels'] = array_values($labels);
       
    94         $this->setDijitParam('topDecoration', $decoration);
       
    95         return $this;
       
    96     }
       
    97 
       
    98     /**
       
    99      * Set params to use with top decoration
       
   100      *
       
   101      * @param  array $params
       
   102      * @return Zend_Dojo_Form_Element_HorizontalSlider
       
   103      */
       
   104     public function setTopDecorationParams(array $params)
       
   105     {
       
   106         $decoration = $this->getTopDecoration();
       
   107         $decoration['params'] = $params;
       
   108         $this->setDijitParam('topDecoration', $decoration);
       
   109         return $this;
       
   110     }
       
   111 
       
   112     /**
       
   113      * Set attribs to use with top decoration
       
   114      *
       
   115      * @param  array $attribs
       
   116      * @return Zend_Dojo_Form_Element_HorizontalSlider
       
   117      */
       
   118     public function setTopDecorationAttribs(array $attribs)
       
   119     {
       
   120         $decoration = $this->getTopDecoration();
       
   121         $decoration['attribs'] = $attribs;
       
   122         $this->setDijitParam('topDecoration', $decoration);
       
   123         return $this;
       
   124     }
       
   125 
       
   126     /**
       
   127      * Get bottom decoration data
       
   128      *
       
   129      * @return array
       
   130      */
       
   131     public function getBottomDecoration()
       
   132     {
       
   133         if ($this->hasDijitParam('bottomDecoration')) {
       
   134             return $this->getDijitParam('bottomDecoration');
       
   135         }
       
   136         return array();
       
   137     }
       
   138 
       
   139     /**
       
   140      * Set dijit to use with bottom decoration
       
   141      *
       
   142      * @param mixed $dijit
       
   143      * @return Zend_Dojo_Form_Element_HorizontalSlider
       
   144      */
       
   145     public function setBottomDecorationDijit($dijit)
       
   146     {
       
   147         $decoration = $this->getBottomDecoration();
       
   148         $decoration['dijit'] = (string) $dijit;
       
   149         $this->setDijitParam('bottomDecoration', $decoration);
       
   150         return $this;
       
   151     }
       
   152 
       
   153     /**
       
   154      * Set container to use with bottom decoration
       
   155      *
       
   156      * @param mixed $container
       
   157      * @return Zend_Dojo_Form_Element_HorizontalSlider
       
   158      */
       
   159     public function setBottomDecorationContainer($container)
       
   160     {
       
   161         $decoration = $this->getBottomDecoration();
       
   162         $decoration['container'] = (string) $container;
       
   163         $this->setDijitParam('bottomDecoration', $decoration);
       
   164         return $this;
       
   165     }
       
   166 
       
   167     /**
       
   168      * Set labels to use with bottom decoration
       
   169      *
       
   170      * @param  array $labels
       
   171      * @return Zend_Dojo_Form_Element_HorizontalSlider
       
   172      */
       
   173     public function setBottomDecorationLabels(array $labels)
       
   174     {
       
   175         $decoration = $this->getBottomDecoration();
       
   176         $decoration['labels'] = array_values($labels);
       
   177         $this->setDijitParam('bottomDecoration', $decoration);
       
   178         return $this;
       
   179     }
       
   180 
       
   181     /**
       
   182      * Set params to use with bottom decoration
       
   183      *
       
   184      * @param  array $params
       
   185      * @return Zend_Dojo_Form_Element_HorizontalSlider
       
   186      */
       
   187     public function setBottomDecorationParams(array $params)
       
   188     {
       
   189         $decoration = $this->getBottomDecoration();
       
   190         $decoration['params'] = $params;
       
   191         $this->setDijitParam('bottomDecoration', $decoration);
       
   192         return $this;
       
   193     }
       
   194 
       
   195     /**
       
   196      * Set attribs to use with bottom decoration
       
   197      *
       
   198      * @param  array $attribs
       
   199      * @return Zend_Dojo_Form_Element_HorizontalSlider
       
   200      */
       
   201     public function setBottomDecorationAttribs(array $attribs)
       
   202     {
       
   203         $decoration = $this->getBottomDecoration();
       
   204         $decoration['attribs'] = $attribs;
       
   205         $this->setDijitParam('bottomDecoration', $decoration);
       
   206         return $this;
       
   207     }
       
   208 }