Oops, albumtree files missing from 091357a9d2
This commit is contained in:
parent
091357a9d2
commit
114997695c
33
3.0/modules/albumtree/helpers/albumtree_installer.php
Normal file
33
3.0/modules/albumtree/helpers/albumtree_installer.php
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
<?php defined("SYSPATH") or die("No direct script access.");
|
||||||
|
/**
|
||||||
|
* Gallery - a web based photo album viewer and editor
|
||||||
|
* Copyright (C) 2000-2010 Bharat Mediratta
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or (at
|
||||||
|
* your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but
|
||||||
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
*/
|
||||||
|
class albumtree_installer {
|
||||||
|
static function install() {
|
||||||
|
module::set_var("albumtree", "style", "select");
|
||||||
|
module::set_version("albumtree", 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
static function upgrade($version) {
|
||||||
|
$db = Database::instance();
|
||||||
|
if ($version == 1) {
|
||||||
|
module::set_var("albumtree", "style", "select");
|
||||||
|
module::set_version("albumtree", $version = 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
38
3.0/modules/albumtree/views/albumtree_block_list.html.php
Normal file
38
3.0/modules/albumtree/views/albumtree_block_list.html.php
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
<?php defined("SYSPATH") or die("No direct script access.") ?>
|
||||||
|
<style type="text/css">
|
||||||
|
ul.treealbumnav {
|
||||||
|
height: 225px;
|
||||||
|
width: 190px;
|
||||||
|
overflow: auto;
|
||||||
|
border: 1px solid #666;
|
||||||
|
padding: 2px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<ul class="treealbumnav">
|
||||||
|
<? // We'll keep track of the list of items that we want to display in a stack ?>
|
||||||
|
<? $stack = array(array(0, $root)) ?>
|
||||||
|
|
||||||
|
<? // While there are still items to show, pick the next one and show it ?>
|
||||||
|
<? while ($stack): ?>
|
||||||
|
<? list($level, $album) = array_pop($stack) ?>
|
||||||
|
<li>
|
||||||
|
<a href="/index.php/items/<?= $album->id ?>"><?= str_repeat(" ", $level) ?><?= $album->title ?>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<? // Then take all of that album's children and put them next on the stack. ?>
|
||||||
|
<? $tmp = array(); ?>
|
||||||
|
<? foreach ($album->viewable()->children(null, null, array(array("type", "=", "album"))) as $child): ?>
|
||||||
|
<? $tmp[] = array($level + 1, $child) ?>
|
||||||
|
<? endforeach ?>
|
||||||
|
|
||||||
|
<? // Since we'll pull them off the stack in the opposite order that we put them on, ?>
|
||||||
|
<? // and the order that we put them on is the order in which we want to display them, ?>
|
||||||
|
<? // We need to reverse the order of the children on the stack ?>
|
||||||
|
<? if ($tmp): ?>
|
||||||
|
<? $stack = array_merge($stack, array_reverse($tmp)) ?>
|
||||||
|
<? endif ?>
|
||||||
|
<? endwhile ?>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
Reference in New Issue
Block a user