Skip to content

Commit

Permalink
Simplifies logic in action handling functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
Bevan Rudge committed Jun 26, 2012
1 parent 43c43d9 commit 20fb3c0
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions scheduler_workbench.module
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,7 @@ function scheduler_workbench_scheduler_api($node, $action) {
* @param stdClass $node
*/
function _scheduler_workbench_scheduler_unpublish($node) {
$state = variable_get('scheduler_unpublish_moderation_state_' . $node->type, '');

if (FALSE === empty($state)) {
if ($state = variable_get('scheduler_unpublish_moderation_state_' . $node->type, FALSE)) {
workbench_moderation_moderate($node, $state);
}
}
Expand All @@ -159,9 +157,7 @@ function _scheduler_workbench_scheduler_unpublish($node) {
* @param stdClass $node
*/
function _scheduler_workbench_scheduler_publish($node) {
$state = variable_get('scheduler_publish_moderation_state_' . $node->type, '');

if (FALSE === empty($state)) {
if ($state = variable_get('scheduler_publish_moderation_state_' . $node->type, FALSE)) {
workbench_moderation_moderate($node, $state);
}
}

0 comments on commit 20fb3c0

Please sign in to comment.