From 7f79a72d9859e3e509f1c384c5eb393f33839f74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cornelius=20Wei=C3=9F?= Date: Tue, 10 Oct 2006 13:39:07 +0000 Subject: [PATCH] cleanup: - fragments of concisus api - file inclusion accidents added: support for js reload by filectime --- phpgwapi/inc/class.javascript.inc.php | 77 ++++----------------------- 1 file changed, 11 insertions(+), 66 deletions(-) diff --git a/phpgwapi/inc/class.javascript.inc.php b/phpgwapi/inc/class.javascript.inc.php index 11576ad8c8..f4a71198ca 100644 --- a/phpgwapi/inc/class.javascript.inc.php +++ b/phpgwapi/inc/class.javascript.inc.php @@ -14,11 +14,6 @@ \**************************************************************************/ /* $Id$ */ - // On production sites, remove this lines below! \\ - if (file_exists(EGW_INCLUDE_ROOT . '/uncompressed_thyapi')) define(EGW_UNCOMPRESSED_THYAPI, true); - else define(EGW_UNCOMPRESSED_THYAPI, false); - - $GLOBALS['concisus_system']['javascript'] = array(); /** * eGroupWare javascript support class @@ -76,8 +71,6 @@ function javascript() { //$this->t =& CreateObject('phpgwapi.Template', ExecMethod('phpgwapi.phpgw.common.get_tpl_dir','phpgwapi')); - //not currently used, but will be soon - I hope :) - $this->included_files =& $GLOBALS['concisus_system']['javascript']['included_files']; } @@ -131,13 +124,9 @@ */ function get_script_links() { - $links = ''; - $links_api = ''; - $links_api_main = ''; - + $links = "\n"; if(!empty($this->files) && is_array($this->files)) { - $links_head = "\n"; foreach($this->files as $app => $packages) { if(!empty($packages) && is_array($packages)) @@ -148,58 +137,18 @@ { foreach($files as $file => $browser) { - if ($app === 'phpgwapi' && $pkg === 'jsapi' && $file === 'jsapi') - { - $links_api_main = '\n"; - - if ($browser !== '.') - { - $links_api_main = '\n"; - } - } - else if ($app === 'phpgwapi') - { - if ($browser !== '.') - { - $links_api .= '\n"; - } - - $links_api .= '\n"; - } - else - { - if ($browser !== '.') - { - $links .= '\n"; - } - - $links .= '\n"; - } + $pkg = $pkg == '.' ? '' : $pkg.'/'; + $browser = $browser == '.' ? '' : $browser.'/'; + + $f = "/$app/js/$pkg$browser$file" . '.js?'. filectime(EGW_INCLUDE_ROOT."/$app/js/$pkg$browser$file.js") .'">'; + $links .= '