]> git.mxchange.org Git - friendica.git/blobdiff - view/theme/frio/style.php
Merge remote-tracking branch 'upstream/develop' into develop
[friendica.git] / view / theme / frio / style.php
index 041f890e29085117551e45f9aee78156bbf8b53b..04379b244ee14316f6bf127e4b0404ee02061a44 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 require_once 'view/theme/frio/php/PHPColors/Color.php';
 
+use Friendica\Core\Config;
 use Friendica\Core\PConfig;
 
 $schemecss = "";
@@ -29,6 +30,25 @@ if (! $a->install) {
                if (empty($modified)) {
                        PConfig::set($uid, 'frio', 'css_modified', time());
                }
+       } else {
+               Config::load('frio');
+
+               // Load frios system config.
+               $schema           = Config::get("frio", "schema");
+               $nav_bg           = Config::get("frio", "nav_bg");
+               $nav_icon_color   = Config::get("frio", "nav_icon_color");
+               $link_color       = Config::get("frio", "link_color");
+               $bgcolor          = Config::get("frio", "background_color");
+               $contentbg_transp = Config::get("frio", "contentbg_transp");
+               $background_image = Config::get("frio", "background_image");
+               $bg_image_option  = Config::get("frio", "bg_image_option");
+               $modified         = Config::get("frio", "css_modified");
+
+               // There is maybe the case that the user did never modify the theme settings.
+               // In this case we store the present time.
+               if (empty($modified)) {
+                       Config::set('frio', 'css_modified', time());
+               }
        }
 }
 
@@ -40,6 +60,11 @@ if (! $a->install) {
 if ($_REQUEST['schema']) {
        $schema = $_REQUEST['schema'];
 }
+
+// Sanitize the data.
+$schema = !empty($schema) ? basename($schema) : "";
+
+
 if (($schema) && ($schema != '---')) {
        if (file_exists('view/theme/frio/schema/' . $schema . '.php')) {
                $schemefile = 'view/theme/frio/schema/' . $schema . '.php';
@@ -73,7 +98,7 @@ $bgcolor          = (empty($bgcolor)          ? "#ededed"      : $bgcolor);
 $background_image = (empty($background_image) ? 'img/none.jpg' : $background_image);
 $modified         = (empty($modified)         ? time()         :$modified);
 
-$contentbg_transp = ((isset($contentbg_transp) && $contentbg_transp != "") ?  $contentbg_transp : 100);
+$contentbg_transp = ((isset($contentbg_transp) && $contentbg_transp != "") ? $contentbg_transp : 100);
 
 // Calculate some colors in dependance of existing colors.
 // Some colors are calculated to don't have too many selection