Skip to content

Commit

Permalink
additional php css
Browse files Browse the repository at this point in the history
  • Loading branch information
omgtalsania authored May 31, 2024
1 parent dca44ef commit a8363a6
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions ide/workspace/web/examples/angularjs/styles/additional.php
Original file line number Diff line number Diff line change
@@ -1 +1,36 @@
<?php

error_reporting(E_ERROR | E_PARSE);

header('Content-Type: text/css');


$file = __DIR__.'/../app/config/settings.js';
$contents = file_get_contents($file);
//$config = json_decode($contents);
$start = strpos($contents, "theme") - 1;
$midstr = substr($contents, $start);
$end = strpos($midstr, "}") + 1;
$finalstr = substr($midstr, 0, $end);
$finaljsonstr = "{ " . $finalstr . "}";
$finaljson = (array)json_decode($finaljsonstr);

$bg = $finaljson['theme']->background;
$css = "
.page-link, .btn-primary{
background-color: " . $bg . " !important;
}
.btn-link{
color: " . $bg . " !important;
}
";


$scriptFile = "additional.css";
$fp = fopen($scriptFile, 'w');
fwrite($fp, $css);
fclose($fp);

echo $css;
?>

0 comments on commit a8363a6

Please sign in to comment.