2014-08-07 19:55:18 +03:00
|
|
|
|
{**
|
|
|
|
|
* Настройки профиля
|
|
|
|
|
*}
|
|
|
|
|
|
|
|
|
|
{$user = $smarty.local.user}
|
|
|
|
|
|
2014-10-18 09:07:45 +03:00
|
|
|
|
{hook run='settings_profile_begin'}
|
|
|
|
|
|
2014-08-07 19:55:18 +03:00
|
|
|
|
|
|
|
|
|
{* Шаблон пользовательского поля (userfield) *}
|
|
|
|
|
{function name=userfield}
|
2014-10-18 09:07:45 +03:00
|
|
|
|
<div class="mb-15 js-user-field-item" {if ! $field}id="user-field-template" style="display:none;"{/if}>
|
|
|
|
|
<select name="profile_user_field_type[]">
|
2014-08-07 19:55:18 +03:00
|
|
|
|
{foreach $aUserFieldsContact as $fieldAll}
|
2014-10-18 09:07:45 +03:00
|
|
|
|
<option value="{$fieldAll->getId()}" {if $field && $fieldAll->getId() == $field->getId()}selected{/if}>
|
|
|
|
|
{$fieldAll->getTitle()|escape}
|
|
|
|
|
</option>
|
2014-08-07 19:55:18 +03:00
|
|
|
|
{/foreach}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<input type="text" name="profile_user_field_value[]" value="{if $field}{$field->getValue()|escape}{/if}" class="width-200">
|
2014-10-18 09:07:45 +03:00
|
|
|
|
<div class="icon-remove js-user-field-item-remove" title="{$aLang.common.remove}"></div>
|
2014-08-07 19:55:18 +03:00
|
|
|
|
</div>
|
|
|
|
|
{/function}
|
|
|
|
|
|
|
|
|
|
{* Скрытое пользовательское поле для вставки через js *}
|
2014-10-18 09:07:45 +03:00
|
|
|
|
{* Вынесено за пределы формы, чтобы не передавалось при отправке формы *}
|
2014-08-07 19:55:18 +03:00
|
|
|
|
{call userfield field=false}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<form method="post" enctype="multipart/form-data" class="js-form-validate">
|
2014-10-18 09:07:45 +03:00
|
|
|
|
{hook run='form_settings_profile_begin'}
|
2014-08-07 19:55:18 +03:00
|
|
|
|
|
|
|
|
|
{* Основная информация *}
|
2014-10-18 09:07:45 +03:00
|
|
|
|
<fieldset>
|
|
|
|
|
<legend>{lang name='user.settings.profile.generic'}</legend>
|
2014-08-07 19:55:18 +03:00
|
|
|
|
|
2014-10-18 09:07:45 +03:00
|
|
|
|
{* Имя *}
|
2015-01-03 10:19:49 +02:00
|
|
|
|
{component 'field' template='text'
|
2014-10-18 09:07:45 +03:00
|
|
|
|
name = 'profile_name'
|
2015-03-30 14:34:41 +03:00
|
|
|
|
rules = [ 'length' => "[2,{Config::Get('module.user.name_max')}]" ]
|
2014-10-18 09:07:45 +03:00
|
|
|
|
value = $user->getProfileName()|escape
|
|
|
|
|
label = {lang name='user.settings.profile.fields.name.label'}}
|
2014-08-07 19:55:18 +03:00
|
|
|
|
|
|
|
|
|
|
2014-10-18 09:07:45 +03:00
|
|
|
|
{* Пол *}
|
|
|
|
|
{$sex = [
|
2014-08-07 19:55:18 +03:00
|
|
|
|
[ 'value' => 'man', 'text' => {lang name='user.gender.male'} ],
|
|
|
|
|
[ 'value' => 'woman', 'text' => {lang name='user.gender.female'} ],
|
|
|
|
|
[ 'value' => 'other', 'text' => {lang name='user.gender.none'} ]
|
|
|
|
|
]}
|
|
|
|
|
|
2015-01-03 10:19:49 +02:00
|
|
|
|
{component 'field' template='select'
|
2014-10-18 09:07:45 +03:00
|
|
|
|
name = 'profile_sex'
|
|
|
|
|
label = {lang name='user.settings.profile.fields.sex.label'}
|
|
|
|
|
items = $sex
|
|
|
|
|
selectedValue = $user->getProfileSex()}
|
2014-08-07 19:55:18 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{* Дата рождения *}
|
2015-01-03 10:19:49 +02:00
|
|
|
|
{component 'field' template='date'
|
2015-03-21 17:40:55 +02:00
|
|
|
|
name = 'profile_birthday'
|
|
|
|
|
inputClasses = 'js-field-date-default'
|
|
|
|
|
label = {lang name='user.settings.profile.fields.birthday.label'}}
|
2014-08-07 19:55:18 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{* Местоположение *}
|
2015-01-03 10:19:49 +02:00
|
|
|
|
{component 'field' template='geo'
|
2014-11-27 16:11:23 +02:00
|
|
|
|
classes = 'js-field-geo-default'
|
|
|
|
|
name = 'geo'
|
|
|
|
|
label = {lang name='user.settings.profile.fields.place.label'}
|
|
|
|
|
countries = $aGeoCountries
|
|
|
|
|
regions = $aGeoRegions
|
|
|
|
|
cities = $aGeoCities
|
|
|
|
|
place = $oGeoTarget}
|
2014-08-07 19:55:18 +03:00
|
|
|
|
|
|
|
|
|
|
2014-10-18 09:07:45 +03:00
|
|
|
|
{* О себе *}
|
2015-01-03 10:19:49 +02:00
|
|
|
|
{component 'field' template='textarea'
|
2014-10-18 09:07:45 +03:00
|
|
|
|
name = 'profile_about'
|
2015-03-30 14:34:41 +03:00
|
|
|
|
rules = [ 'length' => '[1,3000]' ]
|
2014-10-18 09:07:45 +03:00
|
|
|
|
rows = 5
|
|
|
|
|
value = $user->getProfileAbout()|escape
|
|
|
|
|
label = {lang name='user.settings.profile.fields.about.label'}}
|
2014-08-07 19:55:18 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{* Пользовательские поля *}
|
2014-10-18 09:07:45 +03:00
|
|
|
|
{$userfields = $user->getUserFieldValues(false, '')}
|
2014-08-07 19:55:18 +03:00
|
|
|
|
|
|
|
|
|
{foreach $userfields as $field}
|
2015-01-03 10:19:49 +02:00
|
|
|
|
{component 'field' template='text'
|
2014-10-18 09:07:45 +03:00
|
|
|
|
name = "profile_user_field_`$field->getId()`"
|
|
|
|
|
value = $field->getValue()|escape
|
|
|
|
|
label = $field->getTitle()|escape}
|
2014-08-07 19:55:18 +03:00
|
|
|
|
{/foreach}
|
2014-10-18 09:07:45 +03:00
|
|
|
|
</fieldset>
|
2014-08-07 19:55:18 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{* Контакты *}
|
2014-10-18 09:07:45 +03:00
|
|
|
|
<fieldset class="js-user-fields">
|
|
|
|
|
<legend>{lang name='user.settings.profile.contact'}</legend>
|
2014-08-07 19:55:18 +03:00
|
|
|
|
|
2014-10-18 09:07:45 +03:00
|
|
|
|
{$contacts = $user->getUserFieldValues( true, array('contact', 'social') )}
|
2014-08-07 19:55:18 +03:00
|
|
|
|
|
|
|
|
|
{* Список пользовательских полей, шаблон определен в начале файла *}
|
2014-10-18 09:07:45 +03:00
|
|
|
|
<div class="js-user-field-list mb-15">
|
2014-08-07 19:55:18 +03:00
|
|
|
|
{foreach $contacts as $contact}
|
|
|
|
|
{call userfield field=$contact}
|
2014-10-18 09:07:45 +03:00
|
|
|
|
{foreachelse}
|
2015-01-03 10:19:49 +02:00
|
|
|
|
{component 'alert' mods='empty' classes='js-user-fields-empty' text=$aLang.common.empty}
|
2014-08-07 19:55:18 +03:00
|
|
|
|
{/foreach}
|
2014-10-18 09:07:45 +03:00
|
|
|
|
</div>
|
2014-08-07 19:55:18 +03:00
|
|
|
|
|
2014-10-18 09:07:45 +03:00
|
|
|
|
{if $aUserFieldsContact}
|
2015-01-03 10:19:49 +02:00
|
|
|
|
{component 'button' type='button' classes='js-user-fields-submit' text=$aLang.common.add}
|
2014-10-18 09:07:45 +03:00
|
|
|
|
{/if}
|
|
|
|
|
</fieldset>
|
2014-08-07 19:55:18 +03:00
|
|
|
|
|
|
|
|
|
{hook run='form_settings_profile_end'}
|
|
|
|
|
|
|
|
|
|
{* Скрытые поля *}
|
2015-01-03 10:19:49 +02:00
|
|
|
|
{component 'field' template='hidden.security-key'}
|
2014-08-07 19:55:18 +03:00
|
|
|
|
|
|
|
|
|
{* Кнопки *}
|
2015-01-03 10:19:49 +02:00
|
|
|
|
{component 'button' name='submit_profile_edit' mods='primary' text=$aLang.common.save}
|
2014-08-07 19:55:18 +03:00
|
|
|
|
</form>
|
|
|
|
|
|
|
|
|
|
{hook run='settings_profile_end'}
|