// Change permission grants from the deprecated unpublish permission to the
// new transition permission.
$roles=user_roles(FALSE,'unpublish live revision');
$permissions=array(
'unpublish live revision'=>FALSE,
"moderate content from {$transition->from_name} to {$transition->to_name}"=>TRUE,
);
foreach($rolesas$rid=>$role){
user_role_change_permissions($rid,$permissions);
}
returnt("Added a new transition from %from to %to and updated unpublish permissions. Unpublishing content is now controlled by transition permissions, and roles with the 'Bypass moderation restrictions' permission may unpublish content.",array(
@@ -1705,7 +1716,8 @@ function workbench_moderation_messages($context, $node = NULL) {
}
// Add an unpublish link.
if($revision_published&&user_access('unpublish live revision')&&$link=workbench_moderation_access_link(t('Unpublish this revision'),"node/{$node->nid}/moderation/{$node->vid}/unpublish")){
if($revision_published&&!empty($next_states)&&$link=workbench_moderation_access_link(t('Unpublish this revision'),"node/{$node->nid}/moderation/{$node->vid}/unpublish")){
drupal_set_message(t('This is not the live revision of this node.'),'error');
@@ -218,9 +221,27 @@ function workbench_moderation_node_unpublish_form($form, &$form_state, $node) {
'#type'=>'value',
);
$form['message']=array(
'#markup'=>'<p>'.t('Are you sure that you want to unpublish the live revision of this content? The current live revision will be set to moderation state %state.',array('%state'=>workbench_moderation_state_label(workbench_moderation_state_none()))).'</p>',
'#markup'=>'<p>'.t('Are you sure that you want to unpublish the live revision of this content?').'</p>',
$form['message']['#markup'].='<p>'.t('The current live revision will be set to moderation state %state.',array('%state'=>workbench_moderation_state_label(workbench_moderation_state_none()))).'</p>';