Explorar el Código

M style.css
M Model/URI.php
M template.php

Robert Marshall hace 10 años
padre
commit
98426d0e50
Se han modificado 4 ficheros con 16 adiciones y 12 borrados
  1. 1 1
      Model/URI.php
  2. 3 3
      settings.ini
  3. 3 7
      style.css
  4. 9 1
      template.php

+ 1 - 1
Model/URI.php

@@ -4,7 +4,7 @@ class URI {
 	
 	public function __construct($text, $link, $image="") {
 		$this->_text=$text;
-		$this->_link=$link;
+		$this->_link=strtolower($link);
 		$this->_image=$image;
 	}
 	

+ 3 - 3
settings.ini

@@ -5,8 +5,8 @@ template=template.php
 
 [database]
 host=localhost
-username=root
-password=""
+username=robware-test
+password=robware-test
 database=robware-test
 
 [navigation]
@@ -14,4 +14,4 @@ mode=include
 pages=HomeNav,BlogNav,ProjectsNav,GalleryNav
 
 [blog]
-posts_per_page=10
+posts_per_page=10

+ 3 - 7
style.css

@@ -24,23 +24,19 @@ nav img{
 	margin-right: 5px;
 }
 
-nav dt:hover, nav dd:hover{
+nav dt:hover, nav dd:hover, nav dt.active, nav dd.active{
 	background: #EEE;
 	cursor: pointer;
 	cursor: hand;
 }
 
-nav dt:not(:first-child){
-	margin-top:3px;
-}
-
 nav dt {
-    padding: 0 10px;
+    padding: 10px 10px;
 }
 
 nav dd {
     margin: 0;
-    padding-left: 40px;
+    padding: 10px 10px 10px 40px;
 }
 
 nav a{

+ 9 - 1
template.php

@@ -59,10 +59,18 @@ function FormatURI(URI $uri, $base=""){
 				<nav>
 					<dl>
 						<?php
+						$reqUri=trim($_SERVER['REQUEST_URI'],"/");
+						$uriParts=explode("/",$reqUri);
+						if ($uriParts[0]=="")
+							$uriParts[0]="home";
+							
 						$__controllers=Navigation::Get();
 						foreach ($__controllers as $controller){
 							$cURI=$controller->GetURI();
-							echo '<dt>',FormatURI($cURI);
+							echo '<dt';
+							if ($cURI->GetLinkLocation()=='/'.$uriParts[0])
+								echo ' class="active"';
+							echo'>',FormatURI($cURI);
 							$items=$controller->GetItems();
 							if (count($items)>0)
 								echo '<span class="go">&raquo;</span><span class="expand">+</span>';