Button.php #1

  • //
  • guest/
  • perforce_software/
  • chronicle/
  • main/
  • library/
  • P4Cms/
  • View/
  • Helper/
  • Button.php
  • View
  • Commits
  • Open Download .zip Download (1 KB)
<?php
/**
 * Derivative of dojo button view helper. Allows to use SingleClickButton dijit if
 * 'singleClick' attribute is set to true.
 *
 * @copyright   2011 Perforce Software. All rights reserved.
 * @license     Please see LICENSE.txt in top-level folder of this distribution.
 * @version     <release>/<patch>
 */
class P4Cms_View_Helper_Button extends Zend_Dojo_View_Helper_Button
{
    /**
     * Overrides parent method to use p4cms.ui.SlowButton dijit instead of
     * standard form button dijit if 'preventMultiClick' attribute is set
     * to true.
     *
     * @param  string   $id         Zend provides no documentation.
     * @param  string   $value      Zend provides no documentation.
     * @param  array    $params     Parameters to use for dijit creation.
     * @param  array    $attribs    HTML attributes.
     * @return string               Zend provides no documentation.
     */
    public function button($id, $value = null, array $params = array(), array $attribs = array())
    {
        // if singleClick attrib is set to true use SingleClickButton dijit
        if (isset($attribs['singleClick']) && $attribs['singleClick']) {
            $this->_dijit  = 'p4cms.ui.SingleClickButton';
            $this->_module = 'p4cms.ui.SingleClickButton';
            unset($attribs['singleClick']);
        }

        return parent::button($id, $value, $params, $attribs);
    }
}
# Change User Description Committed
#1 16170 perforce_software Move Chronicle files to follow new path scheme for branching.
//guest/perforce_software/chronicle/library/P4Cms/View/Helper/Button.php
#1 8972 Matt Attaway Initial add of the Chronicle source code