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

  • A
  • Actions
  • Alert
  • AlterCSSClassNamesEvent
  • AssetsCollector
  • Button
  • CSSCollector
  • Dataset
  • Date
  • DateRange
  • DateTime
  • Decorator
  • Document
  • DropdownMenu
  • Element
  • File
  • Form
  • Group
  • Helpers
  • HTMLString
  • Iterator
  • JSCollector
  • ListView
  • ListViewColumn
  • Modal
  • Pager
  • Popover
  • PopoverWidget
  • Ranger
  • RecursiveIterator
  • Salutation
  • Searchbox
  • Section
  • SplitButton
  • Text
  • Widget

Interfaces

  • CSSClassNames
  • DecoratorInterface
  • HTMLStringInterface
  • Validator

Traits

  • CSSClassNamesProperty

Exceptions

  • ElementIsEmpty

Functions

  • _array_flatten_callback
  • array_flatten
  • array_insert
  • check_session
  • dump
  • escape
  • escape_all
  • format
  • format_size
  • get_accessible_file
  • get_document
  • normalize
  • render_css_class
  • render_exception
  • retrieve_form
  • retrieve_form_errors
  • shorten
  • stable_sort
  • store_form
  • store_form_errors
  • strip
  • t
  1 <?php
  2 
  3 namespace Brickrouge;
  4 
  5 class Modal extends Element
  6 {
  7     const ACTIONS = '#modal-actions';
  8 
  9     static protected function add_assets(Document $document)
 10     {
 11         $document->js->add('modal.js');
 12     }
 13 
 14     public function __construct(array $attributes=array())
 15     {
 16         parent::__construct('div', $attributes);
 17     }
 18 
 19     protected function alter_class_names(array $class_names)
 20     {
 21         return parent::alter_class_names($class_names) + array
 22         (
 23             'modal' => true,
 24             'hide' => true,
 25             'fade' => true
 26         );
 27     }
 28 
 29     protected function render_inner_html()
 30     {
 31         $html = '';
 32 
 33         $header = $this->render_modal_header();
 34 
 35         if ($header)
 36         {
 37             $header = '<h3>' . $header . '</h3>';
 38         }
 39 
 40         $html .= <<<EOT
 41 <div class="modal-header">
 42     <button class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
 43     {$header}
 44 </div>
 45 EOT;
 46 
 47         $body = $this->render_modal_body();
 48 
 49         if ($body === null)
 50         {
 51             throw new ElementIsEmpty();
 52         }
 53 
 54         $html .= <<<EOT
 55 <div class="modal-body">
 56     {$body}
 57 </div>
 58 EOT;
 59 
 60         $footer = $this->render_modal_footer();
 61 
 62         if ($footer)
 63         {
 64             $html .= <<<EOT
 65 <div class="modal-footer">
 66     {$footer}
 67 </div>
 68 EOT;
 69         }
 70 
 71         return $html;
 72     }
 73 
 74     protected function decorate_with_legend($html, $legend)
 75     {
 76         return $html;
 77     }
 78 
 79     protected function render_modal_header()
 80     {
 81         return $this[self::LEGEND];
 82     }
 83 
 84     protected function render_modal_body()
 85     {
 86         return parent::render_inner_html();
 87     }
 88 
 89     protected function render_modal_footer()
 90     {
 91         $actions = $this[self::ACTIONS];
 92 
 93         if ($actions && !($actions instanceof Actions))
 94         {
 95             $actions = new Actions($actions);
 96         }
 97 
 98         return $actions;
 99     }
100 }
101 
Autodoc API documentation generated by ApiGen 2.8.0