Skip to content

Commit f99413c

Browse files
author
Rasmus Fuhse
committedMay 25, 2016
add gui to download
1 parent e23d053 commit f99413c

File tree

4 files changed

+66
-5
lines changed

4 files changed

+66
-5
lines changed
 

‎StudipDownloader.php

+12-4
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,19 @@
33
class StudipDownloader extends StudipPlugin implements SystemPlugin
44
{
55

6-
//private $svnurl = 'svn://develop.studip.de/studip';
7-
//private $svncmd = 'svn --no-auth-cache --username studip --password studip ';
6+
private $svnurl = 'svn://develop.studip.de/studip';
7+
private $svncmd = 'svn --no-auth-cache --username studip --password studip ';
88

9-
private $svnurl = 'file:///home/svn/studip';
10-
private $svncmd = '/usr/bin/svn';
9+
//private $svnurl = 'file:///home/svn/studip';
10+
//private $svncmd = '/usr/bin/svn';
11+
12+
public function __construct()
13+
{
14+
parent::__construct();
15+
$nav = new Navigation(_("Downloads"), PluginEngine::getURL($this, array(), "downloadarea/overview"));
16+
$nav->setImage(Icon::create("download", "navigation"));
17+
Navigation::addItem("/downloader", $nav);
18+
}
1119

1220
function perform($unconsumed_path) {
1321
try {

‎controllers/downloadarea.php

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
require_once 'app/controllers/plugin_controller.php';
4+
5+
class DownloadareaController extends PluginController {
6+
7+
public function overview_action()
8+
{
9+
Navigation::activateItem("/downloader");
10+
$this->releases = $this->plugin->get_svn_list('/tags');
11+
$this->releases = array_reverse($this->releases->getArrayCopy());
12+
}
13+
}

‎plugin.manifest

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
pluginclassname=StudipDownloader
22
pluginname=StudipDownloader
3-
origin=data-quest
3+
origin=studip
44
version=1
55
StudipMinVersion=3.1

‎views/downloadarea/overview.php

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<div style="font-size: 1.6em; text-align: center;">
2+
<? $latest_stable = array_shift($releases) ?>
3+
4+
<a href="<?= PluginEngine::getLink($plugin, array(), "download/".$latest_stable['name']) ?>">
5+
<?= Icon::create("download", "clickable")->asImg("30px", ['class' => "text-bottom"]) ?>
6+
<?= htmlReady(_("Stud.IP")." ".$latest_stable['name']." "._("jetzt herunterladen."))?>
7+
</a>
8+
</div>
9+
10+
<table class="default">
11+
<caption>
12+
<?= _("Weitere Downloads") ?>
13+
</caption>
14+
<thead>
15+
<tr>
16+
<th><?= _("Version") ?></th>
17+
<th><?= _("Datum") ?></th>
18+
<th></th>
19+
</tr>
20+
</thead>
21+
<tbody>
22+
<? foreach ($releases as $release) : ?>
23+
<tr>
24+
<td>
25+
<a href="<?= PluginEngine::getLink($plugin, array(), "download/".$release['name']) ?>">
26+
<?= htmlReady($release['name']) ?>
27+
</a>
28+
</td>
29+
<td>
30+
<?= date("j.n.Y", strtotime($release['date'])) ?>
31+
</td>
32+
<td style="text-align: right;">
33+
<a href="<?= PluginEngine::getLink($plugin, array(), "download/".$release['name']) ?>">
34+
<?= Icon::create("download", "clickable")->asImg("20px", ['class' => "text-bottom"]) ?>
35+
</a>
36+
</td>
37+
</tr>
38+
<? endforeach ?>
39+
</tbody>
40+
</table>

0 commit comments

Comments
 (0)
Please sign in to comment.