|
@@ -239,6 +239,7 @@ class Edit extends Profile
|
|
|
|
|
|
// имя, титул и аватара
|
|
// имя, титул и аватара
|
|
$fields = [];
|
|
$fields = [];
|
|
|
|
+
|
|
if ($this->rules->rename) {
|
|
if ($this->rules->rename) {
|
|
$fields['username'] = [
|
|
$fields['username'] = [
|
|
'type' => 'text',
|
|
'type' => 'text',
|
|
@@ -257,6 +258,16 @@ class Edit extends Profile
|
|
'value' => $this->curUser->username,
|
|
'value' => $this->curUser->username,
|
|
];
|
|
];
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ if ($this->rules->deleteMyProfile) {
|
|
|
|
+ $fields['delete_profile'] = [
|
|
|
|
+ 'type' => 'link',
|
|
|
|
+ 'value' => __('Delete my profile'),
|
|
|
|
+ 'title' => __('Delete my profile'),
|
|
|
|
+ 'href' => $this->c->Router->link('DeleteUserProfile', $args),
|
|
|
|
+ ];
|
|
|
|
+ }
|
|
|
|
+
|
|
if ($this->rules->changeGroup) {
|
|
if ($this->rules->changeGroup) {
|
|
$fields['group'] = [
|
|
$fields['group'] = [
|
|
'type' => 'link',
|
|
'type' => 'link',
|
|
@@ -273,6 +284,7 @@ class Edit extends Profile
|
|
'value' => $this->curUser->group_id ? $this->curUser->g_title : '-',
|
|
'value' => $this->curUser->group_id ? $this->curUser->g_title : '-',
|
|
];
|
|
];
|
|
}
|
|
}
|
|
|
|
+
|
|
if ($this->rules->confModer) {
|
|
if ($this->rules->confModer) {
|
|
$fields['configure-moderator'] = [
|
|
$fields['configure-moderator'] = [
|
|
'type' => 'link',
|
|
'type' => 'link',
|
|
@@ -280,6 +292,7 @@ class Edit extends Profile
|
|
'href' => $this->c->Router->link('EditUserModeration', $args),
|
|
'href' => $this->c->Router->link('EditUserModeration', $args),
|
|
];
|
|
];
|
|
}
|
|
}
|
|
|
|
+
|
|
if ($this->rules->setTitle) {
|
|
if ($this->rules->setTitle) {
|
|
$fields['title'] = [
|
|
$fields['title'] = [
|
|
'type' => 'text',
|
|
'type' => 'text',
|
|
@@ -296,6 +309,7 @@ class Edit extends Profile
|
|
'value' => $this->curUser->title(),
|
|
'value' => $this->curUser->title(),
|
|
];
|
|
];
|
|
}
|
|
}
|
|
|
|
+
|
|
if ($this->rules->editPass) {
|
|
if ($this->rules->editPass) {
|
|
$fields['change_pass'] = [
|
|
$fields['change_pass'] = [
|
|
'type' => 'link',
|
|
'type' => 'link',
|
|
@@ -303,6 +317,7 @@ class Edit extends Profile
|
|
'href' => $this->c->Router->link('EditUserPass', $args),
|
|
'href' => $this->c->Router->link('EditUserPass', $args),
|
|
];
|
|
];
|
|
}
|
|
}
|
|
|
|
+
|
|
if ($this->rules->configureOAuth) {
|
|
if ($this->rules->configureOAuth) {
|
|
$fields['configure_oauth'] = [
|
|
$fields['configure_oauth'] = [
|
|
'type' => 'link',
|
|
'type' => 'link',
|
|
@@ -310,6 +325,7 @@ class Edit extends Profile
|
|
'href' => $this->c->Router->link('EditUserOAuth', $args),
|
|
'href' => $this->c->Router->link('EditUserOAuth', $args),
|
|
];
|
|
];
|
|
}
|
|
}
|
|
|
|
+
|
|
if ($this->rules->useAvatar) {
|
|
if ($this->rules->useAvatar) {
|
|
if (! $this->curUser->avatar) {
|
|
if (! $this->curUser->avatar) {
|
|
$fields['avatar'] = [
|
|
$fields['avatar'] = [
|
|
@@ -405,6 +421,7 @@ class Edit extends Profile
|
|
|
|
|
|
// контактная информация
|
|
// контактная информация
|
|
$fields = [];
|
|
$fields = [];
|
|
|
|
+
|
|
if ($this->rules->viewOEmail) {
|
|
if ($this->rules->viewOEmail) {
|
|
$fields['open-email'] = [
|
|
$fields['open-email'] = [
|
|
'class' => ['pline'],
|
|
'class' => ['pline'],
|
|
@@ -413,6 +430,7 @@ class Edit extends Profile
|
|
'value' => $this->curUser->censorEmail,
|
|
'value' => $this->curUser->censorEmail,
|
|
];
|
|
];
|
|
}
|
|
}
|
|
|
|
+
|
|
if ($this->rules->editEmail) {
|
|
if ($this->rules->editEmail) {
|
|
$fields['change_email'] = [
|
|
$fields['change_email'] = [
|
|
'type' => 'link',
|
|
'type' => 'link',
|
|
@@ -420,6 +438,7 @@ class Edit extends Profile
|
|
'href' => $this->c->Router->link('EditUserEmail', $args),
|
|
'href' => $this->c->Router->link('EditUserEmail', $args),
|
|
];
|
|
];
|
|
}
|
|
}
|
|
|
|
+
|
|
$fields['email_setting'] = [
|
|
$fields['email_setting'] = [
|
|
'class' => ['block'],
|
|
'class' => ['block'],
|
|
'type' => 'radio',
|
|
'type' => 'radio',
|
|
@@ -453,6 +472,7 @@ class Edit extends Profile
|
|
'href' => $this->curUser->censorUrl,
|
|
'href' => $this->curUser->censorUrl,
|
|
];
|
|
];
|
|
}
|
|
}
|
|
|
|
+
|
|
$form['sets']['contacts'] = [
|
|
$form['sets']['contacts'] = [
|
|
'class' => ['data-edit'],
|
|
'class' => ['data-edit'],
|
|
'legend' => 'Contact details',
|
|
'legend' => 'Contact details',
|