<h1>{$user->username}{if MODULE_USER_RANK && $user->getUserTitle()} <span class="badge userTitleBadge{if $user->getRank() && $user->getRank()->cssClassName} {@$user->getRank()->cssClassName}{/if}">{$user->getUserTitle()}</span>{/if}</h1>
<ul class="dataList">
- {if $user->gender}<li>{lang}wcf.user.gender.{if $user->gender == 1}male{else}female{/if}{/lang}</li>{/if}
- {if $user->getAge()}<li>{@$user->getAge()}</li>{/if}
- {if $user->location}<li>{lang}wcf.user.membersList.location{/lang}</li>{/if}
+ {if $user->isVisibleOption('gender') && $user->gender}<li>{lang}wcf.user.gender.{if $user->gender == 1}male{else}female{/if}{/lang}</li>{/if}
+ {if $user->isVisibleOption('birthday') && $user->getAge()}<li>{@$user->getAge()}</li>{/if}
+ {if $user->isVisibleOption('location') && $user->location}<li>{lang}wcf.user.membersList.location{/lang}</li>{/if}
{if $user->getOldUsername()}<li>{lang}wcf.user.profile.oldUsername{/lang}</li>{/if}
<li>{lang}wcf.user.membersList.registrationDate{/lang}</li>
{event name='userDataRow1'}
</div>
<ul class="dataList userFacts">
{if $user->isAccessible('canViewProfile')}
- {if $user->gender}<li>{lang}wcf.user.gender.{if $user->gender == 1}male{else}female{/if}{/lang}</li>{/if}
- {if $user->getAge()}<li>{@$user->getAge()}</li>{/if}
- {if $user->location}<li>{lang}wcf.user.membersList.location{/lang}</li>{/if}
+ {if $user->isVisibleOption('gender') && $user->gender}<li>{lang}wcf.user.gender.{if $user->gender == 1}male{else}female{/if}{/lang}</li>{/if}
+ {if $user->isVisibleOption('birthday') && $user->getAge()}<li>{@$user->getAge()}</li>{/if}
+ {if $user->isVisibleOption('location') && $user->location}<li>{lang}wcf.user.membersList.location{/lang}</li>{/if}
{/if}
<li>{lang}wcf.user.membersList.registrationDate{/lang}</li>
return $option->optionValue;
}
+ /**
+ * Returns true, if the active user has access to the user option with the given name.
+ *
+ * @param string $name
+ * @return boolean
+ */
+ public function isVisibleOption($name) {
+ $option = ViewableUserOption::getUserOption($name);
+ return $option->isVisible();
+ }
+
/**
* Returns the formatted username.
*