]> git.mxchange.org Git - friendica.git/blobdiff - view/theme/vier/config.php
Merge pull request #12544 from nupplaphil/bug/redirect
[friendica.git] / view / theme / vier / config.php
index 5891aa32f454505a6fc3c66c7fa7788e3a05ef45..b5fe4ff1095dfebe80c4d3b8408d6c9d5508bf80 100644 (file)
@@ -1,6 +1,22 @@
 <?php
 /**
- * Theme settings
+ * @copyright Copyright (C) 2010-2022, the Friendica project
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ *
  */
 
 use Friendica\App;
@@ -11,7 +27,7 @@ require_once __DIR__ . '/theme.php';
 
 function theme_content(App $a)
 {
-       if (!local_user()) {
+       if (!DI::userSession()->getLocalUserId()) {
                return;
        }
 
@@ -19,7 +35,7 @@ function theme_content(App $a)
                return;
        }
 
-       $style = DI::pConfig()->get(local_user(), 'vier', 'style');
+       $style = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'vier', 'style');
 
        if ($style == "") {
                $style = DI::config()->get('vier', 'style');
@@ -42,18 +58,18 @@ function theme_content(App $a)
 
 function theme_post(App $a)
 {
-       if (! local_user()) {
+       if (!DI::userSession()->getLocalUserId()) {
                return;
        }
 
        if (isset($_POST['vier-settings-submit'])) {
-               DI::pConfig()->set(local_user(), 'vier', 'style', $_POST['vier_style']);
-               DI::pConfig()->set(local_user(), 'vier', 'show_pages', $_POST['vier_show_pages']);
-               DI::pConfig()->set(local_user(), 'vier', 'show_profiles', $_POST['vier_show_profiles']);
-               DI::pConfig()->set(local_user(), 'vier', 'show_helpers', $_POST['vier_show_helpers']);
-               DI::pConfig()->set(local_user(), 'vier', 'show_services', $_POST['vier_show_services']);
-               DI::pConfig()->set(local_user(), 'vier', 'show_friends', $_POST['vier_show_friends']);
-               DI::pConfig()->set(local_user(), 'vier', 'show_lastusers', $_POST['vier_show_lastusers']);
+               DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'vier', 'style', $_POST['vier_style']);
+               DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'vier', 'show_pages', $_POST['vier_show_pages']);
+               DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'vier', 'show_profiles', $_POST['vier_show_profiles']);
+               DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'vier', 'show_helpers', $_POST['vier_show_helpers']);
+               DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'vier', 'show_services', $_POST['vier_show_services']);
+               DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'vier', 'show_friends', $_POST['vier_show_friends']);
+               DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'vier', 'show_lastusers', $_POST['vier_show_lastusers']);
        }
 }