示例#1
0
 /**
  * Writes the style-*.css file.
  */
 public function writeStyleFile()
 {
     StyleCompiler::getInstance()->compile($this->getDecoratedObject());
 }
示例#2
0
 /**
  * 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) . '" />';
 }
示例#3
0
	/**
	 * Updates the acp style file.
	 */
	public static function updateStyleFile() {
		StyleCompiler::getInstance()->compileACP();
	}
示例#4
0
	/**
	 * 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).'" />';
	}