/** * Prints the sortable nested albums list * returns true if nesting levels exceede the database container * * @param array $pages The array containing all pages * @param bool $show_thumb set false to use thumb standin image. * @param object $owner the album object of the owner or NULL for the gallery * * @return bool */ function printNestedAlbumsList($albums, $show_thumb, $owner) { $indent = 1; $open = array(1 => 0); $rslt = false; foreach ($albums as $album) { $order = $album['sort_order']; $level = max(1, count($order)); if ($toodeep = $level > 1 && $order[$level - 1] === '') { $rslt = true; } if ($level > $indent) { echo "\n" . str_pad("\t", $indent, "\t") . "<ul class=\"page-list\">\n"; $indent++; $open[$indent] = 0; } else { if ($level < $indent) { while ($indent > $level) { $open[$indent]--; $indent--; echo "</li>\n" . str_pad("\t", $indent, "\t") . "</ul>\n"; } } else { // indent == level if ($open[$indent]) { echo str_pad("\t", $indent, "\t") . "</li>\n"; $open[$indent]--; } else { echo "\n"; } } } if ($open[$indent]) { echo str_pad("\t", $indent, "\t") . "</li>\n"; $open[$indent]--; } $albumobj = newAlbum($album['name']); if ($albumobj->isDynamic()) { $nonest = ' class="no-nest"'; } else { $nonest = ''; } echo str_pad("\t", $indent - 1, "\t") . "<li id=\"id_" . $albumobj->getID() . "\"{$nonest} >"; printAlbumEditRow($albumobj, $show_thumb, $owner); $open[$indent]++; } while ($indent > 1) { echo "</li>\n"; $open[$indent]--; $indent--; echo str_pad("\t", $indent, "\t") . "</ul>"; } if ($open[$indent]) { echo "</li>\n"; } else { echo "\n"; } return $rslt; }
</a>.</p> <table class="bordered" width="100%"> <tr> <th style="text-align: left;"><?php echo gettext("Edit this album"); ?> </th> </tr> <tr> <td style="padding: 0px 0px;" colspan="2"> <div id="albumList" class="albumList"><?php if (count($albums) > 0) { foreach ($albums as $folder) { $album = new Album($gallery, $folder); printAlbumEditRow($album); } } ?> </div> </td> </tr> </table> <div> <ul class="iconlegend"> <li><img src="images/lock.png" alt="Protected" /><?php echo gettext("Has Password"); ?> </li> <li><img src="images/pass.png" alt="Published" /><img src="images/action.png" alt="Unpublished" /><?php echo gettext("Published/Unpublished");