Completed
Branch master (eabbbe)
by Gordon
03:50
created
code/SiteMap.php 3 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -29,6 +29,9 @@
 block discarded – undo
29 29
   return $output;
30 30
  }
31 31
  
32
+ /**
33
+  * @param DataList $pages
34
+  */
32 35
  private function makeList($pages) {
33 36
   $output = "";
34 37
   if(count($pages)) {
Please login to merge, or discard this patch.
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
  
3 3
 class SiteMap extends Page {
4
-	static $db = array(
5
-	);
6
-	static $has_one = array(
7
-	);
4
+ static $db = array(
5
+ );
6
+ static $has_one = array(
7
+ );
8 8
 
9 9
   // hide from menus and search
10 10
   static $defaults = array( 
@@ -15,13 +15,13 @@  discard block
 block discarded – undo
15 15
  
16 16
 class SiteMap_Controller extends Page_Controller {
17 17
    
18
-	/**
19
-	 * This function will return a unordered list of all pages on the site.
20
-	 * Watch for the switch between $page and $child in the second line of the foreach().
21
-	 * 
22
-	 * Note that this will only skip ErrorPage's at the top/root level of the site. 
23
-	 * If you have an ErrorPage class somewhere else in the hierarchy, it will be displayed.
24
-	 */
18
+ /**
19
+  * This function will return a unordered list of all pages on the site.
20
+  * Watch for the switch between $page and $child in the second line of the foreach().
21
+  * 
22
+  * Note that this will only skip ErrorPage's at the top/root level of the site. 
23
+  * If you have an ErrorPage class somewhere else in the hierarchy, it will be displayed.
24
+  */
25 25
  function SiteMap() {
26 26
   $rootLevel = DataObject::get("Page", "ParentID = 0"); // Pages at the root level only
27 27
   $output = "";
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -31,11 +31,11 @@
 block discarded – undo
31 31
  
32 32
  private function makeList($pages) {
33 33
   $output = "";
34
-  if(count($pages)) {
34
+  if (count($pages)) {
35 35
     $output = '
36 36
     <ul class="sitemap-list">';
37
-   foreach($pages as $page) {
38
-    if(!($page instanceof ErrorPage) && $page->ShowInMenus && $page->Title != $this->Title){
37
+   foreach ($pages as $page) {
38
+    if (!($page instanceof ErrorPage) && $page->ShowInMenus && $page->Title != $this->Title) {
39 39
      $output .= '
40 40
       <li><a href="'.$page->URLSegment.'" title="Go to the '.Convert::raw2xml($page->Title).' page">'.Convert::raw2xml($page->MenuTitle).'</a>';
41 41
      $whereStatement = "ParentID = ".$page->ID;
Please login to merge, or discard this patch.