diff --git a/etemplate/inc/class.editor.inc.php b/etemplate/inc/class.editor.inc.php index 412100f65c..769f2f15f6 100644 --- a/etemplate/inc/class.editor.inc.php +++ b/etemplate/inc/class.editor.inc.php @@ -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']; diff --git a/etemplate/inc/class.etemplate.inc.php b/etemplate/inc/class.etemplate.inc.php index 40779d1447..b1100ea815 100644 --- a/etemplate/inc/class.etemplate.inc.php +++ b/etemplate/inc/class.etemplate.inc.php @@ -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))