From 280fb62b012321facdf49b02121c70c57bc9a8fa Mon Sep 17 00:00:00 2001 From: Paolo Date: Fri, 13 Apr 2018 13:41:25 +0200 Subject: [PATCH] Changed the global JS object FHC_JS_DATA_STORAGE_OBJECT, called path and called method have been separeted into two different properties --- application/views/templates/FHC-Header.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/application/views/templates/FHC-Header.php b/application/views/templates/FHC-Header.php index ad948930a..52ed50dbd 100755 --- a/application/views/templates/FHC-Header.php +++ b/application/views/templates/FHC-Header.php @@ -4,7 +4,8 @@ if (! defined('BASEPATH')) exit('No direct script access allowed'); // Retrives the URL path of the called controller + controller method // NOTE: placed here because it doesn't work inside functions -$calledFrom = $this->router->directory.$this->router->class.'/'.$this->router->method; +$calledPath = $this->router->directory.$this->router->class; +$calledMethod = $this->router->method; // By default set the parameters to null $title = isset($title) ? $title : null; @@ -62,7 +63,7 @@ function _generateCSSsInclude($CSSs) /** * Generates global JS-Object to pass parms to other javascripts */ -function _generateJSDataStorageObject($calledFrom) +function _generateJSDataStorageObject($calledPath, $calledMethod) { $toPrint = "\n"; $toPrint .= ''; @@ -167,7 +169,7 @@ function _generateAddonsJSsInclude($calledFrom) // Generates the global object to pass useful parms to the other javascripts // NOTE: must be called before any other JS include - _generateJSDataStorageObject($calledFrom); + _generateJSDataStorageObject($calledPath, $calledMethod); // JQuery V3 if ($jquery === true) _generateJSsInclude('vendor/components/jquery/jquery.min.js'); @@ -202,7 +204,7 @@ function _generateAddonsJSsInclude($calledFrom) } // Load addon hooks JS - if ($addons === true) _generateAddonsJSsInclude($calledFrom); + if ($addons === true) _generateAddonsJSsInclude($calledPath.'/'.$calledMethod); // Eventually required JS _generateJSsInclude($customJSs);