Commit 9d20ac39 authored by fettesvieh's avatar fettesvieh

added a new smarty function: load_module

parent 29bdf2be
......@@ -40,7 +40,7 @@
{/foreach}
</ul>
{/if}
{$users_sidebar}
{load_module module="users|sidebar"}
</div>
<div id="content">
<h1>{$title}</h1>
......
<?php
function smarty_function_load_module($params, &$smarty)
{
global $auth, $breadcrumb, $cache, $config, $db, $modules, $tpl, $validate;
$module = explode('|', $params['module']);
$path = 'modules/' . $module[0] . '/' . $module[1] . '.php';
if (is_file($path)) {
include $path;
}
}
/* vim: set expandtab: */
?>
\ No newline at end of file
......@@ -40,9 +40,6 @@ if (CONFIG_MAINTENANCE == '1' && defined('IN_ACP3')) {
// Evtl. gesetzten Content-Type des Servers überschreiben
header('Content-Type: ' . (defined('CUSTOM_CONTENT_TYPE') ? CUSTOM_CONTENT_TYPE : 'text/html') . '; charset=UTF-8');
// Loginfeld bzw. Benutzermenü laden
include 'modules/users/sidebar.php';
// Navigationsleisten
if ($modules->check('pages', 'functions')) {
include_once 'modules/pages/functions.php';
......
......@@ -30,7 +30,7 @@ if ($auth->is_user()) {
}
$tpl->assign('nav_mods', $nav_mods);
$tpl->assign('users_sidebar', $tpl->fetch('users/sidebar_user_menu.html'));
$tpl->display('users/sidebar_user_menu.html');
} else {
if (defined('IN_ADM'))
$tpl->assign('uri', uri('acp/users/login'));
......@@ -39,6 +39,6 @@ if ($auth->is_user()) {
$tpl->assign('redirect_uri', isset($_POST['form']['redirect_uri']) ? $_POST['form']['redirect_uri'] : base64_encode(htmlentities($_SERVER['REQUEST_URI'])));
$tpl->assign('users_sidebar', $tpl->fetch('users/sidebar_login.html'));
$tpl->display('users/sidebar_login.html');
}
?>
\ No newline at end of file
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