2 <h4>{{$account_types}}</h4>
3 {{include file="field_radio.tpl" field=$account_person}}
4 <div id="account-type-sub-0" class="pageflags">
6 {{include file="field_radio.tpl" field=$page_normal}}
7 {{include file="field_radio.tpl" field=$page_soapbox}}
8 {{include file="field_radio.tpl" field=$page_freelove}}
11 {{include file="field_radio.tpl" field=$account_organisation}}
12 {{include file="field_radio.tpl" field=$account_news}}
14 {{include file="field_radio.tpl" field=$account_community}}
15 <div id="account-type-sub-3" class="pageflags">
16 <h5>{{$community}}</h5>
17 {{include file="field_radio.tpl" field=$page_community}}
18 {{include file="field_radio.tpl" field=$page_prvgroup}}
21 <script language="javascript" type="text/javascript">
22 // This js part changes the state of page-flags radio buttons according
23 // to the selected account type. For a translation of the different
24 // account-types and page-flags have a look in the define section in boot.php
25 var accountType = {{$account_type}};
27 $(document).ready(function(){
28 // Hide all DIV for page-flags expet the one which belongs to the present
30 showPageFlags(accountType);
32 // Save the ID of the active page-flage
33 var activeFlag = $('[id^=id_page-flags_]:checked');
35 $("[id^=id_account-type_]").change(function(){
36 // Since the ID of the radio buttons containing the type of
37 // the account-type we catch the last character of the ID to
38 // know for what account-type the radio button stands for.
39 var type = this.id.substr(this.id.length - 1);
41 // Hide all DIV with page-flags and show only the one which belongs
42 // to the selected radio button
45 // Uncheck all page-flags radio buttons
46 $('input:radio[name="page-flags"]').prop("checked", false);
48 // If the selected account type is the active one mark the page-flag
49 // radio button as checked which is already by database state
50 if (accountType == type) {
51 $(activeFlag).prop("checked", true);
52 } else if (type == 1 || type == 2) {
53 // For account-type 1 or 2 the page-flags are always set to 1
54 $('#id_page-flags_1').prop("checked", true);
56 // Mark the first available page-flags radio button of the selected
57 // account-type as checked
58 $('#account-type-sub-' + type + ' input:radio[name="page-flags"]').first().prop("checked", true);
63 // Show/Hide the page-flags according to the selected account-type
64 function showPageFlags(type) {
65 $(".pageflags").hide();
67 if (type == 0 || type == 3) {
68 $("#account-type-sub-" + type).show();