HomeHelpTrac

Changeset 15802 for trunk/inc


Ignore:
Timestamp:
12/29/11 01:10:30 (5 months ago)
Author:
Anton Lesnikov
Message:
  1. Minor fixes and improvements.
  2. Studio -> Menu Builder.
Location:
trunk/inc/classes
Files:
2 edited

Legend:

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

    r15795 r15802  
    334334 
    335335        $aKey = array(); 
    336         $iKey = $this->oDb->getKeysBy(array('type' => 'by_name', 'value' => $sKey), $aKey); 
    337         if($iKey != 1) 
     336        $this->oDb->getKeysBy(array('type' => 'by_name', 'value' => $sKey), $aKey); 
     337        if(empty($aKey)) 
    338338            return false; 
    339339 
  • trunk/inc/classes/BxDolLanguagesQuery.php

    r15795 r15802  
    276276 
    277277    function updateString($iKeyId, $iLanguageId, $sString) { 
    278         $sSql = $this->prepare("UPDATE `sys_localization_strings` SET `String`=? WHERE `IDKey`=? AND `IDLanguage`=?", $sString, $iKeyId, $iLanguageId); 
     278        $sSql = $this->prepare("SELECT `IDKey` FROM `sys_localization_strings` WHERE `IDKey`=? AND `IDLanguage`=?", $iKeyId, $iLanguageId); 
     279        $iKeyIdDb = (int)$this->getOne($sSql); 
     280         
     281        if($iKeyIdDb != 0) 
     282            $sSql = $this->prepare("UPDATE `sys_localization_strings` SET `String`=? WHERE `IDKey`=? AND `IDLanguage`=?", $sString, $iKeyId, $iLanguageId); 
     283        else  
     284            $sSql = $this->prepare("INSERT INTO `sys_localization_strings` SET `IDKey`=?, `IDLanguage`=?, `String`=?", $iKeyId, $iLanguageId, $sString); 
    279285        return (int)$this->query($sSql) > 0; 
    280286    } 
Note: See TracChangeset for help on using the changeset viewer.