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

  • CacheManager
  • ConfigBlock
  • ConfigOperation
  • Content
  • DeleteBlock
  • EditBlock
  • HomeExcludeOperation
  • HomeIncludeOperation
  • Hooks
  • ManageBlock
  • Model
  • Module
  • Rendered
  • SaveOperation
  • Update20140330
  • ViewProvider

Traits

  • DateProperty
  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\Contents;
 13 
 14 class ManageBlock extends \Icybee\Modules\Nodes\ManageBlock
 15 {
 16     static protected function add_assets(\Brickrouge\Document $document)
 17     {
 18         parent::add_assets($document);
 19 
 20         $document->css->add(DIR . 'public/admin.css');
 21         $document->js->add(DIR . 'public/admin.js');
 22     }
 23 
 24     public function __construct(Module $module, array $attributes=[])
 25     {
 26         parent::__construct
 27         (
 28             $module, $attributes + [
 29 
 30                 self::T_COLUMNS_ORDER => [
 31 
 32                     'title', 'url', 'is_home_excluded', 'is_online', 'uid', 'date', 'updated_at'
 33                 ],
 34 
 35                 self::T_ORDER_BY => [ 'date', 'desc' ]
 36             ]
 37         );
 38     }
 39 
 40     /**
 41      * Adds the following columns:
 42      *
 43      * - `date`: An instance of {@link \Icybee\ManageBlock\DateColumn}.
 44      * - `is_home_excluded`: An instance of {@link ManageBlock\IsHomeExcludedColumn}.
 45      *
 46      * @return array
 47      */
 48     protected function get_available_columns()
 49     {
 50         return array_merge(parent::get_available_columns(), [
 51 
 52             'date' => 'Icybee\ManageBlock\DateColumn',
 53             'is_home_excluded' => __CLASS__ . '\IsHomeExcludedColumn'
 54         ]);
 55     }
 56 }
 57 
 58 namespace Icybee\Modules\Contents\ManageBlock;
 59 
 60 use Brickrouge\Element;
 61 
 62 /**
 63  * Representation of the `is_home_excluded` column.
 64  */
 65 class IsHomeExcludedColumn extends \Icybee\ManageBlock\BooleanColumn
 66 {
 67     public function __construct(\Icybee\ManageBlock $manager, $id, array $options=[])
 68     {
 69         parent::__construct
 70         (
 71             $manager, $id, $options + [
 72 
 73                 'filters' => [
 74 
 75                     'options' => [
 76 
 77                         '=1' => "Excluded from home",
 78                         '=0' => "Included in home"
 79                     ]
 80                 ],
 81 
 82                 'cell_renderer' => __NAMESPACE__ . '\IsHomeExcludedCellRenderer'
 83             ]
 84         );
 85     }
 86 }
 87 
 88 /**
 89  * Renderer for the `is_home_excluded` column cell.
 90  */
 91 class IsHomeExcludedCellRenderer extends \Icybee\ManageBlock\BooleanCellRenderer
 92 {
 93     /**
 94      * Returns a _boolean_ element representing a little house.
 95      *
 96      * @return \Brickrouge\Element
 97      */
 98     public function __invoke($record, $property)
 99     {
100         return new Element('i', [
101 
102             'class' => 'icon-home trigger ' . ($record->$property ? 'on' : ''),
103             'data-nid' => $record->nid,
104             'title' => "Include or exclude the record from the view 'home'"
105         ]);
106     }
107 }
Autodoc API documentation generated by ApiGen 2.8.0