HomeHelpTrac

Changeset 15525 for trunk/templates


Ignore:
Timestamp:
09/25/11 22:53:43 (8 months ago)
Author:
Anton Lesnikov
Message:
  1. Refactoring of languages.inc.php
  2. Polyglot -> update warning
  3. Polyglot -> autoresize for text areas
Location:
trunk/templates/base/scripts
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/templates/base/scripts/BxBaseFunctions.php

    r15335 r15525  
    647647        )); 
    648648    } 
     649     
     650    /** 
     651     * Function will generate list of installed languages list; 
     652     * 
     653     * @return : Html presentation data; 
     654     */ 
     655    function getLangSwitcher() { 
     656        bx_import('BxDolLanguagesQuery'); 
     657        $aLangs = BxDolLanguagesQuery::getInstance()->getLanguages(); 
     658        if(count($aLangs) < 2) 
     659            return ''; 
     660 
     661        bx_import('BxDolTemplate'); 
     662        $oTemplate = BxDolTemplate::getInstance(); 
     663 
     664        $sOutputCode = ''; 
     665        foreach( $aLangs as $sName => $sLang ) { 
     666            $sFlag = $oTemplate->getIconUrl('sys_fl_' . $sName . '.gif'); 
     667            $aTemplateKeys = array ( 
     668                'bx_if:item_img' => array ( 
     669                    'condition' =>  ( $sFlag ), 
     670                    'content'   => array ( 
     671                        'item_img_src'      => $sFlag, 
     672                        'item_img_alt'      => $sName, 
     673                        'item_img_width'    => 18, 
     674                        'item_img_height'   => 12, 
     675                    ), 
     676                ), 
     677                'item_link'    => BX_DOL_URL_ROOT . 'index.php?lang=' . $sName, 
     678                'item_onclick' => null, 
     679                'item_title'   => $sLang, 
     680                'extra_info'   => null, 
     681            ); 
     682 
     683            $sOutputCode .= $oTemplate->parseHtmlByName( 'member_menu_sub_item.html', $aTemplateKeys ); 
     684        } 
     685     
     686        return $sOutputCode; 
     687    } 
    649688} 
    650  
  • trunk/templates/base/scripts/BxBaseMenu.php

    r15334 r15525  
    306306    */ 
    307307    function genMoreLanguagesElement(){ 
    308         $aExistedLanguages = getLangsArr(); 
    309         if(count($aExistedLanguages) <= 1) return; 
     308        bx_import('BxDolLanguagesQuery'); 
     309        $aExistedLanguages = BxDolLanguagesQuery::getInstance()->getLanguages(); 
     310        if(count($aExistedLanguages) <= 1)  
     311            return; 
    310312 
    311313        $sCurLanguage = strlen($_GET['lang']) ? $_GET['lang'] : $_COOKIE['lang']; 
Note: See TracChangeset for help on using the changeset viewer.