Thursday, February 11, 2010

Creating a Browser Not compatible message

Angel provides a SystemCheck Nugget that you can download from their support center. It works well, and lets your users know if they have all the necessary components installed. Unfortunately, it isn't very "loud" if a user is using an unsupported browser, such as Safari. So today, I am going to detail how to modify the check nugget to have a javascript alert message display.

Additionally, if you aren't the coding type of person, a zipped file with these changes already in place can be found here.

You will only need to modify the default.asp file found in the SystemCheck folder. So open that file now in your favorite editor. Do a find for "switch (caps.browser.type)" (without the quotes). This will take you to the part of the code that you need to edit.

If you wish to display a message to IE 6.0 users add the following code under sBrowserIcon = "explorer";
if (caps.browser.version == "6") {
sBrowserIcon = "whitespace";
sUnsupported = '<tr><td colspan=2><img src="' + sIconPath + 'warning.gif" alt="<%=dLang("Warning")%>" valign=textbottom hspace=2><span style="color:red"><%=dLang("InvalidBrowser")%></span></td></tr>\n';
alert("You have an old version of Internet Explorer. Please use IE 7.0+ or Firefox.");
}
This does two things. It displays a message on the System Check nugget itself that the browser is not supported. Additionally, it will display a popup alert message.

To add one specifically against Safari, you will now add the following code before default:

case 'Safari':
sBrowserIcon = "whitespace";
sUnsupported = '<tr><td colspan=2><img src="' + sIconPath + 'warning.gif" alt="<%=dLang("Warning")%>" valign=textbottom hspace=2><span style="color:red"><%=dLang("InvalidBrowser")%></span></td></tr>\n';
alert("Safari is not a supported browser. Please use Firefox, or if on Windows IE 7 or greater.");
Also be sure to add a break; command before the case 'Safari': line.

If you have any questions, feel free to contact me here or elsewhere.

Cya,
Paul

Monday, February 8, 2010

Adding a 3rd party form in Active Admissions

Recently, I was asked by another college how we successfully implemented forms that we want to submit to third parties, such as our Library system's search network, our Google search, etc. So today, I'm going to cover how that is done. This trick is fairly simple, and best implemented within XSLT.

First you'll create your XSLT document with the following shell...

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ACControl="urn:This:Control" xmlns:ACXslt="urn:ActiveCampus:XSLTLibrary" exclude-result-prefixes="ACControl ACXslt">
<xsl:output method="xml" indent="yes" omit-xml-declaration="yes"/>
<xsl:template match="/">
<!--- Put your Form Here -->
</xsl:template>
</xsl:stylesheet>

As you can see in the middle, I've highlighted where your form code will eventually go.

Now we'll start creating your form. In this example case, we are going to use a simple Google Search. Below is the Textbox for the search.

<input type="text" name="q" />

This is fairly straight forward... now comes the real fun, the Submit Button.

<input type="submit" name="b1" value="Go" onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&quot;b1&quot;, &quot;&quot;, false, &quot;&quot;, &quot;http://www.google.com/search&quot;, false, false))" id="b1" />


Hopefully while looking at this you'll notice that instead of actually putting up a quote, in the XSLT, I am actually putting in encoded quotes. This is very important otherwise it won't work.

While I'm on the subject... this would be much more straight forward if Datatel enabled the ability to insert Javascript directly into their Rich Text Editor. Unfortunately they turn that capability off, and the only way to get it switched is via a programmer switch. So I encourage all Active Admissions users to contact Datatel and submit a request to get it turned on. Part of the reason for this is, that I believe schools should have the capability to use all technology, and not be limited. Give us the freedom to create!

Feel free to post, or contact me if you have any questions on this process.

Cya,
Paul