Changeset 9759
- Timestamp:
- 03/23/09 05:32:02 (3 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 16 edited
-
cache_public (added)
-
inc/classes/BxDolAdminTools.php (modified) (1 diff)
-
inc/classes/BxDolTemplate.php (modified) (33 diffs)
-
inc/params.inc.php (modified) (1 diff)
-
index.php (modified) (1 diff)
-
install/index.php (modified) (2 diffs)
-
modules/boonex/feedback/classes/BxFdbTemplate.php (modified) (4 diffs)
-
modules/boonex/news/classes/BxNewsTemplate.php (modified) (4 diffs)
-
modules/boonex/news/templates/base/view.html (modified) (1 diff)
-
modules/boonex/wall/classes/BxWallModule.php (modified) (2 diffs)
-
modules/boonex/wall/templates/base/css/post.css (modified) (1 diff)
-
profile.php (modified) (2 diffs)
-
templates/base/_header.html (modified) (2 diffs)
-
templates/base/css/common.css (modified) (1 diff)
-
templates/base/scripts/BxBaseCmtsView.php (modified) (1 diff)
-
templates/base/scripts/BxBaseSearchResultSharedMedia.php (modified) (1 diff)
-
templates/tmpl_uni/page_150.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/inc/classes/BxDolAdminTools.php
r9391 r9759 53 53 'backup', 54 54 'cache', 55 'cache_public', 55 56 'inc', 56 57 'langs', -
trunk/inc/classes/BxDolTemplate.php
r9757 r9759 32 32 33 33 class BxDolTemplate extends BxDolMistake { 34 var $_sCode; 35 var $_sPageWidth; 34 /** 35 * Main fields 36 */ 37 var $_sCode; 36 38 var $_sKeyWrapperHtml; 37 39 var $_aLocations; … … 41 43 var $_sFolderIcons; 42 44 var $_aTemplates; 45 46 /** 47 * Cache related fields 48 */ 43 49 var $_bCacheEnable; 44 var $_sCacheFolder; 50 var $_sCacheFolderUrl; 51 var $_sCacheFolderPath; 52 var $_sCachePublicFolderUrl; 53 var $_sCachePublicFolderPath; 45 54 var $_sCacheFilePrefix; 46 var $_sCacheTable; 47 55 var $_bCssCollect; 56 var $_bCssArchive; 57 var $_sCssCachePrefix; 58 48 59 /** 49 60 * Constructor … … 52 63 parent::BxDolMistake(); 53 64 54 $this->_sCode = isset($_COOKIE['skin']) ? $_COOKIE['skin'] : BX_DOL_TEMPLATE_DEFAULT_CODE; 55 $this->_sPageWidth = getParam('main_div_width'); 65 $this->_sCode = isset($_COOKIE['skin']) ? $_COOKIE['skin'] : BX_DOL_TEMPLATE_DEFAULT_CODE; 56 66 $this->_sKeyWrapperHtml = '__'; 57 67 $this->_sFolderHtml = ''; … … 59 69 $this->_sFolderImages = 'images/'; 60 70 $this->_sFolderIcons = 'images/icons/'; 61 71 $this->_aTemplates = array(); 72 62 73 $this->addLocation('system', BX_DIRECTORY_PATH_ROOT, BX_DOL_URL_ROOT); 63 74 64 $this->_aTemplates = array(); 75 $this->_bCacheEnable = true; 76 $this->_sCacheFolderUrl = BX_DOL_URL_CACHE; 77 $this->_sCacheFolderPath = BX_DIRECTORY_PATH_CACHE; 78 $this->_sCachePublicFolderUrl = BX_DOL_URL_CACHE_PUBLIC; 79 $this->_sCachePublicFolderPath = BX_DIRECTORY_PATH_CACHE_PUBLIC; 80 $this->_sCacheFilePrefix = "bx_templ_"; 65 81 66 $this->_bCacheEnable = false; 67 $this->_sCacheFolder = BX_DIRECTORY_PATH_CACHE; 68 $this->_sCacheFilePrefix = "bx_templ_"; 69 $this->_sCacheTable = "BxDolTemplateCache"; 82 $this->_bCssCache = true; 83 $this->_bCssArchive = $this->_bCssCollect && false; 84 $this->_sCssCachePrefix = $this->_sCacheFilePrefix . 'css_'; 70 85 } 71 86 /** … … 81 96 /** 82 97 * Initialize template engine. 83 * Note. The method is executed with the system, you shouldn't execute it in your subclass .98 * Note. The method is executed with the system, you shouldn't execute it in your subclasses. 84 99 */ 85 100 function init() { … … 112 127 113 128 $GLOBALS['BxDolTemplateInjections'] = $aInjections; 129 130 //--- Load page elements related static variables ---// 131 $GLOBALS['oSysTemplatePageWidth'] = getParam('main_div_width'); 132 $GLOBALS['oSysTemplatePageTitle'] = ''; 133 $GLOBALS['oSysTemplatePageKeywords'] = array(); 134 $GLOBALS['oSysTemplatePageDescription'] = ''; 135 $GLOBALS['oSysTemplatePageMainBoxTitle'] = ''; 114 136 } 115 137 /** … … 164 186 */ 165 187 function getPageWidth() { 166 return $ this->_sPageWidth;188 return $GLOBALS['oSysTemplatePageWidth']; 167 189 } 168 190 /** … … 172 194 */ 173 195 function setPageWidth($sWidth) { 174 $this->_sPageWidth = $sWidth; 175 } 196 $GLOBALS['oSysTemplatePageWidth'] = $sWidth; 197 } 198 function setPageTitle($sTitle) { 199 $GLOBALS['oSysTemplatePageTitle'] = $sTitle; 200 } 201 function setPageMainBoxTitle($sTitle) { 202 $GLOBALS['oSysTemplatePageMainBoxTitle'] = $sTitle; 203 } 204 function setPageDescription($sDescription) { 205 $GLOBALS['oSysTemplatePageDescription'] = $sDescription; 206 } 207 function addPageKeywords($mixedKeywords) { 208 if(is_string($mixedKeywords)) 209 $mixedKeywords = strpos($mixedKeywords, ',') !== false ? explode(',', $mixedKeywords) : array($mixedKeywords); 210 211 foreach($mixedKeywords as $iKey => $sValue) 212 $mixedKeywords[$iKey] = trim($sValue); 213 214 $GLOBALS['oSysTemplatePageKeywords'] = array_merge($GLOBALS['oSysTemplatePageKeywords'], $mixedKeywords); 215 } 176 216 /** 177 217 * Get template, which was loaded earlier. … … 190 230 * @return string full URL. 191 231 */ 192 function getIconUrl($sName ) {193 return $this->_getAbsoluteLocation('url', $this->_sFolderIcons, $sName );232 function getIconUrl($sName, $sCheckIn = BX_DOL_TEMPLATE_CHECK_IN_BOTH) { 233 return $this->_getAbsoluteLocation('url', $this->_sFolderIcons, $sName, $sCheckIn); 194 234 } 195 235 /** … … 199 239 * @return string absolute path. 200 240 */ 201 function getIconPath($sName ) {202 return $this->_getAbsoluteLocation('path', $this->_sFolderIcons, $sName );241 function getIconPath($sName, $sCheckIn = BX_DOL_TEMPLATE_CHECK_IN_BOTH) { 242 return $this->_getAbsoluteLocation('path', $this->_sFolderIcons, $sName, $sCheckIn); 203 243 } 204 244 /** … … 208 248 * @return string full URL. 209 249 */ 210 function getImageUrl($sName ) {211 return $this->_getAbsoluteLocation('url', $this->_sFolderImages, $sName );250 function getImageUrl($sName, $sCheckIn = BX_DOL_TEMPLATE_CHECK_IN_BOTH) { 251 return $this->_getAbsoluteLocation('url', $this->_sFolderImages, $sName, $sCheckIn); 212 252 } 213 253 /** … … 217 257 * @return string absolute path. 218 258 */ 219 function getImagePath($sName ) {220 return $this->_getAbsoluteLocation('path', $this->_sFolderImages, $sName );259 function getImagePath($sName, $sCheckIn = BX_DOL_TEMPLATE_CHECK_IN_BOTH) { 260 return $this->_getAbsoluteLocation('path', $this->_sFolderImages, $sName, $sCheckIn); 221 261 } 222 262 /** … … 226 266 * @return string full URL. 227 267 */ 228 function getCssUrl($sName) { 229 return $this->_getAbsoluteLocation('url', $this->_sFolderCss, $sName); 268 function getCssUrl($sName, $sCheckIn = BX_DOL_TEMPLATE_CHECK_IN_BOTH) { 269 return $this->_getAbsoluteLocation('url', $this->_sFolderCss, $sName, $sCheckIn); 270 } 271 /** 272 * Get full Path of CSS file. 273 * 274 * @param string $sName - CSS file name. 275 * @return string full URL. 276 */ 277 function getCssPath($sName, $sCheckIn = BX_DOL_TEMPLATE_CHECK_IN_BOTH) { 278 return $this->_getAbsoluteLocation('path', $this->_sFolderCss, $sName, $sCheckIn); 230 279 } 231 280 /** … … 314 363 * @return string value associated with the key. 315 364 */ 316 function parseSystemKey($sKey ) {365 function parseSystemKey($sKey, $mixedKeyWrapperHtml = null) { 317 366 global $site; 318 367 global $_page; 319 368 global $oFunctions; 320 global $oTemplConfig; 369 global $oTemplConfig; 370 371 $aKeyWrappers = $this->_getKeyWrappers($mixedKeyWrapperHtml); 321 372 322 373 $sRet = ''; 323 374 switch( $sKey ) { 324 case 'page_charset': 375 case 'include_css': 376 $this->addCss($_page['css_name']); 377 $sRet = $this->includeCss(); 378 break; 379 case 'page_charset': 325 380 $sRet = 'UTF-8'; 326 381 break; 382 case 'page_keywords': 383 if(!empty($GLOBALS['oSysTemplatePageKeywords']) && is_array($GLOBALS['oSysTemplatePageKeywords'])) 384 $sRet = '<meta name="keywords" content="' . process_line_output(implode(',', $GLOBALS['oSysTemplatePageKeywords'])) . '" />'; 385 break; 386 case 'page_description': 387 if(!empty($GLOBALS['oSysTemplatePageDescription']) && is_string($GLOBALS['oSysTemplatePageDescription'])) 388 $sRet = '<meta name="description" content="' . process_line_output($GLOBALS['oSysTemplatePageDescription']) . '" />'; 389 break; 390 case 'page_header': 391 if(!empty($GLOBALS['oSysTemplatePageTitle'])) 392 $sRet = process_line_output($GLOBALS['oSysTemplatePageTitle']); 393 break; 394 case 'page_header_text': 395 if(!empty($GLOBALS['oSysTemplatePageMainBoxTitle'])) 396 $sRet = process_line_output($GLOBALS['oSysTemplatePageMainBoxTitle']); 397 break; 398 case 'main_div_width': 399 if(!empty($GLOBALS['oSysTemplatePageWidth'])) 400 $sRet = process_line_output($GLOBALS['oSysTemplatePageWidth']); 401 break; 402 403 404 327 405 case 'site_url': 328 406 $sRet = BX_DOL_URL_ROOT; … … 334 412 $sRet = $site['images']; 335 413 break; 414 /* 336 415 case 'css_dir': 337 416 $sRet = $site['css_dir']; 338 417 break; 418 */ 339 419 case 'base_menu_dir': 340 420 $sRet = "templates/base/menu/"; … … 348 428 case 'zodiac': 349 429 $sRet = $site['zodiac']; 350 break; 351 case 'switch_lang_block': 352 $sRet = getLangSwitcher(); 353 break; 430 break; 354 431 case 'main_logo': 355 432 $sRet = getMainLogo(); … … 368 445 case 'thumb_height': 369 446 $sRet = getParam('max_thumb_height'); 370 break; 371 case 'main_div_width': 372 $sRet = $this->getPageWidth();373 break;447 break; 448 case 'switch_lang_block': 449 $sRet = getLangSwitcher(); 450 break; 374 451 case 'switch_skin_block': 375 452 $sRet = getParam("enable_template") ? templates_select_txt() : ''; … … 381 458 $sRet = getDolLangCode(); 382 459 break; 383 case 'meta_keywords':384 $sMetaKeyWord = process_line_output( getParam("MetaKeyWords") );385 if ($sMetaKeyWord != '' && strrchr($_SERVER['PHP_SELF'], '/') == '/index.php')386 $sRet = '<meta name="keywords" content="' . $sMetaKeyWord . '" />';387 break;388 case 'meta_description':389 $sMetaDescription = process_line_output( getParam("MetaDescription") );390 if ($sMetaDescription != '' && strrchr($_SERVER['PHP_SELF'], '/') == '/index.php')391 $sRet = '<meta name="description" content="'. $sMetaDescription . '" />';392 break;393 460 case 'top_menu': 394 461 $sRet = $GLOBALS['oTopMenu'] -> getCode(); … … 396 463 case 'extra_js': 397 464 $sRet = $_page['extra_js']; 398 break; 465 break; 466 /* 399 467 case 'extra_css': 400 468 $sRet = $_page['extra_css']; 401 469 break; 402 case 'page_header': 403 $sRet = $_page['header']; 404 break; 405 case 'page_header_text': 406 $sRet = $_page['header_text']; 407 break; 470 case 'styles': 471 $sRet = $this->processStyles($_page['css_name']); 472 break; 473 */ 474 408 475 case 'banner_top': 409 476 $sRet = banner_put_nv(1); … … 424 491 $sRet = _t( '_copyright', date('Y') ) . getVersionComment(); 425 492 break; 426 case 'styles':427 $sRet = $this->processStyles($_page['css_name']);428 break;429 493 case 'java_script': 430 494 if( strlen( $_page['js_name'] ) ) { … … 474 538 break; 475 539 default: 476 $sRet = ($sTemplAdd = $oFunctions->TemplPageAddComponent($sKey)) !== false ? $sTemplAdd : '__' . $sKey . '__';540 $sRet = ($sTemplAdd = $oFunctions->TemplPageAddComponent($sKey)) !== false ? $sTemplAdd : $aKeyWrappers['left'] . $sKey . $aKeyWrappers['right']; 477 541 } 478 542 … … 498 562 499 563 $sCacheVariableName = "a"; 500 $sCacheAbsolutePath = $this->_sCacheFolder . $this->_getCacheFileName($sAbsolutePath) . '.php';564 $sCacheAbsolutePath = $this->_sCacheFolderPath . $this->_getCacheFileName('html', $sAbsolutePath) . '.php'; 501 565 502 566 $mixedWriteResult = false; 503 567 $bExists = file_exists($sCacheAbsolutePath); 504 if(!$bExists && ($rHandler = fopen($sCacheAbsolutePath, 'w')) && ($sContent = file_get_contents($sAbsolutePath))) { 505 $mixedWriteResult = fwrite($rHandler, $this->_compileContent($sContent, "\$" . $sCacheVariableName, 1, $aVariables, $mixedKeyWrapperHtml)); 506 fclose($rHandler); 507 } 568 if(!$bExists && ($sContent = file_get_contents($sAbsolutePath)) !== false && ($sContent = $this->_compileContent($sContent, "\$" . $sCacheVariableName, 1, $aVariables, $mixedKeyWrapperHtml)) !== false) 569 if(($rHandler = fopen($sCacheAbsolutePath, 'w')) !== false) { 570 $mixedWriteResult = fwrite($rHandler, $sContent); 571 fclose($rHandler); 572 } 508 573 509 574 if($bExists || (!$bExists && $mixedWriteResult !== false)) { … … 519 584 520 585 return false; 521 } 522 523 /** 524 * Conver incomming CSS file/s into HTML representation. 525 * 526 * @param mixed $mixedFiles - single file name or array of file names. 527 * @return string the result of operation. 528 */ 529 function processStyles($mixedFiles) { 530 if(empty($mixedFiles)) return ''; 531 532 if(is_array($mixedFiles)) { 533 $sReturn = ''; 534 foreach ($mixedFiles as $sFile) 535 $sReturn .= $this->_wrapInCssTag($sFile); 536 } 537 else if(is_string($mixedFiles)) 538 $sReturn = $this->_wrapInCssTag($mixedFiles); 539 540 return $sReturn; 541 } 542 /** 543 * Include CSS file(s) in head section of current page. 544 * 545 * @param mixed $mixedFiles - single file name or array of file names. 546 */ 547 function includeStyles($mixedFiles) { 548 $sCss = $this->processStyles($mixedFiles); 549 550 BxDolTemplate::addInjection('styles', 'text', $sCss, 0); 586 } 587 function addCss($mixedFiles){ 588 return $this->_processCss('add', $mixedFiles); 589 } 590 function deleteCss($mixedFiles){ 591 return $this->_processCss('delete', $mixedFiles); 592 } 593 /** 594 * Include CSS file(s) attached to the page in its head section. 595 * @see the method is system and would be called automatically. 596 * 597 * @return string the result CSS code. 598 */ 599 function includeCss() { 600 $aFiles = isset($GLOBALS['BxDolTemplateCss']) ? $GLOBALS['BxDolTemplateCss'] : array(); 601 if(empty($aFiles) || !is_array($aFiles)) 602 return ""; 603 604 if(!$this->_bCssCache) 605 return $this->_includeCss($aFiles); 606 607 //--- If cache already exists, return it ---// 608 ksort($aFiles); 609 610 $sName = ""; 611 foreach($aFiles as $aFile) 612 $sName .= $aFile['url']; 613 $sName = $this->_getCacheFileName('css', $sName); 614 615 $sCacheAbsoluteUrl = $this->_sCachePublicFolderUrl . $sName . '.css'; 616 $sCacheAbsolutePath = $this->_sCachePublicFolderPath . $sName . '.css'; 617 if(file_exists($sCacheAbsolutePath)) 618 return $this->_wrapInCssTag($sCacheAbsoluteUrl); 619 620 //--- Collect all attached CSS in one file ---// 621 $sResult = ""; 622 foreach($aFiles as $aFile) { 623 $aIncluded = array(); 624 $aFileInfo = pathinfo($aFile['path']); 625 if(($sContent = $this->_compileCss($aFileInfo['dirname'] . '/', $aFileInfo['basename'], $aIncluded)) !== false) 626 $sResult .= $sContent; 627 } 628 629 $mixedWriteResult = false; 630 if(!empty($sResult) && ($rHandler = fopen($sCacheAbsolutePath, 'w')) !== false) { 631 $mixedWriteResult = fwrite($rHandler, $sResult); 632 fclose($rHandler); 633 } 634 635 if($mixedWriteResult === false) 636 return $this->_includeCss($aFiles); 637 638 //--- Archive the file if it's needed ---// 639 if($this->_bCssArchive) { 640 //TODO: process archiving. 641 } 642 643 return $this->_wrapInCssTag($sCacheAbsoluteUrl); 644 } 645 /** 646 * Compile CSS files' structure(@see @import css_file_path) in one file. 647 * 648 * @param unknown_type $aFile 649 * @return unknown 650 */ 651 function _compileCss($sPath, $sName, &$aIncluded) { 652 if(isset($aIncluded[$sPath . '_' . $sName])) 653 return ''; 654 655 $sContent = file_get_contents($sPath . $sName); 656 if(empty($sContent)) 657 return ''; 658 659 $aIncluded[$sPath . '_' . $sName] = 1; 660 661 $aSearch = array( 662 "'@import\s+url\s*\(\s*([a-zA-Z0-9\.\/_-]+)\s*\)\s*;'e", 663 "'background-image\s*:\s*url\s*\(\s*([a-zA-Z0-9\.\/_-]+)\s*\)\s*;'e", 664 ); 665 $aReplace = array( 666 "\$this->_compileCss(realpath(\$sPath . dirname('\\1')) . '/', basename('\\1'), \$aIncluded)", 667 "'background-image:url(' . str_replace(BX_DIRECTORY_PATH_ROOT, BX_DOL_URL_ROOT, realpath(\$sPath . dirname('\\1')) . '/' . basename('\\1')) . ');'" 668 ); 669 $sContent = preg_replace($aSearch, $aReplace, $sContent); 670 return $sContent; 671 } 672 /** 673 * Include CSS files without caching. 674 * 675 * @param unknown_type $aFiles 676 * @return unknown 677 */ 678 function _includeCss(&$aFiles) { 679 $sResult = ""; 680 foreach($aFiles as $aFile) 681 $sResult .= $this->_wrapInCssTag($aFile['url']); 682 683 return $sResult; 684 } 685 /** 686 * Insert/Delete CSS file from output stack. 687 * 688 * @param unknown_type $sAction 689 * @param unknown_type $mixedFiles 690 * @return unknown 691 */ 692 function _processCss($sAction, $mixedFiles) { 693 if(empty($mixedFiles)) 694 return false; 695 696 if(is_string($mixedFiles)) 697 $mixedFiles = array($mixedFiles); 698 699 foreach($mixedFiles as $sFile) { 700 $sUrl = $this->getCssUrl($sFile); 701 $sPath = $this->getCssPath($sFile); 702 703 if($sAction == 'add') 704 $GLOBALS['BxDolTemplateCss'][] = array('url' => $sUrl, 'path' => $sPath); 705 else if($sAction == 'delete') 706 foreach($GLOBALS['BxDolTemplateCss'] as $iKey => $aValue) 707 if($aValue['url'] == $sUrl) { 708 unset($GLOBALS['BxDolTemplateCss'][$iKey]); 709 break; 710 } 711 } 712 713 return true; 551 714 } 552 715 … … 605 768 "'<bx_include_base:([^\s]+) \/>'se", 606 769 "'<bx_image_url:([^\s]+) \/>'se", 607 "'<bx_icon_url:([^\s]+) \/>'se" 770 "'<bx_icon_url:([^\s]+) \/>'se", 771 "'<bx_text:([^\s]+) \/>'se" 608 772 )); 609 773 $aValues = array_merge($aValues, array( … … 611 775 "\$this->parseHtmlByName('\\1', \$aVariables, \$mixedKeyWrapperHtml, BX_DOL_TEMPLATE_CHECK_IN_BASE)", 612 776 "\$this->getImageUrl('\\1')", 613 "\$this->getIconUrl('\\1')" 777 "\$this->getIconUrl('\\1')", 778 "_t('\\1')" 614 779 )); 615 780 … … 617 782 $sContent = preg_replace($aKeys, $aValues, $sContent); 618 783 //--- Parse System Keys ---// 619 $sContent = preg_replace( "'" . $aKeyWrappers['left'] . "([a-zA-Z0-9_-]+)" . $aKeyWrappers['right'] . "'e", "\$this->parseSystemKey('\\1' )", $sContent);784 $sContent = preg_replace( "'" . $aKeyWrappers['left'] . "([a-zA-Z0-9_-]+)" . $aKeyWrappers['right'] . "'e", "\$this->parseSystemKey('\\1', \$mixedKeyWrapperHtml)", $sContent); 620 785 621 786 return $sContent; … … 647 812 $sValue = ''; 648 813 if(isset($aMatches[1]) && !empty($aMatches[1])) { 649 if(is_array($aValues[$i])) { 650 $sIndex = "\$" . str_repeat("i", $iVarDepth); 651 $sValue .= "<? for(" . $sIndex . "=0; " . $sIndex . "<count(" . $aVarName . "['" . $aKeys[$i] . "']); " . $sIndex . "++){ ?>"; 652 $sValue .= $this->_compileContent($aMatches[1], $aVarName . "['" . $aKeys[$i] . "'][" . $sIndex . "]", ++$iVarDepth, current($aValues[$i]), $mixedKeyWrapperHtml); 653 $sValue .= "<?}?>"; 654 } 655 else if(is_string($aValues[$i])) 656 $sValue .= $aValues[$i]; 814 if(empty($aValues[$i]) || !is_array($aValues[$i])) 815 return false; 816 817 $sIndex = "\$" . str_repeat("i", $iVarDepth); 818 $sValue .= "<? if(is_array(" . $aVarName . "['" . $aKeys[$i] . "'])) for(" . $sIndex . "=0; " . $sIndex . "<count(" . $aVarName . "['" . $aKeys[$i] . "']); " . $sIndex . "++){ ?>"; 819 if(($sInnerValue = $this->_compileContent($aMatches[1], $aVarName . "['" . $aKeys[$i] . "'][" . $sIndex . "]", ++$iVarDepth, current($aValues[$i]), $mixedKeyWrapperHtml)) === false) 820 return false; 821 $sValue .= $sInnerValue; 822 $sValue .= "<?} else if(is_string(" . $aVarName . "['" . $aKeys[$i] . "'])) echo " . $aVarName . "['" . $aKeys[$i] . "']; ?>"; 657 823 } 658 824 } … … 665 831 $sValue = ''; 666 832 if(isset($aMatches[1]) && !empty($aMatches[1]) && is_array($aValues[$i]) && isset($aValues[$i]['condition']) && isset($aValues[$i]['content'])) { 833 if(empty($aValues[$i]['content']) || !is_array($aValues[$i]['content'])) 834 return false; 835 667 836 $sValue .= "<? if(" . $aVarName . "['" . $aKeys[$i] . "']['condition']){ ?>"; 668 $sValue .= $this->_compileContent($aMatches[1], $aVarName . "['" . $aKeys[$i] . "']['content']", $iVarDepth, $aValues[$i]['content'], $mixedKeyWrapperHtml); 837 if(($sInnerValue = $this->_compileContent($aMatches[1], $aVarName . "['" . $aKeys[$i] . "']['content']", $iVarDepth, $aValues[$i]['content'], $mixedKeyWrapperHtml)) === false) 838 return false; 839 $sValue .= $sInnerValue; 669 840 $sValue .= "<?}?>"; 670 841 } … … 683 854 "'<bx_include_tmpl:([^\s]+) \/>'se", 684 855 "'<bx_image_url:([^\s]+) \/>'se", 685 "'<bx_icon_url:([^\s]+) \/>'se" 856 "'<bx_icon_url:([^\s]+) \/>'se", 857 "'<bx_text:([^\s]+) \/>'se" 686 858 )); 687 859 $aValues = array_merge($aValues, array( … … 689 861 "\$this->getCached('\\1', \$aVarValues, BX_DOL_TEMPLATE_CHECK_IN_TMPL, false)", 690 862 "\$this->getImageUrl('\\1')", 691 "\$this->getIconUrl('\\1')" 863 "\$this->getIconUrl('\\1')", 864 "_t('\\1')" 692 865 )); 693 866 … … 695 868 $sContent = preg_replace($aKeys, $aValues, $sContent); 696 869 //--- Parse System Keys ---// 697 $sContent = preg_replace( "'" . $aKeyWrappers['left'] . "([a-zA-Z0-9_-]+)" . $aKeyWrappers['right'] . "'", "<?=\$this->parseSystemKey('\\1' );?>", $sContent);870 $sContent = preg_replace( "'" . $aKeyWrappers['left'] . "([a-zA-Z0-9_-]+)" . $aKeyWrappers['right'] . "'", "<?=\$this->parseSystemKey('\\1', \$mixedKeyWrapperHtml);?>", $sContent); 698 871 699 872 return $sContent; … … 753 926 */ 754 927 function _wrapInCssTag($sFile) { 755 return '<link href="' . $ this->getCssUrl($sFile). '" rel="stylesheet" type="text/css" />';928 return '<link href="' . $sFile . '" rel="stylesheet" type="text/css" />'; 756 929 } 757 930 /** … … 771 944 * @return string the result of operation. 772 945 */ 773 function _getCacheFileName($sAbsolutePath) { 774 return $this->_sCacheFilePrefix . str_replace(array(BX_DIRECTORY_PATH_ROOT, '/'), array('', '_'), $sAbsolutePath); 946 function _getCacheFileName($sType, $sAbsolutePath) { 947 $sResult = ""; 948 switch($sType) { 949 case 'html': 950 $sResult = $this->_sCacheFilePrefix . str_replace(array(BX_DIRECTORY_PATH_ROOT, '/'), array('', '_'), $sAbsolutePath); 951 break; 952 case 'css': 953 $sResult = $this->_sCssCachePrefix . md5($sAbsolutePath); 954 break; 955 case 'js': 956 $sResult = ""; 957 break; 958 } 959 960 return $sResult; 775 961 } 776 962 -
trunk/inc/params.inc.php
r9395 r9759 26 26 $oSysTemplate = new BxDolTemplate(); 27 27 $oSysTemplate->init(); 28 $oSysTemplate->addCss(array('general.css', 'anchor.css')); 28 29 29 30 /** -
trunk/index.php
r9105 r9759 61 61 62 62 $_page['name_index'] = 1; 63 $_page['header'] = $site['title']; 64 $_page['header_text'] = $site['title']; 65 $_page['css_name'] = 'index.css'; 63 64 $oSysTemplate->setPageTitle($site['title']); 65 $oSysTemplate->setPageDescription(getParam("MetaDescription")); 66 $oSysTemplate->setPageMainBoxTitle($site['title']); 67 $oSysTemplate->addPageKeywords(getParam("MetaKeyWords")); 68 $oSysTemplate->addCss('index.css'); 66 69 67 70 $oIPV = new BxTemplIndexPageView(); -
trunk/install/index.php
r9593 r9759 121 121 define('BX_DOL_URL_PROFILE_BACKGROUNDS', \$site['profileBackground']); 122 122 define('BX_DOL_URL_MODULES', \$site['url'] . 'modules/' ); 123 define('BX_DOL_URL_CACHE_PUBLIC', \$site['url'] . 'cache_public/'); 123 124 124 125 define('BX_DIRECTORY_PATH_INC', \$dir['inc']); … … 130 131 define('BX_DIRECTORY_PATH_DBCACHE', \$dir['cache']); 131 132 define('BX_DIRECTORY_PATH_MODULES', \$dir['root'] . 'modules/' ); 133 define('BX_DIRECTORY_PATH_CACHE_PUBLIC', \$dir['root'] . 'cache_public/' ); 132 134 133 135 define('DATABASE_HOST', \$db['host']); -
trunk/modules/boonex/feedback/classes/BxFdbTemplate.php
r9506 r9759 59 59 ); 60 60 $aResult = array( 61 'include_css' => $this->_processCss('add', array('view.css', 'cmts.css')), 61 62 'filter' => $oSearchResult->showAdminFilterPanel($aParams['filter_value'], 'feedback-filter-txt', 'feedback-filter-chb', 'feedback-filter'), 62 63 'content' => $this->displayList($aParams), … … 64 65 ); 65 66 $aResult = array_merge($aResult, $this->_getViewJs()); 66 $aResult = array_merge($aResult, $this->_getViewCss());67 67 68 68 return $this->parseHtmlByName('admin.html', $aResult); … … 73 73 ); 74 74 $aResult = array_merge($aResult, $this->_getViewJs()); 75 $aResult = array_merge($aResult, $this->_getViewCss()); 76 75 76 $this->addCss(array('view.css', 'cmts.css')); 77 77 return $this->parseHtmlByName('view.html', $aResult); 78 78 } … … 177 177 ); 178 178 } 179 /**180 * Prepare CSS paramaters.181 */182 function _getViewCss() {183 return array(184 'include_css' => $this->processStyles(array('view.css', 'cmts.css', 'forms_adv.css'))185 );186 }187 179 } 188 180 ?> -
trunk/modules/boonex/news/classes/BxNewsTemplate.php
r9408 r9759 63 63 ); 64 64 $aResult = array( 65 'include_css' => $this->_processCss('add', array('view.css', 'cmts.css')), 65 66 'filter' => $oSearchResult->showAdminFilterPanel($aParams['filter_value'], 'news-filter-txt', 'news-filter-chb', 'news-filter'), 66 67 'content' => $this->displayList($aParams), … … 68 69 ); 69 70 $aResult = array_merge($aResult, $this->_getViewJs()); 70 $aResult = array_merge($aResult, $this->_getViewCss());71 71 72 72 return $this->parseHtmlByName('admin.html', $aResult); … … 77 77 ); 78 78 $aResult = array_merge($aResult, $this->_getViewJs()); 79 $aResult = array_merge($aResult, $this->_getViewCss());80 79 80 $this->addCss(array('view.css', 'cmts.css')); 81 81 return $this->parseHtmlByName('view.html', $aResult); 82 82 } … … 177 177 ); 178 178 } 179 /**180 * Prepare CSS paramaters.181 */182 function _getViewCss() {183 return array(184 'include_css' => $this->processStyles(array('view.css', 'cmts.css'))185 );186 }187 179 } 188 180 ?> -
trunk/modules/boonex/news/templates/base/view.html
r9408 r9759 1 __include_css__2 1 <div class="news-view"> 3 2 <script language="javascript" type="text/javascript" src="__include_js_url__"></script> -
trunk/modules/boonex/wall/classes/BxWallModule.php
r9682 r9759 298 298 ); 299 299 300 $this->_oTemplate-> includeStyles('post.css');300 $this->_oTemplate->addCss('post.css'); 301 301 $sRes = array($this->_oTemplate->parseHtmlByName('post.html', $aVariables), $aTopMenu, array(), true, 'getBlockCaptionMenu'); 302 302 return $sRes; … … 346 346 ); 347 347 348 $this->_oTemplate-> includeStyles('view.css');348 $this->_oTemplate->addCss('view.css'); 349 349 return array($this->_oTemplate->parseHtmlByName('view.html', $aVariables), $aTopMenu, array(), true, 'getBlockCaptionMenu'); 350 350 } -
trunk/modules/boonex/wall/templates/base/css/post.css
r9635 r9759 1 div.wall-post { 1 div.wall-post { 2 2 position: relative; 3 3 } -
trunk/profile.php
r9642 r9759 66 66 $oProfile = new BxBaseProfileGenerator( $profileID ); 67 67 68 $oProfile->oCmtsView->getExtraCss(); 69 68 70 $_page['extra_js'] = 69 71 $oTemplConfig -> sTinyMceEditorMiniJS . … … 72 74 '<script type="text/javascript">urlIconLoading = "'.getTemplateIcon('loading.gif').'";</script>'; 73 75 74 $_page['extra_css'] = $oProfile -> genProfileCSS( $profileID ) . $oProfile->oCmtsView->getExtraCss();76 $_page['extra_css'] = $oProfile -> genProfileCSS( $profileID ); 75 77 $p_arr = $oProfile -> _aProfile; 76 78 -
trunk/templates/base/_header.html
r9757 r9759 5 5 <base href="__site_url__" /> 6 6 <meta http-equiv="Content-Type" content="text/html; charset=__page_charset__" /> 7 8 __meta_description__ 9 __meta_keywords__ 10 7 __page_description__ 8 __page_keywords__ 11 9 <meta http-equiv="Content-Style-Type" content="text/css" /> 12 10 <style> … … 15 13 } 16 14 </style> 17 18 <link href="__css_dir__general.css" rel="stylesheet" type="text/css" /> 19 <link href="__css_dir__anchor.css" rel="stylesheet" type="text/css" /> 15 __include_css__ 20 16 21 17 __menu_css__ 18 <!-- 22 19 __styles__ 23 20 __extra_css__ 24 21 --> 25 22 __java_script__ 26 23 __dol_images__ -
trunk/templates/base/css/common.css
r9744 r9759 255 255 height: 28px; 256 256 line-height: 28px; 257 /*position:relative;*/257 position:relative; 258 258 font-weight: normal; 259 259 } -
trunk/templates/base/scripts/BxBaseCmtsView.php
r9241 r9759 183 183 function getExtraCss () 184 184 { 185 global $site; 186 global $tmpl; 187 return '<link href="'.$site['url'].'templates/tmpl_'.$tmpl.'/css/cmts.css" rel="stylesheet" type="text/css" />'; 185 $GLOBALS['oSysTemplate']->addCss('cmts.css'); 188 186 } 189 187 -
trunk/templates/base/scripts/BxBaseSearchResultSharedMedia.php
r9714 r9759 368 368 $sModulePart = $this->getModuleFolder() . '/'; 369 369 $oSysTemplate->addLocation($this->aCurrent['name'], BX_DIRECTORY_PATH_MODULES . $sModulePart, BX_DOL_URL_MODULES . $sModulePart); 370 return $sCode = $oSysTemplate->processStyles(array('search.css')); 370 $oSysTemplate->addCss(array('search.css')); 371 return ''; 371 372 } 372 373 } -
trunk/templates/tmpl_uni/page_150.html
r9015 r9759 4 4 <title>__page_header__</title> 5 5 <meta http-equiv="Content-Type" content="text/html; charset=__page_charset__" /> 6 <meta http-equiv="refresh" content="1;URL=__url_relocate__" /> 7 6 <meta http-equiv="refresh" content="1;URL=__url_relocate__" /> 8 7 <meta http-equiv="Content-Style-Type" content="text/css" /> 9 <link href="__css_dir__general.css" rel="stylesheet" type="text/css" /> 10 <link href="__css_dir__anchor.css" rel="stylesheet" type="text/css" /> 11 __styles__ 8 __include_css__ 12 9 <script src="inc/js/functions.js" type="text/javascript" language="javascript"></script> 13 10 <script src="plugins/jquery/jquery.js" type="text/javascript" language="javascript"></script>
Note: See TracChangeset
for help on using the changeset viewer.