phpdoc; better logic
authorMichael M Slusarz <slusarz@curecanti.org>
Wed, 29 Sep 2010 22:29:01 +0000 (16:29 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Thu, 30 Sep 2010 17:47:23 +0000 (11:47 -0600)
imp/lib/Contents.php

index e3865df..9131021 100644 (file)
@@ -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;
         }