PageRenderTime 43ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/src/application/libraries/Zend/Dojo/View/Helper/SubmitButton.php

https://bitbucket.org/masnug/grc276-blog-laravel
PHP | 67 lines | 22 code | 3 blank | 42 comment | 5 complexity | 1357aefcfeab1dc4a281a30b0e62572a MD5 | raw file
  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 View
  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. * @version $Id: SubmitButton.php 23775 2011-03-01 17:25:24Z ralph $
  21. */
  22. /** Zend_Dojo_View_Helper_Button */
  23. require_once 'Zend/Dojo/View/Helper/Button.php';
  24. /**
  25. * Dojo Button dijit tied to submit input
  26. *
  27. * @uses Zend_Dojo_View_Helper_Button
  28. * @package Zend_Dojo
  29. * @subpackage View
  30. * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
  31. * @license http://framework.zend.com/license/new-bsd New BSD License
  32. */
  33. class Zend_Dojo_View_Helper_SubmitButton extends Zend_Dojo_View_Helper_Button
  34. {
  35. /**
  36. * @var string Submit input
  37. */
  38. protected $_elementType = 'submit';
  39. /**
  40. * dijit.form.Button tied to submit input
  41. *
  42. * @param string $id
  43. * @param string $value
  44. * @param array $params Parameters to use for dijit creation
  45. * @param array $attribs HTML attributes
  46. * @return string
  47. */
  48. public function submitButton($id, $value = null, array $params = array(), array $attribs = array())
  49. {
  50. if (!array_key_exists('label', $params)) {
  51. $params['label'] = $value;
  52. }
  53. if (empty($params['label']) && !empty($params['content'])) {
  54. $params['label'] = $params['content'];
  55. $value = $params['content'];
  56. }
  57. if (empty($params['label']) && !empty($attribs['content'])) {
  58. $params['label'] = $attribs['content'];
  59. $value = $attribs['content'];
  60. unset($attribs['content']);
  61. }
  62. return $this->_createFormElement($id, $value, $params, $attribs);
  63. }
  64. }