twd_events Technical Documentation

Index / Themes

The themes system is comprised of 4 required files.

toc.pl

toc.pl contains the general header information about the theme. We will register our theme with the system via function &RegisterTheme;

&RegisterTheme([theme data], [author data], [theme description]);

You will notice we are passing 2 anon arrays and a string to the function. Values must be passed this way to &RegisterTheme;

&RegisterTheme(["themeID", "version", "theme title", "calender border size"],
["author", "author\@email"],
"Theme Description");

Note: It is VERY IMPORTANT to use the trailing backslash in the email address or PERL will mistake the @ sign as an array

&RegisterThemeSettings([theme settings data], [theme settings default]);

&RegisterThemeSettings; is used to provide a built-in interface to create theme customization via the admin.

Here with both arguments we are passing 2 anon hashes to the registration function

&RegisterThemeSettings(["color_a", "color|Calender Background Color", "color_b", "color|Day Background Color", "admin_link", "checkbox|Display Admin Link?"],
["color_a", "#b2ab9b", "color_b", "#d4d8bd", "admin_link", "1"]);

The value part of each key pair is delimited itself. Pass on values as "type|name|options"
type can be:
text - simple textbox entry
color - uses special color picker entry
checkbox - uses a checkbox entry

You may then retrieve these values in your html template files through hash %THEMESETTING (See the xsnazzy theme included)

The 2nd anon hash contains default values for each setting key

index.template.html

Below are variables useful to this template. This is the main calender view template.

${CalenderTitle} = Inserts the Calender title (change this via calender settings in the admin)
${CalenderData} = Inserts the actual Calender
${statusText} = Inserts contents of the $statusText variable. Useful for displaying status or error information via a plugin.

day.template.html

Below are variables useful to this template. This is a sub-template used to display individual days.

[day] = Inserts the day
${dayEvents} = Inserts the day's events for that day

event.template.html / eventsview.template.html

Below are variables useful to this template. This is the template used when a user clicks on an event text. eventsview.template.html is just a linear view of event data.

${CalenderTitle} = Inserts the Calender title (change this via calender settings in the admin)
${statusText} = Inserts contents of the $statusText variable. Useful for displaying status or error information via a plugin.
${EVENT{'EventTitle'}} = Inserts Event Title.
${EVENT{'EventLocation'}} = Inserts Event Location.
${EVENT{'Date'}} = Inserts Event Date.
${EVENT{'Start'}} = Inserts Event Start Time.
${EVENT{'End'}} = Inserts Event End Time.
${EVENT{'EventDesc'}} = Inserts Event Description Text.