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

some small things

parents efe2e7fa fff2d09c
No related branches found
No related tags found
No related merge requests found
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
require_once __DIR__."/classes/MarketPlugin.class.php"; require_once __DIR__."/classes/MarketPlugin.class.php";
require_once __DIR__."/classes/MarketRelease.class.php"; require_once __DIR__."/classes/MarketRelease.class.php";
require_once __DIR__."/classes/MarketImage.class.php";
class PluginMarket extends StudIPPlugin implements SystemPlugin { class PluginMarket extends StudIPPlugin implements SystemPlugin {
......
<?php
class MarketImage extends SimpleORMap {
protected static function configure($config = array())
{
$config['db_table'] = 'pluginmarket_images';
$config['belongs_to']['plugin'] = array(
'class_name' => 'MarketPlugin',
'foreign_key' => 'plugin_id',
);
parent::configure($config);
}
}
\ No newline at end of file
...@@ -8,6 +8,10 @@ class MarketRelease extends SimpleORMap { ...@@ -8,6 +8,10 @@ class MarketRelease extends SimpleORMap {
return $GLOBALS['STUDIP_BASE_PATH'] . "/data/pluginmarket_releases"; return $GLOBALS['STUDIP_BASE_PATH'] . "/data/pluginmarket_releases";
} }
static public function findByPlugin_id($plugin_id) {
return self::findBySQL("plugin_id = ? ORDER BY version DESC", array($plugin_id));
}
protected static function configure($config = array()) protected static function configure($config = array())
{ {
$config['db_table'] = 'pluginmarket_releases'; $config['db_table'] = 'pluginmarket_releases';
...@@ -45,6 +49,7 @@ class MarketRelease extends SimpleORMap { ...@@ -45,6 +49,7 @@ class MarketRelease extends SimpleORMap {
rmdirr($tmp_folder); rmdirr($tmp_folder);
unlink($file); unlink($file);
$this['chdate'] = time();
} }
protected function getFilePath() { protected function getFilePath() {
......
...@@ -8,6 +8,7 @@ CREATE TABLE IF NOT EXISTS `pluginmarket_plugins` ( ...@@ -8,6 +8,7 @@ CREATE TABLE IF NOT EXISTS `pluginmarket_plugins` (
`short_description` text NOT NULL, `short_description` text NOT NULL,
`release_type` varchar(255) default NULL, `release_type` varchar(255) default NULL,
`approved` tinyint(2) NOT NULL default '0', `approved` tinyint(2) NOT NULL default '0',
`public` tinyint(2) NOT NULL default '1',
`url` varchar(2000) default NULL, `url` varchar(2000) default NULL,
`classification` enum('firstclass','secondclass','none') NOT NULL default 'none', `classification` enum('firstclass','secondclass','none') NOT NULL default 'none',
`language` enum('de','en','de_en') NOT NULL default 'de', `language` enum('de','en','de_en') NOT NULL default 'de',
...@@ -42,3 +43,21 @@ CREATE TABLE IF NOT EXISTS `pluginmarket_user_plugins` ( ...@@ -42,3 +43,21 @@ CREATE TABLE IF NOT EXISTS `pluginmarket_user_plugins` (
`plugin_id` varchar(32) NOT NULL, `plugin_id` varchar(32) NOT NULL,
PRIMARY KEY (`user_id`,`plugin_id`) PRIMARY KEY (`user_id`,`plugin_id`)
) ENGINE=MyISAM; ) ENGINE=MyISAM;
CREATE TABLE IF NOT EXISTS `pluginmarket_rezension` (
`rezension_id` varchar(32) NOT NULL,
`rezension_txt` text NOT NULL,
`user_id` varchar(32) NOT NULL,
`mkdate` int(20) NOT NULL,
`plugin_id` varchar(32) NOT NULL,
KEY `plugin_id` (`plugin_id`)
) ENGINE=MyISAM;
CREATE TABLE IF NOT EXISTS `pluginmarket_tags` (
`plugin_id` varchar(32) NOT NULL,
`tag` varchar(255) NOT NULL,
KEY (`tag_id`),
KEY `plugin_id` (`plugin_id`)
) ENGINE=MyISAM;
This diff is collapsed.
...@@ -63,7 +63,7 @@ if ($_SERVER['HTTPS'] == 'on' && $_SERVER['SERVER_PORT'] != 443 || ...@@ -63,7 +63,7 @@ if ($_SERVER['HTTPS'] == 'on' && $_SERVER['SERVER_PORT'] != 443 ||
<? if (!$release->isNew()) : ?> <? if (!$release->isNew()) : ?>
<p class="info"> <p class="info">
<?= _("Webhook-URL zum Einfgen in github oder gitlab:") ?> <?= _("Webhook-URL zum Einfgen in github oder gitlab:") ?>
<input type="text" style="border: thin solid #cccccc; background-color: #eeeeee;" value="<?= $DOMAIN_STUDIP.URLHelper::getLink("plugins.php/pluginmarket/update/release/".$release->getId(), array('s' => $release->getSecurityHash()), true) ?>"> <input type="text" style="border: thin solid #cccccc; background-color: #eeeeee; width:100%;" value="<?= $DOMAIN_STUDIP.URLHelper::getLink("plugins.php/pluginmarket/upate/".$release->getId(), array('s' => $release->getSecurityHash()), true) ?>">
</p> </p>
<? if ($domain_warning) : ?> <? if ($domain_warning) : ?>
<p class="info"><?= htmlReady($domain_warning) ?></p> <p class="info"><?= htmlReady($domain_warning) ?></p>
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
<thead> <thead>
<tr> <tr>
<th><?= _("Name") ?></th> <th><?= _("Name") ?></th>
<th><?= _("Letztes Update") ?></th>
<th></th> <th></th>
</tr> </tr>
</thead> </thead>
...@@ -10,7 +11,20 @@ ...@@ -10,7 +11,20 @@
<? if (count($plugins)) : ?> <? if (count($plugins)) : ?>
<? foreach ($plugins as $marketplugin) : ?> <? foreach ($plugins as $marketplugin) : ?>
<tr> <tr>
<td><?= htmlReady($marketplugin['name']) ?></td> <td>
<a href="<?= PluginEngine::getLink($plugin, array(), "presenting/details/".$marketplugin->getId()) ?>">
<?= htmlReady($marketplugin['name']) ?>
</a>
</td>
<td>
<?
$chdate = $marketplugin['chdate'];
foreach ($marketplugin->releases as $release) {
$chdate = max($chdate, $release['chdate']);
}
?>
<?= date("j.n.Y, G:i", $chdate) ?> <?= _("Uhr") ?>
</td>
<td> <td>
<a href="<?= PluginEngine::getLink($plugin, array(), "myplugins/edit/".$marketplugin->getId()) ?>" data-dialog><?= Assets::img("icons/20/blue/edit") ?></a> <a href="<?= PluginEngine::getLink($plugin, array(), "myplugins/edit/".$marketplugin->getId()) ?>" data-dialog><?= Assets::img("icons/20/blue/edit") ?></a>
</td> </td>
......
...@@ -3,6 +3,10 @@ ...@@ -3,6 +3,10 @@
<?= formatReady($marketplugin['description']) ?> <?= formatReady($marketplugin['description']) ?>
</div> </div>
<h2><?= _("Galerie") ?></h2>
<div></div>
<h2><?= _("Releases") ?></h2> <h2><?= _("Releases") ?></h2>
<table class="default"> <table class="default">
<thead> <thead>
...@@ -19,7 +23,7 @@ ...@@ -19,7 +23,7 @@
<? foreach ($marketplugin->releases as $release) : ?> <? foreach ($marketplugin->releases as $release) : ?>
<tr> <tr>
<td> <td>
<a href="<?= PluginEngine::getLink($plugin, array(), "presenting/download/".$release->getId()) ?>"> <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>
...@@ -40,6 +44,53 @@ ...@@ -40,6 +44,53 @@
</tbody> </tbody>
</table> </table>
<?
//Donations, wenn die Datenfelder "Flattr", "Bitcoin-Wallet" gesetzt sind
$author = User::find($marketplugin['user_id']);
$flattr_username = $author['datafields']->findBy("name", "Flattr")->val("content");
$bitcoin_datafield = $author['datafields']->findBy("name", "Bitcoin-Wallet")->val("content");
?>
<? if ($flattr_username || $bitcoin_wallet) : ?>
<h2><?= _("Spenden") ?></h2>
<p class="info">
<?= _("Der Download ist kostenlos, aber man kann dem Autor mit einer Spende danken und zuknftige Entwicklungen anregen.") ?>
</p>
<? endif ?>
<div style="text-align: center;">
<? if ($flattr_username) : ?>
<script id='fbowlml'>(function(i){var f,s=document.getElementById(i);f=document.createElement('iframe');f.src='//api.flattr.com/button/view/?uid=<?= urlencode(studip_utf8encode($flattr_username)) ?>&url='+encodeURIComponent(document.URL)+'&title=<?= urlencode(studip_utf8encode($marketplugin['name']." "._("fr Stud.IP"))) ?>';f.title='Flattr';f.height=62;f.width=55;f.style.borderWidth=0;s.parentNode.insertBefore(f,s);})('fbowlml');</script>
<? endif ?>
<? if ($bitcoin_wallet) : ?>
<script src="http://coinwidget.com/widget/coin.js"></script>
<script>
CoinWidgetCom.go({
wallet_address: "<?= htmlReady($bitcoin_wallet) ?>"
, currency: "bitcoin"
, counter: "count"
, alignment: "bl"
, qrcode: true
, auto_show: false
, lbl_button: "Donate"
, lbl_address: "My Bitcoin Address:"
, lbl_count: "donations"
, lbl_amount: "BTC"
});
</script>
<? endif ?>
</div>
<? if ($marketplugin['user_id'] === $GLOBALS['user']->id) : ?>
<div style="text-align: center"> <div style="text-align: center">
<?= \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)) ?>
</div> </div>
<? endif ?>
\ No newline at end of file
...@@ -15,6 +15,9 @@ ...@@ -15,6 +15,9 @@
max-height: 250px; max-height: 250px;
max-width: 250px; max-width: 250px;
overflow: hidden; overflow: hidden;
-webkit-animation: scaling 700ms ease-out;
-ms-animation: scaling 700ms ease-out;
animation: scaling 700ms ease-out;
} }
.plugins_shortview > article > h1 { .plugins_shortview > article > h1 {
margin: 0px; margin: 0px;
...@@ -40,6 +43,54 @@ ...@@ -40,6 +43,54 @@
font-size: 0.9em; font-size: 0.9em;
color: #879199; color: #879199;
} }
@keyframes scaling {
from {
opacity: 0.8;
transform: scale(0.8,0.8) rotate(-3deg);
}
to {
opacity: 1;
transform: scale(1,1) rotate(0deg);
}
}
/* Safari, Chrome and Opera > 12.1 */
@-webkit-keyframes scaling {
from {
opacity: 0.8;
transform: scale(0.8,0.8) rotate(-3deg);
}
to {
opacity: 1;
transform: scale(1,1) rotate(0deg);
}
}
/* Internet Explorer */
@-ms-keyframes scaling {
from {
opacity: 0.8;
transform: scale(0.8,0.8) rotate(-3deg);
}
to {
opacity: 1;
transform: scale(1,1) rotate(0deg);
}
}
/* Opera < 12.1 */
@-o-keyframes scaling {
from {
opacity: 0.8;
transform: scale(0.8,0.8) rotate(-3deg);
}
to {
opacity: 1;
transform: scale(1,1) rotate(0deg);
}
}
</style> </style>
<? if (isset($new_plugins) && count($new_plugins)) : ?> <? if (isset($new_plugins) && count($new_plugins)) : ?>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment