fixed a problem deleting a language translations

This commit is contained in:
Erik Amaru Ortiz
2011-01-21 20:49:08 +00:00
parent 35062c5a80
commit 79c12fa48c
2 changed files with 4 additions and 2 deletions

View File

@@ -285,6 +285,7 @@ class Content extends BaseContent {
$c->add ( ContentPeer::CON_LANG, $lanId );
$result = ContentPeer::doSelectRS ( $c );
$result->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$result->next ();
$row = $result->getRow ();
while ( is_array ( $row ) ) {

View File

@@ -132,6 +132,7 @@ try {
include_once 'classes/model/Translation.php';
include_once 'classes/model/Content.php';
$locale = $_POST['LOCALE'];
$trn = new Translation();
if( strpos($locale, Translation::$localeSeparator) )
list($LAN_ID, $IC_UID) = explode(Translation::$localeSeparator, $locale);
@@ -154,7 +155,7 @@ try {
if( $aRow[0] == 0 ) { //so we can delete this language
try{
Content::removeLanguageContent($locale);
Translation::removeTranslationEnvironment($locale);
$trn->removeTranslationEnvironment($locale);
echo G::LoadTranslation('ID_LANGUAGE_DELETED_SUCCESSFULLY');
} catch (Exception $e){
echo $e->getMessage();
@@ -167,4 +168,4 @@ try {
} catch ( Exception $oException ) {
die($oException->getMessage());
}
?>
?>