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

init plugin

parents
No related branches found
No related tags found
No related merge requests found
<?php
require_once __DIR__."/classes/MarketPlugin.class.php";
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->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")));
}
Navigation::addItem("/pluginmarket", $top);
}
public function getDisplayTitle() {
return _("PluginMarktplatz");
}
}
\ No newline at end of file
assets/topicon.png

530 B

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="16px"
height="16px"
viewBox="0 0 16 16"
shape-rendering="geometricPrecision"
fill="#abb7ce"
id="svg2"
version="1.1"
inkscape:version="0.48.4 r9939"
sodipodi:docname="topicon.svg"
inkscape:export-filename="/home/rasmus/studip/trunk/public/plugins_packages/data-quest/PluginMarket/assets/topicon.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90">
<metadata
id="metadata16">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs14" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="640"
inkscape:window-height="480"
id="namedview12"
showgrid="false"
inkscape:zoom="14.75"
inkscape:cx="8"
inkscape:cy="8"
inkscape:window-x="75"
inkscape:window-y="34"
inkscape:window-maximized="0"
inkscape:current-layer="svg2" />
<g
id="g4">
<g
id="g6">
<polygon
points="8.182,3.179 7.367,1.256 3.587,1.256 2.77,3.179 1.649,3.179 1.65,4.128 14.977,4.119 14.995,13.402 15.928,12.424 15.928,3.179"
id="polygon8" />
<path
d="M0.072,4.756V14h14.279V4.756H0.072z M13.25,12.929H1.041v-7H13.25V12.929z"
id="path10" />
</g>
</g>
<g
transform="matrix(0.42478008,0,0,0.42381531,3.8898949,5.931533)"
id="g4-8">
<path
inkscape:connector-curvature="0"
d="m 11.348,7.312 c 0.788,0.008 1.464,0.478 1.779,1.146 V 4.747 H 9.053 C 9.686,4.418 10.126,3.773 10.134,3.01 10.145,1.91 9.264,1.01 8.164,0.999 7.064,0.988 6.163,1.871 6.152,2.97 6.143,3.745 6.585,4.411 7.229,4.747 H 2.873 V 15.001 H 5.824 C 5.18,14.665 4.739,13.988 4.747,13.213 c 0.011,-1.101 0.912,-1.982 2.011,-1.972 1.1,0.011 1.982,0.912 1.971,2.013 -0.008,0.763 -0.449,1.419 -1.083,1.747 h 5.481 v -4.845 c -0.323,0.679 -1.02,1.146 -1.82,1.137 -1.101,-0.01 -1.983,-0.91 -1.972,-2.01 0.011,-1.1 0.913,-1.982 2.013,-1.971 z"
id="path6" />
</g>
</svg>
assets/topicon_42.png

966 B

<?php
class MarketPlugin extends SimpleORMap {
protected static function configure($config = array())
{
$config['db_table'] = 'pluginmarket_plugins';
$config['has_many']['releases'] = array(
'class_name' => 'MarketRelease',
'on_delete' => 'delete',
'on_store' => 'store',
);
$config['belongs_to']['user'] = array(
'class_name' => 'User',
'foreign_key' => 'user_id',
);
parent::configure($config);
}
}
\ No newline at end of file
<?php
class MarketRelease extends SimpleORMap {
protected static function configure($config = array())
{
$config['db_table'] = 'pluginmarket_releases';
$config['belongs_to']['plugin'] = array(
'class_name' => 'MarketPlugin',
'foreign_key' => 'plugin_id',
);
parent::configure($config);
}
}
\ No newline at end of file
<?php
require_once 'app/controllers/plugin_controller.php';
class MypluginsController extends PluginController {
function before_filter(&$action, &$args)
{
parent::before_filter($action, $args);
Navigation::activateItem("/pluginmarket/myplugins");
}
public function overview_action()
{
$this->plugins = MarketPlugin::findBySQL("1=1");
}
}
\ No newline at end of file
<?php
require_once 'app/controllers/plugin_controller.php';
class PresentingController extends PluginController {
function before_filter(&$action, &$args)
{
parent::before_filter($action, $args);
Navigation::activateItem("/pluginmarket/presenting");
}
public function overview_action() {
$this->plugins = MarketPlugin::findBySQL("1=1");
}
}
\ No newline at end of file
CREATE TABLE IF NOT EXISTS `pluginmarket_plugins` (
`plugin_id` varchar(32) NOT NULL,
`name` varchar(255) NOT NULL,
`description` text,
`license` varchar(255) NOT NULL,
`user_id` varchar(32) NOT NULL,
`in_use` text,
`short_description` text NOT NULL,
`release_type` varchar(255) default NULL,
`approved` tinyint(2) NOT NULL default '0',
`url` varchar(2000) default NULL,
`classification` enum('firstclass','secondclass','none') NOT NULL default 'none',
`language` enum('de','en','de_en') NOT NULL default 'de',
`chdate` int(20) NOT NULL,
`mkdate` int(20) NOT NULL,
PRIMARY KEY (`plugin_id`),
KEY `user_id` (`user_id`)
) ENGINE=MyISAM;
CREATE TABLE IF NOT EXISTS `pluginmarket_releases` (
`release_id` varchar(32) NOT NULL,
`plugin_id` varchar(32) NOT NULL,
`version` varchar(255) NOT NULL,
`studip_min_version` varchar(255) default NULL,
`studip_max_version` varchar(255) default NULL,
`user_id` varchar(32) NOT NULL,
`file_id` varchar(32) default NULL,
`downloads` int(20) NOT NULL default '0',
`release_type` varchar(255) default NULL,
`origin` varchar(255) NOT NULL,
`chdate` int(20) NOT NULL,
`mkdate` int(20) NOT NULL,
PRIMARY KEY (`release_id`),
KEY `plugin_id` (`plugin_id`),
KEY `user_id` (`user_id`)
) ENGINE=MyISAM;
CREATE TABLE IF NOT EXISTS `pluginmarket_user_plugins` (
`user_id` varchar(32) NOT NULL,
`plugin_id` varchar(32) NOT NULL,
PRIMARY KEY (`user_id`,`plugin_id`)
) ENGINE=MyISAM;
\ No newline at end of file
pluginname=PluginMarktplatz
pluginclassname=PluginMarket
origin=data-quest
version=1.0
\ No newline at end of file
<form action="?" method="post">
</form>
\ No newline at end of file
<? foreach ($plugins as $plugin) : ?>
<? endforeach ?>
<?
$sidebar = Sidebar::Get();
$sidebar->setImage(Assets::image_path("sidebar/plugin-sidebar.png"));
$actions = new ActionsWidget();
$actions->addLink(_("Neues Plugin eintragen"), PluginEngine::getURL($plugin, array(), "myplugins/add"));
$sidebar->addWidget($actions);
<style>
.plugins_shortview {
list-style-type: none;
text-align: center;
}
.plugins_shortview > article {
display: inline-block;
margin: 7px;
padding: 8px;
background-color: #3c454e;
box-shadow: 0px 0px 10px rgba(0,0,0,0.3);
color: white;
width: 250px;
height: 250px;
max-height: 250px;
max-width: 250px;
overflow: hidden;
}
.plugins_shortview > article > h1 {
margin: 0px;
border: none;
color: white;
}
.plugins_shortview > article > h1 > a, .plugins_shortview > article > h1 > a:hover {
color: white;
}
.plugins_shortview > article > .image {
margin: 4px;
margin-left: -4px;
margin-right: -4px;
width: calc(100% + 8px);
height: 150px;
background-position: center center;
background-size: auto 100%;
background-repeat: no-repeat;
background-color: white;
box-shadow: inset 0px 0px 3px rgba(0,0,0,0.3);
}
.plugins_shortview > article > .shortdescription {
font-size: 0.9em;
color: #879199;
}
</style>
<div class="plugins_shortview">
<article>
<h1><a href="">BlubberMail</a></h1>
<div class="image" style="background-image: url(http://plugins.studip.de/content/screenshots/a1d85f695cfe506241d398d272ae43f0_thumb);"></div>
<p class="shortdescription">
Blubbern ber Email. Man bekommt Mails, wenn die Diskussion weiter geht, man kann per Mail darauf antworten und man kann Blubberstreams per Mail abonnieren.
</p>
</article>
<article>
<h1>ArchivierungsPlugin</h1>
<div class="image" style="background-image: url(http://plugins.studip.de/content/screenshots/5c6b989378b09deb4b5a79b32a0aa0bc);"></div>
<p class="shortdescription">
Zentrale Archivierung/Lschung von Veranstaltungen durch Admins. Die Veranstaltungen knnen nach verschiedenen Kriterien eingeschrnkt werden.
</p>
</article>
<? foreach ($plugins as $plugin) : ?>
<article>
<h1><a href=""><?= htmlReady($plugin['name']) ?></a></h1>
<div class="image" style="background-image: url(http://plugins.studip.de/content/screenshots/a1d85f695cfe506241d398d272ae43f0_thumb);"></div>
<p class="shortdescription">
<?= htmlReady($plugin['short_description']) ?>
</p>
</article>
<? endforeach ?>
</div>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment