Code Duplication    Length = 25-37 lines in 2 locations

src/controllers/AlldbController.php 1 location

@@ 215-239 (lines=25) @@
212
        $this->printNavLinks($navlinks, $this->table_place, get_defined_vars());
213
    }
214
215
    public function doTree()
216
    {
217
        $conf = $this->conf;
218
        $misc = $this->misc;
219
        $lang = $this->lang;
220
        $data = $misc->getDatabaseAccessor();
221
222
        $databases = $data->getDatabases();
223
224
        $reqvars = $misc->getRequestVars('database');
225
226
        //$this->prtrace($reqvars);
227
228
        $attrs = [
229
            'text'    => Decorator::field('datname'),
230
            'icon'    => 'Database',
231
            'toolTip' => Decorator::field('datcomment'),
232
            'action'  => Decorator::redirecturl('redirect.php', $reqvars, ['database' => Decorator::field('datname')]),
233
            'branch'  => Decorator::url('/src/views/database', $reqvars, ['action' => 'tree', 'database' => Decorator::field('datname')]),
234
235
        ];
236
237
        return $this->printTree($databases, $attrs, 'databases');
238
    }
239
240
    /**
241
     * Display a form for alter and perform actual alter.
242
     */

src/controllers/SchemasController.php 1 location

@@ 184-220 (lines=37) @@
181
    /**
182
     * Generate XML for the browser tree.
183
     */
184
    public function doTree()
185
    {
186
        $conf = $this->conf;
187
        $misc = $this->misc;
188
        $lang = $this->lang;
189
        $data = $misc->getDatabaseAccessor();
190
191
        $schemas = $data->getSchemas();
192
193
        $reqvars = $misc->getRequestVars('schema');
194
195
        //$this->prtrace($reqvars);
196
197
        $attrs = [
198
            'text'    => Decorator::field('nspname'),
199
            'icon'    => 'Schema',
200
            'toolTip' => Decorator::field('nspcomment'),
201
            'action'  => Decorator::redirecturl('redirect.php',
202
                $reqvars,
203
                [
204
                    'subject' => 'schema',
205
                    'schema'  => Decorator::field('nspname'),
206
                ]
207
            ),
208
            'branch'  => Decorator::url('schemas.php',
209
                $reqvars,
210
                [
211
                    'action' => 'subtree',
212
                    'schema' => Decorator::field('nspname'),
213
                ]
214
            ),
215
        ];
216
217
        $this->printTree($schemas, $attrs, 'schemas');
218
    }
219
220
    public function doSubTree()
221
    {
222
        $conf = $this->conf;
223
        $misc = $this->misc;