Commit a780378d authored by Reynaldi Addriantama's avatar Reynaldi Addriantama

base global

parent 02ddb5ba
...@@ -56,9 +56,10 @@ class AdminController extends \Application\Master\GlobalActionController ...@@ -56,9 +56,10 @@ class AdminController extends \Application\Master\GlobalActionController
$uri = $this->getRequest()->getUri(); $uri = $this->getRequest()->getUri();
$baseurl = sprintf('//%s', $uri->getHost());
$port = $uri->getPort(); $port = $uri->getPort();
$baseurl = $baseurl.":".$port; $baseurl = $baseurl.":".$port;
// print_r($baseurl);die;
$actionName = $this->params('action'); $actionName = $this->params('action');
$this->headScript->appendScript(' var nopeg;'); $this->headScript->appendScript(' var nopeg;');
$this->headScript->appendScript(' var nim;'); $this->headScript->appendScript(' var nim;');
...@@ -91,8 +92,9 @@ class AdminController extends \Application\Master\GlobalActionController ...@@ -91,8 +92,9 @@ class AdminController extends \Application\Master\GlobalActionController
// $uri = $this->getRequest()->getUri(); // $uri = $this->getRequest()->getUri();
// $port = $uri->getPort(); // $baseurl = sprintf('//%s', $uri->getHost());
// $baseurl = $baseurl.":".$port; // $port = $uri->getPort();
// $baseurl = $baseurl.":".$port;
// $actionName = $this->params('action'); // $actionName = $this->params('action');
// $this->headScript->appendScript(' var nopeg;'); // $this->headScript->appendScript(' var nopeg;');
...@@ -124,6 +126,7 @@ class AdminController extends \Application\Master\GlobalActionController ...@@ -124,6 +126,7 @@ class AdminController extends \Application\Master\GlobalActionController
/* get url */ /* get url */
$uri = $this->getRequest()->getUri(); $uri = $this->getRequest()->getUri();
$baseurl = sprintf('//%s', $uri->getHost());
$port = $uri->getPort(); $port = $uri->getPort();
$baseurl = $baseurl.":".$port; $baseurl = $baseurl.":".$port;
// $getpath = explode("/",$uri->getPath()); // $getpath = explode("/",$uri->getPath());
...@@ -161,6 +164,7 @@ class AdminController extends \Application\Master\GlobalActionController ...@@ -161,6 +164,7 @@ class AdminController extends \Application\Master\GlobalActionController
/* get url */ /* get url */
$uri = $this->getRequest()->getUri(); $uri = $this->getRequest()->getUri();
$baseurl = sprintf('//%s', $uri->getHost());
$port = $uri->getPort(); $port = $uri->getPort();
$baseurl = $baseurl.":".$port; $baseurl = $baseurl.":".$port;
...@@ -192,6 +196,7 @@ class AdminController extends \Application\Master\GlobalActionController ...@@ -192,6 +196,7 @@ class AdminController extends \Application\Master\GlobalActionController
/* get url */ /* get url */
$uri = $this->getRequest()->getUri(); $uri = $this->getRequest()->getUri();
$baseurl = sprintf('//%s', $uri->getHost());
$port = $uri->getPort(); $port = $uri->getPort();
$baseurl = $baseurl.":".$port; $baseurl = $baseurl.":".$port;
...@@ -221,6 +226,7 @@ class AdminController extends \Application\Master\GlobalActionController ...@@ -221,6 +226,7 @@ class AdminController extends \Application\Master\GlobalActionController
/* get url */ /* get url */
$uri = $this->getRequest()->getUri(); $uri = $this->getRequest()->getUri();
$baseurl = sprintf('//%s', $uri->getHost());
$port = $uri->getPort(); $port = $uri->getPort();
$baseurl = $baseurl.":".$port; $baseurl = $baseurl.":".$port;
...@@ -249,6 +255,7 @@ class AdminController extends \Application\Master\GlobalActionController ...@@ -249,6 +255,7 @@ class AdminController extends \Application\Master\GlobalActionController
/* get url */ /* get url */
$uri = $this->getRequest()->getUri(); $uri = $this->getRequest()->getUri();
$baseurl = sprintf('//%s', $uri->getHost());
$port = $uri->getPort(); $port = $uri->getPort();
$baseurl = $baseurl.":".$port; $baseurl = $baseurl.":".$port;
$urlvar = base64_decode(urldecode($_GET['nim'])); $urlvar = base64_decode(urldecode($_GET['nim']));
...@@ -281,6 +288,7 @@ class AdminController extends \Application\Master\GlobalActionController ...@@ -281,6 +288,7 @@ class AdminController extends \Application\Master\GlobalActionController
/* get url */ /* get url */
$uri = $this->getRequest()->getUri(); $uri = $this->getRequest()->getUri();
$baseurl = sprintf('//%s', $uri->getHost());
$port = $uri->getPort(); $port = $uri->getPort();
$baseurl = $baseurl.":".$port; $baseurl = $baseurl.":".$port;
$urlvar = base64_decode(urldecode($_GET['nim'])); $urlvar = base64_decode(urldecode($_GET['nim']));
...@@ -316,6 +324,7 @@ class AdminController extends \Application\Master\GlobalActionController ...@@ -316,6 +324,7 @@ class AdminController extends \Application\Master\GlobalActionController
/* get url */ /* get url */
$uri = $this->getRequest()->getUri(); $uri = $this->getRequest()->getUri();
$baseurl = sprintf('//%s', $uri->getHost());
$port = $uri->getPort(); $port = $uri->getPort();
$baseurl = $baseurl.":".$port; $baseurl = $baseurl.":".$port;
...@@ -349,6 +358,7 @@ class AdminController extends \Application\Master\GlobalActionController ...@@ -349,6 +358,7 @@ class AdminController extends \Application\Master\GlobalActionController
/* get url */ /* get url */
$uri = $this->getRequest()->getUri(); $uri = $this->getRequest()->getUri();
$baseurl = sprintf('//%s', $uri->getHost());
$port = $uri->getPort(); $port = $uri->getPort();
$baseurl = $baseurl.":".$port; $baseurl = $baseurl.":".$port;
...@@ -392,6 +402,7 @@ class AdminController extends \Application\Master\GlobalActionController ...@@ -392,6 +402,7 @@ class AdminController extends \Application\Master\GlobalActionController
/* get url */ /* get url */
$uri = $this->getRequest()->getUri(); $uri = $this->getRequest()->getUri();
$baseurl = sprintf('//%s', $uri->getHost());
$port = $uri->getPort(); $port = $uri->getPort();
$baseurl = $baseurl.":".$port; $baseurl = $baseurl.":".$port;
...@@ -427,6 +438,7 @@ class AdminController extends \Application\Master\GlobalActionController ...@@ -427,6 +438,7 @@ class AdminController extends \Application\Master\GlobalActionController
/* get url */ /* get url */
$uri = $this->getRequest()->getUri(); $uri = $this->getRequest()->getUri();
$baseurl = sprintf('//%s', $uri->getHost());
$port = $uri->getPort(); $port = $uri->getPort();
$baseurl = $baseurl.":".$port; $baseurl = $baseurl.":".$port;
$this->headScript->appendScript(' var baseURL = "' . $baseurl . '"'); $this->headScript->appendScript(' var baseURL = "' . $baseurl . '"');
...@@ -456,6 +468,7 @@ class AdminController extends \Application\Master\GlobalActionController ...@@ -456,6 +468,7 @@ class AdminController extends \Application\Master\GlobalActionController
/* get url */ /* get url */
$uri = $this->getRequest()->getUri(); $uri = $this->getRequest()->getUri();
$baseurl = sprintf('//%s', $uri->getHost());
$port = $uri->getPort(); $port = $uri->getPort();
$baseurl = $baseurl.":".$port; $baseurl = $baseurl.":".$port;
...@@ -488,6 +501,7 @@ class AdminController extends \Application\Master\GlobalActionController ...@@ -488,6 +501,7 @@ class AdminController extends \Application\Master\GlobalActionController
/* get url */ /* get url */
$uri = $this->getRequest()->getUri(); $uri = $this->getRequest()->getUri();
$baseurl = sprintf('//%s', $uri->getHost());
$port = $uri->getPort(); $port = $uri->getPort();
$baseurl = $baseurl.":".$port; $baseurl = $baseurl.":".$port;
$this->headScript->appendScript(' var baseURL = "' . $baseurl . '"'); $this->headScript->appendScript(' var baseURL = "' . $baseurl . '"');
...@@ -522,6 +536,7 @@ class AdminController extends \Application\Master\GlobalActionController ...@@ -522,6 +536,7 @@ class AdminController extends \Application\Master\GlobalActionController
/* get url */ /* get url */
$uri = $this->getRequest()->getUri(); $uri = $this->getRequest()->getUri();
$baseurl = sprintf('//%s', $uri->getHost());
$port = $uri->getPort(); $port = $uri->getPort();
$baseurl = $baseurl.":".$port; $baseurl = $baseurl.":".$port;
...@@ -557,6 +572,7 @@ class AdminController extends \Application\Master\GlobalActionController ...@@ -557,6 +572,7 @@ class AdminController extends \Application\Master\GlobalActionController
/* get url */ /* get url */
$uri = $this->getRequest()->getUri(); $uri = $this->getRequest()->getUri();
$baseurl = sprintf('//%s', $uri->getHost());
$port = $uri->getPort(); $port = $uri->getPort();
$baseurl = $baseurl.":".$port; $baseurl = $baseurl.":".$port;
...@@ -593,6 +609,7 @@ class AdminController extends \Application\Master\GlobalActionController ...@@ -593,6 +609,7 @@ class AdminController extends \Application\Master\GlobalActionController
/* get url */ /* get url */
$uri = $this->getRequest()->getUri(); $uri = $this->getRequest()->getUri();
$baseurl = sprintf('//%s', $uri->getHost());
$port = $uri->getPort(); $port = $uri->getPort();
$baseurl = $baseurl.":".$port; $baseurl = $baseurl.":".$port;
...@@ -629,6 +646,7 @@ class AdminController extends \Application\Master\GlobalActionController ...@@ -629,6 +646,7 @@ class AdminController extends \Application\Master\GlobalActionController
/* get url */ /* get url */
$uri = $this->getRequest()->getUri(); $uri = $this->getRequest()->getUri();
$baseurl = sprintf('//%s', $uri->getHost());
$port = $uri->getPort(); $port = $uri->getPort();
$baseurl = $baseurl.":".$port; $baseurl = $baseurl.":".$port;
$role = $userSession->get('role'); $role = $userSession->get('role');
...@@ -671,6 +689,7 @@ class AdminController extends \Application\Master\GlobalActionController ...@@ -671,6 +689,7 @@ class AdminController extends \Application\Master\GlobalActionController
/* get url */ /* get url */
$uri = $this->getRequest()->getUri(); $uri = $this->getRequest()->getUri();
$baseurl = sprintf('//%s', $uri->getHost());
$port = $uri->getPort(); $port = $uri->getPort();
$baseurl = $baseurl.":".$port; $baseurl = $baseurl.":".$port;
...@@ -705,6 +724,7 @@ class AdminController extends \Application\Master\GlobalActionController ...@@ -705,6 +724,7 @@ class AdminController extends \Application\Master\GlobalActionController
/* get url */ /* get url */
$uri = $this->getRequest()->getUri(); $uri = $this->getRequest()->getUri();
$baseurl = sprintf('//%s', $uri->getHost());
$port = $uri->getPort(); $port = $uri->getPort();
$baseurl = $baseurl.":".$port; $baseurl = $baseurl.":".$port;
......
...@@ -392,6 +392,7 @@ class GlobalActionController extends \Khansia\Mvc\Controller { ...@@ -392,6 +392,7 @@ class GlobalActionController extends \Khansia\Mvc\Controller {
$uri = $this->getRequest()->getUri(); $uri = $this->getRequest()->getUri();
$baseurl = sprintf('//%s', $uri->getHost()); $baseurl = sprintf('//%s', $uri->getHost());
$port = $uri->getPort();
if(($controllerName != 'Application\Controller\ApiController' && $controllerName != 'Application\Controller\JsondataController')){ if(($controllerName != 'Application\Controller\ApiController' && $controllerName != 'Application\Controller\JsondataController')){
...@@ -400,7 +401,7 @@ class GlobalActionController extends \Khansia\Mvc\Controller { ...@@ -400,7 +401,7 @@ class GlobalActionController extends \Khansia\Mvc\Controller {
$userSess = $this->getSession(); $userSess = $this->getSession();
$this->headScript->appendScript(' var PHRASE = "' . self::PHRASE . '"'); $this->headScript->appendScript(' var PHRASE = "' . self::PHRASE . '"');
$this->headScript->appendScript(' var role = "' . $userSess->get('role') . '"'); $this->headScript->appendScript(' var role = "' . $userSess->get('role') . '"');
$this->headScript->appendScript(' var baseglobal = "' . $baseurl . '"'); $this->headScript->appendScript(' var baseglobal = "' . $baseurl . ':' . $port . '"');
$this->headScript->appendScript(' var actionControl = "' . $actionName . '"'); $this->headScript->appendScript(' var actionControl = "' . $actionName . '"');
$this->headScript->appendFile('/action-js/global-js/sha256.js'); $this->headScript->appendFile('/action-js/global-js/sha256.js');
$this->headScript->appendFile('/action-js/global-js/javaScriptGlobalCustom.js'); $this->headScript->appendFile('/action-js/global-js/javaScriptGlobalCustom.js');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment