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

re #76

parent 482624fc
No related branches found
No related tags found
No related merge requests found
...@@ -79,6 +79,9 @@ ...@@ -79,6 +79,9 @@
#gradient .vertical(fadeout(#fff, 100%), #fff); #gradient .vertical(fadeout(#fff, 100%), #fff);
} }
} }
&.deprecated {
opacity: 0.5;
}
} }
&.new > article { &.new > article {
......
...@@ -96,6 +96,12 @@ class MypluginsController extends MarketController ...@@ -96,6 +96,12 @@ class MypluginsController extends MarketController
if (!isset($data["donationsaccepted"])) { if (!isset($data["donationsaccepted"])) {
$data['donationsaccepted'] = 0; $data['donationsaccepted'] = 0;
} }
if (!$this->marketplugin->isRootable() && isset($data['deprecated'])) {
unset($data['deprecated']);
}
if ($this->marketplugin->isRootable() && !isset($data['deprecated'])) {
$data['deprecated'] = 0;
}
$this->marketplugin->setData($data); $this->marketplugin->setData($data);
if ($this->marketplugin->isNew() && (MarketPlugin::findOneByPluginname($this->marketplugin->pluginname) || !strlen(trim($this->marketplugin->pluginname)))) { if ($this->marketplugin->isNew() && (MarketPlugin::findOneByPluginname($this->marketplugin->pluginname) || !strlen(trim($this->marketplugin->pluginname)))) {
PageLayout::postError(_("Ein Plugin mit diesem Namen ist schon im Marktplatz vorhanden!")); PageLayout::postError(_("Ein Plugin mit diesem Namen ist schon im Marktplatz vorhanden!"));
......
...@@ -87,9 +87,9 @@ class PresentingController extends MarketController ...@@ -87,9 +87,9 @@ class PresentingController extends MarketController
} }
} }
$this->plugins = MarketPlugin::findBySQL("publiclyvisible = 1 AND approved = 1 ORDER BY RAND() LIMIT 3"); $this->plugins = MarketPlugin::findBySQL("publiclyvisible = 1 AND approved = 1 AND deprecated = 0 ORDER BY RAND() LIMIT 3");
$this->latest_plugins = MarketPlugin::findBySQL("publiclyvisible = 1 AND approved = 1 ORDER BY mkdate DESC LIMIT 5"); $this->latest_plugins = MarketPlugin::findBySQL("publiclyvisible = 1 AND approved = 1 AND deprecated = 0 ORDER BY mkdate DESC LIMIT 5");
$best = DBManager::get()->prepare(" $best = DBManager::get()->prepare("
SELECT pluginmarket_plugins.* SELECT pluginmarket_plugins.*
...@@ -97,6 +97,7 @@ class PresentingController extends MarketController ...@@ -97,6 +97,7 @@ class PresentingController extends MarketController
LEFT JOIN pluginmarket_reviews ON (pluginmarket_plugins.plugin_id = pluginmarket_reviews.plugin_id) LEFT JOIN pluginmarket_reviews ON (pluginmarket_plugins.plugin_id = pluginmarket_reviews.plugin_id)
WHERE publiclyvisible = 1 WHERE publiclyvisible = 1
AND approved = 1 AND approved = 1
AND deprecated = 0
GROUP BY pluginmarket_plugins.plugin_id GROUP BY pluginmarket_plugins.plugin_id
ORDER BY pluginmarket_plugins.rating DESC, MAX(pluginmarket_reviews.chdate) DESC ORDER BY pluginmarket_plugins.rating DESC, MAX(pluginmarket_reviews.chdate) DESC
LIMIT 6 LIMIT 6
...@@ -123,7 +124,7 @@ class PresentingController extends MarketController ...@@ -123,7 +124,7 @@ class PresentingController extends MarketController
) )
AND publiclyvisible = 1 AND publiclyvisible = 1
AND approved = 1 AND approved = 1
ORDER BY (IF(name LIKE :likesearch, 6, 0) + MATCH (short_description, description) AGAINST (:search)),name ", array( ORDER BY deprecated ASC, (IF(name LIKE :likesearch, 6, 0) + MATCH (short_description, description) AGAINST (:search)), name ", array(
'likesearch' => "%".Request::get("search")."%", 'likesearch' => "%".Request::get("search")."%",
'search' => Request::get("search") 'search' => Request::get("search")
) )
...@@ -136,7 +137,7 @@ class PresentingController extends MarketController ...@@ -136,7 +137,7 @@ class PresentingController extends MarketController
WHERE pluginmarket_tags.tag = :tag WHERE pluginmarket_tags.tag = :tag
AND pluginmarket_plugins.approved = 1 AND pluginmarket_plugins.approved = 1
AND pluginmarket_plugins.publiclyvisible = 1 AND pluginmarket_plugins.publiclyvisible = 1
ORDER BY name ORDER BY deprecated ASC, name ASC
"); ");
$statement->execute(array('tag' => Request::get("tag"))); $statement->execute(array('tag' => Request::get("tag")));
$plugin_data = $statement->fetchAll(PDO::FETCH_ASSOC); $plugin_data = $statement->fetchAll(PDO::FETCH_ASSOC);
...@@ -148,7 +149,7 @@ class PresentingController extends MarketController ...@@ -148,7 +149,7 @@ class PresentingController extends MarketController
$this->plugins[] = $plugin; $this->plugins[] = $plugin;
} }
} else { } else {
$this->plugins = MarketPlugin::findBySQL("publiclyvisible = 1 AND approved = 1 ORDER BY name ASC"); $this->plugins = MarketPlugin::findBySQL("publiclyvisible = 1 AND approved = 1 AND deprecated = 0 ORDER BY name ASC");
} }
// Filter version // Filter version
...@@ -179,6 +180,10 @@ class PresentingController extends MarketController ...@@ -179,6 +180,10 @@ class PresentingController extends MarketController
$this->marketplugin['rating'] = $this->marketplugin->calculateRating(); $this->marketplugin['rating'] = $this->marketplugin->calculateRating();
$this->marketplugin->store(); $this->marketplugin->store();
if ($this->marketplugin['deprecated']) {
PageLayout::postInfo(_("Dieses Plugin gilt als veraltet."));
}
// Add actions widget // Add actions widget
$sidebar = Sidebar::Get(); $sidebar = Sidebar::Get();
$actions = new ActionsWidget(); $actions = new ActionsWidget();
......
<?php
class DeprecatedPlugins extends Migration {
public function up() {
DBManager::get()->exec("
ALTER TABLE `pluginmarket_plugins` ADD COLUMN `deprecated` TINYINT(1) NOT NULL DEFAULT '0' AFTER `rating`
");
SimpleORMap::expireTableScheme();
}
public function down() {
}
}
\ No newline at end of file
...@@ -59,6 +59,13 @@ ...@@ -59,6 +59,13 @@
<input type="checkbox" name="data[donationsaccepted]" value="1"<?= $marketplugin->isNew() || $marketplugin['donationsaccepted'] ? " checked" : "" ?>> <input type="checkbox" name="data[donationsaccepted]" value="1"<?= $marketplugin->isNew() || $marketplugin['donationsaccepted'] ? " checked" : "" ?>>
</label> </label>
<? if ($marketplugin->isRootable()) : ?>
<label>
<?= _("Plugin veraltet") ?>
<input type="checkbox" name="data[deprecated]" value="1"<?= $marketplugin['deprecated'] ? " checked" : "" ?>>
</label>
<? endif ?>
</fieldset> </fieldset>
......
<article class="contentbox"> <article class="contentbox<?= $marketplugin['deprecated'] ? " deprecated" : "" ?>">
<a href="<?= $controller->url_for('presenting/details/' . $marketplugin->getId()) ?>"> <a href="<?= $controller->url_for('presenting/details/' . $marketplugin->getId()) ?>">
<header> <header>
<h1><?= htmlReady($marketplugin['name']) ?></h1> <h1><?= htmlReady($marketplugin['name']) ?></h1>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment