Collaborama About Help Contact Anonymous [login] Source: site.view [edit] Function name: sitemessageref Arguments: msgid,arg Description: Display a system message, referenced by token Page type: webl Render function: Module: siteutil Page source: // This page displays standard server messages. It is called // by the server with a message id. Edit this table as needed. arg = ToString(arg); // Table lists message and suggestions (may be nil) var msgtable = [. nilreturnvalue = [ `Function returned no value (nil).`, nil], syntaxerror = [ `Error: Command not understood.`, ["ls", "home", "help"]], unknownfunction = [ `Error: Unknown function (or you do not have <a href="/webl/WubHub_DoIt?cmdline=permissions">read access</a> to the function if it exists).`, ["ls", "home", "help"]], unknownkey = [ `Error: Unknown key "` + arg + `". Use setVaultValue(key,value) to initialize this key.`, ["home", "help"]], insufficientpermissions = [ `Error: You do not have sufficient <a href="/webl/WubHub_DoIt?cmdline=permissions">permissions</a> to perform that action.`, nil ], argumentmismatch = [ `Error: Wrong number of arguments sent to function.`, nil ], securityviolation = [ `Error: The function attempted to use WebScript commands that are disallowed for security reasons.`, nil ], returnviolation = [ `Error: Scripts cannot use "return()" command at a top level of execution.`, nil ], newgroupcreated = [ `New group created: ` + arg + ".", [ "home", "editProfile:" + arg ] ], useraddedtogroup = [ `You have been added to the group: ` + arg + ".", [ "home" ] ], functionsaved = [ `Function saved (` + arg + ").", [ "ls", "home", "viewEditGo" ] ], functiondeleted = [ `Function deleted (` + arg + ").", [ "ls", "home" ] ], unknownerror = [ `An error was detected in your script, but unfortunately, no additional debugging information is available.`, [ "home", "help" ] ], unknowncmdtoedit = [ `Error: Could not find function "` + arg + `" to edit.`, [ "ls", "home", "help" ] ], wrongcacheformat= [ `Error: Cache expiration date must be in form: MM/DD/YY HH:MM PM<p>Cache refresh rate must be in form: <i>n</i>M <i>n</i>W <i>n</i>D <i>n</i>H`, nil ], cachedatetooearly = [ `Error: Cache expiration date must be in the future.`, nil ], mustlogin = [ `Sorry, you must be a member and log in to execute this command.`, [ "signup", "login" ] ], mustbemember = [ `Sorry, you must be a member of group "` + arg + `" to execute this command.`, [ "home" ] ], loggedin = [ `You are now logged in as ` + arg, [ "home", "profile", "help" ] ], loggedout = [ `You are now logged out.`, [ "home", "login" ] ], userexists = [ `Error: The login name you entered (` +arg + `) already exists. Please try again with a different user name.`, [ "signup", "home" ] ], groupexists = [ `Error: The group name you entered (` +arg + `) already exists. Please try again with a different group name.`, [ "createGroup", "home" ] ], badname = [ `Error: Invalid name "` + arg + `". Must start with an alpha character, followed by only alphanumeric characters.`, [ "home" ] ], nonexistantgroup = [ `Error: The group name you are trying to sign up for (` +arg + `) doesn't exist. Please try again with a different group name.`, [ "home" ] ], badlogin = [ `Error: You have entered an incorrect login name or password. Please try again.`, [ "login" ] ], newusercreated = [ arg + `: New user account successfully created.`, [ "login", "home", "help" ] ], badinvitation = [ `Error: Your invitation id (` + arg + `) was invalid or has expired.`, [ "signup" ] ], badsignup = [ `Error: Passwords don't match. Please try again.`, [ "signup" ] ], passwordtooshort = [ `Error: For security reasons, your password must be at least 8 characters.`, [ "signup" ] ], badfullname= [ `Error: Please enter your full user name.`, [ "signup" ] ], emptyusername = [ `Error: You must enter a user name.`, [ "login" ] ] .]; // List of suggested commands and descriptions var suggtable = [. ls = "list commands", home = "Collaborama Home", help = "Collaborama Help", login = "log in to Collaborama", profile = "view your profile", signup = "create new account", createGroup = "create a new group" .]; var msg = "", cmdlist; var sugg = "", cmdlink; try msg = msgtable[msgid][0]; cmdlist = msgtable[msgid][1]; if cmdlist != nil then every cmd in cmdlist do if (cmd == "viewEditGo") then var func = Wub_GetFunctionInfo(arg); sugg = sugg + "<p><li>[" + `<a href="WubHub_DoIt?cmdline=view(` + arg + `)">View</a>/`+ `<a href="WubHub_DoIt?cmdline=edit(` + arg + `)">Edit</a>`; if (Str_Trim(func.arglist) == "") then sugg = sugg + `<a href="WubHub_DoIt?cmdline=` + arg + `">/Go To</a>` end; sugg = sugg + "] your saved function</li>\n" elsif Str_StartsWith(cmd, "editProfile:") then var a = Str_Split(cmd, ":"); sugg = sugg + "<li>" + Wub_ALinkCmd2("edit(" + a[1] + ".profile)", "Edit Group Info") else cmdlink = `<a href="/webl/WubHub_DoIt?cmdline=`+cmd+`">`+cmd+`</a>`; sugg = sugg + "<li>" + cmdlink + ": " + suggtable[cmd] + "</li>\n" end end; end; catch E on E.type == "NoSuchField" do msg = msg + "<p>[error processing message id: "+msgid+"]</p>"; end; var result; if cmdlist == nil then result = "<p><b>" + msg + "</b></p>"; else result = "<p><b>" + msg + "</b></p><p>Suggestions:</p><ul>"+sugg+"</ul>"; end; WubCall("sitepage", [result]);