function _inc($inc)
{
    $path = TPL::dir() . $inc . ".php";
    // check for include file in template directory
    if (!file_exists($path)) {
        // check other path
        if (file_exists($inc . ".php")) {
            $path = $inc . ".php";
        } else {
            // log error
            LOGS::write("not_found_template_file");
            // return false
            return false;
        }
    }
    // include file
    extract(TPL::$vars);
    include $path;
}
Exemple #2
0
if (!defined("DRAWLINE_RUN_FROM_INDEX")) {
    die;
}
define("ADMIN_URL", LINKS::get("admin_home"));
/*
 * load BACKend or FRONTend
 */
if (on_admin()) {
    // set template path to admin
    TPL::dir(FOLDER_ADMIN . "template" . DS);
    // run admin
    include FOLDER_ADMIN . "index.php";
} else {
    // set template path to admin
    TPL::dir(FOLDER_EXTENDER . "templates" . DS . OPTIONS::website('frontend_template') . DS);
    // run frontend
    include FOLDER_FRONTEND . "index.php";
}
// 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.");
    }
}