1 | <?php |
||
10 | class StyleUtils |
||
11 | { |
||
12 | |||
13 | /** @var string current template */ |
||
14 | protected $tpl; |
||
15 | /** @var bool reinitialize styles config */ |
||
16 | protected $reinit; |
||
17 | /** @var bool $preview preview mode */ |
||
18 | protected $preview; |
||
19 | /** @var array default replacements to be merged with custom style configs */ |
||
20 | protected $defaultReplacements = array( |
||
21 | '__text__' => "#000", |
||
22 | '__background__' => "#fff", |
||
23 | '__text_alt__' => "#999", |
||
24 | '__background_alt__' => "#eee", |
||
25 | '__text_neu__' => "#666", |
||
26 | '__background_neu__' => "#ddd", |
||
27 | '__border__' => "#ccc", |
||
28 | '__highlight__' => "#ff9", |
||
29 | '__link__' => "#00f", |
||
30 | ); |
||
31 | |||
32 | /** |
||
33 | * StyleUtils constructor. |
||
34 | * @param string $tpl template name: if not passed as argument, the default value from $conf will be used |
||
35 | * @param bool $preview |
||
36 | * @param bool $reinit whether static style conf should be reinitialized |
||
37 | */ |
||
38 | public function __construct($tpl = '', $preview = false, $reinit = false) |
||
48 | |||
49 | /** |
||
50 | * Load style ini contents |
||
51 | * |
||
52 | * Loads and merges style.ini files from template and config and prepares |
||
53 | * the stylesheet modes |
||
54 | * |
||
55 | * @author Andreas Gohr <[email protected]> |
||
56 | * @author Anna Dabrowska <[email protected]> |
||
57 | * |
||
58 | * @return array with keys 'stylesheets' and 'replacements' |
||
59 | */ |
||
60 | public function cssStyleini() |
||
126 | |||
127 | /** |
||
128 | * Checks if configured style files exist and, if necessary, adjusts file extensions in config |
||
129 | * |
||
130 | * @param array $stylesheets |
||
131 | * @param string $file |
||
132 | * @param string $mode |
||
133 | * @param string $incbase |
||
134 | * @param string $webbase |
||
135 | * @return mixed |
||
136 | */ |
||
137 | protected function getValidatedStyles($stylesheets, $file, $mode, $incbase, $webbase) |
||
156 | |||
157 | /** |
||
158 | * Returns the web base path for the given level/group in config cascade. |
||
159 | * Style resources are relative to the template directory for the main (default) styles |
||
160 | * but relative to DOKU_BASE for everything else" |
||
161 | * |
||
162 | * @param string $config_group |
||
163 | * @return string |
||
164 | */ |
||
165 | protected function getWebbase($config_group) |
||
173 | |||
174 | /** |
||
175 | * Amend paths used in replacement relative urls, refer FS#2879 |
||
176 | * |
||
177 | * @author Chris Smith <[email protected]> |
||
178 | * |
||
179 | * @param array $replacements with key-value pairs |
||
180 | * @param string $location |
||
181 | * @return array |
||
182 | */ |
||
183 | protected function cssFixreplacementurls($replacements, $location) |
||
194 | } |
||
195 |