Skip to content
This repository has been archived by the owner on Mar 15, 2024. It is now read-only.

Commit

Permalink
re #25 : add migration and section for best rated plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
Krassmus committed Mar 27, 2015
1 parent 6bf02a3 commit c14dc17
Showing 1 changed file with 55 additions and 57 deletions.
112 changes: 55 additions & 57 deletions views/presenting/details.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,65 +197,63 @@
</div>
<? endif ?>

<? if (($GLOBALS['perm']->have_perm("autor") && !$marketplugin->isWritable()) || $marketplugin['rating']) : ?>
<h2><?= _("Bewertungen") ?></h2>
<div>
<div style="text-align: center;">
<? if ($marketplugin['rating'] === null) : ?>
<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' : "" ?>>
<?= Assets::img($plugin->getPluginURL()."/assets/star.svg", array('width' => "50px")) ?>
<?= Assets::img($plugin->getPluginURL()."/assets/star.svg", array('width' => "50px")) ?>
<?= Assets::img($plugin->getPluginURL()."/assets/star.svg", array('width' => "50px")) ?>
<?= Assets::img($plugin->getPluginURL()."/assets/star.svg", array('width' => "50px")) ?>
<?= Assets::img($plugin->getPluginURL()."/assets/star.svg", array('width' => "50px")) ?>
</a>
<? else : ?>
<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)) ?>">
<? $marketplugin['rating'] = round($marketplugin['rating'], 1) / 2 ?>
<? $v = $marketplugin['rating'] >= 1 ? 3 : ($marketplugin['rating'] >= 0.5 ? 2 : "") ?>
<?= Assets::img($plugin->getPluginURL()."/assets/star$v.svg", array('width' => "50px")) ?>
<? $v = $marketplugin['rating'] >= 2 ? 3 : ($marketplugin['rating'] >= 1.5 ? 2 : "") ?>
<?= Assets::img($plugin->getPluginURL()."/assets/star$v.svg", array('width' => "50px")) ?>
<? $v = $marketplugin['rating'] >= 3 ? 3 : ($marketplugin['rating'] >= 2.5 ? 2 : "") ?>
<?= Assets::img($plugin->getPluginURL()."/assets/star$v.svg", array('width' => "50px")) ?>
<? $v = $marketplugin['rating'] >= 4 ? 3 : ($marketplugin['rating'] >= 3.5 ? 2 : "") ?>
<?= Assets::img($plugin->getPluginURL()."/assets/star$v.svg", array('width' => "50px")) ?>
<? $v = $marketplugin['rating'] > 4.5 ? 3 : ($marketplugin['rating'] >= 4.5 ? 2 : "") ?>
<?= Assets::img($plugin->getPluginURL()."/assets/star$v.svg", array('width' => "50px")) ?>
</a>
<? endif ?>
</div>
<h2><?= _("Bewertungen") ?></h2>
<div>
<div style="text-align: center;">
<? if ($marketplugin['rating'] === null) : ?>
<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' : "" ?>>
<?= Assets::img($plugin->getPluginURL()."/assets/star.svg", array('width' => "50px")) ?>
<?= Assets::img($plugin->getPluginURL()."/assets/star.svg", array('width' => "50px")) ?>
<?= Assets::img($plugin->getPluginURL()."/assets/star.svg", array('width' => "50px")) ?>
<?= Assets::img($plugin->getPluginURL()."/assets/star.svg", array('width' => "50px")) ?>
<?= Assets::img($plugin->getPluginURL()."/assets/star.svg", array('width' => "50px")) ?>
</a>
<? else : ?>
<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)) ?>">
<? $marketplugin['rating'] = round($marketplugin['rating'], 1) / 2 ?>
<? $v = $marketplugin['rating'] >= 1 ? 3 : ($marketplugin['rating'] >= 0.5 ? 2 : "") ?>
<?= Assets::img($plugin->getPluginURL()."/assets/star$v.svg", array('width' => "50px")) ?>
<? $v = $marketplugin['rating'] >= 2 ? 3 : ($marketplugin['rating'] >= 1.5 ? 2 : "") ?>
<?= Assets::img($plugin->getPluginURL()."/assets/star$v.svg", array('width' => "50px")) ?>
<? $v = $marketplugin['rating'] >= 3 ? 3 : ($marketplugin['rating'] >= 2.5 ? 2 : "") ?>
<?= Assets::img($plugin->getPluginURL()."/assets/star$v.svg", array('width' => "50px")) ?>
<? $v = $marketplugin['rating'] >= 4 ? 3 : ($marketplugin['rating'] >= 3.5 ? 2 : "") ?>
<?= Assets::img($plugin->getPluginURL()."/assets/star$v.svg", array('width' => "50px")) ?>
<? $v = $marketplugin['rating'] > 4.5 ? 3 : ($marketplugin['rating'] >= 4.5 ? 2 : "") ?>
<?= Assets::img($plugin->getPluginURL()."/assets/star$v.svg", array('width' => "50px")) ?>
</a>
<? endif ?>
</div>

<ol style="list-style-type: none; padding: none; margin: none;">
<? foreach ($marketplugin->reviews as $review) : ?>
<? if ($review['review']) : ?>
<li style="padding: none; margin: none;">
<blockquote class="quote">
<div class="author">
<div style="float: right;"><?= date("j.n.Y", $review['chdate']) ?></div>
<?= sprintf(_("Rezension von %s"), $GLOBALS['user']->id !== "nobody" ? '<a style="color: white;" href="'.URLHelper::getLink("dispatch.php/profile", array('username' => get_username($review['user_id']))).'">'.Assets::img("icons/16/white/link-intern", array('class' => "text-bottom"))." ".htmlReady(get_fullname($review['user_id'])).'</a>' : htmlReady(get_fullname($review['user_id'])) ) ?>:
</div>
<div>
<? $v = $review['rating'] >= 1 ? 3 : "" ?>
<?= Assets::img($plugin->getPluginURL()."/assets/star$v.svg", array('width' => "20px")) ?>
<? $v = $review['rating'] >= 2 ? 3 : "" ?>
<?= Assets::img($plugin->getPluginURL()."/assets/star$v.svg", array('width' => "20px")) ?>
<? $v = $review['rating'] >= 3 ? 3 : "" ?>
<?= Assets::img($plugin->getPluginURL()."/assets/star$v.svg", array('width' => "20px")) ?>
<? $v = $review['rating'] >= 4 ? 3 : "" ?>
<?= Assets::img($plugin->getPluginURL()."/assets/star$v.svg", array('width' => "20px")) ?>
<? $v = $review['rating'] >= 5 ? 3 : "" ?>
<?= Assets::img($plugin->getPluginURL()."/assets/star$v.svg", array('width' => "20px")) ?>
</div>
<?= htmlReady($review['review']) ?>
</blockquote>
</li>
<? endif ?>
<? endforeach ?>
</ol>
<ol style="list-style-type: none; padding: none; margin: none;">
<? foreach ($marketplugin->reviews as $review) : ?>
<? if ($review['review']) : ?>
<li style="padding: none; margin: none;">
<blockquote class="quote">
<div class="author">
<div style="float: right;"><?= date("j.n.Y", $review['chdate']) ?></div>
<?= sprintf(_("Rezension von %s"), $GLOBALS['user']->id !== "nobody" ? '<a style="color: white;" href="'.URLHelper::getLink("dispatch.php/profile", array('username' => get_username($review['user_id']))).'">'.Assets::img("icons/16/white/link-intern", array('class' => "text-bottom"))." ".htmlReady(get_fullname($review['user_id'])).'</a>' : htmlReady(get_fullname($review['user_id'])) ) ?>:
</div>
<div>
<? $v = $review['rating'] >= 1 ? 3 : "" ?>
<?= Assets::img($plugin->getPluginURL()."/assets/star$v.svg", array('width' => "20px")) ?>
<? $v = $review['rating'] >= 2 ? 3 : "" ?>
<?= Assets::img($plugin->getPluginURL()."/assets/star$v.svg", array('width' => "20px")) ?>
<? $v = $review['rating'] >= 3 ? 3 : "" ?>
<?= Assets::img($plugin->getPluginURL()."/assets/star$v.svg", array('width' => "20px")) ?>
<? $v = $review['rating'] >= 4 ? 3 : "" ?>
<?= Assets::img($plugin->getPluginURL()."/assets/star$v.svg", array('width' => "20px")) ?>
<? $v = $review['rating'] >= 5 ? 3 : "" ?>
<?= Assets::img($plugin->getPluginURL()."/assets/star$v.svg", array('width' => "20px")) ?>
</div>
<?= htmlReady($review['review']) ?>
</blockquote>
</li>
<? endif ?>
<? endforeach ?>
</ol>

</div>
<? endif ?>
</div>

<div style="text-align: center">
<? if ($marketplugin->isWritable()) : ?>
Expand Down

0 comments on commit c14dc17

Please sign in to comment.