HomeHelpTrac

Changeset 15334


Ignore:
Timestamp:
07/12/11 01:20:32 (11 months ago)
Author:
Anton Lesnikov
Message:

Get rid of $GLOBALSoSysTemplate?

Location:
trunk
Files:
27 edited

Legend:

Unmodified
Added
Removed
  • trunk/categories.php

    r15260 r15334  
    3232require_once( BX_DIRECTORY_PATH_INC . 'design.inc.php' ); 
    3333 
     34bx_import('BxDolTemplate'); 
    3435bx_import('BxTemplCategories'); 
    3536bx_import('BxDolPageView'); 
     
    9293            'month_current' => $this->getTitle(), 
    9394        ); 
    94         $sHtml = $GLOBALS['oSysTemplate']->parseHtmlByName('calendar.html', $aVars); 
     95 
     96        $oSysTemplate = BxDolTemplate::getInstance(); 
     97 
     98        $sHtml = $oSysTemplate->parseHtmlByName('calendar.html', $aVars); 
    9599        $sHtml = preg_replace ('#<bx_repeat:events>.*?</bx_repeat:events>#s', '', $sHtml); 
    96         $GLOBALS['oSysTemplate']->addCss('calendar.css'); 
     100        $oSysTemplate->addCss('calendar.css'); 
    97101        return $sHtml; 
    98102    } 
     
    273277    } 
    274278 
    275     function getBlockCode_Form() 
    276     { 
    277         return $GLOBALS['oSysTemplate']->parseHtmlByName('search_tags_box.html', array('form' => $this->oForm->getCode())); 
     279    function getBlockCode_Form() { 
     280        return BxDolTemplate::getInstance()->parseHtmlByName('search_tags_box.html', array('form' => $this->oForm->getCode())); 
    278281    } 
    279282 
     
    363366 
    364367if (!$bAjaxMode) { 
    365     bx_import('BxDolTemplate'); 
    366368    $oTemplate = BxDolTemplate::getInstance(); 
    367369    $oTemplate->setPageNameIndex(25); 
     
    379381else 
    380382    echo $sContent; 
    381  
    382 ?> 
  • trunk/change_status.php

    r15260 r15334  
    165165            break; 
    166166    } 
    167     return $GLOBALS['oSysTemplate']->parseHtmlByName('change_status.html', $aData); 
     167    bx_import('BxDolTemplate'); 
     168    return BxDolTemplate::getInstance()->parseHtmlByName('change_status.html', $aData); 
    168169} 
    169170 
  • trunk/inc/classes/BxDolFilesUploader.php

    r15211 r15334  
    5555        $this->sSendFileInfoFormCaption = ''; 
    5656 
    57         $GLOBALS['oSysTemplate']->addJsTranslation(array( 
     57        $this->addJsTranslation(array( 
    5858            '_bx_' . $this->sUploadTypeLC . 's_val_title_err', 
    5959            '_bx_' . $this->sUploadTypeLC . 's_val_descr_err' 
  • trunk/inc/classes/BxDolFriendsPageView.php

    r15287 r15334  
    2323***************************************************************************/ 
    2424 
    25 bx_import( 'BxDolPageView' ); 
     25bx_import('BxDolTemplate'); 
     26bx_import('BxDolPageView'); 
    2627 
    2728class BxDolFriendsPageView extends BxDolPageView 
     
    247248 
    248249        // build template ; 
    249         $sOutputHtml = $GLOBALS['oSysTemplate'] -> parseHtmlByName( $aUsedTemplates[0], $aTemplateKeys ); 
     250        $sOutputHtml = BxDolTemplate::getInstance()->parseHtmlByName( $aUsedTemplates[0], $aTemplateKeys ); 
    250251 
    251252        // build the toggle block ; 
     
    288289                [message]   - (string) text message ( if will have a new messages ); 
    289290     */ 
    290     function get_member_menu_bubble_online_friends($iMemberId, $iOldCount = 0) 
    291     { 
    292         global $oSysTemplate, $oFunctions, $site; 
     291    function get_member_menu_bubble_online_friends($iMemberId, $iOldCount = 0) { 
     292        global $oFunctions, $site; 
     293 
     294        $oSysTemplate = BxDolTemplate::getInstance(); 
    293295 
    294296        $iMemberId           = (int) $iMemberId; 
     
    353355        global $oFunctions; 
    354356 
     357        $oSysTemplate = BxDolTemplate::getInstance(); 
     358 
    355359        $iMemberId      = (int) $iMemberId; 
    356360        $iOnlineTime = getParam('member_online_time'); 
     
    378382        $oModuleDb   = BxDolModuleQuery::getInstance(); 
    379383 
    380         $sVideoMessengerImgPath  = $GLOBALS['oSysTemplate'] -> getIconUrl('video.png'); 
     384        $sVideoMessengerImgPath  = $oSysTemplate -> getIconUrl('video.png'); 
    381385        $sMessengerTitle = _t('_Chat'); 
    382386 
     
    434438        ); 
    435439 
    436         $sOutputCode = $GLOBALS['oSysTemplate'] -> parseHtmlByName( 'view_friends_member_menu_friends_list.html', $aTemplateKeys ); 
    437         return $sOutputCode; 
     440        return $oSysTemplate -> parseHtmlByName( 'view_friends_member_menu_friends_list.html', $aTemplateKeys ); 
    438441    } 
    439442} 
  • trunk/inc/classes/BxDolMemberMenu.php

    r15287 r15334  
    106106     * no alerts 
    107107     */ 
     108 
     109    bx_import('BxDolTemplate'); 
     110 
    108111    class BxDolMemberMenu 
    109112    { 
     
    152155                ['item_img_height'] - (integer) module's icon's height; 
    153156         */ 
    154         function getGetExtraMenuLink(&$aLinkInfo) 
    155         { 
    156             global $oSysTemplate; 
     157        function getGetExtraMenuLink(&$aLinkInfo) { 
     158            $oSysTemplate = BxDolTemplate::getInstance(); 
    157159 
    158160            $aTemplateKeys = array( 
     
    184186         * @return : Html presentation data; 
    185187         */ 
    186         function getDescriptionWindow($sDescription) 
    187         { 
    188             global $oSysTemplate; 
     188        function getDescriptionWindow($sDescription) { 
     189            $oSysTemplate = BxDolTemplate::getInstance(); 
    189190 
    190191            $aTemplateKeys = array( 
     
    221222         * @return text 
    222223         */ 
    223         function _parseStructure($aMemberInfo, $aMenuStructure) 
    224         { 
    225             global $oSysTemplate, $oFunctions; 
     224        function _parseStructure($aMemberInfo, $aMenuStructure) { 
     225            global $oFunctions; 
    226226 
    227227            if(!$aMenuStructure) { 
     
    229229            } 
    230230 
    231                $oCache = $this -> getCacheObject(); 
     231            $oSysTemplate = BxDolTemplate::getInstance(); 
     232 
     233            $oCache = $this -> getCacheObject(); 
    232234 
    233235            $oPermalinks   = new BxDolPermalinks(); 
     
    530532         * @return string 
    531533         */ 
    532         function getCacheKey($iProfileId) 
    533         { 
     534        function getCacheKey($iProfileId) { 
    534535            global $site; 
    535536 
     537            $oSysTemplate = BxDolTemplate::getInstance(); 
    536538            return $this -> sMenuMemberKeysCache . $iProfileId . '_' . md5($site['ver'] 
    537539                . $site['build'] . $site['url'] . getCurrentLangName(false) 
    538                 . $GLOBALS['oSysTemplate']->getCode()) . '.php'; 
     540                . $oSysTemplate->getCode()) . '.php'; 
    539541        } 
    540542 
  • trunk/inc/classes/BxDolPageViewCacher.php

    r15211 r15334  
    137137    function genBlocksCacheKey ($sId) { 
    138138        global $site; 
    139         return 'pb_' . $sId . '_' . md5($site['ver'] . $site['build'] . $site['url'] . getCurrentLangName(false) . $GLOBALS['oSysTemplate']->getCode()) . '.php'; 
     139 
     140        bx_import('BxDolTemplate'); 
     141        return 'pb_' . $sId . '_' . md5($site['ver'] . $site['build'] . $site['url'] . getCurrentLangName(false) . BxDolTemplate::getInstance()->getCode()) . '.php'; 
    140142    } 
    141143} 
  • trunk/inc/classes/BxDolPrivacySearch.php

    r15211 r15334  
    2323***************************************************************************/ 
    2424 
     25bx_import('BxDolTemplate'); 
    2526bx_import('BxTemplSearchResultText'); 
    2627 
     
    4849        parent::BxTemplSearchResultText(); 
    4950 
    50         global $oSysTemplate; 
    51  
    5251        $this->aCurrent['restriction']['owner']['value'] = $iOwnerId; 
    5352        $this->aCurrent['restriction']['keyword']['value'] = process_db_input($sValue, BX_TAGS_STRIP); 
    5453 
    55         $this->_sSearchUnitTmpl = $oSysTemplate->getHtml('ps_search_unit.html'); 
     54        $this->_sSearchUnitTmpl = BxDolTemplate::getInstance()->getHtml('ps_search_unit.html'); 
    5655    } 
    5756 
    5857    function displaySearchUnit($aData) { 
    59         global $oSysTemplate; 
    60  
    61         return $oSysTemplate->parseHtmlByContent($this->_sSearchUnitTmpl, array( 
     58        return BxDolTemplate::getInstance()->parseHtmlByContent($this->_sSearchUnitTmpl, array( 
    6259            'action' => 'add', 
    6360            'member_id' => $aData['id'], 
  • trunk/inc/classes/BxDolSubscription.php

    r15211 r15334  
    99// TODO: now subscriptions are too complicated, try to simplify it 
    1010 
     11bx_import('BxDolTemplate'); 
    1112bx_import('BxDolSubscriptionQuery'); 
    1213 
     
    125126        $sContent = $oForm->getCode(); 
    126127 
    127         $GLOBALS['oSysTemplate']->addJsTranslation('_sbs_wrn_unsubscribe'); 
     128        BxDolTemplate::getInstance()->addJsTranslation('_sbs_wrn_unsubscribe'); 
     129 
    128130        ob_start(); 
    129131        ?> 
     
    245247        $sContent .= PopupBox($this->_sVisitorPopup, _t('_sys_bcpt_subscribe'), $oForm->getCode(), array(), true); 
    246248 
    247         $GLOBALS['oSysTemplate']->addCss('subscription.css'); 
    248         $GLOBALS['oSysTemplate']->addJs('BxDolSubscription.js'); 
     249        $oSysTemplate = BxDolTemplate::getInstance(); 
     250        $oSysTemplate->addCss('subscription.css'); 
     251        $oSysTemplate->addJs('BxDolSubscription.js'); 
    249252        return $sContent; 
    250253    } 
  • trunk/inc/classes/BxDolTextPageMain.php

    r15211 r15334  
    3737    } 
    3838    function getBlockCode_Latest() { 
     39        bx_import('BxDolTemplate'); 
     40 
    3941        $sUri = $this->_oObject->_oConfig->getUri(); 
    4042        $sBaseUri = $this->_oObject->_oConfig->getBaseUri(); 
    4143        $aTopMenu = array( 
    42             'get-rss' => array('href' => BX_DOL_URL_ROOT . $sBaseUri . 'act_rss/', 'target' => '_blank', 'title' => _t('_' . $sUri . '_get_rss'), 'icon' => $GLOBALS['oSysTemplate']->getIconUrl('rss.png')), 
     44            'get-rss' => array('href' => BX_DOL_URL_ROOT . $sBaseUri . 'act_rss/', 'target' => '_blank', 'title' => _t('_' . $sUri . '_get_rss'), 'icon' => BxDolTemplate::getInstance()->getIconUrl('rss.png')), 
    4345        ); 
    4446 
  • trunk/inc/classes/BxDolUserStatusView.php

    r15211 r15334  
    11<?php 
    22// TODO: reconsider this functionality 
     3 
     4bx_import('BxDolTemplate'); 
    35 
    46class BxDolUserStatusView 
     
    106108     * @return : Html presentation data; 
    107109     */ 
    108     function getStatusField($iMemberId) 
    109     { 
    110            global $oSysTemplate; 
    111  
     110    function getStatusField($iMemberId) { 
    112111        $aMemberInfo    = getProfileInfo($iMemberId); 
    113112        $sStatusMessage = process_line_output($aMemberInfo['UserStatusMessage']); 
     
    117116        ); 
    118117 
    119         return $oSysTemplate -> parseHtmlByName('member_menu_status_text_field.html', $aTemplateKeys); 
    120        } 
     118        return BxDolTemplate::getInstance() -> parseHtmlByName('member_menu_status_text_field.html', $aTemplateKeys); 
     119    } 
    121120 
    122121    /** 
     
    126125     * @return : Html presentation data; 
    127126     */ 
    128     function getStatusPageLight($iMemberId) 
    129     { 
    130         global $oSysTemplate; 
    131  
     127    function getStatusPageLight($iMemberId) { 
    132128        $aProfileInfo = getProfileInfo($iMemberId); 
    133129        $aTemplateKeys = array ( 
     
    135131        ); 
    136132 
    137         return $oSysTemplate -> parseHtmlByName( 'user_status_light.html', $aTemplateKeys ); 
     133        return BxDolTemplate::getInstance() -> parseHtmlByName( 'user_status_light.html', $aTemplateKeys ); 
    138134    } 
    139135} 
  • trunk/inc/languages.inc.php

    r15286 r15334  
    155155        ); 
    156156 
    157         $sOutputCode .= $GLOBALS['oSysTemplate']->parseHtmlByName( 'member_menu_sub_item.html', $aTemplateKeys ); 
     157        bx_import('BxDolTemplate'); 
     158        $sOutputCode .= BxDolTemplate::getInstance()->parseHtmlByName( 'member_menu_sub_item.html', $aTemplateKeys ); 
    158159    } 
    159160 
  • trunk/inc/params.inc.php

    r15332 r15334  
    1313} 
    1414 
    15 bx_import('BxDolTemplate'); 
    16 $oSysTemplate = BxDolTemplate::getInstance(); 
    17  
    1815if (defined('BX_PROFILER') && BX_PROFILER) require_once(BX_DIRECTORY_PATH_MODULES . 'boonex/profiler/classes/BxProfiler.php'); 
    1916 
  • trunk/mail.php

    r15329 r15334  
    169169 
    170170            //add some translation 
    171             $GLOBALS['oSysTemplate']->addJsTranslation('_Mailbox title empty'); 
    172             $GLOBALS['oSysTemplate']->addJsTranslation('_Mailbox recipient empty'); 
    173             $GLOBALS['oSysTemplate']->addJsTranslation('_Mailbox description empty'); 
     171            bx_import('BxDolTemplate'); 
     172            $oSysTemplate = BxDolTemplate::getInstance(); 
     173            $oSysTemplate->addJsTranslation('_Mailbox title empty'); 
     174            $oSysTemplate->addJsTranslation('_Mailbox recipient empty'); 
     175            $oSysTemplate->addJsTranslation('_Mailbox description empty'); 
    174176        break; 
    175177 
  • trunk/member_privacy.php

    r15260 r15334  
    6565        } 
    6666 
    67         $sCode = $GLOBALS['oSysTemplate']->parseHtmlByName('ps_page_menu.html', array('bx_repeat:items' => $aItems)); 
     67        bx_import('BxDolTemplate'); 
     68        $sCode = BxDolTemplate::getInstance()->parseHtmlByName('ps_page_menu.html', array('bx_repeat:items' => $aItems)); 
    6869        $sCode = PopupBox('dbPrivacyMenu' . $iBlockId, _t('_ps_bcpt_block_privacy'), $sCode); 
    6970    } 
  • trunk/search.php

    r15260 r15334  
    186186 
    187187        $sOutputHtml .= '<div class="clear_both"></div>'; 
    188         $sContent = $sSortElement . $GLOBALS['oSysTemplate']->parseHtmlByName('view_profiles.html', array('content' => $sOutputHtml)) . $oPaginate->getPaginate(); 
     188 
     189        bx_import('BxDolTemplate'); 
     190        $sContent = $sSortElement . BxDolTemplate::getInstance()->parseHtmlByName('view_profiles.html', array('content' => $sOutputHtml)) . $oPaginate->getPaginate(); 
    189191        $aItems = array( 
    190192             _t('_Simple') => array( 
  • trunk/tags.php

    r15260 r15334  
    3535require_once( BX_DIRECTORY_PATH_INC . 'design.inc.php' ); 
    3636 
     37bx_import('BxDolTemplate'); 
    3738bx_import('BxTemplTags'); 
    3839bx_import('BxDolPageView'); 
     
    8687 
    8788    function display() { 
     89        $oSysTemplate = BxDolTemplate::getInstance(); 
     90             
    8891        $aVars = array ( 
    8992            'bx_repeat:week_names' => $this->_getWeekNames (), 
     
    97100            'month_current' => $this->getTitle(), 
    98101        ); 
    99         $sHtml = $GLOBALS['oSysTemplate']->parseHtmlByName('calendar.html', $aVars); 
     102        $sHtml = $oSysTemplate->parseHtmlByName('calendar.html', $aVars); 
    100103        $sHtml = preg_replace ('#<bx_repeat:events>.*?</bx_repeat:events>#s', '', $sHtml); 
    101         $GLOBALS['oSysTemplate']->addCss('calendar.css'); 
     104        $oSysTemplate->addCss('calendar.css'); 
    102105        return $sHtml; 
    103106    } 
     
    309312    function getBlockCode_Form() 
    310313    { 
    311         return $GLOBALS['oSysTemplate']->parseHtmlByName('search_tags_box.html', array('form' => $this->oForm->getCode())); 
     314        return BxDolTemplate::getInstance()->parseHtmlByName('search_tags_box.html', array('form' => $this->oForm->getCode())); 
    312315    } 
    313316 
  • trunk/templates/base/scripts/BxBaseBrowse.php

    r15211 r15334  
    2121***************************************************************************/ 
    2222 
     23bx_import('BxDolTemplate'); 
    2324bx_import('BxDolBrowse'); 
    2425bx_import('BxDolPaginate'); 
     
    263264            ); 
    264265 
    265             $sSexSection = $GLOBALS['oSysTemplate'] -> parseHtmlByName( $aUsedTemplates[0], $aTemplateKeys ); 
     266            $sSexSection = BxDolTemplate::getInstance() -> parseHtmlByName( $aUsedTemplates[0], $aTemplateKeys ); 
    266267 
    267268            // return builded template ; 
     
    355356            ); 
    356357 
    357             $sAgeSection = $GLOBALS['oSysTemplate'] -> parseHtmlByName( $aUsedTemplates[0], $aTemplateKeys ); 
     358            $sAgeSection = BxDolTemplate::getInstance() -> parseHtmlByName( $aUsedTemplates[0], $aTemplateKeys ); 
    358359 
    359360            // return builded template ; 
     
    450451            ); 
    451452 
    452             $sCountrySection = $GLOBALS['oSysTemplate'] -> parseHtmlByName( $aUsedTemplates[0], $aTemplateKeys ); 
     453            $sCountrySection = BxDolTemplate::getInstance() -> parseHtmlByName( $aUsedTemplates[0], $aTemplateKeys ); 
    453454 
    454455            // return builded template ; 
     
    869870 
    870871        // build template ; 
    871         $sOutputHtml = $GLOBALS['oSysTemplate'] -> parseHtmlByName( $aUsedTemplates[0], $aTemplateKeys ); 
     872        $sOutputHtml = BxDolTemplate::getInstance() -> parseHtmlByName( $aUsedTemplates[0], $aTemplateKeys ); 
    872873 
    873874        // generate toggle ellements ; 
  • trunk/templates/base/scripts/BxBaseCategories.php

    r15211 r15334  
    77defined('BX_DOL') or die('hack attempt'); 
    88 
     9bx_import('BxDolTemplate'); 
    910bx_import('BxDolCategories'); 
    1011 
     
    2223    } 
    2324 
    24     function getCategoriesView ($aTotalCategories, $sHrefTempl, $iColumns) 
    25     { 
    26         global $oSysTemplate; 
     25    function getCategoriesView ($aTotalCategories, $sHrefTempl, $iColumns) { 
     26        $oSysTemplate = BxDolTemplate::getInstance(); 
    2727 
    2828        if (empty($aTotalCategories)) 
     
    181181    } 
    182182 
    183     function _getTopBox($aParam, $iBoxId, $sPageUrl) 
    184     { 
    185         global $oSysTemplate; 
     183    function _getTopBox($aParam, $iBoxId, $sPageUrl) { 
    186184        $sCode = ''; 
    187185 
     
    196194            $sTopCode .= '<option value="' . $sKey . '" ' . ($sKey == $aParam['orderby'] ? 'selected' : '') . '>' . $sVal . '</option>'; 
    197195        $sTopCode .= '</select>'; 
    198         $sCode = $oSysTemplate->parseHtmlByName('top_block.html', array('code' => $sTopCode)); 
     196        $sCode = BxDolTemplate::getInstance()->parseHtmlByName('top_block.html', array('code' => $sTopCode)); 
    199197 
    200198        return $sCode; 
  • trunk/templates/base/scripts/BxBaseCommunicator.php

    r15211 r15334  
    6363         * 
    6464         */ 
    65         function getBlockCode_CommunicatorPage() 
    66         { 
    67             global $oSysTemplate; 
    68  
     65        function getBlockCode_CommunicatorPage() { 
    6966            // set default mode ; 
    7067           if ( !$this -> aCommunicatorSettings['communicator_mode'] ) 
     
    104101         * @return  : Html presentation data ; 
    105102         */ 
    106         function getProcessingRows() 
    107         { 
    108             global $oSysTemplate, $site, $oFunctions ; 
     103        function getProcessingRows() { 
     104            global $site, $oFunctions ; 
     105 
     106            $oSysTemplate = BxDolTemplate::getInstance(); 
    109107 
    110108            // ** init some needed variables ; 
  • trunk/templates/base/scripts/BxBaseFunctions.php

    r15332 r15334  
    108108                ); 
    109109 
    110                 $sOutputHtml .= $GLOBALS['oSysTemplate'] -> parseHtmlByName( $aUsedTemplate['action'], $aTemplateKeys ); 
     110                bx_import('BxDolTemplate'); 
     111                $sOutputHtml .= BxDolTemplate::getInstance() -> parseHtmlByName( $aUsedTemplate['action'], $aTemplateKeys ); 
    111112            } 
    112113        } 
     
    160161        $iId = mktime() . mt_rand(1, 1000); 
    161162 
    162         return $GLOBALS['oSysTemplate']->parseHtmlByName('messageBox.html', array( 
     163        bx_import('BxDolTemplate'); 
     164        return BxDolTemplate::getInstance()->parseHtmlByName('messageBox.html', array( 
    163165            'id' => $iId, 
    164166            'msgText' => $sText, 
     
    175177 
    176178    function loadingBox($sName) { 
    177         return $GLOBALS['oSysTemplate']->parseHtmlByName('loading.html', array( 
     179        bx_import('BxDolTemplate'); 
     180        return BxDolTemplate::getInstance()->parseHtmlByName('loading.html', array( 
    178181            'name' => $sName, 
    179182        )); 
     
    218221            ); 
    219222 
    220         return $GLOBALS['oSysTemplate']->parseHtmlByName('popup_box.html', array( 
     223        bx_import('BxDolTemplate'); 
     224        return BxDolTemplate::getInstance()->parseHtmlByName('popup_box.html', array( 
    221225            'id' => $iId, 
    222226            'wrapper_style' => $isHiddenByDefault ? 'display:none;' : '', 
     
    228232 
    229233    function transBox($content, $isPlaceInCenter = false) { 
     234        bx_import('BxDolTemplate'); 
    230235        return 
    231236            ($isPlaceInCenter ? '<div class="login_ajax_wrap">' : '') . 
    232                 $GLOBALS['oSysTemplate']->parseHtmlByName('transBox.html', array('content' => $content)) . 
     237                BxDolTemplate::getInstance()->parseHtmlByName('transBox.html', array('content' => $content)) . 
    233238            ($isPlaceInCenter ? '</div>' : ''); 
    234239    } 
     
    346351        } 
    347352 
    348         return $GLOBALS['oSysTemplate']->parseHtmlByName($bCouple ? "thumbnail_couple.html" : "thumbnail_single.html", $aVariables); 
     353        bx_import('BxDolTemplate'); 
     354        return BxDolTemplate::getInstance()->parseHtmlByName($bCouple ? "thumbnail_couple.html" : "thumbnail_single.html", $aVariables); 
    349355    } 
    350356 
     
    364370 
    365371    function getTemplateIcon($sName) { 
    366         $sUrl = $GLOBALS['oSysTemplate']->getIconUrl($sName); 
    367         return !empty($sUrl) ? $sUrl : $GLOBALS['oSysTemplate']->getIconUrl('spacer.gif'); 
     372        bx_import('BxDolTemplate'); 
     373        $oSysTemplate = BxDolTemplate::getInstance(); 
     374             
     375        $sUrl = $oSysTemplate->getIconUrl($sName); 
     376        return !empty($sUrl) ? $sUrl : $oSysTemplate->getIconUrl('spacer.gif'); 
    368377    } 
    369378 
    370379    function getTemplateImage($sName) { 
    371         $sUrl = $GLOBALS['oSysTemplate']->getImageUrl($sName); 
    372         return !empty($sUrl) ? $sUrl : $GLOBALS['oSysTemplate']->getImageUrl('spacer.gif'); 
     380        bx_import('BxDolTemplate'); 
     381        $oSysTemplate = BxDolTemplate::getInstance(); 
     382 
     383        $sUrl = $oSysTemplate->getImageUrl($sName); 
     384        return !empty($sUrl) ? $sUrl : $oSysTemplate->getImageUrl('spacer.gif'); 
    373385    } 
    374386 
     
    381393    */ 
    382394    function genObjectsActions( &$aKeys,  $sActionsType, $bSubMenuMode = false ) { 
    383  
     395        bx_import('BxDolTemplate'); 
     396        $oSysTemplate = BxDolTemplate::getInstance(); 
     397             
    384398        // ** init some needed variables ; 
    385399        $sActionsList     = null; 
     
    481495            // is there any value to having this template even if the ID is empty? 
    482496            if ( !$this -> iDhtmlPopupMenu && !empty($aKeys['ID'])) { 
    483                 $sResponceBlock = $GLOBALS['oSysTemplate'] -> parseHtmlByName( $aUsedTemplate['ajaxy_popup'], array('object_id' => $aKeys['ID']) ); 
     497                $sResponceBlock = $oSysTemplate -> parseHtmlByName( $aUsedTemplate['ajaxy_popup'], array('object_id' => $aKeys['ID']) ); 
    484498            } 
    485499 
     
    489503            ); 
    490504 
    491             $sActionsList = $GLOBALS['oSysTemplate'] -> parseHtmlByName( $aUsedTemplate['actions'], $aTemplateKeys ); 
     505            $sActionsList = $oSysTemplate -> parseHtmlByName( $aUsedTemplate['actions'], $aTemplateKeys ); 
    492506        } 
    493507 
     
    567581        ); 
    568582 
    569         $sOutputHtml = $GLOBALS['oSysTemplate'] -> parseHtmlByName( 'menu_bottom.html', $aTemplateKeys ); 
     583        bx_import('BxDolTemplate'); 
     584        $sOutputHtml = BxDolTemplate::getInstance() -> parseHtmlByName( 'menu_bottom.html', $aTemplateKeys ); 
    570585 
    571586        if (isset($GLOBALS['bx_profiler'])) $GLOBALS['bx_profiler']->endMenu('Bottom Menu'); 
  • trunk/templates/base/scripts/BxBaseIndexPageView.php

    r15211 r15334  
    77defined('BX_DOL') or die('hack attempt'); 
    88 
    9 bx_import ('BxDolPageView'); 
     9bx_import('BxDolTemplate'); 
     10bx_import('BxDolPageView'); 
    1011 
    1112class BxBaseIndexPageView extends BxDolPageView { 
     
    2526        $aButton = $oSubscription->getButton(0, 'system', 'mass_mailer'); 
    2627 
    27         return $oSubscription->getData() . $GLOBALS['oSysTemplate']->parseHtmlByName('home_page_subscribe.html', array( 
     28        return $oSubscription->getData() . BxDolTemplate::getInstance()->parseHtmlByName('home_page_subscribe.html', array( 
    2829            'message' => _t('_SUBSCRIBE_TEXT', $site['title']), 
    2930            'button_title' => $aButton['title'], 
     
    226227 
    227228    function getBlockCode_Download() { 
     229        $oSysTemplate = BxDolTemplate::getInstance(); 
     230 
    228231        $a = BxDolDb::getInstance()->fromCache('sys_box_download', 'getAll', 'SELECT * FROM `sys_box_download` WHERE `disabled` = 0 ORDER BY `order`'); 
    229232        $s = ''; 
     
    240243                continue; 
    241244 
    242             $r['icon'] = $GLOBALS['oSysTemplate']->getIconUrl($r['icon']); 
    243             $s .= $GLOBALS['oSysTemplate']->parseHtmlByName('download_box_unit.html', $r); 
     245            $r['icon'] = $oSysTemplate->getIconUrl($r['icon']); 
     246            $s .= $oSysTemplate->parseHtmlByName('download_box_unit.html', $r); 
    244247        } 
    245248 
  • trunk/templates/base/scripts/BxBaseMailBox.php

    r15332 r15334  
    2121    ***************************************************************************/ 
    2222 
     23    bx_import('BxDolTemplate'); 
    2324    bx_import('BxDolMailBox'); 
    2425    bx_import('BxDolSubscription'); 
     
    211212         * @return : Html presentation data ; 
    212213         */ 
    213         function getBlockCode_Archives() 
    214         { 
    215             global  $oSysTemplate; 
     214        function getBlockCode_Archives() { 
     215            $oSysTemplate = BxDolTemplate::getInstance(); 
    216216 
    217217            // init some needed variables; 
     
    309309         * @return   : Html presentation data ; 
    310310         */ 
    311         function getBlockCode_ViewMessage() 
    312         { 
    313             global $oSysTemplate; 
     311        function getBlockCode_ViewMessage() { 
    314312            global $oFunctions; 
    315313            global $site; 
     314 
     315            $oSysTemplate = BxDolTemplate::getInstance(); 
    316316 
    317317            bx_import('BxTemplConfig'); 
     
    671671         * @return         : Html presentation data ; 
    672672         */ 
    673         function getBlockCode_MailBox() 
    674         { 
    675             global $oSysTemplate; 
     673        function getBlockCode_MailBox() { 
     674            $oSysTemplate = BxDolTemplate::getInstance(); 
    676675 
    677676            // init some nedded variables ; 
     
    722721         * @return         : html presentation data ; 
    723722         */ 
    724         function getBlockCode_Contacts() 
    725         { 
    726             global  $oSysTemplate, 
    727                     $oFunctions, 
    728                     $site; 
     723        function getBlockCode_Contacts() { 
     724            global  $oFunctions, $site; 
     725 
     726            $oSysTemplate = BxDolTemplate::getInstance(); 
    729727 
    730728            // init some needed variables; 
     
    899897         * @return        : Html presentation data; 
    900898         */ 
    901         function genArchiveMessages() 
    902         { 
    903             global  $oSysTemplate, 
    904                     $oFunctions, 
    905                     $site; 
     899        function genArchiveMessages() { 
     900            global $oFunctions, $site; 
     901 
     902            $oSysTemplate = BxDolTemplate::getInstance(); 
    906903 
    907904            // ** INTERNAL FUNCTIONS ; 
     
    914911             * @return        : Html presentation data; 
    915912             */ 
    916             function _genPaginationItem( $sItemType, $oObject ) 
    917             { 
    918                 global  $oSysTemplate; 
     913            function _genPaginationItem( $sItemType, $oObject ) { 
     914                $oSysTemplate = BxDolTemplate::getInstance(); 
    919915 
    920916                // init some needed variables ; 
     
    10801076         * @return         : Html presentation data ; 
    10811077         */ 
    1082         function genMessagesRows() 
    1083         { 
    1084             global $oSysTemplate; 
     1078        function genMessagesRows() { 
    10851079            global $oFunctions; 
    10861080            global $site; 
     1081 
     1082            $oSysTemplate = BxDolTemplate::getInstance(); 
    10871083 
    10881084            // init some needed variables ; 
     
    14931489         * @return        : Html presentation data; 
    14941490         */ 
    1495         function genReplayMessage($iRecipientID, $iMessageID = 0) 
    1496         { 
    1497             global $oSysTemplate; 
     1491        function genReplayMessage($iRecipientID, $iMessageID = 0) { 
     1492            $oSysTemplate = BxDolTemplate::getInstance(); 
    14981493 
    14991494            $iMessageID = (int) $iMessageID; 
     
    16641659                [message]   - (string) text message ( if will have a new messages ); 
    16651660         */ 
    1666         function get_member_menu_bubble_new_messages($iMemberId, $iOldCount = 0) 
    1667         { 
    1668             global $oSysTemplate, $oFunctions, $site; 
     1661        function get_member_menu_bubble_new_messages($iMemberId, $iOldCount = 0) { 
     1662            global $oFunctions, $site; 
     1663 
     1664            $oSysTemplate = BxDolTemplate::getInstance(); 
    16691665 
    16701666            $iMemberId         = (int) $iMemberId; 
     
    17411737         * @return : Html presentation data ; 
    17421738        */ 
    1743         function get_member_menu_messages_list( $iMemberId = 0 ) 
    1744         { 
    1745             global $oSysTemplate, $oFunctions; 
     1739        function get_member_menu_messages_list( $iMemberId = 0 ) { 
     1740            global $oFunctions; 
     1741 
     1742            $oSysTemplate = BxDolTemplate::getInstance(); 
    17461743 
    17471744            $iMemberId = (int) $iMemberId; 
  • trunk/templates/base/scripts/BxBaseMenu.php

    r15211 r15334  
    150150        ); 
    151151 
    152         $sRet =  $GLOBALS['oSysTemplate']->parseHtmlByName ('breadcrumbs.html', $aVars); 
     152        bx_import('BxDolTemplate'); 
     153        $sRet =  BxDolTemplate::getInstance()->parseHtmlByName ('breadcrumbs.html', $aVars); 
    153154 
    154155        if (isset($GLOBALS['bx_profiler'])) $GLOBALS['bx_profiler']->endMenu('Breadcrumbs'); 
     
    189190        $aVars['bx_repeat:menu'] = $aMenuReady; 
    190191 
    191         return $GLOBALS['oSysTemplate']->parseHtmlByName ($sTemplateName, $aVars); 
     192        bx_import('BxDolTemplate'); 
     193        return BxDolTemplate::getInstance()->parseHtmlByName ($sTemplateName, $aVars); 
    192194    } 
    193195 
  • trunk/templates/base/scripts/BxBaseProfileView.php

    r15332 r15334  
    8585 
    8686    function getBlockCode_Description() { 
    87         global $oSysTemplate; 
    88  
    8987        $aProfileInfo = getProfileInfo($this -> oProfileGen -> _iProfileID); 
    9088        if(!$aProfileInfo['DescriptionMe']) { 
     
    9694        ); 
    9795 
    98         return $oSysTemplate -> parseHtmlByName('default_padding.html', $aTemplateKeys); 
     96        bx_import('BxDolTemplate'); 
     97        return BxDolTemplate::getInstance() -> parseHtmlByName('default_padding.html', $aTemplateKeys); 
    9998    } 
    10099 
    101100    function _getBlockCaptionCode($iBlockID, $aBlock, $aBlockCode, $bStatic = true, $sDynamicType = 'tab') { 
     101        bx_import('BxDolTemplate'); 
     102 
    102103        //--- Privacy for Profile page ---// 
    103104        $sCode = ""; 
    104105        if($this->iMemberID == $this->oProfileGen->_iProfileID) { 
    105106            $sAlt = ""; 
    106             $sCode = $GLOBALS['oSysTemplate']->parseHtmlByName('ps_page_chooser.html', array( 
     107            $sCode = BxDolTemplate::getInstance()->parseHtmlByName('ps_page_chooser.html', array( 
    107108                'alt' => $sAlt, 
    108109                'page_name' => $this->sPageName, 
  • trunk/templates/base/scripts/BxBaseSearchResultSharedMedia.php

    r15211 r15334  
    2323***************************************************************************/ 
    2424 
     25bx_import('BxDolTemplate'); 
    2526bx_import('BxBaseSearchResult'); 
    2627bx_import('BxDolAlbums'); 
     
    132133        $this->sModuleClass = $sModuleClass; 
    133134        $this->oModule = BxDolModule::getInstance($this->sModuleClass); 
    134         $this->oTemplate = $GLOBALS['oSysTemplate']; 
     135        $this->oTemplate = BxDolTemplate::getInstance(); 
    135136 
    136137        $sClassName = $this->oModule->_oConfig->getClassPrefix() . 'Privacy'; 
  • trunk/templates/base/scripts/BxBaseTags.php

    r15332 r15334  
    77defined('BX_DOL') or die('hack attempt'); 
    88 
     9bx_import('BxDolTemplate'); 
    910bx_import('BxDolTags'); 
    1011 
     
    2223 
    2324    function getTagsView ($aTotalTags, $sHrefTempl) { 
    24         global $oSysTemplate; 
     25        $oSysTemplate = BxDolTemplate::getInstance(); 
    2526 
    2627        if (empty($aTotalTags)) 
     
    103104    } 
    104105 
    105     function getTagsInternalMenuHtml ($aParam, $iBoxId, $sAction = '') 
    106     { 
    107         global $oSysTemplate; 
    108         $sCode = ''; 
     106    function getTagsInternalMenuHtml ($aParam, $iBoxId, $sAction = '') { 
    109107        $sMenu = ''; 
    110108 
     
    112110        $aMenu = $this->getTagsTopMenu($aParam, $sAction); 
    113111 
    114         foreach ($aMenu as $sName => $aItem) 
    115         { 
     112        foreach ($aMenu as $sName => $aItem) { 
    116113            $sMenu .= '<option value="' . $aItem['href'] . '" '. 
    117114                ($aItem['key'] == $aParam['type'] ? 'selected' : '') .'>' . 
     
    121118        $sMenu .= '</select>'; 
    122119 
    123         $sCode = $oSysTemplate->parseHtmlByName('top_block.html', array('code' => $sMenu)); 
    124  
    125         return $sCode; 
     120        return BxDolTemplate::getInstance()->parseHtmlByName('top_block.html', array('code' => $sMenu)); 
    126121    } 
    127122 
  • trunk/templates/tmpl_uni/scripts/BxTemplConfig.php

    r15211 r15334  
    99bx_import('BxBaseConfig'); 
    1010 
     11bx_import('BxDolTemplate'); 
     12$oSysTemplate = BxDolTemplate::getInstance(); 
     13 
    1114// path to the images used in the template 
    12 $site['images']    = $site['url'] . "templates/tmpl_{$GLOBALS['tmpl']}/images/"; 
     15global $site; 
     16$site['images']    = $site['url'] . "templates/tmpl_" . $oSysTemplate->getCode() . "/images/"; 
    1317$site['zodiac']    = $site['images'] . "zodiac/"; 
    1418$site['icons']    = $site['images'] . "icons/"; 
    15 $site['css_dir']= "templates/tmpl_{$GLOBALS['tmpl']}/css/"; 
     19$site['css_dir']= "templates/tmpl_" . $oSysTemplate->getCode() . "/css/"; 
    1620 
    1721class BxTemplConfig extends BxBaseConfig { 
     
    2024    } 
    2125} 
    22  
Note: See TracChangeset for help on using the changeset viewer.