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

first adding of new plugins

parent 64c9ce1d
No related branches found
No related tags found
No related merge requests found
......@@ -13,6 +13,10 @@ class PluginMarket extends StudIPPlugin implements SystemPlugin {
$top->addSubNavigation("myplugins", new Navigation(_("Meine Plugins"), PluginEngine::getURL($this, array(), "myplugins/overview")));
}
Navigation::addItem("/pluginmarket", $top);
$loginlink = new Navigation($this->getDisplayTitle(), PluginEngine::getURL($this, array(), "presenting/overview"));
$loginlink->setDescription(_("Laden Sie hier Plugins fr Ihr Stud.IP herunter"));
Navigation::addItem("/login/pluginmarket",$loginlink);
}
public function getDisplayTitle() {
......
......@@ -8,6 +8,7 @@ class MypluginsController extends PluginController {
parent::before_filter($action, $args);
Navigation::activateItem("/pluginmarket/myplugins");
$this->set_content_type('text/html;charset=windows-1252');
}
public function overview_action()
......@@ -15,4 +16,30 @@ class MypluginsController extends PluginController {
$this->plugins = MarketPlugin::findBySQL("1=1");
}
public function add_action() {
$this->marketplugin = new MarketPlugin();
if (Request::isXhr()) {
$this->set_layout(null);
}
$this->render_action("edit");
}
public function edit_action($plugin_id) {
$this->marketplugin = new MarketPlugin($plugin_id);
}
public function save_action() {
if (!Request::isPost()) {
throw new Exception("Method not allowed. Try a POST request.");
}
$this->marketplugin = new MarketPlugin(Request::option("id") ?: null);
$this->marketplugin->setData(Request::getArray("data"));
if ($this->marketplugin->isNew()) {
$this->marketplugin['user_id'] = $GLOBALS['user']->id;
}
$this->marketplugin->store();
PageLayout::postMessage(MessageBox::success(_("Plugin wurde gespeichert.")));
$this->redirect("pluginmarket/presenting/details/".$this->marketplugin->getId());
}
}
\ No newline at end of file
......@@ -14,4 +14,8 @@ class PresentingController extends PluginController {
$this->plugins = MarketPlugin::findBySQL("1=1");
}
public function details_action($plugin_id) {
$this->marketplugin = new MarketPlugin($plugin_id);
}
}
\ No newline at end of file
<form action="?" method="post">
<form action="<?= PluginEngine::getLink($plugin, array(), "myplugins/save") ?>" method="post" class="studip_form">
<input type="hidden" name="id" value="<?= $marketplugin->getId() ?>">
<fieldset>
<legend>
<?= _("Informationen") ?>
</legend>
<label>
<?= _("Name des Plugins") ?>
<input type="text" name="data[name]" value="<?= htmlReady($marketplugin['name']) ?>">
</label>
<label>
<?= _("Kurzbeschreibung") ?>
<input type="text" name="data[short_description]" value="<?= htmlReady($marketplugin['short_description']) ?>" maxlength="160">
</label>
<label>
<?= _("Sprache") ?>
<select name="data[language]">
<option value="de"<?= $marketplugin['language'] === "de" ? " selected" : "" ?>><?= _("Deutsch") ?></option>
<option value="en"<?= $marketplugin['language'] === "en" ? " selected" : "" ?>><?= _("Englisch") ?></option>
<option value="de_en"<?= $marketplugin['language'] === "de_en" ? " selected" : "" ?>><?= _("Deutsch und Englisch") ?></option>
</select>
</label>
<label>
<?= _("Lange Beschreibung") ?>
<textarea class="add_toolbar" name="data[description]"><?= htmlReady($marketplugin['description']) ?></textarea>
</label>
<div>
<?= _("Lizenz") ?>
<input type="hidden" name="data[license]" value="GPL 2 or later">
<p class="info">
<?= _("Stud.IP-Plugins mssen immer mindestens GPL 2 lizensiert sein. Durch das Hochladen erklren Sie, dass auch Ihr Plugin unter der GPL liegt und liegen darf. Wenn Sie nicht das Recht haben, das zu entscheiden, laden Sie jetzt bitte nichts hoch.") ?>
</p>
</div>
</fieldset>
<fieldset>
<legend>
<?= _("Release hinzufgen") ?>
</legend>
<label>
<?= _("Releasebezeichnung") ?>
<input type="text" name="release[name]" placeholder="<?= _("z.B. Rocky Raccoon 3.0.1") ?>">
</label>
<div>
<label>
<input type="radio" name="release[type]" value="zipfile">
<?= _("Als Datei") ?>
</label>
<label>
<input type="radio" name="release[type]" value="git">
<?= _("Als Git-Branch") ?>
</label>
</div>
<fieldset>
<legend>
<?= _("ZIP auswhlen") ?>
</legend>
<label>
<a style="cursor: pointer">
<?= Assets::img("icons/20/blue/upload") ?>
<input type="file" name="release[file]">
</a>
</label>
</fieldset>
<fieldset>
<legend>
<?= _("Git-Branch") ?>
</legend>
<label>
<?= _("Download-URL des Branches oder des Tags") ?>
<input type="release[git_download]">
</label>
<p class="info">
<?= _("Github und gitlab bieten zu jedem Branch und Tag den Download als ZIP-Datei an. Klicken Sie dort mit rechter Maustaste auf den Downloadbutton und kopieren Sie die URL, um sie hier einzufgen. Nach dem Speichern hier knnen Sie auf github bzw. gitlab Webhooks einrichten, damit der Marktplatz sich automatisch die neuste Version des Plugins vom Repository holt.") ?>
</p>
</fieldset>
</fieldset>
<div data-dialog-button>
<?= \Studip\Button::create(_("speichern")) ?>
</div>
</form>
\ No newline at end of file
......@@ -6,6 +6,6 @@
$sidebar = Sidebar::Get();
$sidebar->setImage(Assets::image_path("sidebar/plugin-sidebar.png"));
$actions = new ActionsWidget();
$actions->addLink(_("Neues Plugin eintragen"), PluginEngine::getURL($plugin, array(), "myplugins/add"));
$actions->addLink(_("Neues Plugin eintragen"), PluginEngine::getURL($plugin, array(), "myplugins/add"), null, array('data-dialog' => 1));
$sidebar->addWidget($actions);
<h1><?= htmlReady($marketplugin['name']) ?></h1>
<div>
<?= formatReady($marketplugin['description']) ?>
</div>
\ No newline at end of file
......@@ -31,10 +31,10 @@
width: calc(100% + 8px);
height: 150px;
background-position: center center;
background-size: auto 100%;
background-size: auto calc(100% - 6px);
background-repeat: no-repeat;
background-color: white;
box-shadow: inset 0px 0px 3px rgba(0,0,0,0.3);
box-shadow: inset 0px 0px 4px rgba(0,0,0,0.3);
}
.plugins_shortview > article > .shortdescription {
font-size: 0.9em;
......@@ -57,12 +57,12 @@
Zentrale Archivierung/Lschung von Veranstaltungen durch Admins. Die Veranstaltungen knnen nach verschiedenen Kriterien eingeschrnkt werden.
</p>
</article>
<? foreach ($plugins as $plugin) : ?>
<? foreach ($plugins as $marketplugin) : ?>
<article>
<h1><a href=""><?= htmlReady($plugin['name']) ?></a></h1>
<h1><a href="<?= PluginEngine::getLink($plugin, array(), "presenting/details/".$marketplugin->getId()) ?>"><?= htmlReady($marketplugin['name']) ?></a></h1>
<div class="image" style="background-image: url(http://plugins.studip.de/content/screenshots/a1d85f695cfe506241d398d272ae43f0_thumb);"></div>
<p class="shortdescription">
<?= htmlReady($plugin['short_description']) ?>
<?= htmlReady($marketplugin['short_description']) ?>
</p>
</article>
<? endforeach ?>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment