fixes for languages

This commit is contained in:
Gustavo Adolfo Cruz Laura
2011-01-21 22:54:05 +00:00
parent 4cd8a15c73
commit 0765704db5
3 changed files with 12 additions and 3 deletions

View File

@@ -293,7 +293,7 @@ class languages {
$category,
$id,
$LOCALE,
trim(str_replace(chr(10), '', $rowTranslation['msgstr']))
trim(str_replace(chr(10), '', stripslashes($rowTranslation['msgstr'])))
);
if( $result['codError'] == 0 )
$countItemsSuccess++;

View File

@@ -284,15 +284,22 @@ class Content extends BaseContent {
$c->addSelectColumn(ContentPeer::CON_LANG);
$c->add ( ContentPeer::CON_LANG, $lanId );
$result = ContentPeer::doSelectRS ( $c );
$result->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$result->next ();
$row = $result->getRow ();
while ( is_array ( $row ) ) {
ContentPeer::doDelete ( array ($row['CON_CATEGORY'], $row['CON_PARENT'], $row['CON_ID'], $lanId ) );
$content = ContentPeer::retrieveByPK( $row['CON_CATEGORY'], '', $row['CON_ID'], $lanId);
if( get_class($content) == 'Content' )
$content->delete();
$result->next ();
$row = $result->getRow ();
}
} catch ( Exception $e ) {
throw ($e);
}

View File

@@ -142,7 +142,9 @@ try {
}
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn('COUNT('.ContentPeer::CON_CATEGORY.')');
//$oCriteria->addSelectColumn('COUNT('.ContentPeer::CON_CATEGORY.')');
$oCriteria->addSelectColumn(ContentPeer::CON_CATEGORY);
$oCriteria->addSelectColumn(ContentPeer::CON_VALUE);
$oCriteria->add(ContentPeer::CON_LANG, $locale);
$oCriteria->add(ContentPeer::CON_CATEGORY, 'APP_TITLE', Criteria::EQUAL );
$oDataset = ContentPeer::doSelectRS($oCriteria);