Login  Register
Customized macros
Search macros
View logs

change_user_groups

NAML documentation   Watch a video
   Usages of this macro
The source code below doesn't have navigation links because no usage has been compiled yet. Navigation links depend on how and where the macro is used, so first you may try finding all usages of "change_user_groups".
... in change_user_groups.naml
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
75
76
77
78
79
80
81
<macro name="change_user_groups" requires="servlet">
    <n.user_page.>
        <n.if.not.visitor.can_manage_users_and_groups>
            <then>
                <n.login.><t>Only authorized users can proceed in this area.</t></n.login.>
            </then>
        </n.if.not.visitor.can_manage_users_and_groups>
        <n.if.is_submitted_form>
            <then>
                <n.catch_exception. id="save-block">
                    <n.edit_page_user.>
                        <n.user_group_list.loop.group_field. group="[n.current_group/]">
                            <n.if.is_checked>
                                 <then><n.add_to_group.current_group/></then>
                                 <else><n.remove_from_group.current_group/></else>
                            </n.if.is_checked>
                        </n.user_group_list.loop.group_field.>
                        <n.get_parameter_values. name="newgroup">
                            <n.loop.>
                                <n.if.not.is_empty.current_parameter_value>
                                     <then><n.add_to_group.current_parameter_value/></then>
                                </n.if.not.is_empty.current_parameter_value>
                            </n.loop.>
                        </n.get_parameter_values.>
                    </n.edit_page_user.>
                    <n.redirect_to.page_user.path/>
                </n.catch_exception.>
            </then>
        </n.if.is_submitted_form>
        <n.html>
            <head>
                <META NAME="robots" CONTENT="noindex,nofollow"/>
                <n.title.><t>Change User Groups</t></n.title.>
                <style type="text/css">
                    .title-row {
                        padding:.2em;
                        border-bottom-width:2px;
                        border-bottom-style:solid;
                        font-weight:bold;
                    }
                </style>
            </head>
            <body>
                <n.page_user.profile_header/>
 
                <div class="title-row light-border-color" style="margin-top:.5em">
                    <t>Groups of this user</t>
                </div>
                <n.form.>
                    <table>
                        <n.if.page_user.is_registered>
                            <then><n.fixed_group_row name="Anyone" tip="[t]Users that completed the registration process[/t]"/></then>
                        </n.if.page_user.is_registered>
 
                        <n.if.page_user.is_authenticated>
                            <then>
                                <n.user_group_list.loop.>
                                    <n.group_row>
                                        <group><n.current_group/></group>
                                        <checked><n.page_user.is_in_group.current_group/></checked>
                                    </n.group_row>
                                </n.user_group_list.loop.>
 
                                <n.empty_group_controls/>
                            </then>
                        </n.if.page_user.is_authenticated>
                    </table>
 
                    <n.if.page_user.is_authenticated>
                        <then>
                            <div style="margin-top:1.4em">
                                <input type="submit" value="[t]Save Changes[/t]" />
                                <t>or</t> <a href="[n.page_user.url/]"><t>Cancel</t></a>
                            </div>
                        </then>
                    </n.if.page_user.is_authenticated>
                </n.form.>
            </body>
        </n.html>
    </n.user_page.>
</macro>