示例#1
0
文件: dict.php 项目: aikianapa/aiki
function dict__edit()
{
    $form = $_GET["form"];
    $out = ki::fromFile("http://{$_SERVER["HTTP_HOST"]}/engine/forms/{$form}/{$form}_edit.php");
    $Item = aikiReadItem("dict", $_GET["id"]);
    if ($_GET["id"] == "_new") {
        $Item["id"] = newIdRnd();
    } else {
        $out->find("#dictEditForm .nav-tabs li:eq(1)")->addClass("set_active");
    }
    $out->find("form button[data-formsave]")->parents(".form-group")->remove();
    $Item["form"] = $form;
    if (isset($Item["data"])) {
        $Item["data"] = json_encode($Item["data"]);
    }
    $out->contentSetData($Item);
    return $out->outerHtml();
}
示例#2
0
文件: users.php 项目: aikianapa/aiki
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);
}
示例#3
0
文件: common.php 项目: aikianapa/aiki
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();
}
示例#4
0
文件: setup.php 项目: aikianapa/aiki
$_SESSION["app_path"] = $_SERVER["DOCUMENT_ROOT"];
$_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>");
示例#5
0
    $text = array("Columns", "The system does not manage the complex numbers.", "Generate", "Line", "Calculate", "Data", "You have to choose the size of the array to generate it", "Pearson's chi-squared test is a statistical test applied to sets of categorical data to evaluate how likely it is that any observed difference between the sets arose by chance. It is suitable for unpaired data from large samples");
} else {
    if ($_SESSION['langue'] == 'fr') {
        $text = array("Colonnes", "Le système ne prend pas en charge les nombres complexes.", "Génerer", "Lignes", "Calculer", "Données", "Vous devez choisir la taille du tableau de données pour le générer", "Le test du « khi-deux » est un test statistique permettant de tester l'adéquation d'une série de données à une famille de lois de probabilités ou de tester l'indépendance entre deux variables aléatoires.");
    }
}
if (isset($_POST['test_ki'])) {
    $data = array();
    for ($x = 0; $x < $_GET['x']; $x++) {
        $d = array();
        for ($y = 0; $y < $_GET['y']; $y++) {
            $d[$y] = $_POST['data_' . $x . '_' . $y . ''];
        }
        $data[$x] = $d;
    }
    $ki2 = new ki($data, $_GET['y'], $_GET['x']);
    $result_somme = $ki2->get_somme();
    $result_theorique = $ki2->get_theorique_tab();
    $result_ki = $ki2->get_tab_ki();
}
?>
<div id="page-wrapper">
    <div class="row">
        <div class="col-lg-12" style="margin-top: 10px;">
            <div class="alert alert-warning" role="alert"><?php 
echo $text[1];
?>
</div>
        </div>
        <div class="col-lg-12">
            <div class="panel panel-default">
示例#6
0
文件: engine.php 项目: aikianapa/aiki
     }
     $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);
示例#7
0
文件: kiDom.php 项目: aikianapa/aiki
 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;
 }
示例#8
0
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;
}