$page['content_slug'] = $_POST['page_slug'] == '' ? slugify($_POST['page_title']) : $_POST['page_slug'];
             $page['content_visible'] = $_POST['page_visible'];
             // update content
             if (CONTENT::set_content($page, $_GET['id']) !== false) {
                 // show success message
                 TPL::message('Continutul a fost actualizat cu succes!', 'success');
             }
         }
         // assign data
         TPL::assign("content", CONTENT::get());
         TPL::assign('categories', CONTENT::get_categories());
         // set render
         TPL::render('v_pages/page_types/page_text');
     });
     EVENTS::add_action("before_render", function () {
         EVENTS::do_action("edit_page_" . CONTENT::get('content_type'));
     });
     break;
     /*
      * delete page
      */
 /*
  * delete page
  */
 case "delete":
     $page_id = $db->real_escape($_GET['id']);
     $del = $db->query("DELETE FROM dl_content WHERE content_id = '{$page_id}'");
     redirect(LINKS::get("admin_pages"));
     break;
 default:
     die("Undefined action");
Exemple #2
0
                if (CONTENT::set_content($produs, CONTENT::get("content_id"))) {
                    TPL::message("Actualizarile au fost efectuate cu success.", "success");
                } else {
                    TPL::message("S-au intampinat niste erori. Va rugam reincercati!");
                }
                // update content
                CONTENT::get_content(CONTENT::get("content_id"));
            }
            CONTENT::$current['content_text'] = object2array(json_decode(CONTENT::$current['content_text']));
            if (isset(CONTENT::$current['content_text']['caracteristici'])) {
                CONTENT::$current['content_text']['caracteristici'] = stripslashes(implode("\r\n", CONTENT::$current['content_text']['caracteristici']));
            } else {
                CONTENT::$current['content_text']['caracteristici'] = '';
            }
            if (!isset(CONTENT::$current['content_text']['descriere'])) {
                CONTENT::$current['content_text']['descriere'] = '';
            } else {
                CONTENT::$current['content_text']['descriere'] = stripslashes(CONTENT::$current['content_text']['descriere']);
            }
            if (CONTENT::$current['content_attachment'] == '') {
                CONTENT::$current['content_attachment'] = array();
            } else {
                CONTENT::$current['content_attachment'] = explode(",", CONTENT::$current['content_attachment']);
            }
            // assign
            TPL::assign("content", CONTENT::get());
            // set render
            TPL::render(FOLDER_pPBUC . "viewers_admin" . DS . "page_produs_edit");
        });
    }
});
Exemple #3
0
include FOLDER_WEBAPP . "services" . DS . "service_minify.php";
// service SITEMAP
include FOLDER_WEBAPP . "services" . DS . "service_sitemap.php";
// service THUMBS
include FOLDER_WEBAPP . "services" . DS . "service_thumbs.php";
URL::route("/", function () {
    TPL::render("pages/page_home");
});
if (CONTENT::is_page()) {
    TPL::thing("head", "title", CONTENT::$current['content_title']);
    EVENTS::add_action("view_page_page_text", function () {
        TPL::assign("content", CONTENT::get());
        TPL::render("pages/page_text");
    });
    EVENTS::add_action("before_render", function () {
        EVENTS::do_action("view_page_" . CONTENT::get("content_type"));
    });
    URL::routed(true);
}
if (!URL::routed()) {
    $request = URL::get_request();
    if (substr($request, -1) == '/') {
        $request = substr($request, 0, -1);
    }
    $not_allowed = array("home", "text", "404", "maintenance");
    if (TPL::check_template("page_" . $request) && !in_array($request, $not_allowed)) {
        TPL::render("page_" . $request);
        URL::routed(true);
    }
}
//LOGS::export("html", true);