Commit 82b2613a authored by Dries's avatar Dries

- Patch #101690 by kkaefer: language/usability improvements.

parent b9d8f023
......@@ -1213,52 +1213,56 @@ function node_last_changed($nid) {
*/
function node_node_operations() {
$operations = array(
'approve' => array(
'label' => t('Approve the selected posts'),
'callback' => 'node_operations_approve',
'publish' => array(
'label' => t('Publish'),
'callback' => 'node_operations_publish',
),
'unpublish' => array(
'label' => t('Unpublish'),
'callback' => 'node_operations_unpublish',
),
'promote' => array(
'label' => t('Promote the selected posts'),
'label' => t('Promote to front page'),
'callback' => 'node_operations_promote',
),
'sticky' => array(
'label' => t('Make the selected posts sticky'),
'callback' => 'node_operations_sticky',
),
'demote' => array(
'label' => t('Demote the selected posts'),
'label' => t('Demote from front page'),
'callback' => 'node_operations_demote',
),
'unpublish' => array(
'label' => t('Unpublish the selected posts'),
'callback' => 'node_operations_unpublish',
'sticky' => array(
'label' => t('Make sticky'),
'callback' => 'node_operations_sticky',
),
'unsticky' => array(
'label' => t('Remove stickiness'),
'callback' => 'node_operations_unsticky',
),
'delete' => array(
'label' => t('Delete the selected posts'),
'label' => t('Delete'),
),
);
return $operations;
}
/**
* Callback function for admin mass approving nodes.
* Callback function for admin mass publishing nodes.
*/
function node_operations_approve($nodes) {
function node_operations_publish($nodes) {
db_query('UPDATE {node} SET status = 1 WHERE nid IN(%s)', implode(',', $nodes));
}
/**
* Callback function for admin mass promoting nodes.
* Callback function for admin mass unpublishing nodes.
*/
function node_operations_promote($nodes) {
db_query('UPDATE {node} SET status = 1, promote = 1 WHERE nid IN(%s)', implode(',', $nodes));
function node_operations_unpublish($nodes) {
db_query('UPDATE {node} SET status = 0 WHERE nid IN(%s)', implode(',', $nodes));
}
/**
* Callback function for admin mass editing nodes to be sticky.
* Callback function for admin mass promoting nodes.
*/
function node_operations_sticky($nodes) {
db_query('UPDATE {node} SET status = 1, sticky = 1 WHERE nid IN(%s)', implode(',', $nodes));
function node_operations_promote($nodes) {
db_query('UPDATE {node} SET status = 1, promote = 1 WHERE nid IN(%s)', implode(',', $nodes));
}
/**
......@@ -1269,10 +1273,17 @@ function node_operations_demote($nodes) {
}
/**
* Callback function for admin mass unpublishing nodes.
* Callback function for admin mass editing nodes to be sticky.
*/
function node_operations_unpublish($nodes) {
db_query('UPDATE {node} SET status = 0 WHERE nid IN(%s)', implode(',', $nodes));
function node_operations_sticky($nodes) {
db_query('UPDATE {node} SET status = 1, sticky = 1 WHERE nid IN(%s)', implode(',', $nodes));
}
/**
* Callback function for admin mass editing nodes to remove stickiness.
*/
function node_operations_unsticky($nodes) {
db_query('UPDATE {node} SET sticky = 0 WHERE nid IN(%s)', implode(',', $nodes));
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment