예제 #1
0
 /**
  * Generates a 'text' element.
  *
  * @access public
  *
  * @param string|array $name    If a string, the element name.  If an
  *                              array, all other parameters are ignored, and the array elements
  *                              are used in place of added parameters.
  *
  * @param mixed        $value   The element value.
  *
  * @param array        $attribs Attributes for the element tag.
  *
  * @return string The element XHTML.
  */
 public function DataTableText($name, $label, $value = null, $attribs = null, $order = null)
 {
     $info = $this->_getInfo($name, $value, $attribs);
     extract($info);
     // name, value, attribs, options, disable
     $xhtml = '<th' . ' id="' . $this->view->escape($id) . '"' . $this->_htmlAttribs($attribs) . ' name="' . $this->view->escape($name) . '" >' . $this->view->escape($label) . '</th>';
     $create = new ZfComplement_DataTable_Create();
     $create->setContent($xhtml)->setDesabled($disable)->setId($this->view->escape($id))->setValue($this->view->escape($value))->setOptions($options);
     return $create;
 }
예제 #2
0
 /**
  * Generates a 'text' element.
  *
  * @access public
  *
  * @param string|array $name    If a string, the element name.  If an
  *                              array, all other parameters are ignored, and the array elements
  *                              are used in place of added parameters.
  *
  * @param mixed        $value   The element value.
  *
  * @param array        $attribs Attributes for the element tag.
  *
  * @return string The element XHTML.
  */
 public function DataTableButton($name, $label, $value = null, $attribs = null, $order = null)
 {
     $base = $this->view->baseUrl();
     $this->jquery = $this->view->JQuery();
     $this->jquery->enable();
     $this->jquery->addJavascriptFile($base . self::BOOTBOX);
     $info = $this->_getInfo($name, $value, $attribs);
     extract($info);
     // name, value, attribs, options, disable
     $this->_id = $id;
     $this->_attribs = $attribs;
     $modal = '';
     if (isset($options['modal'])) {
         $modal = ' modal="' . $options['modal'] . '"';
     }
     $url = isset($options["url"]) && is_array($options["url"]) ? $options["url"] : array();
     $url = $this->view->url($url);
     $xhtml = '<th' . ' id="' . $this->view->escape($id) . '"' . ' url="' . $url . '"' . $modal . ' name="' . $this->view->escape($name) . '" >' . $label . '</th>';
     $create = new ZfComplement_DataTable_Create();
     $create->setContent($xhtml)->setDesabled($disable)->setId($this->view->escape($id))->setValue($this->view->escape($value))->setButtom(true)->setOptions($options)->setJscript($this->createJscript($options));
     return $create;
 }