Autodoc
  • Namespace
  • Class
  • Tree

Namespaces

  • BlueTihi
    • Context
  • Brickrouge
    • Element
      • Nodes
    • Renderer
    • Widget
  • ICanBoogie
    • ActiveRecord
    • AutoConfig
    • CLDR
    • Composer
    • Core
    • Event
    • Exception
    • HTTP
      • Dispatcher
      • Request
    • I18n
      • Translator
    • Mailer
    • Modules
      • Taxonomy
        • Support
      • Thumbnailer
        • Versions
    • Object
    • Operation
      • Dispatcher
    • Prototype
    • Routes
    • Routing
      • Dispatcher
    • Session
  • Icybee
    • ActiveRecord
      • Model
    • ConfigOperation
    • Document
    • EditBlock
    • Element
      • ActionbarContextual
      • ActionbarSearch
      • ActionbarToolbar
    • FormBlock
    • Installer
    • ManageBlock
    • Modules
      • Articles
      • Cache
        • Collection
        • ManageBlock
      • Comments
        • ManageBlock
      • Contents
        • ManageBlock
      • Dashboard
      • Editor
        • Collection
      • Files
        • File
        • ManageBlock
      • Forms
        • Form
        • ManageBlock
      • I18n
      • Images
        • ManageBlock
      • Members
      • Modules
        • ManageBlock
      • Nodes
        • ManageBlock
        • Module
      • Pages
        • BreadcrumbElement
        • LanguagesElement
        • ManageBlock
        • NavigationBranchElement
        • NavigationElement
        • Page
        • PageController
      • Registry
      • Search
      • Seo
      • Sites
        • ManageBlock
      • Taxonomy
        • Terms
          • ManageBlock
        • Vocabulary
          • ManageBlock
      • Users
        • ManageBlock
        • NonceLogin
        • Roles
      • Views
        • ActiveRecordProvider
        • Collection
        • View
    • Operation
      • ActiveRecord
      • Constructor
      • Module
      • Widget
    • Rendering
  • None
  • Patron
  • PHP

Classes

  • AdjustImage
  • AdjustThumbnail
  • EditBlock
  • GalleryBlock
  • GalleryController
  • Hooks
  • Image
  • ImageUpload
  • ManageBlock
  • Model
  • Module
  • NodeRelation
  • PopImage
  • PopOrUploadImage
  • SaveOperation
  • Thumbnail
  • ThumbnailDecorator
  • ThumbnailOperation
  • UploadImage
  • UploadOperation
 1 <?php
 2 
 3 /*
 4  * This file is part of the Icybee package.
 5  *
 6  * (c) Olivier Laviale <olivier.laviale@gmail.com>
 7  *
 8  * For the full copyright and license information, please view the LICENSE
 9  * file that was distributed with this source code.
10  */
11 
12 namespace Icybee\Modules\Images;
13 
14 /**
15  * Representation of an image thumbnail.
16  */
17 class Thumbnail extends \ICanBoogie\Modules\Thumbnailer\Thumbnail
18 {
19     /* @var $record \Icybee\Modules\Images\Image */
20 
21     protected function get_url()
22     {
23         $record = $this->src;
24         $options = $this->filtered_options;
25         $version_name = $this->version_name;
26 
27         $url = "/api/images/{$record->nid}";
28         $remove_path_params = false;
29 
30         if ($version_name)
31         {
32             $url .= "/thumbnails/" . $version_name;
33         }
34         else
35         {
36             $url .= self::format_options_as_path($options);
37             $remove_path_params = true;
38         }
39 
40         $query_string = self::format_options_as_query_string($options, true);
41 
42         if ($query_string)
43         {
44             $url .= '?' . $query_string;
45         }
46 
47         return $url;
48     }
49 
50     public function to_element(array $attributes=[])
51     {
52         $element = parent::to_element($attributes);
53 
54         $record = $this->src;
55 
56         list($w, $h) = \ICanBoogie\Image::compute_final_size($this->w, $this->h, $this->method, [ $record->width, $record->height ]);
57 
58         $element['alt'] = $record->alt;
59         $element['width'] = $w;
60         $element['height'] = $h;
61 
62         return $element;
63     }
64 }
Autodoc API documentation generated by ApiGen 2.8.0