@@ -13,7 +13,15 @@ class SearchController extends AppController
13
13
function init ()
14
14
{
15
15
$ this ->view ->activemenu = 'feed ' ; // set the active menu
16
- } // end init()
16
+
17
+ // if the number of parameters is more than 3 then it's the liveAction
18
+ if (count ($ this ->_getAllParams ()) == 3 )
19
+ {
20
+ $ actionName =Zend_Controller_Front::getInstance ()->getRequest ()->getActionName ();
21
+ $ this ->_forward ('index ' ,null ,null ,array ('q ' =>$ actionName ));
22
+ }
23
+ } // end init()
24
+
17
25
18
26
/** search live Action */
19
27
public function indexAction ()
@@ -25,8 +33,20 @@ public function indexAction()
25
33
$ this ->view ->json ['search ' ]['keyword ' ] = $ keyword ;
26
34
27
35
// Get the items corresponding to the search
28
- $ items = $ this ->ItemKeyword ->getItemsFromSearch ($ keyword ,$ this ->userSession ->Dao );
29
- $ this ->view ->items =$ items ;
36
+ $ ItemsDao = $ this ->ItemKeyword ->getItemsFromSearch ($ keyword ,$ this ->userSession ->Dao );
37
+ $ this ->view ->items =$ ItemsDao ;
38
+
39
+ // Search for the folders
40
+ $ FoldersDao = $ this ->Folder ->getFoldersFromSearch ($ keyword ,$ this ->userSession ->Dao );
41
+ $ this ->view ->folders =$ FoldersDao ;
42
+
43
+ // Search for the communities
44
+ $ CommunitiesDao = $ this ->Community ->getCommunitiesFromSearch ($ keyword ,$ this ->userSession ->Dao );
45
+ $ this ->view ->communities =$ CommunitiesDao ;
46
+
47
+ // Search for the users
48
+ $ UsersDao = $ this ->User ->getUsersFromSearch ($ keyword ,$ this ->userSession ->Dao );
49
+ $ this ->view ->users =$ UsersDao ;
30
50
}
31
51
32
52
/** search live Action */
0 commit comments