Bläddra i källkod

implement mechanism to register css variables through inherited colors.txt files and register backgroundColor

dev01
förälder
incheckning
b26933a5dd
4 ändrade filer med 19 tillägg och 4 borttagningar
  1. +10
    -4
      app/controller/page.php
  2. +5
    -0
      app/modules/filesinfolders.php
  3. +3
    -0
      app/views/colors.css
  4. +1
    -0
      app/views/tpl/index.html

+ 10
- 4
app/controller/page.php Visa fil

@@ -80,9 +80,9 @@ class Page {
);

$folder->prepare_files();
if($folder->extras['colors']) {
$folder->structs['default']['txt']['colors']=$folder->extras['colors'];
}
$this->register_key('backgroundColor',$folder);
$folder->fill_content();
foreach($f3->get('siteColors') as $k=>$v){
$f3->set($k,
@@ -96,7 +96,7 @@ class Page {
? $folder->config['includeBanner']
: $f3->get('templateVars.includeBanner')
);
if ($f3->get('hasBanner')) {
$banner = new \Modules\CachedImage($folder->extras['banner']);
$f3->set('banner',$banner->get_src(2000));
@@ -166,6 +166,12 @@ class Page {
///////////////////////
// Utility functions //
///////////////////////
function register_key($name, &$ff) {
$f3 = \Base::instance();
if (array_key_exists($name,$ff->config)) {
$f3->set($name,$ff->config[$name]);
}
}
function linkify($string) {
$pattern = "/\s@(\w+)[=]([\w,]+)\s/";
$count = 0;

+ 5
- 0
app/modules/filesinfolders.php Visa fil

@@ -103,6 +103,11 @@ class FilesInFolders {
$this->EXT[$param['type']]
);
}
if($this->extras[$key]) {
if ($param['type'] == 'txt') {
$this->read_textfile($this->extras[$key]);
}
}
}
}


+ 3
- 0
app/views/colors.css Visa fil

@@ -0,0 +1,3 @@
html {
background-color: {{ @backgroundColor }};
}

+ 1
- 0
app/views/tpl/index.html Visa fil

@@ -17,6 +17,7 @@
<link type="text/css" href="/{{ @RESOURCES }}style.css" rel="stylesheet" />
<title>{{ @title }}</title>
<style>
<include href="colors.css" />
li { margin-left:1em; }
</style>
</head>

Laddar…
Avbryt
Spara