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 ICanBoogie\I18n;
15 use ICanBoogie\Operation;
16 
17 use Brickrouge\Element;
18 
19 class GalleryBlock extends ManageBlock
20 {
21     static protected function add_assets(\Brickrouge\Document $document)
22     {
23         parent::add_assets($document);
24 
25         $document->css->add('gallery.css');
26     }
27 
28     public function __construct($module, array $tags=array())
29     {
30         parent::__construct
31         (
32             $module, $tags + array
33             (
34                 self::T_ORDER_BY => 'title',
35                 self::T_BLOCK => 'gallery'
36             )
37         );
38     }
39 
40     protected function resolve_options($name, array $modifiers)
41     {
42         return parent::resolve_options($name . '/gallery', $modifiers);
43     }
44 
45     protected function render_body()
46     {
47         global $core;
48 
49         $rendered_columns_cells = $this->render_columns_cells($this->columns);
50         $rows = $this->columns_to_rows($rendered_columns_cells);
51 
52         $html = '';
53 
54         foreach ($rows as $i => $row)
55         {
56             $record = $this->records[$i];
57             $title =  $record->title;
58 
59             $label = new Element
60             (
61                 'a', array
62                 (
63                     Element::INNER_HTML => \ICanBoogie\escape($title),
64 
65                     'class' => 'goto-edit',
66                     'title' => I18n\t('Edit this item'),
67                     'href' => \ICanBoogie\Routing\contextualize("/admin/{$record->constructor}/{$record->nid}/edit")
68                 )
69             );
70 
71             $img = $record->thumbnail('$gallery')->to_element(array(
72 
73                 'title' => $title,
74                 'alt' => $title
75 
76             ));
77 
78             $html .= <<<EOT
79 <div class="thumbnailer-wrapper" data-key="{$record->nid}" style="width: 128px;">
80     <a href="{$record->path}" rel="lightbox[]">$img</a>
81     $label
82 </div>
83 EOT;
84         }
85 
86         $colspan = count($this->columns) + 1;
87 
88         return <<<EOT
89 <tr id="gallery">
90     <td colspan="{$colspan}" class="gallery-inner">
91         <div class="gallery-contents">$html</div>
92     </td>
93 </tr>
94 EOT;
95     }
96 }
Autodoc API documentation generated by ApiGen 2.8.0