Esempio n. 1
0
<?php

// check if logged
if (!USER::is_logged() && !LINKS::on_link("admin_login")) {
    $link = LINKS::get("admin_login") . (LINKS::on_link("admin_home") ? '' : '?redirect=' . urlencode(URL::get_full_url()));
    redirect($link);
}
// check if has permission to access Admin Panel
if (USER::is_logged() && !PERMISSIONS::check("access_admin") && !LINKS::on_link("admin_login") && !LINKS::on_link("admin_logout")) {
    redirect(LINKS::get("base_home"));
}
/* REWRITING */
if (file_exists(FOLDER_ADMIN . "routes.php")) {
    include FOLDER_ADMIN . "routes.php";
}
ob_start();
/*
 * Set default admin menu
 */
/*
 * CONTENT
 */
DRAWLINE::admin_menu('content', array("title" => "Content", "icon" => "book", "link" => "admin_content"));
DRAWLINE::admin_menu('add_page', array("title" => "Add page", "icon" => "plus", "link" => array("admin_pages_add"), "item_active_on_link" => "admin_pages_add", "parent" => "content"));
DRAWLINE::admin_menu('pages_list', array("title" => "Pages list", "icon" => "list", "link" => "admin_pages", "parent" => "content"));
DRAWLINE::admin_menu('categories', array("title" => "Categories", "icon" => "tags", "link" => "admin_categories", "parent" => "content", "item_separator_bottom" => true));
DRAWLINE::admin_menu('media', array("title" => "Media", "icon" => "picture-o", "link" => "admin_media", "parent" => "content"));
DRAWLINE::admin_menu('menus', array("title" => "Menus", "icon" => "plane", "link" => "admin_menus", "parent" => "content", "item_separator_bottom" => true));
DRAWLINE::admin_menu('trash', array("title" => "Trash", "icon" => "trash", "link" => "admin_trash", "parent" => "content"));
/*
 * DESIGN
Esempio n. 2
0
}
// general assign
TPL::assign("admin_url", ADMIN_URL);
TPL::assign("base_url", BASE_URL);
// run plugins
foreach (DRAWLINE::plugins_list(true) as $plugin) {
    if (file_exists(FOLDER_PLUGINS . $plugin . DS . "index.php")) {
        include_once FOLDER_PLUGINS . $plugin . DS . "index.php";
        EVENTS::do_action("run_plugin_" . $plugin);
    } else {
        LOGS::write("Not found plugin " . $plugin . " on the server.");
    }
}
EVENTS::do_action("before_render");
// start render
if (OPTIONS::website("maintenance_mode") == '1' && !on_admin() && !PERMISSIONS::check("access_admin")) {
    if (TPL::check_template("page_maintenance")) {
        TPL::render("page_maintenance");
        TPL::draw(true);
    } else {
        echo '<h1>This website is in maintenance!</h1>';
    }
} elseif (TPL::render() != "") {
    TPL::draw(true);
} else {
    if (!URL::routed()) {
        show_404();
    }
}
EVENTS::do_action("after_render");
//print_array(LOGS::export("html"));