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(); }
} $call = "{$Item["form"]}BeforeShowItem"; if (is_callable($call)) { $Item = @$call($Item); } $__page->contentSetData($Item); $call = $form . "ChangeHtml"; if (is_callable($call)) { $call($__page, $Item); } $__page->contentTargeter($Item); if ($Item == array("id" => $_GET["id"], "form" => $_GET["form"]) && strip_tags($__page->outerHtml()) == "" && $_GET["form"] == "page" && $_GET["mode"] == "show") { if (is_file($_SESSION["app_path"] . "/tpl/404.php")) { $__page = aikiGetTpl("404.php"); } else { $__page = ki::fromString("[Ошибка 404] Страница отсутствует"); } } } if (is_object($__page) && isset($__form) && $__page->outerHtml() == "") { $__page = $__form; $__page->contentSetData($Item); } if (isset($Item["meta_description"])) { $tag = '<meta name="description" content="' . $Item["meta_description"] . '">'; $meta = $__page->find("meta[name=description]", 0); if (is_object($meta)) { $meta->before($tag); $meta->remove(); } else { $__page->find("head")->append($tag);
protected function prepareContent($content) { if (!$content instanceof kiNodesList) { // Document if ($content instanceof kiDocument) { $content =& $content->detachChildren(); } else { if (!is_object($content) && !is_array($content)) { $content = ki::fromString($content); $content =& $content->detachChildren(); } } $list = new self(); $list->add($content); $content = $list; } return $content->length ? $content : false; }
function sitemapGeneration() { $host = "http://{$_SESSION['HTTP_HOST']}"; $sitemap = ki::fromString(' <?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <url> <loc>' . $host . '/</loc> <lastmod>' . date("Y-m-d") . '</lastmod> <changefreq>weekly</changefreq> <priority>0.8</priority> </url> </urlset> '); $forms = array("page", "news"); foreach ($forms as $form) { $list = aikiListItems($form); sitemapGenerationUrl($sitemap, $form, $list); } unset($form); fileSaveItem("{$_SESSION['prj_path']}/sitemap.xml", $sitemap, true); return true; }