From ce5711012a5ee0c48ac604356209eb2642c3fd43 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sat, 14 May 2005 23:20:33 +0000 Subject: [PATCH] r141: Convert some $show[] stuff to use the ternary operator rather than a full-blown if statement --- showreport.php | 27 +++------------------------ 1 file changed, 3 insertions(+), 24 deletions(-) diff --git a/showreport.php b/showreport.php index 5a9a4ea..c0bcf1b 100644 --- a/showreport.php +++ b/showreport.php @@ -56,14 +56,7 @@ $bug['priority'] = $bugsys->datastore['priority']["$bug[priority]"]['priority']; $assigninfo = $bugsys->datastore['assignto']["$bug[assignedto]"]; $bug['assigninfo'] = ((is_array($assigninfo)) ? construct_user_display($assigninfo) : ''); -if (((can_perform('caneditown') AND $bugsys->userinfo['userid'] == $comment['userid']) OR can_perform('caneditothers')) AND can_perform('caneditinfo')) -{ - $show['editreport'] = true; -} -else -{ - $show['editreport'] = false; -} +$show['editreport'] = ((((can_perform('caneditown') AND $bugsys->userinfo['userid'] == $comment['userid']) OR can_perform('caneditothers')) AND can_perform('caneditinfo')) ? true : false); // ------------------------------------------------------------------- // hilight @@ -116,14 +109,7 @@ while ($comment = $db->fetch_array($comments_fetch)) { $comment['posttime'] = datelike('standard', $comment['dateline']); $comment['postby'] = construct_user_display($comment); - if ((can_perform('caneditown') AND $bugsys->userinfo['userid'] == $comment['userid']) OR can_perform('caneditothers')) - { - $show['editcomment'] = true; - } - else - { - $show['editcomment'] = false; - } + $show['editcomment'] = (((can_perform('caneditown') AND $bugsys->userinfo['userid'] == $comment['userid']) OR can_perform('caneditothers')) ? true : false); if (is_array($hilight)) { @@ -138,14 +124,7 @@ while ($comment = $db->fetch_array($comments_fetch)) eval('$comments .= "' . $template->fetch('showreport_comment') . '";'); } -if (can_perform('canpostcomments')) -{ - $show['newreply'] = true; -} -else -{ - $show['newreply'] = false; -} +$show['newreply'] = ((can_perform('canpostcomments')) ? true : false); if (is_array($hilight)) { -- 2.22.5