 classes/ezfmodulefunctioncollection.php |   31 ++++++++++++++++++++++++++++---
 1 file changed, 28 insertions(+), 3 deletions(-)

diff --git a/classes/ezfmodulefunctioncollection.php b/classes/ezfmodulefunctioncollection.php
index 0c04bb3..d0bcf53 100644
--- a/classes/ezfmodulefunctioncollection.php
+++ b/classes/ezfmodulefunctioncollection.php
@@ -75,15 +75,40 @@ class ezfModuleFunctionCollection
     {
         $http = eZHTTPTool::instance();
         $filterList = array();
+        $tempfilterList = array();
+       	#preparing sorted filter array
         if ( $http->hasGetVariable( 'filter' ) )
         {
             foreach ( $http->getVariable( 'filter' ) as $filterCond )
             {
-                list( $name, $value ) = explode( ':', $filterCond, 2 );
-                $filterList[$name] = $value;
+                $filter_parts = explode( ':', $filterCond );
+                if (array_key_exists($filter_parts[0], $tempfilterList))
+                {
+                	array_push($tempfilterList[$filter_parts[0]], $filter_parts[1]);
+                }
+                else
+                {
+                	$tempfilterList[$filter_parts[0]][] = $filter_parts[1];
+                }
             }
         }
-
+        
+        foreach ($tempfilterList as $key => $tempfilter)
+        {
+        	if(count($tempfilter) >= 2)
+        	{
+        		$filterList[] = array("OR");
+        		foreach($tempfilter as $multi_filter)
+        		{
+        			#adds the elements to the last key in the array ( thats the same as the newly created sub array by or)
+        			$filterList[key( array_slice( $filterList, -1, 1, TRUE ) )][] = $key . ":" . $multi_filter; 
+        		}
+        	}
+        	else
+        	{
+        		$filterList[] = $key . ":" . $tempfilter[0]; 
+        	}
+        }
         return array( 'result' => $filterList );
     }
 
