check if application of template has a app.js file

--> load it
This commit is contained in:
Ralf Becker 2009-07-03 08:38:25 +00:00
parent 28618da875
commit dcce79d92a
2 changed files with 11 additions and 0 deletions

View File

@ -499,6 +499,11 @@ class editor
{
$new_content['onclick'] .= html::style('@import url('.$GLOBALS['egw_info']['server']['webserver_url'].'/'.$app.'/templates/default/app.css);');
}
// check if application of template has a app.js file --> load it
if (file_exists(EGW_SERVER_ROOT.'/'.$app.'/js/app.js'))
{
$GLOBALS['egw']->js->validate_file('.','app',$app,false);
}
$editor->data[$editor->rows]['A']['obj'] = &$this->etemplate;
$vals = $content['vals'];
$olds = $content['olds'];

View File

@ -211,6 +211,12 @@ class etemplate extends boetemplate
{
$GLOBALS['egw']->translation->add_app('etemplate'); // some extensions have own texts
}
// 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'))
{
$GLOBALS['egw']->js->validate_file('.','app',$app,false);
}
// use different form-names to allows multiple eTemplates in one page, eg. addressbook-view
self::$name_form = 'eTemplate';
if (in_array(self::$name_form,self::$name_forms))