aboutsummaryrefslogtreecommitdiff
path: root/app/views/course/wizard/steps/studyareas/_node.php
blob: b29f564a0b3a582501d682e5d92baf605142e643 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php if (empty($search_result) || in_array($node->id, $search_result)) : ?>
<li class="sem-tree-<?= htmlReady($node->id) ?> keep-node" data-id="<?= $node->id ?>">
    <?php if ($node->isAssignable()) : ?>
    <?= Icon::create('arr_2left', 'sort')->asInput(["name" => 'assign['.$node->id.']', "onclick" => "return STUDIP.CourseWizard.assignNode('".$node->id."')", "class" => in_array($node->id, $values['studyareas'] ??[])?'hidden-no-js':'', "style" => in_array($node->id, $values['studyareas'] ?? [])?'display:none':false]) ?>
    <?php endif ?>
    <?php if ($node->hasChildren()) : ?>
    <input type="checkbox" id="<?= htmlReady($node->id) ?>"<?= (in_array($node->id, $open_nodes) && $node->parent_id != $values['open_node']) ? ' checked="checked"' : '' ?>/>
    <label onclick="return STUDIP.CourseWizard.getTreeChildren('<?= htmlReady($node->sem_tree_id) ?>', true)"
           for="<?= htmlReady($node->id) ?>" class="undecorated">
        <a href="<?= URLHelper::getLink($no_js_url,
            ['open_node' => $node->id]) ?>">
    <?php endif ?>
        <?= htmlReady($node->name) ?>
    <?php if ($node->hasChildren()) : ?>
        </a>
    </label>
    <ul>
        <?php if ($node->hasChildren() && in_array($node->id, $open_nodes) && $node->_parent->id != $values['open_node']) : ?>
            <?php foreach ($node->getChildren() as $child) : ?>
                <?= $this->render_partial('studyareas/_node',
                    ['node' => $child, 'stepnumber' => $stepnumber,
                        'temp_id' => $temp_id, 'values' => $values,
                        'open_nodes' => $open_nodes ?: [],
                        'search_result' => $search_result ?: []]) ?>
            <?php endforeach ?>
        <?php endif ?>
    </ul>
    <?php endif ?>
</li>
<?php endif ?>