• Main Page
  • Related Pages
  • Namespaces
  • Data Structures
  • Files
  • Examples
  • File List

E:/E/GEAMP/www/openbiz/openbiz/others/Zend/View/Helper/FormImage.php

00001 <?php
00027 require_once 'Zend/View/Helper/FormElement.php';
00028 
00029 
00039 class Zend_View_Helper_FormImage extends Zend_View_Helper_FormElement
00040 {
00056     public function formImage($name, $value = null, $attribs = null)
00057     {
00058         $info = $this->_getInfo($name, $value, $attribs);
00059         extract($info); // name, value, attribs, options, listsep, disable
00060 
00061         // Determine if we should use the value or the src attribute
00062         if (isset($attribs['src'])) {
00063             $src = ' src="' . $this->view->escape($attribs['src']) . '"';
00064             unset($attribs['src']);
00065         } else {
00066             $src = ' src="' . $this->view->escape($value) . '"';
00067             unset($value);
00068         }
00069 
00070         // Do we have a value?
00071         if (isset($value) && !empty($value)) {
00072             $value = ' value="' . $this->view->escape($value) . '"';
00073         } else {
00074             $value = '';
00075         }
00076 
00077         // Disabled?
00078         $disabled = '';
00079         if ($disable) {
00080             $disabled = ' disabled="disabled"';
00081         }
00082 
00083         // XHTML or HTML end tag?
00084         $endTag = ' />';
00085         if (($this->view instanceof Zend_View_Abstract) && !$this->view->doctype()->isXhtml()) {
00086             $endTag= '>';
00087         }
00088 
00089         // build the element
00090         $xhtml = '<input type="image"'
00091                 . ' name="' . $this->view->escape($name) . '"'
00092                 . ' id="' . $this->view->escape($id) . '"'
00093                 . $src
00094                 . $value
00095                 . $disabled
00096                 . $this->_htmlAttribs($attribs)
00097                 . $endTag;
00098 
00099         return $xhtml;
00100     }
00101 }

Generated on Thu Apr 19 2012 17:01:18 for openbiz by  doxygen 1.7.2