apl (Append List) SiteCatalyst Plug-in

The apl (or Append List) plug‐in utility provides a simple mechanism to append a value to any delimited lists, with the option of a case sensitive or case‐insensitive check to insure the value doesn’t already exist in the list. The apl plugin is referenced by several standard plug‐ins but can be used directly in a variety of situations.

Plugin Prototype
s.apl(L,v,d,u)

Parameter Descriptions
L = source list, empty list is accepted
V = value to append
d = list delimiter
u = (optional, defaults to 0) Unique value check. 0=no unique check, value is always
appended. 1=case insensitive check, append only if value isn’t in list. 2=case sensitive
check, append only if value isn’t in list.

Example
Here is an example use of the plugin to fire an event on every page. This is commonly
used when you want to create a ‘page view’ event, so you can have a traffic variable
available to be broken down by conversion metrics.

s.events=s.apl(s.events,'event1',',',1);

/*
 * Plugin Utility: apl v1.1
 */
s.apl=new Function("L","v","d","u",""
+"var s=this,m=0;if(!L)L='';if(u){var i,n,a=s.split(L,d);for(i=0;i<a."
+"length;i++){n=a[i];m=m||(u==1?(n==v):(n.toLowerCase()==v.toLowerCas"
+"e()));}}if(!m)L=L?L+d+v:v;return L");