index.php 3.11 KB
Newer Older
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
<?php
/**
 * This program is part of Mahara
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 *
 * @package    mahara
 * @subpackage core
 * @author     Penny Leach <penny@catalyst.net.nz>
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL
 * @copyright  (C) 2006,2007 Catalyst IT Ltd http://catalyst.net.nz
 *
 */

define('INTERNAL', 1);
define('MENUITEM', 'account');
define('SUBMENUITEM', 'accountprefs');

require(dirname(dirname(__FILE__)) . '/init.php');
Penny Leach's avatar
Penny Leach committed
32
require('form.php');
33

Penny Leach's avatar
Penny Leach committed
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
// load up user preferences
$prefs = (object)($SESSION->get('accountprefs'));

$prefsform = array(
    'name'        => 'accountprefs',
    'method'      => 'post',
    'ajaxpost'    => true,
    'plugintype ' => 'core',
    'pluginname'  => 'account',
    'elements'    => array(
        'friendscontrol' => array(
            'type' => 'radio',
            'value' => $prefs->friendscontrol, 
            'title'  => get_string('friendsdescr', 'account'),
            'separator' => HTML_BR,
            'options' => array(
                'nobody' => get_string('friendsnobody', 'account'),
                'auth'   => get_string('friendsauth', 'account'),
                'auto'   => get_string('friendsauto', 'account')
            ),
           'rules' => array(
                'required' => true
            )
        ),
        'wysiwyg' => array(
            'type' => 'radio',
            'value' => $prefs->wysiwyg,
            'title' => get_string('wysiwygdescr', 'account'),
            'options' => array(
                1 => get_string('on', 'account'),
                0 => get_string('off', 'account'),
            ),
           'rules' => array(
                'required' => true
            )
        ),
        'messages' => array(
            'type' => 'radio',
            'value' => $prefs->messages,
            'title' => get_string('messagesdescr', 'account'),
            'options' => array(
                'nobody' => get_string('messagesnobody', 'account'),
                'friends' => get_string('messagesfriends', 'account'),
                'allow' => get_string('messagesallow', 'account'),
            ),
           'rules' => array(
                'required' => true
            )
        ),
        'submit' => array(
            'type' => 'submit',
            'value' => get_string('save'),
        ),
    ),
);
89

Penny Leach's avatar
Penny Leach committed
90
91
92

$smarty = smarty();
$smarty->assign('form', form($prefsform));
93
94
$smarty->display('account/index.tpl');

Penny Leach's avatar
Penny Leach committed
95
96
97
98
99
100
function accountprefs_submit($values) {

    
}


101
?>