Completed
Push — master ( a4e09c...825da9 )
by Michael
01:51
created

Tree::_makePagesUserTree()   F

Complexity

Conditions 16
Paths 582

Size

Total Lines 101
Code Lines 41

Duplication

Lines 5
Ratio 4.95 %

Importance

Changes 0
Metric Value
cc 16
eloc 41
nc 582
nop 5
dl 5
loc 101
rs 2.5045
c 0
b 0
f 0

How to fix   Long Method    Complexity   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php namespace Xoopsmodules\instruction;
2
3
// Автор: andrey3761
4
// Вывод древообразного списка страниц в панели администрирования
5
6
//defined('XOOPS_ROOT_PATH') || exit('Restricted access');
0 ignored issues
show
Unused Code Comprehensibility introduced by
75% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
7
define('INST_DIRNAME', basename(dirname(__DIR__)));
8
9
include_once $GLOBALS['xoops']->path('include/common.php');
10
// Подключаем трей
11
include_once $GLOBALS['xoops']->path('class/tree.php');
12
13
// Наследник класса XoopsObjectTree
14
15
/**
16
 * Class Tree
17
 * @package Xoopsmodules\instruction
18
 */
19
class Tree extends \XoopsObjectTree
20
{
21
    //    public function __construct()
0 ignored issues
show
Unused Code Comprehensibility introduced by
50% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
22
    //    {
23
    //    }
24
25
    /**
26
     * @param        $key
27
     * @param        $ret
28
     * @param        $prefix_orig
29
     * @param        $objInsinstr
30
     * @param string $class
31
     * @param string $prefix_curr
32
     */
33
    public function _makePagesAdminOptions($key, &$ret, $prefix_orig, $objInsinstr, $class = 'odd', $prefix_curr = '')
34
    {
35
        if ($key > 0) {
36
37
            //
38
            $class = ('even' === $class) ? 'odd' : 'even';
39
            // ID инструкции ( Можно сделать статической )
40
            $instrid = $objInsinstr->getVar('instrid');
41
42
            // ID страницы
43
            $pageid = $this->tree[$key]['obj']->getVar('pageid');
44
            // Название страницы
45
            $pagetitle = $this->tree[$key]['obj']->getVar('title');
46
            // Вес
47
            $pageweight = $this->tree[$key]['obj']->getVar('weight');
48
            // Статус
49
            $pagestatus = $this->tree[$key]['obj']->getVar('status');
50
            // Тип страницы
51
            $pagetype = $this->tree[$key]['obj']->getVar('type');
52
53
            // Дочернии страницы
54
            $page_childs = $this->getAllChild($pageid);
55
            // Число дочерних страниц
56
            $num_childs = count($page_childs);
57
58
            // Действие - удаление
59
            $act_del = ($num_childs > 0) ? '<img src="../assets/icons/no_delete_mini.png" alt="' . _AM_INSTR_NODELPAGE . '" title="' . _AM_INSTR_NODELPAGE . '" />' : '<a href="instr.php?op=delpage&pageid='
60
                                                                                                                                                                      . $pageid
61
                                                                                                                                                                      . '"><img src="../assets/icons/delete_mini.png" alt="'
62
                                                                                                                                                                      . _AM_INSTRUCTION_DEL
63
                                                                                                                                                                      . '" title="'
64
                                                                                                                                                                      . _AM_INSTRUCTION_DEL
65
                                                                                                                                                                      . '"></a>';
66
            //
67
            $page_link = '<a name="pageid_' . $pageid . '" ' . ($pagetype ? 'href="' . XOOPS_URL . '/modules/' . INST_DIRNAME . '/page.php?id=' . $pageid . '#pagetext"' : '') . '>' . $pagetitle . '</a>';
68
69
            $ret .= '<tr class="' . $class . '">
70
      <td>' . $prefix_curr . ' ' . $page_link . '</td>
71
      <td align="center" width="50">
72
        <input type="text" name="weights[]" size="2" value="' . $pageweight . '" />
73
        <input type="hidden" name="pageids[]" value="' . $pageid . '" />
74
      </td>
75
      <td align="center" width="180">';
76
            // Просмотре без кэша
77
            $ret .= ' <a href="' . XOOPS_URL . '/modules/' . INST_DIRNAME . '/page.php?id=' . $pageid . '&amp;nocache=1"><img src="../assets/icons/no_cache.png" alt="' . _AM_INSTR_DISPLAY_NOCACHE . '" title="' . _AM_INSTR_DISPLAY_NOCACHE . '" /></a> ';
78
            // Добавить подстраницу
79
            $ret .= ' <a href="instr.php?op=editpage&instrid=' . $instrid . '&pid=' . $pageid . '"><img src="../assets/icons/add_mini.png" alt="' . _AM_INSTRUCTION_ADDSUBPAGE . '" title="' . _AM_INSTRUCTION_ADDSUBPAGE . '" /></a> ';
80
81
            if ($pagestatus) {
82
                $ret .= ' <img src="../assets/icons/lock_mini.png" alt="' . _AM_INSTRUCTION_LOCK . '" title="' . _AM_INSTRUCTION_LOCK . '"> ';
83
            } else {
84
                $ret .= ' <img src="../assets/icons/unlock_mini.png" alt="' . _AM_INSTRUCTION_UNLOCK . '" title="' . _AM_INSTRUCTION_UNLOCK . '"> ';
85
            }
86
87
            $ret .= ' <a href="instr.php?op=editpage&pageid=' . $pageid . '"><img src="../assets/icons/edit_mini.png" alt="' . _AM_INSTRUCTION_EDIT . '" title="' . _AM_INSTRUCTION_EDIT . '"></a> ' . $act_del . '
88
      </td>
89
    </tr>';
90
91
            // Устанавливаем префикс
92
            $prefix_curr .= $prefix_orig;
93
        }
94
95 View Code Duplication
        if (isset($this->tree[$key]['child']) && !empty($this->tree[$key]['child'])) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
96
            foreach ($this->tree[$key]['child'] as $childkey) {
97
                $this->_makePagesAdminOptions($childkey, $ret, $prefix_orig, $objInsinstr, $class, $prefix_curr);
98
            }
99
        }
100
    }
101
102
    /**
103
     * @param        $objInsinstr
104
     * @param string $prefix
105
     * @param int    $key
106
     * @return string
107
     */
108
    public function makePagesAdmin(&$objInsinstr, $prefix = '-', $key = 0)
109
    {
110
        $ret = '<form name="inspages" action="instr.php" method="post">
111
  <table width="100%" cellspacing="1" class="outer">
112
    <tr>
113
      <th align="center" colspan="3">' . sprintf(_AM_INSTRUCTION_LISTPAGESININSTR, $objInsinstr->getVar('title')) . '</th>
114
    </tr>
115
    <tr>
116
      <td class="head" align="center">' . _AM_INSTRUCTION_TITLE . '</td>
117
      <td class="head" align="center" width="50">' . _AM_INSTRUCTION_WEIGHT . '</td>
118
      <td class="head" align="center" width="180">' . _AM_INSTRUCTION_ACTION . '</td>
119
    </tr>';
120
121
        // Выводим все страницы
122
        $this->_makePagesAdminOptions($key, $ret, $prefix, $objInsinstr);
123
124
        $ret .= '<tr class="foot">
125
      <td><a href="instr.php?op=editpage&instrid=' . $objInsinstr->getVar('instrid') . '"><img src="../assets/icons/add_mini.png" alt="' . _AM_INSTRUCTION_ADDPAGE . '" title="' . _AM_INSTRUCTION_ADDPAGE . '"></a></td>
126
      <td colspan="2">
127
        <input type="hidden" name="instrid" value="' . $objInsinstr->getVar('instrid') . '" />
128
        <input type="hidden" name="op" value="updpage" />
129
        <input type="submit" value="' . _SUBMIT . '" />
130
      </td>
131
    </tr>
132
  </table>
133
</form>';
134
135
        return $ret;
136
    }
137
138
    // ==================================
139
    // === Дерево категорий в админке ===
140
    // ==================================
141
142
    /**
143
     * @param        $key
144
     * @param        $ret
145
     * @param        $prefix_orig
146
     * @param array  $cidinstrids
147
     * @param string $class
148
     * @param string $prefix_curr
149
     */
150
    public function _makeCatsAdminOptions($key, &$ret, $prefix_orig, $cidinstrids = [], &$class = 'odd', $prefix_curr = '')
151
    {
152
        if ($key > 0) {
153
154
            //
155
            $class = ('even' === $class) ? 'odd' : 'even';
156
157
            // ID категории
158
            $catid = $this->tree[$key]['obj']->getVar('cid');
159
            // Название категории
160
            $cattitle = $this->tree[$key]['obj']->getVar('title');
161
            // Вес
162
            $catweight = $this->tree[$key]['obj']->getVar('weight');
163
            // Статус
164
            $pagestatus = $this->tree[$key]['obj']->getVar('status');
0 ignored issues
show
Unused Code introduced by
$pagestatus is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
165
166
            // Дочернии категории
167
            $cat_childs = $this->getAllChild($catid);
168
            // Число дочерних категорий
169
            $num_childs = count($cat_childs);
170
            // Число инструкций
171
            $num_instrs = isset($cidinstrids[$catid]) ? $cidinstrids[$catid] : 0;
172
173
            // Действие - удаление
174
            $act_del = (($num_instrs > 0) || ($num_childs > 0)) ? '<img src="../assets/icons/no_delete_mini.png" alt="' . _AM_INSTR_NODELCAT . '" title="' . _AM_INSTR_NODELCAT . '" />' : '<a href="cat.php?op=delcat&cid='
175
                                                                                                                                                                                           . $catid
176
                                                                                                                                                                                           . '"><img src="../assets/icons/delete_mini.png" alt="'
177
                                                                                                                                                                                           . _AM_INSTRUCTION_DEL
178
                                                                                                                                                                                           . '" title="'
179
                                                                                                                                                                                           . _AM_INSTRUCTION_DEL
180
                                                                                                                                                                                           . '" /></a>';
181
            // Действие - просмотр
182
            $act_view = ($num_instrs > 0) ? '<a href="instr.php?cid=' . $catid . '"><img src="../assets/icons/view_mini.png" alt="' . _AM_INSTR_VIEWINSTR . '" title="' . _AM_INSTR_VIEWINSTR . '" /></a>' : '<img src="../assets/icons/no_view_mini.png" alt="'
183
                                                                                                                                                                                                             . _AM_INSTR_NOVIEWINSTR
184
                                                                                                                                                                                                             . '" title="'
185
                                                                                                                                                                                                             . _AM_INSTR_NOVIEWINSTR
186
                                                                                                                                                                                                             . '" />';
187
188
            $ret .= '<tr class="' . $class . '">
189
      <td>' . $prefix_curr . ' <a href="' . XOOPS_URL . '/modules/' . INST_DIRNAME . '/index.php?cid=' . $catid . '">' . $cattitle . '</a></td>
190
      <td align="center" width="50">' . $catweight . '</td>
191
      <td align="center" width="100">' . $num_instrs . '</td>
192
      <td align="center" width="150">
193
        ' . $act_view . '
194
        <a href="cat.php?op=editcat&cid=' . $catid . '"><img src="../assets/icons/edit_mini.png" alt="' . _AM_INSTRUCTION_EDIT . '" title="' . _AM_INSTRUCTION_EDIT . '"></a>
195
        ' . $act_del . '
196
      </td>
197
    </tr>';
198
199
            // Устанавливаем префикс
200
            $prefix_curr .= $prefix_orig;
201
        }
202
203 View Code Duplication
        if (isset($this->tree[$key]['child']) && !empty($this->tree[$key]['child'])) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
204
            foreach ($this->tree[$key]['child'] as $childkey) {
205
                $this->_makeCatsAdminOptions($childkey, $ret, $prefix_orig, $cidinstrids, $class, $prefix_curr);
206
            }
207
        }
208
    }
209
210
    /**
211
     * @param string $prefix
212
     * @param array  $cidinstrids
213
     * @param int    $key
214
     * @return string
215
     */
216
    public function makeCatsAdmin($prefix = '-', $cidinstrids = [], $key = 0)
217
    {
218
        $ret = '<table width="100%" cellspacing="1" class="outer">
219
    <tr>
220
      <th align="center" colspan="4">' . _AM_INSTR_LISTALLCATS . '</th>
221
    </tr>
222
    <tr>
223
      <td class="head">' . _AM_INSTRUCTION_TITLE . '</td>
224
      <td class="head" align="center" width="50">' . _AM_INSTRUCTION_WEIGHT . '</td>
225
	  <td class="head" align="center" width="100">' . _AM_INSTR_INSTRS . '</td>
226
      <td class="head" align="center" width="150">' . _AM_INSTRUCTION_ACTION . '</td>
227
    </tr>';
228
229
        // Выводим все страницы
230
        $this->_makeCatsAdminOptions($key, $ret, $prefix, $cidinstrids);
231
232
        $ret .= '</table>';
233
234
        return $ret;
235
    }
236
237
    // ======================================
238
    // Список страниц на стороне пользователя
239
    // ======================================
240
241
    /**
242
     * @param       $key
243
     * @param       $ret
244
     * @param int   $currpageid
245
     * @param array $lastpageids
246
     * @param int   $level
247
     */
248
    public function _makePagesUserTree($key, &$ret, $currpageid = 0, &$lastpageids = [], $level = 0)
249
    {
250
251
        // Сохраняем значение предыдущей страницы
252
        //static $stat_prevpages;
253
254
        if ($key > 0) {
255
256
            // ID страницы
257
            $pageid = $this->tree[$key]['obj']->getVar('pageid');
258
            // Название страницы
259
            $pagetitle = $this->tree[$key]['obj']->getVar('title');
260
            // Тип страницы
261
            $pagetype = $this->tree[$key]['obj']->getVar('type');
262
263
            // Дочернии категории
264
            $page_childs = $this->getAllChild($pageid);
265
            // Число дочерних страниц
266
            $num_childs = count($page_childs);
267
268
            // Генерируем класс
269
            // InstrTreeNode InstrTreeIsRoot InstrTreeExpandClosed InstrTreeIsLast
270
            $class = [];
271
            // Данный класс должен быть у любого узла
272
            $class[] = 'InstrTreeNode';
273
            // Если узел нулевого уровня, добавляем InstrTreeIsRoot
274
            if (0 === $level) {
275
                $class[] = 'InstrTreeIsRoot';
276
            }
277
            // Тип узла InstrTreeExpandClosed|InstrTreeExpandLeaf
278
            // Если у узла нет потомков - InstrTreeExpandLeaf
279
            if (0 == $num_childs) {
280
                $class[] = 'InstrTreeExpandLeaf';
281
                // Если у искомого элемента есть потомки - открываем список
282
            } elseif ($currpageid == $pageid) {
283
                $class[] = 'InstrTreeExpandOpen';
284
                // Если искомый элемент есть в потомках текущего, то ставим класс InstrTreeExpandOpen
285
            } elseif (array_key_exists($currpageid, $page_childs)) {
286
                $class[] = 'InstrTreeExpandOpen';
287
                //
288
            } else {
289
                $class[] = 'InstrTreeExpandClosed';
290
            }
291
292
            // Данный класс нужно добавлять последнему узлу в каждом уровне
293
294
            if (isset($lastpageids[$level]) && ($pageid == $lastpageids[$level])) {
295
                $class[] = 'InstrTreeIsLast';
296
            }
297
298
            //$class[] = 'InstrTreeIsLast';
0 ignored issues
show
Unused Code Comprehensibility introduced by
63% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
299
300
            // Test
301
            //$ret .= '<div id="' . $pageid . '">';
302
303
            // Создаём запись
304
            $ret .= '<li class="' . implode(' ', $class) . '">';
305
            //
306
            $ret .= '<div class="InstrTreeExpand"></div>';
307
            //
308
            $ret .= '<div class="InstrTreeContent">';
309
310
            // Если это лист дерева
311
            if (0 == $pagetype) {
312
                $ret .= '<span class="InstrTreeEmptyPage">' . $pagetitle . '</span>';
313
                //
314
            } elseif ($currpageid == $pageid) {
315
                $ret .= $pagetitle;
316
                //
317
            } else {
318
                $ret .= '<a href="' . XOOPS_URL . '/modules/' . INST_DIRNAME . '/page.php?id=' . $pageid . '#pagetext">' . $pagetitle . '</a>';
319
            }
320
321
            $ret .= '</div>';
322
323
            // Если есть потомки
324
            if ($num_childs > 0) {
325
                $ret .= '<ul class="InstrTreeContainer">';
326
            }
327
328
            // Инкримент уровня
329
            $level++;
330
        }
331
332
        // Рекурсия
333 View Code Duplication
        if (isset($this->tree[$key]['child']) && !empty($this->tree[$key]['child'])) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
334
            foreach ($this->tree[$key]['child'] as $childkey) {
335
                $this->_makePagesUserTree($childkey, $ret, $currpageid, $lastpageids, $level);
336
            }
337
        }
338
339
        // Test
340
        if ($key > 0) {
341
            // Если есть потомки
342
            if ($num_childs > 0) {
0 ignored issues
show
Bug introduced by
The variable $num_childs does not seem to be defined for all execution paths leading up to this point.

If you define a variable conditionally, it can happen that it is not defined for all execution paths.

Let’s take a look at an example:

function myFunction($a) {
    switch ($a) {
        case 'foo':
            $x = 1;
            break;

        case 'bar':
            $x = 2;
            break;
    }

    // $x is potentially undefined here.
    echo $x;
}

In the above example, the variable $x is defined if you pass “foo” or “bar” as argument for $a. However, since the switch statement has no default case statement, if you pass any other value, the variable $x would be undefined.

Available Fixes

  1. Check for existence of the variable explicitly:

    function myFunction($a) {
        switch ($a) {
            case 'foo':
                $x = 1;
                break;
    
            case 'bar':
                $x = 2;
                break;
        }
    
        if (isset($x)) { // Make sure it's always set.
            echo $x;
        }
    }
    
  2. Define a default value for the variable:

    function myFunction($a) {
        $x = ''; // Set a default which gets overridden for certain paths.
        switch ($a) {
            case 'foo':
                $x = 1;
                break;
    
            case 'bar':
                $x = 2;
                break;
        }
    
        echo $x;
    }
    
  3. Add a value for the missing path:

    function myFunction($a) {
        switch ($a) {
            case 'foo':
                $x = 1;
                break;
    
            case 'bar':
                $x = 2;
                break;
    
            // We add support for the missing case.
            default:
                $x = '';
                break;
        }
    
        echo $x;
    }
    
Loading history...
343
                $ret .= '</ul>';
344
            }
345
            // Конец текущей записи
346
            $ret .= '</li>';
347
        }
348
    }
349
350
    // Находим предыдущую и следующую страницы.
351
    // Находим последнии страницы на каждом уровне.
352
    /**
353
     * @param       $key
354
     * @param int   $currpageid
355
     * @param array $prevpages
356
     * @param array $nextpages
357
     * @param array $lastpageids
358
     * @param int   $level
359
     */
360
    public function _makePagesUserCalc($key, $currpageid = 0, &$prevpages = [], &$nextpages = [], &$lastpageids = [], $level = 0)
361
    {
362
363
        // Сохраняем значение предыдущей страницы
364
        static $stat_prevpages;
365
366
        if ($key > 0) {
367
            // ID страницы
368
            $pageid = $this->tree[$key]['obj']->getVar('pageid');
369
            // Название страницы
370
            $pagetitle = $this->tree[$key]['obj']->getVar('title');
371
            // Тип страницы
372
            $pagetype = $this->tree[$key]['obj']->getVar('type');
373
374
            // Если мы передали ID текущей страницы, то находить предыдудую и следующую страницы
375
            // Не находить предыдущие и следующие для "Пустой страницы"
376
            if ($currpageid && $pagetype) {
377
                // Если элемент равен текущей странице
378
                if (isset($stat_prevpages) && ($currpageid == $pageid)) {
379
                    // Забиваем массив предыдущей страницы
380
                    $prevpages['pageid'] = $stat_prevpages['pageid'];
381
                    $prevpages['title']  = $stat_prevpages['title'];
382
383
                    // Если предыдущий равен текущей странице
384
                } elseif (isset($stat_prevpages) && ($currpageid == $stat_prevpages['pageid'])) {
385
                    // Забиваем массив следующей страницы
386
                    $nextpages['pageid'] = $pageid;
387
                    $nextpages['title']  = $pagetitle;
388
                }
389
                // Заносим текущие данные в массив предыдущей страницы
390
                $stat_prevpages['pageid'] = $pageid;
391
                $stat_prevpages['title']  = $pagetitle;
392
            }
393
394
            // Заносим текущую страницу в массив "последних страний"
395
            $lastpageids[$level] = $pageid;
396
397
            // Инкримент уровня
398
            $level++;
399
        }
400
401
        // Рекурсия
402 View Code Duplication
        if (isset($this->tree[$key]['child']) && !empty($this->tree[$key]['child'])) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
403
            foreach ($this->tree[$key]['child'] as $childkey) {
404
                $this->_makePagesUserCalc($childkey, $currpageid, $prevpages, $nextpages, $lastpageids, $level);
405
            }
406
        }
407
    }
408
409
    //
410
411
    /**
412
     * @param int   $currpageid
413
     * @param array $prevpages
414
     * @param array $nextpages
415
     * @param int   $key
416
     * @return string
417
     */
418
    public function makePagesUser($currpageid = 0, &$prevpages = [], &$nextpages = [], $key = 0)
419
    {
420
421
        // Массив последней страницы на каждом уровне
422
        // level => pageid
423
        $lastpageids = [];
424
425
        // Расчёт
426
        $this->_makePagesUserCalc($key, $currpageid, $prevpages, $nextpages, $lastpageids);
427
428
        $ret = '<div onclick="instr_tree_toggle(arguments[0])">
429
<div>' . _MD_INSTRUCTION_LISTPAGES . '</div>
430
<div><ul class="InstrTreeContainer">';
431
432
        // Генерируем дерево
433
        $this->_makePagesUserTree($key, $ret, $currpageid, $lastpageids);
434
435
        $ret .= '</ul>
436
</div>';
437
438
        return $ret;
439
    }
440
}
441