1
0

Merge branch 'master' of git@github.com:gallery/gallery3-contrib

Conflicts:
	modules/calendarview/controllers/calendarview.php
This commit is contained in:
Bharat Mediratta 2009-11-17 15:55:19 -08:00
commit 85570acabd
4 changed files with 20 additions and 18 deletions

View File

@ -32,6 +32,7 @@ class CalendarView_Controller extends Controller {
// Draw the page.
$template = new Theme_View("page.html", "other", "CalendarView");
$template->css("calendarview_calendar.css");
$template->page_title = t("Gallery :: Calendar");
$template->content = new View("calendarview_year.html");
$template->content->calendar_year = $display_year;
@ -62,7 +63,7 @@ class CalendarView_Controller extends Controller {
->find_all()
->count();
}
// Figure out paging stuff.
$page_size = module::get_var("gallery", "page_size", 9);
$page = $this->input->get("page", "1");
@ -98,7 +99,7 @@ class CalendarView_Controller extends Controller {
->orderby("captured", "ASC")
->find_all($page_size, $offset));
}
// Finish setting up and then display the page.
$template->set_global("children_count", $day_count);
$template->content = new View("dynamic.html");
@ -124,7 +125,7 @@ class CalendarView_Controller extends Controller {
->count();
if ($count > 0) {
$valid_users[$one_user->id] = $one_user->full_name;
}
}
}
// Generate a list of years, starting with the year the earliest photo was
@ -160,19 +161,19 @@ class CalendarView_Controller extends Controller {
// Return the newly generated form.
return $form;
}
public function setprefs() {
// Change the calendar year and / or user.
// Prevent Cross Site Request Forgery
access::verify_csrf();
// Get user specified settings.
$str_user_id = Input::instance()->post("cal_user");
$str_user_id = Input::instance()->post("cal_user");
$str_year_id = Input::instance()->post("cal_year");
// redirect to the currect page.
url::redirect(url::site("calendarview/calendar/" . $str_year_id . "/" . $str_user_id));
url::redirect(url::site("calendarview/calendar/" . $str_year_id . "/" . $str_user_id));
}
}

View File

@ -0,0 +1,8 @@
table.calendar { text-align: center; width:100px; }
table.calendar caption { font-size: 1.5em; padding: 0.2em; }
table.calendar th, table.calendar td { padding: 0.2em; background: #fff; border: 0; }
table.calendar td:hover { background: #ddf; }
table.calendar td.prev-next { background: #ccc; color: #999; }
table.calendar td.today { color: #800; }
#cal_user, #cal_year, #g-view-calendar-form li { display: inline; }
#SaveSettings { float: right; }

View File

@ -1,15 +1,4 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<style type="text/css">
table.calendar { text-align: center; width:100px; }
table.calendar caption { font-size: 1.5em; padding: 0.2em; }
table.calendar th, table.calendar td { padding: 0.2em; background: #fff; border: 0; }
table.calendar td:hover { background: #ddf; }
table.calendar td.prev-next { background: #ccc; color: #999; }
table.calendar td.today { color: #800; }
select, li {
display: inline;
}
</style>
<h1 align="center"><?=$calendar_year ?></h1>
<?= $calendar_user_year_form ?>

View File

@ -43,7 +43,11 @@ else
}
?>
<? if ($day[1] == true) { ?>
<td class="<?php echo implode(' ', $classes) ?>"><span class="day"><?php echo $day[0] ?></span><?php echo $output ?></td>
<? } else { ?>
<td></td>
<? } ?>
<?php endforeach ?>
</tr>
<?php endforeach ?>