File: prefs.php

package info (click to toggle)
horde2 2.2.8-1sarge3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 3,832 kB
  • ctags: 2,897
  • sloc: php: 12,784; sh: 954; sql: 149; makefile: 104; perl: 97; xml: 24; pascal: 6
file content (74 lines) | stat: -rw-r--r-- 1,912 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?php
/*
 * $Horde: horde/prefs.php,v 2.1.2.10 2005/01/03 11:25:45 jan Exp $
 *
 * Copyright 1999-2005 Charles J. Hagenbuch <chuck@horde.org>
 * Copyright 1999-2005 Jon Parise <jon@horde.org>
 *
 * See the enclosed file COPYING for license information (LGPL).  If you
 * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
 */

/**
 * Call PrefsUI::groupIsEditable() here because we can rely on it being present
 * in Horde 2.1 but the prefs template still calls groupIsEditable().
 */
function groupIsEditable($group)
{
    return PrefsUI::groupIsEditable($group);
}

function prefs_callback()
{
    global $prefs, $js_onLoad;

    if ($prefs->isDirty('menu_view')) {
        $js_onLoad = 'if (window.parent.frames.horde_menu) window.parent.frames.horde_menu.location.reload();';
    }
}

define('HORDE_BASE', dirname(__FILE__));
require_once HORDE_BASE . '/lib/base.php';
require_once HORDE_BASE . '/lib/PrefsUI.php';
require HORDE_BASE . '/config/prefs.php';

if (!Auth::getAuth()) {
    header('Location: ' . Horde::applicationUrl('login.php'), true);
    exit;
}

$js_onLoad = null;

/* See if we have a preferences group set. */
$group = Horde::getFormData('group');

if (PrefsUI::handleForm($group)) {
    $group = null;
    include HORDE_BASE . '/config/prefs.php';
}

Horde::compressOutput();
if (!$prefs->isLocked('initial_application')) {
    $initial_application_options = array();
    $apps = $registry->listApps();
    foreach ($apps as $app) {
        $initial_application_options[$app] = $registry->getParam('name', $app);
    }
}



$title = _("User Options");
require HORDE_TEMPLATES . '/common-header.inc';
require HORDE_BASE . '/navbar.php';

/* Assign variables for select lists. */
if (!$prefs->isLocked('timezone')) {
    $timezone_options = &$tz;
}

/* Show the UI. */
PrefsUI::generateUI($group);

$registry->shutdown();
require HORDE_TEMPLATES . '/common-footer.inc';