Skip to content
Snippets Groups Projects
Commit 0f496d55 authored by Rasmus Fuhse's avatar Rasmus Fuhse
Browse files

re #33 : add studipMaxVersion if not set in manifest

parent cb2a68f8
No related branches found
No related tags found
No related merge requests found
...@@ -5,6 +5,17 @@ class PluginMarket extends StudIPPlugin implements SystemPlugin, HomepagePlugin ...@@ -5,6 +5,17 @@ class PluginMarket extends StudIPPlugin implements SystemPlugin, HomepagePlugin
{ {
static protected $studip_domain = null; 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() public function __construct()
{ {
parent::__construct(); parent::__construct();
......
...@@ -119,6 +119,10 @@ class MarketRelease extends SimpleORMap { ...@@ -119,6 +119,10 @@ class MarketRelease extends SimpleORMap {
} }
$this['studip_min_version'] = $manifest['studipMinVersion']; $this['studip_min_version'] = $manifest['studipMinVersion'];
$this['studip_max_version'] = $manifest['studipMaxVersion']; $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']; $this['version'] = $manifest['version'];
if ($this['repository_overwrites_descriptionfrom']) { if ($this['repository_overwrites_descriptionfrom']) {
$readme = ""; $readme = "";
......
...@@ -3,6 +3,7 @@ require_once 'app/controllers/plugin_controller.php'; ...@@ -3,6 +3,7 @@ require_once 'app/controllers/plugin_controller.php';
class MarketController extends PluginController class MarketController extends PluginController
{ {
public function absolute_url_for($to) public function absolute_url_for($to)
{ {
$old_base = URLHelper::setBaseURL($GLOBALS['ABSOLUTE_URI_STUDIP']); $old_base = URLHelper::setBaseURL($GLOBALS['ABSOLUTE_URI_STUDIP']);
......
...@@ -69,10 +69,9 @@ class PresentingController extends MarketController ...@@ -69,10 +69,9 @@ class PresentingController extends MarketController
// Create options for all studip versions // Create options for all studip versions
$_SESSION['pluginmarket']['version'] = Request::submitted('version') ? Request::get('version') : $_SESSION['pluginmarket']['version']; $_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>"; $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>"; $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>')); $versionWidget->addElement(new WidgetElement('<select style="width: 100%" onchange="location = this.options[this.selectedIndex].value;">'.join("", $options).'</select>'));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment