/zf/library/Zend/Dojo/Form/Element/VerticalSlider.php
PHP | 208 lines | 90 code | 14 blank | 104 comment | 2 complexity | dc417d0c68fe957be6686fb5b9d28c50 MD5 | raw file
Possible License(s): MIT, BSD-3-Clause, Apache-2.0, LGPL-2.1, LGPL-3.0, BSD-2-Clause
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-2011 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 */ 23require_once 'Zend/Dojo/Form/Element/Slider.php'; 24 25/** 26 * VerticalSlider dijit 27 * 28 * @uses Zend_Dojo_Form_Element_Slider 29 * @package Zend_Dojo 30 * @subpackage Form_Element 31 * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) 32 * @license http://framework.zend.com/license/new-bsd New BSD License 33 * @version $Id: VerticalSlider.php 23775 2011-03-01 17:25:24Z ralph $ 34 */ 35class Zend_Dojo_Form_Element_VerticalSlider extends Zend_Dojo_Form_Element_Slider 36{ 37 /** 38 * Use VerticalSlider dijit view helper 39 * @var string 40 */ 41 public $helper = 'VerticalSlider'; 42 43 /** 44 * Get left decoration data 45 * 46 * @return array 47 */ 48 public function getLeftDecoration() 49 { 50 if ($this->hasDijitParam('leftDecoration')) { 51 return $this->getDijitParam('leftDecoration'); 52 } 53 return array(); 54 } 55 56 /** 57 * Set dijit to use with left decoration 58 * 59 * @param mixed $dijit 60 * @return Zend_Dojo_Form_Element_HorizontalSlider 61 */ 62 public function setLeftDecorationDijit($dijit) 63 { 64 $decoration = $this->getLeftDecoration(); 65 $decoration['dijit'] = (string) $dijit; 66 $this->setDijitParam('leftDecoration', $decoration); 67 return $this; 68 } 69 70 /** 71 * Set container to use with left decoration 72 * 73 * @param mixed $container 74 * @return Zend_Dojo_Form_Element_HorizontalSlider 75 */ 76 public function setLeftDecorationContainer($container) 77 { 78 $decoration = $this->getLeftDecoration(); 79 $decoration['container'] = (string) $container; 80 $this->setDijitParam('leftDecoration', $decoration); 81 return $this; 82 } 83 84 /** 85 * Set labels to use with left decoration 86 * 87 * @param array $labels 88 * @return Zend_Dojo_Form_Element_HorizontalSlider 89 */ 90 public function setLeftDecorationLabels(array $labels) 91 { 92 $decoration = $this->getLeftDecoration(); 93 $decoration['labels'] = array_values($labels); 94 $this->setDijitParam('leftDecoration', $decoration); 95 return $this; 96 } 97 98 /** 99 * Set params to use with left decoration 100 * 101 * @param array $params 102 * @return Zend_Dojo_Form_Element_HorizontalSlider 103 */ 104 public function setLeftDecorationParams(array $params) 105 { 106 $decoration = $this->getLeftDecoration(); 107 $decoration['params'] = $params; 108 $this->setDijitParam('leftDecoration', $decoration); 109 return $this; 110 } 111 112 /** 113 * Set attribs to use with left decoration 114 * 115 * @param array $attribs 116 * @return Zend_Dojo_Form_Element_HorizontalSlider 117 */ 118 public function setLeftDecorationAttribs(array $attribs) 119 { 120 $decoration = $this->getLeftDecoration(); 121 $decoration['attribs'] = $attribs; 122 $this->setDijitParam('leftDecoration', $decoration); 123 return $this; 124 } 125 126 /** 127 * Get right decoration data 128 * 129 * @return array 130 */ 131 public function getRightDecoration() 132 { 133 if ($this->hasDijitParam('rightDecoration')) { 134 return $this->getDijitParam('rightDecoration'); 135 } 136 return array(); 137 } 138 139 /** 140 * Set dijit to use with right decoration 141 * 142 * @param mixed $dijit 143 * @return Zend_Dojo_Form_Element_HorizontalSlider 144 */ 145 public function setRightDecorationDijit($dijit) 146 { 147 $decoration = $this->getRightDecoration(); 148 $decoration['dijit'] = (string) $dijit; 149 $this->setDijitParam('rightDecoration', $decoration); 150 return $this; 151 } 152 153 /** 154 * Set container to use with right decoration 155 * 156 * @param mixed $container 157 * @return Zend_Dojo_Form_Element_HorizontalSlider 158 */ 159 public function setRightDecorationContainer($container) 160 { 161 $decoration = $this->getRightDecoration(); 162 $decoration['container'] = (string) $container; 163 $this->setDijitParam('rightDecoration', $decoration); 164 return $this; 165 } 166 167 /** 168 * Set labels to use with right decoration 169 * 170 * @param array $labels 171 * @return Zend_Dojo_Form_Element_HorizontalSlider 172 */ 173 public function setRightDecorationLabels(array $labels) 174 { 175 $decoration = $this->getRightDecoration(); 176 $decoration['labels'] = array_values($labels); 177 $this->setDijitParam('rightDecoration', $decoration); 178 return $this; 179 } 180 181 /** 182 * Set params to use with right decoration 183 * 184 * @param array $params 185 * @return Zend_Dojo_Form_Element_HorizontalSlider 186 */ 187 public function setRightDecorationParams(array $params) 188 { 189 $decoration = $this->getRightDecoration(); 190 $decoration['params'] = $params; 191 $this->setDijitParam('rightDecoration', $decoration); 192 return $this; 193 } 194 195 /** 196 * Set attribs to use with right decoration 197 * 198 * @param array $attribs 199 * @return Zend_Dojo_Form_Element_HorizontalSlider 200 */ 201 public function setRightDecorationAttribs(array $attribs) 202 { 203 $decoration = $this->getRightDecoration(); 204 $decoration['attribs'] = $attribs; 205 $this->setDijitParam('rightDecoration', $decoration); 206 return $this; 207 } 208}