Code Duplication    Length = 25-33 lines in 2 locations

src/controllers/DatabaseController.php 1 location

@@ 114-138 (lines=25) @@
111
        $this->printFooter(true, $footer_template);
112
    }
113
114
    public function doTree($print = true)
115
    {
116
        $conf = $this->conf;
117
        $misc = $this->misc;
118
        $lang = $this->lang;
119
120
        $data = $misc->getDatabaseAccessor();
121
122
        $reqvars = $misc->getRequestVars('database');
123
124
        $tabs = $misc->getNavTabs('database');
125
126
        $items = $this->adjustTabsForTree($tabs);
127
128
        $attrs = [
129
            'text'   => Decorator::field('title'),
130
            'icon'   => Decorator::field('icon'),
131
            'action' => Decorator::actionurl(Decorator::field('url'), $reqvars, Decorator::field('urlvars', [])),
132
            'branch' => Decorator::url(Decorator::field('url'), $reqvars, Decorator::field('urlvars'), ['action' => 'tree']),
133
        ];
134
135
        return $this->printTree($items, $attrs, 'database', $print);
136
    }
137
138
    /**
139
     * Sends a signal to a process
140
     */
141
    public function doSignal()

src/controllers/SchemasController.php 1 location

@@ 220-252 (lines=33) @@
217
        $this->printTree($schemas, $attrs, 'schemas');
218
    }
219
220
    public function doSubTree()
221
    {
222
        $conf = $this->conf;
223
        $misc = $this->misc;
224
        $lang = $this->lang;
225
        $data = $misc->getDatabaseAccessor();
226
227
        $tabs = $misc->getNavTabs('schema');
228
229
        $items = $this->adjustTabsForTree($tabs);
230
231
        $reqvars = $misc->getRequestVars('schema');
232
233
        //$this->prtrace($reqvars);
234
235
        $attrs = [
236
            'text'   => Decorator::field('title'),
237
            'icon'   => Decorator::field('icon'),
238
            'action' => Decorator::actionurl(Decorator::field('url'),
239
                $reqvars,
240
                Decorator::field('urlvars', [])
241
            ),
242
            'branch' => Decorator::url(Decorator::field('url'),
243
                $reqvars,
244
                Decorator::field('urlvars'),
245
                ['action' => 'tree']
246
            ),
247
        ];
248
249
        $this->printTree($items, $attrs, 'schema');
250
    }
251
252
    /**
253
     * Displays a screen where they can enter a new schema
254
     */
255
    public function doCreate($msg = '')