/** * Function to for pre-processing * * @return None * @access public */ public function preProcess() { parent::preProcess(); require_once 'CRM/Utils/Request.php'; $this->_key = CRM_Utils_Request::retrieve('key', 'String', $this, false, 0); $session = CRM_Core_Session::singleton(); $url = CRM_Utils_System::url('civicrm/admin/extensions', 'reset=1&action=browse'); $session->pushUserContext($url); $this->assign('id', $this->_id); $this->assign('key', $this->_key); require_once "CRM/Core/Extensions.php"; $ext = new CRM_Core_Extensions(); $extension = $ext->getExtensionsByKey(TRUE); $this->assign('extension', get_object_vars($extension[$this->_key])); }
/** * Sets extension's record active or disabled. * * @access public * @param int $id id of option value record * @param boolean $is_active active state * @return mixed result of CRM_Core_DAO::setFieldValue */ public static function setIsActive($id, $is_active) { $extensions = new CRM_Core_Extensions(); $e = $extensions->getExtensionsByKey(); foreach ($e as $key => $eo) { if ($eo->id == $id) { $ext = $eo; } } $is_active ? $ext->enable() : $ext->disable(); return true; }