mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-08-18 12:30:02 +02:00
cleanup:
- fragments of concisus api - file inclusion accidents added: support for js reload by filectime
This commit is contained in:
@@ -14,11 +14,6 @@
|
|||||||
\**************************************************************************/
|
\**************************************************************************/
|
||||||
/* $Id$ */
|
/* $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
|
* eGroupWare javascript support class
|
||||||
@@ -76,8 +71,6 @@
|
|||||||
function javascript()
|
function javascript()
|
||||||
{
|
{
|
||||||
//$this->t =& CreateObject('phpgwapi.Template', ExecMethod('phpgwapi.phpgw.common.get_tpl_dir','phpgwapi'));
|
//$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()
|
function get_script_links()
|
||||||
{
|
{
|
||||||
$links = '';
|
$links = "<!--JS Imports from phpGW javascript class -->\n";
|
||||||
$links_api = '';
|
|
||||||
$links_api_main = '';
|
|
||||||
|
|
||||||
if(!empty($this->files) && is_array($this->files))
|
if(!empty($this->files) && is_array($this->files))
|
||||||
{
|
{
|
||||||
$links_head = "<!--JS Imports from phpGW javascript class -->\n";
|
|
||||||
foreach($this->files as $app => $packages)
|
foreach($this->files as $app => $packages)
|
||||||
{
|
{
|
||||||
if(!empty($packages) && is_array($packages))
|
if(!empty($packages) && is_array($packages))
|
||||||
@@ -148,58 +137,18 @@
|
|||||||
{
|
{
|
||||||
foreach($files as $file => $browser)
|
foreach($files as $file => $browser)
|
||||||
{
|
{
|
||||||
if ($app === 'phpgwapi' && $pkg === 'jsapi' && $file === 'jsapi')
|
$pkg = $pkg == '.' ? '' : $pkg.'/';
|
||||||
{
|
$browser = $browser == '.' ? '' : $browser.'/';
|
||||||
$links_api_main = '<script type="text/javascript" src="'
|
|
||||||
. $GLOBALS['egw_info']['server']['webserver_url']
|
|
||||||
. "/$app/js/$pkg/$browser/$file" . '.js">'
|
|
||||||
. "</script>\n";
|
|
||||||
|
|
||||||
if ($browser !== '.')
|
$f = "/$app/js/$pkg$browser$file" . '.js?'. filectime(EGW_INCLUDE_ROOT."/$app/js/$pkg$browser$file.js") .'">';
|
||||||
{
|
$links .= '<script type="text/javascript" src="'. $GLOBALS['egw_info']['server']['webserver_url']. $f. "</script>\n";
|
||||||
$links_api_main = '<script type="text/javascript" src="'
|
|
||||||
. $GLOBALS['egw_info']['server']['webserver_url']
|
|
||||||
. "/$app/js/$pkg/$file" . '.js">'
|
|
||||||
. "</script>\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if ($app === 'phpgwapi')
|
|
||||||
{
|
|
||||||
if ($browser !== '.')
|
|
||||||
{
|
|
||||||
$links_api .= '<script type="text/javascript" src="'
|
|
||||||
. $GLOBALS['egw_info']['server']['webserver_url']
|
|
||||||
. "/$app/js/$pkg/$file" . '.js">'
|
|
||||||
. "</script>\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
$links_api .= '<script type="text/javascript" src="'
|
|
||||||
. $GLOBALS['egw_info']['server']['webserver_url']
|
|
||||||
. "/$app/js/$pkg/$browser/$file" . '.js">'
|
|
||||||
. "</script>\n";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if ($browser !== '.')
|
|
||||||
{
|
|
||||||
$links .= '<script type="text/javascript" src="'
|
|
||||||
. $GLOBALS['egw_info']['server']['webserver_url']
|
|
||||||
. "/$app/js/$pkg/$file" . '.js">'
|
|
||||||
. "</script>\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
$links .= '<script type="text/javascript" src="'
|
|
||||||
. $GLOBALS['egw_info']['server']['webserver_url']
|
|
||||||
. "/$app/js/$pkg/$browser/$file" . '.js">'
|
|
||||||
. "</script>\n";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $links_head.$links_api_main.$links_api.$links;
|
return $links;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -280,30 +229,26 @@
|
|||||||
|
|
||||||
if ($this->included_files[$app][$package][$file]) return true;
|
if ($this->included_files[$app][$package][$file]) return true;
|
||||||
|
|
||||||
if(is_readable(EGW_INCLUDE_ROOT .SEP .$app .SEP .'js' .SEP . $package . SEP . $browser_folder . SEP . $file . '.js'))
|
if(is_readable(EGW_INCLUDE_ROOT ."/$app/js/$package/$browser_folder/$file.js"))
|
||||||
{
|
{
|
||||||
$this->files[$app][$package][$file] = $browser_folder;
|
$this->files[$app][$package][$file] = $browser_folder;
|
||||||
$this->included_files[$app][$package][$file] = $browser_folder;
|
|
||||||
return True;
|
return True;
|
||||||
}
|
}
|
||||||
elseif (is_readable(EGW_INCLUDE_ROOT .SEP .$app .SEP .'js' .SEP . $package . SEP . $file . '.js'))
|
elseif (is_readable(EGW_INCLUDE_ROOT. "/$app/js/$package/$file.js"))
|
||||||
{
|
{
|
||||||
$this->files[$app][$package][$file] = '.';
|
$this->files[$app][$package][$file] = '.';
|
||||||
$this->included_files[$app][$package][$file] = '.';
|
|
||||||
return True;
|
return True;
|
||||||
}
|
}
|
||||||
elseif($app != 'phpgwapi')
|
elseif($app != 'phpgwapi')
|
||||||
{
|
{
|
||||||
if(is_readable(EGW_INCLUDE_ROOT .SEP .'phpgwapi' .SEP .'js' .SEP . $package .SEP . $browser_folder . SEP . $file . '.js'))
|
if(is_readable(EGW_INCLUDE_ROOT ."/phpgwapi/js/$package/$browser_folder/$file.js"))
|
||||||
{
|
{
|
||||||
$this->files['phpgwapi'][$package][$file] = $browser_folder;
|
$this->files['phpgwapi'][$package][$file] = $browser_folder;
|
||||||
$this->included_files['phpgwapi'][$package][$file] = $browser_folder;
|
|
||||||
return True;
|
return True;
|
||||||
}
|
}
|
||||||
elseif(is_readable(EGW_INCLUDE_ROOT .SEP .'phpgwapi' .SEP .'js' .SEP . $package .SEP . $file . '.js'))
|
elseif(is_readable(EGW_INCLUDE_ROOT ."phpgwapi/js/$package/$file.js"))
|
||||||
{
|
{
|
||||||
$this->files['phpgwapi'][$package][$file] = '.';
|
$this->files['phpgwapi'][$package][$file] = '.';
|
||||||
$this->included_files['phpgwapi'][$package][$file] = '.';
|
|
||||||
return True;
|
return True;
|
||||||
}
|
}
|
||||||
return False;
|
return False;
|
||||||
|
Reference in New Issue
Block a user