Esempio n. 1
0
$smarty->loadFilter('pre', 'add_partial_indents');
$smarty->loadFilter('output', 'fix_smarty_syntax_indents');
// admin
if ($htmlwarrior->config['frontpage_site'] === false) {
    if ($htmlwarrior->runtime['site_dir'] == '') {
        if (isset($_GET['action'])) {
            if ($_GET['action'] == 'new_project') {
                if (isset($_GET['name'])) {
                    echo 'todo new ';
                } else {
                    die('name attribute needed');
                }
            }
        }
        $smarty->setTemplateDir($htmlwarrior->config['code_path'] . '/admin/templates');
        $smarty->assign('access_log', get_access_log(array('limit' => 10)));
        $smarty->assign('access_log_site', get_site_access_log(array('limit' => 10)));
        $files = dir_list($htmlwarrior->config['basepath']);
        foreach ($files as &$ma) {
            $tmp[] =& $ma['timestamp'];
        }
        array_multisort($tmp, SORT_DESC, $files, SORT_DESC);
        $smarty->assign('files', $files);
        $smarty->display('index.tpl');
        die;
    }
}
// load custom site functions
if (file_exists($htmlwarrior->config['basepath'] . '/' . $htmlwarrior->runtime['site_dir'] . '/functions.php')) {
    require_once $htmlwarrior->config['basepath'] . '/' . $htmlwarrior->runtime['site_dir'] . '/functions.php';
}
Esempio n. 2
0
$smarty->loadFilter("pre", "add_partial_indents");
$smarty->loadFilter("output", "fix_smarty_syntax_indents");
// admin
if ($smartysh->config["frontpage_site"] === false) {
    if ($smartysh->runtime["site_dir"] == "") {
        if (isset($_GET["action"])) {
            if ($_GET["action"] == "new_project") {
                if (isset($_GET["name"])) {
                    echo "todo new ";
                } else {
                    die("name attribute needed");
                }
            }
        }
        $smarty->template_dir = $smartysh->config["code_path"] . "/admin/templates";
        $smarty->assign("access_log", get_access_log(array("limit" => 10)));
        $smarty->assign("access_log_site", get_site_access_log(array("limit" => 10)));
        $files = dir_list($smartysh->config["basepath"]);
        foreach ($files as &$ma) {
            $tmp[] =& $ma["timestamp"];
        }
        array_multisort($tmp, SORT_DESC, $files, SORT_DESC);
        $smarty->assign("files", $files);
        $smarty->display("index.tpl");
        die;
    }
}
// load custom site functions
if (file_exists($smartysh->config["basepath"] . "/" . $smartysh->runtime["site_dir"] . "/functions.php")) {
    require_once $smartysh->config["basepath"] . "/" . $smartysh->runtime["site_dir"] . "/functions.php";
}