function ougc_pages_uninstall() { global $db, $PL, $cache; ougc_pages_pl_check(); // Drop DB entries $db->drop_table('ougc_pages'); $db->drop_table('ougc_pages_categories'); $PL->cache_delete('ougc_pages'); $PL->settings_delete('ougc_pages'); $PL->templates_delete('ougcpages'); // Delete version from cache $plugins = (array) $cache->read('ougc_plugins'); if (isset($plugins['pages'])) { unset($plugins['pages']); } if (!empty($plugins)) { $cache->update('ougc_plugins', $plugins); } else { $PL->cache_delete('ougc_plugins'); } // Remove administrator permissions change_admin_permission('config', 'ougc_pages', -1); }
it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. ****************************************************************************/ // Die if IN_MYBB is not defined, for security reasons. defined('IN_MYBB') or die('Direct initialization of this file is not allowed.'); // Check requirements ougc_pages_pl_check(); // Set url to use $ougc_pages->set_url('index.php?module=config-ougc_pages'); $ougc_pages->lang_load(); $sub_tabs['ougc_pages_cat_view'] = array('title' => $lang->ougc_pages_tab_cat, 'link' => $ougc_pages->build_url(array('action' => 'categories')), 'description' => $lang->ougc_pages_tab_cat_desc); if ($mybb->get_input('manage') != 'pages') { $sub_tabs['ougc_pages_cat_add'] = array('title' => $lang->ougc_pages_tab_cat_add, 'link' => $ougc_pages->build_url(array('action' => 'add')), 'description' => $lang->ougc_pages_tab_cat_add_desc); } if ($mybb->get_input('action') == 'edit' && $mybb->get_input('manage') != 'pages') { $sub_tabs['ougc_pages_edit'] = array('title' => $lang->ougc_pages_tab_edit_cat, 'link' => $ougc_pages->build_url(array('action' => 'edit', 'cid' => $mybb->get_input('cid', 1))), 'description' => $lang->ougc_pages_tab_edit_cat_desc); } $page->add_breadcrumb_item($lang->ougc_pages_manage, $ougc_pages->build_url()); if ($mybb->get_input('manage') == 'pages') { if (!($category = $ougc_pages->get_category($mybb->get_input('cid', 1)))) { $ougc_pages->redirect($lang->ougc_pages_error_invalidcategory, true); }