Slider.php 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  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-2015 Zend Technologies USA Inc. (http://www.zend.com)
  19. * @license http://framework.zend.com/license/new-bsd New BSD License
  20. */
  21. /** Zend_Dojo_Form_Element_Dijit */
  22. require_once 'Zend/Dojo/Form/Element/Dijit.php';
  23. /**
  24. * Abstract Slider dijit
  25. *
  26. * @uses Zend_Dojo_Form_Element_Dijit
  27. * @package Zend_Dojo
  28. * @subpackage Form_Element
  29. * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
  30. * @license http://framework.zend.com/license/new-bsd New BSD License
  31. * @version $Id$
  32. */
  33. abstract class Zend_Dojo_Form_Element_Slider extends Zend_Dojo_Form_Element_Dijit
  34. {
  35. /**
  36. * Set clickSelect flag
  37. *
  38. * @param bool $clickSelect
  39. * @return Zend_Dojo_Form_Element_TextBox
  40. */
  41. public function setClickSelect($flag)
  42. {
  43. $this->setDijitParam('clickSelect', (bool) $flag);
  44. return $this;
  45. }
  46. /**
  47. * Retrieve clickSelect flag
  48. *
  49. * @return bool
  50. */
  51. public function getClickSelect()
  52. {
  53. if (!$this->hasDijitParam('clickSelect')) {
  54. return false;
  55. }
  56. return $this->getDijitParam('clickSelect');
  57. }
  58. /**
  59. * Set intermediateChanges flag
  60. *
  61. * @param bool $intermediateChanges
  62. * @return Zend_Dojo_Form_Element_TextBox
  63. */
  64. public function setIntermediateChanges($flag)
  65. {
  66. $this->setDijitParam('intermediateChanges', (bool) $flag);
  67. return $this;
  68. }
  69. /**
  70. * Retrieve intermediateChanges flag
  71. *
  72. * @return bool
  73. */
  74. public function getIntermediateChanges()
  75. {
  76. if (!$this->hasDijitParam('intermediateChanges')) {
  77. return false;
  78. }
  79. return $this->getDijitParam('intermediateChanges');
  80. }
  81. /**
  82. * Set showButtons flag
  83. *
  84. * @param bool $showButtons
  85. * @return Zend_Dojo_Form_Element_TextBox
  86. */
  87. public function setShowButtons($flag)
  88. {
  89. $this->setDijitParam('showButtons', (bool) $flag);
  90. return $this;
  91. }
  92. /**
  93. * Retrieve showButtons flag
  94. *
  95. * @return bool
  96. */
  97. public function getShowButtons()
  98. {
  99. if (!$this->hasDijitParam('showButtons')) {
  100. return false;
  101. }
  102. return $this->getDijitParam('showButtons');
  103. }
  104. /**
  105. * Set discreteValues
  106. *
  107. * @param int $value
  108. * @return Zend_Dojo_Form_Element_TextBox
  109. */
  110. public function setDiscreteValues($value)
  111. {
  112. $this->setDijitParam('discreteValues', (int) $value);
  113. return $this;
  114. }
  115. /**
  116. * Retrieve discreteValues
  117. *
  118. * @return int|null
  119. */
  120. public function getDiscreteValues()
  121. {
  122. return $this->getDijitParam('discreteValues');
  123. }
  124. /**
  125. * Set maximum
  126. *
  127. * @param int $value
  128. * @return Zend_Dojo_Form_Element_TextBox
  129. */
  130. public function setMaximum($value)
  131. {
  132. $this->setDijitParam('maximum', (int) $value);
  133. return $this;
  134. }
  135. /**
  136. * Retrieve maximum
  137. *
  138. * @return int|null
  139. */
  140. public function getMaximum()
  141. {
  142. return $this->getDijitParam('maximum');
  143. }
  144. /**
  145. * Set minimum
  146. *
  147. * @param int $value
  148. * @return Zend_Dojo_Form_Element_TextBox
  149. */
  150. public function setMinimum($value)
  151. {
  152. $this->setDijitParam('minimum', (int) $value);
  153. return $this;
  154. }
  155. /**
  156. * Retrieve minimum
  157. *
  158. * @return int|null
  159. */
  160. public function getMinimum()
  161. {
  162. return $this->getDijitParam('minimum');
  163. }
  164. /**
  165. * Set pageIncrement
  166. *
  167. * @param int $value
  168. * @return Zend_Dojo_Form_Element_TextBox
  169. */
  170. public function setPageIncrement($value)
  171. {
  172. $this->setDijitParam('pageIncrement', (int) $value);
  173. return $this;
  174. }
  175. /**
  176. * Retrieve pageIncrement
  177. *
  178. * @return int|null
  179. */
  180. public function getPageIncrement()
  181. {
  182. return $this->getDijitParam('pageIncrement');
  183. }
  184. }