Example #1
0
        flash();
    } else {
        flash("success", "templet.php?type=" . $_POST['type']);
    }
}
if (isset($_GET['do'])) {
    $do = trim($_GET['do']);
    if (!empty($_GET['id'])) {
        $id = intval($_GET['id']);
    }
    if ($do == "uninstall" && !empty($id)) {
        $templet->del($id);
    }
    if ($do == "install" && !empty($_GET['entry'])) {
        $entry = trim($_GET['entry']);
        $templet_controller->install($entry);
        flash("tpl_installed_ok", "templet.php?type=" . $_GET['type']);
    }
    if ($do == "setup" && !empty($_GET['name']) && $pdb->GetRow("SELECT * FROM {$tb_prefix}templets WHERE id=" . $id)) {
        $the_theme = trim($_GET['name']);
        $setting->replace(array("theme" => $the_theme));
        $result = $cache->writeCache("setting", "setting");
        if ($result) {
            $templet->exchangeDefault($id);
            flash("success", "templet.php?type=system");
        } else {
            flash();
        }
    }
    if ($do == "edit") {
        if (!empty($id)) {