Ignore:
Timestamp:
Nov 17, 2013, 4:03:32 PM (10 years ago)
Author:
mistic100
Message:

feature 2999 : documentation of include/functions_calendar.inc.php and Calendar classes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/calendar_base.class.php

    r23618 r25507  
    2323
    2424/**
     25 * @package functions\calendar
     26 */
     27
     28
     29/**
    2530 * Base class for monthly and weekly calendar styles
    2631 */
    27 class CalendarBase
     32abstract class CalendarBase
    2833{
    29   // db column on which this calendar works
     34  /** db column on which this calendar works */
    3035  var $date_field;
    31   // used for queries (INNER JOIN or normal)
     36  /** used for queries (INNER JOIN or normal) */
    3237  var $inner_sql;
    33   //
     38  /** used to store db fields */
    3439  var $calendar_levels;
    3540
    3641  /**
    37    * Initialize the calendar
    38    * @param string inner_sql used for queries (INNER JOIN or normal)
     42   * Generate navigation bars for category page.
     43   *
     44   * @return boolean false indicates that thumbnails where not included
     45   */
     46  abstract function generate_category_content();
     47
     48  /**
     49   * Returns a sql WHERE subquery for the date field.
     50   *
     51   * @param int $max_levels (e.g. 2=only year and month)
     52   * @return string
     53   */
     54  abstract function get_date_where($max_levels);
     55
     56  /**
     57   * Initialize the calendar.
     58   *
     59   * @param string $inner_sql
    3960   */
    4061  function initialize($inner_sql)
     
    5273  }
    5374
     75  /**
     76   * Returns the calendar title (with HTML).
     77   *
     78   * @return string
     79   */
    5480  function get_display_name()
    5581  {
     
    83109  }
    84110
    85 //--------------------------------------------------------- private members ---
    86   /**
    87    * Returns a display name for a date component optionally using labels
    88   */
    89   function get_date_component_label($level, $date_component)
     111  /**
     112   * Returns a display name for a date component optionally using labels.
     113   *
     114   * @return string
     115   */
     116  protected function get_date_component_label($level, $date_component)
    90117  {
    91118    $label = $date_component;
     
    102129
    103130  /**
    104    * Gets a nice display name for a date to be shown in previos/next links.
    105    */
    106   function get_date_nice_name($date)
     131   * Gets a nice display name for a date to be shown in previous/next links
     132   *
     133   * @param string $date
     134   * @return string
     135   */
     136  protected function get_date_nice_name($date)
    107137  {
    108138    $date_components = explode('-', $date);
     
    126156   * Creates a calendar navigation bar.
    127157   *
    128    * @param array date_components
    129    * @param array items - hash of items to put in the bar (e.g. 2005,2006)
    130    * @param bool show_any - adds any link to the end of the bar
    131    * @param bool show_empty - shows all labels even those without items
    132    * @param array labels - optional labels for items (e.g. Jan,Feb,...)
    133    * @return string the navigation bar
    134    */
    135   function get_nav_bar_from_items($date_components, $items,
     158   * @param array $date_components
     159   * @param array $items - hash of items to put in the bar (e.g. 2005,2006)
     160   * @param bool $show_any - adds any link to the end of the bar
     161   * @param bool $show_empty - shows all labels even those without items
     162   * @param array $labels - optional labels for items (e.g. Jan,Feb,...)
     163   * @return string
     164   */
     165  protected function get_nav_bar_from_items($date_components, $items,
    136166                                  $show_any,
    137167                                  $show_empty=false, $labels=null)
     
    204234   * Creates a calendar navigation bar for a given level.
    205235   *
    206    * @param int level - the level (0-year,1-month/week,2-day)
    207    * @return void
    208    */
    209   function build_nav_bar($level, $labels=null)
     236   * @param int $level - 0-year, 1-month/week, 2-day
     237   */
     238  protected function build_nav_bar($level, $labels=null)
    210239  {
    211240    global $template, $conf, $page;
     
    262291   * the currently choosen date.
    263292   */
    264   function build_next_prev()
     293  protected function build_next_prev()
    265294  {
    266295    global $template, $page;
     
    344373  }
    345374}
     375
    346376?>
Note: See TracChangeset for help on using the changeset viewer.