Exemplo n.º 1
0
 protected function &_getPresentationImage(RokGallery_Model_Slice &$slice, JRegistry &$params)
 {
     $image = new stdClass();
     $image->id = $slice->id;
     $image->title = $params->get('gallery_use_title_from', 'slice') == 'slice' ? $slice->title : $slice->File->title;
     $image->caption = $params->get('gallery_use_caption_from', 'slice') == 'slice' ? $slice->caption : $slice->File->description;
     $image->slug = $slice->slug;
     $image->created_at = date('j M Y', strtotime($slice->File->created_at));
     $image->updated_at = date('j M Y', strtotime($slice->updated_at));
     $image->views = $slice->File->Views->count;
     $image->loves = $slice->File->Loves->count;
     $image->thumburl = $slice->thumburl;
     $image->xsize = $slice->xsize;
     $image->ysize = $slice->ysize;
     $image->doilove = $slice->doilove;
     $image->filesize = $slice->filesize;
     $image->imageurl = $slice->imageurl;
     $image->rel = '';
     if (!RokGallery_Link::isJson($slice->link)) {
         $link = new RokGallery_Link(json_encode(new RokGallery_Link_Type_Manual_Info($slice->link)));
     } else {
         $link = new RokGallery_Link($slice->link);
     }
     switch ($params->get('link')) {
         case 'rokbox':
             $gallery_name = preg_replace("/(\\s|_|-|!)/i", '', $slice->Gallery->name);
             $image->link = $slice->imageurl;
             $image->rel = 'rel="rokbox[' . $image->xsize . ' ' . $image->ysize . '](' . $gallery_name . ')" title="' . $image->title . ' :: ' . $image->caption . '" ';
             break;
         case 'rokbox_full':
             $image->link = $slice->File->imageurl;
             $image->rel = 'rel="rokbox[' . $slice->File->xsize . ' ' . $slice->File->ysize . '](' . str_replace(' ', '', $slice->Gallery->name) . ')" title="' . $image->title . ' :: ' . $image->caption . '" ';
             break;
         case 'slice_link':
             switch ($link->getType()) {
                 case 'manual':
                     if ($link->getUrl() == '') {
                         $menu =& JSite::getMenu();
                         $activeenuitem = $menu->getActive();
                         $menuItem =& $menu->getItem($params->get('default_menuitem', $activeenuitem->id));
                         $image->link = JRoute::_($menuItem->link . '&Itemid=' . $menuItem->id);
                     } else {
                         $image->link = $link->getUrl();
                     }
                     break;
                 case 'article':
                     $image->link = JRoute::_($link->getUrl());
                     break;
             }
             break;
         default:
             $image->link = null;
     }
     return $image;
 }
<?php

/**
 * @version   $Id: default_file.php 39412 2011-07-03 18:34:26Z djamil $
 * @author    RocketTheme http://www.rockettheme.com
 * @copyright Copyright (C) 2007 - 2011 RocketTheme, LLC
 * @license   http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
 */
$slice = $that->slice;
$publish = !$slice->published ? 'publish' : 'unpublish';
$published = $slice->published ? 'published' : 'unpublished';
if (!$slice->link) {
    $link = "#";
} else {
    if (!RokGallery_Link::isJson($slice->link)) {
        $link = new RokGallery_Link(json_encode(new RokGallery_Link_Type_Manual_Info($slice->link)));
    } else {
        $link = new RokGallery_Link($slice->link);
    }
    $link = $link->getUrl();
}
?>

<li data-id="slice-<?php 
echo $slice->id;
?>
" class="slice slice-<?php 
echo $published;
?>
">
    <div class="wrapper">
Exemplo n.º 3
0
 protected function &getPresentationImage(RokGallery_Model_Slice &$slice, JRegistry &$params, $base_page_url, $sort_by, $sort_direction)
 {
     $image = new stdClass();
     $image->id = $slice->id;
     $image->title = $params->get('gallery_use_title_from', 'slice') == 'slice' ? $slice->title : $slice->File->title;
     $image->caption = $params->get('gallery_use_caption_from', 'slice') == 'slice' ? $slice->caption : $slice->File->description;
     $image->created_at = date('j M Y', strtotime($slice->File->created_at));
     $image->updated_at = date('j M Y', strtotime($slice->updated_at));
     $image->views = $slice->File->Views->count;
     $image->loves = $slice->File->Loves->count;
     $image->thumburl = $slice->thumburl;
     $image->xsize = $slice->xsize;
     $image->ysize = $slice->ysize;
     $image->doilove = $slice->doilove;
     $image->filesize = $slice->filesize;
     $image->imageurl = $slice->imageurl;
     $image->rel = '';
     if (!RokGallery_Link::isJson($slice->link)) {
         $link = new RokGallery_Link(json_encode(new RokGallery_Link_Type_Manual_Info($slice->link)));
     } else {
         $link = new RokGallery_Link($slice->link);
     }
     switch ($params->get('slice_link_to')) {
         case 'rokbox':
             $image->link = $slice->imageurl;
             $image->rel = 'rel="rokbox[' . $image->xsize . ' ' . $image->ysize . '](' . str_replace(' ', '', $slice->Gallery->name) . ')" title="' . $image->title . ' :: ' . $image->caption . '" ';
             break;
         case 'rokbox_full':
             $image->link = $slice->imageurl;
             $image->rel = 'rel="rokbox[' . $image->xsize . ' ' . $image->ysize . '](' . str_replace(' ', '', $slice->Gallery->name) . ')" title="' . $image->title . ' :: ' . $image->caption . '" ';
             break;
         case 'force_details':
             $image->link = JRoute::_(RokCommon_URL::updateParams($base_page_url, array('view' => 'detail', 'id' => $slice->id)));
             break;
         default:
             switch ($link->getType()) {
                 case 'manual':
                     $image->link = $link->getUrl() != '' ? $link->getUrl() : JRoute::_(RokCommon_URL::updateParams($base_page_url, array('view' => 'detail', 'id' => $slice->id)));
                     break;
                 case 'article':
                     $image->link = JRoute::_($link->getUrl());
                     break;
             }
             break;
     }
     switch ($params->get('gallery_use_tags_from', 'slice')) {
         case 'slice':
             $tags =& $slice->Tags;
             break;
         case 'file':
             $tags =& $slice->File->Tags;
             break;
         case 'combined':
             $tags =& $slice->getCombinedTags();
             break;
     }
     $image->tags = array();
     foreach ($tags as $tag) {
         if (!($params->get('gallery_remove_gallery_tags', false) && in_array($tag['tag'], $slice->Gallery->filetags))) {
             $image->tags[] = $tag['tag'];
         }
     }
     return $image;
 }