Просмотр исходного кода

Made breadcrumbs more consistent.

Alan Lam 8 лет назад
Родитель
Сommit
b4f9904b2d

+ 1 - 0
controllers/location_add.php

@@ -7,6 +7,7 @@ if(!$customer) throw new Exception("You do not have permission to access this pa
 
 Core::addBreadcrumb("/account", "Account");
 Core::addBreadcrumb("/account/locations", "Locations");
+Core::addBreadcrumb("/account/locations?customer_id=$customer->id", "$customer->name Locations");
 Core::addBreadcrumb("/account/locations/add", $page_title);
 
 $location = new Location;

+ 3 - 0
controllers/location_edit.php

@@ -6,6 +6,8 @@ $location = Location::get($id);
 if(!$location) throw new Exception("Location not found.");
 if(!Core::$user->hasPermission($location)) throw new Exception("You do not have have permission to access this page.");
 
+$customer = $location->getCustomer();
+
 $submit = http::value("submit");
 if($submit) {
 	try {
@@ -52,6 +54,7 @@ if($submit) {
 
 Core::addBreadcrumb("/account", "Account");
 Core::addBreadcrumb("/account/locations", "Locations");
+Core::addBreadcrumb("/account/locations?customer_id=$customer->id", "$customer->name Locations");
 Core::addBreadcrumb("/account/locations/$id", $location->name);
 Core::addBreadcrumb("/account/locations/$id/edit", $page_title);
 

+ 1 - 1
controllers/locations.php

@@ -7,7 +7,7 @@ Core::addBreadcrumb("/account/locations", "Locations");
 $customer = Customer::getForAdmin();
 if(!$customer) throw new Exception("You do not have permission to access this page.");
 
-$page_title = "$customer->name";
+$page_title = "$customer->name Locations";
 
 Core::addBreadcrumb("/account/locations?customer_id=$customer->id", $page_title);
 

+ 1 - 0
controllers/project_add.php

@@ -10,6 +10,7 @@ if(empty($customer)) throw new Exception("Customer not found.");
 
 Core::addBreadcrumb("/account", "Account");
 Core::addBreadcrumb("/account/projects", "Projects");
+Core::addBreadcrumb("/account/projects?customer_id=$customer->id", "$customer->name Projects");
 Core::addBreadcrumb("/account/projects/add", $page_title);
 
 // Check templates

+ 6 - 2
controllers/projects.php

@@ -1,12 +1,16 @@
 <?php
 
-$page_title = "Projects";
 
 Core::addBreadcrumb("/account", "Account");
-Core::addBreadcrumb("/account/projects", $page_title);
+Core::addBreadcrumb("/account/projects", "Projects");
 
 $customer = Customer::getForAdmin();
 
+$page_title = "$customer->name Projects";
+
+Core::addBreadcrumb("/account/projects?customer_id=$customer->id", $page_title);
+
+
 $projects = $customer->getProjects();
 
 View::includeOnce("header", compact("page_title"));

+ 5 - 1
controllers/template_add.php

@@ -4,10 +4,14 @@ $page_title = "Add Template";
 
 Core::addBreadcrumb("/account", "Account");
 Core::addBreadcrumb("/account/templates", "Templates");
-Core::addBreadcrumb($_SERVER["REQUEST_URI"], $page_title);
 
 $customer = Customer::getForAdmin();
 
+Core::addBreadcrumb("/account/templates?customer_id=$customer->id", "$customer->name Templates");
+
+Core::addBreadcrumb($_SERVER["REQUEST_URI"], $page_title);
+
+
 $template = new Template;
 $template->customer_id = $customer->id;
 $template->json = "";

+ 4 - 3
controllers/templates.php

@@ -1,12 +1,13 @@
 <?php
 
-$page_title = "Templates";
-
 Core::addBreadcrumb("/account", "Account");
-Core::addBreadcrumb("/account/templates", $page_title);
+Core::addBreadcrumb("/account/templates", "Templates");
 
 $customer = Customer::getForAdmin();
 
+$page_title = "$customer->name Templates";
+Core::addBreadcrumb("/account/templates?customer_id=$customer->id", $page_title);
+
 $templates = $customer->getTemplates();
 
 View::includeOnce("header", compact("page_title"));