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

re #68

parent 31fd3db2
No related branches found
No related tags found
No related merge requests found
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="100%" height="100%" viewBox="0 0 64 64" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;">
<path id="line5" d="M0,0" style="fill-rule:nonzero;stroke:rgb(68,159,219);stroke-width:1px;"/>
<path id="path7" d="M64,24.816L41.889,21.603L32,1.567L22.111,21.603L0,24.816L16,40.412L12.223,62.434L32,52.037L51.777,62.434L48,40.412L64,24.816ZM32,47.094L18.034,54.437L20.701,38.885L9.402,27.871L25.017,25.602L32,11.452L38.983,25.602L54.598,27.871L43.299,38.885L45.966,54.437L32,47.094L32,47.094Z" style="fill:rgb(15,70,126);fill-rule:nonzero;"/>
</svg>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="100%" height="100%" viewBox="0 0 64 64" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;">
<path id="line5" d="M0,0" style="fill-rule:nonzero;stroke:rgb(68,159,219);stroke-width:1px;"/>
<path id="path7" d="M64,24.816L41.889,21.603L32,1.567L22.111,21.603L0,24.816L16,40.412L12.223,62.434L32,52.037L51.777,62.434L48,40.412L64,24.816ZM32,47.094L31.941,47.125L32,11.452L38.983,25.602L54.598,27.871L43.299,38.885L45.966,54.437L32,47.094L32,47.094Z" style="fill:rgb(15,70,126);fill-rule:nonzero;"/>
</svg>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="100%" height="100%" viewBox="0 0 64 64" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;">
<path id="line5" d="M0,0" style="fill-rule:nonzero;stroke:rgb(68,159,219);stroke-width:1px;"/>
<path id="path7" d="M64,24.816L41.889,21.603L32,1.567L22.111,21.603L0,24.816L16,40.412L12.223,62.434L32,52.037L51.777,62.434L48,40.412L64,24.816Z" style="fill:rgb(15,70,126);fill-rule:nonzero;"/>
</svg>
<?php <?php
require_once __DIR__."/../classes/MarketPlugin.class.php";
class AddRatingToDatabase extends Migration { class AddRatingToDatabase extends Migration {
public function up() { public function up() {
......
...@@ -233,30 +233,32 @@ if ($image) { ...@@ -233,30 +233,32 @@ if ($image) {
<? if ($marketplugin['rating'] === null) : ?> <? if ($marketplugin['rating'] === null) : ?>
<? if (!$marketplugin->isWritable()) : ?> <? if (!$marketplugin->isWritable()) : ?>
<a style="opacity: 0.3;" title="<?= $GLOBALS['perm']->have_perm("autor") ? _("Geben Sie die erste Bewertung ab.") : _("Noch keine bewertung abgegeben.") ?>" <?= ($GLOBALS['perm']->have_perm("autor") && !$marketplugin->isWritable()) ? 'href="' . $controller->url_for('presenting/review/' . $marketplugin->getId()) . '" data-dialog' : "" ?>> <a style="opacity: 0.3;" title="<?= $GLOBALS['perm']->have_perm("autor") ? _("Geben Sie die erste Bewertung ab.") : _("Noch keine bewertung abgegeben.") ?>" <?= ($GLOBALS['perm']->have_perm("autor") && !$marketplugin->isWritable()) ? 'href="' . $controller->url_for('presenting/review/' . $marketplugin->getId()) . '" data-dialog' : "" ?>>
<? $icon_prefix = "blue_" ?>
<? endif ?> <? endif ?>
<?= Assets::img($plugin->getPluginURL()."/assets/star.svg", array('width' => "50px")) ?> <?= Assets::img($plugin->getPluginURL()."/assets/".$icon_prefix."star.svg", array('width' => "50px")) ?>
<?= Assets::img($plugin->getPluginURL()."/assets/star.svg", array('width' => "50px")) ?> <?= Assets::img($plugin->getPluginURL()."/assets/".$icon_prefix."star.svg", array('width' => "50px")) ?>
<?= Assets::img($plugin->getPluginURL()."/assets/star.svg", array('width' => "50px")) ?> <?= Assets::img($plugin->getPluginURL()."/assets/".$icon_prefix."star.svg", array('width' => "50px")) ?>
<?= Assets::img($plugin->getPluginURL()."/assets/star.svg", array('width' => "50px")) ?> <?= Assets::img($plugin->getPluginURL()."/assets/".$icon_prefix."star.svg", array('width' => "50px")) ?>
<?= Assets::img($plugin->getPluginURL()."/assets/star.svg", array('width' => "50px")) ?> <?= Assets::img($plugin->getPluginURL()."/assets/".$icon_prefix."star.svg", array('width' => "50px")) ?>
<? if (!$marketplugin->isWritable()) : ?> <? if (!$marketplugin->isWritable()) : ?>
</a> </a>
<? endif ?> <? endif ?>
<? else : ?> <? else : ?>
<? if (!$marketplugin->isWritable()) : ?> <? if (!$marketplugin->isWritable()) : ?>
<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)) ?>">
<? $icon_prefix = "blue_" ?>
<? endif ?> <? endif ?>
<? $marketplugin['rating'] = round($marketplugin['rating'], 1) / 2 ?> <? $marketplugin['rating'] = round($marketplugin['rating'], 1) / 2 ?>
<? $v = $marketplugin['rating'] >= 0.75 ? 3 : ($marketplugin['rating'] >= 0.25 ? 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/".$icon_prefix."star$v.svg", array('width' => "50px")) ?>
<? $v = $marketplugin['rating'] >= 1.75 ? 3 : ($marketplugin['rating'] >= 1.25 ? 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/".$icon_prefix."star$v.svg", array('width' => "50px")) ?>
<? $v = $marketplugin['rating'] >= 2.75 ? 3 : ($marketplugin['rating'] >= 2.25 ? 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/".$icon_prefix."star$v.svg", array('width' => "50px")) ?>
<? $v = $marketplugin['rating'] >= 3.75 ? 3 : ($marketplugin['rating'] >= 3.25 ? 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/".$icon_prefix."star$v.svg", array('width' => "50px")) ?>
<? $v = $marketplugin['rating'] >= 4.75 ? 3 : ($marketplugin['rating'] >= 4.25 ? 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/".$icon_prefix."star$v.svg", array('width' => "50px")) ?>
<? if (!$marketplugin->isWritable()) : ?> <? if (!$marketplugin->isWritable()) : ?>
</a> </a>
<? endif ?> <? endif ?>
...@@ -296,9 +298,12 @@ if ($image) { ...@@ -296,9 +298,12 @@ if ($image) {
<div style="text-align: center"> <div style="text-align: center">
<? if ($marketplugin->isWritable()) : ?> <? if ($marketplugin->isWritable()) : ?>
<?= \Studip\LinkButton::create(_("Plugin lschen"), PluginEngine::getURL($plugin, array(), '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"), PluginEngine::getURL($plugin, array(), "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"), PluginEngine::getURL($plugin, array(), "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->isWritable()) : ?>
<?= \Studip\LinkButton::create(_("Bewertung schreiben"), $controller->url_for('presenting/review/' . $marketplugin->getId()), array('data-dialog' => 1)) ?>
<? endif ?>
<? if ($marketplugin['user_id'] !== $GLOBALS['user']->id) : ?> <? if ($marketplugin['user_id'] !== $GLOBALS['user']->id) : ?>
<?= \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")) ?> <?= \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 ?>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment