//Adminpaper - it's like paper, but more adminny! /obj/item/weapon/paper/admin name = "administrative paper" desc = "If you see this, something has gone horribly wrong." var/datum/admins/admindatum = null var/interactions = null var/isCrayon = 0 var/origin = null var/mob/sender = null var/obj/machinery/photocopier/faxmachine/destination var/header = null var/headerOn = TRUE var/footer = null var/footerOn = FALSE /obj/item/weapon/paper/admin/New() ..() generateInteractions() /obj/item/weapon/paper/admin/proc/generateInteractions() //clear first interactions = null //Snapshot is crazy and likes putting each topic hyperlink on a seperate line from any other tags so it's nice and clean. interactions += "
The fax will transmit everything above this line
" interactions += "Send fax " interactions += "Pen mode: [isCrayon ? "Crayon" : "Pen"] " interactions += "Cancel fax " interactions += "
" interactions += "Toggle Header " interactions += "Toggle Footer " interactions += "Clear page " interactions += "
" /obj/item/weapon/paper/admin/proc/generateHeader() var/originhash = md5("[origin]") var/timehash = copytext(md5("[world.time]"),1,10) var/text = null var/logo = alert(usr, "Do you want the header of your fax to have a NanoTrasen or SolGov logo?","Fax Logo","NanoTrasen","SolGov") if(logo == "SolGov") logo = "sglogo.png" else logo = "ntlogo.png" //TODO change logo based on who you're contacting. text = "

" text += "[origin] Quantum Uplink Signed Message
" text += "Encryption key: [originhash]
" text += "Challenge: [timehash]

" header = text /obj/item/weapon/paper/admin/proc/generateFooter() var/text = null text = "
" text += "This transmission is intended only for the addressee and may contain confidential information. Any unauthorized disclosure is strictly prohibited.

" text += "If this transmission is received in error, please notify both the sender and the office of [using_map.boss_name] Internal Affairs immediately so that corrective action may be taken." text += "Failure to comply is a breach of regulation and may be prosecuted to the fullest extent of the law, where applicable." text += "
" footer = text /obj/item/weapon/paper/admin/proc/adminbrowse() updateinfolinks() generateHeader() generateFooter() updateDisplay() obj/item/weapon/paper/admin/proc/updateDisplay() usr << browse("[name][headerOn ? header : ""][info_links][stamps][footerOn ? footer : ""][interactions]", "window=[name];can_close=0") /obj/item/weapon/paper/admin/Topic(href, href_list) if(href_list["write"]) var/id = href_list["write"] if(free_space <= 0) to_chat(usr, "There isn't enough space left on \the [src] to write anything.") return var/t = sanitize(input("Enter what you want to write:", "Write", null, null) as message, free_space, extra = 0) if(!t) return var last_fields_value = fields //t = html_encode(t) t = replacetext(t, "\n", "
") t = parsepencode(t,,, isCrayon) // Encode everything from pencode to html if(fields > 50)//large amount of fields creates a heavy load on the server, see updateinfolinks() and addtofield() to_chat(usr, "Too many fields. Sorry, you can't do this.") fields = last_fields_value return if(id!="end") addtofield(text2num(id), t) // He wants to edit a field, let him. else info += t // Oh, he wants to edit to the end of the file, let him. updateinfolinks() update_space(t) updateDisplay() update_icon() return if(href_list["confirm"]) switch(alert("Are you sure you want to send the fax as is?",, "Yes", "No")) if("Yes") if(headerOn) info = header + info if(footerOn) info += footer updateinfolinks() usr << browse(null, "window=[name]") admindatum.faxCallback(src, destination) return if(href_list["penmode"]) isCrayon = !isCrayon generateInteractions() updateDisplay() return if(href_list["cancel"]) usr << browse(null, "window=[name]") qdel(src) return if(href_list["clear"]) clearpaper() updateDisplay() return if(href_list["toggleheader"]) headerOn = !headerOn updateDisplay() return if(href_list["togglefooter"]) footerOn = !footerOn updateDisplay() return /obj/item/weapon/paper/admin/get_signature() return input(usr, "Enter the name you wish to sign the paper with (will prompt for multiple entries, in order of entry)", "Signature") as text|null