<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.7 |
+ | CiviCRM version 5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2017 |
+ | Copyright CiviCRM LLC (c) 2004-2019 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2017
+ * @copyright CiviCRM LLC (c) 2004-2019
*/
/**
public function preProcess() {
parent::preProcess();
+ $mainPage = new CRM_Admin_Page_Extensions();
+ $localExtensionRows = $mainPage->formatLocalExtensionRows();
+ $this->assign('localExtensionRows', $localExtensionRows);
+
+ $remoteExtensionRows = $mainPage->formatRemoteExtensionRows($localExtensionRows);
+ $this->assign('remoteExtensionRows', $remoteExtensionRows);
+
$this->_key = CRM_Utils_Request::retrieve('key', 'String',
$this, FALSE, 0
);
- if (!CRM_Utils_Type::validate($this->_key, 'ExtensionKey')) {
+ if (!CRM_Utils_Type::validate($this->_key, 'ExtensionKey') && !empty($this->_key)) {
throw new CRM_Core_Exception('Extension Key does not match expected standard');
}
$session = CRM_Core_Session::singleton();
}
if ($this->_action & CRM_Core_Action::ADD) {
- CRM_Extension_System::singleton()->getManager()->install(array($this->_key));
+ civicrm_api3('Extension', 'install', array('keys' => $this->_key));
CRM_Core_Session::setStatus("", ts('Extension Installed'), "success");
}
if ($this->_action & CRM_Core_Action::ENABLE) {
- CRM_Extension_System::singleton()->getManager()->enable(array($this->_key));
+ civicrm_api3('Extension', 'enable', array('keys' => $this->_key));
CRM_Core_Session::setStatus("", ts('Extension Enabled'), "success");
}