Commit cbcd6ca4 authored by fettesvieh's avatar fettesvieh

- added a stub for the acp welcome page

- refsctored the breadcrumbs class
- removed the last entry.php from the polls module
- fixed a bug with the combo_box function
parent 11482c56
......@@ -6,7 +6,7 @@
<li><a href="{uri args="users/home"}">{lang values="users|home"}</a></li>
{if $nav_mods}
<li>
<a href="#" id="nav-mods-link">{lang values="users|administration"}</a>
<a href="{uri args="acp"}" id="nav-mods-link">{lang values="users|administration"}</a>
<ul id="nav-mods" class="hide">
{foreach from=$nav_mods item=row}
<li><a href="{uri args="acp/`$row.dir`"}">{$row.name}</a></li>
......
......@@ -67,16 +67,15 @@ class breadcrumb
// Brotkrümelspur für das Frontend
if (defined('IN_ACP3') && $mode == 1) {
// Zusätzlich zugewiesene Brotkrumen holen und Einträge zählen
$c_steps = count($this->steps);
if ($c_steps > 0) {
// Zusätzlich zugewiesene Brotkrumen an Smarty übergeben
if (count($this->steps) > 0) {
$tpl->assign('breadcrumb', $this->steps);
$tpl->assign('end', $this->end);
// Falls keine zusätzlichen Brotkrumen angegeben sind, jeweiligen Seitennamen der Moduldatei ausgeben
// Falls keine zusätzlichen Brotkrumen angegeben sind, jeweiligen Seitennamen der Moduldatei ausgeben
} else {
if (!empty($this->end)) {
$tpl->assign('end', $this->end);
} elseif ($modules->page == 'list' || $modules->page == 'entry') {
} elseif ($modules->page == 'list') {
$tpl->assign('end', lang($modules->mod, $modules->mod));
} else {
$tpl->assign('end', lang($modules->mod, $modules->page));
......@@ -85,34 +84,30 @@ class breadcrumb
return $tpl->fetch('common/breadcrumb.html');
// Brotkrümelspur für das Admin Panel
} elseif (defined('IN_ADM') && $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 == 'adm_list' || $modules->page == 'entry') && $c_steps == 0) {
if ($modules->page == 'adm_list' && count($this->steps) == 0 && empty($this->end)) {
$breadcrumb[0]['uri'] = uri('acp');
$breadcrumb[0]['title'] = lang('common', 'acp');
$tpl->assign('breadcrumb', $breadcrumb);
$tpl->assign('end', lang($modules->mod, $modules->mod));
} elseif (count($this->steps) > 0 || !empty($this->end)) {
$tpl->assign('breadcrumb', $this->steps);
$tpl->assign('end', $this->end);
// Falls keine zusätzlichen Brotkrumen angegeben sind, jeweiligen Seitennamen der Moduldatei ausgeben
} 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('acp/' . $modules->mod);
$breadcrumb[1]['title'] = lang($modules->mod, $modules->mod);
$tpl->assign('end', lang($modules->mod, $modules->page));
}
$breadcrumb[0]['uri'] = uri('acp');
$breadcrumb[0]['title'] = lang('common', 'acp');
$breadcrumb[1]['uri'] = uri('acp/' . $modules->mod);
$breadcrumb[1]['title'] = lang($modules->mod, $modules->mod);
$tpl->assign('breadcrumb', $breadcrumb);
$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)) {
return $this->end;
} else {
return $modules->page != 'list' && $modules->page != 'adm_list' && $modules->page != 'entry' ? lang($modules->mod, $modules->page) : lang($modules->mod, $modules->mod);
return $modules->page != 'list' && $modules->page != 'adm_list' ? lang($modules->mod, $modules->page) : lang($modules->mod, $modules->mod);
}
}
}
......
......@@ -65,10 +65,11 @@ class modules
define('IN_ACP3', true);
}
$stm = !empty($_GET['stm']) ? explode('/', $_GET['stm']) : 0;
$def_page = defined('IN_ADM') ? 'adm_list' : 'list';
$defaultModule = defined('IN_ADM') ? 'acp' : 'news';
$defaultPage = defined('IN_ADM') ? 'adm_list' : 'list';
$this->mod = !empty($stm[0]) ? $stm[0] : 'news';
$this->page = !empty($stm[1]) ? $stm[1] : $def_page;
$this->mod = !empty($stm[0]) ? $stm[0] : $defaultModule;
$this->page = !empty($stm[1]) ? $stm[1] : $defaultPage;
$this->cat = !empty($_POST['cat']) ? $_POST['cat'] : '0';
$this->action = !empty($_POST['action']) ? $_POST['action'] : '';
......
......@@ -23,12 +23,13 @@ function combo_box($text, $forward = 0, $back = 0)
if (is_array($text) && empty($forward) && empty($back)) {
$tpl->assign('text', $text);
return $tpl->fetch('common/error.html');
} elseif (!empty($forward) && !empty($back)) {
} elseif (!empty($text) && (!empty($forward) || !empty($back))) {
$tpl->assign('text', $text);
$tpl->assign('forward', $forward);
$tpl->assign('back', $back);
if (!empty($back)) {
$tpl->assign('back', $back);
}
return $tpl->fetch('common/combo.html');
}
......
......@@ -22,12 +22,9 @@ if (CONFIG_MAINTENANCE == '1' && defined('IN_ACP3')) {
} else {
$auth = new auth;
if ($auth->isUser() && defined('IN_ADM') && empty($_GET['stm'])) {
redirect(0, ROOT_DIR);
} elseif ($modules->check()) {
$content = '';
if ($modules->check()) {
include 'modules/' . $modules->mod . '/' . $modules->page . '.php';
$tpl->assign('content', $content);
$tpl->assign('content', isset($content) ? $content : '');
} elseif (!$auth->isUser() && defined('IN_ADM') && $modules->mod != 'users' && $modules->page != 'login') {
redirect('users/login');
} elseif (is_file('modules/errors/404.php')) {
......
<?php
/**
* Polls
* Administration Control Panel
*
* @author Goratsch Webdesign
* @package ACP3
......@@ -9,17 +9,8 @@
if (!defined('IN_ADM'))
exit;
if (!$modules->check('polls', 'entry'))
redirect('errors/403');
switch ($modules->action) {
case 'create':
break;
case 'edit':
break;
case 'delete':
break;
default:
redirect('errors/404');
}
$breadcrumb->assign(lang('common', 'acp'));
$content = $tpl->fetch('acp/adm_list.html');
?>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<module>
<info>
<name lang="true"/>
<description lang="true"/>
<author>Goratsch Webdesign</author>
<tables></tables>
<version core="true"/>
<protected/>
<active>1</active>
</info>
<access>
<item>
<file>adm_list</file>
<level>2</level>
</item>
</access>
</module>
\ No newline at end of file
......@@ -27,6 +27,7 @@ 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));
......
......@@ -15,6 +15,7 @@ $pic = isset($modules->gen['pic']) && $validate->is_number($modules->gen['pic'])
if (!empty($modules->id)) {
$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'));
......
......@@ -13,6 +13,7 @@ if (!defined('IN_ADM'))
if (!empty($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']);
......
......@@ -13,6 +13,7 @@ if (!defined('IN_ADM'))
if (!empty($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'));
......
......@@ -10,6 +10,7 @@
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'));
......
......@@ -10,6 +10,7 @@
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'));
......
......@@ -10,6 +10,11 @@
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'));
if (isset($_POST['entries']) && is_array($_POST['entries']))
$entries = $_POST['entries'];
elseif (isset($modules->gen['entries']) && preg_match('/^([\d|]+)$/', $modules->gen['entries']))
......
......@@ -11,6 +11,7 @@ if (!defined('IN_ADM'))
exit;
if (!empty($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'));
......
......@@ -10,6 +10,7 @@
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'));
......
......@@ -10,6 +10,7 @@
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'));
......
......@@ -10,6 +10,7 @@
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'));
......
......@@ -2,6 +2,7 @@
if (!defined('IN_ADM'))
exit;
$breadcrumb->assign(lang('common', 'acp'), uri('acp'));
$breadcrumb->assign(lang('system', 'system'), uri('acp/system'));
$breadcrumb->assign(lang('system', 'maintenance'), uri('acp/system/maintenance'));
$breadcrumb->assign(lang('system', 'sql_export'));
......
......@@ -10,6 +10,7 @@
if (!defined('IN_ADM'))
exit;
$breadcrumb->assign(lang('common', 'acp'), uri('acp'));
$breadcrumb->assign(lang('system', 'system'), uri('acp/system'));
$breadcrumb->assign(lang('system', 'maintenance'), uri('acp/system/maintenance'));
$breadcrumb->assign(lang('system', 'sql_optimisation'));
......
......@@ -10,6 +10,7 @@
if (!defined('IN_ADM'))
exit;
$breadcrumb->assign(lang('common', 'acp'), uri('acp'));
$breadcrumb->assign(lang('system', 'system'), uri('acp/system'));
$breadcrumb->assign(lang('system', 'maintenance'), uri('acp/system/maintenance'));
$breadcrumb->assign(lang('system', 'update_check'));
......
......@@ -9,15 +9,11 @@ if (!$auth->isUser() || !preg_match('/\d/', USER_ID)) {
$breadcrumb->assign(lang('users', 'home'));
if (isset($_POST['submit'])) {
if (!$auth->isUser() || !preg_match('/\d/', USER_ID)) {
redirect('errors/403');
} else {
$form = $_POST['form'];
$form = $_POST['form'];
$bool = $db->update('users', array('draft' => $db->escape($form['draft'], 2)), 'id = \'' . USER_ID . '\'');
$bool = $db->update('users', array('draft' => $db->escape($form['draft'], 2)), 'id = \'' . USER_ID . '\'');
$content = combo_box($bool ? lang('users', 'draft_success') : lang('users', 'draft_error'), uri('users/home'));
}
$content = combo_box($bool ? lang('users', 'draft_success') : lang('users', 'draft_error'), uri('users/home'));
}
if (!isset($_POST['submit'])) {
$user = $db->select('draft', 'users', 'id = \'' . USER_ID . '\'');
......
......@@ -17,7 +17,7 @@ if ($auth->isUser()) {
foreach ($mod_list as $name => $info) {
$dir = $info['dir'];
if ($modules->check($dir, 'adm_list')) {
if ($modules->check($dir, 'adm_list') && $dir != 'acp') {
if ($dir == 'system') {
$tpl->assign('access_system', true);
} elseif ($dir == 'home') {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment