1
0
This repository has been archived on 2021-04-26. You can view files and clone it, but cannot push or open issues or pull requests.
gallery3-contrib/3.0/modules/albumtree/views/albumtree_block_select.html.php
2012-02-29 07:35:40 -08:00

17 lines
599 B
PHP

<?php defined("SYSPATH") or die("No direct script access.") ?>
<select onchange="window.location=this.value">
<?
function makeselect($album, $level){
//print out the list item as a select option
?>
<option value="<?= item::root()->url() ?><?= $album->relative_url() ?>"><?= str_repeat("&nbsp;&nbsp;", $level) ?><?= html::purify($album->title) ?></option>
<?
//recurse over the children, and print their list items as well
foreach ($album->viewable()->children(null, null, array(array("type", "=", "album"))) as $child){
makeselect($child,$level+1);
}
}
makeselect($root,0);
?>
</select>