Skip to content

Commit

Permalink
Ability to hide "My applications" from the menu (#937)
Browse files Browse the repository at this point in the history
  • Loading branch information
n1rwana authored Sep 16, 2023
1 parent 2939936 commit 0ef413a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Web/Models/Entities/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,7 @@ function getLeftMenuItemStatus(string $id): bool
"news",
"links",
"poster",
"apps"
],
])->get($id);
}
Expand Down Expand Up @@ -1026,6 +1027,7 @@ function setLeftMenuItemStatus(string $id, bool $status): void
"news",
"links",
"poster",
"apps"
],
])->set($id, (int) $status)->toInteger();

Expand Down
1 change: 1 addition & 0 deletions Web/Presenters/UserPresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,7 @@ function renderSettings(): void
"menu_novajoj" => "news",
"menu_ligiloj" => "links",
"menu_standardo" => "poster",
"menu_aplikoj" => "apps"
];
foreach($settings as $checkbox => $setting)
$user->setLeftMenuItemStatus($setting, $this->checkbox($checkbox));
Expand Down
2 changes: 1 addition & 1 deletion Web/Presenters/templates/@layout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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)}
Expand Down
10 changes: 10 additions & 0 deletions Web/Presenters/templates/User/Settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0ef413a

Please sign in to comment.