Upgraded phpmyadmin to 4.0.4 (All Languages) - No modifications yet
[openemr.git] / phpmyadmin / libraries / navigation / Navigation.class.php
blobd140bbc33a18fbeb0aece930a98e7272a1292faf
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * This class is responsible for instanciating
5 * the various components of the navigation panel
7 * @package PhpMyAdmin-navigation
8 */
9 if (! defined('PHPMYADMIN')) {
10 exit;
13 require_once 'libraries/navigation/NodeFactory.class.php';
14 require_once 'libraries/navigation/NavigationHeader.class.php';
15 require_once 'libraries/navigation/NavigationTree.class.php';
17 /**
18 * The navigation panel - displays server, db and table selection tree
20 * @package PhpMyAdmin-Navigation
22 class PMA_Navigation
24 /**
25 * Initialises the class
27 * @return void
29 public function __construct()
31 if (empty($GLOBALS['token'])) {
32 $GLOBALS['token'] = $_SESSION[' PMA_token '];
36 /**
37 * Renders the navigation tree, or part of it
39 * @return string The navigation tree
41 public function getDisplay()
43 /* Init */
44 $retval = '';
45 if (! PMA_Response::getInstance()->isAjax()) {
46 $header = new PMA_NavigationHeader();
47 $retval = $header->getDisplay();
49 $tree = new PMA_NavigationTree();
50 if (! PMA_Response::getInstance()->isAjax()
51 || ! empty($_REQUEST['full'])
52 || ! empty($_REQUEST['reload'])
53 ) {
54 $treeRender = $tree->renderState();
55 } else {
56 $treeRender = $tree->renderPath();
59 if (! $treeRender) {
60 $retval .= PMA_Message::error(
61 __('An error has occured while loading the navigation tree')
62 )->getDisplay();
63 } else {
64 $retval .= $treeRender;
67 if (! PMA_Response::getInstance()->isAjax()) {
68 // closes the tags that were opened by the navigation header
69 $retval .= '</div>';
70 $retval .= '</div>';
71 $retval .= '</div>';
74 return $retval;