added some useful models and controllers
This commit is contained in:
parent
a6873ee6c8
commit
57c0436f14
45 changed files with 6456 additions and 0 deletions
BIN
library/.DS_Store
vendored
Normal file
BIN
library/.DS_Store
vendored
Normal file
Binary file not shown.
BIN
library/DidgeridooArtwork/.DS_Store
vendored
Normal file
BIN
library/DidgeridooArtwork/.DS_Store
vendored
Normal file
Binary file not shown.
BIN
library/DidgeridooArtwork/Controller/.DS_Store
vendored
Normal file
BIN
library/DidgeridooArtwork/Controller/.DS_Store
vendored
Normal file
Binary file not shown.
17
library/DidgeridooArtwork/Controller/Plugin/Access.php
Normal file
17
library/DidgeridooArtwork/Controller/Plugin/Access.php
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
class DidgeridooArtwork_Controller_Plugin_Access extends Katharsis_Controller_Plugin_Abstract
|
||||
{
|
||||
public function preController()
|
||||
{
|
||||
if(Katharsis_Request::getControllerName() != 'admin')
|
||||
{
|
||||
$firstFive = substr(Katharsis_Request::getControllerName(), 0, 5);
|
||||
|
||||
if($firstFive == 'admin' && !Access::isLogged())
|
||||
{
|
||||
Katharsis_Request::setControllerName('admin');
|
||||
Katharsis_Request::setActionName('index');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
13
library/DidgeridooArtwork/Controller/Plugin/Defaults.php
Normal file
13
library/DidgeridooArtwork/Controller/Plugin/Defaults.php
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
<?php
|
||||
class DidgeridooArtwork_Controller_Plugin_Defaults extends Katharsis_Controller_Plugin_Abstract
|
||||
{
|
||||
public function preController()
|
||||
{
|
||||
$ini = parse_ini_file('config/defaults.config.ini', true);
|
||||
$registry = Katharsis_Registry::getInstance();
|
||||
$registry->defaults = $ini;
|
||||
|
||||
$view = Katharsis_View::getInstance();
|
||||
$view->defaults = $ini;
|
||||
}
|
||||
}
|
||||
39
library/DidgeridooArtwork/Controller/Plugin/Navigation.php
Normal file
39
library/DidgeridooArtwork/Controller/Plugin/Navigation.php
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
<?php
|
||||
class DidgeridooArtwork_Controller_Plugin_Navigation extends Katharsis_Controller_Plugin_Abstract
|
||||
{
|
||||
public function preController()
|
||||
{
|
||||
$view = Katharsis_View::getInstance();
|
||||
$sql = "SELECT id, name, controller, action, link FROM navigation WHERE parent_id IS NULL ORDER BY sorting";
|
||||
$view->mainNavigationItems = $this->_con->fetchAll($sql);
|
||||
|
||||
$sql = "SELECT id, parent_id, controller, action FROM navigation WHERE (action = :action AND controller = :controller) OR (action IS NULL AND controller = :controller)";
|
||||
$sql = $this->_con->createStatement($sql, array(
|
||||
'controller' => Katharsis_Request::getControllerName(),
|
||||
'action' => Katharsis_Request::getActionName()
|
||||
));
|
||||
|
||||
if($row = $this->_con->fetchOne($sql))
|
||||
{
|
||||
$activeItemId = ($row['parent_id'] === null) ? $row['id'] : $row['parent_id'];
|
||||
|
||||
$view->activeMenuItem = $activeItemId;
|
||||
|
||||
$sql = "SELECT id, name, controller, action, link FROM navigation WHERE parent_id = :parentId ORDER BY sorting";
|
||||
$sql = $this->_con->createStatement($sql, array('parentId' => $activeItemId));
|
||||
$view->subNavigationItems = $this->_con->fetchAll($sql);
|
||||
|
||||
if($row['parent_id'] !== null)
|
||||
{
|
||||
$view->activeSubMenuItem = $row['id'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$actionpart = ($row['action'] === null) ? ' action IS NULL ' : ' action = :action';
|
||||
$sql = "SELECT id FROM navigation WHERE controller = :controller AND " . $actionpart . " AND parent_id IS NOT NULL";
|
||||
$sql = $this->_con->createStatement($sql, array('controller' => $row['controller'], 'action' => $row['action']));
|
||||
$view->activeSubMenuItem = $this->_con->fetchField($sql);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
9
library/DidgeridooArtwork/Controller/Plugin/Notice.php
Normal file
9
library/DidgeridooArtwork/Controller/Plugin/Notice.php
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
class DidgeridooArtwork_Controller_Plugin_Notice extends Katharsis_Controller_Plugin_Abstract
|
||||
{
|
||||
public function preController()
|
||||
{
|
||||
$view = Katharsis_View::getInstance();
|
||||
$view->notices = DidgeridooArtwork_Notice::get();
|
||||
}
|
||||
}
|
||||
11
library/DidgeridooArtwork/Controller/Plugin/SetNames.php
Normal file
11
library/DidgeridooArtwork/Controller/Plugin/SetNames.php
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<?php
|
||||
class DidgeridooArtwork_Controller_Plugin_SetNames extends Katharsis_Controller_Plugin_Abstract
|
||||
{
|
||||
public function preController()
|
||||
{
|
||||
$view = Katharsis_View::getInstance();
|
||||
$sql = "SET NAMES utf8";
|
||||
|
||||
$this->_con->run($sql);
|
||||
}
|
||||
}
|
||||
16
library/DidgeridooArtwork/Exception.php
Normal file
16
library/DidgeridooArtwork/Exception.php
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
class DidgeridooArtwork_Exception extends Katharsis_Exception
|
||||
{
|
||||
protected $_important = false;
|
||||
|
||||
public function __construct($message, $important = false)
|
||||
{
|
||||
$this->_important = $important;
|
||||
parent::__construct($message);
|
||||
}
|
||||
|
||||
public function handle()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
23
library/DidgeridooArtwork/Notice.php
Normal file
23
library/DidgeridooArtwork/Notice.php
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
class DidgeridooArtwork_Notice
|
||||
{
|
||||
public static function add($notice)
|
||||
{
|
||||
if(!is_array($_SESSION['notices']))
|
||||
{
|
||||
$_SESSION['notices'] = array();
|
||||
}
|
||||
$_SESSION['notices'][] = $notice;
|
||||
}
|
||||
|
||||
public static function get()
|
||||
{
|
||||
$notices = array();
|
||||
if(array_key_exists('notices', $_SESSION))
|
||||
{
|
||||
$notices = $_SESSION['notices'];
|
||||
}
|
||||
$_SESSION['notices'] = array();
|
||||
return $notices;
|
||||
}
|
||||
}
|
||||
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');
|
||||
}
|
||||
}
|
||||
4750
library/Verot/Upload.php
Normal file
4750
library/Verot/Upload.php
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue