<?php
/**
 * $Horde: moment/prefs.php,v 1.2 2003/05/23 14:44:44 chuck Exp $
 *
 * Copyright 2002 Chuck Hagenbuch <chuck@horde.org>
 *
 * See the enclosed file COPYING for license information (GPL).  If you
 * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
 */

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

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

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

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

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

$title = _("User Options");
require MOMENT_TEMPLATES . '/common-header.inc';
Moment::menu();
PrefsUI::generateUI($group);
require MOMENT_TEMPLATES . '/common-footer.inc';
