From ca733ba231fa3da5dc9c6eb0d80eca175c7afe5e Mon Sep 17 00:00:00 2001 From: Andreas Unterkircher Date: Sun, 4 May 2008 19:56:57 +0200 Subject: display initial available-tag list without the help of AJAX Signed-off-by: Andreas Unterkircher --- phpfspot.class.php | 8 +++++--- phpfspot.js | 5 ++--- themes/default/templates/tags.tpl | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/phpfspot.class.php b/phpfspot.class.php index 8305ba5..55bd713 100644 --- a/phpfspot.class.php +++ b/phpfspot.class.php @@ -314,8 +314,11 @@ class PHPFSPOT { $this->tmpl->assign('from_date', $this->get_calendar('from')); $this->tmpl->assign('to_date', $this->get_calendar('to')); - if(!isset($content)) + if(!isset($content)) { + $this->tmpl->assign('preset_selected_tags', $this->getSelectedTags()); + $this->tmpl->assign('preset_available_tags', $this->getAvailableTags()); $this->tmpl->assign('content_page', $this->tmpl->fetch('welcome.tpl')); + } else $this->tmpl->assign('content_page', $content); @@ -733,7 +736,7 @@ class PHPFSPOT { } $output = substr($output, 0, strlen($output)-2); - print $output; + return $output; } // getAvailableTags() @@ -3121,7 +3124,6 @@ class PHPFSPOT { if(is_numeric($options[2])) { $_GET['mode'] = 'showpi'; $_SESSION['selected_tags'] = Array($options[2]); - $this->tmpl->assign('preset_selected_tags', $this->getSelectedTags()); $_GET['tags'] = $options[2]; return $this->showPhotoIndex(); } diff --git a/phpfspot.js b/phpfspot.js index 7dfdcc8..ae202a0 100644 --- a/phpfspot.js +++ b/phpfspot.js @@ -383,13 +383,12 @@ function init_phpfspot(srv_webpath) web_path = ''; /* always load list of available tags */ - refreshAvailableTags(); + //this should not be more necessary since 4.5.08 + //refreshAvailableTags(); /* ask the server what we are currently displaying */ whattodo = AskServerWhatToDo(); - window.alert(whattodo); - if(whattodo == 'showpi' || whattodo == 'showpi_date') { showPhotoIndex(); } diff --git a/themes/default/templates/tags.tpl b/themes/default/templates/tags.tpl index a4b1e0a..f0e3a47 100644 --- a/themes/default/templates/tags.tpl +++ b/themes/default/templates/tags.tpl @@ -1,7 +1,7 @@ available tagsAvailable Tags: -
+
{ $preset_available_tags }
selected tagsSelected Tags: -- cgit v1.2.3-18-g5258