Fixes for installation mode
[mailer.git] / inc / libs / surfbar_functions.php
index f4c90eb5850008fc5b584a9330c710c943d63d7e..0a404409889307001f540de5bdd5c47da6afd272 100644 (file)
@@ -940,9 +940,50 @@ ORDER BY u.id ASC",
        // Return the array
        return $URLs;
 }
+// "Getter" for member action array for given status
+function SURFBAR_GET_ACTION_ARRAY ($status) {
+       // Init array
+       $returnArray = array();
+
+       // Get all assigned actions
+       $result = SQL_QUERY_ESC("SELECT action FROM "._MYSQL_PREFIX."_surfbar_actions WHERE status='%s' ORDER BY id ASC",
+               array($status), __FILE__, __LINE__);
+
+       // Some entries there?
+       if (SQL_NUMROWS($result) > 0) {
+               // Load all actions
+               while (list($action) = SQL_FETCHROW($result)) {
+                       $returnArray[] = $action;
+               } // END - if
+       } // END - if
+
+       // Free result
+       SQL_FREERESULT($result);
+
+       // Return result
+       return $returnArray;
+}
 // Create list of actions depending on status for the user
 function SURFBAR_MEMBER_ACTIONS ($id, $status) {
-       /* DEBUG: */ die("id={$id},status={$status}");
+       // Load all actions in an array for given status
+       $actionArray = SURFBAR_GET_ACTION_ARRAY($status);
+
+       // Init HTML code
+       $OUT = "";
+
+       // "Walk" through all actions and create forms
+       foreach ($actionArray as $action) {
+               // Add form for this action
+               $OUT .= sprintf("<form action=\"".URL."/modules.php?module=login&amp;what=surfbar_list\" method=\"post\" style=\"padding-bottom:0px\">
+<input type=\"submit\" name=\"%s\" value=\"{--MEMBER_SURFBAR_ACTION_%s_SUBMIT--}\" />
+</form>",
+                       $action,
+                       strtoupper($action)
+               );
+       } // END - if
+
+       // Return code
+       return $OUT;
 }
 // Determine next id for surfbar or get data for given id, always call this before you call other
 // getters below this function!!!