Esempio n. 1
0
 /**
  * @desc Displays the mini calendar. You must call the display method in the same order as the calendars are displayed, because it requires a javascript code loading.
  * @return string The code to write in the HTML page.
  */
 public function display()
 {
     //On crée le code selon le template
     $template = new FileTemplate('framework/util/mini_calendar.tpl');
     $template->put_all(array('DEFAULT_DATE' => !empty($this->date) ? $this->date->format(Date::FORMAT_ISO_DAY_MONTH_YEAR) : '', 'CALENDAR_ID' => $this->html_id, 'CALENDAR_NUMBER' => (string) $this->num_instance, 'DAY' => !empty($this->date) ? $this->date->get_day() : '', 'MONTH' => !empty($this->date) ? $this->date->get_month() : '', 'YEAR' => !empty($this->date) ? $this->date->get_year() : '', 'CALENDAR_STYLE' => $this->style, 'C_INCLUDE_JS' => !self::$js_inclusion_already_done));
     self::$js_inclusion_already_done = true;
     return $template->render();
 }