after remove a tag, resort the selected tag array
[phpfspot.git] / phpfspot.class.php
index 42d3075a2d665bd22bbc8b40e09c6ad505496548..0dea249a6a56cf037fba99b2d6006f37b113216a 100644 (file)
@@ -150,7 +150,7 @@ class PHPFSPOT {
             continue;
 
          // return all available (= not selected) tags
-         print "<a href=\"javascript:Tags('add', ". $tag .");\">". $this->tags[$tag] ."</a>&nbsp;";
+         print "<a href=\"javascript:Tags('add', ". $tag .");\" class=\"tag\">". $this->tags[$tag] ."</a>&nbsp;";
 
       }
 
@@ -162,7 +162,7 @@ class PHPFSPOT {
       {
          // return all selected tags
          if(isset($_SESSION['selected_tags']) && in_array($tag, $_SESSION['selected_tags'])) {
-            print "<a href=\"javascript:Tags('del', ". $tag .");\">". $this->tags[$tag] ."</a>&nbsp;";
+            print "<a href=\"javascript:Tags('del', ". $tag .");\" class=\"tag\">". $this->tags[$tag] ."</a>&nbsp;";
          }
 
       }
@@ -183,6 +183,7 @@ class PHPFSPOT {
       if(isset($_SESSION['selected_tags'])) {
          $key = array_search($tag, $_SESSION['selected_tags']);
          unset($_SESSION['selected_tags'][$key]);
+        sort($_SESSION['selected_tags']);
       }
 
    } // delTag()