1
0

Code cleanup.

This commit is contained in:
rWatcher 2009-11-18 19:04:47 -05:00
parent 92e97357e5
commit 11153056f1
2 changed files with 12 additions and 30 deletions

View File

@ -33,7 +33,7 @@ class CalendarView_Controller extends Controller {
// Draw the page.
$template = new Theme_View("page.html", "other", "CalendarView");
$template->css("calendarview_calendar.css");
$template->set_global("calendar_user", $display_user);
$template->set_global("calendar_user", $display_user);
$template->page_title = t("Gallery :: Calendar");
$template->content = new View("calendarview_year.html");
$template->content->calendar_year = $display_year;
@ -84,10 +84,6 @@ class CalendarView_Controller extends Controller {
$template->set_global("page_size", $page_size);
$template->page_title = t("Gallery :: Calendar");
$template->set_global("first_visible_position", $offset+1);
$template->set_global("last_visible_position", $offset+$page_size);
// $template->set_global("total", $day_count);
// Figure out which photos go on this page.
if ($display_user == "-1") {
$template->set_global("children", ORM::factory("item")
@ -108,18 +104,15 @@ class CalendarView_Controller extends Controller {
->find_all($page_size, $offset));
}
// Finish setting up and then display the page.
$template->set_global("children_count", $day_count);
// Set up breadcrumbs
$calendar_breadcrumbs[0] = new Calendar_Breadcrumb($display_year, url::site("calendarview/calendar/" . $display_year . "/" . $display_user));
$calendar_breadcrumbs[1] = 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));
$fake_item = new Calendar_Breadcrumb($display_day, "");
//$photo = ORM::factory("item", "3");
$template->set_global("item", $fake_item);
$template->set_global("parents", $calendar_breadcrumbs);
// Finish setting up and then display the page.
$template->set_global("children_count", $day_count);
$template->content = new View("dynamic.html");
$template->content->title = t("Photos From ") . date("d", mktime(0, 0, 0, $display_month, $display_day, $display_year)) . " " . t(date("F", mktime(0, 0, 0, $display_month, $display_day, $display_year))) . " " . date("Y", mktime(0, 0, 0, $display_month, $display_day, $display_year));
print $template;
@ -167,10 +160,6 @@ class CalendarView_Controller extends Controller {
$template->set_global("page_size", $page_size);
$template->page_title = t("Gallery :: Calendar");
$template->set_global("first_visible_position", $offset+1);
$template->set_global("last_visible_position", $offset+$page_size);
// $template->set_global("total", $day_count);
// Figure out which photos go on this page.
if ($display_user == "-1") {
$template->set_global("children", ORM::factory("item")
@ -191,17 +180,14 @@ class CalendarView_Controller extends Controller {
->find_all($page_size, $offset));
}
// Finish setting up and then display the page.
$template->set_global("children_count", $day_count);
// Set up breadcrumbs for this page.
$calendar_breadcrumbs[0] = new Calendar_Breadcrumb($display_year, url::site("calendarview/calendar/" . $display_year . "/" . $display_user));
$fake_item = new Calendar_Breadcrumb(t(date("F", mktime(0, 0, 0, $display_month, 1, $display_year))), "");
//$photo = ORM::factory("item", "3");
$template->set_global("item", $fake_item);
$template->set_global("parents", $calendar_breadcrumbs);
// Finish setting up and then display the page.
$template->set_global("children_count", $day_count);
$template->content = new View("dynamic.html");
$template->content->title = t("Photos From ") . t(date("F", mktime(0, 0, 0, $display_month, 1, $display_year))) . " " . date("Y", mktime(0, 0, 0, $display_month, 1, $display_year));
print $template;

View File

@ -18,27 +18,23 @@
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
class Calendar_Breadcrumb_Core {
public $title = "the_title";
// Creates a class to maintain a single breadcrumb.
// Multiple breadcrumbs can be achieved by createing an array of this class type.
public $title = "";
public $id = 0;
//public $crumb_url = "asdf";
public $url = "asdf";
public $crumb_parent = null;
public $url = "";
public function __construct($new_title, $new_url) {
$this->title = $new_title;
$this->url = $new_url;
//$this->crumb_url = $new_url;
}
public function url($query=null) {
//return $crumb_url;
//print $this->url;
//return "http://the.url/";
return $this->url;
}
public function parent() {
return $crumb_parent;
return null;
}
public function is_album() {