Changeset 5971
- Timestamp:
- 01/25/12 01:56:27 (4 months ago)
- File:
-
- 1 edited
-
trunk/core/tools/cssbuilder.core.php (modified) (15 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/core/tools/cssbuilder.core.php
r5899 r5971 43 43 * into one file, the "import.css". If you include "import.css" in your Theme you laying 44 44 * a solid base for your own CSS style modifications on top of our CSS Framework. 45 * Plus, you might still modify the Clansuite CSS Framework Core to your intents. 45 * Plus, you might still modify the Clansuite CSS Framework Core to your intents. 46 46 * 47 47 * Basic Usage: … … 145 145 // initializing 146 146 $config = Clansuite_CMS::getClansuiteConfig(); 147 147 148 self::setFrontendPath(ROOT_THEMES_FRONTEND); 148 149 self::setBackendPath(ROOT_THEMES_BACKEND); … … 158 159 { 159 160 160 #-----------------------------------------------------------------------------------------------------------------161 # Prepare162 #-----------------------------------------------------------------------------------------------------------------161 /** 162 * Configuration 163 */ 163 164 $config = self::getConfiguration(); 164 165 165 166 $coreadditionalFiles = $themeadditionalFiles = $themeBackadditionalFiles = array(); 166 167 168 # build browser specific configuration filename 167 169 $browser = $config['browsers']; 168 170 $postfix = $browser[$index]['postfix']; … … 175 177 // Read Core INI-File 176 178 $coreINI = ROOT_THEMES_CORE . 'css' . DS . 'csfw' . DS . $builderINI; 177 $coreInfo = $this->read _properties($coreINI);179 $coreInfo = $this->readCssBuilderIni($coreINI); 178 180 $coreCssName = $coreInfo['cssname'] . $postfix . '.css'; 179 181 … … 189 191 $core_compact = $this->getCoreCompactHeader($coreInfo); 190 192 191 /* ----- prepare frontend theme ----- */ 193 /** 194 * prepare frontend theme 195 */ 192 196 if(true === $config['compileThemeFrontend']) 193 197 { … … 200 204 // Read INI-File 201 205 $themeINI = $config['themeFrontendPath'] . DS . $config['themeFrontend'] . DS . 'css' . DS . $builderINI; 202 $themeInfo = $this->read _properties($themeINI);206 $themeInfo = $this->readCssBuilderIni($themeINI); 203 207 $themeInfo['path'] = str_replace("{theme}", $config['themeFrontend'], $themeInfo['path']); 204 208 … … 217 221 #Clansuite_Debug::printR( $themeFiles ); 218 222 219 /* ----- prepare backend theme ----- */ 223 /** 224 * prepare backend theme 225 */ 220 226 if(true === $config['compileThemeBackend']) 221 227 { … … 227 233 // Read INI-File 228 234 $themeBackINI = $config['themeBackendPath'] . DS . $config['themeBackend'] . DS . 'css' . DS . $builderINI; 229 $themeBackInfo = $this->read _properties($themeBackINI);235 $themeBackInfo = $this->readCssBuilderIni($themeBackINI); 230 236 $themeBackInfo['path'] = str_replace("{theme}", $config['themeBackend'], $themeBackInfo['path']); 231 237 … … 243 249 } 244 250 245 $_compact = $this->getC ompactHeader($browser[$index]['description']);251 $_compact = $this->getCssFileHeader($browser[$index]['description']); 246 252 $html = ''; 247 253 248 #-----------------------------------------------------------------------------------------------------------------249 #Build Core CSS250 #-----------------------------------------------------------------------------------------------------------------254 /** 255 * Build Core CSS 256 */ 251 257 if(true === $config['compileCore']) 252 258 { … … 268 274 } 269 275 270 #-----------------------------------------------------------------------------------------------------------------271 #Build Frontend Theme CSS272 #-----------------------------------------------------------------------------------------------------------------276 /** 277 * Build Frontend Theme CSS 278 */ 273 279 /** 274 280 * create Info + compiled frontend theme stylesheet … … 320 326 } 321 327 322 #----------------------------------------------------------------------------------------------------------------- 323 # Build Backend Theme CSS 324 #----------------------------------------------------------------------------------------------------------------- 328 /** 329 * Build Backend Theme CSS 330 */ 331 325 332 /** 326 333 * create Info + compiled backend theme stylesheet … … 376 383 377 384 /** 378 * -------------------------------------------------------------------------------------------------379 * read_core_definition380 * -------------------------------------------------------------------------------------------------381 */ 382 protected function read _properties($inifile)385 * Reads the ini file 386 * 387 * @return array ini array 388 */ 389 protected function readCssBuilderIni($inifile) 383 390 { 384 391 $iniArray = parse_ini_file($inifile); … … 388 395 $search = array(' ', "\t", "\r\n", "\r", CR); 389 396 $replace = array('', '', '', '', '', ''); 390 $iniArray['files'] = str_replace( $search, $replace, $iniArray['files']);397 $iniArray['files'] = str_replace( $search, $replace, $iniArray['files']); 391 398 392 399 if(mb_substr($iniArray['files'], strlen($iniArray['files']) - 1) == ',') … … 394 401 $iniArray['files'] = mb_substr($iniArray['files'], 0, strlen($iniArray['files']) - 1); 395 402 } 403 396 404 return $iniArray; 397 405 } 398 406 399 protected function getCompactHeader($browserInfo = '') 400 { 401 $compact = ''; 402 $compact = '/**' . CR; 403 $compact .= ' * This file has been auto-generated by the Clansuite CSS Framework.' . CR; 404 $compact .= ' * Its a compilation of several css files. Do not edit manually. Use CssBuilder!' . CR; 405 $compact .= ' * Last Update: ' . date('Y-m-d H:i:s', time()) . CR; 406 $compact .= ' * ---------------------------------------------------------------------------------------------------' . CR; 407 $compact .= ' * CSS2 Framework (CSFW)' . CR; 408 $compact .= ' * ---------------------------------------------------------------------------------------------------' . CR; 409 $compact .= ' * @author Paul Brand <info@isp-tenerife.net>' . CR; 410 $compact .= ' * @package CSFW' . CR; 411 $compact .= ' * @subpackage Core' . CR; 412 $compact .= ' * @version 1.0' . CR; 413 $compact .= ' * ---------------------------------------------------------------------------------------------------' . CR; 414 $compact .= ' * @description Created for - ' . $browserInfo . CR; 415 $compact .= ' * ---------------------------------------------------------------------------------------------------' . CR; 416 $compact .= ' */' . CR; 417 $compact .= CR; 418 $compact .= '@charset "UTF-8";'; 419 $compact .= CR; 420 $compact .= CR; 421 422 return $compact; 423 } 424 407 /** 408 * Returns the header text for the css file. 409 * 410 * @param string $browserInfo Name of the browser this css file is written for. 411 * @return string Header text for the css file. 412 */ 413 protected function getCssFileHeader($browserInfo = '') 414 { 415 $header = ''; 416 $header = '/**' . CR; 417 $header .= ' * ---------------------------------------------------------------------------------------------------' . CR; 418 $header .= ' * Clansuite CSS Framework' . CR; 419 $header .= ' * ---------------------------------------------------------------------------------------------------' . CR; 420 $header .= ' * This file has been auto-generated by the Clansuite CSS Framework.' . CR; 421 $header .= ' * Its a compilation of several css files. Do not edit manually. Use the CssBuilder!' . CR; 422 $header .= ' * Last Update: ' . date('Y-m-d H:i:s', time()) . CR; 423 $header .= ' * ---------------------------------------------------------------------------------------------------' . CR; 424 $header .= ' * @author Paul Brand <info@isp-tenerife.net>' . CR; 425 $header .= ' * @package CSFW' . CR; 426 $header .= ' * @subpackage Core' . CR; 427 $header .= ' * @version 1.0' . CR; 428 $header .= ' * ---------------------------------------------------------------------------------------------------' . CR; 429 $header .= ' * @description Created for - ' . $browserInfo . CR; 430 $header .= ' * ---------------------------------------------------------------------------------------------------' . CR; 431 $header .= ' * @generated' . CR; 432 $header .= ' */' . CR; 433 $header .= CR; 434 $header .= '@charset "UTF-8";'; 435 $header .= CR; 436 $header .= CR; 437 438 return $header; 439 } 440 441 /** 442 * Returns the header text for the core css file. 443 * 444 * @param array $coreInfo Array version information about this class. 445 * @return string Header text for the core css file. 446 */ 425 447 protected function getCoreCompactHeader($coreInfo = '') 426 448 { 427 $core_compact = ''; 428 $core_compact = '/**' . CR; 429 $core_compact .= ' * This file has been auto-generated by the Clansuite CSS Framework.' . CR; 430 $core_compact .= ' * Its a compilation of several css files. Do not edit manually. Use CssBuilder!' . CR; 431 $core_compact .= ' * Last Update: ' . date('Y-m-d H:i:s', time()) . CR; 432 $core_compact .= ' * ----------------------------------------------------------------------------------------------' . CR; 433 $core_compact .= ' * Framework: ' . $coreInfo['framework'] . CR; 434 $core_compact .= ' * Description: ' . $coreInfo['description'] . CR; 435 $core_compact .= ' * Author: ' . $coreInfo['author'] . CR; 436 $core_compact .= ' * Version: ' . $coreInfo['version'] . CR; 437 $core_compact .= ' * Version-Date: ' . $coreInfo['date'] . CR; 438 $core_compact .= ' * ----------------------------------------------------------------------------------------------' . CR; 439 $core_compact .= ' */' . CR; 440 441 return $core_compact; 442 } 443 449 $header = ''; 450 $header = '/**' . CR; 451 $header .= ' * This file has been auto-generated by the Clansuite CSS Framework.' . CR; 452 $header .= ' * Its a compilation of several css files. Do not edit manually. Use the CssBuilder!' . CR; 453 $header .= ' * Last Update: ' . date('Y-m-d H:i:s', time()) . CR; 454 $header .= ' * ----------------------------------------------------------------------------------------------' . CR; 455 $header .= ' * Framework: ' . $coreInfo['framework'] . CR; 456 $header .= ' * Description: ' . $coreInfo['description'] . CR; 457 $header .= ' * Author: ' . $coreInfo['author'] . CR; 458 $header .= ' * Version: ' . $coreInfo['version'] . CR; 459 $header .= ' * Version-Date: ' . $coreInfo['date'] . CR; 460 $header .= ' * ----------------------------------------------------------------------------------------------' . CR; 461 $header .= ' * @generated' . CR; 462 $header .= ' */' . CR; 463 464 return $header; 465 } 466 467 /** 468 * Returns the header text for the theme css file. 469 * 470 * @param array $themeInfo Array with version information about the theme. 471 * @return string Header text for the theme css file. 472 */ 444 473 protected function getThemeCompactHeader($themeInfo = '') 445 474 { 446 $theme_compact = ''; 447 $theme_compact = '/**' . CR; 448 $theme_compact .= ' * This file has been auto-generated by the Clansuite CSS Framework.' . CR; 449 $theme_compact .= ' * Its a compilation of several css files. Do not edit manually. Use CssBuilder!' . CR; 450 $theme_compact .= ' * Last Update: ' . date('Y-m-d H:i:s', time()) . CR; 451 $theme_compact .= ' * ---------------------------------------------------------------------------------------------' . CR; 452 $theme_compact .= ' * Framework: ' . $themeInfo['framework'] . CR; 453 $theme_compact .= ' * Description: ' . $themeInfo['description'] . CR; 454 $theme_compact .= ' * Author: ' . $themeInfo['author'] . CR; 455 $theme_compact .= ' * Version: ' . $themeInfo['version'] . CR; 456 $theme_compact .= ' * Version-Date: ' . $themeInfo['date'] . CR; 457 $theme_compact .= ' * ---------------------------------------------------------------------------------------------' . CR; 458 $theme_compact .= ' */' . CR; 459 460 return $theme_compact; 475 $header = ''; 476 $header = '/**' . CR; 477 $header .= ' * This file has been auto-generated by the Clansuite CSS Framework.' . CR; 478 $header .= ' * Its a compilation of several css files. Do not edit manually. Use CssBuilder!' . CR; 479 $header .= ' * Last Update: ' . date('Y-m-d H:i:s', time()) . CR; 480 $header .= ' * ---------------------------------------------------------------------------------------------' . CR; 481 $header .= ' * Framework: ' . $themeInfo['framework'] . CR; 482 $header .= ' * Description: ' . $themeInfo['description'] . CR; 483 $header .= ' * Author: ' . $themeInfo['author'] . CR; 484 $header .= ' * Version: ' . $themeInfo['version'] . CR; 485 $header .= ' * Version-Date: ' . $themeInfo['date'] . CR; 486 $header .= ' * ---------------------------------------------------------------------------------------------' . CR; 487 $header .= ' * @generated' . CR; 488 $header .= ' */' . CR; 489 490 return $header; 461 491 } 462 492 … … 565 595 '$1$2$3', $contents 566 596 ); 597 567 598 // End the file with a new line. 568 $contents = trim($contents); 569 $contents .= CR; 599 $contents = trim($contents) . CR; 570 600 } 571 601
Note: See TracChangeset
for help on using the changeset viewer.
