Robert Marshall 10 năm trước cách đây
mục cha
commit
bec9fa0b19
5 tập tin đã thay đổi với 37 bổ sung4 xóa
  1. 7 0
      Controller/SiteMap.php
  2. 4 2
      Model/BlogPost.php
  3. 17 0
      View/SiteMap/index.view
  4. 1 0
      style-med.css
  5. 8 2
      style.css

+ 7 - 0
Controller/SiteMap.php

@@ -0,0 +1,7 @@
+<?php
+class SiteMap {
+	public function Index($params) {
+		$controllers=Navigation::Get();
+		return new View("SiteMap/index.view",array("controllers"=>$controllers));
+	}
+}

+ 4 - 2
Model/BlogPost.php

@@ -59,8 +59,10 @@ class BlogPost extends DBObjectAutoCreate {
 	public function GetPostPreview() {
 		$previewLength=ApplicationSettings::GetSetting("blog", "preview_length");
 		$content=$this->PostContent;
-		$pTagPos=strpos($content,"</p>",$previewLength);
-		$content=substr($content, 0, $pTagPos);
+		if ($previewLength<strlen($content)){
+			$pTagPos=strpos($content,"</p>",$previewLength);
+			$content=substr($content, 0, $pTagPos);
+		}
 		$content=Helper::CloseOpenTags($content);
 		return $content;
 	}

+ 17 - 0
View/SiteMap/index.view

@@ -0,0 +1,17 @@
+@Title{Sitemap}@
+@Body{
+<ul>
+	<?php foreach ($controllers as $c){
+		$cUri=$c->GetURI();
+		echo '<li><a href="',$cUri->GetLinkLocation(),'">',$cUri->GetText(),'</a>';
+		$items=$c->GetItems();
+		if (count($items)>0){
+			echo '<ul>';
+			foreach ($items as $i)
+				echo '<li><a href="',$cUri->GetLinkLocation(),'/',$i->GetLinkLocation(),'">',$i->GetText(),'</a></li>';
+			echo '</ul>';
+		}
+		echo '</li>';
+	}?>
+</ul>
+}@

+ 1 - 0
style-med.css

@@ -1,5 +1,6 @@
 #menu{
 	display: none;
+	box-shadow: none;
 }
 
 #main, #main-header{

+ 8 - 2
style.css

@@ -105,11 +105,17 @@ td, th{
 	left:0;
 	position:fixed;
 	height:100%;
-	box-shadow: 7px 0px 4px 0px rgba(0,0,0,0.15);
+	/*box-shadow: 7px 0px 4px 0px rgba(0,0,0,0.15);*/
+	box-shadow: -2px 0px 0px 0px #eee inset;
+	/*border-right: 2px solid #eeeeee;*/
 	z-index: 400;
 	overflow-x: hidden;
 }
 
+#menu .header{
+	z-index: 401;
+}
+
 /*#menu>div{
 	position: relative;
 	height:100%
@@ -147,7 +153,6 @@ td, th{
 	left:0;
 	right:0;
 	/*box-shadow: 0 5px 10px rgba(249,249,249, 0.9);*/
-	box-shadow: 0px 4px 5px -2px rgba(50, 50, 50, 0.8);
 }
 
 #main-header .header>*{
@@ -225,6 +230,7 @@ td, th{
 	white-space:nowrap;
 	padding:0 !important;
 	overflow: hidden;
+	box-shadow: 0px 0px 5px 0px rgba(50, 50, 50, 0.8);
 }
 
 .header>*{