Source for file ScTabs.php
Documentation is available at ScTabs.php
* An open source SmartClient View Helper for Zend Framework
* @author Fernando Marcelo Morgenstern <fernando@consultorpc.com>
* @copyright Copyright (c) 2009, ConsultorPC
* @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html
* @link http://smartclientphp.com/
* Smart Client Tabs Helper
* @uses viewHelper SmartClient
* @var Zend_View_Interface
* @param $view Zend_View_Interface
public function setView( Zend_View_Interface $view )
* @param mixed $data If string, it must be the title of the tab. If array, them we will loop on it
* @param string $pane Content of the tab
* @param array $options Additional options
public function addTab( $data , $pane = '' , $options = '' )
// Check if it is an array
// Add name and title to the new field
$newTab['title'] = $data;
// Check if options is array and do the loop
foreach ( $options as $name => $value )
$this->_tabs[] = $newTab;
* @param array $data Array containing multiple tabs
foreach ( $data as $row )
* Return the current tabs array
* @param mixed $data If string, it must be the element ID. If array, them we will loop through it
* @param integer $width Width of the tab set
* @param integer $height Height of the tab set
* @param array $options Additional options
public function create( $data , $width = '' , $height = '' , $options = '' )
// Check if it is an array
// Add vars to the new button
$newTabSet['ID'] = $data;
$newTabSet['width'] = $width;
$newTabSet['height'] = $height;
$newTabSet['tabs'] = $this->_tabs;
// Check if options is array and do the loop
foreach ( $options as $name => $value )
$newTabSet[$name] = $value;
$dataEncoded = Zend_Json::encode( $newTabSet );
// Remove vars that shouldn't be quoted
<script type="text/javascript">
|