comparison modules/translation/translation.module @ 13:8b6c45761e01 6.6

Drupal 6.6
author Franck Deroche <webmaster@defr.org>
date Tue, 23 Dec 2008 14:32:33 +0100
parents 589fb7c02327
children 4347c45bb494
comparison
equal deleted inserted replaced
12:4ca9f57cc4d4 13:8b6c45761e01
1 <?php 1 <?php
2 // $Id: translation.module,v 1.23.2.1 2008/08/16 21:37:45 dries Exp $ 2 // $Id: translation.module,v 1.23.2.2 2008/10/16 11:57:52 goba Exp $
3 3
4 /** 4 /**
5 * @file 5 * @file
6 * Manages content translations. 6 * Manages content translations.
7 * 7 *
242 * Remove a node from its translation set (if any) 242 * Remove a node from its translation set (if any)
243 * and update the set accordingly. 243 * and update the set accordingly.
244 */ 244 */
245 function translation_remove_from_set($node) { 245 function translation_remove_from_set($node) {
246 if (isset($node->tnid)) { 246 if (isset($node->tnid)) {
247 if (db_result(db_query('SELECT COUNT(*) FROM {node} WHERE tnid = %d', $node->tnid)) <= 2) { 247 if (db_result(db_query('SELECT COUNT(*) FROM {node} WHERE tnid = %d', $node->tnid)) == 1) {
248 // There would only be one node left in the set: remove the set altogether. 248 // There is only one node left in the set: remove the set altogether.
249 db_query('UPDATE {node} SET tnid = 0, translate = 0 WHERE tnid = %d', $node->tnid); 249 db_query('UPDATE {node} SET tnid = 0, translate = 0 WHERE tnid = %d', $node->tnid);
250 } 250 }
251 else { 251 else {
252 db_query('UPDATE {node} SET tnid = 0, translate = 0 WHERE nid = %d', $node->nid); 252 db_query('UPDATE {node} SET tnid = 0, translate = 0 WHERE nid = %d', $node->nid);
253 253