added some useful models and controllers
This commit is contained in:
parent
9bb724147e
commit
1d4b2a3314
44 changed files with 6424 additions and 0 deletions
26
library/DidgeridooArtwork/Page/Plugin.php
Normal file
26
library/DidgeridooArtwork/Page/Plugin.php
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
<?php
|
||||
class DidgeridooArtwork_Page_Plugin
|
||||
{
|
||||
public static function render($content)
|
||||
{
|
||||
preg_match_all("~\{plugin\=([^\}| ]*)([^\}]*)~", $content, $findings);
|
||||
|
||||
$findings[1] = array_reverse($findings[1]);
|
||||
$findings[2] = array_reverse($findings[2]);
|
||||
|
||||
foreach($findings[1] as $key => $item)
|
||||
{
|
||||
$instanceName = "DidgeridooArtwork_Page_Plugin_" . ucfirst($findings[1][$key]);
|
||||
if(!Katharsis_Autoload::findClass($instanceName))
|
||||
{
|
||||
throw new DidgeridooArtwork_Exception('PagePlugin ' . $instanceName . ' konnte nicht gefunden werden.', 1);
|
||||
}
|
||||
$object = new $instanceName;
|
||||
$plugincontent = (string) $object->render(trim($findings[2][$key]));
|
||||
|
||||
$content = preg_replace("~(.*)\{plugin\=" . $findings[1][$key] . "[^\}]*\}(.*)~", '${1}' . $plugincontent . '${2}', $content);
|
||||
}
|
||||
|
||||
return $content;
|
||||
}
|
||||
}
|
||||
19
library/DidgeridooArtwork/Page/Plugin/Abstract.php
Normal file
19
library/DidgeridooArtwork/Page/Plugin/Abstract.php
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
<?php
|
||||
abstract class DidgeridooArtwork_Page_Plugin_Abstract
|
||||
{
|
||||
protected $_con;
|
||||
protected $_view;
|
||||
|
||||
public final function __construct()
|
||||
{
|
||||
$this->_con = Katharsis_DatabaseConnector::getConnection();
|
||||
$this->_view = Katharsis_View::getInstance();
|
||||
$this->init();
|
||||
}
|
||||
|
||||
public function init()
|
||||
{
|
||||
}
|
||||
|
||||
abstract public function render($parameters);
|
||||
}
|
||||
8
library/DidgeridooArtwork/Page/Plugin/Mail.php
Normal file
8
library/DidgeridooArtwork/Page/Plugin/Mail.php
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<?php
|
||||
class DidgeridooArtwork_Page_Plugin_Mail extends DidgeridooArtwork_Page_Plugin_Abstract
|
||||
{
|
||||
public function render($parameters)
|
||||
{
|
||||
return $this->_view->render('Plugin/mail');
|
||||
}
|
||||
}
|
||||
11
library/DidgeridooArtwork/Page/Plugin/MiniEventList.php
Normal file
11
library/DidgeridooArtwork/Page/Plugin/MiniEventList.php
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<?php
|
||||
class DidgeridooArtwork_Page_Plugin_MiniEventList extends DidgeridooArtwork_Page_Plugin_Abstract
|
||||
{
|
||||
public function render($parameters)
|
||||
{
|
||||
$event = new Event();
|
||||
$this->_view->pluginEvents = $event->getEventList();
|
||||
|
||||
return $this->_view->render('Plugin/minieventlist');
|
||||
}
|
||||
}
|
||||
10
library/DidgeridooArtwork/Page/Plugin/MiniNewsList.php
Normal file
10
library/DidgeridooArtwork/Page/Plugin/MiniNewsList.php
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
class DidgeridooArtwork_Page_Plugin_MiniNewsList extends DidgeridooArtwork_Page_Plugin_Abstract
|
||||
{
|
||||
public function render($parameters)
|
||||
{
|
||||
$news = new News();
|
||||
$this->_view->pluginNews = $news->getActiveNews();
|
||||
return $this->_view->render('Plugin/mininewslist');
|
||||
}
|
||||
}
|
||||
8
library/DidgeridooArtwork/Page/Plugin/Newsletter.php
Normal file
8
library/DidgeridooArtwork/Page/Plugin/Newsletter.php
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<?php
|
||||
class DidgeridooArtwork_Page_Plugin_Newsletter extends DidgeridooArtwork_Page_Plugin_Abstract
|
||||
{
|
||||
public function render($parameters)
|
||||
{
|
||||
return $this->_view->render('Plugin/newsletter');
|
||||
}
|
||||
}
|
||||
11
library/DidgeridooArtwork/Page/Plugin/ShopVorschau.php
Normal file
11
library/DidgeridooArtwork/Page/Plugin/ShopVorschau.php
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<?php
|
||||
class DidgeridooArtwork_Page_Plugin_ShopVorschau extends DidgeridooArtwork_Page_Plugin_Abstract
|
||||
{
|
||||
public function render($parameters)
|
||||
{
|
||||
$event = new Event();
|
||||
$this->_view->pluginEvents = $event->getEventList();
|
||||
|
||||
return $this->_view->render('Plugin/shopvorschau');
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue