Source for file BootstrapNotebookWrapper.php
Documentation is available at BootstrapNotebookWrapper.php
namespace
Adianti \
Wrapper ;
* Bootstrap datagrid decorator 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
$this -> decorated =
$notebook ;
$this -> properties =
array ( ) ;
$this -> divisions =
array ( 2 , 10 ) ;
* Redirect calls to decorated object
public function __call ( $method , $parameters )
* Redirect assigns to decorated object
public function __set ( $property , $value )
$this -> properties [ $property ] =
$value ;
* @param $direction Tabs direction (left right)
$this -> direction =
'tabs-' .
$direction ;
$this -> divisions =
$divisions ;
* Shows the decorated datagrid
$rendered =
$this -> decorated -> render ( ) ;
$rendered -> { 'role' } =
'tabpanel' ;
unset
( $rendered -> { 'class' } ) ;
$rendered -> { 'class' } =
'tabwrapper' ;
foreach ( $this -> properties as $property =>
$value )
$rendered -> $property =
$value ;
$sessions =
$rendered -> getChildren ( ) ;
foreach ( $sessions as $section )
if ( $section -> { 'class' } ==
'nav nav-tabs' )
$section -> { 'class' } =
"nav nav-tabs " .
$this -> direction ;
$section -> { 'class' } .=
" flex-column" ;
$section -> { 'role' } =
"tablist" ;
if ( $section -> { 'class' } ==
'spacer' )
$section -> { 'style' } =
"display:none" ;
if ( $section -> { 'class' } ==
'frame tab-content' )
$section -> { 'class' } =
'tab-content' ;
if ( $this -> direction ==
'tabs-left' )
$rendered -> clearChildren ( ) ;
$left_pack =
TElement :: tag ( 'div' , '' , array ( 'class' =>
'left-pack col-' .
$this -> divisions [ 0 ] , 'style' =>
'padding:0' )) ;
$right_pack =
TElement :: tag ( 'div' , '' , array ( 'class' =>
'right-pack col-' .
$this -> divisions [ 1 ] , 'style' =>
'padding-right:0; margin-right:0' )) ;
$rendered -> add ( $left_pack ) ;
$rendered -> add ( $right_pack ) ;
$right_pack -> add ( $panel ) ;
else if ( $this -> direction ==
'tabs-right' )
$rendered -> clearChildren ( ) ;
$left_pack =
TElement :: tag ( 'div' , '' , array ( 'class' =>
'left-pack col-' .
$this -> divisions [ 1 ] )) ;
$right_pack =
TElement :: tag ( 'div' , '' , array ( 'class' =>
'right-pack col-' .
$this -> divisions [ 0 ] )) ;
$rendered -> add ( $left_pack ) ;
$rendered -> add ( $right_pack ) ;
if ( ! empty ( $this -> direction ))
$rendered -> { 'style' } .=
';display: flex' ;