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

  • Actionbar
  • ActionbarContextual
  • ActionbarNav
  • ActionbarNew
  • ActionbarSearch
  • ActionbarTitle
  • ActionbarToolbar
  • AdminMenu
  • Form
  • Group
  • Navigation
  • SiteMenu
  • UserMenu
 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\Element;
13 
14 class Group extends \Brickrouge\Group
15 {
16     public function __construct(array $attributes=array())
17     {
18         parent::__construct($attributes);
19 
20         $this->tag_name = 'div';
21         $this->add_class('group');
22         $this->add_class('clearfix');
23     }
24 
25     protected function render_group_legend($legend)
26     {
27         return '<div class="group-legend">' . $legend . '</div>';
28     }
29 
30     /**
31      * Adds the `enabled` class name if the element has the `group-toggler` class name and a
32      * checked checkbox child.
33      */
34     protected function render_class(array $class_names)
35     {
36         if (!empty($class_names['group-toggler']))
37         {
38             foreach ($this->children as $child)
39             {
40                 if ($child->tag_name == 'input' && $child['type'] == 'checkbox')
41                 {
42                     if ($child['checked'])
43                     {
44                         $class_names['enabled'] = true;
45 
46                         break;
47                     }
48                 }
49             }
50         }
51 
52         return parent::render_class($class_names);
53     }
54 }
Autodoc API documentation generated by ApiGen 2.8.0