function pay2pay__settings() { $form = aikiGetForm($_GET["form"], $_GET["mode"]); $form->contentSetValues($_SESSION["settings"]); // проставляем значения return $form->outerHtml(); }
function source__list() { $out = aikiGetForm(); $Item = array(); //$dirlist = getDirectoryTree($_SESSION["app_path"],'',array("engine","contents")); $Item["dirTree"] = "<div class='sourceTree' role='menu'></div>\n"; $out->contentSetData($Item); return $out->outerHtml(); }
function news__edit() { $out = aikiGetForm($_GET["form"], $_GET["mode"]); $Item = aikiReadItem("news", $_GET["id"]); if ($_GET["id"] == "_new") { $Item["id"] = newIdRnd(); } $Item = _newsBeforeShowItem($Item); $out->contentSetData($Item); return $out->htmlOuter(); }
function prod__edit() { $out = aikiGetForm($_GET["form"], $_GET["mode"]); $Item = aikiReadItem($_GET["form"], $_GET["id"]); $Item["form"] = $_GET["form"]; if ($_GET["id"] == "_new") { $Item["id"] = newIdRnd(); } $out->contentSetData($Item); return $out->outerHtml(); }
function page__getajax() { $out = aikiGetForm($_GET["form"], $_GET["mode"]); if (!is_object($out)) { $out = aikiGetForm($_GET["form"], "show"); } $Item = aikiReadItem($_GET["form"], $_GET["item"]); $out = aikiFromString(page__show($out, $Item)); if (is_callable("pageChangeHtml")) { pageChangeHtml($out, $Item); } return $out->outerHtml(); }
function admin__settings() { $out = aikiGetForm($_GET["form"], $_GET["mode"]); $Item = fileReadItem($_GET["form"], $_GET["mode"]); $checkout_list = aikiCheckoutForms(); if (count($checkout_list) > 0) { $Item["checkout_list"] = $checkout_list; } else { $out->find("select[name=checkout]")->parents(".form-group")->remove(); } $Item["tpllist"] = aikiListTpl(); $Item["formlist"] = aikiListForms(); $out->contentSetData($Item); return $out->htmlOuter(); }
function _ordersMail($Item = null) { if ($Item == null) { $Item = aikiReadItem("orders", $_GET["item"]); } $out = aikiGetForm("orders", "mail", true); $out->contentSetData($Item); $out->find(".data-grand-total")->remove(); $subject = $out->find("title")->text(); $to = "<{$Item["person"]["email"]}>, "; $to .= "<{$_SESSION["settings"]["email"]}> "; $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=windows-1251\r\n"; $headers .= "From: {$_SERVER["HTTP_HOST"]} <{$_SESSION["settings"]["email"]}>\r\n"; $body = iconv("UTF-8", "WINDOWS-1251", $out->outerHtml()); $subject = iconv("UTF-8", "WINDOWS-1251", $subject); mail($to, $subject, $body, $headers); return $out; }
function users__reg_submit() { $res = users__reg_check(); $text = aikiGetForm($_GET["form"], "ajax_text"); switch ($res) { case "ok": users__reg_mail($text); $out = $text->find("#success")->html(); break; case "email": $out = $text->find("#error_email")->html(); break; case "login": $out = $text->find("#error_login")->html(); break; } unset($text); return ki::fromString($out); }
function common__show($Item = array()) { $out = ""; if (isset($_GET["form"]) && $_GET["form"] > "") { $Item = aikiReadItem($_GET["form"], $_GET["id"]); if ($_SESSION["error"] == "noitem") { header($_SERVER['SERVER_PROTOCOL'] . " 404 Not Found"); if (is_file($_SESSION["app_path"] . "/tpl/404.php")) { $out = aikiGetTpl("404.php"); } else { $out = ki::fromString("[Ошибка 404] Страница отсутствует"); } } else { if (isset($Item["template"]) && $Item["template"] > "") { $out = aikiGetTpl($Item["template"]); } else { $out = aikiGetForm(); } if ($out == "") { $out = ki::fromString("<html><div><h2>{{header}}</h2>{{text}}</div></html>"); } } if (isset($Item["form"])) { formCurrentInclude($Item["form"]); $call = "_{$Item["form"]}BeforeShowItem"; if (is_callable($call)) { $Item = @$call($Item); } $call = "{$Item["form"]}BeforeShowItem"; if (is_callable($call)) { $Item = @$call($Item); } } } if (!is_object($out)) { $out = ki::fromString($out); } $out->contentSetData($Item); return $out->outerHtml(); }
function comments__getajax() { switch ($_GET["view"]) { case "modal": $out = aikiGetForm($_GET["form"], "show"); $Item = _commentsBeforeShowItem(aikiReadItem("comments", $_GET["item"])); $out->contentSetData($Item); return $out->outerHtml(); break; case "new": $out = aikiGetForm($_GET["form"], "edit"); $Item["id"] = newIdRnd(); if ($_SESSION["User"] != "Admin") { $out->find("textarea[name=reply]")->parents(".form-group")->remove(); $out->find("input[type=checkbox]")->parents(".form-group")->remove(); } else { $out->find(".modal-body button[formsave]")->parents(".form-group")->remove(); } $out->contentSetData($Item); return clearValueTags($out->outerHtml()); break; } }
$_SESSION["engine_path"] = "{$_SERVER['DOCUMENT_ROOT']}/engine"; include_once "{$_SESSION["engine_path"]}/engine.php"; if (is_file("{$_SERVER['DOCUMENT_ROOT']}/contents/admin/settings")) { header("Refresh: 0; URL=http://{$_SERVER["HTTP_HOST"]}/login.htm"); die; } comPathCheck(); copy("{$_SESSION["engine_path"]}/.htaccess", "{$_SERVER['DOCUMENT_ROOT']}/.htaccess"); copy("{$_SESSION["engine_path"]}/tpl/default.php", "{$_SERVER['DOCUMENT_ROOT']}/tpl/default.php"); copy("{$_SESSION["engine_path"]}/uploads/__system/index.php", "{$_SERVER['DOCUMENT_ROOT']}/index.php"); chmod("{$_SERVER['DOCUMENT_ROOT']}/.htaccess", 0766); chmod("{$_SERVER['DOCUMENT_ROOT']}/tpl/default.php", 0766); chmod("{$_SERVER['DOCUMENT_ROOT']}/index.php", 0766); recurse_copy("{$_SESSION["engine_path"]}/uploads/__contents", "{$_SERVER['DOCUMENT_ROOT']}/contents"); $__page = ki::fromFile("{$_SESSION["engine_path"]}/tpl/admin.php"); $form = aikiGetForm("admin", "settings"); foreach ($form->find(".form-group") as $fg) { if (!$fg->hasClass("setup")) { $fg->remove(); } } $form->find("[data-role=multiinput]")->remove(); $form->find("ul.nav li:not(.active)")->remove(); $__page->find("script[src=/engine/tpl/js/admin.js])")->remove(); $__page->find("head title")->html("Настройки"); $__page->find("head")->prepend("<script src='/engine/js/jquery.min.js'></script>"); $__page->find("head")->append("<link rel='stylesheet' href='/engine/appUI/css/bootstrap.min.css'>"); $__page->find("head")->prepend("<script src='/engine/js/jquery.min.js'></script>"); $__page->find("head")->append("<script src='/engine/bootstrap/js/bootstrap.min.js'></script>"); $__page->find("head")->append("<script src='/engine/js/functions.js'></script>"); $__page->find("head")->append("<script src='/engine/appUI/js/plugins.js'></script>");
$empty = 0; } if ($form == "page" && $mode == "show" && $item == "home" && $tpl == "") { if (is_file($_SESSION["app_path"] . "/tpl/home.php")) { $__page = aikiGetTpl("home.php"); } else { if (is_file($_SESSION["app_path"] . "/tpl/default.php")) { $__page = aikiGetTpl("default.php"); } } } else { if ($tpl > "") { $__page = aikiGetTpl($tpl); } else { if ($error == null) { $__form = aikiGetForm(); if ($_SESSION["error"] == "noform") { if (is_file($_SESSION["app_path"] . "/tpl/404.php")) { $__page = aikiGetTpl("404.php"); } else { $__form = ki::fromString("[Ошибка 404] Страница отсутствует"); } } } } } if ($_SESSION["cache"] !== 1) { if (is_object($__page) and $__page->outerHtml() == "") { // в темплейтах не нашли, ищем в обработчиках $inc = array("{$_SESSION["engine_path"]}/forms/{$_GET["form"]}.php", "{$_SESSION["engine_path"]}/forms/{$_GET["form"]}/{$_GET["form"]}.php", "{$_SESSION["prj_path"]}/forms/{$_GET["form"]}.php", "{$_SESSION["prj_path"]}/forms/{$_GET["form"]}/{$_GET["form"]}.php", "{$_SESSION["app_path"]}/forms/{$_GET["form"]}.php", "{$_SESSION["app_path"]}/forms/{$_GET["form"]}/{$_GET["form"]}.php", "{$_SESSION["root_path"]}/forms/{$_GET["form"]}.php", "{$_SESSION["root_path"]}/forms/{$_GET["form"]}/{$_GET["form"]}.php"); $res = FALSE;