diff options
Diffstat (limited to 'lib/private/ocsclient.php')
-rw-r--r-- | lib/private/ocsclient.php | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/lib/private/ocsclient.php b/lib/private/ocsclient.php index dc147dea0c9..5c3ff0b3961 100644 --- a/lib/private/ocsclient.php +++ b/lib/private/ocsclient.php @@ -67,12 +67,15 @@ class OC_OCSClient{ * @return array|null an array of category ids or null * @note returns NULL if config value appstoreenabled is set to false * This function returns a list of all the application categories on the OCS server + * + * @param array $targetVersion The target ownCloud version */ - public static function getCategories() { + public static function getCategories(array $targetVersion) { if(!self::isAppstoreEnabled()) { return null; } $url=OC_OCSClient::getAppStoreURL().'/content/categories'; + $url .= '?version='.implode('x', $targetVersion); $xml=OC_OCSClient::getOCSresponse($url); if($xml==false) { return null; @@ -103,8 +106,9 @@ class OC_OCSClient{ * @param array|string $categories * @param int $page * @param string $filter + * @param array $targetVersion The target ownCloud version */ - public static function getApplications($categories, $page, $filter) { + public static function getApplications($categories, $page, $filter, array $targetVersion) { if(!self::isAppstoreEnabled()) { return(array()); } @@ -115,7 +119,7 @@ class OC_OCSClient{ $categoriesstring=$categories; } - $version='&version='.implode('x', \OC_Util::getVersion()); + $version='&version='.implode('x', $targetVersion); $filterurl='&filter='.urlencode($filter); $url=OC_OCSClient::getAppStoreURL().'/content/data?categories='.urlencode($categoriesstring) .'&sortmode=new&page='.urlencode($page).'&pagesize=100'.$filterurl.$version; @@ -155,15 +159,17 @@ class OC_OCSClient{ /** * Get an the applications from the OCS server * @param string $id + * @param array $targetVersion The target ownCloud version * @return array|null an array of application data or null * * This function returns an applications from the OCS server */ - public static function getApplication($id) { + public static function getApplication($id, array $targetVersion) { if(!self::isAppstoreEnabled()) { return null; } $url=OC_OCSClient::getAppStoreURL().'/content/data/'.urlencode($id); + $url .= '?version='.implode('x', $targetVersion); $xml=OC_OCSClient::getOCSresponse($url); if($xml==false) { @@ -206,12 +212,14 @@ class OC_OCSClient{ * This function returns an download url for an applications from the OCS server * @param string $id * @param integer $item + * @param array $targetVersion The target ownCloud version */ - public static function getApplicationDownload($id, $item) { + public static function getApplicationDownload($id, $item, array $targetVersion) { if(!self::isAppstoreEnabled()) { return null; } $url=OC_OCSClient::getAppStoreURL().'/content/download/'.urlencode($id).'/'.urlencode($item); + $url .= '?version='.implode('x', $targetVersion); $xml=OC_OCSClient::getOCSresponse($url); if($xml==false) { |