PHP Class PMA\libraries\navigation\NavigationTree

Mostrar archivo Open project: phpmyadmin/phpmyadmin Class Usage Examples

Public Methods

Method Description
__construct ( ) Initialises the class
groupNode ( Node $node ) : void Recursively groups tree nodes given a separator
groupTree ( mixed $node = null ) : void Recursively groups tree nodes given a separator
renderDbSelect ( ) : string Renders a database select box like the pre-4.0 navigation panel
renderPath ( ) : string Renders a part of the tree, used for Ajax requests in light mode
renderState ( ) : string Renders a state of the tree, used in light mode when either JavaScript and/or Ajax are disabled
sortNode ( Node $a, Node $b ) : integer Called by usort() for sorting the nodes in a container

Private Methods

Method Description
_addDbContainers ( NodeDatabase $db, string $type, integer $pos2 ) : array Adds containers to a node that is a database
_addTableContainers ( NodeTable $table, integer $pos2, string $type3, integer $pos3 ) : array Adds containers to a node that is a table
_buildPath ( ) : Node | false Generates the tree structure so that it can be rendered later
_buildPathPart ( array $path, string $type2, integer $pos2, string $type3, integer $pos3 ) : Node | false Builds a branch of the tree
_controls ( ) : string Creates the code for displaying the controls at the top of the navigation tree
_fastFilterHtml ( Node $node ) : string Generates the HTML code for displaying the fast filter for tables
_findTreeMatch ( array $tree, array $paths ) : boolean Finds whether given tree matches this tree.
_getNavigationDbPos ( ) : integer Returns the database position for the page selector
_getPageSelector ( Node $node ) : string Generates the HTML code for displaying the list pagination
_getPaginationParamsHtml ( Node $node ) : string Renders the parameters that are required on the client side to know which page(s) we will be requesting data from
_parsePath ( string $string ) : array Converts an encoded path to a node in string format to an array
_quickWarp ( ) : string Display quick warp links, contain Recents and Favorites
_renderNode ( Node $node, boolean $recursive, string $class = '' ) : string Renders a single node or a branch of the tree
_setVisibility ( ) : void Makes some nodes visible based on the which node is active

Method Details

__construct() public method

Initialises the class
public __construct ( )

groupNode() public method

Recursively groups tree nodes given a separator
public groupNode ( Node $node ) : void
$node PMA\libraries\navigation\nodes\Node The node to group
return void

groupTree() public method

Recursively groups tree nodes given a separator
public groupTree ( mixed $node = null ) : void
$node mixed The node to group or null to group the whole tree. If passed as an argument, $node must be of type CONTAINER
return void

renderDbSelect() public method

Renders a database select box like the pre-4.0 navigation panel
public renderDbSelect ( ) : string
return string HTML code

renderPath() public method

Renders a part of the tree, used for Ajax requests in light mode
public renderPath ( ) : string
return string HTML code for the navigation tree

renderState() public method

Renders a state of the tree, used in light mode when either JavaScript and/or Ajax are disabled
public renderState ( ) : string
return string HTML code for the navigation tree

sortNode() public static method

Called by usort() for sorting the nodes in a container
public static sortNode ( Node $a, Node $b ) : integer
$a PMA\libraries\navigation\nodes\Node The first element used in the comparison
$b PMA\libraries\navigation\nodes\Node The second element used in the comparison
return integer See strnatcmp() and strcmp()