Browse Source

add calendar content module

tags/v1.1
parent
commit
830eee59d3
2 changed files with 67 additions and 0 deletions
  1. +52
    -0
      app/modules/ccalendar.php
  2. +15
    -0
      app/modules/filesinfolders.php

+ 52
- 0
app/modules/ccalendar.php View File

<?php

namespace Modules;

class CCalendar extends ContentType {

public $keys = array(
'VON' => 'from',
'BIS' => 'to'
);
public $values;
protected $layout;
protected $layouts = array(
'default' => 'weeks_compact'
);
function __construct($keys,$config) {
parent::__construct($keys,$config);
}


function weeks_compact() {
$v = (object) $this->values;
//$TS = strtotime($v->date);
//$href = $this->href;
$TS = time();
$start = $TS;
$end = $TS + 50 * 86400;
$days = "";
for ($day = $start; $day<=$end; $day=$day+(86400)) {
$days .= sprintf("<div class='calendar-day weekday-%s'>%s</div>",
date("w",$day),
date("D, d. ",$day)
);
}
return sprintf("<div class=\"calendar calendar-week\">"
."%s"
."</div>",
$days
);
}

}


+ 15
- 0
app/modules/filesinfolders.php View File

array_shift($request), array_shift($request),
$toc); $toc);
break; break;
case 'calendar':
array_shift($request);
$conf = array('path', $this->folder);
$v = $this->read_config();
$cal = new \Modules\CCalendar($v,$conf);
//$cal->dispatch();
//$conf = array('path', $this->folder);
//$v = $this->read_config();
$new=sprintf("<div class=\"calendar\">%s</div>",
$cal);
break;


case 'header': case 'header':
array_shift($request); array_shift($request);

Loading…
Cancel
Save