foreach ($children as $path => $name) {
- echo '<img src="'.$spacer.'" height="1" width="'.$indent.'" />';
if ($expanded[$path] == 1) {
- echo '<a href="'.$serendipity['baseURL'].'gallery/collapse'.$path.'"><img src="'.$minus.'" alt="expand" /></a> '."\n";
- if ($show != $path) {
- echo '<a href="'.$serendipity['baseURL'].'gallery/show'.$path.'">'.stripslashes($name).'</a><br />'."\n";
- }
- else {
- echo '<span class="selected">'.stripslashes($name).'</span><br />'."\n";
- }
+ echo '<span class="gallery_minus" style="padding-left:'.$indent.'px;"><a href="'.$serendipity['baseURL'].'gallery/collapse'.$path.'">[-]</a></span>'."\n";
+ echo '<a href="'.$serendipity['baseURL'].'gallery/show'.$path.'">'.stripslashes($name).'</a><br />'."\n";
make_tree($path,$indent+10,$show,$expand,$expanded);
}
else {
if (has_children($path)) {
- echo '<a href="'.$serendipity['baseURL'].'gallery/expand'.$path.'"><img src="'.$plus.'" alt="expand" /></a> '."\n";
- }
- else {
- echo '<img src="'.$plusGrey.'" alt="No children" /> '."\n";
- }
- if ($show != $path) {
- echo '<a href="'.$serendipity['baseURL'].'gallery/show'.$path.'">'.stripslashes($name).'</a><br />'."\n";
+ echo '<span class="gallery_plus" style="padding-left:'.$indent.'px;"><a href="'.$serendipity['baseURL'].'gallery/expand'.$path.'">[+]</a></span>'."\n";
}
else {
- echo '<span class="selected">'.stripslashes($name).'</span><br />'."\n";
+ echo '<span class="gallery_plus_grey" style="padding-left:'.$indent.'px;">[+]</span> '."\n";
}
+ echo '<a href="'.$serendipity['baseURL'].'gallery/show'.$path.'">'.stripslashes($name).'</a><br />'."\n";
}
}
}
function make_directory($show) {
global $serendipity;
$content .='<div style="padding-left:20px">';
- $content .='<p><b>showing images in: '.get_heading($show).':</b></p>';
+ $content .='<p>showing images in: '.get_heading($show).':</p>';
if (file_exists(SGN_DIR_ROOT.$show.'/summary.inc')) {
$content .='<p>»» ';
$content .= implode('',file(SGN_DIR_ROOT.$show.'/summary.inc'));
$caption = implode('',file(SGN_DIR_ROOT.$show.str_replace($f[count($f)-1],'inc',$file)));
}
$content .='<td><a href="'.$serendipity['baseURL'].'gallery/view.php?f='.$show.'/'.$file.'"><img src="'.SGN_WEB_ROOT.$thumb.'" alt="'.$caption.'" /></a></td>';
- if ($count == 3) {
+ if ($count == 3 && $count != count($files)) {
$content .='</tr><tr>';
$count = 1;
}
$content .='</tr></table>';
}
$content .='<div style="padding-left:20px">';
- $content .='<p><b>subdirectories:</b></p>';
+ $content .='<p>subdirectories:</p>';
$children = get_children($show);
global $serendipity;
$title = $this->title;
+ // parse the url
+
+ $requestpath = $_SERVER['REQUEST_URI'];
+ $bits = explode('/',$requestpath);
+
+ $action = '';
+ $path = '';
+
+ foreach ($bits as $i => $b) {
+ if (empty($b)) {
+ continue;
+ }
+ if ($b == 'gallery') {
+ $actionnext = true;
+ continue;
+ }
+ if (!empty($actionnext)) {
+ $action = $b;
+ $actionnext = false;
+ $finished = true;
+ continue;
+ }
+ if (!empty($finished)) {
+ $path .= '/'.$b;
+ }
+ }
- $show = $_GET['show'];
- if (!isset($show)) {
+ if ($action == 'show') {
+ $show = $path;
+ } else {
$show = (isset($_SESSION['show'])) ? $_SESSION['show'] : '';
}
$_SESSION['show'] = $show;
- $expand = $_GET['expand'];
- if (!isset($_GET['expand'])) {
+
+ if ($action == 'expand') {
+ $expand = $path;
+ } else {
$expand =(isset($_SESSION['expand'])) ? $_SESSION['expand'] : '';
}
$_SESSION['expand'] = $expand;
+
$expanded = $_SESSION['expanded'];
if (!isset($expanded)) {
$expanded = array();
$expanded[$collapse] = 0;
}
$_SESSION['expanded'] = $expanded;
- $op = $_GET['op'];
-
make_tree('/',1,$show,$expand,$expanded);
}