From 43de9af71f7f4ca5731b94a06d688ae8412ba427 Mon Sep 17 00:00:00 2001 From: M.Gergo Date: Fri, 6 Jul 2018 11:14:41 +0200 Subject: 2018/Feb/28 -i állapot hozzáadva, mint a módosítások kiindulási állapota --- mayor-orig/www/skin/ajax/base/html/alert.phtml | 25 ++++++ mayor-orig/www/skin/ajax/base/html/base.phtml | 101 +++++++++++++++++++++++++ 2 files changed, 126 insertions(+) create mode 100644 mayor-orig/www/skin/ajax/base/html/alert.phtml create mode 100644 mayor-orig/www/skin/ajax/base/html/base.phtml (limited to 'mayor-orig/www/skin/ajax/base/html') diff --git a/mayor-orig/www/skin/ajax/base/html/alert.phtml b/mayor-orig/www/skin/ajax/base/html/alert.phtml new file mode 100644 index 00000000..e81b75ed --- /dev/null +++ b/mayor-orig/www/skin/ajax/base/html/alert.phtml @@ -0,0 +1,25 @@ + \ No newline at end of file diff --git a/mayor-orig/www/skin/ajax/base/html/base.phtml b/mayor-orig/www/skin/ajax/base/html/base.phtml new file mode 100644 index 00000000..cfa12036 --- /dev/null +++ b/mayor-orig/www/skin/ajax/base/html/base.phtml @@ -0,0 +1,101 @@ + base.php + putValidXHTML() +*/ + + + /* Egy JSON példa + echo '{ "action" : [ ' + .'{ "func" : "alert", "param" : [ "Helló", "World" ] }, ' + .'{ "func" : "update", "param" : [ { "id" : "updateForm", "content" : "Helló Update" } ]}, ' + .'{ "func" : "hide", "param" : [ "settings" ] },' + .'{ "func" : "show", "param" : [ "updateWindow" ] },' + .'{ "func" : "remove", "param" : [ "head" ] },' + .'{ "func" : "removeClass", "param" : [ { "id" : "jegy-1", "class" : "jegy1" } ] },' + .'{}],' + .' "name" : "Violet", "occupation" : "character" }'; + */ + + +// ------------------------------------------------------------------- +// html_base() : a html oldal szerkezete +// ------------------------------------------------------------------- + +function html_base($sessionID,$policy,$page,$sub,$f,$lang,$skin,$MENU) { + + global $_JSON; + + if ($_JSON['result'] === false) @header("HTTP/1.1 400 Bad Request"); + else @header("HTTP/1.1 200 OK"); + + @header('Content-type: application/json; charset=utf-8'); + @header("Etag: ".__SALTVALUE.'-'.__SALTNAME.'-'.$_SESSION['mayorToken']); // ajax request esetén innen tudható a _SALTVALUE + + _httpHeader(); + + if ( (!is_array($_JSON)?false:json_encode($_JSON)) === false) { + ob_start(); + define('_UNIQUE', uniqid()); + //echo '
'; + page($page,$sub,$f,$lang,$skin,$policy); + $_JSON['html'] = ob_get_contents(); + ob_end_clean(); + } + if (is_array($_SESSION['alert']) && count($_SESSION['alert'])>0) { + for($i=0; $i'.$aType.':'.$aCode.')'; + else $msg = $ALERT_MSG[$aCode]; + + // paraméter behelyettesítés + for($i = 0; $i < count($param); $i++) { + $_msg = $msg; + $msg = @str_replace("%$i%",''.($param[$i]).'',$msg); + if ($param[$i] != '' and $_msg == $msg) $pstr .= ''.($param[$i]).','; + } + if ($pstr != '') $msg .= ' (' . substr($pstr,0,-1) . ')'; + if (($aType == 'message') or ($aType == 'page')) { + $title = _ERROR; + $class = 'errorMsg'; + if ($aType == 'page') $showPage = false; + } else { + $title = _INFORMATION; + $class = 'infoMsg'; + } + $msg = ''.$title.': ' . $msg; + $showPage .= '
'.str_replace('***','
',$msg).'
'."\n"; + } + + return $showPage; + +} + +?> -- cgit v1.2.3