1
0

Code and CSS cleanups, also added a sidebar.

This commit is contained in:
rWatcher 2010-03-03 20:51:33 -05:00
parent a7da5cc836
commit 29a1d7e80c
7 changed files with 105 additions and 13 deletions

View File

@ -41,7 +41,7 @@ class CalendarView_Controller extends Controller {
$template->content->calendar_user_year_form = $this->_get_calenderprefs_form($display_year, $display_user);
$template->content->title = t("Calendar") . ": " . $display_year;
// Set up breadcrumbs
$calendar_breadcrumbs[0] = new Calendar_Breadcrumb(item::root()->title, item::root()->url());
$calendar_breadcrumbs[0] = new Calendar_Breadcrumb(item::root()->title, item::root()->url());
$calendar_breadcrumbs[1] = new Calendar_Breadcrumb($display_year, "");
$template->set_global("breadcrumbs", $calendar_breadcrumbs);
print $template;
@ -110,12 +110,12 @@ class CalendarView_Controller extends Controller {
}
// Set up breadcrumbs
$calendar_breadcrumbs[0] = new Calendar_Breadcrumb(item::root()->title, item::root()->url());
$calendar_breadcrumbs[0] = new Calendar_Breadcrumb(item::root()->title, item::root()->url());
$calendar_breadcrumbs[1] = new Calendar_Breadcrumb($display_year, url::site("calendarview/calendar/" . $display_year . "/" . $display_user));
$calendar_breadcrumbs[2] = new Calendar_Breadcrumb(t(date("F", mktime(0, 0, 0, $display_month, $display_day, $display_year))), url::site("calendarview/month/" . $display_year . "/" . $display_user . "/" . $display_month));
$calendar_breadcrumbs[3] = new Calendar_Breadcrumb($display_day, "");
$template->set_global("breadcrumbs", $calendar_breadcrumbs);
// Finish setting up and then display the page.
$template->set_global("children_count", $day_count);
$template->content = new View("dynamic.html");

View File

@ -1,10 +1,4 @@
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, #cal_go { display: inline; }
/* Grid view ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
#g-calendar-grid {
position: relative;
align: center;
@ -14,3 +8,44 @@ table.calendar td.today { color: #800; }
margin: 10px 10px 10px 10px;
}
/* Search form ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
#cal_user {
top: 0px;
left: 60px;
display: inline;
}
#cal_year {
top: 0px;
left: 240px;
display: inline;
}
#cal_go {
top: 0px;
left: 328px;
display: inline;
}
/* Content ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
table.calendar {
text-align: center;
}
table.calendar caption {
font-size: 1.5em;
padding: 0.2em;
}
table.calendar th, table.calendar td {
padding: 0.2em;
background: #ffffff;
border: 0px;
}
table.calendar td:hover {
background: #ddf;
}
/* For RTL Languages ~~~~~~~~~~~~~~~~~~~~~~~ */
.rtl #g-calendar-grid {
float: right;
}

View File

@ -0,0 +1,54 @@
<?php defined("SYSPATH") or die("No direct script access.");
/**
* Gallery - a web based photo album viewer and editor
* Copyright (C) 2000-2009 Bharat Mediratta
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
class calendarview_block_Core {
static function get_site_list() {
return array("calendarview_photo" => t("More Photos From This Date"));
}
static function get($block_id, $theme) {
$block = "";
// Make sure the current page belongs to an item.
if (!$theme->item()) {
return;
}
$item = $theme->item;
$display_date = "";
if (isset($item->captured)) {
$display_date = $item->captured;
}elseif (isset($item->created)) {
$display_date = $item->created;
}
switch ($block_id) {
case "calendarview_photo":
if ($display_date != "") {
$block = new Block();
$block->css_id = "g-calendarview-sidebar";
$block->title = t("Calendar");
$block->content = new View("calendarview_sidebar.html");
$block->content->date = $display_date;
}
break;
}
return $block;
}
}

View File

@ -69,5 +69,4 @@ class calendarview_event_Core {
site_status::clear("calendarview_needs_exif");
}
}
}

View File

@ -83,6 +83,5 @@ class PHPCalendar_Core {
return $calendar."</tr>\n</table>\n";
}
}
?>

View File

@ -0,0 +1,5 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<ul>
<li><a href="<?=url::site("calendarview/day/" . date("Y", $date) . "/-1/" . date("n", $date) . "/" . date("j", $date)); ?>"><?=t("More from"); ?> <?=date("F", $date); ?> <?=date("j", $date); ?><?=date("S", $date); ?></a></li>
<li><a href="<?=url::site("calendarview/month/" . date("Y", $date) . "/-1/" . date("n", $date)); ?>"><?=t("More from"); ?> <?=date("F", $date); ?></a></li>
</ul>

View File

@ -6,7 +6,7 @@
<h1><?= html::clean($title) ?></h1>
</div>
<?= $calendar_user_year_form ?><br /><br />
<br/><?= $calendar_user_year_form ?><br /><br />
<?
$counter_months = 1;