Revize b6eb1915
Přidáno uživatelem David Raška před asi 9 roky(ů)
application/controllers/members.php | ||
---|---|---|
$empty_birthday = Settings::get('users_birthday_empty_enabled');
|
||
$min_age = Settings::get('members_age_min_limit');
|
||
|
||
$form->date('birthday')
|
||
->label('Birthday')
|
||
->years(date('Y') - 100, date('Y'));
|
||
|
||
if ($empty_birthday == 0)
|
||
{
|
||
$form->date('birthday')
|
||
->label('Birthday')
|
||
->years(date('Y') - 100, date('Y'))
|
||
$form->inputs['birthday']
|
||
->rules('required');
|
||
}
|
||
else
|
||
{
|
||
if (empty($min_age))
|
||
{
|
||
$form->date('birthday')
|
||
->label('Birthday')
|
||
->years(date('Y') - 100, date('Y'))
|
||
->value('');
|
||
}
|
||
else
|
||
{
|
||
$form->checkbox('older_than')
|
||
->label(__("I'm older than %d years", array($min_age)))
|
||
->rules('required');
|
||
}
|
||
$form->inputs['birthday']
|
||
->value('');
|
||
}
|
||
|
||
$form->date('entrance_date')
|
application/controllers/users.php | ||
---|---|---|
$empty_birthday = Settings::get('users_birthday_empty_enabled');
|
||
$min_age = Settings::get('members_age_min_limit');
|
||
|
||
$form->date('birthday')
|
||
->label('Birthday')
|
||
->years(date('Y') - 100, date('Y'))
|
||
->value($user->birthday === NULL ? '' : strtotime($user->birthday));
|
||
|
||
if ($empty_birthday == 0)
|
||
{
|
||
$form->date('birthday')
|
||
->label('Birthday')
|
||
->years(date('Y') - 100, date('Y'))
|
||
->rules('required')
|
||
->value(strtotime($user->birthday));
|
||
}
|
||
else
|
||
{
|
||
if (!empty($min_age) && $user->type == User_Model::MAIN_USER)
|
||
{
|
||
$form->checkbox('older_than')
|
||
->label(__("I'm older than %d years", array($min_age)))
|
||
->rules('required')
|
||
->checked(TRUE);
|
||
}
|
||
else
|
||
{
|
||
$form->date('birthday')
|
||
->label('Birthday')
|
||
->years(date('Y') - 100, date('Y'))
|
||
->value($user->birthday === NULL ? '' : strtotime($user->birthday));
|
||
}
|
||
$form->inputs['birthday']
|
||
->rules('required');
|
||
}
|
||
|
||
if ($this->acl_check_edit(get_class($this), 'comment', $user->member_id))
|
Také k dispozici: Unified diff
refs #957: "I'm older than x years" checkbox is only shown on self-register page