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); } } }
} /** * 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']))) { $loadarr = isset($_GET['full']) ? explode(' ', $_GET['full']) : array(); // Support for deprecated WEBKIT parameter. if (isset($_GET['webkit'])) { $loadarr = array_merge(explode(' ', $_GET['webkit']), $loadarr); } foreach ($loadarr as $file) { if (Path_Validator::is_safe($file, 'css') && ($contents = Path::get_contents($file))) { echo CSSMin::minify($contents); } } }