Esempio n. 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);
 }
Esempio n. 2
0
 /**
  * Overwrite parent html body. This is the main bulk of the logic. modify at your own risks.
  */
 function createBody()
 {
     /*
      * Main Bulk of logic is here. If unsure, refer to other themes.
      */
     // register default body view var
     parent::createBody();
 }
Esempio n. 3
0
 /**
  * Overwrite parent html body. This is the main bulk of the logic. modify at your own risks.
  */
 function createBody()
 {
     // 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'];
             $this->cell[$i][$j]['short_desc'][] = '';
             $this->cell[$i][$j]['short_desc_image'][] = '';
             // if days with link
             $count = 0;
             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'] == '*')) {
                     switch ($val['link']) {
                         case 'url':
                             $this->cell[$i][$j]['link'] = 'url';
                             $this->cell[$i][$j]['short_desc'][$count] = "<a href=\"{$val['url']}\" target='_blank'>{$val['short_desc']}</a>";
                             $this->cell[$i][$j]['short_desc_image'][$count] = $val['short_desc_image'] ? "<a href=\"" . QCALENDAR_WEB_PATH . "{$val['url']}\" target='_blank'><img src=\"" . QCALENDAR_WEB_PATH . "{$val['short_desc_image']}\"></a>" : '';
                             break;
                         case 'div':
                             $this->cell[$i][$j]['link'] = 'div';
                             $this->cell[$i][$j]['short_desc'][$count] = "<a href=\"javascript:;\" onclick=\"qCalendarDetails('{$this->divLongDesc}', '{$this->theme}', {$val['id']})\">{$val['short_desc']}</a>";
                             $this->cell[$i][$j]['short_desc_image'][$count] = $val['short_desc_image'] ? "<a href=\"javascript:;\" onclick=\"qCalendarDetails('{$this->divLongDesc}', '{$this->theme}', {$val['id']})\"><img src=\"" . QCALENDAR_WEB_PATH . "{$val['short_desc_image']}\"></a>" : '';
                             break;
                         default:
                             $this->cell[$i][$j]['short_desc'][$count] = $val['short_desc'];
                             $this->cell[$i][$j]['short_desc_image'][$count] = $val['short_desc_image'];
                             break;
                     }
                     $count++;
                 }
             }
         }
     }
     // register default body view var
     parent::createBody();
     $view = array();
     $view['cell'] = $this->cell;
     $this->registerView($view);
 }
Esempio n. 4
0
 /**
  * Overwrite parent html body. This is the main bulk of the logic. modify at your own risks.
  */
 function createBody()
 {
     // start rendering table
     // start the week from Wed
     $this->fillArray(3);
     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
             $count = 0;
             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'] == '*')) {
                     switch ($val['link']) {
                         case 'url':
                             $this->cell[$i][$j]['link'] = 'url';
                             $this->cell[$i][$j]['day'] = "<a href=\"{$val['url']}\" target='_blank' title=\"{$val['short_desc']}\">{$this->cell[$i][$j]['value']}</a>";
                             break;
                         case 'div':
                             $this->cell[$i][$j]['day'] = "<a href=\"javascript:;\" onmouseover=\"qCalendarAllDetailsFloatOn('{$this->divLongDesc}', '{$this->theme}', '{$this->cell[$i][$j]['value']}', '{$this->month}', '{$this->year}', '{$this->cat_id}');\">{$this->cell[$i][$j]['value']}</a>";
                             $this->cell[$i][$j]['link'] = 'div';
                             break;
                         default:
                             break;
                     }
                     $count++;
                 }
             }
         }
     }
     // register default body view var
     parent::createBody();
     $view = array();
     $view['cell'] = $this->cell;
     $this->registerView($view);
 }