tiki-admin_layout.php 2.16 KB
Newer Older
lrargerich's avatar
lrargerich committed
1
<?php
2
// (c) Copyright 2002-2011 by authors of the Tiki Wiki CMS Groupware Project
3
// 
4 5
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
6
// $Id$
changi67's avatar
changi67 committed
7

8
require_once ('tiki-setup.php');
9 10 11
$access->check_feature('layout_section');
$access->check_permission('tiki_p_admin');

changi67's avatar
changi67 committed
12
foreach($sections_enabled as $section => $data) {
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
	if (isset($_REQUEST["${section}_layout"])) {
		check_ticket('admin-layout');
		if (isset($_REQUEST["${section}_left_column"]) && $_REQUEST["${section}_left_column"] == "on") {
			$tikilib->set_preference("${section}_left_column", 'y');
		} else {
			$tikilib->set_preference("${section}_left_column", 'n');
		}
		if (isset($_REQUEST["${section}_right_column"]) && $_REQUEST["${section}_right_column"] == "on") {
			$tikilib->set_preference("${section}_right_column", 'y');
		} else {
			$tikilib->set_preference("${section}_right_column", 'n');
		}
		if (isset($_REQUEST["${section}_top_bar"]) && $_REQUEST["${section}_top_bar"] == "on") {
			$tikilib->set_preference("${section}_top_bar", 'y');
		} else {
			$tikilib->set_preference("${section}_top_bar", 'n');
		}
		if (isset($_REQUEST["${section}_bot_bar"]) && $_REQUEST["${section}_bot_bar"] == "on") {
			$tikilib->set_preference("${section}_bot_bar", 'y');
		} else {
			$tikilib->set_preference("${section}_bot_bar", 'n');
		}
	}
lrargerich's avatar
lrargerich committed
36
}
37
$sections_smt = array();
38
$temp_max = count($sections_enabled);
39
$needed_prefs = array();
changi67's avatar
changi67 committed
40
$needed_elements = array(
41 42 43 44
	'left_column',
	'right_column',
	'top_bar',
	'bot_bar'
changi67's avatar
changi67 committed
45 46
);
foreach($sections_enabled as $sec => $dat) foreach($needed_elements as $elmt) $needed_prefs[$sec . '_' . $elmt] = 'y';
47
$tikilib->get_preferences($needed_elements, true, true);
changi67's avatar
changi67 committed
48
foreach($sections_enabled as $sec => $dat) {
49 50 51 52 53
	$aux["name"] = $sec;
	foreach($needed_elements as $elmt) $aux[$elmt] = $ {
		$sec . '_' . $elmt
	};
	$sections_smt[] = $aux;
lrargerich's avatar
lrargerich committed
54
}
55
$smarty->assign('sections', $sections_smt);
56
ask_ticket('admin-layout');
57 58
// disallow robots to index page:
$smarty->assign('metatag_robots', 'NOINDEX, NOFOLLOW');
lrargerich's avatar
lrargerich committed
59
// Display the template
60
$smarty->assign('mid', 'tiki-admin_layout.tpl');
61
$smarty->display("tiki.tpl");