From: Michael M Slusarz Date: Wed, 29 Sep 2010 22:29:01 +0000 (-0600) Subject: phpdoc; better logic X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=7c47587b2677bd61fd1b18d28741c63b83d932d2;p=horde.git phpdoc; better logic --- diff --git a/imp/lib/Contents.php b/imp/lib/Contents.php index e3865df01..9131021c4 100644 --- a/imp/lib/Contents.php +++ b/imp/lib/Contents.php @@ -925,7 +925,7 @@ class IMP_Contents * @param string $type The type to use (overrides the MIME ID if $id is * a MIME part). * - * @return boolean True if the part can be displayed. + * @return integer The RENDER_ constant of the allowable display. */ public function canDisplay($part, $mask, $type = null) { @@ -946,15 +946,12 @@ class IMP_Contents return self::RENDER_FULL; } - $inline = null; - if (($mask & self::RENDER_INLINE) && - ($inline = $viewer->canRender('inline'))) { - return self::RENDER_INLINE; - } - - if (($mask & self::RENDER_INLINE_DISP_NO) && - (($inline === true) || - (is_null($inline) && $viewer->canRender('inline')))) { + if ($mask & self::RENDER_INLINE) { + if ($viewer->canRender('inline')) { + return self::RENDER_INLINE; + } + } elseif (($mask & self::RENDER_INLINE_DISP_NO) && + $viewer->canRender('inline')) { return self::RENDER_INLINE_DISP_NO; }