]> git.mxchange.org Git - friendica.git/blobdiff - view/theme/quattro/config.php
Replace "group" with "circle" in the rest of the code
[friendica.git] / view / theme / quattro / config.php
index 459a0d7f40cb6d6cd26f2c0493d8008d7f8c67a9..1b010a355909c92e0a9a3ebc5e0388a82b6e6b66 100644 (file)
@@ -1,36 +1,51 @@
 <?php
 /**
- * Theme settings
+ * @copyright Copyright (C) 2010-2023, 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;
-use Friendica\Core\Config;
 use Friendica\Core\Renderer;
 use Friendica\DI;
 
 function theme_content(App $a) {
-       if (!local_user()) {
+       if (!DI::userSession()->getLocalUserId()) {
                return;
        }
 
-       $align = DI::pConfig()->get(local_user(), 'quattro', 'align' );
-       $color = DI::pConfig()->get(local_user(), 'quattro', 'color' );
-       $tfs = DI::pConfig()->get(local_user(),"quattro","tfs");
-       $pfs = DI::pConfig()->get(local_user(),"quattro","pfs");
+       $align = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'quattro', 'align' );
+       $color = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'quattro', 'color' );
+       $tfs = DI::pConfig()->get(DI::userSession()->getLocalUserId(),"quattro","tfs");
+       $pfs = DI::pConfig()->get(DI::userSession()->getLocalUserId(),"quattro","pfs");
 
        return quattro_form($a,$align, $color, $tfs, $pfs);
 }
 
 function theme_post(App $a) {
-       if (! local_user()) {
+       if (!DI::userSession()->getLocalUserId()) {
                return;
        }
 
        if (isset($_POST['quattro-settings-submit'])){
-               DI::pConfig()->set(local_user(), 'quattro', 'align', $_POST['quattro_align']);
-               DI::pConfig()->set(local_user(), 'quattro', 'color', $_POST['quattro_color']);
-               DI::pConfig()->set(local_user(), 'quattro', 'tfs', $_POST['quattro_tfs']);
-               DI::pConfig()->set(local_user(), 'quattro', 'pfs', $_POST['quattro_pfs']);
+               DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'quattro', 'align', $_POST['quattro_align']);
+               DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'quattro', 'color', $_POST['quattro_color']);
+               DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'quattro', 'tfs', $_POST['quattro_tfs']);
+               DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'quattro', 'pfs', $_POST['quattro_pfs']);
        }
 }