diff --git a/PluginMarket.class.php b/PluginMarket.class.php index 54ce52a8ecadf3453028e9095e6dfdc83b57df3b..fa1354a89425b8f9fcc9ead06357c3e687d81556 100644 --- a/PluginMarket.class.php +++ b/PluginMarket.class.php @@ -5,6 +5,17 @@ class PluginMarket extends StudIPPlugin implements SystemPlugin, HomepagePlugin { static protected $studip_domain = null; + static public function getStudipReleases() + { + return array( + '1.4', '1.5', '1.6', '1.7', '1.8', + '1.9', '1.10', '1.11', + '2.0', '2.1', '2.2', '2.3', '2.4', + '2.5', + '3.0', '3.1', '3.2' + ); + } + public function __construct() { parent::__construct(); diff --git a/classes/MarketRelease.class.php b/classes/MarketRelease.class.php index 4d9bb398928bac4f8faa7b5d5194915b7639eaec..47509442ef6d6da72029b0d315212e385ae6cc1d 100644 --- a/classes/MarketRelease.class.php +++ b/classes/MarketRelease.class.php @@ -119,6 +119,10 @@ class MarketRelease extends SimpleORMap { } $this['studip_min_version'] = $manifest['studipMinVersion']; $this['studip_max_version'] = $manifest['studipMaxVersion']; + if (!$this['studip_max_version']) { + $versions = PluginMarket::getStudipReleases(); + $this['studip_max_version'] = array_pop($versions).".99"; + } $this['version'] = $manifest['version']; if ($this['repository_overwrites_descriptionfrom']) { $readme = ""; diff --git a/controllers/market_controller.php b/controllers/market_controller.php index 758157c6d3733bba7ea8f053fa792619fffae2db..3ca1f13fadc949103a5f7fd988791514b201011c 100644 --- a/controllers/market_controller.php +++ b/controllers/market_controller.php @@ -3,6 +3,7 @@ require_once 'app/controllers/plugin_controller.php'; class MarketController extends PluginController { + public function absolute_url_for($to) { $old_base = URLHelper::setBaseURL($GLOBALS['ABSOLUTE_URI_STUDIP']); diff --git a/controllers/presenting.php b/controllers/presenting.php index 4cf17d6063a10f688b56f6b22666d5f666dd06dc..b40021412771a92575e2a7a0a47c92500ad08d8d 100644 --- a/controllers/presenting.php +++ b/controllers/presenting.php @@ -69,10 +69,9 @@ class PresentingController extends MarketController // Create options for all studip versions $_SESSION['pluginmarket']['version'] = Request::submitted('version') ? Request::get('version') : $_SESSION['pluginmarket']['version']; - $studipVersions = array('1.4.0','1.5.0','1.6.0','1.7','1.8','1.9','1.10','1.11','2.0','2.1','2.2','2.3','2.4','2.5','3.0','3.1'); $options[] = "<option value='".URLHelper::getLink('', array('version' => 0))."'>"._('Alle Versionen')."</option>"; - foreach (array_reverse($studipVersions) as $version) { + foreach (array_reverse(PluginMarket::getStudipReleases()) as $version) { $options[] = "<option value='".URLHelper::getLink('', array('version' => $version))."' ".($_SESSION['pluginmarket']['version'] == $version ? "SELECTED" : "").">$version</option>"; } $versionWidget->addElement(new WidgetElement('<select style="width: 100%" onchange="location = this.options[this.selectedIndex].value;">'.join("", $options).'</select>'));