comparison modules/node/node.module @ 5:2427550111ae 6.2

Drupal 6.2
author Franck Deroche <webmaster@defr.org>
date Tue, 23 Dec 2008 14:30:08 +0100
parents 165d43f946a8
children fff6d4c8c043
comparison
equal deleted inserted replaced
4:d94886ac61a0 5:2427550111ae
1 <?php 1 <?php
2 // $Id: node.module,v 1.947.2.3 2008/02/27 17:12:58 goba Exp $ 2 // $Id: node.module,v 1.947.2.6 2008/04/09 21:11:48 goba Exp $
3 3
4 /** 4 /**
5 * @file 5 * @file
6 * The core that allows content to be submitted to the site. Modules and scripts may 6 * The core that allows content to be submitted to the site. Modules and scripts may
7 * programmatically submit nodes using the usual form API pattern. 7 * programmatically submit nodes using the usual form API pattern.
1148 db_query("UPDATE {search_dataset} SET reindex = %d WHERE type = 'node'", time()); 1148 db_query("UPDATE {search_dataset} SET reindex = %d WHERE type = 'node'", time());
1149 return; 1149 return;
1150 1150
1151 case 'status': 1151 case 'status':
1152 $total = db_result(db_query('SELECT COUNT(*) FROM {node} WHERE status = 1')); 1152 $total = db_result(db_query('SELECT COUNT(*) FROM {node} WHERE status = 1'));
1153 $remaining = db_result(db_query("SELECT COUNT(*) FROM {node} n LEFT JOIN {search_dataset} d ON d.type = 'node' AND d.sid = n.nid WHERE d.sid IS NULL OR d.reindex <> 0")); 1153 $remaining = db_result(db_query("SELECT COUNT(*) FROM {node} n LEFT JOIN {search_dataset} d ON d.type = 'node' AND d.sid = n.nid WHERE n.status = 1 AND (d.sid IS NULL OR d.reindex <> 0)"));
1154 return array('remaining' => $remaining, 'total' => $total); 1154 return array('remaining' => $remaining, 'total' => $total);
1155 1155
1156 case 'admin': 1156 case 'admin':
1157 $form = array(); 1157 $form = array();
1158 // Output form for defining rank factor weights. 1158 // Output form for defining rank factor weights.
1445 ); 1445 );
1446 $items['admin/content/types/add'] = array( 1446 $items['admin/content/types/add'] = array(
1447 'title' => 'Add content type', 1447 'title' => 'Add content type',
1448 'page callback' => 'drupal_get_form', 1448 'page callback' => 'drupal_get_form',
1449 'page arguments' => array('node_type_form'), 1449 'page arguments' => array('node_type_form'),
1450 'access arguments' => array('administer content types'),
1450 'file' => 'content_types.inc', 1451 'file' => 'content_types.inc',
1451 'type' => MENU_LOCAL_TASK, 1452 'type' => MENU_LOCAL_TASK,
1452 ); 1453 );
1453 $items['node'] = array( 1454 $items['node'] = array(
1454 'title' => 'Content', 1455 'title' => 'Content',
1483 ); 1484 );
1484 $items['admin/content/node-type/'. $type_url_str] = array( 1485 $items['admin/content/node-type/'. $type_url_str] = array(
1485 'title' => $type->name, 1486 'title' => $type->name,
1486 'page callback' => 'drupal_get_form', 1487 'page callback' => 'drupal_get_form',
1487 'page arguments' => array('node_type_form', $type), 1488 'page arguments' => array('node_type_form', $type),
1489 'access arguments' => array('administer content types'),
1488 'file' => 'content_types.inc', 1490 'file' => 'content_types.inc',
1489 'type' => MENU_CALLBACK, 1491 'type' => MENU_CALLBACK,
1490 ); 1492 );
1491 $items['admin/content/node-type/'. $type_url_str .'/edit'] = array( 1493 $items['admin/content/node-type/'. $type_url_str .'/edit'] = array(
1492 'title' => 'Edit', 1494 'title' => 'Edit',
1493 'type' => MENU_DEFAULT_LOCAL_TASK, 1495 'type' => MENU_DEFAULT_LOCAL_TASK,
1494 ); 1496 );
1495 $items['admin/content/node-type/'. $type_url_str .'/delete'] = array( 1497 $items['admin/content/node-type/'. $type_url_str .'/delete'] = array(
1496 'title' => 'Delete', 1498 'title' => 'Delete',
1497 'page arguments' => array('node_type_delete_confirm', $type), 1499 'page arguments' => array('node_type_delete_confirm', $type),
1500 'access arguments' => array('administer content types'),
1498 'file' => 'content_types.inc', 1501 'file' => 'content_types.inc',
1499 'type' => MENU_CALLBACK, 1502 'type' => MENU_CALLBACK,
1500 ); 1503 );
1501 } 1504 }
1502 $items['node/%node'] = array( 1505 $items['node/%node'] = array(
1543 $items['node/%node/revisions/%/view'] = array( 1546 $items['node/%node/revisions/%/view'] = array(
1544 'title' => 'Revisions', 1547 'title' => 'Revisions',
1545 'load arguments' => array(3), 1548 'load arguments' => array(3),
1546 'page callback' => 'node_show', 1549 'page callback' => 'node_show',
1547 'page arguments' => array(1, NULL, TRUE), 1550 'page arguments' => array(1, NULL, TRUE),
1551 'access callback' => '_node_revision_access',
1552 'access arguments' => array(1),
1548 'type' => MENU_CALLBACK, 1553 'type' => MENU_CALLBACK,
1549 ); 1554 );
1550 $items['node/%node/revisions/%/revert'] = array( 1555 $items['node/%node/revisions/%/revert'] = array(
1551 'title' => 'Revert to earlier revision', 1556 'title' => 'Revert to earlier revision',
1552 'load arguments' => array(3), 1557 'load arguments' => array(3),