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

  • AdjustThumbnailOptions
  • AdjustThumbnailVersion
  • CacheManager
  • GetOperation
  • Hooks
  • Module
  • PopThumbnailVersion
  • Thumbnail
  • Version
  • Versions

Exceptions

  • VersionNotDefined

Constants

  • CACHE_VERSIONS
  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 ICanBoogie\Modules\Thumbnailer;
 13 
 14 use Brickrouge\Element;
 15 
 16 class PopThumbnailVersion extends \Brickrouge\Widget
 17 {
 18     static protected function add_assets(\Brickrouge\Document $document)
 19     {
 20         parent::add_assets($document);
 21 
 22         $document->js->add(DIR . 'public/module.js');
 23     }
 24 
 25     public function __construct(array $attributes=array())
 26     {
 27         parent::__construct
 28         (
 29             'a', $attributes + array
 30             (
 31                 'class' => 'spinner'
 32             )
 33         );
 34     }
 35 
 36     public function offsetSet($offset, $value)
 37     {
 38         if (($offset == 'value' || $offset == self::DEFAULT_VALUE) && is_array($value))
 39         {
 40             $value = json_encode($value);
 41         }
 42 
 43         parent::offsetSet($offset, $value);
 44     }
 45 
 46     protected function render_class(array $class_names)
 47     {
 48         if (!$this['value'])
 49         {
 50             $class_names['placeholder'] = true;
 51         }
 52 
 53         return parent::render_class($class_names);
 54     }
 55 
 56     protected function render_inner_html()
 57     {
 58         $html = parent::render_inner_html();
 59 
 60         $value = $this['value'] ?: $this[self::DEFAULT_VALUE];
 61         $decoded_value = json_decode($value, true);
 62 
 63         $input = new Element
 64         (
 65             'input', array
 66             (
 67                 'name' => $this['name'],
 68                 'type' => 'hidden',
 69                 'value' => $value
 70             )
 71         );
 72 
 73         $content = '';
 74 
 75         if ($decoded_value)
 76         {
 77             $version = new Version($decoded_value);
 78 
 79             $w = $version->width ?: '<em>auto</em>';
 80             $h = $version->height ?: '<em>auto</em>';
 81             $method = $version->method;
 82             $format = '.' . ($version->format ?: '<em>auto</em>');
 83 
 84             $content = "{$w}×{$h} {$method} $format";
 85         }
 86 
 87         $placeholder = 'Version non définie';
 88 
 89         return <<<EOT
 90 $input <span class="spinner-content">$content</span> <em class="spinner-placeholder">$placeholder</em> $html
 91 EOT;
 92     }
 93 }
 94 
 95 namespace Brickrouge\Widget;
 96 
 97 class PopThumbnailVersion extends \ICanBoogie\Modules\Thumbnailer\PopThumbnailVersion
 98 {
 99 
100 }
Autodoc API documentation generated by ApiGen 2.8.0