]> git.pld-linux.org Git - packages/dokuwiki-plugin-icalevents.git/blob - showCurrentWeek.patch
- add show current week patch
[packages/dokuwiki-plugin-icalevents.git] / showCurrentWeek.patch
1 Only in /usr/share/dokuwiki/lib/plugins/iCalEvents/: .syntax.php.swo
2 Only in /usr/share/dokuwiki/lib/plugins/iCalEvents/: .syntax.php.swp
3 Only in /usr/share/dokuwiki/lib/plugins/iCalEvents/conf: default.php~
4 Only in .: iCalEvents
5 Only in ./lang: de
6 diff -ur -x .svn -x .git -x .bzr -x CVS ./syntax.php /usr/share/dokuwiki/lib/plugins/iCalEvents/syntax.php
7 --- ./syntax.php        2011-05-24 07:10:51.275958659 +0300
8 +++ /usr/share/dokuwiki/lib/plugins/iCalEvents/syntax.php       2011-05-23 12:38:52.386695372 +0300
9 @@ -88,17 +88,18 @@
10        }
11  
12        $showEndDates = !empty($params['showEndDates']);
13 +      $showCurrentWeek = !empty($params['showCurrentWeek']);
14        
15 -      #echo "url=$icsURL flags=$flagStr; from = $from;    previewSec = $previewSec; dateFormat=$dateFormat;<br/>";
16 +      #echo "url=$icsURL flags=$flagStr; from = $from;    previewSec = $previewSec; dateFormat=$dateFormat; showCurrentWeek=$showCurrentWeek<br/>";
17        
18 -      return array($icsURL, $from, $previewSec, $dateFormat, $showEndDates); 
19 +      return array($icsURL, $from, $previewSec, $dateFormat, $showEndDates, $showCurrentWeek);
20      }
21      
22      /**
23       * loads the ics file via HTTP, parses it and renders an HTML table.
24       */
25      function render($mode, &$renderer, $data) {
26 -      list($url, $from, $previewSec, $dateFormat, $showEndDates) = $data;
27 +      list($url, $from, $previewSec, $dateFormat, $showEndDates, $showCurrentWeek) = $data;
28        $ret = '';
29        if($mode == 'xhtml'){
30               # parse the ICS file
31 @@ -113,10 +114,16 @@
32                    '<th>'.$this->getLang('what').'</th>'.
33                    '<th>'.$this->getLang('description').'</th>'.
34                    '<th>'.$this->getLang('where').'</th>'.
35                    '</tr>'.NL;
36 +          $weekStart = strtotime("0 week ago 12:00");
37 +          $weekEnd = strtotime("1 weeks 12:00");
38            foreach ($entries as $entry) {
39              $rowCount++;
40 -            $ret .= '<tr>';
41 +            $ret .= '<tr';
42 +            if ($showCurrentWeek && ($entry['startunixdate'] >= $weekStart && $entry['endunixdate'] <= $weekEnd)) {
43 +                $ret .= ' style="background-color: red !important"';
44 +            }
45 +            $ret .= '>';
46                         if ($showEndDates || $this->getConf('showEndDates')) {
47                                 $ret .= '<td>'.$entry['startdate'].' - '.$entry['enddate'].'</td>';
48                         } else {
This page took 0.112804 seconds and 3 git commands to generate.