Source for file TExpander.php
Documentation is available at TExpander.php
namespace
Adianti \
Widget \
Container ;
* @author Pablo Dall'Oglio
* @copyright Copyright (c) 2006 Adianti Solutions Ltd. (http://www.adianti.com.br)
* @license http://www.adianti.com.br/framework-license
* @param $value text label
$this -> { 'id' } =
'texpander_' .
mt_rand ( 1000000000 , 1999999999 ) ;
$this -> { 'class' } =
'dropdown' ;
$this -> button -> { 'class' } =
'btn btn-default dropdown-toggle' ;
$this -> button -> { 'type' } =
'button' ;
$this -> button -> { 'id' } =
'button_' .
mt_rand ( 1000000000 , 1999999999 ) ;
$this -> button -> { 'data-toggle' } =
'dropdown' ;
$this -> container -> { 'class' } =
'dropdown-menu texpander-container' ;
$this -> container -> { 'aria-labelledby' } =
$this -> button -> { 'id' } ;
parent :: add ( $this -> button ) ;
parent :: add ( $this -> container ) ;
* @caret_side Caret side (left, right)
$this -> caret_side =
$caret_side ;
$this -> container -> { 'class' } =
" dropdown-menu texpander-container pull-{$side } " ;
* Define a button property
* @param $property Property name (Ex: style)
* @param $value Property value
$this -> button -> $property =
$value ;
* Define a container property
* @param $property Property name (Ex: style)
* @param $value Property value
$this -> container -> $property =
$value ;
* Add content to the expander
* @param $content Any Object that implements show() method
public function add ( $content )
$this -> container -> add ( $content ) ;
if ( $this -> caret_side ==
'left' )
$this -> button -> add ( TElement :: tag ( 'span' , '' , array ( 'class' =>
'caret' ))) ;
$this -> button -> add ( $this -> label ) ;
else if ( $this -> caret_side ==
'right' )
$this -> button -> add ( $this -> label ) ;
$this -> button -> add ( ' ' ) ;
$this -> button -> add ( TElement :: tag ( 'span' , '' , array ( 'class' =>
'caret' ))) ;
$this -> button -> add ( $this -> label ) ;