HomeHelpTrac

Changeset 15706 for trunk/inc


Ignore:
Timestamp:
11/28/11 04:20:04 (6 months ago)
Author:
Anton Lesnikov
Message:
  1. Minor improvements in Grid Engine.
  2. Grid based Studio -> Polyglot -> Keys manager.
Location:
trunk/inc
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/inc/classes/BxDolLanguagesQuery.php

    r15664 r15706  
    2929     */ 
    3030    static function getInstance() { 
    31         if(!isset($GLOBALS['bxDolClasses'][__CLASS__])) { 
    32             bx_import('BxTemplMenu'); 
     31        if(!isset($GLOBALS['bxDolClasses'][__CLASS__])) 
    3332            $GLOBALS['bxDolClasses'][__CLASS__] = new BxDolLanguagesQuery(); 
    34         } 
    3533 
    3634        return $GLOBALS['bxDolClasses'][__CLASS__]; 
     
    6664                $sWhereClause .= $this->prepare(" AND `tl`.`Name`=?", $aParams['value']); 
    6765                break; 
     66            case 'default': 
     67                $aMethod['name'] = 'getRow'; 
     68                $sWhereClause .= $this->prepare(" AND `tl`.`Name`=?", $this->getParam('lang_default')); 
     69                break; 
    6870            case 'active': 
    6971                $sWhereClause = " AND `tl`.`Enabled`='1'"; 
  • trunk/inc/languages.inc.php

    r15698 r15706  
    325325 
    326326    $sKey = bx_process_input($sKey); 
    327     $sString = bx_process_input($mixedString); 
     327    $mixedString = bx_process_input($mixedString); 
    328328 
    329329    $oDb = BxDolLanguagesQuery::getInstance(); 
     
    350350    } 
    351351 
    352     return true; 
     352    return $iKeyId; 
    353353} 
    354354 
     
    368368} 
    369369 
    370 function updateLanguageStringById($iKeyId, $sString, $iLangId = 0, $bRecompile = true) { 
     370function updateLanguageStringById($iKeyId, $mixedString, $iLangId = 0, $bRecompile = true) { 
    371371    $iKeyId = (int)$iKeyId; 
    372     $sString = bx_process_input($sString); 
     372    $mixedString = bx_process_input($mixedString); 
    373373    $iLangId = (int)$iLangId; 
    374374 
     
    380380 
    381381    foreach($aLanguages as $aLanguage) { 
    382         if(!$oDb->updateString($iKeyId, $aLanguage['id'], $sString)) 
    383             return false; 
    384  
    385         if($bRecompile) 
     382        $sString = ''; 
     383        if(is_string($mixedString)) 
     384            $sString = $mixedString; 
     385        else if(is_array($mixedString)) 
     386            $sString = $mixedString[$aLanguage['id']]; 
     387 
     388        if($oDb->updateString($iKeyId, $aLanguage['id'], $sString) && $bRecompile) 
    386389            compileLanguage($aLanguage['id']); 
    387390    } 
Note: See TracChangeset for help on using the changeset viewer.