Class CalendarSolution_List

Description

The parent class for displaying collections of events

Located in /include/CalendarSolution/List.php (line 20)

CalendarSolution
   |
   --CalendarSolution_List
Direct descendents
Class Description
CalendarSolution_List_MonthTitle The means to output collections of events formatted as a table of the date and name of each event and is grouped by month
CalendarSolution_List_Ul The means to output collections of events formatted as an "unordered list" of the date and name of each event
CalendarSolution_List_Calendar The means to output collections of events formatted as a calendar grid with brief info about each event
CalendarSolution_List_QuickTable The means to output collections of events formatted as a table with basic info about each entry
CalendarSolution_List_Title The means to output collections of events formatted as a table of the date and name of each event
CalendarSolution_List_Icalendar The means to output collections of events formatted as a set of iCalendar VEVENT entries
CalendarSolution_List_List The means to output collections of events formatted as a table with significant info about each event
CalendarSolution_List_DetailTable The means to output collections of events formatted as a table with details about each entry
Variable Summary
string $cache_key
array $category_id
array $data
DateTimeSolution $from
string $is_own_event
DateTimeSolution $next_from
DateTimeSolution $next_to
int $page_id
DateTimeSolution $permit_future_date
DateTimeSolution $permit_history_date
DateTimeSolution $prior_from
DateTimeSolution $prior_to
string $time_format
DateTimeSolution $to
string $where_sql
Method Summary
static CalendarSolution_List_Calendar|CalendarSolution_List_List factory_chosen_view ([integer $months = 3], [string $dbms = CALENDAR_SOLUTION_DBMS])
CalendarSolution_List __construct ([integer $months = 3], [string $dbms = CALENDAR_SOLUTION_DBMS])
string get_change_view ([string $phrase = 'View the events in %s format'], [string $list = 'list'], [string $calendar = 'calendar'])
string get_css_name ()
string get_date_navigation ([string $prior_link = '< See Earlier Events'], [string $next_link = 'See Later Events >'])
string get_limit_form ([array $show = array('datebox', 'category', 'event', 'remove')])
string get_limit_navigation ([string $prior_link = '< prior'], [string $next_link = 'next >'])
string get_link (array $event)
string get_view ()
DateIntervalSolution interval_singleton ()
void run_query ()
void set_category_id ([mixed $in = null])
void set_category_id_not ([mixed $in = null])
void set_date_format (int $in)
void set_frequent_event_id ([mixed $in = null])
void set_frequent_event_id_not ([mixed $in = null])
void set_from ([mixed $in = null])
void set_is_own_event ([mixed $in = null])
void set_limit (mixed $quantity, [mixed $start = false])
void set_page_id (int $in)
void set_permit_future_months ([mixed $months = 12])
void set_permit_history_months ([mixed $months = 12])
void set_show_cancelled (bool $in)
void set_show_location (bool $in)
void set_show_own_events_first (bool $in)
void set_show_summary (bool $in)
void set_time_format (int $in)
void set_to ([mixed $in = null])
void set_where_sql ()
Variables
string $cache_count_key (line 25)

The cache key identifying the number of rows found in a data set

string $cache_key (line 31)

The data cache key for the current view

bool $called_set_prior_and_next_dates = false (line 37)

Has set_prior_and_next_dates() been called?

  • access: protected
bool $called_set_request_properties = false (line 43)

Has set_request_properties() been called?

  • access: protected
array $category_id (line 49)

The category ids to show events for

array $category_id_not (line 55)

The category ids to not show events for

array $data (line 61)

The records to be displayed


Redefinition of:
CalendarSolution::$data
An associative array of the given item's data
int $frequent_event_id (line 67)

The frequent event id to show events for

array $frequent_event_id_not (line 73)

The frequent event id to not show events for

DateTimeSolution $from (line 79)

The start of the date range to show events for in the current request

string $interval_spec (line 85)

The DateIntervalSolution specification for how many months to show at once

string $is_own_event (line 95)

Only show events sponsored by you ("Y") or only those sponsored by another organization ("N")?

All events are shown if this is empty.

int $limit_quantity (line 101)

The number of items to show

int $limit_start (line 107)

The zero-based row index to start the limit on

DateTimeSolution $next_from (line 114)

The start of the date range to show events for if the user navigates

to later events

DateTimeSolution $next_to (line 121)

The end of the date range to show events for if the user navigates

to later events

int $page_id (line 127)

The page id to show events for

DateTimeSolution $permit_future_date (line 133)

The furthest date in the future users are allowed to see

DateTimeSolution $permit_history_date (line 139)

The furthest date in the past users are allowed to see

DateTimeSolution $prior_from (line 146)

The start of the date range to show events for if the user navigates

to earlier events

DateTimeSolution $prior_to (line 153)

The end of the date range to show events for if the user navigates

to earlier events

bool $show_cancelled = true (line 159)

Should cancelled events be shown or not?

bool $show_location = true (line 169)

Should the Location field be shown or not when viewing "Calendar" mode?

NOTE: needs to be in CalendarSolution_List class due to ability switch between Calendar and List views.

bool $show_own_events_first = false (line 175)

Show your own events before events produced by other organizations?

bool $show_summary = true (line 185)

Should the Summary field be shown or not when viewing "List" mode?

NOTE: needs to be in CalendarSolution_List class due to ability switch between Calendar and List views.

string $time_format = self::DATE_FORMAT_TIME_12AP (line 194)

Format for PHP's date() function, to be used by our format_date() method

DateTimeSolution $to (line 200)

The end of the date range to show events for in the current request

int $total_rows (line 206)

How many rows the entire result set has

  • access: protected
string $where_sql (line 212)

The SQL WHERE clause for the current view

Inherited Variables

Inherited from CalendarSolution

CalendarSolution::$cache
CalendarSolution::$cache_available
CalendarSolution::$csrf_token_name
CalendarSolution::$http_host
CalendarSolution::$sql
CalendarSolution::$uri
CalendarSolution::$use_cache
Methods
static factory_chosen_view (line 254)

Looks at $_REQUEST['view'] then $_COOKIE['CalendarSolution'] to determine whether to return a CalendarSolution_List_Calendar (the default) or CalendarSolution_List_List object

WARNING: this function sets a cookie, so MUST be called before ANY output is sent to the browser.

  • todo: Adjust cookie expiration date as the year 2038 approaches.
  • access: public
static CalendarSolution_List_Calendar|CalendarSolution_List_List factory_chosen_view ([integer $months = 3], [string $dbms = CALENDAR_SOLUTION_DBMS])
  • integer $months: how many months should be shown at once
  • string $dbms: optional override of the database extension setting in CALENDAR_SOLUTION_DBMS. Values can be "mysql", "mysqli", "pgsql", "sqlite", "sqlite3".
Constructor __construct (line 231)

Calls the parent constructor and set_uri() then populates the "$interval_spec" property

CalendarSolution_List __construct ([integer $months = 3], [string $dbms = CALENDAR_SOLUTION_DBMS])
  • integer $months: how many months should be shown at once
  • string $dbms: optional override of the database extension setting in CALENDAR_SOLUTION_DBMS. Values can be "mysql", "mysqli", "pgsql", "sqlite", "sqlite3".

Redefinition of:
CalendarSolution::__construct()
Instantiates the database and cache classes then sets the $http_host property
get_change_view (line 325)

Produces the HTML for changing between "List" and "Calendar" formats

string get_change_view ([string $phrase = 'View the events in %s format'], [string $list = 'list'], [string $calendar = 'calendar'])
  • string $phrase: the sprintf formatted string to be displayed. Must contain one "%s" conversion specification, where the "$list" or "$calendar" parameter text will be inserted by this method as appropriate
  • string $list: the text for the "list" view. The value is passed through htmlspecialchars().
  • string $calendar: the text for the "calendar" view. The value is passed through htmlspecialchars().
get_css_name (line 371)

Provides the path and name of the needed Cascading Style Sheet file

  • return: the path and name of the CSS file
  • access: public
string get_css_name ()

Redefined in descendants as:
get_date_navigation (line 415)

Produces the HTML for navigating to earlier and later events

Inteneded for use with the "Calendar," "List," and "MonthTitle" formats.

NOTE: will return an empty string if "$from" or "$to" are false.

string get_date_navigation ([string $prior_link = '< See Earlier Events'], [string $next_link = 'See Later Events >'])
  • string $prior_link: the text for the "prior" link. The value is passed through htmlspecialchars().
  • string $next_link: the text for the "next" link. The value is passed through htmlspecialchars().
get_limit_form (line 502)

Produces the HTML for the form people can use to pick date ranges and particular events

NOTE: "datelist" will not be displayed if "$from", "$to", "$permit_history_date", or "$permit_future_date" are false.

string get_limit_form ([array $show = array('datebox', 'category', 'event', 'remove')])
  • array $show: a list of elements to show ("datebox", "datelist", "category", "event", "remove")
get_limit_navigation (line 706)

Produces the prior/next links for use in conjunction with set_limit()

For this navigation to work properly, set_limit()'s "$start" parameter must be set to NULL. For example: set_limit(10, null).

NOTE: This must be called after get_rendering(). An empty string will be returned if called before get_rendering().

  • return: the navigation elements if the $start parameter is enabled in set_limit() and get_rendering() has been called, an empty string if not
  • see: CalendarSolution_List::set_limit()
  • since: Method available since version 3.0
  • access: public
  • uses: CalendarSolution::$uri - to know the current URI
string get_limit_navigation ([string $prior_link = '< prior'], [string $next_link = 'next >'])
  • string $prior_link: the text for the "prior" link. The value is passed through htmlspecialchars().
  • string $next_link: the text for the "next" link. The value is passed through htmlspecialchars().
get_link (line 751)

Figures out what link should be shown for this item

  • return: the hyperlink and/or title
  • access: public
  • uses: CALENDAR_SOLUTION_LINK_PATH - for pointing links to the calendar-detail.php page in the right direction
string get_link (array $event)
  • array $event: the associative array of the current item
get_view (line 782)

Says which view class is being used

  • return: the view being used
  • since: Method available since version 3.0
  • access: public
string get_view ()
interval_singleton (line 795)

Creates a DateIntervalSolution object indicating how many months should be displayed at one time

DateIntervalSolution interval_singleton ()
run_query (line 823)

Assembles the query string then executes it

void run_query ()
set_category_id (line 956)

Sets the "category_id" property to the appropriate value

void set_category_id ([mixed $in = null])
  • mixed $in:
      • FALSE = set the value to FALSE
      • integer = an integer, falling back to FALSE if
      the input is is invalid
      • array of integers = if each element is not an integer
      then the value will be set to FALSE
    set_category_id_not (line 996)

    Sets the "category_id_not" property to the appropriate value

    void set_category_id_not ([mixed $in = null])
    • mixed $in:
        • FALSE = set the value to FALSE
        • integer = an integer, falling back to FALSE if
        the input is is invalid
        • array of integers = if each element is not an integer
        then the value will be set to FALSE
      set_date_format (line 1030)

      Sets the date format to be used by our format_date() method

      • see: CalendarSolution::format_date()
      • since: Method available since version 3.0
      • access: public
      • uses: CalendarSolution_List::$date_format - to store the data
      void set_date_format (int $in)
      • int $in: the format used by PHP's date() function
      set_frequent_event_id (line 1048)

      Sets the "frequent_event_id" property to the appropriate value

      void set_frequent_event_id ([mixed $in = null])
      • mixed $in:
          • FALSE = set the value to FALSE
          • integer = an integer, falling back to FALSE if
          the input is is invalid
        set_frequent_event_id_not (line 1077)

        Sets the "frequent_event_id_not" property to the appropriate value

        void set_frequent_event_id_not ([mixed $in = null])
        • mixed $in:
            • FALSE = set the value to FALSE
            • integer = an integer, falling back to FALSE if
            the input is is invalid
            • array of integers = if each element is not an integer
            then the value will be set to FALSE
          set_from (line 1125)

          Sets the "from" property

          CalendarSolution_List::set_from() defaults to today. CalendarSolution_List_Calendar::set_from() defaults to the first day of today's month.

          NOTE: "from" is reset to "permit_history_date" if "from" is earlier than "permit_history_date"

          void set_from ([mixed $in = null])
          • mixed $in:
              • TRUE = use value of $_REQUEST['from'] if it is set,
              use the default if it is invalid, use FALSE if not set
              • FALSE = set the value to FALSE
              • string = a date in YYYY-MM-DD format though uses
              the default if it is invalid

            Redefined in descendants as:
            set_is_own_event (line 1170)

            Sets the "is_own_event" property to the appropriate value

            "Y" means only show events sponsored by your organization. "N" means only show events sponsored by other organizations. All events are shown if this is empty/unset/false.

            void set_is_own_event ([mixed $in = null])
            • mixed $in:
                • FALSE = set the value to FALSE
                • "Y" or "N" = falling back to FALSE if
                the input is is invalid
              set_limit (line 1218)

              Sets the "limit_quantity" and "limit_start" properties

              Intended for use with the "QuickTable" and "Title" formats.

              To have lists show only the first ten events: set_limit(10)

              To have lists show the first ten events and possibly show navigation to later events: set_limit(10, null). One must also call get_limit_navigation() to get the navigation to show up.

              void set_limit (mixed $quantity, [mixed $start = false])
              • mixed $quantity: the number of rows to show
                • NULL = use value of $_REQUEST['limit_quantity']
                though set it to FALSE if it is not set or invalid
                • FALSE = set the value to FALSE
                • integer = an integer, falling back to FALSE if
                the input is is invalid
              • mixed $start: the row to start on. Is zero indexed, so 0 starts on the first row, 10 starts on the 11th row, etc.
                • NULL = use value of $_REQUEST['limit_start']
                though set it to 0 if it is not set or FALSE if invalid
                • FALSE = set the value to FALSE
                • integer = an integer, falling back to FALSE if
                the input is is invalid
                • Gets set to FALSE if $quantity is empty()
              set_page_id (line 1254)

              Sets the Featured Page "page_id" property to the appropriate value

              void set_page_id (int $in)
              • int $in: the featured page id to get the list for
              set_permit_future_months (line 1281)

              Sets the furthest date in the future users are allowed to see

              NOTE: if the "to" property is later than this, "to" is reset to this.

              void set_permit_future_months ([mixed $months = 12])
              • mixed $months:
                  • FALSE = unlimited
                set_permit_history_months (line 1319)

                Sets the furthest date in the past users are allowed to see

                NOTE: if the "from" property is earlier than this, "from" is reset to this.

                void set_permit_history_months ([mixed $months = 12])
                • mixed $months:
                    • FALSE = unlimited
                  set_prior_and_next_dates (line 1361)

                  Sets the properties used later when generating the navigation elements for getting to earlier and later events

                  NOTE: Does nothing if "$from" or "$to" are false.

                  void set_prior_and_next_dates ()
                  set_request_properties (line 1432)

                  Sets all properties that can be populated with $_REQUEST data, but does so only for properties that have not been set yet

                  void set_request_properties ()
                  set_show_cancelled (line 1473)

                  Should cancelled events be shown or not?

                  void set_show_cancelled (bool $in)
                  • bool $in: pass FALSE to leave out cancelled events, is TRUE by default
                  set_show_location (line 1491)

                  Turns the Location field on or off when showing the "Calendar" format

                  void set_show_location (bool $in)
                  • bool $in: pass FALSE to not show locations, is TRUE by default
                  set_show_own_events_first (line 1511)

                  Show your own events before events produced by other organizations?

                  Items are normally sorted by date then start time. Enabling this option still sorts items by date, but within each day your events are shown first, sorted by time, then events by organizations are shown sorted by time.

                  void set_show_own_events_first (bool $in)
                  • bool $in: pass TRUE to show your own events first, is FALSE by default
                  set_show_summary (line 1527)

                  Turns the Summary field on or off when showing the "List" format

                  void set_show_summary (bool $in)
                  • bool $in: pass FALSE to not show summaries, is TRUE by default
                  set_time_format (line 1543)

                  Sets the time format to be used by our format_date() method

                  void set_time_format (int $in)
                  • int $in: the format used by PHP's date() function
                  set_to (line 1570)

                  Sets the "to" property (defaults to the last day of the month occurring $interval_spec months from today)

                  NOTE: "to" is reset to "permit_future_date" if "to" is later than "permit_future_date".

                  void set_to ([mixed $in = null])
                  • mixed $in:
                      • TRUE = use value of $_REQUEST['to'] if it is set,
                      use the default if it is invalid, use FALSE if not set
                      • FALSE = set the value to FALSE
                      • string = a date in YYYY-MM-DD format though uses
                      the default if it is invalid
                    set_where_sql (line 1634)

                    Generates the SQL WHERE clause and cache keys for data retrieval

                    This has been separated out from run_query() to facilitate cache lookups by the various get_rendering() methods.

                    void set_where_sql ()

                    Inherited Methods

                    Inherited From CalendarSolution

                    CalendarSolution::__construct()
                    CalendarSolution::convert_windows_characters()
                    CalendarSolution::escape_data_for_html()
                    CalendarSolution::escape_for_icalendar()
                    CalendarSolution::flush_cache()
                    CalendarSolution::format_date()
                    CalendarSolution::get_admin_navigation()
                    CalendarSolution::get_credit()
                    CalendarSolution::get_css()
                    CalendarSolution::get_date_from_request()
                    CalendarSolution::get_errors()
                    CalendarSolution::get_event_formatted_icalendar()
                    CalendarSolution::get_int_array_from_request()
                    CalendarSolution::get_int_from_request()
                    CalendarSolution::get_string_from_request()
                    CalendarSolution::is_admin()
                    CalendarSolution::is_cache_available()
                    CalendarSolution::set_data_empty()
                    CalendarSolution::set_data_from_post()
                    CalendarSolution::set_uri()
                    CalendarSolution::validate_csrf_token()
                    Class Constants

                    Documentation generated on Wed, 21 Mar 2012 14:16:43 -0400 by phpDocumentor 1.4.4