Subversion Repositories eFlore/Applications.del

Rev

Rev 1452 | Rev 1481 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1452 Rev 1480
Line 720... Line 720...
720
		// TODO: PHP-5.3
720
		// TODO: PHP-5.3
721
		return array_filter($p, create_function('$a','return !in_array($a, array("",false,null),true);'));
721
		return array_filter($p, create_function('$a','return !in_array($a, array("",false,null),true);'));
722
	}
722
	}
Line 723... Line 723...
723
 
723
 
-
 
724
	static function makeJSONHeader($total, $params, $url_service) {
724
	static function makeJSONHeader($total, $params, $url_service) {
725
	
-
 
726
		$prev_url = $next_url = NULL;
-
 
727
		$url_service_sans_slash = substr($url_service, 0, -1);
-
 
728
 
-
 
729
		// aplatissons les params! - une seule couche cela dit, après débrouillez-vous
-
 
730
		$params_a_plat = $params;
-
 
731
		foreach ($params_a_plat as $cle_plate => $pap) {
-
 
732
			if (is_array($pap)) {
-
 
733
				$params_a_plat[$cle_plate] = implode(array_keys($pap), ',');
-
 
734
			}
Line 725... Line 735...
725
		$prev_url = $next_url = NULL;
735
		}
726
 
736
 
727
		$next_offset = $params['navigation.depart'] + $params['navigation.limite'];
-
 
728
		if($next_offset < $total) {
737
		$next_offset = $params['navigation.depart'] + $params['navigation.limite'];
729
			$next_url = sprintf("http://%s?%s", isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : $url_service,
738
		if($next_offset < $total) {
Line 730... Line 739...
730
								http_build_query(array_merge($params, array('navigation.depart' => $next_offset))));
739
			$next_url = $url_service_sans_slash . '?' . http_build_query(array_merge($params_a_plat, array('navigation.depart' => $next_offset)));
731
		}
740
		}
732
 
-
 
733
		$prev_offset = $params['navigation.depart'] - $params['navigation.limite'];
741
 
734
		if($prev_offset > 0) {
742
		$prev_offset = $params['navigation.depart'] - $params['navigation.limite'];
Line 735... Line 743...
735
			$prev_url = sprintf("http://%s?%s", isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : $url_service,
743
		if($prev_offset > 0) {
736
								http_build_query(array_merge($params, array('navigation.depart' => $prev_offset))));
744
			$prev_url = $url_service_sans_slash . '?' . http_build_query(array_merge($params_a_plat, array('navigation.depart' => $prev_offset)));
737
		}
745
		}