function page__show($out = null, $Item = null) { if ($Item == null) { $Item = $_SESSION["Item"]; } if ($out == null) { if (isset($Item["template"]) && $Item["template"] > "") { $out = aikiGetTpl($Item["template"]); } else { $out = aikiGetForm(); } } $out->contentSetData($Item); return $out->outerHtml(); }
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(); }
if (is_callable($call)) { $Item = @$call($Item); } $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();