a½ŲX ¶=ųˆ¶=ųˆ ĢBArialµn¶=ü ÜeWLAND’’’’’’winon disableScript(adrSite) atSuite.disable(adrSite) return(true) €€€ĢŹ@Arialµp¶=ü%Ś3Ÿ«LAND’’’’’’winon enableScript(adrSite) atSuite.enable(adrSite) return(true) €€€ŹVµK¶AŁ0 7 EQ ^j‹• ¢descriptionUrl$http://q.queso.com/altTemplatePlugIn disableScript„ enableScript\flAddToEditorsOnlyMenu flEditors flEnabled relativePathat/3/µP¶=ü version1.0a13 "Arial¶@©¶¶@©½ļ3·®LAND’’’’’’winreturn(atSuite.addTemplatePage()) € œArialµW ¶=ü Ś3–ŸLAND’’’’’’winreturn(atSuite.defaultPage()) €œ£%Arial¶=žė¶@­~ļ3·ØLAND’’’’’’winreturn(atSuite.deleteTemplatePage()) €£”#Arial¶=žė¶=žōļ3·®LAND’’’’’’winreturn(atSuite.editTemplatePage()) €”§)Arial¶AŚę¶AŚļļ3·±LAND’’’’’’winreturn(atSuite.manageAssociationsPage()) €§•Arial¶BȶBÖ(!šŸLAND’’’’’’winreturn(atSuite.view()) €• VµV¶BK  '3 ;G Vb o{ Žš Ÿ #pluginName altTemplate addTemplate„default0deleteTemplateŲ editTemplate‡manageAssociations4viewē ~z.¶=ų—¶=ūś  , < initialConfig2prefsEwebsiteFragmentˆ~ ¶=ų•¶AŚŪ a„eArial¶@© ¶@­Ė/hNŪLAND’’’’’’winon addTemplatePage() local htmlText = "" pta = html.getPageTableAddress() adrAtPrefs = manilaSuite.plugins.getStorageAddress("altTemplate") on add(s) htmlText = htmlText + s + cr pta^.title = "altTemplate: Add Template" if manilaSuite.editors.managingEditorTest(pta) == false add("I'm sorry... you have to be a managing editor of this site in order to use altTemplate.") return(htmlText) if not defined (pta^.postArgs.templateName) add("I'm sorry, there was no template name passed to me to create, so there's not much I can do.") return(htmlText) bundle // do the deed... add("Creating template " + pta^.postArgs.templateName + "...
") if defined (adrAtPrefs^.templates.[pta^.postArgs.templateName]) add("I'm sorry, but the template \"" + pta^.postArgs.templateName + "\" already exists, so obviously, it's tough for me to create it!") return(htmlText) wp.newTextObject("", @adrAtPrefs^.templates.[pta^.postArgs.templateName]) add("Template created. Redirecting to edit page...
") mainresponder.redirect("/at/editTemplate?" + string.urlEncode(pta^.postArgs.templateName)) €€€€€€€€€€€€€€€€€€aö€žArialµ"+±¶AŚŌ@$PƒLAND’’’’’’winon defaultPage() local htmlText = "" pta = html.getPageTableAddress() adrAtPrefs = manilaSuite.plugins.getStorageAddress("altTemplate") on add(s) htmlText = htmlText + s + cr pta^.title = "altTemplate" if manilaSuite.editors.managingEditorTest(pta) == false add("I'm sorry... you have to be a managing editor of this site in order to use altTemplate.") return(htmlText) bundle // build page top add("

This is the master page for altTemplate, where you can add, edit, and delete templates, as well as attach alternate templates to messages.

") add("
") bundle // build the form to add a template add("
") add("

Add Template: enter the name of the template you wish to create:

") add("   ") add("  ") add("

") bundle // build the form to edit a template local sCount add("
") add("

Edit Template: choose the template you wish to edit:

") add("      ") add("") add("

") bundle // build the form to attach a template to a message local sCount add("
") add("

Attach Template to Message: enter the message number, and choose the template you wish to attach to that message:

") add("   ") add("      ") add("") add("

") bundle // manage message/template associations add("
") add("

Manage Template Associations: click below to view all template associations, as well as add and delete new associations.

") add("   ") add("

") bundle // build the form to delete a template local sCount add("
") add("

Delete Template: choose the template you wish to delete:

") add("      ") add("") add("

") bundle // build page footer add("
") add("
altTemplate Plug-In version " + atData.prefs.version + ".
") add("For more information on the plug-in, visit its home page.
") return(htmlText) €€€€€€€€€€€€€€€€€€€„€€€€öćŲ“Arial¶@­„¶@°h$»ACLAND’’’’’’winon deleteTemplatePage() local htmlText = "" pta = html.getPageTableAddress() adrAtPrefs = manilaSuite.plugins.getStorageAddress("altTemplate") confirmDelete = false templateName on add(s) htmlText = htmlText + s + cr pta^.title = "altTemplate: Delete Template" if manilaSuite.editors.managingEditorTest(pta) == false add("I'm sorry... you have to be a managing editor of this site in order to use altTemplate.") return(htmlText) if not defined (pta^.postArgs.templateName) add("I'm sorry, there was no template name passed to me to create, so there's not much I can do.") return(htmlText) templateName = string.urlDecode(pta^.postArgs.templateName) pta^.title = "altTemplate: Delete Template \"" + templateName + "\"" if not defined(adrAtPrefs^.templates.[templateName]) add("

The template \"" + templateName + "\" does not exist, so I can't really delete it!

") return(htmlText) bundle // check to see if this is the first click, or the confirmation click... if defined(pta^.postArgs.confirmDelete) if pta^.postArgs.confirmDelete == "true" confirmDelete = true if confirmDelete == true delete(@adrAtPrefs^.templates.[templateName]) mainResponder.redirect("/at") else add("
") add("") add("") add("

Are you sure that you want to delete the template \"" + templateName + "\"? If so, click on the \"delete template\" button below; otherwise, press the back button in your browser to return to your previous page, or return to the altTemplate home page.

") add("") add("

") return(htmlText) €€€€€€€€€€€€€€€ćH$¬Arialµv¶> M˜FLAND’’’’’’winon disable(adrSite) local adrSiteFrag = manilaSuite.plugins.getSiteFragmentAddress("altTemplate", adrSite) if defined(adrSiteFrag^) delete(adrSiteFrag) return(true) €€€€€€H ®h ĪArial¶=’¶@¬éV&=R¬LAND’’’’’’winon editTemplatePage() local htmlText = "" pta = html.getPageTableAddress() adrAtPrefs = manilaSuite.plugins.getStorageAddress("altTemplate") templateName templateData = "" on add(s) htmlText = htmlText + s + cr on exportOutline (s) s = string.replaceall (s, "\t", " ") s = string.replaceall (s, "&", "&") s = string.replaceall (s, "<", "<") s = string.replaceall (s, ">", ">") s = string.replaceall (s, "{", "{") return (s) pta^.title = "altTemplate: Edit Template" if manilaSuite.editors.managingEditorTest(pta) == false add("I'm sorry... you have to be a managing editor of this site in order to use altTemplate.") return(htmlText) if not defined (pta^.postArgs.templateName) if pta^.searchArgs != "" templateName = string.urlDecode(pta^.searchArgs) else add("I'm sorry, there was no template name passed to me to edit, so there's not much I can do.") return(htmlText) else templateName = string.urlDecode(pta^.postArgs.templateName) pta^.title = "altTemplate: Edit Template \"" + templateName + "\"" if not defined (adrAtPrefs^.templates.[templateName]) add("I'm sorry, but the template \"" + templateName + "\" doesn't exist, so there's not much I can do.") return(htmlText) bundle // build page top add("
return to altTemplate home

") add("

The only requirement in a template submitted with altTemplate is the {bodytext} macro.

") bundle // build the form to edit the template; within, submit the new template if this is a form submission templateData = string(adrAtPrefs^.templates.[templateName]) if defined (pta^.postArgs.templateData) local tmpTemplateData = pta^.postArgs.templateData errorString if manilaSuite.admin.isGoodTemplate(tmpTemplateData + "{editorialMenu}", @errorString, nil, false) tmpTemplateData = mainResponder.neuterText(tmpTemplateData, true, false) delete(@adrAtPrefs^.templates.[templateName]) wp.newTextObject(tmpTemplateData, @adrAtPrefs^.templates.[templateName]) templateData = tmpTemplateData add("" + manilaSuite.getString ("admin.templateUpdateSuccess", pta: pta) + " (" + clock.now() + ")") else templateData = tmpTemplateData add("" + exportOutline(errorString) + "") add("
") add("") add("
") add("") add("
") bundle // build page footer add("
") add("
altTemplate Plug-In version " + atData.prefs.version + ".
") add("For more information on the plug-in, visit its home page.
") return(htmlText) €€€€€€€€€€€€€€€€€€€€ ®:<†Arialµr¶AŚ!dżSLAND’’’’’’winon enable(adrSite) local adrSiteFrag = manilaSuite.plugins.getSiteFragmentAddress("altTemplate", adrSite) adrAtPrefs = manilaSuite.plugins.getStorageAddress("altTemplate") adrSiteFrag^ = atData.websiteFragment if not defined (adrAtPrefs^.templates) new (tableType, @adrAtPrefs^.templates) if not defined (adrAtPrefs^.msgList) new (tableType, @adrAtPrefs^.msgList) return(true) €€€€€€€€:B¬Arial¶=łL¶>.JSĀLAND’’’’’’winlocal adrMacros = @atMacros adrVirginConfig = @atData.initialConfig atSuite.setUpSubscriptionPrefs() return(manilaSuite.plugins.register("altTemplate", adrVirginConfig)) €€€€€BšF2Arial¶AŚś¶Bµc+G†LAND’’’’’’winon manageAssociationsPage() local htmlText = "" pta = html.getPageTableAddress() adrAtPrefs = manilaSuite.plugins.getStorageAddress("altTemplate") msgNumber = "", msgPath = "", templateName = "", action addErrorString = "" on add(s) htmlText = htmlText + s + cr pta^.title = "altTemplate: Manage Associations" if manilaSuite.editors.managingEditorTest(pta) == false add("I'm sorry... you have to be a managing editor of this site in order to use altTemplate.") return(htmlText) bundle // deal with any posted arguments if defined(pta^.postArgs.action) case pta^.postArgs.action "add" msgNumber = string.padWithZeros(pta^.postArgs.msgNum, 7) templateName = pta^.postArgs.templateName msgPath = pta^.postArgs.msgPath if (string.dropNonAlphas(msgPath) == msgPath) and (string.dropNonAlphas(msgPath) != "") if defined(pta^.discussionGroup^.messages.[msgNumber]) if manilaSuite.discuss.isStory(@pta^.discussionGroup^.messages.[msgNumber], pta^.adrSiteRootTable) new(tableType, @adrAtPrefs^.msgList.[msgPath]) adrAtPrefs^.msgList.[msgPath].msgNum = msgNumber adrAtPrefs^.msgList.[msgPath].template = string.urlDecode(templateName) msgNumber = "" templateName = "" msgPath = "" else addErrorString = "This message isn't a story, so it can't be rendered through an alternate template." else addErrorString = "The message number you entered does not exist." else addErrorString = "The new path can contain only letters and numbers, and must contain at least one character." "edit" msgPath = pta^.postArgs.path msgNumber = string.padWithZeros(adrAtPrefs^.msgList.[msgPath].msgNum, 7) templateName = string.urlEncode(adrAtPrefs^.msgList.[msgPath].template) "delete" msgPath = pta^.postArgs.path delete(@adrAtPrefs^.msgList.[msgPath]) msgPath = "" bundle // build page top add("

Here, you can view all of the message/template associations you have made, as well as add and delete associations.

") add("
") bundle // build the form to add or edit an association local sCount add("
") add("") add("

Add/Edit an Association: type in the message number and choose the template you would like to associate with it, and then type in the path you would like to use to access the message rendered in that template. Note that, as of now, you can only associate alternate templates with messages that have been elevated to stories.

") if addErrorString != "" add("

" + addErrorString + "

") add("   ") add("   "); add("   ") add("   ") add("
") add("
") bundle // build the table to show and delete associations local sCount add("

Current Associations: here's a list of all of the current message/template associations, along with the paths that access those associations.

") add("
") add("") bundle // header row of table add("") add("") add("") add("") add("") add("") add("") for sCount = 1 to sizeOf(adrAtPrefs^.msgList) add("") add("") add("") add("") add("") add("") add("") add("
pathmsg numtemplate  
" + nameOf(adrAtPrefs^.msgList[sCount]) + "" + string.padWithZeros(adrAtPrefs^.msgList[sCount].msgNum, 7) + "" + adrAtPrefs^.msgList[sCount].template + "
") add("
") bundle // build page footer add("
") add("
altTemplate Plug-In version " + atData.prefs.version + ".
") add("For more information on the plug-in, visit its home page.
") return(htmlText) €€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€š„ Arial¶=łŠ¶>4Dķ9LAND’’’’’’winlocal adrPrefs = @user.rootUpdates.servers.altTemplate if not defined (adrPrefs^) new (tableType, adrPrefs) if not defined (adrPrefs^.autobackup) adrPrefs^.autobackup = true if not defined (adrPrefs^.dbname) adrPrefs^.dbname = "altTemplate.root" if not defined (adrPrefs^.dialogs) adrPrefs^.dialogs = true if not defined (adrPrefs^.lastUpdate) adrPrefs^.lastUpdate = "Thu, 01 Apr 2000 00:00:01 GMT" if not defined (adrPrefs^.method) adrPrefs^.method = "mainResponder.subscriptions.update" if not defined (adrPrefs^.port) adrPrefs^.port = 80 if not defined (adrPrefs^.serialNum) adrPrefs^.serialNum = 0 if not defined (adrPrefs^.server) adrPrefs^.server = "manilaupdates.queso.com" if not defined (adrPrefs^.url) adrPrefs^.url = "http://q.queso.com/altTemplatePlugIn" €€€€€€€€€€€€€€€€€€€€€€ÓسArial¶B޶B #^GqLAND’’’’’’winon view() local htmlText = "" pta = html.getPageTableAddress() adrAtPrefs = manilaSuite.plugins.getStorageAddress("altTemplate") passedPath msgNumber templateName, templateData on add(s) htmlText = htmlText + s + cr if pta^.pathArgs == "" pta^.title = "altTemplate Viewer" add("No path was pased in, so I can't do much here.") return(htmlText) passedPath = string.urlDecode(pta^.pathArgs) if not defined(adrAtPrefs^.msgList.[passedPath]) pta^.title = "altTemplate Viewer" add("The path you are trying to view does not exist.") return(htmlText) msgNumber = string.padWithZeros(adrAtPrefs^.msgList.[passedPath].msgNum, 7) templateName = adrAtPrefs^.msgList.[passedPath].template if not defined(adrAtPrefs^.templates.[templateName]) pta^.title = "altTemplate Viewer" add("The path you are trying to view has template \"" + templateName + "\" associated with it, but that template doesn't exist. You may want to go back to the altTemplate management pages and associate an existing template with this path.") return(htmlText) templateData = string(adrAtPrefs^.templates.[templateName]) pta^.template = templateData return(manilaSuite.storyReader(msgNumber, pta)) €€€€€€€€€€€€€€€€€€€Ó~zt¶=ų“¶BP  (4 GS [g x„ ‹— Ÿ« ĀĪ åń öaddTemplatePage S defaultPageĄdeleteTemplatePageĀdisable(±editTemplatePage*enable7æinstall:manageAssociationsPage;SsetUpSubscriptionPrefsUOviewYa~ē8¶=ųv¶=ų—  ( 1= E#changesXatDataatMacros 'atSuite_@VArial³22Q(Ņēŗ`Ź+ž»Arial ’’’’’’’’ MS Sans Serif ZÆTimes New Roman &0€¶Arial 5!qÅArial ’’’’’’’’ MS Sans Serif ’’ŗ