Ability to hide "My applications" from the menu (#937)

This commit is contained in:
n1rwana 2023-09-17 00:56:36 +03:00 committed by GitHub
parent 2939936534
commit 0ef413a5b9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 1 deletions

View file

@ -462,6 +462,7 @@ class User extends RowModel
"news",
"links",
"poster",
"apps"
],
])->get($id);
}
@ -1026,6 +1027,7 @@ class User extends RowModel
"news",
"links",
"poster",
"apps"
],
])->set($id, (int) $status)->toInteger();

View file

@ -481,6 +481,7 @@ final class UserPresenter extends OpenVKPresenter
"menu_novajoj" => "news",
"menu_ligiloj" => "links",
"menu_standardo" => "poster",
"menu_aplikoj" => "apps"
];
foreach($settings as $checkbox => $setting)
$user->setLeftMenuItemStatus($setting, $this->checkbox($checkbox));

View file

@ -196,7 +196,7 @@
(<b>{$thisUser->getNotificationsCount()}</b>)
{/if}
</a>
<a href="/apps?act=installed" class="link">{_my_apps}</a>
<a n:if="$thisUser->getLeftMenuItemStatus('apps')" href="/apps?act=installed" class="link">{_my_apps}</a>
<a href="/settings" class="link">{_my_settings}</a>
{var $canAccessAdminPanel = $thisUser->getChandlerUser()->can("access")->model("admin")->whichBelongsTo(NULL)}

View file

@ -650,6 +650,16 @@
<td>
<span class="nobold">{_my_feed}</span>
</td>
</tr><tr>
<td width="120" valign="top" align="right" align="right">
<input
n:attr="checked => $user->getLeftMenuItemStatus('apps')"
type="checkbox"
name="menu_aplikoj" />
</td>
<td>
<span class="nobold">{_my_apps}</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