Ejemplo n.º 1
0
    public function external_hook($hook)
    {
        switch ($hook) {
            case 'css':
                @ob_end_clean();
                $cache_length = 10800;
                // 3 hours
                header('Expires: ' . gmdate('D, d M Y H:i:s', time() + $cache_length) . ' GMT');
                header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
                header("Pragma: cache");
                header("Cache-Control: max-age={$cache_length}");
                header("User-Cache-Control: max-age={$cache_length}");
                header('Content-type: text/css');
                $styles = !empty(module_theme::$current_theme_styles) ? module_theme::$current_theme_styles : module_theme::get_theme_styles(module_theme::$current_theme);
                ?>


/** css stylesheet */

<?php 
                foreach ($styles as $style) {
                    if (isset($style['v']) && is_array($style['v'])) {
                        echo $style['r'] . '{';
                        foreach ($style['v'] as $s => $v) {
                            echo $s . ':' . $v[0] . '; ';
                        }
                        echo "}\n";
                    }
                }
                // custom css output (only not in demo mode)
                if (!_DEMO_MODE) {
                    echo module_config::c(_THEME_CONFIG_PREFIX . 'theme_custom_css');
                } else {
                    echo '/*custom css disabled in demo mode*/';
                }
                exit;
        }
    }
Ejemplo n.º 2
0
                <?php 
_e('Value');
?>
            </th>
            <th>
                <?php 
_e('Default');
?>
            </th>
        </tr>
        </thead>
        <tbody>
            <?php 
$r = 1;
$x = 1;
foreach (module_theme::get_theme_styles(module_theme::$current_theme) as $style) {
    $c = 0;
    if (isset($style['v']) && is_array($style['v'])) {
        foreach ($style['v'] as $k => $v) {
            $c++;
            ?>
                        <tr class="<?php 
            echo $x % 2 ? 'odd' : 'even';
            ?>
">
                            <?php 
            if ($c == 1) {
                ?>
                            <td rowspan="<?php 
                echo count($style['v']);
                ?>