Exemple #1
0
/**
 * Implementation of hook_civicrm_enable
 */
function booking_civicrm_enable()
{
    // rebuild the menu so our path is picked up
    require_once 'CRM/Core/Invoke.php';
    CRM_Core_Invoke::rebuildMenuAndCaches();
    return _booking_civix_civicrm_enable();
}
function civicrm_invoke()
{
    civicrm_init();
    plugin_init();
    $user = JFactory::getUser();
    /* bypass synchronize if running upgrade
     * to avoid any serious non-recoverable error
     * which might hinder the upgrade process.
     */
    require_once 'CRM/Utils/Array.php';
    if (CRM_Utils_Array::value('task', $_REQUEST) != 'civicrm/upgrade') {
        require_once 'CRM/Core/BAO/UFMatch.php';
        CRM_Core_BAO_UFMatch::synchronize($user, FALSE, 'Joomla', 'Individual', TRUE);
    }
    require_once 'CRM/Utils/System/Joomla.php';
    CRM_Utils_System_Joomla::addHTMLHead(NULL, TRUE);
    if (isset($_GET['task'])) {
        $args = explode('/', trim($_GET['task']));
    } else {
        $_GET['task'] = 'civicrm/dashboard';
        $_GET['reset'] = 1;
        $args = array('civicrm', 'dashboard');
    }
    CRM_Core_Invoke::invoke($args);
}
function civicrm_invoke()
{
    civicrm_init();
    global $my;
    require_once 'CRM/Core/BAO/UFMatch.php';
    CRM_Core_BAO_UFMatch::synchronize($my, false, 'Mambo');
    $args = explode('/', trim($_GET['task']));
    CRM_Core_Invoke::invoke($args);
}
/**
 * Implementation of hook_civicrm_uninstall
 */
function eventcalendar_civicrm_uninstall()
{
    $cividiscountRoot = dirname(__FILE__) . DIRECTORY_SEPARATOR;
    $cividiscountSQL = $cividiscountRoot . DIRECTORY_SEPARATOR . 'uninstall.sql';
    CRM_Utils_File::sourceSQLFile(CIVICRM_DSN, $cividiscountSQL);
    // rebuild the menu so our path is picked up
    CRM_Core_Invoke::rebuildMenuAndCaches();
    //return _eventcalendar_civix_civicrm_uninstall();
}
 function postProcess()
 {
     $values = $this->exportValues();
     // process menu entry
     $old_menu_position = (int) CRM_Core_BAO_Setting::getItem('CiviBanking', 'menu_position');
     $new_menu_position = (int) $values['menu_position'];
     if ($old_menu_position != $new_menu_position) {
         CRM_Core_BAO_Setting::setItem($new_menu_position, 'CiviBanking', 'menu_position');
         CRM_Core_Invoke::rebuildMenuAndCaches();
     }
     parent::postProcess();
 }
/**
 * Implementation of hook_civicrm_install
 */
function civigiftaid_civicrm_install()
{
    require_once 'CRM/Utils/Migrate/Import.php';
    $import = new CRM_Utils_Migrate_Import();
    $extRoot = dirname(__FILE__) . DIRECTORY_SEPARATOR;
    $op = $extRoot . 'xml' . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'CustomGroupData.xml';
    $import->run($op);
    // rebuild the menu so our path is picked up
    require_once 'CRM/Core/Invoke.php';
    CRM_Core_Invoke::rebuildMenuAndCaches();
    return _civigiftaid_civix_civicrm_install();
}
 /**
  * Example: Run a simple query when a module is disabled.
  */
 public function disable()
 {
     //~ CRM_Core_DAO::executeQuery('UPDATE foo SET is_active = 0 WHERE bar = "whiz"');
     $this->executeSqlFile('sql/disable.sql');
     CRM_Core_Invoke::rebuildMenuAndCaches();
     try {
         $dashlet = civicrm_api3('Dashboard', 'get', array('name' => 'eventcalendardashlet'));
         if (!empty($dashlet['id'])) {
             civicrm_api3('Dashboard', 'create', array('id' => $dashlet['id'], 'is_active' => 0));
         }
     } catch (Exception $e) {
         die(__METHOD__ . ' error: ' . $e->getMessage());
     }
 }
 function postProcess()
 {
     $values = $this->exportValues();
     // process menu entry
     $old_menu_position = (int) CRM_Core_BAO_Setting::getItem('CiviBanking', 'menu_position');
     $new_menu_position = (int) $values['menu_position'];
     if ($old_menu_position != $new_menu_position) {
         CRM_Core_BAO_Setting::setItem($new_menu_position, 'CiviBanking', 'menu_position');
         CRM_Core_Invoke::rebuildMenuAndCaches();
     }
     // process reference normalisation / validation
     CRM_Core_BAO_Setting::setItem(!empty($values['reference_normalisation']), 'CiviBanking', 'reference_normalisation');
     CRM_Core_BAO_Setting::setItem(!empty($values['reference_validation']), 'CiviBanking', 'reference_validation');
     parent::postProcess();
 }
/**
 * Upgrade an extension - runs upgrade_N hooks and system.flush.
 *
 * @return array
 *   API result
 */
function civicrm_api3_extension_upgrade()
{
    CRM_Core_Invoke::rebuildMenuAndCaches(TRUE);
    $queue = CRM_Extension_Upgrades::createQueue();
    $runner = new CRM_Queue_Runner(array('title' => 'Extension Upgrades', 'queue' => $queue, 'errorMode' => CRM_Queue_Runner::ERROR_ABORT));
    try {
        $result = $runner->runAll();
    } catch (CRM_Extension_Exception $e) {
        return civicrm_api3_create_error($e->getMessage());
    }
    if ($result === TRUE) {
        return civicrm_api3_create_success();
    } else {
        return $result;
    }
}
Exemple #10
0
function civicrm_invoke()
{
    civicrm_init();
    plugin_init();
    $user = JFactory::getUser();
    require_once 'CRM/Core/BAO/UFMatch.php';
    CRM_Core_BAO_UFMatch::synchronize($user, false, 'Joomla', 'Individual');
    if (isset($_GET['task'])) {
        $args = explode('/', trim($_GET['task']));
        CRM_Core_Invoke::invoke($args);
    } else {
        $_GET['task'] = 'civicrm/dashboard';
        $_GET['reset'] = 1;
        $args = array('civicrm', 'dashboard');
        CRM_Core_Invoke::invoke($args);
    }
}
Exemple #11
0
function civicrm_invoke()
{
    civicrm_init();
    // check and ensure that we have a valid session
    if (!empty($_POST)) {
        // the session should not be empty
        // however for standalone forms, it will not have any CiviCRM variables in the
        // session either, so dont check for it
        if (count($_SESSION) <= 1) {
            require_once 'CRM/Utils/System.php';
            $config =& CRM_Core_Config::singleton();
            CRM_Utils_System::redirect($config->userFrameworkBaseURL);
        }
    }
    // add all the values from the itemId param
    // overrride the GET values if conflict
    if (CRM_Utils_Array::value('Itemid', $_GET)) {
        $component =& JComponentHelper::getComponent('com_civicrm');
        $menu =& JSite::getMenu();
        $item = $menu->getItems('componentid', $component->id, true);
        $params = $menu->getParams($_GET['Itemid']);
        $args = array('task', 'id', 'gid', 'reset', 'pageId', 'action');
        foreach ($args as $a) {
            $val = $params->get($a, null);
            if ($val !== null) {
                $_GET[$a] = $val;
            }
        }
    }
    $task = CRM_Utils_Array::value('task', $_GET, '');
    $args = explode('/', trim($task));
    // check permission
    if (!civicrm_check_permission($args)) {
        echo "You do not have permission to execute this url.";
        return;
    }
    require_once 'CRM/Utils/System/Joomla.php';
    CRM_Utils_System_Joomla::addHTMLHead(null, true);
    $user = JFactory::getUser();
    require_once 'CRM/Core/BAO/UFMatch.php';
    CRM_Core_BAO_UFMatch::synchronize($user, false, 'Joomla', 'Individual');
    CRM_Core_Invoke::invoke($args);
}
function civicrm_invoke()
{
    civicrm_init();
    // check and ensure that we have a valid session
    if (!empty($_POST)) {
        // the session should not be empty
        // however for standalone forms, it will not have any CiviCRM variables in the
        // session either, so dont check for it
        if (count($_SESSION) <= 1) {
            require_once 'CRM/Utils/System.php';
            $config = CRM_Core_Config::singleton();
            CRM_Utils_System::redirect($config->userFrameworkBaseURL);
        }
    }
    // add all the values from the itemId param
    // overrride the GET values if conflict
    if (CRM_Utils_Array::value('Itemid', $_GET)) {
        $component = JComponentHelper::getComponent('com_civicrm');
        $menu = JSite::getMenu();
        $params = $menu->getParams($_GET['Itemid']);
        $args = array('task', 'id', 'gid', 'pageId', 'action', 'csid');
        $view = CRM_Utils_Array::value('view', $_GET);
        if ($view) {
            $args[] = 'reset';
        }
        foreach ($args as $a) {
            $val = $params->get($a, NULL);
            if ($val !== NULL && $view) {
                $_GET[$a] = $val;
            }
        }
    }
    $task = CRM_Utils_Array::value('task', $_GET, '');
    $args = explode('/', trim($task));
    require_once 'CRM/Utils/System/Joomla.php';
    CRM_Utils_System_Joomla::addHTMLHead(NULL, TRUE);
    $user = JFactory::getUser();
    require_once 'CRM/Core/BAO/UFMatch.php';
    CRM_Core_BAO_UFMatch::synchronize($user, FALSE, 'Joomla', 'Individual', TRUE);
    CRM_Core_Invoke::invoke($args);
}
Exemple #13
0
function invoke()
{
    $session =& CRM_Core_Session::singleton();
    $config =& CRM_Core_Config::singleton();
    // display error if any
    showError($session);
    $urlVar = $config->userFrameworkURLVar;
    require_once 'CRM/Core/Invoke.php';
    if ($session->get('userID') == null || $session->get('userID') == '') {
        if ($_GET[$urlVar] == "") {
            require_once "CRM/Core/BAO/UFMatch.php";
            if (CRM_Core_BAO_UFMatch::isEmptyTable() == false) {
                include 'login.html';
            } else {
                $session->set('new_install', true);
                include 'new_install.html';
            }
            exit(1);
        } else {
            $str = '';
            if ($session->get('new_install') !== true && $_GET[$urlVar] !== "civicrm/standalone/register") {
                $str = "<a href=\"{$config->userFrameworkBaseURL}\">Login here</a> if you have an account.\n";
            } elseif ($_GET[$urlVar] == "civicrm/standalone/register" && isset($_GET['reset'])) {
                // this is when user first registers with civicrm
                print "<head><style type=\"text/css\"> body {border: 1px #CCC solid;margin: 3em;padding: 1em 1em 1em 2em;} </style></head>\n";
            }
            print $str . CRM_Core_Invoke::invoke(explode('/', $_GET[$urlVar]));
        }
    } else {
        if ($_GET[$urlVar] == "") {
            print CRM_Core_Invoke::invoke(array("civicrm", "dashboard"));
        } else {
            print CRM_Core_Invoke::invoke(explode('/', $_GET[$urlVar]));
        }
    }
}
Exemple #14
0
 function main(&$args)
 {
     if ($args[1] !== 'contribute') {
         return;
     }
     $session =& CRM_Core_Session::singleton();
     $config =& CRM_Core_Config::singleton();
     if ($args[2] == 'transact') {
         if ($config->enableSSL && CRM_Core_Invoke::onlySSL($args)) {
             if (!isset($_SERVER['HTTPS'])) {
                 CRM_Utils_System::redirect('https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
             } else {
                 CRM_Utils_System::mapConfigToSSL();
             }
         }
         require_once 'CRM/Contribute/Controller/Contribution.php';
         $controller =& new CRM_Contribute_Controller_Contribution($title, $mode);
         return $controller->run();
     } elseif ($args[2] == 'search') {
         require_once 'CRM/Contribute/Controller/Search.php';
         $controller =& new CRM_Contribute_Controller_Search($title, $mode);
         $url = 'civicrm/contribute/search';
         $session->pushUserContext(CRM_Utils_System::url($url, 'force=1'));
         $controller->set('context', 'search');
         return $controller->run();
     } elseif ($args[2] == 'import') {
         require_once 'CRM/Contribute/Import/Controller.php';
         $controller =& new CRM_Contribute_Import_Controller(ts('Import Contributions'));
         return $controller->run();
     } else {
         if ($args[2] == 'add') {
             $session =& CRM_Core_Session::singleton();
             $session->pushUserContext(CRM_Utils_System::url('civicrm/contribute', 'action=browse&reset=1'));
             require_once 'CRM/Contribute/Controller/ContributionPage.php';
             $controller =& new CRM_Contribute_Controller_ContributionPage();
             return $controller->run();
         } else {
             if ($args[2] == 'contribution') {
                 require_once 'CRM/Contribute/Page/Contribution.php';
                 $page =& new CRM_Contribute_Page_Contribution();
                 return $page->run();
             } else {
                 require_once 'CRM/Contribute/Page/DashBoard.php';
                 $view =& new CRM_Contribute_Page_DashBoard(ts('DashBoard'));
                 return $view->run();
             }
         }
     }
 }
/**
 * Flush all system caches
 *
 * @param  array   	  $params input parameters
 *                          - triggers: bool, whether to drop/create SQL triggers; default: FALSE
 *                          - session:  bool, whether to reset the CiviCRM session data; defaul: FALSE
 *
 * @return boolean        true if success, else false
 * @static void
 * @access public
 * @example SystemFlush.php
 *
 */
function civicrm_api3_system_flush($params)
{
    CRM_Core_Invoke::rebuildMenuAndCaches(CRM_Utils_Array::value('triggers', $params, FALSE), CRM_Utils_Array::value('session', $params, FALSE));
    return civicrm_api3_create_success();
}
 /**
  * Perform the actual rebuild
  */
 public function doCivicrmRebuild()
 {
     // dump($this, 'doCivicrmRebuild');
     $this->bootstrap();
     CRM_Core_Invoke::rebuildMenuAndCaches(TRUE);
 }
Exemple #17
0
 /**
  * Process the form submission.
  *
  * @return void
  */
 public function postProcess()
 {
     $params = $this->controller->exportValues($this->_name);
     $permissionsArray = self::getPermissionArray();
     // Function to get Wordpress roles
     global $wp_roles;
     if (!isset($wp_roles)) {
         $wp_roles = new WP_Roles();
     }
     foreach ($wp_roles->role_names as $role => $name) {
         $roleObj = $wp_roles->get_role($role);
         //Remove all civicrm capabilities for the role, as there may be some capabilities checkbox unticked
         foreach ($permissionsArray as $key => $capability) {
             $roleObj->remove_cap($key);
         }
         //Add the selected wordpress capabilities for the role
         $rolePermissions = $params[$role];
         if (!empty($rolePermissions)) {
             foreach ($rolePermissions as $key => $capability) {
                 $roleObj->add_cap($key);
             }
         }
         if ($role == 'anonymous_user') {
             // Get the permissions into a format that matches what we get from WP
             $allWarningPermissions = CRM_Core_Permission::getAnonymousPermissionsWarnings();
             foreach ($allWarningPermissions as $key => $permission) {
                 $allWarningPermissions[$key] = CRM_utils_String::munge(strtolower($permission));
             }
             $warningPermissions = array_intersect($allWarningPermissions, array_keys($rolePermissions));
             $warningPermissionNames = array();
             foreach ($warningPermissions as $permission) {
                 $warningPermissionNames[$permission] = $permissionsArray[$permission];
             }
             if (!empty($warningPermissionNames)) {
                 CRM_Core_Session::setStatus(ts('The %1 role was assigned one or more permissions that may prove dangerous for users of that role to have. Please reconsider assigning %2 to them.', array(1 => $wp_roles->role_names[$role], 2 => implode(', ', $warningPermissionNames))), ts('Unsafe Permission Settings'));
             }
         }
     }
     // FIXME
     // Changed the 'access_civicrm_nav_link' capability in civicrm.php file
     // But for some reason, if i remove 'Access CiviCRM' administrator and save, it is showing
     // 'You do not have sufficient permissions to access this page'
     // which should not happen for Super Admin and Administrators, as checking permissions for Super
     // Admin and Administrators always gives TRUE
     wp_civicrm_capability();
     CRM_Core_Session::setStatus("", ts('Wordpress Access Control Updated'), "success");
     // rebuild the menus to comply with the new permisssions/capabilites
     CRM_Core_Invoke::rebuildMenuAndCaches();
     CRM_Utils_System::redirect('admin.php?page=CiviCRM&q=civicrm/admin/access&reset=1');
     CRM_Utils_System::civiExit();
 }
 /**
  * Function to process the form
  *
  * @access public
  * @return void
  */
 public function postProcess()
 {
     $params = $this->controller->exportValues($this->_name);
     $permissionsArray = self::getPermissionArray();
     // Function to get Wordpress roles
     global $wp_roles;
     if (!isset($wp_roles)) {
         $wp_roles = new WP_Roles();
     }
     foreach ($wp_roles->role_names as $role => $name) {
         $roleObj = $wp_roles->get_role($role);
         //Remove all civicrm capabilities for the role, as there may be some capabilities checkbox unticked
         foreach ($permissionsArray as $key => $capability) {
             $roleObj->remove_cap($key);
         }
         //Add the selected wordpress capabilities for the role
         $rolePermissions = $params[$role];
         if (!empty($rolePermissions)) {
             foreach ($rolePermissions as $key => $capability) {
                 $roleObj->add_cap($key);
             }
         }
     }
     // FIXME
     // Changed the 'access_civicrm_nav_link' capability in civicrm.php file
     // But for some reason, if i remove 'Access CiviCRM' administrator and save, it is showing
     // 'You do not have sufficient permissions to access this page'
     // which should not happen for Super Admin and Administrators, as checking permissions for Super
     // Admin and Administrators always gives TRUE
     wp_civicrm_capability();
     CRM_Core_Session::setStatus("", ts('Wordpress Access Control Updated'), "success");
     // rebuild the menus to comply with the new permisssions/capabilites
     CRM_Core_Invoke::rebuildMenuAndCaches();
     CRM_Utils_System::redirect('admin.php?page=CiviCRM&q=civicrm/admin/access&reset=1');
     CRM_Utils_System::civiExit();
 }
Exemple #19
0
 /**
  * This function contains the actions for group arguments
  *
  * @params $args array this array contains the arguments of the url 
  *
  * @static
  * @access public
  */
 function group($args)
 {
     if ($args[1] !== 'group') {
         return;
     }
     switch (CRM_Utils_Array::value(2, $args)) {
         case 'add':
             require_once 'CRM/Group/Controller.php';
             $controller =& new CRM_Group_Controller(ts('Groups'), CRM_CORE_ACTION_ADD);
             $session =& CRM_Core_Session::singleton();
             $session->pushUserContext(CRM_Utils_System::url('civicrm/group', 'reset=1'));
             return $controller->run();
         case 'search':
             return CRM_Core_Invoke::search($args);
         default:
             require_once 'CRM/Group/Page/Group.php';
             $view =& new CRM_Group_Page_Group(ts('View Groups'));
             return $view->run();
     }
 }
Exemple #20
0
 public function upgrade_1400()
 {
     $this->ctx->log->info('Applying update 1400');
     $i = 3;
     foreach (array('Joining', 'Probation') as $caseName) {
         CRM_Core_DAO::executeQuery("UPDATE civicrm_case_type SET weight = {$i} WHERE name = '{$caseName}'");
         $i++;
     }
     CRM_Core_DAO::executeQuery("UPDATE civicrm_case_type SET weight = 6 WHERE name = 'Exiting'");
     $this->executeSqlFile('sql/activities_install.sql');
     require_once 'hrcase.php';
     $scheduleActions = hrcase_getActionsSchedule();
     foreach ($scheduleActions as $actionName => $scheduleAction) {
         $result = civicrm_api3('action_schedule', 'get', array('name' => $actionName));
         if (empty($result['id'])) {
             $result = civicrm_api3('action_schedule', 'create', $scheduleAction);
         }
     }
     $existingCaseType = array('Appraisal');
     $this->manageCaseTypes($existingCaseType);
     CRM_Core_Invoke::rebuildMenuAndCaches(TRUE);
     //update query to replace Case with Assignment
     $optionGroupID = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', 'activity_type', 'id', 'name');
     $sql = "UPDATE civicrm_option_value SET label= replace(label,'Case','Assignment') WHERE label like '%Case%' and option_group_id={$optionGroupID} and label <> 'Open Case'";
     CRM_Core_DAO::executeQuery($sql);
     $sql = "UPDATE civicrm_option_value SET label= replace(label,'Open Case','Created New Assignment') WHERE label like '%Case%' and option_group_id={$optionGroupID}";
     CRM_Core_DAO::executeQuery($sql);
     return TRUE;
 }
 public function disable()
 {
     if ($this->type == 'payment' && $this->status != 'missing') {
         $this->_runPaymentHook('disable');
     }
     $this->_setActiveByType(0);
     CRM_Core_DAO::setFieldValue('CRM_Core_DAO_Extension', $this->id, 'is_active', 0);
     CRM_Core_Invoke::rebuildMenuAndCaches(TRUE);
 }
 /**
  * @description: invoke CiviCRM in a WordPress context
  * Callback function from add_menu_page()
  * Callback from WordPress 'init' and 'the_content' hooks
  * Also called by add_shortcode_includes() and _civicrm_update_user()
  */
 public function invoke()
 {
     static $alreadyInvoked = FALSE;
     if ($alreadyInvoked) {
         return;
     }
     if (!$this->initialize()) {
         return '';
     }
     // CRM-12523
     // WordPress has it's own timezone calculations
     // Civi relies on the php default timezone which WP
     // overrides with UTC in wp-settings.php
     $wpBaseTimezone = date_default_timezone_get();
     $wpUserTimezone = get_option('timezone_string');
     if ($wpUserTimezone) {
         date_default_timezone_set($wpUserTimezone);
         CRM_Core_Config::singleton()->userSystem->setMySQLTimeZone();
     }
     // Add our standard css & js
     CRM_Core_Resources::singleton()->addCoreResources();
     // CRM-95XX
     // At this point we are calling a civicrm function
     // Since WP messes up and always quotes the request, we need to reverse
     // what it just did
     $this->remove_wp_magic_quotes();
     if (isset($_GET['q'])) {
         $args = explode('/', trim($_GET['q']));
     } else {
         $_GET['q'] = 'civicrm/dashboard';
         $_GET['reset'] = 1;
         $args = array('civicrm', 'dashboard');
     }
     global $current_user;
     get_currentuserinfo();
     /*
      * bypass synchronize if running upgrade
      * to avoid any serious non-recoverable error
      * which might hinder the upgrade process.
      */
     if (CRM_Utils_Array::value('q', $_GET) != 'civicrm/upgrade') {
         require_once 'CRM/Core/BAO/UFMatch.php';
         CRM_Core_BAO_UFMatch::synchronize($current_user, FALSE, 'WordPress', 'Individual', TRUE);
     }
     if ($this->isPageRequest() && !in_the_loop() && !is_admin()) {
         return;
     }
     $alreadyInvoked = TRUE;
     // do the business
     CRM_Core_Invoke::invoke($args);
     // restore WP's timezone
     if ($wpBaseTimezone) {
         date_default_timezone_set($wpBaseTimezone);
     }
     // notify plugins
     do_action('civicrm_invoked');
 }
Exemple #23
0
 /**
  * Remove all database references to an extension.
  *
  * Add records of the extension to the database -- and enable it
  *
  * @param array $keys
  *   List of extension keys.
  * @throws CRM_Extension_Exception
  */
 public function uninstall($keys)
 {
     $origStatuses = $this->getStatuses();
     // TODO: to mitigate the risk of crashing during installation, scan
     // keys/statuses/types before doing anything
     foreach ($keys as $key) {
         switch ($origStatuses[$key]) {
             case self::STATUS_INSTALLED:
             case self::STATUS_INSTALLED_MISSING:
                 throw new CRM_Extension_Exception("Cannot uninstall extension; disable it first: {$key}");
             case self::STATUS_DISABLED:
                 list($info, $typeManager) = $this->_getInfoTypeHandler($key);
                 // throws Exception
                 $typeManager->onPreUninstall($info);
                 $this->_removeExtensionEntry($info);
                 $typeManager->onPostUninstall($info);
                 break;
             case self::STATUS_DISABLED_MISSING:
                 list($info, $typeManager) = $this->_getMissingInfoTypeHandler($key);
                 // throws Exception
                 $typeManager->onPreUninstall($info);
                 $this->_removeExtensionEntry($info);
                 $typeManager->onPostUninstall($info);
                 break;
             case self::STATUS_UNINSTALLED:
                 // ok, nothing to do
                 break;
             case self::STATUS_UNKNOWN:
             default:
                 throw new CRM_Extension_Exception("Cannot disable unknown extension: {$key}");
         }
     }
     $this->statuses = NULL;
     $this->mapper->refresh();
     CRM_Core_Invoke::rebuildMenuAndCaches(TRUE);
 }
 /**
  * Invoke CiviCRM in a WordPress context
  * Callback function from add_menu_page()
  * Callback from WordPress 'init' and 'the_content' hooks
  * Also called by shortcode_render() and _civicrm_update_user()
  *
  * @return void
  */
 public function invoke()
 {
     static $alreadyInvoked = FALSE;
     if ($alreadyInvoked) {
         return;
     }
     // bail if this is called via a content-preprocessing plugin
     if ($this->is_page_request() && !in_the_loop() && !is_admin()) {
         return;
     }
     if (!$this->initialize()) {
         return;
     }
     // CRM-12523
     // WordPress has it's own timezone calculations
     // Civi relies on the php default timezone which WP
     // overrides with UTC in wp-settings.php
     $wpBaseTimezone = date_default_timezone_get();
     $wpUserTimezone = get_option('timezone_string');
     if ($wpUserTimezone) {
         date_default_timezone_set($wpUserTimezone);
         CRM_Core_Config::singleton()->userSystem->setMySQLTimeZone();
     }
     // CRM-95XX
     // At this point we are calling a CiviCRM function
     // WP always quotes the request, CiviCRM needs to reverse what it just did
     $this->remove_wp_magic_quotes();
     // Code inside invoke() requires the current user to be set up
     $current_user = wp_get_current_user();
     /**
      * Bypass synchronize if running upgrade to avoid any serious non-recoverable
      * error which might hinder the upgrade process.
      */
     if (CRM_Utils_Array::value('q', $_GET) != 'civicrm/upgrade') {
         $this->users->sync_user($current_user);
     }
     // set flag
     $alreadyInvoked = TRUE;
     // get args
     $argdata = $this->get_request_args();
     // set dashboard as default if args are empty
     if (!isset($_GET['q'])) {
         $_GET['q'] = 'civicrm/dashboard';
         $_GET['reset'] = 1;
         $argdata['args'] = array('civicrm', 'dashboard');
     }
     // do the business
     CRM_Core_Invoke::invoke($argdata['args']);
     // restore WP's timezone
     if ($wpBaseTimezone) {
         date_default_timezone_set($wpBaseTimezone);
     }
     // restore WP's arrays
     $this->restore_wp_magic_quotes();
     // notify plugins
     do_action('civicrm_invoked');
 }