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
  • AdjustNode
  • AdjustThumbnail
  • AdjustThumbnailVersion
  • PopThumbnailVersion
  • TimeZone
 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 use ICanBoogie\Modules\Thumbnailer\AdjustThumbnailOptions;
15 
16 use Brickrouge\Element;
17 
18 class AdjustThumbnail extends \Brickrouge\Widget
19 {
20     protected $adjust_image;
21     protected $adjust_thumbnail_options;
22 
23     static protected function add_assets(\Brickrouge\Document $document)
24     {
25         parent::add_assets($document);
26 
27         $document->css->add(DIR . 'public/module.css');
28         $document->js->add(DIR . 'public/module.js');
29     }
30 
31     public function __construct(array $attributes=array())
32     {
33         parent::__construct
34         (
35             'div', $attributes + array
36             (
37                 Element::CHILDREN => array
38                 (
39                     $this->adjust_image = new AdjustImage,
40                     $this->adjust_thumbnail_options = new AdjustThumbnailOptions
41                 ),
42 
43                 'data-widget-constructor' => 'AdjustThumbnail'
44             )
45         );
46     }
47 
48     public function render_inner_html()
49     {
50         return '<input type="hidden" value="' . \Brickrouge\escape($this['value']) . '" />'
51         . parent::render_inner_html()
52         . '<div class="more"><i class="icon-cog"></i></div>';
53     }
54 
55     public function offsetSet($attribute, $value)
56     {
57         if ($attribute == 'value')
58         {
59             if (preg_match('/\/api\/images\/(\d+)(\/(\d*)x(\d*)(\/([a-z\-]+))?)?/', $value, $matches))
60             {
61                 list($path, $nid, , $width, $height, , $method) = $matches + array(3 => null, 4 => null, 6 => null);
62 
63                 $options = array();
64 
65                 $qs = strpos($value, '?');
66 
67                 if ($qs)
68                 {
69                     parse_str(substr($value, $qs + 1), $options);
70                 }
71 
72                 $options['width'] = $width;
73                 $options['height'] = $height;
74 
75                 if ($method)
76                 {
77                     $options['method'] = $method;
78                 }
79 
80                 $this->adjust_image['value'] = $nid;
81                 $this->adjust_thumbnail_options['value'] = $options;
82             }
83         }
84 
85         parent::offsetSet($attribute, $value);
86     }
87 
88     // TODO-20130605: offsetGet >> value
89 }
90 
91 namespace Brickrouge\Widget;
92 
93 class AdjustThumbnail extends \Icybee\Modules\Images\AdjustThumbnail
94 {
95 
96 }
Autodoc API documentation generated by ApiGen 2.8.0