1<?php
2// (c) Copyright by authors of the Tiki Wiki CMS Groupware Project
3//
4// All Rights Reserved. See copyright.txt for details and a complete list of authors.
5// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
6// $Id$
7
8/**
9 * simple_set_toggle
10 *
11 * @param mixed $feature
12 * @access public
13 * @return void
14 */
15function simple_set_toggle($feature)
16{
17	global $prefs;
18	$tikilib = TikiLib::lib('tiki');
19	$logslib = TikiLib::lib('logs');
20	if (isset($_REQUEST[$feature]) && $_REQUEST[$feature] == 'on') {
21		if ((! isset($prefs[$feature]) || $prefs[$feature] != 'y')) {
22			// not yet set at all or not set to y
23			if ($tikilib->set_preference($feature, 'y')) {
24				add_feedback($feature, tr('%0 enabled', $feature), 1, 1);
25				$logslib->add_action('feature', $feature, 'system', 'enabled');
26			}
27		}
28	} else {
29		if ((! isset($prefs[$feature]) || $prefs[$feature] != 'n')) {
30			// not yet set at all or not set to n
31			if ($tikilib->set_preference($feature, 'n')) {
32				add_feedback($feature, tr('%0 disabled', $feature), 0, 1);
33				$logslib->add_action('feature', $feature, 'system', 'disabled');
34			}
35		}
36	}
37
38	$cachelib = TikiLib::lib('cache');
39	$cachelib->invalidate('allperms');
40}
41
42if (isset($_REQUEST['page'])) {
43	$adminPage = $_REQUEST['page'];
44	if ($adminPage == 'features') {
45		$admintitle = 'Features'; //get_strings tra('Features')
46		$description = 'Enable/disable Tiki features here, but configure them elsewhere'; //get_strings tra('Enable/disable Tiki features here, but configure them elsewhere')
47		$helpUrl = 'Features+Admin';
48		include_once('tiki-admin_include_features.php');
49	} elseif ($adminPage == 'general') {
50		$admintitle = 'General'; //get_strings tra('General')
51		$description = 'General preferences and settings'; //get_strings tra('General preferences and settings')
52		$helpUrl = 'General+Admin';
53		include_once('tiki-admin_include_general.php');
54	} elseif ($adminPage == 'login') {
55		$admintitle = 'Login'; //get_strings tra('Login')
56		$description = 'User registration, login and authentication'; //get_strings tra('User registration, login and authentication')
57		$helpUrl = 'Login+Config';
58		include_once('tiki-admin_include_login.php');
59	} elseif ($adminPage == 'wiki') {
60		$admintitle = tra('Wiki');
61		$description = tra('Wiki settings');
62		$helpUrl = 'Wiki+Config';
63		include_once('tiki-admin_include_wiki.php');
64	} else {
65		$helpUrl = '';
66	}
67	$url = 'tiki-admin.php' . '?page=' . $adminPage;
68	if (! $helpUrl) {
69		$helpUrl = ucfirst($adminPage) . '+Config';
70	}
71	$helpDescription = "Help on $admintitle Config"; //get_strings tra("Help on $admintitle Config")
72} else {
73	$smarty->assign('admintitle', 'Control Panels');
74	$smarty->assign('description', 'Home Page for Administrators');
75	$smarty->assign('headtitle', breadcrumb_buildHeadTitle($crumbs));
76	$smarty->assign('description', $crumbs[0]->description);
77	$email_test_body = tra("Congratulations!\n\nYour server can send emails.\n\n");
78}
79