Source for file TPanelGroup.php
Documentation is available at TPanelGroup.php
namespace
Adianti \
Widget \
Container ;
* Bootstrap native panel for Adianti Framework
* @author Pablo Dall'Oglio
* @copyright Copyright (c) 2006 Adianti Solutions Ltd. (http://www.adianti.com.br)
* @license http://www.adianti.com.br/framework-license
private $actionsContainer ;
* Static creator for panels
* @param $title Panel title
* @param $element Panel content
public static function pack ( $title , $element , $footer =
null )
$panel =
new self ( $title ) ;
$panel -> addFooter ( $footer ) ;
* @param $title Panel Title
* @param $footer Panel Footer
public function __construct ( $title =
NULL , $background =
NULL )
$this -> { 'class' } =
'card panel' ;
$this -> head -> { 'class' } =
'card-header panel-heading' ;
$this -> head -> { 'style' } =
'display:none' ;
parent :: add ( $this -> head ) ;
$panel_title -> { 'class' } =
'card-title panel-title' ;
$this -> head -> add ( $panel_title ) ;
$this -> title -> { 'style' } =
'width: 100%' ;
$this -> title -> add ( $title ) ;
$panel_title -> add ( $this -> title ) ;
$this -> head -> { 'style' } .=
';background:' .
$background ;
$this -> actionsContainer =
new TElement ( 'div' ) ;
$this -> actionsContainer -> { 'style' } =
'margin-left: auto' ;
$this -> head -> add ( $this -> actionsContainer ) ;
$this -> head -> { 'style' } =
str_replace ( 'display:none' , '' , $this -> head -> { 'style' } ) ;
$this -> body -> { 'class' } =
'card-body panel-body' ;
parent :: add ( $this -> body ) ;
$this -> footer -> { 'class' } =
'card-footer panel-footer' ;
$this -> title -> add ( $title ) ;
* Add a form header action
* @param $label Button label
* @param $action Button action
* @param $icon Button icon
$this -> head -> { 'style' } =
str_replace ( 'display:none' , '' , $this -> head -> { 'style' } ) ;
$this -> title -> { 'style' } =
'display:inline-block;' ;
$label_info =
( $label instanceof
TLabel ) ?
$label -> getValue ( ) :
$label ;
$button =
new TActionLink ( $label_info , $action , null , null , null , $icon ) ;
$button -> { 'class' } =
'btn btn-sm btn-default' ;
$this -> actionsContainer -> add ( $button ) ;
* Add a form header widget
$this -> head -> { 'style' } =
str_replace ( 'display:none' , '' , $this -> head -> { 'style' } ) ;
$this -> title -> { 'style' } =
'display:inline-block;' ;
$this -> actionsContainer -> add ( $widget ) ;
public function add ( $content )
$this -> body -> add ( $content ) ;
$buttons =
$content -> detachActionButtons ( ) ;
foreach ( $buttons as $button )
$this -> footer -> add ( $button ) ;
parent :: add ( $this -> footer ) ;
$this -> footer -> add ( $footer ) ;
parent :: add ( $this -> footer ) ;