Browse Source

Merge pull request #18 from Fabacks/master

Sstechs &  ressources Trie  alphabetique + gitignore, merfi :)
Idleman 7 years ago
parent
commit
45eda02c54
2 changed files with 6 additions and 6 deletions
  1. 2 0
      .gitignore
  2. 4 6
      action.php

+ 2 - 0
.gitignore

@@ -0,0 +1,2 @@
+/upload/*
+!/upload/.htaccess

+ 4 - 6
action.php

@@ -1,4 +1,4 @@
-<?php
+<?php
 
 require_once __DIR__.DIRECTORY_SEPARATOR."common.php";
 
@@ -162,7 +162,7 @@ switch ($_['action']){
 				$filters = array('owner'=>$myUser->id);
 			}
 			
-			$sketchs = Sketch::loadAll($filters);
+			$sketchs = Sketch::loadAll($filters, "label ASC");
 			foreach($sketchs as $sketch){
 				$sketch->label = html_entity_decode($sketch->label);
 				$sketch->owner = User::getById($sketch->owner)->login;
@@ -280,13 +280,11 @@ switch ($_['action']){
 		});
 	break;
 	
-	case 'search_resources':
-	    
-		
+	case 'search_resources':		
 		Action::write(function($_,&$response){
 			
 			if(!isset($_['id']) || !is_numeric($_['id'])) throw new Exception("Sketch non spécifié");
-			$resources = Resource::loadAll(array('sketch'=>$_['id']),'sort');
+			$resources = Resource::loadAll(array('sketch'=>$_['id']),'sort ASC, label ASC');
 			
 			foreach($resources as $resource){
 				$resource->label = html_entity_decode($resource->label);