fixed default parameters and type of etemplate::exec to match documentation

This commit is contained in:
Ralf Becker 2013-02-04 12:56:08 +00:00
parent ec2d395a68
commit e2d3c2ee29

View File

@ -7,7 +7,7 @@
* @subpackage api * @subpackage api
* @link http://www.egroupware.org * @link http://www.egroupware.org
* @author Ralf Becker <RalfBecker@outdoor-training.de> * @author Ralf Becker <RalfBecker@outdoor-training.de>
* @copyright 2002-11 by RalfBecker@outdoor-training.de * @copyright 2002-13 by RalfBecker@outdoor-training.de
* @version $Id$ * @version $Id$
*/ */
@ -115,9 +115,8 @@ class etemplate_new extends etemplate_widget_template
* @param array $changes change made in the last call if looping, only used internaly by process_exec * @param array $changes change made in the last call if looping, only used internaly by process_exec
* @return string html for $output_mode == 1, else nothing * @return string html for $output_mode == 1, else nothing
*/ */
function exec($method,$content,$sel_options='',$readonlys='',$preserv='',$output_mode=0,$ignore_validation='',$changes='') function exec($method,array $content,array $sel_options=null,array $readonlys=null,array $preserv=null,$output_mode=0,$ignore_validation='',array $changes=null)
{ {
// Include the etemplate2 javascript code // Include the etemplate2 javascript code
egw_framework::validate_file('.', 'etemplate2', 'etemplate'); egw_framework::validate_file('.', 'etemplate2', 'etemplate');
@ -168,13 +167,6 @@ class etemplate_new extends etemplate_widget_template
$theme = 'redmond'; $theme = 'redmond';
egw_framework::includeCSS("/phpgwapi/js/jquery/jquery-ui/$theme/jquery-ui-1.8.21.custom.css"); egw_framework::includeCSS("/phpgwapi/js/jquery/jquery-ui/$theme/jquery-ui-1.8.21.custom.css");
// check if application of template has a app.js file --> load it
list($app) = explode('.',$this->name);
if (file_exists(EGW_SERVER_ROOT.'/'.$app.'/js/app.js'))
{
egw_framework::validate_file('.','app',$app,false);
}
common::egw_header(); common::egw_header();
if ($output_mode != 2) if ($output_mode != 2)
{ {
@ -267,9 +259,6 @@ class etemplate_new extends etemplate_widget_template
{ {
throw new egw_exception_wrong_parameter('Can NOT read template '.array2string(self::$request->template)); throw new egw_exception_wrong_parameter('Can NOT read template '.array2string(self::$request->template));
} }
translation::add_app($GLOBALS['egw_info']['flags']['currentapp']);
$validated = array(); $validated = array();
$expand = array( $expand = array(
'cont' => &self::$request->content, 'cont' => &self::$request->content,