Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/HuasoFoundries/phpPgAdmin6.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelipe Figueroa <amenadiel@gmail.com>2018-03-24 02:23:42 +0300
committerFelipe Figueroa <amenadiel@gmail.com>2018-03-24 02:23:42 +0300
commit57b3703e844f72992a231cc58d97e8b4ed92366e (patch)
treeefd58d72dd35452991a7503cbccbf6137e0be556 /src/controllers/SqleditController.php
parent5339049e53ee0616918e222e7cb89fc9ef41dd0b (diff)
add root element for jstree
Diffstat (limited to 'src/controllers/SqleditController.php')
-rw-r--r--src/controllers/SqleditController.php23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/controllers/SqleditController.php b/src/controllers/SqleditController.php
index 82fee456..6793a8f5 100644
--- a/src/controllers/SqleditController.php
+++ b/src/controllers/SqleditController.php
@@ -6,6 +6,8 @@
namespace PHPPgAdmin\Controller;
+use PHPPgAdmin\Decorators\Decorator;
+
/**
* Base controller class.
*
@@ -28,6 +30,10 @@ class SqleditController extends BaseController
$action = $this->action;
+ if ('tree' == $action) {
+ return $this->doTree();
+ }
+
switch ($action) {
case 'find':
$title = $this->lang['strfind'];
@@ -133,6 +139,23 @@ class SqleditController extends BaseController
return $default_html;
}
+ public function doTree()
+ {
+
+ $treedata = new \PHPPgAdmin\ArrayRecordSet([]);
+ $reqvars = [];
+
+ $attrs = [
+ 'text' => 'Servers',
+ 'icon' => 'Servers',
+ 'root' => 'true',
+ 'action' => Decorator::url('/src/views/servers'),
+ 'branch' => Decorator::url('/src/views/servers', $reqvars, ['action' => 'tree']),
+ ];
+
+ return $this->printTree($treedata, $attrs, 'server');
+ }
+
/**
* Private function to display server and list of databases.
*