Example #1
0
 /**
  * Overwrite parent html body. This is the main bulk of the logic. modify at your own risks.
  */
 function createBody()
 {
     // start the week from Mon
     $this->fillArray(1);
     // start rendering table
     for ($i = 0; $i < $this->weeksInMonth; $i++) {
         for ($j = 0; $j < 7; $j++) {
             // check if if is today
             if ($this->today['day'] == $this->cell[$i][$j]['value'] && $this->today['month'] == $this->month && $this->today['year'] == $this->year) {
                 $this->cell[$i][$j]['isToday'] = 1;
             } else {
                 $this->cell[$i][$j]['isToday'] = 0;
             }
             // init defaults
             $this->cell[$i][$j]['link'] = 'none';
             $this->cell[$i][$j]['day'] = $this->cell[$i][$j]['value'];
             // if days with link
             foreach ($this->links as $val) {
                 if ($val['day'] == $this->cell[$i][$j]['value'] && ($val['month'] == $this->month || $val['month'] == '*') && ($val['year'] == $this->year || $val['year'] == '*')) {
                     $this->cell[$i][$j]['day'] = "<a href=\"javascript:;\" title=\"{$val['short_desc']}\">{$this->cell[$i][$j]['value']}</a>";
                     $this->cell[$i][$j]['link'] = 'div';
                     break;
                 }
             }
         }
     }
     // register default body view var
     parent::createBody();
     $view = array();
     $view['cell'] = $this->cell;
     $this->registerView($view);
 }
Example #2
0
 /**
  * Overwrite parent html footer.
  */
 function createFooter()
 {
     // register default footer view var
     parent::createFooter();
     $view = array();
     $view['todayLink'] = "displayQCalendar('{$this->theme}', '{$this->divCalendar}', '{$this->divLongDesc}', '{$this->day}', '{$this->today['month']}','{$this->today['year']}', '{$this->cat_id}')";
     $view['todayText'] = $this->today['day'] . ' ' . date('M', mktime(0, 0, 0, $this->today['month'], 1, $this->today['year'])) . ' ' . $this->today['year'];
     // register view variable
     $this->registerView($view);
 }
Example #3
0
 /**
  * Overwrite parent html footer.
  */
 function createFooter()
 {
     // register default footer view var
     parent::createFooter();
     $view = array();
     $view['prevMonth'] = "<a href=\"javascript:;\" onclick=\"displayQCalendar('{$this->theme}', '{$this->divCalendar}', '{$this->divLongDesc}', '{$this->day}', '{$this->prevMonth}','{$this->pYear}', '{$this->cat_id}')\" class='headerNav' title='Prev Month'><img src=\"" . QCALENDAR_WEB_PATH . "/themes/{$this->theme}/images/prev.gif\"></a>";
     $view['nextMonth'] = "<a href=\"javascript:;\" onclick=\"displayQCalendar('{$this->theme}', '{$this->divCalendar}', '{$this->divLongDesc}', '{$this->day}', '{$this->nextMonth}','{$this->lYear}', '{$this->cat_id}')\" class='headerNav' title='Next Month'><img src=\"" . QCALENDAR_WEB_PATH . "/themes/{$this->theme}/images/next.gif\"></a>";
     // register view variable
     $this->registerView($view);
 }
Example #4
0
 /**
  * Overwrite parent html footer.
  */
 function createFooter()
 {
     // register default footer view var
     parent::createFooter();
 }