Global: Add user option to hide ad poster

This commit is contained in:
Maxim Leshchenko 2022-01-03 21:13:53 +02:00
parent 1b1c88dd96
commit 3edf34e0ea
No known key found for this signature in database
GPG key ID: BB9C44A8733FBEEE
6 changed files with 23 additions and 8 deletions

View file

@ -354,6 +354,7 @@ class User extends RowModel
"groups", "groups",
"news", "news",
"links", "links",
"poster",
], ],
])->get($id); ])->get($id);
} }
@ -774,6 +775,7 @@ class User extends RowModel
"groups", "groups",
"news", "news",
"links", "links",
"poster",
], ],
])->set($id, (int) $status)->toInteger(); ])->set($id, (int) $status)->toInteger();

View file

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

View file

@ -195,7 +195,7 @@
</div> </div>
<a <a
n:if="OPENVK_ROOT_CONF['openvk']['preferences']['adPoster']['enable']" n:if="OPENVK_ROOT_CONF['openvk']['preferences']['adPoster']['enable'] && $thisUser->getLeftMenuItemStatus('poster')"
href="{php echo OPENVK_ROOT_CONF['openvk']['preferences']['adPoster']['link']}" > href="{php echo OPENVK_ROOT_CONF['openvk']['preferences']['adPoster']['link']}" >
<img <img
src="{php echo OPENVK_ROOT_CONF['openvk']['preferences']['adPoster']['src']}" src="{php echo OPENVK_ROOT_CONF['openvk']['preferences']['adPoster']['src']}"

View file

@ -552,6 +552,16 @@
<td> <td>
<span class="nobold">{_additional_links}</span> <span class="nobold">{_additional_links}</span>
</td> </td>
</tr><tr n:if="OPENVK_ROOT_CONF['openvk']['preferences']['adPoster']['enable']">
<td width="120" valign="top" align="right" align="right">
<input
n:attr="checked => $user->getLeftMenuItemStatus('poster')"
type="checkbox"
name="menu_standardo" />
</td>
<td>
<span class="nobold">{_ad_poster}</span>
</td>
</tr> </tr>
<tr> <tr>
<td> <td>

View file

@ -412,6 +412,7 @@
"ui_settings_rating_hide" = "Hide"; "ui_settings_rating_hide" = "Hide";
"additional_links" = "Additional links"; "additional_links" = "Additional links";
"ad_poster" = "Ad poster";
/* Two-factor authentication */ /* Two-factor authentication */

View file

@ -432,6 +432,7 @@
"ui_settings_rating_hide" = "Скрывать"; "ui_settings_rating_hide" = "Скрывать";
"additional_links" = "Дополнительные ссылки"; "additional_links" = "Дополнительные ссылки";
"ad_poster" = "Рекламный плакат";
/* Two-factor authentication */ /* Two-factor authentication */