Skip Navigation

UNL_UCBCN_Frontend API Documentation

Developers, developers, developers, devel…

Class UNL_UCBCN_Frontend

Description

This is the basic frontend output class through which all output to the public is generated. This class handles the determination of what view the user requested and what information to send.

Located in /UNL/UCBCN/Frontend.php (line 32)

UNL_UCBCN
   |
   --UNL_UCBCN_Frontend
Direct descendents
Class Description
UNL_UCBCN_Frontend_Search Container for search results for the frontend.
Variable Summary
UNL_UCBCN_Calendar $calendar
int $day
string $format
string $manageruri
int $month
mixed $output
string $right
string $sectitle
string $uniquebody
string $uri
string $uriformat
string $view
int $year
Method Summary
UNL_UCBCN_Frontend __construct (array $options)
bool dayHasEvents (string $epoch, [UNL_UCBCN_Calendar $calendar = null])
String dbStringToHtml (string $t)
array determineView ([string $method = 'GET'])
void displayImage ()
string formatURL (array $values, [bool $encode = true])
string getCacheKey ()
int getCalendarID (string $shortname)
void getCalendarsByStatus (string $status)
int getCalendarShortname (int $id)
object UNL_UCBCN_EventInstance getEventInstance (int $id, [UNL_UCBCN_Calendar $calendar = null])
void getEventTypes ()
void preRun ([bool $cache_hit = false])
string reformatURL (string $url, array $values)
void run ()
string uriFormat ([string $set = null])
Variables
UNL_UCBCN_Calendar $calendar (line 39)

Calendar UNL_UCBCN_Calendar Object

  • access: public

Redefined in descendants as:
int $day (line 60)

Day to show events for

  • access: public
int $eventdatetime_id = null (line 67)

Specific eventdatetime_id (if used)

  • access: public
string $format = 'html' (line 130)

format of view

  • access: public
string $manageruri = '' (line 88)

URI to the management interface UNL_UCBCN_Manager

  • var: EG: http://events.unl.edu/manager/
  • access: public
int $month (line 53)

Month the user is viewing.

  • access: public
mixed $output (line 109)

Main content of the page sent to the client.

  • access: public

Redefined in descendants as:
string $right (line 95)

Right column (usually the month widget)

  • access: public
string $sectitle (line 116)

Section Title

  • access: public
string $uniquebody (line 102)

Unique body ID

  • access: public
string $uri = '' (line 74)

URI to the management frontend

  • access: public
string $uriformat = 'querystring' (line 81)

Format of URI's querystring|rest

  • access: public
string $view = 'day' (line 123)

View to be displayed

  • access: public
int $year (line 46)

Year the user is viewing.

  • access: public
Methods
Constructor __construct (line 137)

Constructor for the frontend.

UNL_UCBCN_Frontend __construct (array $options)
  • array $options: Associative array of options for the frontend.

Redefined in descendants as:
dayHasEvents (line 628)

This function checks if a calendar has events on the day requested.

  • return: true or false
bool dayHasEvents (string $epoch, [UNL_UCBCN_Calendar $calendar = null])
  • string $epoch: Unix epoch of the day to check.
  • UNL_UCBCN_Calendar $calendar: The calendar to check.
dbStringToHtml (line 614)

This function converts a string stored in the database to html output.

& becomes & etc.

  • return: encoded for output to html.
String dbStringToHtml (string $t)
  • string $t: Normally a varchar string from the database.
determineView (line 452)

This function attempts to determine the view parameters for the frontend output.

  • return: options to be sent to the constructor.
array determineView ([string $method = 'GET'])
  • string $method: The HTTP method to use for determining views-GET | POST
displayImage (line 660)

When the image view is set, the image for a given event will be displayed to the end user. $_GET['id'] must be set to the event.id which has the image.

void displayImage ()
formatURL (line 316)

Returns a formatted URL.

  • return: URL to a frontend which has the data in the format requested.
string formatURL (array $values, [bool $encode = true])
  • array $values: Associative array of the values to add to the URL
  • bool $encode: If true and format is querystring, ampersands will be &
getCacheKey (line 525)

Get's a uniqe key for this object for reference in cache.

  • return: A unique identifier for this view of the calendar.
string getCacheKey ()
getCalendarID (line 560)

Gets the calendar id from a shortname.

  • return: id on success, false on error.
int getCalendarID (string $shortname)
  • string $shortname: The value for the shortname field in the calendar table.
getCalendarsByStatus (line 578)

Get a list of calendars with a given status

void getCalendarsByStatus (string $status)
  • string $status: The value of the status in the calendar table
getCalendarShortname (line 543)

Returns a calendar shortname for the calendar with the given ID.

  • return: on success, false on error.
int getCalendarShortname (int $id)
  • int $id: Calendar ID within the database.
getEventInstance (line 290)

Gets the specified event instance.

  • return: on success UNL_UCBCN_Error on error.
object UNL_UCBCN_EventInstance getEventInstance (int $id, [UNL_UCBCN_Calendar $calendar = null])
  • int $id: The id of the event instance to get.
  • UNL_UCBCN_Calendar $calendar: The calendar to get the event for.
getEventTypes (line 595)

Get a list of event types

void getEventTypes ()
preRun (line 163)

This function is called before the run() function to handle any details prior to populating the data in the object, and sends output headers.

void preRun ([bool $cache_hit = false])
  • bool $cache_hit: if data is already cached or not.
reformatURL (line 396)

This function is for reformmating URL address. IE, you have the url to the object, but simply want to change the format to ics etc.

  • return: The URL reformatted to a different output format.
string reformatURL (string $url, array $values)
  • string $url: Url of the form http://
  • array $values: Associative array of values to apply. format
run (line 194)

Runs/builds the frontend object with the display parameters set.

This function will populate all of the output and member variables with the data for the current view.

void run ()

Redefined in descendants as:
  • UNL_UCBCN_Frontend_Search::run() : Runs the query on the database from the calendar, currently supports two types of searches - textual or date and time hinted by passing a string supported by the strtotime() function.
uriFormat (line 420)

Sets and/or returns the uri format.

  • return: rest or querystring
string uriFormat ([string $set = null])
  • string $set: optional string, pass it to set the uriFormat, don't pass it to retrieve.

Documentation generated on Wed, 12 Aug 2009 13:00:47 -0500 by phpDocumentor 1.4.2