Commit 1e5ca29c authored by fettesvieh's avatar fettesvieh

--no commit message

--no commit message
parent 98bbe7b0
......@@ -65,8 +65,8 @@ class breadcrumb
{
global $modules, $tpl;
// Brotkrümelspur für das Frontend
if (defined('IN_FRONTEND') && $mode == 1) {
// Brotkrümelspur ausgeben
if ($mode == 1) {
// Zusätzlich zugewiesene Brotkrumen holen und Einträge zählen
$c_steps = count($this->steps);
if ($c_steps > 0) {
......@@ -76,37 +76,13 @@ class breadcrumb
} else {
if (!empty($this->end)) {
$tpl->assign('end', $this->end);
} elseif ($modules->page == 'list' || $modules->page == 'entry') {
} elseif ($modules->page == 'list' || $modules->page == 'acp_list' || $modules->page == 'entry') {
$tpl->assign('end', lang($modules->mod, $modules->mod));
} else {
$tpl->assign('end', lang($modules->mod, $modules->page));
}
}
return $tpl->fetch('common/breadcrumb.html');
// Brotkrümelspur für das Admin Panel
} elseif (defined('IN_ACP') && $mode == 1) {
// Ausgangsstufe der Brotkrümelspur
$breadcrumb[0]['uri'] = uri('acp');
$breadcrumb[0]['title'] = lang('common', 'acp');
// Zusätzlich zugewiesene Brotkrumen holen und Einträge zählen
$c_steps = count($this->steps);
if (($modules->page == 'acp_list' || $modules->page == 'entry') && $c_steps == 0) {
$tpl->assign('end', lang($modules->mod, $modules->mod));
} else {
if ($c_steps > 0) {
$breadcrumb = array_merge($breadcrumb, $this->steps);
$tpl->assign('end', $this->end);
// Falls keine zusätzlichen Brotkrumen angegeben sind, jeweiligen Seitennamen der Moduldatei ausgeben
} else {
$breadcrumb[1]['uri'] = uri($modules->mod . '/acp_list');
$breadcrumb[1]['title'] = lang($modules->mod, $modules->mod);
$tpl->assign('end', lang($modules->mod, $modules->page));
}
}
$tpl->assign('breadcrumb', $breadcrumb);
return $tpl->fetch('common/breadcrumb.html');
// Nur Seitentitel ausgeben
} else {
if (!empty($this->end)) {
......
......@@ -16,12 +16,19 @@
class modules
{
/**
* Die ID eines Eintrages in der Datenbank
* Definieren, ob man sich in der Administration befindet, oder nicht
*
* @var integer
* @var boolean
* @access public
*/
public $id = '0';
public $acp = false;
/**
* Die Aktion, welche z.B. in einem Formular ausgeführt werden soll
*
* @var string
* @access public
*/
public $action = '';
/**
* Die ID einer Kategorie in der Datenbank
*
......@@ -30,12 +37,12 @@ class modules
*/
public $cat = '0';
/**
* Die Aktion, welche z.B: in einem Formular ausgeführt werden soll
* Die ID eines Eintrages in der Datenbank
*
* @var string
* @var integer
* @access public
*/
public $action = '';
public $id = '0';
/**
* Die restlichen URI Parameter
*
......@@ -53,14 +60,15 @@ class modules
{
$query = !empty($_GET['stm']) ? explode('/', $_GET['stm']) : 0;
if (isset($query[1]) && strpos($query[1], 'acp_') !== false) {
define('IN_ACP', true);
$this->acp = true;
//define('CUSTOM_LAYOUT', 'acp.html');
$default_page = 'acp_list';
} else {
define('IN_FRONTEND', true);
$default_page = 'list';
}
$def_page = defined('IN_ACP') ? 'acp_list' : 'list';
$this->mod = !empty($query[0]) ? $query[0] : 'news';
$this->page = !empty($query[1]) ? $query[1] : $def_page;
$this->page = !empty($query[1]) ? $query[1] : $default_page;
$this->cat = !empty($_POST['cat']) ? $_POST['cat'] : '0';
$this->action = !empty($_POST['action']) ? $_POST['action'] : $this->page;
......@@ -113,7 +121,7 @@ class modules
$page = !empty($page) ? $page : $this->page;
if (empty($area)) {
$area = defined('IN_ACP') ? 'acp' : 'frontend';
$area = $this->acp ? 'acp' : 'frontend';
}
if (is_file('modules/' . $module . '/' . $page . '.php')) {
......@@ -142,7 +150,7 @@ class modules
// XML Datei parsen
// Falls die entry.php eines Moduls verwendet werden soll, dann Zugriffslevel für die einzelnen Aktionen parsen
if ($page == 'entry') {
foreach ($xml->xpath('//access/' . $area . '/item/action') as $action) {
foreach ($xml->xpath('//access/entry/action') as $action) {
if (isset($access_level[$module]) &&
(string) $action->level != '0' &&
(string) $action->level <= $access_level[$module] &&
......
This diff is collapsed.
......@@ -9,6 +9,8 @@
ob_start();
define('IN_ACP3', true);
require 'includes/common.php';
$tpl->assign('lang', CONFIG_LANG);
......@@ -22,9 +24,9 @@ if (CONFIG_MAINTENANCE == '1' && defined('IN_FRONTEND')) {
} else {
$auth = new auth;
if (!$auth->is_user() && defined('IN_ACP') && $modules->mod != 'users' && $modules->page != 'login') {
if (!$auth->is_user() && $modules->acp && $modules->mod != 'users' && $modules->page != 'login') {
redirect('users/login');
} elseif ($auth->is_user() && defined('IN_ACP') && empty($_GET['stm'])) {
} elseif ($auth->is_user() && $modules->acp && empty($_GET['stm'])) {
redirect(0, ROOT_DIR);
}
......
......@@ -7,7 +7,7 @@
* @subpackage Modules
*/
if (!defined('IN_ACP'))
if (!defined('IN_ACP3'))
exit;
if (isset($_POST['submit'])) {
......
......@@ -7,7 +7,7 @@
* @subpackage Modules
*/
if (!defined('IN_ACP'))
if (!defined('IN_ACP3'))
exit;
if (!empty($modules->id) && $db->select('id', 'access', 'id = \'' . $modules->id . '\'', 0, 0, 0, 1) == '1') {
......
......@@ -7,7 +7,7 @@
* @subpackage Modules
*/
if (!defined('IN_ACP'))
if (!defined('IN_ACP3'))
exit;
if (isset($_POST['entries']) || isset($modules->gen['entries'])) {
......
......@@ -7,7 +7,7 @@
* @subpackage Modules
*/
if (!defined('IN_ACP'))
if (!defined('IN_ACP3'))
exit;
if (!$modules->check('access', 'entry'))
redirect('errors/403');
......
......@@ -23,21 +23,20 @@
<file>acp_list</file>
<level>2</level>
</item>
<item>
<file>entry</file>
<action>
<name>acp_create</name>
<level>2</level>
</action>
<action>
<name>acp_delete</name>
<level>2</level>
</action>
<action>
<name>acp_edit</name>
<level>2</level>
</action>
</item>
</acp>
<entry>
<action>
<name>acp_create</name>
<level>2</level>
</action>
<action>
<name>acp_delete</name>
<level>2</level>
</action>
<action>
<name>acp_edit</name>
<level>2</level>
</action>
</entry>
</access>
</module>
\ No newline at end of file
......@@ -7,7 +7,7 @@
* @subpackage Modules
*/
if (!defined('IN_ACP'))
if (!defined('IN_ACP3'))
exit;
if (isset($_POST['submit'])) {
......
......@@ -7,7 +7,7 @@
* @subpackage Modules
*/
if (!defined('IN_ACP'))
if (!defined('IN_ACP3'))
exit;
if (!empty($modules->id) && $db->select('id', 'categories', 'id = \'' . $modules->id . '\'', 0, 0, 0, 1) == '1') {
......
......@@ -7,7 +7,7 @@
* @subpackage Modules
*/
if (!defined('IN_ACP'))
if (!defined('IN_ACP3'))
exit;
if (isset($_POST['entries']) || isset($modules->gen['entries'])) {
......
......@@ -7,7 +7,7 @@
* @subpackage Modules
*/
if (!defined('IN_ACP'))
if (!defined('IN_ACP3'))
exit;
if (!$modules->check('categories', 'entry'))
redirect('errors/403');
......
......@@ -23,21 +23,20 @@
<file>acp_list</file>
<level>2</level>
</item>
<item>
<file>entry</file>
<action>
<name>acp_create</name>
<level>2</level>
</action>
<action>
<name>acp_delete</name>
<level>2</level>
</action>
<action>
<name>acp_edit</name>
<level>2</level>
</action>
</item>
</acp>
<entry>
<action>
<name>acp_create</name>
<level>2</level>
</action>
<action>
<name>acp_delete</name>
<level>2</level>
</action>
<action>
<name>acp_edit</name>
<level>2</level>
</action>
</entry>
</access>
</module>
\ No newline at end of file
......@@ -7,7 +7,7 @@
* @subpackage Modules
*/
if (!defined('IN_ACP'))
if (!defined('IN_ACP3'))
exit;
if (!empty($modules->id) && $db->select('id', 'comments', 'id = \'' . $modules->id . '\'', 0, 0, 0, 1) == '1') {
......
......@@ -7,7 +7,7 @@
* @subpackage Modules
*/
if (!defined('IN_ACP'))
if (!defined('IN_ACP3'))
exit;
if (isset($_POST['entries']) || isset($modules->gen['entries'])) {
......
......@@ -7,7 +7,7 @@
* @subpackage Modules
*/
if (!defined('IN_FRONTEND') && !defined('IN_ACP'))
if (!defined('IN_ACP3'))
exit;
if (!$modules->check('comments', 'entry'))
redirect('errors/403');
......
......@@ -18,30 +18,26 @@
<file>acp_list</file>
<level>2</level>
</item>
<item>
<file>entry</file>
<action>
<name>acp_delete_com_by_mod</name>
<level>2</level>
</action>
<action>
<name>acp_delete_comments</name>
<level>2</level>
</action>
<action>
<name>acp_edit</name>
<level>2</level>
</action>
</item>
</acp>
<entry>
<action>
<name>acp_delete_com_by_mod</name>
<level>2</level>
</action>
<action>
<name>acp_delete_comments</name>
<level>2</level>
</action>
<action>
<name>acp_edit</name>
<level>2</level>
</action>
<action>
<name>create</name>
<level>1</level>
</action>
</entry>
<frontend>
<item>
<file>entry</file>
<action>
<name>create</name>
<level>1</level>
</action>
</item>
<item>
<file>functions</file>
<level>1</level>
......
......@@ -7,7 +7,7 @@
* @subpackage Modules
*/
if (!defined('IN_ACP'))
if (!defined('IN_ACP3'))
exit;
if (isset($_POST['submit'])) {
......
......@@ -7,7 +7,7 @@
* @subpackage Modules
*/
if (!defined('IN_FRONTEND') && !defined('IN_ACP'))
if (!defined('IN_ACP3'))
exit;
if (!$modules->check('contact', 'entry'))
redirect('errors/403');
......
......@@ -7,7 +7,7 @@
* @subpackage Modules
*/
if (!defined('IN_FRONTEND'))
if (!defined('IN_ACP3'))
exit;
$breadcrumb->assign(lang('contact', 'contact'), uri('contact'));
......
......@@ -7,7 +7,7 @@
* @subpackage Modules
*/
if (!defined('IN_FRONTEND'))
if (!defined('IN_ACP3'))
exit;
if (isset($_POST['submit'])) {
......
......@@ -13,22 +13,18 @@
<file>acp_list</file>
<level>2</level>
</item>
<item>
<file>entry</file>
<action>
<name>acp_edit</name>
<level>2</level>
</action>
</item>
</acp>
<entry>
<action>
<name>acp_edit</name>
<level>2</level>
</action>
<action>
<name>send_mail</name>
<level>1</level>
</action>
</entry>
<frontend>
<item>
<file>entry</file>
<action>
<name>send_mail</name>
<level>1</level>
</action>
</item>
<item>
<file>imprint</file>
<level>1</level>
......
......@@ -7,7 +7,7 @@
* @subpackage Modules
*/
if (!defined('IN_ACP'))
if (!defined('IN_ACP3'))
exit;
if (isset($_POST['submit'])) {
......
......@@ -7,7 +7,7 @@
* @subpackage Modules
*/
if (!defined('IN_ACP'))
if (!defined('IN_ACP3'))
exit;
if (!empty($modules->id) && $db->select('id', 'emoticons', 'id = \'' . $modules->id . '\'', 0, 0, 0, 1) == '1') {
......
......@@ -7,7 +7,7 @@
* @subpackage Modules
*/
if (!defined('IN_ACP'))
if (!defined('IN_ACP3'))
exit;
if (isset($_POST['entries']) || isset($modules->gen['entries'])) {
......
......@@ -7,7 +7,7 @@
* @subpackage Modules
*/
if (!defined('IN_ACP'))
if (!defined('IN_ACP3'))
exit;
if (!$modules->check('emoticons', 'entry'))
redirect('errors/403');
......
......@@ -22,22 +22,21 @@
<file>acp_list</file>
<level>2</level>
</item>
<item>
<file>entry</file>
<action>
<name>acp_create</name>
<level>2</level>
</action>
<action>
<name>acp_delete</name>
<level>2</level>
</action>
<action>
<name>acp_edit</name>
<level>2</level>
</action>
</item>
</acp>
<entry>
<action>
<name>acp_create</name>
<level>2</level>
</action>
<action>
<name>acp_delete</name>
<level>2</level>
</action>
<action>
<name>acp_edit</name>
<level>2</level>
</action>
</entry>
<frontend>
<item>
<file>functions</file>
......
......@@ -7,7 +7,7 @@
* @subpackage Modules
*/
if (!defined('IN_FRONTEND') && !defined('IN_ACP'))
if (!defined('IN_ACP3'))
exit;
$content = $tpl->fetch('errors/403.html');
......
......@@ -7,7 +7,7 @@
* @subpackage Modules
*/
if (!defined('IN_FRONTEND') && !defined('IN_ACP'))
if (!defined('IN_ACP3'))
exit;
$content = $tpl->fetch('errors/404.html');
......
<?php
if (!defined('IN_FRONTEND'))
if (!defined('IN_ACP3'))
exit;
if (isset($modules->gen['feed'])) {
......
......@@ -7,7 +7,7 @@
* @subpackage Modules
*/
if (!defined('IN_ACP'))
if (!defined('IN_ACP3'))
exit;
if (isset($_POST['submit'])) {
......
......@@ -7,7 +7,7 @@
* @subpackage Modules
*/
if (!defined('IN_ACP'))
if (!defined('IN_ACP3'))
exit;
if (!empty($modules->id) && $db->select('id', 'files', 'id = \'' . $modules->id . '\'', 0, 0, 0, 1) == '1') {
......
......@@ -7,7 +7,7 @@
* @subpackage Modules
*/
if (!defined('IN_ACP'))
if (!defined('IN_ACP3'))
exit;
if (isset($_POST['entries']) || isset($modules->gen['entries'])) {
......
......@@ -7,7 +7,7 @@
* @subpackage Modules
*/
if (!defined('IN_FRONTEND'))
if (!defined('IN_ACP3'))
exit;
$date = ' AND (start = end AND start <= \'' . date_aligned(2, time()) . '\' OR start != end AND start <= \'' . date_aligned(2, time()) . '\' AND end >= \'' . date_aligned(2, time()) . '\')';
......
......@@ -7,7 +7,7 @@
* @subpackage Modules
*/
if (!defined('IN_ACP'))
if (!defined('IN_ACP3'))
exit;
if (!$modules->check('files', 'entry'))
redirect('errors/403');
......
......@@ -7,7 +7,7 @@
* @subpackage Modules
*/
if (!defined('IN_FRONTEND'))
if (!defined('IN_ACP3'))
exit;
$result = $db->select('id, start, link_title, text', 'files', '(start = end AND start <= \'' . date_aligned(2, time()) . '\' OR start != end AND start <= \'' . date_aligned(2, time()) . '\' AND end >= \'' . date_aligned(2, time()) . '\')', 'start DESC, id DESC', 10);
......
......@@ -7,7 +7,7 @@
* @subpackage Modules
*/
if (!defined('IN_FRONTEND'))
if (!defined('IN_ACP3'))
exit;
$date = '(start = end AND start <= \'' . date_aligned(2, time()) . '\' OR start != end AND start <= \'' . date_aligned(2, time()) . '\' AND end >= \'' . date_aligned(2, time()) . '\')';
......
......@@ -7,7 +7,7 @@
* @subpackage Modules
*/
if (!defined('IN_FRONTEND'))
if (!defined('IN_ACP3'))
exit;
if (!empty($modules->cat)) {
......
......@@ -7,7 +7,7 @@
* @subpackage Modules
*/
if (!defined('IN_FRONTEND'))
if (!defined('IN_ACP3'))
exit;
if (!$cache->check('categories_files')) {
......
......@@ -23,22 +23,21 @@
<file>acp_list</file>
<level>2</level>
</item>
<item>
<file>entry</file>
<action>
<name>acp_create</name>
<level>2</level>
</action>
<action>
<name>acp_delete</name>
<level>2</level>
</action>
<action>
<name>acp_edit</name>
<level>2</level>
</action>
</item>
</acp>
<entry>
<action>
<name>acp_create</name>
<level>2</level>
</action>
<action>
<name>acp_delete</name>
<level>2</level>
</action>
<action>
<name>acp_edit</name>
<level>2</level>
</action>
</entry>
<frontend>
<item>
<file>details</file>
......
......@@ -7,7 +7,7 @@
* @subpackage Modules
*/
if (!defined('IN_ACP'))