Source for file ScButtons.php
Documentation is available at ScButtons.php
* An open source SmartClient library for PHP
* @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 Buttons Helper
* @param mixed $data If string, it must be the title of the button. If array, them we will loop through it
* @param string $click Onclick function
* @param string $buttonType Type of the button
* @param array $options Additional options
public function create( $data , $click = '' , $buttonType = '' , $options = '' )
$validButtons = array( 'Button' , 'IButton' , 'ImgButton' );
// Check if it is an array
// Get button type off the array
$buttonType = $data['buttonType'];
unset ( $data['buttonType'] );
// Add vars to the new button
$newButton['title'] = $data;
// Check if options is array and do the loop
foreach ( $options as $name => $value )
$newButton[$name] = $value;
// Check if buttonType is valid
if ( !in_array( $buttonType , $validButtons ) )
// Set buttonType to a default value
// Remove vars that shouldn't be quoted
<script type="text/javascript">
isc.'. $buttonType . '.create(
|