コード例 #1
0
 /**
  * Renders the navigation tree, or part of it
  *
  * @return string The navigation tree
  */
 public function getDisplay()
 {
     /* Init */
     $retval = '';
     if (!PMA_Response::getInstance()->isAjax()) {
         $header = new PMA_NavigationHeader();
         $retval = $header->getDisplay();
     }
     $tree = new PMA_NavigationTree();
     if (!PMA_Response::getInstance()->isAjax() || !empty($_REQUEST['full']) || !empty($_REQUEST['reload'])) {
         $treeRender = $tree->renderState();
     } else {
         $treeRender = $tree->renderPath();
     }
     if (!$treeRender) {
         $retval .= PMA_Message::error(__('An error has occurred while loading the navigation tree'))->getDisplay();
     } else {
         $retval .= $treeRender;
     }
     if (!PMA_Response::getInstance()->isAjax()) {
         // closes the tags that were opened by the navigation header
         $retval .= '</div>';
         $retval .= '</div>';
         $retval .= $this->_getDropHandler();
         $retval .= '</div>';
     }
     return $retval;
 }
コード例 #2
0
 /**
  * Renders the navigation tree, or part of it
  *
  * @return string The navigation tree
  */
 public function getDisplay()
 {
     /* Init */
     $retval = '';
     if (!PMA_Response::getInstance()->isAjax()) {
         $header = new PMA_NavigationHeader();
         $retval = $header->getDisplay();
     }
     $tree = new PMA_NavigationTree();
     if (!PMA_Response::getInstance()->isAjax() || !empty($_REQUEST['full']) || !empty($_REQUEST['reload'])) {
         if ($GLOBALS['cfg']['ShowDatabasesNavigationAsTree']) {
             // provide database tree in navigation
             $navRender = $tree->renderState();
         } else {
             // provide legacy pre-4.0 navigation
             $navRender = $tree->renderDbSelect();
         }
     } else {
         $navRender = $tree->renderPath();
     }
     if (!$navRender) {
         $retval .= PMA_Message::error(__('An error has occurred while loading the navigation display'))->getDisplay();
     } else {
         $retval .= $navRender;
     }
     if (!PMA_Response::getInstance()->isAjax()) {
         // closes the tags that were opened by the navigation header
         $retval .= '</div>';
         // pma_navigation_tree
         $retval .= '<div id="pma_navi_settings_container">';
         if (!defined('PMA_DISABLE_NAVI_SETTINGS')) {
             $retval .= PMA_PageSettings::getNaviSettings();
         }
         $retval .= '</div>';
         //pma_navi_settings_container
         $retval .= '</div>';
         // pma_navigation_content
         $retval .= $this->_getDropHandler();
         $retval .= '</div>';
         // pma_navigation
     }
     return $retval;
 }
コード例 #3
0
 /**
  * Very basic path rendering test.
  *
  * @return void
  */
 public function testRenderPath()
 {
     $result = $this->object->renderPath();
     $this->assertContains('list_container', $result);
 }