diff options
author | Felipe Figueroa <amenadiel@gmail.com> | 2021-11-25 06:08:15 +0300 |
---|---|---|
committer | Felipe Figueroa <amenadiel@gmail.com> | 2021-11-25 06:08:15 +0300 |
commit | b74660b55e38fd359732a441eb14652dec65e067 (patch) | |
tree | 816dcba16c6356bf8fa5c312714def4eecb75fd9 /src/controllers/BrowserController.php | |
parent | f7b0193500faec8da57a29e907d9cf445b8356a8 (diff) |
Diffstat (limited to 'src/controllers/BrowserController.php')
-rw-r--r-- | src/controllers/BrowserController.php | 86 |
1 files changed, 0 insertions, 86 deletions
diff --git a/src/controllers/BrowserController.php b/src/controllers/BrowserController.php deleted file mode 100644 index 64fadb58..00000000 --- a/src/controllers/BrowserController.php +++ /dev/null @@ -1,86 +0,0 @@ -<?php - -/** - * PHPPgAdmin6 - */ - -namespace PHPPgAdmin\Controller; - -use PHPPgAdmin\ArrayRecordSet; -use PHPPgAdmin\Decorators\Decorator; - -/** - * Base controller class. - */ -class BrowserController extends BaseController -{ - protected $no_db_connection = true; - - /** - * Default method to render the controller according to the action parameter. - * - * @param null|mixed $action - * - * @return string - */ - public function render($action = null) - { - if (null === $action) { - $action = $this->action; - } - - switch ($action) { - case 'tree': - return $this->doTree(); - - break; - - default: - return $this->doDefault(); - - break; - } - } - - /** - * Default method to render the browser iframe using jstree. - * - * @return string rendered html of the jstree template - */ - public function doDefault() - { - $this->misc->setNoDBConnection(true); - - $this->setNoBottomLink(true); - - $viewVars = ['icon' => [ - 'Refresh' => $this->view->icon('Refresh'), - 'Servers' => $this->view->icon('Servers'), - ]]; - - return $this->view->fetch('browser.twig', $viewVars); - } - - /** - * Renders the root element of the jstree. - * - * @return string json representation of the root element of the jstree - */ - public function doTree() - { - $treedata = new ArrayRecordSet([]); - $reqvars = []; - $action = Decorator::url('/src/views/servers'); - $branch = Decorator::url('/src/views/servers', $reqvars, ['action' => 'tree']); - // $this->dump($branch); - $attrs = [ - 'text' => 'Servers', - 'icon' => 'Servers', - 'is_root' => 'true', - 'action' => $action, - 'branch' => $branch, - ]; - - return $this->printTree($treedata, $attrs, 'server'); - } -} |