From 560c52f30250c72d52e1e327598712772e5be8ce Mon Sep 17 00:00:00 2001 From: Jan Date: Sat, 17 Oct 2015 19:22:42 +0200 Subject: [PATCH] Do not open PlayerCard, if Module is inactive --- includes/pages/game/AbstractGamePage.class.php | 1 + scripts/game/base.js | 2 +- styles/templates/game/main.header.tpl | 1 + styles/templates/game/page.phalanx.default.tpl | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/includes/pages/game/AbstractGamePage.class.php b/includes/pages/game/AbstractGamePage.class.php index 7c4aa4903..ce6003945 100644 --- a/includes/pages/game/AbstractGamePage.class.php +++ b/includes/pages/game/AbstractGamePage.class.php @@ -201,6 +201,7 @@ protected function getPageData() 'debug' => $config->debug, 'VERSION' => $config->VERSION, 'date' => explode("|", date('Y\|n\|j\|G\|i\|s\|Z', TIMESTAMP)), + 'isPlayerCardActive' => isModuleAvailable(MODULE_PLAYERCARD), 'REV' => substr($config->VERSION, -4), 'Offset' => $dateTimeUser->getOffset() - $dateTimeServer->getOffset(), 'queryString' => $this->getQueryString(), diff --git a/scripts/game/base.js b/scripts/game/base.js index 49e8d04be..8ff0e26d5 100644 --- a/scripts/game/base.js +++ b/scripts/game/base.js @@ -167,7 +167,7 @@ var Dialog = { }, Playercard: function(ID) { - return Dialog.open('game.php?page=playerCard&id='+ID, 650, 600); + return isPlayerCardActive && Dialog.open('game.php?page=playerCard&id='+ID, 650, 600); }, Buddy: function(ID) { diff --git a/styles/templates/game/main.header.tpl b/styles/templates/game/main.header.tpl index 183c8945d..c3496a34e 100644 --- a/styles/templates/game/main.header.tpl +++ b/styles/templates/game/main.header.tpl @@ -41,6 +41,7 @@ var months = {$LNG.months|json|default:'[]'} ; var tdformat = "{$LNG.js_tdformat}"; var queryString = "{$queryString|escape:'javascript'}"; + var isPlayerCardActive = "{$isPlayerCardActive|json}"; setInterval(function() { serverTime.setSeconds(serverTime.getSeconds()+1); diff --git a/styles/templates/game/page.phalanx.default.tpl b/styles/templates/game/page.phalanx.default.tpl index 705dad399..50048fb45 100644 --- a/styles/templates/game/page.phalanx.default.tpl +++ b/styles/templates/game/page.phalanx.default.tpl @@ -1,4 +1,4 @@ -{block name="title" prepend}{$LNG.lm_playercard}{/block} +{block name="title" prepend}{$LNG.gl_phalanx}{/block} {block name="content"}