Commit 704b186079aab40e3f1b94296c9ccfff4acdc61d
1 parent
07a2315e
KTS-673
"The search algorithm needs some work" Updated. Added search portlet. Committed By: Conrad Vermeulen Reviewed By: Kevin Fourie git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@7266 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
2 changed files
with
38 additions
and
0 deletions
plugins/search2/Search2Portlet.php
0 → 100644
| 1 | +<?php | |
| 2 | + | |
| 3 | +class Search2Portlet extends KTPortlet | |
| 4 | +{ | |
| 5 | + | |
| 6 | + function Search2Portlet() | |
| 7 | + { | |
| 8 | + parent::KTPortlet(_kt("Search")); | |
| 9 | + } | |
| 10 | + | |
| 11 | + function render() | |
| 12 | + { | |
| 13 | + $oTemplating =& KTTemplating::getSingleton(); | |
| 14 | + $oTemplate = $oTemplating->loadTemplate("ktcore/search2/search_portlet"); | |
| 15 | + | |
| 16 | + $iFolderId = KTUtil::arrayGet($_REQUEST, 'fFolderId', 1); | |
| 17 | + $iDocumentId = KTUtil::arrayGet($_REQUEST, 'fDocumentId'); | |
| 18 | + if (!$iFolderId && !$iDocumentId) { | |
| 19 | + return null; | |
| 20 | + } | |
| 21 | + | |
| 22 | + $savedSearches = SearchHelper::getSavedSearches($_SESSION['userID']); | |
| 23 | + | |
| 24 | + $aTemplateData = array( | |
| 25 | + 'context' => $this, | |
| 26 | + 'folder_id' => $iFolderId, | |
| 27 | + 'document_id' => $iDocumentId, | |
| 28 | + 'savedSearches' =>$savedSearches | |
| 29 | + ); | |
| 30 | + | |
| 31 | + return $oTemplate->render($aTemplateData); | |
| 32 | + } | |
| 33 | +} | |
| 34 | + | |
| 35 | +?> | |
| 0 | 36 | \ No newline at end of file | ... | ... |
plugins/search2/searchPlugin.php
| ... | ... | @@ -22,6 +22,9 @@ require_once('Search2Triggers.php'); |
| 22 | 22 | $this->registerTrigger('edit', 'postValidate', 'SavedSearchSubscriptionTrigger', 'ktcore.search2.savedsearch.subscription.edit', 'Search2Triggers.php'); |
| 23 | 23 | $this->registerTrigger('add', 'postValidate', 'SavedSearchSubscriptionTrigger', 'ktcore.search2.savedsearch.subscription.add', 'Search2Triggers.php'); |
| 24 | 24 | $this->registerTrigger('discussion', 'postValidate', 'SavedSearchSubscriptionTrigger', 'ktcore.search2.savedsearch.subscription.discussion', 'Search2Triggers.php'); |
| 25 | + $this->registerPortlet(array('browse', 'dashboard'), | |
| 26 | + 'Search2Portlet', 'ktcore.search2.portlet', | |
| 27 | + 'Search2Portlet.php'); | |
| 25 | 28 | } |
| 26 | 29 | } |
| 27 | 30 | ... | ... |