Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

* sorting

  • Loading branch information...
commit 397571f77622249bbe6611333cb19de343cedc6e 1 parent ddfa4f2
rolwi authored February 29, 2012
4  extensions/content/eportfolio/classes/commands/Biography.class.php
@@ -56,10 +56,10 @@ public function frameResponse(\FrameResponseObject $frameResponseObject) {
56 56
 		$years = array();
57 57
 		foreach ($entries as $entry){
58 58
 			$dates = getdate(strtotime($entry->getRawData($entry->entryAttributes["date"])));
59  
-			$sortedEntries[$dates["year"]] []= $entry;
  59
+			$sortedEntries[$dates["year"]] [] = $entry;
60 60
 			$years [$dates["year"]]= $dates["year"];
61 61
 		}
62  
-
  62
+		krsort($years);
63 63
 		$html = "<br>";
64 64
 		foreach ($years as $year){
65 65
 			$html .= "<h1>{$year}:</h1>";
27  extensions/content/eportfolio/classes/model/Portfolios.class.php
@@ -9,19 +9,26 @@ class Portfolios {
9 9
     private $entryContainer;
10 10
 
11 11
     private function __construct($user, $portfolioContainer, $entryContainer) {
12  
-        $this->user = $user;
13  
-        $this->portfolioContainer = $portfolioContainer;
14  
-        $this->entryContainer = $entryContainer;
  12
+    	$this->user = $user;
  13
+    	$this->portfolioContainer = $portfolioContainer;
  14
+    	$this->entryContainer = $entryContainer;
15 15
     }
16 16
 
17 17
     public function getAllEntries() {
18  
-        $all = $this->getEntriesContainer()->get_inventory_filtered(
19  
-        		array(array('+', 'class', CLASS_ROOM)));
20  
-        $allEntries = array();
21  
-        foreach ($all as $room) {
22  
-        	$allEntries[] = Entry::getEntryByRoom($room);
23  
-        }
24  
-        return $allEntries;
  18
+    	$all = $this->getEntriesContainer()->get_inventory_filtered(
  19
+    			array(array('+', 'class', CLASS_ROOM)));
  20
+    	$tmpEntries = array();
  21
+    	foreach ($all as $room) {
  22
+    		$tmpEntries[] = Entry::getEntryByRoom($room);
  23
+    	}
  24
+    	$sortedEntries = array();
  25
+    	$i = 1;
  26
+    	foreach ($tmpEntries as $entry) {
  27
+    		$dates = getdate(strtotime($entry->getRawData($entry->entryAttributes["date"])));
  28
+    		$sortedEntries[$dates[0] . $i++] = $entry;
  29
+    	}
  30
+    	krsort($sortedEntries);
  31
+    	return $sortedEntries;
25 32
     }
26 33
 
27 34
     public function getAchievedCompetences() {

0 notes on commit 397571f

Please sign in to comment.
Something went wrong with that request. Please try again.