diff --git a/PluginMarket.class.php b/PluginMarket.class.php index 71d155450d22ad0ccf7a726c86f4d2815935ee26..5c1a48c1ccf7f1047a850a8b76f9c28f4bb5a895 100644 --- a/PluginMarket.class.php +++ b/PluginMarket.class.php @@ -9,7 +9,7 @@ class PluginMarket extends StudIPPlugin implements SystemPlugin { public function __construct() { parent::__construct(); $top = new Navigation($this->getDisplayTitle(), PluginEngine::getURL($this, array(), "presenting/overview")); - $top->setImage($this->getPluginURL()."/assets/topicon_42.png"); + $top->setImage($this->getPluginURL()."/assets/topicon_".($GLOBALS['auth']->auth['devicePixelRatio'] ? 84 : 42).".png"); $top->addSubNavigation("presenting", new Navigation($this->getDisplayTitle(), PluginEngine::getURL($this, array(), "presenting/overview"))); if ($GLOBALS['perm']->have_perm("autor")) { $top->addSubNavigation("myplugins", new Navigation(_("Meine Plugins"), PluginEngine::getURL($this, array(), "myplugins/overview"))); diff --git a/assets/topicon_42.png b/assets/topicon_42.png index b9160581b0ed3ba08f1ef16777b66ba286715304..293c2b8aa8596ea2404059793dbbb359c3ac6bb6 100644 Binary files a/assets/topicon_42.png and b/assets/topicon_42.png differ diff --git a/assets/topicon_84.png b/assets/topicon_84.png new file mode 100644 index 0000000000000000000000000000000000000000..1e6d35dfdc99a30ea8756b02b38d1049060a6ff7 Binary files /dev/null and b/assets/topicon_84.png differ diff --git a/controllers/myplugins.php b/controllers/myplugins.php index 21a001b7291801a2e715f638012c7c9582bebbb4..1ced4c367589d770da13183f1f896b1232fcdc94 100644 --- a/controllers/myplugins.php +++ b/controllers/myplugins.php @@ -44,8 +44,12 @@ class MypluginsController extends PluginController { if (!Request::isPost()) { throw new Exception("Method not allowed. Try a POST request."); } + $data = Request::getArray("data"); + if (!isset($data["publiclyvisible"])) { + $data['publiclyvisible'] = 0; + } $this->marketplugin = new MarketPlugin(Request::option("id") ?: null); - $this->marketplugin->setData(Request::getArray("data")); + $this->marketplugin->setData($data); if ($this->marketplugin->isNew()) { $this->marketplugin['user_id'] = $GLOBALS['user']->id; } diff --git a/controllers/presenting.php b/controllers/presenting.php index aea04e2353036e2456a9ee685698cce06a6be523..47403738b1107c739906a8a028b441e576453b87 100644 --- a/controllers/presenting.php +++ b/controllers/presenting.php @@ -22,7 +22,7 @@ class PresentingController extends PluginController { } } - $this->plugins = MarketPlugin::findBySQL("1=1 ORDER BY name ASC"); + $this->plugins = MarketPlugin::findBySQL("publiclyvisible = 1 AND approved = 1 ORDER BY name ASC"); } public function details_action($plugin_id) { diff --git a/install.sql b/install.sql index d349e026ab7c4e1877701e3e4c73c88043b8820a..f706c113ba2f6d94714a612a3e0fc5db062f536a 100644 --- a/install.sql +++ b/install.sql @@ -8,7 +8,7 @@ CREATE TABLE IF NOT EXISTS `pluginmarket_plugins` ( `short_description` text NOT NULL, `release_type` varchar(255) default NULL, `approved` tinyint(2) NOT NULL default '0', - `public` tinyint(2) NOT NULL default '1', + `publiclyvisible` TINYINT NOT NULL DEFAULT '1' `url` varchar(2000) default NULL, `classification` enum('firstclass','secondclass','none') NOT NULL default 'none', `language` enum('de','en','de_en') NOT NULL default 'de', diff --git a/views/myplugins/edit.php b/views/myplugins/edit.php index d02c3d05511976a889e38eb230ab8a21c36d5b43..b9ad3de83ab4f537a0ba34a893ece605deffcc6c 100644 --- a/views/myplugins/edit.php +++ b/views/myplugins/edit.php @@ -28,6 +28,11 @@ <textarea class="add_toolbar" name="data[description]"><?= htmlReady($marketplugin['description']) ?></textarea> </label> + <label> + <?= _("Sichtbar f�r alle") ?> + <input type="checkbox" name="data[publiclyvisible]" value="1"<?= $marketplugin->isNew() || $marketplugin['publiclyvisible'] ? " checked" : "" ?>> + </label> + <div> <?= _("Lizenz") ?> <input type="hidden" name="data[license]" value="GPL 2 or later"> diff --git a/views/myplugins/overview.php b/views/myplugins/overview.php index e1220f4a3ad7a57d5a4e9c982851500c0d0fa4ab..ce4c8b439c0c07e68e672b6bc515f2d793feb895 100644 --- a/views/myplugins/overview.php +++ b/views/myplugins/overview.php @@ -5,6 +5,7 @@ <th><?= _("Name") ?></th> <th><?= _("Letztes Update") ?></th> <th></th> + <th></th> </tr> </thead> <tbody> @@ -25,6 +26,11 @@ ?> <?= date("j.n.Y, G:i", $chdate) ?> <?= _("Uhr") ?> </td> + <td> + <? if (!$marketplugin['publiclyvisible']) : ?> + <?= Assets::img("icons/20/grey/lock-locked.png.png", array('title' => _("Plugin ist nicht �ffentlich"))) ?> + <? endif ?> + </td> <td> <a href="<?= PluginEngine::getLink($plugin, array(), "myplugins/edit/".$marketplugin->getId()) ?>" data-dialog><?= Assets::img("icons/20/blue/edit") ?></a> </td> diff --git a/views/presenting/details.php b/views/presenting/details.php index 017abe707ab7771a1be0f8809683cfd17ae9c9cd..ae365ab9cc21824a17d9707898356ece464566ec 100644 --- a/views/presenting/details.php +++ b/views/presenting/details.php @@ -1,3 +1,7 @@ +<? if (!$marketplugin['publiclyvisible']) : ?> + <?= PageLayout::postMessage(MessageBox::info(_("Dieses Plugin ist nicht �ffentlich."))) ?> +<? endif ?> + <h1><?= htmlReady($marketplugin['name']) ?></h1> <div> <?= formatReady($marketplugin['description']) ?> @@ -5,7 +9,11 @@ <h2><?= _("Galerie") ?></h2> -<div></div> +<div> + <? if ($marketplugin['user_id'] === $GLOBALS['user']->id) : ?> + <div><a href=""><?= Assets::img("icons/20/blue/add") ?></a></div> + <? endif ?> +</div> <h2><?= _("Releases") ?></h2> <table class="default">