/** * Writes the style-*.css file. */ public function writeStyleFile() { StyleCompiler::getInstance()->compile($this->getDecoratedObject()); }
/** * Returns the HTML tag to include current stylesheet. * * @param boolean $isACP indicates if the request is an acp request * @return string */ public function getStylesheet($isACP = false) { if ($isACP) { // ACP $filename = 'acp/style/style' . (WCF::getLanguage()->get('wcf.global.pageDirection') == 'rtl' ? '-rtl' : '') . '.css'; if (!file_exists(WCF_DIR . $filename)) { StyleCompiler::getInstance()->compileACP(); } } else { // frontend $filename = 'style/style-' . $this->getStyle()->styleID . (WCF::getLanguage()->get('wcf.global.pageDirection') == 'rtl' ? '-rtl' : '') . '.css'; if (!file_exists(WCF_DIR . $filename)) { StyleCompiler::getInstance()->compile($this->getStyle()->getDecoratedObject()); } } return '<link rel="stylesheet" type="text/css" href="' . WCF::getPath() . $filename . '?m=' . filemtime(WCF_DIR . $filename) . '" />'; }
/** * Updates the acp style file. */ public static function updateStyleFile() { StyleCompiler::getInstance()->compileACP(); }
/** * Returns the HTML tag to include current stylesheet. * * @todo Add RTL support * * @return string */ public function getStylesheet() { if (RequestHandler::getInstance()->isACPRequest()) { // ACP $filename = 'acp/style/style.css'; if (!file_exists(WCF_DIR.$filename)) { StyleCompiler::getInstance()->compileACP(); } } else { // frontend $filename = 'style/style-'.$this->getStyle()->styleID.'.css'; if (!file_exists(WCF_DIR.$filename)) { StyleCompiler::getInstance()->compile($this->getStyle()->getDecoratedObject()); } } return '<link rel="stylesheet" type="text/css" href="'.WCF::getPath().$filename.'?m='.filemtime(WCF_DIR.$filename).'" />'; }