Friendica Communications Platform (please note that this is a clone of the repository at github, issues are handled there)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

71 lines
2.6 KiB

{{include file="field_radio.tpl" field=$account_person}}
<div id="account-type-sub-0" class="pageflags">
{{include file="field_radio.tpl" field=$page_normal}}
{{include file="field_radio.tpl" field=$page_soapbox}}
{{include file="field_radio.tpl" field=$page_freelove}}
{{include file="field_radio.tpl" field=$account_organisation}}
{{include file="field_radio.tpl" field=$account_news}}
{{include file="field_radio.tpl" field=$account_community}}
<div id="account-type-sub-3" class="pageflags">
{{include file="field_radio.tpl" field=$page_community}}
{{include file="field_radio.tpl" field=$page_prvgroup}}
<script language="javascript" type="text/javascript">
// This js part changes the state of page-flags radio buttons according
// to the selected account type. For a translation of the different
// account-types and page-flags have a look in the define section in boot.php
var accountType = {{$account_type}};
// Hide all DIV for page-flags expet the one which belongs to the present
// account-type
// Save the ID of the active page-flage
var activeFlag = $('[id^=id_page-flags_]:checked');
// Since the ID of the radio buttons containing the type of
// the account-type we catch the last character of the ID to
// know for what account-type the radio button stands for.
var type = - 1);
// Hide all DIV with page-flags and show only the one which belongs
// to the selected radio button
// Uncheck all page-flags radio buttons
$('input:radio[name="page-flags"]').prop("checked", false);
// If the selected account type is the active one mark the page-flag
// radio button as checked which is already by database state
if (accountType == type) {
$(activeFlag).prop("checked", true);
} else if (type == 1 || type == 2) {
// For account-type 1 or 2 the page-flags are always set to 1
$('#id_page-flags_1').prop("checked", true);
} else {
// Mark the first available page-flags radio button of the selected
// account-type as checked
$('#account-type-sub-' + type + ' input:radio[name="page-flags"]').first().prop("checked", true);
// Show/Hide the page-flags according to the selected account-type
function showPageFlags(type) {
if (type == 0 || type == 3) {
$("#account-type-sub-" + type).show();