web/lib/Zend/View/Helper/FormCheckbox.php
changeset 807 877f952ae2bd
parent 207 621fa6caec0c
child 1230 68c69c656a2c
--- a/web/lib/Zend/View/Helper/FormCheckbox.php	Thu Mar 21 17:31:31 2013 +0100
+++ b/web/lib/Zend/View/Helper/FormCheckbox.php	Thu Mar 21 19:50:53 2013 +0100
@@ -15,9 +15,9 @@
  * @category   Zend
  * @package    Zend_View
  * @subpackage Helper
- * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
+ * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
  * @license    http://framework.zend.com/license/new-bsd     New BSD License
- * @version    $Id: FormCheckbox.php 20096 2010-01-06 02:05:09Z bkarwin $
+ * @version    $Id: FormCheckbox.php 24825 2012-05-29 20:42:55Z rob $
  */
 
 
@@ -33,7 +33,7 @@
  * @category   Zend
  * @package    Zend_View
  * @subpackage Helper
- * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
+ * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
  * @license    http://framework.zend.com/license/new-bsd     New BSD License
  */
 class Zend_View_Helper_FormCheckbox extends Zend_View_Helper_FormElement
@@ -81,17 +81,18 @@
             $disabled = ' disabled="disabled"';
         }
 
-        // XHTML or HTML end tag?
-        $endTag = ' />';
-        if (($this->view instanceof Zend_View_Abstract) && !$this->view->doctype()->isXhtml()) {
-            $endTag= '>';
+        // build the element
+        $xhtml = '';
+        if ((!$disable && !strstr($name, '[]'))
+            && (empty($attribs['disableHidden']) || !$attribs['disableHidden'])
+        ) {
+            $xhtml = $this->_hidden($name, $checkedOptions['uncheckedValue']);
         }
 
-        // build the element
-        $xhtml = '';
-        if (!$disable && !strstr($name, '[]')) {
-            $xhtml = $this->_hidden($name, $checkedOptions['uncheckedValue']);
+        if (array_key_exists('disableHidden', $attribs)) {
+            unset($attribs['disableHidden']);
         }
+
         $xhtml .= '<input type="checkbox"'
                 . ' name="' . $this->view->escape($name) . '"'
                 . ' id="' . $this->view->escape($id) . '"'
@@ -99,7 +100,7 @@
                 . $checkedOptions['checkedString']
                 . $disabled
                 . $this->_htmlAttribs($attribs)
-                . $endTag;
+                . $this->getClosingBracket();
 
         return $xhtml;
     }