Ejemplo n.º 1
0
Archivo: css.php Proyecto: ruucla/mwf
    require_once dirname(__FILE__) . '/css/default/full.css';
    foreach ($custom as $dir) {
        if (file_exists(dirname(__FILE__) . '/css/' . $dir . '/full.css')) {
            include_once dirname(__FILE__) . '/css/' . $dir . '/full.css';
        }
    }
}
/**
 * Load custom CSS files (minified) based on user agent.
 */
if (isset($_GET['basic'])) {
    foreach (explode(' ', $_GET['basic']) as $file) {
        if (Path_Validator::is_safe($file, 'css') && ($contents = Path::get_contents($file))) {
            echo ' ' . CSSMin::minify($contents);
        }
    }
}
if (User_Agent::is_standard() && isset($_GET['standard'])) {
    foreach (explode(' ', $_GET['standard']) as $file) {
        if (Path_Validator::is_safe($file, 'css') && ($contents = Path::get_contents($file))) {
            echo ' ' . CSSMin::minify($contents);
        }
    }
}
if (User_Agent::is_full() && isset($_GET['full'])) {
    foreach (explode(' ', $_GET['full']) as $file) {
        if (Path_Validator::is_safe($file, 'css') && ($contents = Path::get_contents($file))) {
            echo ' ' . CSSMin::minify($contents);
        }
    }
}
Ejemplo n.º 2
0
Archivo: css.php Proyecto: ruucla/mwf
if (isset($_GET['basic']) || isset($_GET['paths'])) {
    $loadarr = isset($_GET['basic']) ? explode(' ', $_GET['basic']) : array();
    // Support for deprecated PATHS parameter.
    if (isset($_GET['paths'])) {
        $loadarr = array_merge(explode(' ', $_GET['paths']), $loadarr);
    }
    foreach ($loadarr as $file) {
        if (Path_Validator::is_safe($file, 'css') && ($contents = Path::get_contents(urldecode($file)))) {
            echo CSSMin::minify($contents);
        }
    }
}
/**
 * Scripts that will be minified and included at the STANDARD level and above.
 */
if (User_Agent::is_standard() && (isset($_GET['standard']) || isset($_GET['touch']))) {
    $loadarr = isset($_GET['standard']) ? explode(' ', $_GET['standard']) : array();
    // Support for deprecated TOUCH parameter.
    if (isset($_GET['touch'])) {
        $loadarr = array_merge(explode(' ', $_GET['touch']), $loadarr);
    }
    foreach ($loadarr as $file) {
        if (Path_Validator::is_safe($file, 'css') && ($contents = Path::get_contents($file))) {
            echo CSSMin::minify($contents);
        }
    }
}
/**
 * Scripts that will be minified and included at the FULL level only.
 */
if (User_Agent::is_full() && (isset($_GET['full']) || isset($_GET['webkit']))) {