Beispiel #1
0
 public static function show(array $msg)
 {
     $page = new page();
     $page->set('msg', $msg);
     $message = $page->render('msg');
     if ($message !== false) {
         echo $message;
     } else {
         $page->title = $msg['type'];
         $page->body = array('class' => 'msg');
         $page->header();
         $page->add('');
         $page->add('<div id="icon"><div class="zotop-icon zotop-icon-' . $msg['type'] . '"></div></div>');
         $page->add('<div id="msg" class="' . $msg['type'] . ' clearfix">');
         $page->add('	<div id="msg-type">' . $msg['type'] . '</div>');
         $page->add('	<div id="msg-life">' . (int) $msg['life'] . '</div>');
         $page->add('	<div id="msg-title">' . $msg['title'] . '</div>');
         $page->add('	<div id="msg-content">' . $msg['content'] . '</div>');
         $page->add('	<div id="msg-detail">' . $msg['detail'] . '</div>');
         $page->add('	<div id="msg-action">' . $msg['action'] . '</div>');
         $page->add('	<div id="msg-file">' . $msg['file'] . '</div>');
         $page->add('	<div id="msg-line">' . $msg['line'] . '</div>');
         if (!empty($msg['url'])) {
             $page->add('	<div>');
             $page->add('		<div><b>如果页面没有自动跳转,请点击以下链接</b></div>');
             $page->add('		<a href="' . $msg['url'] . '" id="msg-url">' . $msg['url'] . '</a>');
             $page->add('	</div>');
         }
         $page->add('</div>');
         $page->add('<div id="powered">' . zotop::config('zotop.name') . ' ' . zotop::config('zotop.version') . '</div>');
         $page->footer();
     }
     exit;
 }
Beispiel #2
0
 function showPage()
 {
     $curpage = getcurpage();
     // берём контроллер для текущей страницы
     include __corePath . "controllers/{$curpage}.php";
     $page = new page($curpage, $this->db, $this->config);
     $page->prepare();
     $page->render();
     echo $page->show();
     //показываем страницу
 }
Beispiel #3
0
    /*
     * HttpError doesn't have access to
     * vars outside of here.
     */
    $render = new render();
    $config = new config();
    $build = new page();
    $pages = new db("pages");
    $request = $_SERVER['REQUEST_URI'];
    $found = false;
    foreach ($pages->all() as $page) {
        $component = array_keys($page)[0];
        if ($page["endpoint"] != "/") {
            //Add slash to URL
            $page["endpoint"] = "/" . $page["endpoint"];
        }
        if ($page["endpoint"] == $request) {
            $found = $page;
        }
    }
    if ($found) {
        $endpoint = "app/cache/" . $found['page'] . ".html";
        if (file_exists($endpoint)) {
            die(file_get_contents($endpoint));
        }
        $build->render($found);
    } else {
        $render->render("admin.error", ["system" => $config->system]);
    }
    die;
});
Beispiel #4
0
    }
    return $res;
}
function getInstallActions()
{
    if (!isset($_POST['action'])) {
        return 0;
    }
    $action = str_replace('.', '##', $_POST['action']);
    if (file_exists("actions/" . $action . '.php')) {
        return $action;
    }
    return 0;
}
$action = getInstallActions();
if ($action) {
    include "actions/{$action}.php";
    $action = new action(0);
    $action->execute();
}
$route = getroute();
if (beforeInstall()) {
    $curpage = 'controller/beforeInstall';
} else {
    $curpage = 'controller/' . $route;
}
include "{$curpage}.php";
$page = new page($curpage, 0, 0);
$page->prepare();
$page->render();
echo $page->show();
Beispiel #5
0
 public function __destruct()
 {
     parent::render();
 }
<?php

require_once '../thinkedit.init.php';
require_once '../class/datagrid.class.php';
require_once '../class/page.class.php';
$page = new page();
$datagrid = new datagrid();
$datagrid->addColumn('firstname', 'First name', true, true);
$datagrid->addColumn('lastname', 'Last name', true, true);
$datagrid->addColumn('title', 'Last name', true, true);
for ($i = 1; $i < 1000; $i++) {
    $data['firstname'] = rand(1, 100);
    $data['lastname'] = rand(1, 100);
    $data['title'] = rand(1, 100);
    $datagrid->add($data);
}
$page->startPanel('test');
$page->add($datagrid->render('icon'));
$page->endPanel('test');
echo $page->render();