Browse files

Prepared the calendar object for full page layouts.

Fixed access conflict in register.php.

Signed-off-by: Ben Bowtell <kumnaa@gmail.com>
  • Loading branch information...
1 parent 3df47c9 commit 388be4554253989377187d6e51bb4b4c2c1fc0ef @Kumnaa committed Apr 4, 2011
Showing with 11 additions and 4 deletions.
  1. +2 −2 html/core/calendar.php
  2. +8 −1 pages/core/calendar.php
  3. +1 −1 pages/core/register.php
View
4 html/core/calendar.php
@@ -84,9 +84,9 @@ public function display_xml() {
return $doc->saveXML();
}
- public function display($template) {
+ public function display($template, $template_name = 'calendar') {
$page = new page($template);
- $page->set_template('calendar');
+ $page->set_template($template_name);
$blank = 0;
switch ($this->first_day_of_month->format("D")) {
case "Sun": $blank = 0;
View
9 pages/core/calendar.php
@@ -41,8 +41,9 @@ class calendar_page extends page {
public function __construct() {
$this->enable_component(component_types::$calendar);
parent::__construct();
+ $today = new DateTime();
$this->add_text('title', 'Category Viewer');
- $this->month = input::validate('month', 'string');
+ $this->month = input::validate('month', 'string', $today->format('Ym'));
}
public function generate_display() {
@@ -64,6 +65,12 @@ protected function action() {
$calendar = new calendar($date);
$this->add_text('xml', $calendar->display_xml());
break;
+
+ default:
+ $date = new DateTime(substr($this->month, 0, 4) . '-' . substr($this->month, 4, 2) . '-1');
+ $calendar = new calendar($date);
+ $this->add_text('main', $calendar->display($this->template, 'calendar_large'));
+ break;
}
} catch (Exception $ex) {
$this->notice($ex->getMessage());
View
2 pages/core/register.php
@@ -46,7 +46,7 @@ class register_page extends page {
protected $error;
protected $user_id;
protected $recaptcha;
- private $site_root;
+ protected $site_root;
public function __construct() {
try {

0 comments on commit 388be45

Please sign in to comment.