Esempio n. 1
0
/**
 * Deactivates the plugin.
 *
 */
function accountswitcher_deactivate()
{
    global $db, $cache;
    // Undo template edits
    accountswitcher_revert_template_edits();
    // Delete master templates for upgrade
    $db->delete_query("templategroups", "prefix = 'accountswitcher'");
    $db->delete_query("templates", "title LIKE 'accountswitcher_%' AND sid='-2'");
    // Delete deprecated templates
    $db->delete_query("templates", "`title` = 'as_usercp_nav'");
    $db->delete_query("templates", "`title` = 'as_usercp'");
    $db->delete_query("templates", "`title` = 'as_usercp_users'");
    $db->delete_query("templates", "`title` = 'as_usercp_userbit'");
    $db->delete_query("templates", "`title` = 'as_usercp_options'");
    $db->delete_query("templates", "`title` = 'as_header'");
    $db->delete_query("templates", "`title` = 'as_header_dropdown'");
    $db->delete_query("templates", "`title` = 'global_pm_switch_alert'");
    $db->delete_query("templates", "`title` = 'as_acclist_link'");
    // Clear cache
    $cache->update('accountswitcher', false);
    $cache->update('accountswitcher_fields', false);
}
Esempio n. 2
0
/**
 * Applies the template edits to added/imported themes.
 *
 */
function accountswitcher_new_themes()
{
    accountswitcher_revert_template_edits();
    accountswitcher_apply_template_edits();
}