send the current owncloud version to the ocs server so that we can filter for compatible apps
This commit is contained in:
parent
6f8efcfe61
commit
72e80bf6bd
|
@ -88,7 +88,7 @@ class OC_OCSClient{
|
||||||
*
|
*
|
||||||
* This function returns a list of all the applications on the OCS server
|
* This function returns a list of all the applications on the OCS server
|
||||||
*/
|
*/
|
||||||
public static function getApplications($categories,$page){
|
public static function getApplications($categories,$page,$filter){
|
||||||
if(OC_Config::getValue('appstoreenabled', true)==false){
|
if(OC_Config::getValue('appstoreenabled', true)==false){
|
||||||
return(array());
|
return(array());
|
||||||
}
|
}
|
||||||
|
@ -98,7 +98,10 @@ class OC_OCSClient{
|
||||||
}else{
|
}else{
|
||||||
$categoriesstring=$categories;
|
$categoriesstring=$categories;
|
||||||
}
|
}
|
||||||
$url=OC_OCSClient::getAppStoreURL().'/content/data?categories='.urlencode($categoriesstring).'&sortmode=new&page='.urlencode($page).'&pagesize=100';
|
|
||||||
|
$version='&version='.implode('x',\OC_Util::getVersion());
|
||||||
|
$filterurl='&filter='.urlencode($filter);
|
||||||
|
$url=OC_OCSClient::getAppStoreURL().'/content/data?categories='.urlencode($categoriesstring).'&sortmode=new&page='.urlencode($page).'&pagesize=100'.$filterurl.$version;
|
||||||
$apps=array();
|
$apps=array();
|
||||||
$xml=@file_get_contents($url);
|
$xml=@file_get_contents($url);
|
||||||
if($xml==FALSE){
|
if($xml==FALSE){
|
||||||
|
|
|
@ -30,7 +30,8 @@ $catagoryNames=OC_OCSClient::getCategories();
|
||||||
if(is_array($catagoryNames)){
|
if(is_array($catagoryNames)){
|
||||||
$categories=array_keys($catagoryNames);
|
$categories=array_keys($catagoryNames);
|
||||||
$page=0;
|
$page=0;
|
||||||
$externalApps=OC_OCSClient::getApplications($categories,$page);
|
$filter='approved';
|
||||||
|
$externalApps=OC_OCSClient::getApplications($categories,$page,$filter);
|
||||||
foreach($externalApps as $app){
|
foreach($externalApps as $app){
|
||||||
// show only external apps that aren't enabled yet
|
// show only external apps that aren't enabled yet
|
||||||
$local=false;
|
$local=false;
|
||||||
|
|
Loading…
Reference in New Issue