diff options
Diffstat (limited to 'modules/node')
-rw-r--r-- | modules/node/node.module | 17 | ||||
-rw-r--r-- | modules/node/node.schema | 32 |
2 files changed, 30 insertions, 19 deletions
diff --git a/modules/node/node.module b/modules/node/node.module index 1df162468..1423f3c29 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -581,10 +581,10 @@ function node_load($param = array(), $revision = NULL, $reset = NULL) { // No db_rewrite_sql is applied so as to get complete indexing for search. if ($revision) { array_unshift($arguments, $revision); - $node = db_fetch_object(db_query('SELECT n.nid, r.vid, n.type, n.status, n.language, n.created, n.changed, n.comment, n.promote, n.sticky, r.timestamp AS revision_timestamp, r.title, r.body, r.teaser, r.log, r.format, u.uid, u.name, u.picture, u.data FROM {node} n INNER JOIN {users} u ON u.uid = n.uid INNER JOIN {node_revisions} r ON r.nid = n.nid AND r.vid = %d WHERE '. $cond, $arguments)); + $node = db_fetch_object(db_query('SELECT n.nid, r.vid, n.type, n.status, n.language, n.created, n.changed, n.comment, n.promote, n.sticky, n.tnid, n.translate, r.timestamp AS revision_timestamp, r.title, r.body, r.teaser, r.log, r.format, u.uid, u.name, u.picture, u.data FROM {node} n INNER JOIN {users} u ON u.uid = n.uid INNER JOIN {node_revisions} r ON r.nid = n.nid AND r.vid = %d WHERE '. $cond, $arguments)); } else { - $node = db_fetch_object(db_query('SELECT n.nid, n.vid, n.type, n.status, n.language, n.created, n.changed, n.comment, n.promote, n.sticky, r.timestamp AS revision_timestamp, r.title, r.body, r.teaser, r.log, r.format, u.uid, u.name, u.picture, u.data FROM {node} n INNER JOIN {users} u ON u.uid = n.uid INNER JOIN {node_revisions} r ON r.vid = n.vid WHERE '. $cond, $arguments)); + $node = db_fetch_object(db_query('SELECT n.nid, n.vid, n.type, n.status, n.language, n.created, n.changed, n.comment, n.promote, n.sticky, n.tnid, n.translate, r.timestamp AS revision_timestamp, r.title, r.body, r.teaser, r.log, r.format, u.uid, u.name, u.picture, u.data FROM {node} n INNER JOIN {users} u ON u.uid = n.uid INNER JOIN {node_revisions} r ON r.vid = n.vid WHERE '. $cond, $arguments)); } if ($node && $node->nid) { @@ -1371,10 +1371,17 @@ function node_operations_unsticky($nodes) { function node_filters() { // Regular filters $filters['status'] = array('title' => t('status'), - 'options' => array('status-1' => t('published'), 'status-0' => t('not published'), - 'promote-1' => t('promoted'), 'promote-0' => t('not promoted'), - 'sticky-1' => t('sticky'), 'sticky-0' => t('not sticky'))); + 'options' => array('status-1' => t('published'), 'status-0' => t('not published'), + 'promote-1' => t('promoted'), 'promote-0' => t('not promoted'), + 'sticky-1' => t('sticky'), 'sticky-0' => t('not sticky')) + ); + // Include translation states if we have this module enabled + if (module_exists('translation')) { + $filters['status']['options'] += array('translate-0' => t('up to date translation'), 'translate-1' => t('outdated translation')); + } + $filters['type'] = array('title' => t('type'), 'options' => node_get_types('names')); + // The taxonomy filter if ($taxonomy = module_invoke('taxonomy', 'form_all', 1)) { $filters['category'] = array('title' => t('category'), 'options' => $taxonomy); diff --git a/modules/node/node.schema b/modules/node/node.schema index 69a8981a8..752732c5f 100644 --- a/modules/node/node.schema +++ b/modules/node/node.schema @@ -4,19 +4,21 @@ function node_schema() { $schema['node'] = array( 'fields' => array( - 'nid' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE), - 'vid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => FALSE, 'default' => 0), - 'type' => array('type' => 'varchar', 'length' => 32, 'not null' => TRUE, 'default' => ''), - 'language' => array('type' => 'varchar', 'length' => 12, 'not null' => TRUE, 'default' => ''), - 'title' => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''), - 'uid' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - 'status' => array('type' => 'int', 'not null' => TRUE, 'default' => 1), - 'created' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - 'changed' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - 'comment' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - 'promote' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - 'moderate' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - 'sticky' => array('type' => 'int', 'not null' => TRUE, 'default' => 0) + 'nid' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE), + 'vid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => FALSE, 'default' => 0), + 'type' => array('type' => 'varchar', 'length' => 32, 'not null' => TRUE, 'default' => ''), + 'language' => array('type' => 'varchar', 'length' => 12, 'not null' => TRUE, 'default' => ''), + 'title' => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''), + 'uid' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), + 'status' => array('type' => 'int', 'not null' => TRUE, 'default' => 1), + 'created' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), + 'changed' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), + 'comment' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), + 'promote' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), + 'moderate' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), + 'sticky' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), + 'tnid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), + 'translate' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), ), 'indexes' => array( 'nid' => array('nid'), @@ -28,7 +30,9 @@ function node_schema() { 'node_title_type' => array('title', array('type', 4)), 'node_type' => array(array('type', 4)), 'status' => array('status'), - 'uid' => array('uid') + 'uid' => array('uid'), + 'tnid' => array('tnid'), + 'translate' => array('translate'), ), 'unique keys' => array( 'nid_vid' => array('nid', 'vid'), |