summaryrefslogtreecommitdiff
path: root/modules/organize/views/organize_tree.html.php
blob: 5b676889065ee378e0b3a35387acbb508761ef1b (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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php defined("SYSPATH") or die("No direct script access.") ?>
<? foreach ($parents as $parent): ?>
<li class="gOrganizeAlbum ui-icon-left <?= access::can("edit", $parent) ? "" : "gViewOnly" ?>"
    ref="<?= $parent->id ?>">
  <span class="ui-icon ui-icon-minus">
  </span>
  <span class="gAlbumText" ref="<?= $parent->id ?>">
    <?= html::clean($parent->title) ?>
  </span>
  <ul class="ui-icon-plus">
    <? endforeach ?>

    <? foreach ($peers as $peer): ?>
    <li class="gOrganizeAlbum ui-icon-left <?= access::can("edit", $peer) ? "" : "gViewOnly" ?>"
        ref="<?= $peer->id ?>">
      <span class="ui-icon <?= $peer->id == $album->id ? "ui-icon-minus" : "ui-icon-plus" ?>">
      </span>
      <span class="gAlbumText <?= $peer->id == $album->id ? "selected" : "" ?>"
            ref="<?= $peer->id ?>">
        <?= html::clean($peer->title) ?>
      </span>

      <? if ($peer->id == $album->id): ?>
      <ul class="ui-icon-plus">
        <? foreach ($album->children(null, 0, array("type" => "album")) as $child): ?>
        <li class="gOrganizeAlbum ui-icon-left <?= access::can("edit", $child) ? "" : "gViewOnly" ?>"
            ref="<?= $child->id ?>">
          <span class="ui-icon ui-icon-plus">
          </span>
          <span class="gAlbumText"
                ref="<?= $child->id ?>">
            <?= html::clean($child->title) ?>
          </span>
        </li>
        <? endforeach ?>
      </ul>
      <? endif ?>
    </li>
    <? endforeach ?>

    <? foreach ($parents as $parent): ?>
  </ul>
</li>
<? endforeach ?>