コード例 #1
0
ファイル: index.php プロジェクト: double-web/drawline
if (!defined("FOLDER_pPBUC")) {
    define("FOLDER_pPBUC", FOLDER_PLUGINS . pPBUC . DS);
}
if (!defined("FOLDER_pPBUC_CONTENT")) {
    define("FOLDER_pPBUC_CONTENT", FOLDER_CONTENT . "produse-poliamida" . DS);
}
if (!defined("URL_pPBUC_CONTENT")) {
    define("URL_pPBUC_CONTENT", str_replace(array(FOLDER_BASE, DS), array(BASE_URL, "/"), FOLDER_pPBUC_CONTENT));
}
/*
 * install the plugin
 */
EVENTS::add_action("install_plugin_" . pPBUC, function () {
    // 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");