Commit 8f44d213 authored by sylvieg's avatar sylvieg

take away 2 include(language.php) that are unseless as the tra function and...

take away 2 include(language.php) that are unseless as the tra function and the tr prefilter have their own include when they need. TODO: check if the call to the tra function can be remplaced by a {tr} to have no more include of the big fat language.php
parent a26ce399
<?php
// $Header: /cvsroot/tikiwiki/tiki/tiki-setup.php,v 1.202 2004-03-25 06:19:08 dabright Exp $
// $Header: /cvsroot/tikiwiki/tiki/tiki-setup.php,v 1.203 2004-03-26 21:27:20 sylvieg Exp $
// Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
......@@ -1236,13 +1236,6 @@ if ($feature_userPreferences == 'y') {
$smarty->assign('language', $language);
}
if ($lang_use_db != 'y') {
// check if needed!!!
global $lang;
include_once ('lang/' . $language . '/language.php');
}
$feature_babelfish = $tikilib->get_preference('feature_babelfish', 'y');
$feature_babelfish_logo = $tikilib->get_preference('feature_babelfish_logo', 'n');
......
<?php
// $Header: /cvsroot/tikiwiki/tiki/tiki-setup_base.php,v 1.55 2004-03-25 21:02:45 chealer Exp $
// $Header: /cvsroot/tikiwiki/tiki/tiki-setup_base.php,v 1.56 2004-03-26 21:27:20 sylvieg Exp $
// Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
......@@ -101,8 +101,10 @@ function tra($content, $lg="") {
global $language;
if ($lang_use_db != 'y') {
if ($lg == "" || $lg == $language)
if ($lg == "" || $lg == $language) {
global $lang;
include_once("lang/$language/language.php");
}
else
include ("lang/$lg/language.php");
if ($content) {
......@@ -191,14 +193,23 @@ if(!$cachelib->isCached("allperms")) {
}
$allperms = $allperms["data"];
//Initializes permissions
foreach ($allperms as $vperm) {
$perm = $vperm["permName"];
$$perm = 'n';
$perm = $vperm["permName"];
if ($user != 'admin' && (!$user || !$userlib->user_has_permission($user, 'tiki_p_admin'))) {
$$perm = 'n';
$smarty->assign("$perm", 'n');
$smarty->assign("$perm", 'n');
} else {
$$perm = 'y';
$smarty->assign("$perm", 'y');
}
}
unset($allperms);
// Permissions
// Get group permissions here
$perms = $userlib->get_user_permissions($user);
......@@ -362,18 +373,6 @@ if ($tiki_p_admin_cms == 'y') {
}
}
//Gives admins all permissions
if ($user == 'admin' || ($user && $userlib->user_has_permission($user, 'tiki_p_admin'))) {
foreach ($allperms as $vperm) {
$perm = $vperm["permName"];
$$perm = 'y';
$smarty->assign("$perm", 'y');
}
}
unset($allperms);
$tikiIndex = $tikilib->get_preference("tikiIndex", 'tiki-index.php');
$style = $tikilib->get_preference("style", 'moreneat.css');
......@@ -431,13 +430,6 @@ if (!isset($_SERVER['REQUEST_URI']) || empty($_SERVER['REQUEST_URI'])) {
$_SERVER['REQUEST_URI'] = $_SERVER['PHP_SELF'] . '/' . $_SERVER['QUERY_STRING'];
}
//really needed? (todo: check)
//if ($lang_use_db!='y') {
global $lang;
include_once('lang/' . $language . '/language.php');
//}
// added for wirtual hosting suport
if (!isset($tikidomain)) {
$tikidomain = "";
......
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