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 use Brickrouge\Element;
15 
16 class AdjustImage extends \Brickrouge\Widget\AdjustNode
17 {
18     static protected function add_assets(\Brickrouge\Document $document)
19     {
20         parent::add_assets($document);
21 
22         $document->css->add(DIR . 'public/module.css');
23         $document->js->add(DIR . 'public/module.js');
24     }
25 
26     public function __construct(array $attributes=array())
27     {
28         parent::__construct
29         (
30             $attributes + array
31             (
32                 self::T_CONSTRUCTOR => 'images',
33                 self::WIDGET_CONSTRUCTOR => 'AdjustImage',
34 
35                 'data-adjust' => 'adjust-image'
36             )
37         );
38     }
39 
40     /**
41      * Adds the `widget-adjust-image` class name.
42      */
43     protected function alter_class_names(array $class_names)
44     {
45         return parent::alter_class_names($class_names) + array
46         (
47             'widget-adjust-image' => true
48         );
49     }
50 
51     /**
52      * Because a 4x4 grid is used, `$limit` defaults to 16.
53      */
54     protected function get_records($constructor, array $options, $limit=16)
55     {
56         return parent::get_records($constructor, $options, $limit);
57     }
58 
59     protected function render_record(\Icybee\Modules\Nodes\Node $record, $selected, array $range, array $options)
60     {
61         $nid = $record->nid;
62 
63         return $record->thumbnail('$icon-m')->to_element
64         (
65             array
66             (
67                 'alt' => $record->alt,
68                 'title' => $record->title,
69 
70                 'data-nid' => $nid,
71                 'data-popover-image' => $record->thumbnail('$popover')->url,
72                 'data-popover-target' => '.widget-adjust-image',
73                 'data-title' => $record->title,
74                 'data-path' => $record->path
75             )
76         );
77     }
78 
79     /**
80      * Defaults constructor to `images`.
81      */
82     public function get_results(array $options=array(), $constructor='images')
83     {
84         return parent::get_results($options, $constructor);
85     }
86 }
87 
88 namespace Brickrouge\Widget;
89 
90 class AdjustImage extends \Icybee\Modules\Images\AdjustImage
91 {
92 
93 }
Autodoc API documentation generated by ApiGen 2.8.0