From e6988247360fa98b85915a38803d018dd353df00 Mon Sep 17 00:00:00 2001 From: M.Gergo Date: Sun, 16 Dec 2018 16:35:17 +0100 Subject: Rev: 4412 --- mayor-orig/www/include/base/base.php | 16 +++++++++++----- mayor-orig/www/include/base/config.php | 2 +- 2 files changed, 12 insertions(+), 6 deletions(-) (limited to 'mayor-orig/www/include/base') diff --git a/mayor-orig/www/include/base/base.php b/mayor-orig/www/include/base/base.php index dd620a41..378b31fd 100644 --- a/mayor-orig/www/include/base/base.php +++ b/mayor-orig/www/include/base/base.php @@ -126,13 +126,20 @@ function page($page, $sub, $f, $lang, $skin, $policy = _DEFAULT_POLICY) { global $_JSON; if (html_alert($_SESSION['alert'])) { // A figyelmeztető üzenet letilthatja az oldal további megjelenítését. - if ($sub != '') { $load = "$sub/$f"; } else { $load = $f; } + // --TEST $API_DICTIONARY['api']['naplo']['orarend']['orarend'] = true; + if ($skin=='api') { + $_JSON['api']['version'] = '1.0'; + if (isset($API_DICTIONARY[$skin][$page][$sub][$f])===false) { // --TODO API_DICTIONARY + return false; + } + } + if (file_exists("policy/$policy/$page/$load.php")) { if (file_exists("lang/$lang/module-$page/base.php")) { require_once("lang/$lang/module-$page/base.php"); @@ -146,20 +153,19 @@ function page($page, $sub, $f, $lang, $skin, $policy = _DEFAULT_POLICY) { } if (file_exists("skin/$skin/module-$page/html/base.phtml")) { require_once("skin/$skin/module-$page/html/base.phtml"); - } elseif (file_exists("skin/"._DEFAULT_SKIN."/module-$page/html/base.phtml")) { + } elseif ($skin!=='api' && file_exists("skin/"._DEFAULT_SKIN."/module-$page/html/base.phtml")) { // api esetén nem töltjük be a default skin phtml-t require_once("skin/"._DEFAULT_SKIN."/module-$page/html/base.phtml"); } if (file_exists("skin/$skin/module-$page/html/$load.phtml")) { require_once("skin/$skin/module-$page/html/$load.phtml"); - } elseif (file_exists("skin/"._DEFAULT_SKIN."/module-$page/html/$load.phtml")) { + } elseif ($skin!=='api' && file_exists("skin/"._DEFAULT_SKIN."/module-$page/html/$load.phtml")) { // api esetén nem töltjük be a default skin phtml-t require_once("skin/"._DEFAULT_SKIN."/module-$page/html/$load.phtml"); } + $_JSON['api']['debug'] = serialize($page.$load); include("policy/$policy/$page/$load.php"); - //szamlal($policy,$page); } elseif (file_exists("static/$lang/$page/$load.html")) { include("static/$lang/$page/$load.html"); - //szamlal($policy,$page); } else { //??? ha már kiírtuk a hibaüzeneteket, újabbat nem írhatunk ki sajnos :( html_alert(array('page:page_missing:'."[$page]:[$sub]:[$f]")); --> rights.php } diff --git a/mayor-orig/www/include/base/config.php b/mayor-orig/www/include/base/config.php index 4a234fcf..28f711cb 100644 --- a/mayor-orig/www/include/base/config.php +++ b/mayor-orig/www/include/base/config.php @@ -31,7 +31,7 @@ if (!defined('_SECURECOOKIE')) define('_SECURECOOKIE', true); define('_BASE_URL',( ($_SERVER['HTTPS']=='on')?"https://".$_SERVER['SERVER_NAME']:"http://".$_SERVER['SERVER_NAME'] )); /* classic, blue, ajax + rpc, + cron kiegészítés */ -$SKINS = @array_unique(array_merge($SKINS,array('classic','blue','ajax','rpc','gray','cron'))); +$SKINS = @array_unique(array_merge($SKINS,array('classic','blue','ajax','rpc','gray','cron','api'))); $SKINSSHOW = @array_unique(array_merge($SKINSSHOW,array('classic','vakbarat','gray'))); if (is_array($POLICIES) && defined('_CONFIGDIR')) { -- cgit v1.2.3