mirror of
https://github.com/openvk/openvk
synced 2024-12-23 00:51:03 +03:00
Users: Add ability to hide custom links by users through settings
This commit is contained in:
parent
4dcb62a1d3
commit
8edebcb0d5
6 changed files with 21 additions and 1 deletions
|
@ -353,6 +353,7 @@ class User extends RowModel
|
|||
"notes",
|
||||
"groups",
|
||||
"news",
|
||||
"links",
|
||||
],
|
||||
])->get($id);
|
||||
}
|
||||
|
@ -766,6 +767,7 @@ class User extends RowModel
|
|||
"notes",
|
||||
"groups",
|
||||
"news",
|
||||
"links",
|
||||
],
|
||||
])->set($id, (int) $status)->toInteger();
|
||||
|
||||
|
|
|
@ -375,6 +375,7 @@ final class UserPresenter extends OpenVKPresenter
|
|||
"menu_notatoj" => "notes",
|
||||
"menu_grupoj" => "groups",
|
||||
"menu_novajoj" => "news",
|
||||
"menu_ligiloj" => "links",
|
||||
];
|
||||
foreach($settings as $checkbox => $setting)
|
||||
$user->setLeftMenuItemStatus($setting, $this->checkbox($checkbox));
|
||||
|
|
|
@ -168,7 +168,7 @@
|
|||
<a href="/settings" class="link">{_"my_settings"}</a>
|
||||
{var canAccessAdminPanel = $thisUser->getChandlerUser()->can("access")->model("admin")->whichBelongsTo(NULL)}
|
||||
{var canAccessHelpdesk = $thisUser->getChandlerUser()->can("write")->model('openvk\Web\Models\Entities\TicketReply')->whichBelongsTo(0)}
|
||||
{var menuLinksAvaiable = sizeof(OPENVK_ROOT_CONF['openvk']['preferences']['menu']['links']) > 0}
|
||||
{var menuLinksAvaiable = sizeof(OPENVK_ROOT_CONF['openvk']['preferences']['menu']['links']) > 0 && $thisUser->getLeftMenuItemStatus('links')}
|
||||
<div n:if="$canAccessAdminPanel || $canAccessHelpdesk || $menuLinksAvaiable" class="menu_divider"></div>
|
||||
{if $canAccessAdminPanel}
|
||||
<a href="/admin" class="link">Админ-панель</a>
|
||||
|
@ -181,6 +181,7 @@
|
|||
</a>
|
||||
{/if}
|
||||
<a
|
||||
n:if="$thisUser->getLeftMenuItemStatus('links')"
|
||||
n:foreach="OPENVK_ROOT_CONF['openvk']['preferences']['menu']['links'] as $menuItem"
|
||||
href="{$menuItem['url']}"
|
||||
target="_blank"
|
||||
|
|
|
@ -505,6 +505,16 @@
|
|||
<td>
|
||||
<span class="nobold">{_my_feed}</span>
|
||||
</td>
|
||||
</tr><tr n:if="sizeof(OPENVK_ROOT_CONF['openvk']['preferences']['menu']['links']) > 0">
|
||||
<td width="120" valign="top" align="right" align="right">
|
||||
<input
|
||||
n:attr="checked => $user->getLeftMenuItemStatus('links')"
|
||||
type="checkbox"
|
||||
name="menu_ligiloj" />
|
||||
</td>
|
||||
<td>
|
||||
<span class="nobold">{_additional_links}</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
|
|
|
@ -406,6 +406,8 @@
|
|||
"ui_settings_rating_show" = "Show";
|
||||
"ui_settings_rating_hide" = "Hide";
|
||||
|
||||
"additional_links" = "Additional links";
|
||||
|
||||
/* Two-factor authentication */
|
||||
|
||||
"two_factor_authentication" = "Two-factor authentication";
|
||||
|
|
|
@ -426,6 +426,10 @@
|
|||
"ui_settings_rating_show" = "Показывать";
|
||||
"ui_settings_rating_hide" = "Скрывать";
|
||||
|
||||
"additional_links" = "Дополнительные ссылки";
|
||||
|
||||
/* Two-factor authentication */
|
||||
|
||||
"two_factor_authentication" = "Двухфакторная аутентификация";
|
||||
"two_factor_authentication_disabled" = "Обеспечивает надежную защиту от взлома: для входа на страницу необходимо ввести код, полученный в приложении 2FA.";
|
||||
"two_factor_authentication_enabled" = "Двухфакторная аутентификация включена. Ваша страница защищена.";
|
||||
|
|
Loading…
Reference in a new issue