Commit 495498ab authored by fettesvieh's avatar fettesvieh

the breadcrumb() class is now static

parent 86ff8535
<form action="{uri args="acp/pages/delete"}" method="post">
<div id="adm-list">
<a href="{uri args="acp/pages/create"}" title="{lang values="pages|create"}"><img src="{icon path="32/create_page"}" alt="{lang values="pages|create"}" /></a>
<a href="{uri args="acp/pages/adm_list_blocks"}" title="{lang values="pages|adm_list_blocks"}"><img src="{icon path="32/blocks_modules"}" alt="{lang values="pages|manage_blocks"}" /></a>
<a href="{uri args="acp/pages/adm_list_blocks"}" title="{lang values="pages|adm_list_blocks"}"><img src="{icon path="32/blocks_modules"}" alt="{lang values="pages|adm_list_blocks"}" /></a>
<input type="image" src="{icon path="32/delete"}" alt="{lang values="common|delete_marked"}" title="{lang values="common|delete_marked"}" />
<h2>{lang values="pages|pages_overview"}</h2>
</div>
......
......@@ -21,14 +21,14 @@ class breadcrumb
* @var array
* @access protected
*/
protected $steps = array();
protected static $steps = array();
/**
* Das Ende der Brotkrümelspur
*
* @var string
* @access protected
*/
protected $end = '';
protected static $end = '';
/**
* Zuweisung der jewiligen Stufen der Brotkrümelspur
......@@ -39,17 +39,17 @@ class breadcrumb
* Der zum $title zugehörige Hyperlink
* @return array
*/
public function assign($title, $uri = 0)
public static function assign($title, $uri = 0)
{
static $i = 0;
if (!empty($uri)) {
$this->steps[$i]['uri'] = $uri;
$this->steps[$i]['title'] = $title;
self::$steps[$i]['uri'] = $uri;
self::$steps[$i]['title'] = $title;
$i++;
return;
} else {
$this->end = $title;
self::$end = $title;
return;
}
}
......@@ -61,7 +61,7 @@ class breadcrumb
* 2 = Nur Seitentitel ausgeben
* @return string
*/
public function output($mode = 1)
public static function output($mode = 1)
{
global $modules, $tpl;
......@@ -71,13 +71,13 @@ class breadcrumb
// Brotkrümelspur für das Frontend
if (defined('IN_ACP3') && $mode == 1) {
// Zusätzlich zugewiesene Brotkrumen an Smarty übergeben
if (count($this->steps) > 0) {
$tpl->assign('breadcrumb', $this->steps);
$tpl->assign('end', $this->end);
if (count(self::$steps) > 0) {
$tpl->assign('breadcrumb', self::$steps);
$tpl->assign('end', self::$end);
// Falls keine zusätzlichen Brotkrumen angegeben sind, jeweiligen Seitennamen der Moduldatei ausgeben
} else {
if (!empty($this->end)) {
$tpl->assign('end', $this->end);
if (!empty(self::$end)) {
$tpl->assign('end', self::$end);
} elseif ($page == 'list') {
$tpl->assign('end', lang($module, $module));
} else {
......@@ -87,25 +87,25 @@ class breadcrumb
return $tpl->fetch('common/breadcrumb.html');
// Brotkrümelspur für das Admin Panel
} elseif (defined('IN_ADM') && $mode == 1) {
if ($page == 'adm_list' && count($this->steps) == 0 && empty($this->end)) {
$this->assign(lang('common', 'acp'), uri('acp'));
$tpl->assign('breadcrumb', $this->steps);
if ($page == 'adm_list' && count(self::$steps) == 0 && empty(self::$end)) {
self::assign(lang('common', 'acp'), uri('acp'));
$tpl->assign('breadcrumb', self::$steps);
$tpl->assign('end', lang($module, $module));
} elseif (count($this->steps) > 0 || !empty($this->end)) {
$tpl->assign('breadcrumb', $this->steps);
$tpl->assign('end', $this->end);
} elseif (count(self::$steps) > 0 || !empty(self::$end)) {
$tpl->assign('breadcrumb', self::$steps);
$tpl->assign('end', self::$end);
// Falls keine zusätzlichen Brotkrumen angegeben sind, jeweiligen Seitennamen der Moduldatei ausgeben
} else {
$this->assign(lang('common', 'acp'), uri('acp'));
$this->assign(lang($module, $module), uri('acp/' . $module));
$tpl->assign('breadcrumb', $this->steps);
self::assign(lang('common', 'acp'), uri('acp'));
self::assign(lang($module, $module), uri('acp/' . $module));
$tpl->assign('breadcrumb', self::$steps);
$tpl->assign('end', lang($module, $page));
}
return $tpl->fetch('common/breadcrumb.html');
// Nur Seitentitel ausgeben
} else {
if (!empty($this->end)) {
return $this->end;
if (!empty(self::$end)) {
return self::$end;
} else {
return $page != 'list' && $page != 'adm_list' ? lang($module, $page) : lang($module, $module);
}
......
......@@ -21,7 +21,7 @@ class cache
* @param string $filename
* @return boolean
*/
static public function check($filename)
public static function check($filename)
{
if (is_file(ACP3_ROOT . 'cache/sql_' . md5($filename) . '.php')) {
return true;
......@@ -37,7 +37,7 @@ class cache
* Datensätze der SQL Abfrage
* @return boolean
*/
static public function create($filename, $sql_results)
public static function create($filename, $sql_results)
{
if (!empty($sql_results)) {
$bool = @file_put_contents(ACP3_ROOT . 'cache/sql_' . md5($filename) . '.php', serialize($sql_results));
......@@ -55,7 +55,7 @@ class cache
* Zu löschende Datei
* @return boolean
*/
static public function delete($filename)
public static function delete($filename)
{
if (self::check($filename)) {
return unlink(ACP3_ROOT . 'cache/sql_' . md5($filename) . '.php');
......@@ -69,7 +69,7 @@ class cache
* Auszugebende Datei
* @return mixed
*/
static public function output($filename)
public static function output($filename)
{
if (self::check($filename)) {
return unserialize(@file_get_contents(ACP3_ROOT . 'cache/sql_' . md5($filename) . '.php'));
......@@ -79,7 +79,7 @@ class cache
/**
* Löscht alle gecacheten SQL Queries
*/
static public function purge()
public static function purge()
{
$cache_dir = scandir('cache');
$c_cache_dir = count($cache_dir);
......
......@@ -22,7 +22,7 @@ class config
* Zu schreibende Daten
* @return boolean
*/
static public function general($data)
public static function general($data)
{
$path = ACP3_ROOT . 'includes/config.php';
if (is_writable($path)) {
......@@ -49,7 +49,7 @@ class config
* @param array $data
* @return boolean
*/
static public function module($module, $data)
public static function module($module, $data)
{
$path = ACP3_ROOT . 'modules/' . $module . '/module.xml';
if (!preg_match('=/=', $module) && file_exists($path) && is_writable($path)) {
......@@ -82,7 +82,7 @@ class config
* @param string $module
* @return mixed
*/
static public function output($module)
public static function output($module)
{
static $settings = array();
......
......@@ -22,7 +22,7 @@ class validate
* @param string $hash
* @return boolean
*/
static public function captcha($input, $hash)
public static function captcha($input, $hash)
{
if (preg_match('/^[a-zA-Z0-9]+$/', $input) && strlen($hash) == 32 && preg_match('/^[a-z0-9]+$/', $hash)) {
$path = ACP3_ROOT . 'modules/captcha/generated/' . $hash . strtolower($input);
......@@ -40,7 +40,7 @@ class validate
* Der zu überprüfende Wert
* @return boolean
*/
static public function date($value)
public static function date($value)
{
return strtotime($value, dateAligned(2, time())) == -1 ? false : true;
}
......@@ -53,7 +53,7 @@ class validate
* Zu überprüfende E-Mail-Adresse
* @return boolean
*/
static public function email($var)
public static function email($var)
{
$pattern = '/^((\"[^\"\f\n\r\t\v\b]+\")|([\w\!\#\$\%\&\'\*\+\-\~\/\^\`\|\{\}]+(\.[\w\!\#\$\%\&\'\*\+\-\~\/\^\`\|\{\}]+)*))@((\[(((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9])))\])|(((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9])))|((([A-Za-z0-9\-])+\.)+[A-Za-z\-]+))$/';
......@@ -65,7 +65,7 @@ class validate
* @param string $string
* @return boolean
*/
static public function isMD5($string)
public static function isMD5($string)
{
return preg_match('/^[a-f0-9]+$/', $string) && strlen($string) == 32 ? true : false;
}
......@@ -75,7 +75,7 @@ class validate
* @param mixed $var
* @return boolean
*/
static public function isNumber($var)
public static function isNumber($var)
{
return preg_match('/^(\d+)$/', $var);
}
......@@ -86,7 +86,7 @@ class validate
* Zu überprüfendes Bild
* @return boolean
*/
static public function isPicture($file, $width = '', $height = '', $filesize = '')
public static function isPicture($file, $width = '', $height = '', $filesize = '')
{
$info = getimagesize($file);
......
......@@ -51,7 +51,6 @@ $tpl->assign('DESCRIPTION', CONFIG_META_DESCRIPTION);
// Klassen initialisieren
$db = new db;
$modules = new modules;
$breadcrumb = new breadcrumb;
require_once ACP3_ROOT . 'includes/functions.php';
?>
\ No newline at end of file
<?php
function smarty_function_load_module($params, &$smarty)
{
global $auth, $breadcrumb, $db, $modules, $tpl;
global $auth, $db, $modules, $tpl;
$module = explode('|', $params['module']);
$path = ACP3_ROOT . 'modules/' . $module[0] . '/' . $module[1] . '.php';
if (file_exists($path)) {
include $path;
if ($modules->check($module[0], $module[1])) {
include ACP3_ROOT . 'modules/' . $module[0] . '/' . $module[1] . '.php';
}
}
/* vim: set expandtab: */
......
......@@ -37,8 +37,8 @@ if (CONFIG_MAINTENANCE == '1' && defined('IN_ACP3')) {
}
// Seitentitel und Brotkrümelspur setzen
$tpl->assign('TITLE', $breadcrumb->output(2));
$tpl->assign('BREADCRUMB', $breadcrumb->output());
$tpl->assign('TITLE', breadcrumb::output(2));
$tpl->assign('BREADCRUMB', breadcrumb::output());
// Falls ein Modul ein eigenes Layout verwenden möchte, dieses auch verweden
$tpl->display(defined('CUSTOM_LAYOUT') ? CUSTOM_LAYOUT : 'layout.html');
......
......@@ -10,7 +10,7 @@
if (! defined('IN_ADM'))
exit();
$breadcrumb->assign(lang('common', 'acp'));
breadcrumb::assign(lang('common', 'acp'));
// Module einholen
$mod_list = $modules->modulesList();
......
......@@ -27,9 +27,9 @@ if (empty($module) || !empty($module) && $db->select('id', 'comments', 'module =
}
} elseif (!empty($module) && $db->select('id', 'comments', 'module = \'' . $module . '\'', 0, 0, 0, 1) > '0') {
//Brotkrümelspur
$breadcrumb->assign(lang('common', 'acp'), uri('acp'));
$breadcrumb->assign(lang('comments', 'comments'), uri('acp/comments'));
$breadcrumb->assign(lang($module, $module));
breadcrumb::assign(lang('common', 'acp'), uri('acp'));
breadcrumb::assign(lang('comments', 'comments'), uri('acp/comments'));
breadcrumb::assign(lang($module, $module));
$comments = $db->select('id, ip, date, name, message', 'comments', 'module = \'' . $module . '\'', 'date DESC', POS, CONFIG_ENTRIES);
$c_comments = count($comments);
......
......@@ -14,10 +14,10 @@ if (validate::isNumber($modules->id) && $db->select('id', 'comments', 'id = \''
$comment = $db->select('name, message, module', 'comments', 'id = \'' . $modules->id . '\'');
$comment[0]['module'] = $db->escape($comment[0]['module'], 3);
$breadcrumb->assign(lang('common', 'acp'), uri('acp'));
$breadcrumb->assign(lang('comments', 'comments'), uri('acp/comments'));
$breadcrumb->assign(lang($comment[0]['module'], $comment[0]['module']), uri('acp/comments/adm_list/module_' . $comment[0]['module']));
$breadcrumb->assign(lang('comments', 'edit'));
breadcrumb::assign(lang('common', 'acp'), uri('acp'));
breadcrumb::assign(lang('comments', 'comments'), uri('acp/comments'));
breadcrumb::assign(lang($comment[0]['module'], $comment[0]['module']), uri('acp/comments/adm_list/module_' . $comment[0]['module']));
breadcrumb::assign(lang('comments', 'edit'));
if (isset($_POST['submit'])) {
$form = $_POST['form'];
......
......@@ -10,8 +10,8 @@
if (!defined('IN_ACP3'))
exit;
$breadcrumb->assign(lang('contact', 'contact'), uri('contact'));
$breadcrumb->assign(lang('contact', 'imprint'));
breadcrumb::assign(lang('contact', 'contact'), uri('contact'));
breadcrumb::assign(lang('contact', 'imprint'));
$contact = config::output('contact');
......
......@@ -31,9 +31,9 @@ if (validate::isNumber($modules->id) && $db->select('id', 'files', 'id = \'' . $
}
} else {
// Brotkrümelspur
$breadcrumb->assign(lang('files', 'files'), uri('files'));
$breadcrumb->assign($file[0]['category_name'], uri('files/files/cat_' . $file[0]['category_id']));
$breadcrumb->assign($file[0]['link_title']);
breadcrumb::assign(lang('files', 'files'), uri('files'));
breadcrumb::assign($file[0]['category_name'], uri('files/files/cat_' . $file[0]['category_id']));
breadcrumb::assign($file[0]['link_title']);
$file[0]['size'] = !empty($file[0]['size']) ? $file[0]['size'] : lang('files', 'unknown_filesize');
$file[0]['date'] = dateAligned(1, $file[0]['start']);
......
......@@ -11,9 +11,9 @@ if (!defined('IN_ACP3'))
exit;
if (validate::isNumber($modules->cat) && $db->select('id', 'categories', 'id = \'' . $modules->cat . '\'', 0, 0, 0, 1) == '1') {
$breadcrumb->assign(lang('files', 'files'), uri('files'));
breadcrumb::assign(lang('files', 'files'), uri('files'));
$category = $db->select('name', 'categories', 'id = \'' . $modules->cat . '\'');
$breadcrumb->assign($category[0]['name']);
breadcrumb::assign($category[0]['name']);
$date = ' AND (start = end AND start <= \'' . dateAligned(2, time()) . '\' OR start != end AND start <= \'' . dateAligned(2, time()) . '\' AND end >= \'' . dateAligned(2, time()) . '\')';
$files = $db->select('id, start, file, size, link_title', 'files', 'category_id = \'' . $modules->cat . '\'' . $date, 'start DESC, end DESC');
......
......@@ -14,10 +14,10 @@ if (validate::isNumber($modules->id) && $db->select('id', 'gallery', 'id = \'' .
$pic = validate::isNumber($modules->pic) ? $modules->pic : 1;
$gallery = $db->select('name', 'gallery', 'id = \'' . $modules->id . '\'');
$breadcrumb->assign(lang('common', 'acp'), uri('acp'));
$breadcrumb->assign(lang('gallery', 'gallery'), uri('acp/gallery'));
$breadcrumb->assign($gallery[0]['name'], uri('acp/gallery/edit_gallery/id_' . $modules->id));
$breadcrumb->assign(lang('gallery', 'add_picture'));
breadcrumb::assign(lang('common', 'acp'), uri('acp'));
breadcrumb::assign(lang('gallery', 'gallery'), uri('acp/gallery'));
breadcrumb::assign($gallery[0]['name'], uri('acp/gallery/edit_gallery/id_' . $modules->id));
breadcrumb::assign(lang('gallery', 'add_picture'));
if (isset($_POST['submit'])) {
$file['tmp_name'] = $_FILES['file']['tmp_name'];
......
......@@ -17,9 +17,9 @@ if (validate::isNumber($modules->id) && $db->select('g.id', 'gallery AS g, ' . C
if (count($picture) > 0) {
// Brotkrümelspur
$breadcrumb->assign(lang('gallery', 'gallery'), uri('gallery'));
$breadcrumb->assign($picture[0]['name'], uri('gallery/pics/id_' . $picture[0]['gallery_id']));
$breadcrumb->assign(lang('gallery', 'details'));
breadcrumb::assign(lang('gallery', 'gallery'), uri('gallery'));
breadcrumb::assign($picture[0]['name'], uri('gallery/pics/id_' . $picture[0]['gallery_id']));
breadcrumb::assign(lang('gallery', 'details'));
$picture[0]['description'] = $db->escape($picture[0]['description'], 3);
$tpl->assign('picture', $picture[0]);
......
......@@ -13,9 +13,9 @@ if (!defined('IN_ADM'))
if (validate::isNumber($modules->id) && $db->select('id', 'gallery', 'id = \'' . $modules->id . '\'', 0, 0, 0, 1) == '1') {
$gallery = $db->select('start, end, name', 'gallery', 'id = \'' . $modules->id . '\'');
$breadcrumb->assign(lang('common', 'acp'), uri('acp'));
$breadcrumb->assign(lang('gallery', 'gallery'), uri('acp/gallery'));
$breadcrumb->assign($gallery[0]['name']);
breadcrumb::assign(lang('common', 'acp'), uri('acp'));
breadcrumb::assign(lang('gallery', 'gallery'), uri('acp/gallery'));
breadcrumb::assign($gallery[0]['name']);
if (isset($_POST['submit'])) {
$form = $_POST['form'];
......
......@@ -13,10 +13,10 @@ if (!defined('IN_ADM'))
if (validate::isNumber($modules->id) && $db->select('id', 'galpics', 'id = \'' . $modules->id . '\'', 0, 0, 0, 1) == '1') {
$picture = $db->select('p.pic, p.gallery_id, p.file, p.description, g.name AS gallery_name', 'galpics AS p, ' . CONFIG_DB_PRE . 'gallery AS g', 'p.id = \'' . $modules->id . '\' AND p.gallery_id = g.id');
$breadcrumb->assign(lang('common', 'acp'), uri('acp'));
$breadcrumb->assign(lang('gallery', 'gallery'), uri('acp/gallery'));
$breadcrumb->assign($picture[0]['gallery_name'], uri('acp/gallery/edit_gallery/id_' . $picture[0]['gallery_id']));
$breadcrumb->assign(lang('gallery', 'edit_picture'));
breadcrumb::assign(lang('common', 'acp'), uri('acp'));
breadcrumb::assign(lang('gallery', 'gallery'), uri('acp/gallery'));
breadcrumb::assign($picture[0]['gallery_name'], uri('acp/gallery/edit_gallery/id_' . $picture[0]['gallery_id']));
breadcrumb::assign(lang('gallery', 'edit_picture'));
if (isset($_POST['submit'])) {
if (!empty($_FILES['file']['tmp_name']) && $_FILES['file']['size'] > '0') {
......
......@@ -23,8 +23,8 @@ if (validate::isNumber($modules->id) && $db->select('id', 'gallery', 'id = \'' .
$gallery_name = $db->select('name', 'gallery', 'id = \'' . $modules->id . '\'');
// Brotkrümelspur
$breadcrumb->assign(lang('gallery', 'gallery'), uri('gallery'));
$breadcrumb->assign($gallery_name[0]['name']);
breadcrumb::assign(lang('gallery', 'gallery'), uri('gallery'));
breadcrumb::assign($gallery_name[0]['name']);
$tpl->assign('gallery', $gallery);
}
......
......@@ -10,8 +10,8 @@
if (!defined('IN_ACP3'))
exit;
$breadcrumb->assign(lang('guestbook', 'guestbook'), uri('guestbook'));
$breadcrumb->assign(lang('guestbook', 'create'));
breadcrumb::assign(lang('guestbook', 'guestbook'), uri('guestbook'));
breadcrumb::assign(lang('guestbook', 'create'));
if (isset($_POST['submit'])) {
$ip = $_SERVER['REMOTE_ADDR'];
......
......@@ -21,11 +21,11 @@ if (validate::isNumber($modules->id) && $db->select('id', 'news', 'id = \'' . $m
// Brotkrümelspur
$category = $db->select('name', 'categories', 'id = \'' . $news[0]['category_id'] . '\'');
$breadcrumb->assign(lang('news', 'news'), uri('news'));
breadcrumb::assign(lang('news', 'news'), uri('news'));
if (count($category) > 0) {
$breadcrumb->assign($category[0]['name'], uri('news/list/cat_' . $news[0]['category_id']));
breadcrumb::assign($category[0]['name'], uri('news/list/cat_' . $news[0]['category_id']));
}
$breadcrumb->assign($news[0]['headline']);
breadcrumb::assign($news[0]['headline']);
$news[0]['date'] = dateAligned(1, $news[0]['start']);
$news[0]['headline'] = $news[0]['headline'];
......
......@@ -10,9 +10,9 @@
if (!defined('IN_ADM'))
exit;
$breadcrumb->assign(lang('common', 'acp'), uri('acp'));
$breadcrumb->assign(lang('pages', 'pages'), uri('acp/pages'));
$breadcrumb->assign(lang('pages', 'adm_list_blocks'));
breadcrumb::assign(lang('common', 'acp'), uri('acp'));
breadcrumb::assign(lang('pages', 'pages'), uri('acp/pages'));
breadcrumb::assign(lang('pages', 'adm_list_blocks'));
$blocks = $db->select('id, index_name, title', 'pages_blocks', 0, 'title ASC, index_name ASC', POS, CONFIG_ENTRIES);
$c_blocks = count($blocks);
......
......@@ -10,10 +10,10 @@
if (!defined('IN_ADM'))
exit;
$breadcrumb->assign(lang('common', 'acp'), uri('acp'));
$breadcrumb->assign(lang('pages', 'pages'), uri('acp/pages'));
$breadcrumb->assign(lang('pages', 'adm_list_blocks'), uri('acp/pages/adm_list_blocks'));
$breadcrumb->assign(lang('pages', 'create_block'));
breadcrumb::assign(lang('common', 'acp'), uri('acp'));
breadcrumb::assign(lang('pages', 'pages'), uri('acp/pages'));
breadcrumb::assign(lang('pages', 'adm_list_blocks'), uri('acp/pages/adm_list_blocks'));
breadcrumb::assign(lang('pages', 'create_block'));
if (isset($_POST['submit'])) {
$form = $_POST['form'];
......
......@@ -10,10 +10,10 @@
if (!defined('IN_ADM'))
exit;
$breadcrumb->assign(lang('common', 'acp'), uri('acp'));
$breadcrumb->assign(lang('pages', 'pages'), uri('acp/pages'));
$breadcrumb->assign(lang('pages', 'adm_list_blocks'), uri('acp/pages/adm_list_blocks'));
$breadcrumb->assign(lang('pages', 'delete_blocks'));
breadcrumb::assign(lang('common', 'acp'), uri('acp'));
breadcrumb::assign(lang('pages', 'pages'), uri('acp/pages'));
breadcrumb::assign(lang('pages', 'adm_list_blocks'), uri('acp/pages/adm_list_blocks'));
breadcrumb::assign(lang('pages', 'delete_blocks'));
if (isset($_POST['entries']) && is_array($_POST['entries']))
$entries = $_POST['entries'];
......
......@@ -11,10 +11,10 @@ if (!defined('IN_ADM'))
exit;
if (validate::isNumber($modules->id) && $db->select('id', 'pages_blocks', 'id = \'' . $modules->id . '\'', 0, 0, 0, 1) == '1') {
$breadcrumb->assign(lang('common', 'acp'), uri('acp'));
$breadcrumb->assign(lang('pages', 'pages'), uri('acp/pages'));
$breadcrumb->assign(lang('pages', 'adm_list_blocks'), uri('acp/pages/adm_list_blocks'));
$breadcrumb->assign(lang('pages', 'edit_block'));
breadcrumb::assign(lang('common', 'acp'), uri('acp'));
breadcrumb::assign(lang('pages', 'pages'), uri('acp/pages'));
breadcrumb::assign(lang('pages', 'adm_list_blocks'), uri('acp/pages/adm_list_blocks'));
breadcrumb::assign(lang('pages', 'edit_block'));
if (isset($_POST['submit'])) {
$form = $_POST['form'];
......
......@@ -23,8 +23,46 @@ if (validate::isNumber($modules->id) && $db->select('id', 'pages', 'id = \'' . $
* Erweitert die Breadcrumb Klasse, damit für die statischen Seiten die Brotkrümelspur erstellt werden kann
*
*/
class breadcrumb_pages extends breadcrumb
class breadcrumb
{
/**
* Enthält alle Schritte der Brotkrümelspur
*
* @var array
* @access protected
*/
protected static $steps = array();
/**
* Das Ende der Brotkrümelspur
*
* @var string
* @access protected
*/
protected static $end = '';
/**
* Zuweisung der jewiligen Stufen der Brotkrümelspur
*
* @param string $title
* Bezeichnung der jeweiligen Stufe der Brotkrume
* @param string $uri
* Der zum $title zugehörige Hyperlink
* @return array
*/
public static function assign($title, $uri = 0)
{
static $i = 0;
if (!empty($uri)) {
self::$steps[$i]['uri'] = $uri;
self::$steps[$i]['title'] = $title;
$i++;
return;
} else {
self::$end = $title;
return;
}
}
/**
* Gibt die Brotkrümelspur bzw. den Seitentitel einer statischen Seite aus
*
......@@ -35,7 +73,7 @@ if (validate::isNumber($modules->id) && $db->select('id', 'pages', 'id = \'' . $
* ID der jeweiligen statischen Seite
* @return string
*/
public function output($mode = 1, $id = 0)
public static function output($mode = 1, $id = 0)
{
global $db, $modules, $tpl;
......@@ -45,19 +83,19 @@ if (validate::isNumber($modules->id) && $db->select('id', 'pages', 'id = \'' . $
$page = $db->select('parent, title', 'pages', 'id = \'' . $id . '\' AND mode = \'1\'');
// Brotkrümelspur ausgeben
if ($mode == 1) {
if (empty($this->end)) {
$this->end = $page[0]['title'];
if (empty(self::$end)) {
self::$end = $page[0]['title'];
}
if ($db->select('parent', 'pages', 'id = \'' . $page[0]['parent'] . '\' AND mode = \'1\'', 0, 0, 0, 1) > 0) {
$parent = $db->select('title', 'pages', 'id = \'' . $page[0]['parent'] . '\' AND mode = \'1\'');
$this->assign($parent[0]['title'], uri('pages/list/id_' . $page[0]['parent']));
self::assign($parent[0]['title'], uri('pages/list/id_' . $page[0]['parent']));
return $this->output(1, $page[0]['parent']);
return self::output(1, $page[0]['parent']);
}
$pages = $this->steps;
$pages = self::$steps;
krsort($pages);
$tpl->assign('breadcrumb', $pages);
$tpl->assign('end', $this->end);
$tpl->assign('end', self::$end);
return $tpl->fetch('common/breadcrumb.html');
// Nur Seitentitel ausgeben
} else {
......@@ -66,8 +104,6 @@ if (validate::isNumber($modules->id) && $db->select('id', 'pages', 'id = \'' . $
}
}
$breadcrumb = new breadcrumb_pages;
$tpl->assign('text', $db->escape($page[0]['text'], 3));
} elseif ($page[0]['mode'] == '2') {
redirect($page[0]['uri']);
......
......@@ -11,8 +11,8 @@ if (!defined('IN_ACP3'))
exit;
if (validate::isNumber($modules->id) && $db->select('id', 'poll_question', 'id = \'' . $modules->id . '\' AND start <= \'' . dateAligned(2, time()) . '\'', 0, 0, 0, 1) == 1) {
$breadcrumb->assign(lang('polls', 'polls'), uri('polls'));
$breadcrumb->assign(lang('polls', 'result'));
breadcrumb::assign(lang('polls', 'polls'), uri('polls'));
breadcrumb::assign(lang('polls', 'result'));
$question = $db->select('question', 'poll_question');
$answers = $db->select('id, text', 'poll_answers', 'poll_id = \'' . $modules->id . '\'', 'id ASC');
......
......@@ -14,8 +14,8 @@ $date = ' AND (start = end AND start <= \'' . dateAligned(2, time()) . '\' OR st
if (validate::isNumber($modules->id) && $db->select('id', 'poll_question', 'id = \'' . $modules->id . '\'' . $date, 0, 0, 0, 1) == 1) {
// Brotkrümelspur
$breadcrumb->assign(lang('polls', 'polls'), uri('polls'));
$breadcrumb->assign(lang('polls', 'vote'));
breadcrumb::assign(lang('polls', 'polls'), uri('polls'));
breadcrumb::assign(lang('polls', 'vote'));
if (isset($_POST['submit']) && isset($_POST['answer']) && validate::isNumber($_POST['answer'])) {
$answer = $_POST['answer'];
......
......@@ -10,10 +10,10 @@
if (!defined('IN_ADM'))
exit;
$breadcrumb->assign(lang('common', 'acp'), uri('acp'));
$breadcrumb->assign(lang('system', 'system'), uri('acp/system'));
$breadcrumb->assign(lang('system', 'extensions'), uri('acp/system/extensions'));
$breadcrumb->assign(lang('system', 'designs'));
breadcrumb::assign(lang('common', 'acp'), uri('acp'));
breadcrumb::assign(lang('system', 'system'), uri('acp/system'));
breadcrumb::assign(lang('system', 'extensions'), uri('acp/system/extensions'));
breadcrumb::assign(lang('system', 'designs'));
if ($modules->dir) {
$dir = is_file(ACP3_ROOT . 'designs/' . $modules->dir . '/info.php') ? $modules->dir : 0;
......
......@@ -10,10 +10,10 @@
if (!defined('IN_ADM'))
exit;
$breadcrumb->assign(lang('common', 'acp'), uri('acp'));
$breadcrumb->assign(lang('system', 'system'), uri('acp/system'));
$breadcrumb->assign(lang('system', 'extensions'), uri('acp/system/extensions'));
$breadcrumb->assign(lang('system', 'languages'));
breadcrumb::assign(lang('common', 'acp'), uri('acp'));
breadcrumb::assign(lang('system', 'system'), uri('acp/system'));
breadcrumb::assign(lang('system', 'extensions'), uri('acp/system/extensions'));
breadcrumb::assign(lang('system', 'languages'));
if ($modules->dir) {
$dir = is_file(ACP3_ROOT . 'languages/' . $modules->dir . '/info.php') ? $modules->dir : 0;
......
......@@ -10,10 +10,10 @@
if (!defined('IN_ADM'))
exit;
$breadcrumb->assign(lang('common', 'acp'), uri('acp'));
$breadcrumb->assign(lang('system', 'system'), uri('acp/system'));
$breadcrumb->assign(lang('system', 'extensions'), uri('acp/system/extensions'));
$breadcrumb->assign(lang('system', 'modules'));
breadcrumb::assign(lang('common', 'acp'), uri('acp'));
breadcrumb::assign(lang('system', 'system'), uri('acp/system'));
breadcrumb::assign(lang('system', 'extensions'), uri('acp/system/extensions'));
breadcrumb::assign(lang('system', 'modules'));