Esempio n. 1
0
    public static function uninstall()
    {
        global $db, $setting, $admin_cat;
        $info = self::info();
        $db->delete($setting['db']['pre'] . "news_mark");
        $db->exec("drop", "table", $setting['db']['pre'] . "news_mark");
        $db->delete($setting['db']['pre'] . "admin_cat", array("file", "=", "news_mark.php"));
        $db->delete($setting['db']['pre'] . "plugin", array("idx", "=", $info['idx']));
        deleteCache("admin_cat");
        deleteCache("plugin");
        $err = array();
        if ($db->GetError($err)) {
            showInfo($setting['language']['plugin_err_uninstall'] . "\r\n\t\t\t<br />\r\n\t\t\t<pre>\r\n\t\t\t" . join("\n------------------------\n", $err) . "\r\n\t\t\t</pre>\r\n\t\t\t");
        } else {
            includeCache("admin_cat");
            $admin_cat = toJson($admin_cat, $setting['gen']['charset']);
            echo <<<mystep
<script language="javascript">
parent.admin_cat = {$admin_cat};
parent.setNav();
</script>
mystep;
            buildParaList("plugin");
            echo showInfo($setting['language']['plugin_uninstall_done'], false);
        }
    }
Esempio n. 2
0
    public static function uninstall()
    {
        global $db, $setting, $admin_cat;
        $info = self::info();
        $db->delete($setting['db']['pre'] . "survey");
        $db->exec("drop", "table", $setting['db']['pre'] . "survey");
        $db->delete($setting['db']['pre'] . "admin_cat", array("file", "like", "survey.php%"));
        $db->delete($setting['db']['pre'] . "plugin", array("idx", "=", $info['idx']));
        deleteCache("admin_cat");
        deleteCache("plugin");
        $err = array();
        if ($db->GetError($err)) {
            showInfo($setting['language']['plugin_err_uninstall'] . "\r\n\t\t\t<br />\r\n\t\t\t<pre>\r\n\t\t\t" . join("\n------------------------\n", $err) . "\r\n\t\t\t</pre>\r\n\t\t\t");
        } else {
            includeCache("admin_cat");
            $admin_cat = toJson($admin_cat, $setting['gen']['charset']);
            echo <<<mystep
<script language="javascript">
parent.admin_cat = {$admin_cat};
parent.setNav();
</script>
mystep;
            MultiDel(ROOT_PATH . "/" . $setting['path']['cache'] . "/plugin/survey/");
            MultiDel(dirname(__FILE__) . "/data/");
            MakeDir(dirname(__FILE__) . "/data/");
            buildParaList("plugin");
            echo showInfo($setting['language']['plugin_uninstall_done'], false);
        }
    }
Esempio n. 3
0
    public static function uninstall()
    {
        global $db, $setting, $admin_cat, $mystep;
        $info = self::info();
        $db->delete($setting['db']['pre'] . "admin_cat", array("file", "=", "xcode.php"));
        $db->delete($setting['db']['pre'] . "plugin", array("idx", "=", $info['idx']));
        deleteCache("admin_cat");
        deleteCache("plugin");
        $err = array();
        if ($db->GetError($err)) {
            showInfo($setting['language']['plugin_err_uninstall'] . "\r\n\t\t\t<br />\r\n\t\t\t<pre>\r\n\t\t\t" . join("\n------------------------\n", $err) . "\r\n\t\t\t</pre>\r\n\t\t\t");
        } else {
            $mydb = $mystep->getInstance("MyDB", "code", dirname(__FILE__));
            $record = $mydb->queryAll();
            for ($i = 0; $i < count($record); $i++) {
                unlink(dirname(__FILE__) . "/code/" . $record[$i]['idx'] . ".php");
            }
            $mydb->emptyTBL();
            unset($mydb);
            includeCache("admin_cat");
            $admin_cat = toJson($admin_cat, $setting['gen']['charset']);
            echo <<<mystep
<script language="javascript">
parent.admin_cat = {$admin_cat};
parent.setNav();
</script>
mystep;
            buildParaList("plugin");
            echo showInfo($setting['language']['plugin_uninstall_done'], false);
        }
    }
Esempio n. 4
0
 public static function uninstall()
 {
     global $db, $setting, $admin_cat;
     $info = self::info();
     $db->delete($setting['db']['pre'] . "plugin", array("idx", "=", $info['idx']));
     deleteCache("plugin");
     $err = array();
     if ($db->GetError($err)) {
         showInfo($setting['language']['plugin_err_uninstall'] . "\r\n\t\t\t<br />\r\n\t\t\t<pre>\r\n\t\t\t" . join("\n------------------------\n", $err) . "\r\n\t\t\t</pre>\r\n\t\t\t");
     } else {
         buildParaList("plugin");
         echo showInfo($setting['language']['plugin_uninstall_done'], false);
     }
 }
Esempio n. 5
0
    public static function uninstall()
    {
        global $db, $setting, $admin_cat;
        $info = self::info();
        $db->select($setting['db']['pre'] . "custom_form", "mid");
        $sql_list = array();
        while ($record = $db->GetRS()) {
            $sql_list[] = "truncate table " . $setting['db']['pre'] . "custom_form_" . $record['mid'];
            $sql_list[] = "drop table " . $setting['db']['pre'] . "custom_form_" . $record['mid'];
            unlink(dirname(__FILE__) . "/setting/{$record['mid']}_cf_submit_cn.tpl");
            unlink(dirname(__FILE__) . "/setting/{$record['mid']}_cf_submit_en.tpl");
            unlink(dirname(__FILE__) . "/setting/{$record['mid']}_cf_list_cn.tpl");
            unlink(dirname(__FILE__) . "/setting/{$record['mid']}_cf_list_en.tpl");
            unlink(dirname(__FILE__) . "/setting/{$record['mid']}_block_cf_list_cn.tpl");
            unlink(dirname(__FILE__) . "/setting/{$record['mid']}_block_cf_list_en.tpl");
            unlink(dirname(__FILE__) . "/setting/{$record['mid']}_mail_cn.tpl");
            unlink(dirname(__FILE__) . "/setting/{$record['mid']}_mail_en.tpl");
            unlink(dirname(__FILE__) . "/setting/{$record['mid']}_edit_data.tpl");
            unlink(dirname(__FILE__) . "/setting/{$record['mid']}_list_data.tpl");
            unlink(dirname(__FILE__) . "/setting/{$record['mid']}_ext_script.php");
            unlink(dirname(__FILE__) . "/setting/{$record['mid']}.php");
        }
        $db->Free();
        $db->BatchExec($sql_list);
        include "config.php";
        if (isset($catid) && $catid != 0) {
            $db->delete($setting['db']['pre'] . "admin_cat", array("pid", "n=", $catid));
        }
        $db->delete($setting['db']['pre'] . "custom_form");
        $db->exec("drop", "table", $setting['db']['pre'] . "custom_form");
        $db->delete($setting['db']['pre'] . "admin_cat", array("file", "like", "custom_form.php"));
        $db->delete($setting['db']['pre'] . "plugin", array("idx", "=", $info['idx']));
        deleteCache("admin_cat");
        deleteCache("plugin");
        $err = array();
        if ($db->GetError($err)) {
            showInfo($setting['language']['plugin_err_uninstall'] . "\r\n\t\t\t<br />\r\n\t\t\t<pre>\r\n\t\t\t" . join("\n------------------------\n", $err) . "\r\n\t\t\t</pre>\r\n\t\t\t");
        } else {
            includeCache("admin_cat");
            $admin_cat = toJson($admin_cat, $setting['gen']['charset']);
            echo <<<mystep
<script language="javascript">
parent.admin_cat = {$admin_cat};
parent.setNav();
</script>
mystep;
            buildParaList("plugin");
            WriteFile(dirname(__FILE__) . "/config.php", '<?php
$catid = 0;
?>', "wb");
            echo showInfo($setting['language']['plugin_uninstall_done'], false);
        }
    }