Example #1
0
    // add page type
    $page_types = array("type_name" => "page_poli_products", "type_title" => "Produs Plastic", "type_desc" => "Adaugarea unuei pagini de produs mase plastice", "type_icon" => "tags");
    CONTENT::add_page_type($page_types);
});
/*
 * uninstall the plugin
 */
EVENTS::add_action("uninstall_plugin_" . pPBUC, function () {
    // remove installed page type
    CONTENT::remove_page_type("page_poli_products");
});
/*
 * run plugin
 */
EVENTS::add_action("run_plugin_" . pPBUC, function () {
    if (!on_admin()) {
        URL::route("/", function () {
            TPL::thing("head", "title", "Adeko Distributions");
        });
        EVENTS::add_action("view_page_page_poli_products", function () {
            // routed
            URL::routed(true);
            // get caracteristici
            CONTENT::$current['content_text'] = object2array(json_decode(CONTENT::$current['content_text']));
            if (isset(CONTENT::$current['content_text']['caracteristici'])) {
                CONTENT::$current['content_text']['caracteristici'] = CONTENT::$current['content_text']['caracteristici'];
            } else {
                CONTENT::$current['content_text']['caracteristici'] = array();
            }
            if (!isset(CONTENT::$current['content_text']['descriere'])) {
                CONTENT::$current['content_text']['descriere'] = '';
Example #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"));