Commit c74a6c8f authored by AllenShaw's avatar AllenShaw

Fix CRM-19408: Create extension.getremote API

parent 56e22db0
......@@ -341,6 +341,27 @@ function civicrm_api3_extension_get($params) {
return _civicrm_api3_basic_array_get('Extension', $params, $result, 'id', array('id', 'key', 'status'));
}
/**
* Get a list of remotely available extensions.
*
* @param array $params
*
* @return array
* API result
*/
function civicrm_api3_extension_getremote($params) {
$extensions = CRM_Extension_System::singleton()->getBrowser()->getExtensions();
$result = array();
$id = 0;
foreach ($extensions as $key => $obj) {
$info = array();
$info['id'] = $id++; // backward compatibility with indexing scheme
$info = array_merge($info, (array) $obj);
$result[] = $info;
}
return _civicrm_api3_basic_array_get('Extension', $params, $result, 'id', CRM_Utils_Array::value('return', $params, array()));
}
/**
* Determine the list of extension keys.
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment