mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 22:10:45 +02:00
[ticket/10799] Removing global variable from includejs
Removing global $phpbb_root_path from includejs implementation PHPBB3-10799
This commit is contained in:
@@ -496,14 +496,19 @@ class phpbb_template
|
||||
*
|
||||
* @param string $file file name
|
||||
* @param bool $locate True if file needs to be located
|
||||
* @param bool $relative True if path is relative to phpBB root directory. Ignored if $locate == true
|
||||
*/
|
||||
public function _js_include($file, $locate = false)
|
||||
public function _js_include($file, $locate = false, $relative = false)
|
||||
{
|
||||
// Locate file
|
||||
if ($locate)
|
||||
{
|
||||
$file = $this->locator->get_first_file_location(array($file), true, true);
|
||||
}
|
||||
else if ($relative)
|
||||
{
|
||||
$file = $this->phpbb_root_path . $file;
|
||||
}
|
||||
|
||||
$file .= (strpos($file, '?') === false) ? '?' : '&';
|
||||
$file .= 'assets_version=' . $this->config['assets_version'];
|
||||
|
Reference in New Issue
Block a user