Changeset 15158

Show
Ignore:
Timestamp:
02/21/08 14:25:15 (9 months ago)
Author:
rambo
Message:

forward port r15157

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/midcom/midcom.helper.datamanager2/widget/photo.php

    r14380 r15158  
    105105        else 
    106106        { 
    107             $url = $this->_type->attachments_info['main']['url']; 
    108             $x = $this->_type->attachments_info['main']['size_x']; 
    109             $y = $this->_type->attachments_info['main']['size_y']; 
    110107            $is_thumbnail = false; 
     108            if (array_key_exists('main', $this->_type->attachments_info)) 
     109            { 
     110                $url = $this->_type->attachments_info['main']['url']; 
     111                $x = $this->_type->attachments_info['main']['size_x']; 
     112                $y = $this->_type->attachments_info['main']['size_y']; 
     113            } 
     114            else 
     115            { 
     116                $url = $this->_type->attachments_info['archival']['url']; 
     117                $x = $this->_type->attachments_info['archival']['size_x']; 
     118                $y = $this->_type->attachments_info['archival']['size_y']; 
     119            } 
    111120 
    112121            // Downscale Preview image to max 75px, protect against broken images: 
     
    152161        foreach ($this->_type->attachments_info as $name => $info) 
    153162        { 
    154             //TODO: skip the archival version ?? 
     163            //PONDER: skip the archival version ?? - No 
    155164            if (   $info['size_x'] 
    156165                && $info['size_y']) 
  • trunk/midcom/org.routamc.gallery/style/show_index_item.php

    r5989 r15158  
    33$prefix = $_MIDCOM->get_context_data(MIDCOM_CONTEXT_ANCHORPREFIX); 
    44$view = $data['photo_view']; 
    5 $thumbnail = $data['datamanager']->types['photo']->attachments_info['thumbnail']; 
     5$thumbnail = false; 
     6if (isset($data['datamanager']->types['photo']->attachments_info['thumbnail'])) 
     7
     8    $thumbnail = $data['datamanager']->types['photo']->attachments_info['thumbnail']; 
     9
    610$photo_url = "{$prefix}photo/{$data['photo']->guid}.html"; 
    711?> 
    812<li class="photo"> 
    913    <?php 
    10     echo "<a href=\"{$photo_url}\"><img src=\"{$thumbnail['url']}\" {$thumbnail['size_line']} alt=\"{$thumbnail['filename']}\" /></a>"; 
     14    if ($thumbnail) 
     15    { 
     16        echo "    <a href='{$photo_url}'><img src='{$thumbnail['url']}' {$thumbnail['size_line']} alt='{$thumbnail['filename']}' /></a>\n"; 
     17        echo "    <span class='title'>{$view['title']}</span>\n"; 
     18    } 
     19    else 
     20    { 
     21        // TODO: Some sort of "broken image" placeholder ?? 
     22        echo "    <span class='title'><a href='{$photo_url}'>{$view['title']}</a></span>\n"; 
     23    } 
    1124    ?> 
    12     <span class="title">&(view['title']:h);</span> 
    1325</li> 
  • trunk/midcom/org.routamc.photostream/style/show_photostream_item.php

    r12776 r15158  
    33$prefix = $_MIDCOM->get_context_data(MIDCOM_CONTEXT_ANCHORPREFIX); 
    44$view = $data['photo_view']; 
    5 $thumbnail = $data['datamanager']->types['photo']->attachments_info['thumbnail']; 
     5$thumbnail = false; 
     6if (isset($data['datamanager']->types['photo']->attachments_info['thumbnail'])) 
     7
     8    $thumbnail = $data['datamanager']->types['photo']->attachments_info['thumbnail']; 
     9
    610$photo_url = "{$prefix}photo/{$data['photo']->guid}/"; 
    711 
     
    1317<li class="photo"> 
    1418    <?php 
    15     echo "<a href=\"{$photo_url}\"><img src=\"{$thumbnail['url']}\" {$thumbnail['size_line']} alt=\"{$thumbnail['filename']}\" /></a>"; 
     19    if ($thumbnail) 
     20    { 
     21        echo "    <a href='{$photo_url}'><img src='{$thumbnail['url']}' {$thumbnail['size_line']} alt='{$thumbnail['filename']}' /></a>\n"; 
     22        echo "    <span class='title'>{$view['title']}</span>\n"; 
     23    } 
     24    else 
     25    { 
     26        // TODO: Some sort of "broken image" placeholder ?? 
     27        echo "    <span class='title'><a href='{$photo_url}'>{$view['title']}</a></span>\n"; 
     28    } 
    1629    ?> 
    17     <span class="title">&(view['title']:h);</span> 
    1830    <span class="rating">&(view['rating']:h);</span> 
    1931</li>