Commit 3cfc7147e25b27341c6c5150976f0b441cbaebf6
1 parent
d70519d0
removed commented code
fixed renderHeader call git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@1962 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
14 additions
and
31 deletions
presentation/lookAndFeel/knowledgeTree/search/advancedSearchUI.inc
| 1 | 1 | <?php |
| 2 | - | |
| 3 | 2 | /** |
| 4 | -* Presentation logic used by advancedSearchBL.php | |
| 5 | -* | |
| 6 | -* @author Rob Cherry, Jam Warehouse South Africa (Pty) Ltd | |
| 7 | -* @date 26 February 2003 | |
| 8 | -* @package presentation.lookAndFeel.knowledgeTree.search | |
| 9 | -* | |
| 10 | -*/ | |
| 11 | - | |
| 12 | -/*function renderHeading() { | |
| 13 | - global $default; | |
| 14 | - $sSectionName = $default->siteMap->getSectionName(substr($_SERVER["PHP_SELF"], strlen($default->rootUrl), strlen($_SERVER["PHP_SELF"]))); | |
| 15 | - $sColor = $default->siteMap->getSectionColour($sSectionName, "th"); | |
| 16 | - $sToRender .= "<tr align=\"left\"><th class=\"sectionHeading\" bgcolor=\"$sColor\"><font color=\"ffffff\">Advanced Search</font></th></tr>\n"; | |
| 17 | - $sToRender .= "<tr/>\n"; | |
| 18 | - $sToRender .= "<tr/>\n"; | |
| 19 | - return $sToRender; | |
| 20 | -}*/ | |
| 3 | + * $Id$ | |
| 4 | + * | |
| 5 | + * Presentation logic used by advancedSearchBL.php | |
| 6 | + * | |
| 7 | + * @author Rob Cherry, Jam Warehouse South Africa (Pty) Ltd | |
| 8 | + * @date 26 February 2003 | |
| 9 | + * @package presentation.lookAndFeel.knowledgeTree.search | |
| 10 | + */ | |
| 21 | 11 | |
| 22 | 12 | function getMetaData($aMetaTagIDs) { |
| 23 | 13 | global $default; |
| ... | ... | @@ -50,11 +40,10 @@ function getMetaData($aMetaTagIDs) { |
| 50 | 40 | |
| 51 | 41 | function getSearchPage($sSearchString = "", $aMetaTagIDs = array()) { |
| 52 | 42 | global $default; |
| 53 | - $sToRender = "<table width=\"600\">\n"; | |
| 54 | - $sToRender .= renderHeading("Advanced Search"); | |
| 43 | + $sToRender = renderHeading("Advanced Search"); | |
| 44 | + $sToRender .= "<table width=\"600\">\n"; | |
| 55 | 45 | $sToRender .= "<tr>\n"; |
| 56 | 46 | $sToRender .= "<td>Search text: <input type=\"text\" size=\"60\" name=\"fSearchString\" value=\"$sSearchString\" />\n"; |
| 57 | - //$sToRender .= "<td><input type=\"button\" src=\"$default->graphicsUrl/search.gif\" value=\"search\" onClick=\"validateAdvancedSearchText()\"/></td>\n"; | |
| 58 | 47 | $sToRender .= "<input type=\"button\" value=\"search\" onClick=\"validateAdvancedSearch()\"/></td>\n"; |
| 59 | 48 | $sToRender .= "</tr>\n"; |
| 60 | 49 | $sToRender .= "<tr>\n"; |
| ... | ... | @@ -71,7 +60,6 @@ function getSearchPage($sSearchString = "", $aMetaTagIDs = array()) { |
| 71 | 60 | return $sToRender . getSearchValidationJavaScript();; |
| 72 | 61 | } |
| 73 | 62 | |
| 74 | -//function getSearchResults($sSQLSearchString, $iStartIndex, $sSearchText, $sMetaTagIDs) { | |
| 75 | 63 | function getSearchResults($sMetaTagIDs, $sSQLSearchString, $iStartIndex) { |
| 76 | 64 | global $default; |
| 77 | 65 | $sQuery = "SELECT '" . "$default->graphicsUrl/widgets/dfolder.gif" . "' AS folder_image_url, F.id folder_id, D.id document_id, D.name AS document_name, COUNT(D.id) AS doc_count " . |
| ... | ... | @@ -79,15 +67,12 @@ function getSearchResults($sMetaTagIDs, $sSQLSearchString, $iStartIndex) { |
| 79 | 67 | "INNER JOIN document_fields_link AS DFL ON DFL.document_id = D.id " . |
| 80 | 68 | "INNER JOIN document_fields AS DF ON DF.id = DFL.document_field_id " . |
| 81 | 69 | "INNER JOIN search_document_user_link AS SDUL ON SDUL.document_id = D.ID " . |
| 82 | - //"WHERE D.id IN ($sSQLSearchString) " . | |
| 83 | 70 | "WHERE DF.ID IN ($sMetaTagIDs) " . |
| 84 | 71 | "AND " . $sSQLSearchString . " " . |
| 85 | 72 | "AND SDUL.user_id = " . $_SESSION["userID"] . " " . |
| 86 | 73 | "GROUP BY D.id "; |
| 87 | - "ORDER BY doc_count DESC "; | |
| 88 | - | |
| 89 | - //echo $sQuery; | |
| 90 | - | |
| 74 | + "ORDER BY doc_count DESC "; | |
| 75 | + | |
| 91 | 76 | $aColumns = array("folder_image_url", "document_name", "doc_count"); |
| 92 | 77 | $aColumnTypes = array(4,3,3); |
| 93 | 78 | $aColumnHeaders = array("<font color=\"ffffff\">Folder</font>","<font color=\"ffffff\">Document</font>", "<font color=\"ffffff\">Matches</font>"); |
| ... | ... | @@ -99,7 +84,7 @@ function getSearchResults($sMetaTagIDs, $sSQLSearchString, $iStartIndex) { |
| 99 | 84 | $oPatternBrowse->setStartIndex($iStartIndex); |
| 100 | 85 | |
| 101 | 86 | $sRefreshMessage = "<table><tr><td align=\"center\">If your browser displays a 'Warning: Page has Expired' message when you attempt to return to these search results, please click your browser's 'Refresh' button</td></tr></table>"; |
| 102 | - return "<table width=\"600\">" . renderHeading("Advanced Search") . "</table>" . $oPatternBrowse->render() . $sRefreshMessage . getSearchVariablesHtml($sSearchText, $sMetaTagIDs); | |
| 87 | + return renderHeading("Advanced Search") . $oPatternBrowse->render() . $sRefreshMessage . getSearchVariablesHtml($sSearchText, $sMetaTagIDs); | |
| 103 | 88 | } |
| 104 | 89 | |
| 105 | 90 | function getSearchValidationJavaScript() { |
| ... | ... | @@ -133,6 +118,4 @@ function getSearchVariablesHtml($sSearchText, $sMetaTagIDs) { |
| 133 | 118 | $sToRender .= "<input type=\"hidden\" name=\"adv_search_end\" value=\"\" />\n"; |
| 134 | 119 | return $sToRender; |
| 135 | 120 | } |
| 136 | - | |
| 137 | -?> | |
| 138 | - | |
| 121 | +?> | |
| 139 | 122 | \ No newline at end of file | ... | ... |