display initial available-tag list without the help of AJAX
authorAndreas Unterkircher <unki@netshadow.at>
Sun, 4 May 2008 17:56:57 +0000 (19:56 +0200)
committerAndreas Unterkircher <unki@netshadow.at>
Sun, 4 May 2008 19:52:40 +0000 (21:52 +0200)
Signed-off-by: Andreas Unterkircher <unki@netshadow.at>
phpfspot.class.php
phpfspot.js
themes/default/templates/tags.tpl

index 8305ba5ba7289cddcc112d70f28065f542ed2da7..55bd713abedcc4f1818a3eb1a020e991ca90e480 100644 (file)
@@ -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();
                }
index 7dfdcc84c74f1f59f252b9083459c1fcb5cedc33..ae202a0c004f69d0e7eb792c19f62711d787b571 100644 (file)
@@ -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();
    }
index a4b1e0a1859a66cccefd40b019210f262455da7d..f0e3a4748b52838162f45f317901a07f39e5c8b9 100644 (file)
@@ -1,7 +1,7 @@
 <span style="vertical-align: middle; text-decoration: underline;">
  <img src="{$web_path}/resources/available_tags.png" alt="available tags" />Available Tags:
 </span>
-<div id="available_tags"></div>
+<div id="available_tags">{ $preset_available_tags }</div>
 <span style="vertical-align: middle; text-decoration: underline;">
  <img src="{$web_path}/resources/selected_tags.png" alt="selected tags" />Selected Tags:
 </span>