mirror of
https://github.com/openvk/openvk
synced 2024-11-11 01:19:53 +03:00
Global: Add toggle home page between My Page and My Feed
The switch is in the interface settings. Closes #361
This commit is contained in:
parent
0d86837699
commit
060100821d
7 changed files with 28 additions and 1 deletions
|
@ -86,6 +86,11 @@ class User extends RowModel
|
|||
return (bool) $this->getRecord()->microblog;
|
||||
}
|
||||
|
||||
function getMainPage(): int
|
||||
{
|
||||
return $this->getRecord()->main_page;
|
||||
}
|
||||
|
||||
function getChandlerGUID(): string
|
||||
{
|
||||
return $this->getRecord()->user;
|
||||
|
|
|
@ -14,7 +14,12 @@ final class AboutPresenter extends OpenVKPresenter
|
|||
{
|
||||
if(!is_null($this->user)) {
|
||||
header("HTTP/1.1 302 Found");
|
||||
|
||||
if($this->user->identity->getMainPage())
|
||||
header("Location: /feed");
|
||||
else
|
||||
header("Location: /id" . $this->user->id);
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
|
|
|
@ -419,6 +419,9 @@ final class UserPresenter extends OpenVKPresenter
|
|||
|
||||
if(in_array($this->postParam("nsfw"), [0, 1, 2]))
|
||||
$user->setNsfwTolerance((int) $this->postParam("nsfw"));
|
||||
|
||||
if(in_array($this->postParam("main_page"), [0, 1]))
|
||||
$user->setMain_Page((int) $this->postParam("main_page"));
|
||||
} else if($_GET['act'] === "lMenu") {
|
||||
$settings = [
|
||||
"menu_bildoj" => "photos",
|
||||
|
|
|
@ -500,6 +500,17 @@
|
|||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="120" valign="top">
|
||||
<span class="nobold">{_ui_settings_main_page}</span>
|
||||
</td>
|
||||
<td>
|
||||
<select name="main_page">
|
||||
<option value="0" {if !$user->getMainPage()}selected{/if}>{_my_page}</option>
|
||||
<option value="1" {if $user->getMainPage()}selected{/if}>{_my_feed}</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="120" valign="top" align="right">
|
||||
<input type="checkbox" name="theme_for_session" value="1">
|
||||
|
|
1
install/sqls/00024-main-page-setting.sql
Normal file
1
install/sqls/00024-main-page-setting.sql
Normal file
|
@ -0,0 +1 @@
|
|||
ALTER TABLE `profiles` ADD COLUMN `main_page` tinyint(3) unsigned NOT NULL DEFAULT 0 AFTER `microblog`;
|
|
@ -463,6 +463,7 @@
|
|||
"ui_settings_view_of_posts" = "View of posts";
|
||||
"ui_settings_view_of_posts_old" = "Old";
|
||||
"ui_settings_view_of_posts_microblog" = "Microblog";
|
||||
"ui_settings_main_page" = "Main page";
|
||||
|
||||
"additional_links" = "Additional links";
|
||||
"ad_poster" = "Ad poster";
|
||||
|
|
|
@ -491,6 +491,7 @@
|
|||
"ui_settings_view_of_posts" = "Вид постов";
|
||||
"ui_settings_view_of_posts_old" = "Старый";
|
||||
"ui_settings_view_of_posts_microblog" = "Микроблог";
|
||||
"ui_settings_main_page" = "Главная страница";
|
||||
|
||||
"additional_links" = "Дополнительные ссылки";
|
||||
"ad_poster" = "Рекламный плакат";
|
||||
|
|
Loading…
Reference in a new issue