Skip to content
Snippets Groups Projects
Commit 2eb9fd5d authored by Florian Bieringer's avatar Florian Bieringer
Browse files

#59 delete plugin

parents 4f824438 3d2328a1
No related branches found
No related tags found
1 merge request!62#59 Plugin löschen
Showing
with 76 additions and 29 deletions
<form action="<?= $controller->url_for('myplugins/save') ?>" method="post" class="studip_form" enctype="multipart/form-data"> <form action="<?= $controller->url_for('myplugins/save') ?>" method="post" class="default" enctype="multipart/form-data">
<input type="hidden" name="id" value="<?= $marketplugin->getId() ?>"> <input type="hidden" name="id" value="<?= $marketplugin->getId() ?>">
<fieldset> <fieldset>
<legend> <legend>
......
<form action="<?= $controller->url_for('myplugins/save') ?>" method="post" enctype="multipart/form-data" class="studip_form"> <form action="<?= $controller->url_for('myplugins/save') ?>" method="post" enctype="multipart/form-data" class="default">
<input type="hidden" name="id" value="<?= $marketplugin->getId() ?>"> <input type="hidden" name="id" value="<?= $marketplugin->getId() ?>">
<?= $this->render_partial("myplugins/_edit_images.php", compact("marketplugin")) ?> <?= $this->render_partial("myplugins/_edit_images.php", compact("marketplugin")) ?>
......
<form action="<?= $controller->url_for('myplugins/save_release') ?>" method="post" class="studip_form" enctype="multipart/form-data"> <form action="<?= $controller->url_for('myplugins/save_release') ?>" method="post" class="default" enctype="multipart/form-data">
<input type="hidden" name="id" value="<?= $release->getId() ?>"> <input type="hidden" name="id" value="<?= $release->getId() ?>">
<input type="hidden" name="plugin_id" value="<?= $marketplugin->getId() ?>"> <input type="hidden" name="plugin_id" value="<?= $marketplugin->getId() ?>">
<?= $this->render_partial("myplugins/_edit_release.php", array('release' => $release)) ?> <?= $this->render_partial("myplugins/_edit_release.php", array('release' => $release)) ?>
......
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
...@@ -16,20 +16,31 @@ if ($icon) { ...@@ -16,20 +16,31 @@ if ($icon) {
<h1><?= htmlReady($marketplugin['name']) ?></h1> <h1><?= htmlReady($marketplugin['name']) ?></h1>
<div> <div>
<?= htmlReady($marketplugin['short_description']) ?>
</div>
<?if ($marketplugin['description']) : ?>
<div>
<br>
<?= formatReady($marketplugin['description']) ?> <?= formatReady($marketplugin['description']) ?>
</div> </div>
<? endif ?>
<? if (count($marketplugin->images) > 0 || $marketplugin->isWritable()) : ?> <? if (count($marketplugin->images) > 0 || $marketplugin->isWritable()) : ?>
<h2><?= _("Galerie") ?></h2> <h2><?= _("Galerie") ?></h2>
<ol id="pluginmarket_galery_view" class="pluginmarket_galery"> <ol id="pluginmarket_galery_view" class="pluginmarket_galery">
<? foreach ($marketplugin->images as $image) : ?> <? foreach ($marketplugin->images as $image) : ?>
<div class="image"> <div class="image">
<a href="<?= htmlReady($image->getURL()) ?>" data-lightbox="plugin_gallery">
<img src="<?= htmlReady($image->getURL()) ?>"> <img src="<?= htmlReady($image->getURL()) ?>">
</a>
</div> </div>
<? endforeach ?> <? endforeach ?>
<? if ($marketplugin->isWritable()) : ?> <? if ($marketplugin->isWritable()) : ?>
<div><a href="<?= $controller->url_for('myplugins/edit_images/' . $marketplugin->getId()) ?>" data-dialog title="<?= _("Galerie bearbeiten / neue Bilder hinzufgen") ?>"><?= Assets::img("icons/20/blue/add") ?></a></div> <div>
<a href="<?= PluginEngine::getLink($plugin, array(), "myplugins/edit_images/". $marketplugin->getId()) ?>" data-dialog title="<?= _("Galerie bearbeiten / neue Bilder hinzufgen") ?>">
<?= Assets::img("icons/20/blue/add") ?>
</a>
</div>
<? endif ?> <? endif ?>
</ol> </ol>
<? endif ?> <? endif ?>
...@@ -38,12 +49,14 @@ if ($icon) { ...@@ -38,12 +49,14 @@ if ($icon) {
<ul class="plugin-usages"> <ul class="plugin-usages">
<? foreach ($marketplugin['uses'] as $use): ?> <? foreach ($marketplugin['uses'] as $use): ?>
<li> <li>
<a href="<?= PluginEngine::getLink($plugin, array('search' => htmlReady($use->name)), "presenting/all") ?>">
<?= htmlReady($use->name) ?> <?= htmlReady($use->name) ?>
</a>
<? if ($use->plugin->isWritable(User::findCurrent()->id)): ?> <? if ($use->plugin->isWritable(User::findCurrent()->id)): ?>
(<?= ObjectdisplayHelper::link($use->user) ?>) (<?= ObjectdisplayHelper::link($use->user) ?>)
<? endif; ?> <? endif; ?>
<? if ($use->isEditable()): ?> <? if ($use->isEditable()): ?>
<a href="<?= $controller->url_for('presenting/delete_usage/' . $use->id) ?>"> <a href="<?= PluginEngine::getLink($plugin, array(), "presenting/delete_usage/" . $use->id) ?>">
<?= Assets::img('icons/blue/trash.svg'); ?> <?= Assets::img('icons/blue/trash.svg'); ?>
</a> </a>
<? endif; ?> <? endif; ?>
...@@ -114,7 +127,7 @@ if ($icon) { ...@@ -114,7 +127,7 @@ if ($icon) {
<? foreach ($marketplugin->releases as $release) : ?> <? foreach ($marketplugin->releases as $release) : ?>
<tr> <tr>
<td> <td>
<a href="<?= $controller->url_for('presenting/download/' . $release->getId()) ?>" title="<?= _("Dieses Release runterladen") ?>"> <a href="<?= PluginEngine::getLink($plugin, array(), "presenting/download/". $release->getId()) ?>" title="<?= _("Dieses Release runterladen") ?>">
<?= Assets::img("icons/20/blue/download", array('class' => "text-bottom")) ?> <?= Assets::img("icons/20/blue/download", array('class' => "text-bottom")) ?>
<?= htmlReady($release['version']) ?> <?= htmlReady($release['version']) ?>
</a> </a>
...@@ -126,15 +139,15 @@ if ($icon) { ...@@ -126,15 +139,15 @@ if ($icon) {
<td><?= htmlReady($release['downloads']) ?></td> <td><?= htmlReady($release['downloads']) ?></td>
<td class="actions"> <td class="actions">
<? if ($marketplugin->isWritable()) : ?> <? if ($marketplugin->isWritable()) : ?>
<a href="<?= $controller->url_for('myplugins/edit_release/' . $release->getId()) ?>" data-dialog> <a href="<?= PluginEngine::getLink($plugin, array(), "myplugins/edit_release/" . $release->getId()) ?>" data-dialog>
<?= Assets::img("icons/20/blue/edit", array('class' => "text-bottom")) ?> <?= Assets::img("icons/20/blue/edit", array('class' => "text-bottom")) ?>
</a> </a>
<a href="<?= $controller->url_for('presenting/delete_release/' . $release->getId()) ?>"> <a href="<?= PluginEngine::getLink($plugin, array(), "presenting/delete_release/" . $release->getId()) ?>">
<?= Assets::img("icons/20/blue/trash", array('class' => "text-bottom", 'onclick' => "return window.confirm('"._("Pluginrelease wirklich unwiderrufbar lschen?")."');")) ?> <?= Assets::img("icons/20/blue/trash", array('class' => "text-bottom", 'onclick' => "return window.confirm('"._("Pluginrelease wirklich unwiderrufbar lschen?")."');")) ?>
</a> </a>
<? endif ?> <? endif ?>
<? if ($GLOBALS['perm']->have_perm("autor")) : ?> <? if ($GLOBALS['perm']->have_perm("autor")) : ?>
<a href="<?= $controller->url_for('presenting/follow_release/' . $release->getId()) ?>" title="<?= _("Fr automatische Updates registrieren.") ?>" data-dialog> <a href="<?= PluginEngine::getLink($plugin, array(), "presenting/follow_release/" . $release->getId()) ?>" title="<?= _("Fr automatische Updates registrieren.") ?>" data-dialog>
<?= Assets::img("icons/20/blue/rss", array('class' => "text-bottom")) ?> <?= Assets::img("icons/20/blue/rss", array('class' => "text-bottom")) ?>
</a> </a>
<? endif ?> <? endif ?>
...@@ -146,7 +159,7 @@ if ($icon) { ...@@ -146,7 +159,7 @@ if ($icon) {
<tfoot> <tfoot>
<tr> <tr>
<td colspan="7"> <td colspan="7">
<a href="<?= $controller->url_for('myplugins/add_release/' . $marketplugin->getId()) ?>" data-dialog> <a href="<?= PluginEngine::getLink($plugin, array(), "myplugins/add_release/" . $marketplugin->getId()) ?>" data-dialog>
<?= Assets::img("icons/20/blue/add") ?> <?= Assets::img("icons/20/blue/add") ?>
</a> </a>
</td> </td>
...@@ -234,15 +247,15 @@ if ($icon) { ...@@ -234,15 +247,15 @@ if ($icon) {
<a <?= ($GLOBALS['perm']->have_perm("autor") && !$marketplugin->isWritable()) ? 'href="' . $controller->url_for('presenting/review/' . $marketplugin->getId()) . '" data-dialog' : "" ?> title="<?= sprintf(_("%s von 5 Sternen"), round($marketplugin['rating'] / 2, 1)) ?>"> <a <?= ($GLOBALS['perm']->have_perm("autor") && !$marketplugin->isWritable()) ? 'href="' . $controller->url_for('presenting/review/' . $marketplugin->getId()) . '" data-dialog' : "" ?> title="<?= sprintf(_("%s von 5 Sternen"), round($marketplugin['rating'] / 2, 1)) ?>">
<? endif ?> <? endif ?>
<? $marketplugin['rating'] = round($marketplugin['rating'], 1) / 2 ?> <? $marketplugin['rating'] = round($marketplugin['rating'], 1) / 2 ?>
<? $v = $marketplugin['rating'] >= 1 ? 3 : ($marketplugin['rating'] >= 0.5 ? 2 : "") ?> <? $v = $marketplugin['rating'] >= 0.75 ? 3 : ($marketplugin['rating'] >= 0.25 ? 2 : "") ?>
<?= Assets::img($plugin->getPluginURL()."/assets/star$v.svg", array('width' => "50px")) ?> <?= Assets::img($plugin->getPluginURL()."/assets/star$v.svg", array('width' => "50px")) ?>
<? $v = $marketplugin['rating'] >= 2 ? 3 : ($marketplugin['rating'] >= 1.5 ? 2 : "") ?> <? $v = $marketplugin['rating'] >= 1.75 ? 3 : ($marketplugin['rating'] >= 1.25 ? 2 : "") ?>
<?= Assets::img($plugin->getPluginURL()."/assets/star$v.svg", array('width' => "50px")) ?> <?= Assets::img($plugin->getPluginURL()."/assets/star$v.svg", array('width' => "50px")) ?>
<? $v = $marketplugin['rating'] >= 3 ? 3 : ($marketplugin['rating'] >= 2.5 ? 2 : "") ?> <? $v = $marketplugin['rating'] >= 2.75 ? 3 : ($marketplugin['rating'] >= 2.25 ? 2 : "") ?>
<?= Assets::img($plugin->getPluginURL()."/assets/star$v.svg", array('width' => "50px")) ?> <?= Assets::img($plugin->getPluginURL()."/assets/star$v.svg", array('width' => "50px")) ?>
<? $v = $marketplugin['rating'] >= 4 ? 3 : ($marketplugin['rating'] >= 3.5 ? 2 : "") ?> <? $v = $marketplugin['rating'] >= 3.75 ? 3 : ($marketplugin['rating'] >= 3.25 ? 2 : "") ?>
<?= Assets::img($plugin->getPluginURL()."/assets/star$v.svg", array('width' => "50px")) ?> <?= Assets::img($plugin->getPluginURL()."/assets/star$v.svg", array('width' => "50px")) ?>
<? $v = $marketplugin['rating'] > 4.5 ? 3 : ($marketplugin['rating'] >= 4.5 ? 2 : "") ?> <? $v = $marketplugin['rating'] >= 4.75 ? 3 : ($marketplugin['rating'] >= 4.25 ? 2 : "") ?>
<?= Assets::img($plugin->getPluginURL()."/assets/star$v.svg", array('width' => "50px")) ?> <?= Assets::img($plugin->getPluginURL()."/assets/star$v.svg", array('width' => "50px")) ?>
<? if (!$marketplugin->isWritable()) : ?> <? if (!$marketplugin->isWritable()) : ?>
</a> </a>
...@@ -282,11 +295,11 @@ if ($icon) { ...@@ -282,11 +295,11 @@ if ($icon) {
<div style="text-align: center"> <div style="text-align: center">
<? if ($marketplugin->isWritable()) : ?> <? if ($marketplugin->isWritable()) : ?>
<?= \Studip\LinkButton::create(_("Plugin lschen"), $controller->url_for('myplugins/delete/' . $marketplugin->getId()), array('data-dialog' => 1)) ?> <?= \Studip\LinkButton::create(_("Plugin lschen"), PluginEngine::getURL($plugin, array(), 'myplugins/delete/' . $marketplugin->getId()), array('data-dialog' => 1)) ?>
<?= \Studip\LinkButton::create(_("bearbeiten"), $controller->url_for('myplugins/edit/' . $marketplugin->getId()), array('data-dialog' => 1)) ?> <?= \Studip\LinkButton::create(_("bearbeiten"), PluginEngine::getURL($plugin, array(), "myplugins/edit/" . $marketplugin->getId()), array('data-dialog' => 1)) ?>
<?= \Studip\LinkButton::create(_("Release hinzufgen"), $controller->url_for('myplugins/add_release/' . $marketplugin->getId()), array('data-dialog' => 1)) ?> <?= \Studip\LinkButton::create(_("Release hinzufgen"), PluginEngine::getURL($plugin, array(), "myplugins/add_release/" . $marketplugin->getId()), array('data-dialog' => 1)) ?>
<? endif ?> <? endif ?>
<? if ($marketplugin['user_id'] !== $GLOBALS['user']->id) : ?> <? if ($marketplugin['user_id'] !== $GLOBALS['user']->id) : ?>
<?= \Studip\LinkButton::create(_("Plugin abonnieren"), $controller->url_for('presenting/register_for_pluginnews/' . $marketplugin->getId()), array('title' => _("Neuigkeiten des Plugins per Nachricht bekommen."), 'data-dialog' => "1")) ?> <?= \Studip\LinkButton::create(_("Plugin abonnieren"), PluginEngine::getURL($plugin, array(), "presenting/register_for_pluginnews/" . $marketplugin->getId()), array('title' => _("Neuigkeiten des Plugins per Nachricht bekommen."), 'data-dialog' => "1")) ?>
<? endif ?> <? endif ?>
</div> </div>
<? foreach (PageLayout::getMessages() as $message) : ?> <? foreach (PageLayout::getMessages() as $message) : ?>
<?= $message ?> <?= $message ?>
<? endforeach ?> <? endforeach ?>
<form action="<?= $controller->url_for('presenting/follow_release/' . $release->getId()) ?>" method="post" data-dialog class="studip_form"> <form action="<?= $controller->url_for('presenting/follow_release/' . $release->getId()) ?>" method="post" data-dialog class="default">
<p class="info"> <p class="info">
<?= _("Immer aktuell bleiben mit automatischen Updates! Sie finden in Ihrem eigenen Stud.IP in der Pluginverwaltung rechts neben dem Plugin ein Icon, das Sie zu einem Popup führt. Geben Sie dort die unten stehende Download-URL ein und geben Sie hier die URL ein, die Sie danach dort in Ihrer Pluginverwaltung sehen. Sind beide Systeme korrekt konfiguriert, wird der Marktplatz dann eine jede neue Version dieses Releases automatisch in ihrem Stud.IP installieren.") ?> <?= _("Immer aktuell bleiben mit automatischen Updates! Sie finden in Ihrem eigenen Stud.IP in der Pluginverwaltung rechts neben dem Plugin ein Icon, das Sie zu einem Popup führt. Geben Sie dort die unten stehende Download-URL ein und geben Sie hier die URL ein, die Sie danach dort in Ihrer Pluginverwaltung sehen. Sind beide Systeme korrekt konfiguriert, wird der Marktplatz dann eine jede neue Version dieses Releases automatisch in ihrem Stud.IP installieren.") ?>
</p> </p>
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<th data-sort-type="int"> <th data-sort-type="int">
<?= _('Standorte') ?> <?= _('Standorte') ?>
</th> </th>
<th data-sort-type="int"> <th data-sort-type="sorter">
<?= _('Letzte nderung') ?> <?= _('Letzte nderung') ?>
</th> </th>
<th data-sort-type="int"> <th data-sort-type="int">
...@@ -32,8 +32,8 @@ ...@@ -32,8 +32,8 @@
<td> <td>
<?= htmlReady($marketplugin->uses->count()) ?> <?= htmlReady($marketplugin->uses->count()) ?>
</td> </td>
<td> <td data-sorter="<?= $marketplugin->releases->orderBy('chdate DESC')->val('mkdate') ?>">
<?= strftime('%x', $marketplugin->releases->orderBy('chdate DESC')->first()->chdate) ?> <?= strftime('%x', $marketplugin->releases->orderBy('chdate DESC')->val('mkdate')) ?>
</td> </td>
<td> <td>
<?= htmlReady($marketplugin->getDownloads()) ?> <?= htmlReady($marketplugin->getDownloads()) ?>
......
File mode changed from 100644 to 100755
<form class="studip_form" method="post" action="<?= $controller->url_for('presenting/propose_usage/' . $plugin->id) ?>"> <form class="default" method="post" action="<?= $controller->url_for('presenting/propose_usage/' . $plugin->id) ?>">
<fieldset> <fieldset>
<?= CSRFProtection::tokenTag(); ?> <?= CSRFProtection::tokenTag(); ?>
<legend><?= sprintf(_('Pluginnutzung mitteilen fr %s'), htmlReady($plugin->name)) ?></legend> <legend><?= sprintf(_('Pluginnutzung mitteilen fr %s'), htmlReady($plugin->name)) ?></legend>
......
File mode changed from 100644 to 100755
<form action="<?= $controller->url_for('presenting/save_review/' . $review['plugin_id']) ?>" method="post" class="studip_form"> <form action="<?= $controller->url_for('presenting/save_review/' . $review['plugin_id']) ?>" method="post" class="default">
<fieldset> <fieldset>
<legend> <legend>
<?= _("Bewertung") ?> <?= _("Bewertung") ?>
......
File mode changed from 100644 to 100755
<h2><?= _("Erstellen von Sidebar-Grafiken") ?></h2>
<table>
<tbody>
<tr>
<td><label for="color"><?=_("Farbe") ?></label></td>
<td><input type="color" id="color" value="#24437c" onChange="STUDIP.SidebarGraphicsGenerator.drawImage();"></td>
</tr>
<tr>
<td><label for="localicon"><?= _("Bilddatei (SVG, quadratisch, weiß)") ?></label></td>
<td><input type="file" id="localicon" onChange="STUDIP.SidebarGraphicsGenerator.setFile(this); return false;"></td>
</tr>
<tr style="display: none;">
<td><?= _("Bild") ?></td>
<td><img id="icon" style="width: 200px; height: 200px; background-color: #36598f; border:thin solid #36598f"></td>
</tr>
</tbody>
</table>
<canvas width="320" height="320" style="display: none;" id="pre_icon"></canvas>
<input type="hidden" id="filename" value="">
<div style="border: rgba(54,89,142,0.5) solid 10px; display: inline-block; border-radius: 7px;">
<canvas width="520px" height="200px" style="border: white solid 3px;" id="sidebar_image"></canvas>
</div>
<div id="save_instructions" style="display: none; padding: 20px;">
<a href="#" id="downloader" onClick="this.href=window.document.getElementById('sidebar_image').toDataURL('image/png');" download="testXXX.png">
<?= Assets::img("icons/16/blue/download") ?>
<?= _("Speichern unter ...") ?>
</a>
</div>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment