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

  • CoreConfigRequirement
  • DatabaseForm
  • DatabaseOperation
  • DocumentDecorator
  • InstallForm
  • InstallOperation
  • InstallRequirements
  • LanguageElement
  • Operation
  • PanelDecorator
  • PanelForm
  • PDODriversRequirement
  • RepositoryRequirement
  • Requirement
  • Requirements
  • RequirementsOperation
  • SiteForm
  • SiteOperation
  • StepsController
  • TellMeMore
  • UserConfigRequirement
  • UserForm
  • UserOperation
  • WelcomePanel
  • WelcomeRequirements

Functions

  • t
 1 <?php
 2 
 3 /*
 4  * This file is part of the Icybee/Installer 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\Installer;
13 
14 use Brickrouge\Element;
15 
16 /**
17  * Decorates component with an install panel.
18  */
19 class PanelDecorator
20 {
21     const TITLE = '#panel-title';
22     const DESCRIPTION = '#panel-description';
23 
24     /**
25      * Component to decorate.
26      *
27      * @var Element
28      */
29     protected $component;
30 
31     public function __construct(Element $component)
32     {
33         $this->component = $component;
34     }
35 
36     public function __toString()
37     {
38         try
39         {
40             return $this->render();
41         }
42         catch (\Exception $e)
43         {
44             return \Brickrouge\render_exception($e);
45         }
46     }
47 
48     public function render()
49     {
50         global $core;
51 
52         $panel = new Element
53         (
54             'div', array
55             (
56                 'class' => 'install-panel'
57             )
58         );
59 
60         $component = $this->component;
61         $rendered_component = (string) $component;
62         $content = '';
63         $name = $component['name'];
64         $title = $component[self::TITLE];
65         $description = $component[self::DESCRIPTION];
66 
67         if ($rendered_component)
68         {
69             $content = '<div class="install-panel-content">' . $rendered_component . '</div>';
70         }
71         else
72         {
73             $panel->add_class('no-content');
74         }
75 
76         if ($name)
77         {
78             $panel['id'] = "panel-$name";
79             $panel->add_class("install-panel--$name");
80         }
81 
82         if (!empty($core->session->install['done'][$name]))
83         {
84             $panel->add_class('done');
85         }
86 
87         $panel[Element::INNER_HTML] = <<<EOT
88 <div class="install-panel-inner">
89     <h3 class="install-panel-title">$title</h3>
90     <div class="install-panel-description">$description</div>
91     $content
92 </div>
93 EOT;
94 
95         return (string) $panel;
96     }
97 }
Autodoc API documentation generated by ApiGen 2.8.0