Missing VGWS API calls.

This commit is contained in:
Rob Nelson
2014-04-09 12:15:18 -07:00
parent aa2a9856a5
commit 7f73e4459e
2 changed files with 15 additions and 5 deletions

View File

@@ -234,7 +234,8 @@ var/global/floorIsLava = 0
return
checkSessionKey()
var/cid = input("Type computer ID", "CID", 0)
usr << link("[config.vgws_base_url]/index.php/rapsheet/?s=[sessKey]&cid=[cid]")
usr << link(getVGPanel("rapsheet",admin=1,query=list("cid"=cid)))
//usr << link("[config.vgws_base_url]/index.php/rapsheet/?s=[sessKey]&cid=[cid]")
return
/datum/admins/proc/checkCKEY()
@@ -249,7 +250,8 @@ var/global/floorIsLava = 0
return
checkSessionKey()
var/ckey = lowertext(input("Type player ckey", "ckey", null) as text | null)
usr << link("[config.vgws_base_url]/index.php/rapsheet/?s=[sessKey]&ckey=[ckey]")
usr << link(getVGPanel("rapsheet",admin=1,query=list("ckey"=ckey)))
//usr << link("[config.vgws_base_url]/index.php/rapsheet/?s=[sessKey]&ckey=[ckey]")
return
/datum/admins/proc/PlayerNotesPage(page)

View File

@@ -1,12 +1,20 @@
#ifdef __OPENBYOND
// The idea is to eventually be able to call
//user << VGPanel(...)
// instead of
//user << link(GetVGPanel(...))
// But OpenBYOND isn't ready yet.
#define VGPanel(...) link(getVGPanel(__VA_ARGS__))
#endif
// Usage:
// user << link(getVGPanel("route"[, admin=1][, query=list("get_var"="value")]))
// Turns into:
// [config.vgws_base_url]/index.php/route?get_var=value
// s is automatically added when admin=1.
/datum/admins/proc/getVGPanel(var/route,var/list/query=list(),var/admin=0)
checkSessionKey()
var/url="[config.vgws_base_url]/index.php/[route]"
//usr << link("[config.vgws_base_url]/index.php/rapsheet/?s=[sessKey]&ckey=[ckey]")
if(admin)
query["s"]=sessKey
url += buildurlquery(query)