예제 #1
0
/**
* Automatic uninstall function for plugins
*
* @return   array
*
* This code is automatically uninstalling the plugin.
* It passes an array to the core code function that removes
* tables, groups, features and php blocks from the tables.
* Additionally, this code can perform special actions that cannot be
* foreseen by the core code (interactions with other plugins for example)
*
*/
function plugin_autouninstall_nexproject()
{
    global $_PRJCONF, $_TABLES;
    $out = array('tables' => array('prj_category', 'prj_department', 'prj_location', 'prj_objective', 'prj_permissions', 'prj_users', 'prj_projects', 'prj_sorting', 'prj_task_users', 'prj_tasks', 'prj_statuslog', 'prj_session', 'prj_filters', 'prj_lockcontrol', 'prj_projPerms', 'prj_taskSemaphore', 'prj_config'), 'groups' => array('nexProject Admin'), 'features' => array('nexproject.admin'), 'php_blocks' => array('phpblock_projectFilter'), 'vars' => array());
    if (prj_forumExists()) {
        //using this row's config value, we'll delete all forums with this ID as the parent and then chuck out the category itself...
        $sql = "SELECT * FROM {$_TABLES['gf_forums']} where forum_cat={$_PRJCONF['forum_parent']}";
        $forumres = DB_query($sql);
        while ($X = DB_fetchArray($forumres)) {
            forum_deleteForum($X['forum_id']);
        }
        DB_query("DELETE FROM {$_TABLES['gf_categories']} where id={$_PRJCONF['forum_parent']}");
    }
    if (prj_nexFileExists()) {
        PLG_itemDeleted($_PRJCONF['nexfile_parent'], 'nexproject_filefolder');
    }
    DB_query("DELETE FROM {$_TABLES['nexlistitems']} WHERE lid={$_PRJCONF['nexlist_locations']}");
    DB_query("DELETE FROM {$_TABLES['nexlistfields']} WHERE lid={$_PRJCONF['nexlist_locations']}");
    DB_query("DELETE FROM {$_TABLES['nexlist']} WHERE id={$_PRJCONF['nexlist_locations']}");
    DB_query("DELETE FROM {$_TABLES['nexlistitems']} WHERE lid={$_PRJCONF['nexlist_departments']}");
    DB_query("DELETE FROM {$_TABLES['nexlistfields']} WHERE lid={$_PRJCONF['nexlist_departments']}");
    DB_query("DELETE FROM {$_TABLES['nexlist']} WHERE id={$_PRJCONF['nexlist_departments']}");
    DB_query("DELETE FROM {$_TABLES['nexlistitems']} WHERE lid={$_PRJCONF['nexlist_category']}");
    DB_query("DELETE FROM {$_TABLES['nexlistfields']} WHERE lid={$_PRJCONF['nexlist_category']}");
    DB_query("DELETE FROM {$_TABLES['nexlist']} WHERE id={$_PRJCONF['nexlist_category']}");
    DB_query("DELETE FROM {$_TABLES['nexlistitems']} WHERE lid={$_PRJCONF['nexlist_objective']}");
    DB_query("DELETE FROM {$_TABLES['nexlistfields']} WHERE lid={$_PRJCONF['nexlist_objective']}");
    DB_query("DELETE FROM {$_TABLES['nexlist']} WHERE id={$_PRJCONF['nexlist_objective']}");
    return $out;
}
예제 #2
0
function forum_mergeForum($id, $new_id)
{
    global $_TABLES;
    DB_query("UPDATE {$_TABLES['forum_topic']} SET forum='{$new_id}' WHERE forum='{$id}'");
    DB_query("UPDATE {$_TABLES['forum_watch']} SET forum_id='{$new_id}' WHERE forum_id='{$id}'");
    DB_query("UPDATE {$_TABLES['forum_log']} SET forum='{$new_id}' WHERE forum='{$id}'");
    // Resynch forum now
    gf_resyncforum($new_id);
    // Delete old forum now and any records we do not need
    forum_deleteForum($id);
    return true;
}
예제 #3
0
         $boards_addforum->set_var('LANG_hidepostsdscp', $LANG_GF93['hidepostsdscp']);
         $boards_addforum->set_var('groupname', $groupname);
         $boards_addforum->set_var('grouplist', $grouplist);
         $boards_addforum->set_var('attachmentgrouplist', $grouplist);
         $boards_addforum->set_var('LANG_CANCEL', $LANG_GF01['CANCEL']);
         $boards_addforum->set_var('LANG_SAVE', $LANG_GF01['SAVE']);
         $boards_addforum->parse('output', 'boards_addforum');
         echo $boards_addforum->finish($boards_addforum->get_var('output'));
         echo COM_endBlock();
         echo adminfooter();
         echo COM_siteFooter();
         exit;
     }
 } elseif ($mode == $LANG_GF01['DELETE']) {
     if ($confirm == 1) {
         forum_deleteForum($id);
         forum_statusMessage($LANG_GF93['forumdeleted'], $_CONF['site_admin_url'] . '/plugins/forum/boards.php', $LANG_GF93['forumdeleted']);
         echo COM_endBlock();
         echo adminfooter();
         echo COM_siteFooter();
         exit;
     } else {
         $boards_delforum = new Template($_CONF['path_layout'] . 'forum/layout/admin');
         $boards_delforum->set_file(array('boards_delforum' => 'boards_delete.thtml'));
         $boards_delforum->set_var('phpself', $_CONF['site_admin_url'] . '/plugins/forum/boards.php');
         $boards_delforum->set_var('deletenote1', sprintf($LANG_GF93['deleteforumnote1'], COM_applyFilter($_POST['forumname'])));
         $boards_delforum->set_var('deletenote2', $LANG_GF93['deleteforumnote2']);
         $boards_delforum->set_var('id', $id);
         $boards_delforum->set_var('type', 'forum');
         $boards_delforum->set_var('LANG_DELETE', $LANG_GF01['DELETE']);
         $boards_delforum->set_var('LANG_CANCEL', $LANG_GF01['CANCEL']);