HomeHelpTrac

Changeset 15964 for trunk


Ignore:
Timestamp:
02/08/12 17:44:48 (4 months ago)
Author:
Alexander Trofimov
Message:

Pages - image block

Location:
trunk/templates/base
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/templates/base/css/general.css

    r15942 r15964  
    7878} 
    7979 
     80 
  • trunk/templates/base/css/page_layouts.css

    r15864 r15964  
    2020 
    2121.bx-layout-bar-width { 
    22     width:200px; 
     22    width:280px; 
    2323} 
    2424 
  • trunk/templates/base/scripts/BxBasePage.php

    r15948 r15964  
    176176     */ 
    177177    protected function _getBlockImage ($aBlock) { 
    178         // TODO: 
    179         return ''; 
     178        if (empty($aBlock['content'])) 
     179            return false; 
     180 
     181        list($iFileId, $sAlign ) = explode('#', $aBlock['content']); 
     182        $iFileId = (int)$iFileId; 
     183        if (!$iFileId) 
     184            return false; 
     185 
     186        bx_import('BxDolStorage'); 
     187        $oStorage = BxDolStorage::getObjectInstance(BX_DOL_STORAGE_OBJ_IMAGES); 
     188        if (!$oStorage) 
     189            return false; 
     190 
     191        $sUrl = $oStorage->getFileUrlById($iFileId); 
     192        if (!$sUrl) 
     193            return false; 
     194 
     195        $sStyleAdd = ''; 
     196        if ('center' == $sAlign || 'left' == $sAlign || 'right' == $sAlign) 
     197            $sStyleAdd = 'style="text-align:' . $sAlign . '"'; 
     198 
     199        return '<div class="bx-page-image-container" ' . $sStyleAdd . '><img src="' . $sUrl . '" /></div>'; 
    180200    } 
    181201 
Note: See TracChangeset for help on using the changeset viewer.