Commit 782afb09b76554b5628865bc5fd89cd05c6d98d2
1 parent
3f30a629
(#2813) refactored and tidied
incorporated addLink link git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@2513 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
2 changed files
with
61 additions
and
49 deletions
presentation/lookAndFeel/knowledgeTree/administration/linkmanagement/listLinksBL.php
| ... | ... | @@ -8,56 +8,26 @@ |
| 8 | 8 | * |
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | - require_once("../../../../../config/dmsDefaults.php"); | |
| 11 | +require_once("../../../../../config/dmsDefaults.php"); | |
| 12 | +require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCreate.inc"); | |
| 13 | +require_once("$default->fileSystemRoot/presentation/lookAndFeel/knowledgeTree/foldermanagement/folderUI.inc"); | |
| 14 | +require_once("$default->fileSystemRoot/lib/foldermanagement/Folder.inc"); | |
| 15 | +require_once("$default->fileSystemRoot/lib/users/User.inc"); | |
| 16 | +require_once("$default->fileSystemRoot/lib/security/permission.inc"); | |
| 17 | +require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCustom.inc"); | |
| 18 | +require_once("$default->fileSystemRoot/lib/visualpatterns/PatternTableSqlQuery.inc"); | |
| 19 | +require_once("$default->fileSystemRoot/lib/visualpatterns/PatternBrowsableSearchResults.inc"); | |
| 20 | +require_once("$default->fileSystemRoot/lib/visualpatterns/PatternListBox.inc"); | |
| 21 | +require_once("$default->fileSystemRoot/presentation/Html.inc"); | |
| 22 | +require_once("$default->fileSystemRoot/presentation/lookAndFeel/knowledgeTree/administration/adminUI.inc"); | |
| 23 | +require_once("listLinksUI.inc"); | |
| 12 | 24 | |
| 13 | -if (checkSession()) { | |
| 14 | - require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCreate.inc"); | |
| 15 | - require_once("$default->fileSystemRoot/presentation/lookAndFeel/knowledgeTree/foldermanagement/folderUI.inc"); | |
| 16 | - require_once("$default->fileSystemRoot/lib/foldermanagement/Folder.inc"); | |
| 17 | - require_once("$default->fileSystemRoot/lib/users/User.inc"); | |
| 18 | - require_once("$default->fileSystemRoot/lib/security/permission.inc"); | |
| 19 | - require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); | |
| 20 | - require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCustom.inc"); | |
| 21 | - require_once("$default->fileSystemRoot/lib/visualpatterns/PatternTableSqlQuery.inc"); | |
| 22 | - require_once("$default->fileSystemRoot/lib/visualpatterns/PatternBrowsableSearchResults.inc"); | |
| 23 | - require_once("$default->fileSystemRoot/lib/visualpatterns/PatternListBox.inc"); | |
| 24 | - require_once("$default->fileSystemRoot/presentation/Html.inc"); | |
| 25 | - | |
| 26 | - | |
| 25 | +if (checkSession()) { | |
| 27 | 26 | $oPatternCustom = & new PatternCustom(); |
| 28 | - | |
| 29 | -if(checkSession()) { | |
| 30 | - global $default; | |
| 31 | - | |
| 32 | - $oPatternCustom->addHtml(renderHeading("Link Management")); // Create the Heading | |
| 33 | - | |
| 34 | - $main->setFormAction($_SERVER['PHP_SELF']); | |
| 35 | - | |
| 36 | - | |
| 37 | - $sQuery = "SELECT id as LinkID, name as LinkName, url LinkURL, rank as LinkRank, " . | |
| 38 | - "'Edit', 'Delete' " . | |
| 39 | - "FROM " . $default->owl_links_table . " " . | |
| 40 | - "ORDER BY name"; | |
| 41 | - | |
| 42 | - $aColumns = array("LinkName", "LinkURL", "LinkRank", "Edit", "Delete"); | |
| 43 | - $aColumnNames = array("Link Name","URL", "Rank", "Edit", "Delete"); | |
| 44 | - $aColumnTypes = array(1,1,1,3,3); | |
| 45 | - $aDBColumnArray = array("LinkID"); | |
| 46 | - $aQueryStringVariableNames = array("fLinkID"); | |
| 47 | - | |
| 48 | - $aHyperLinkURL = array( 3=> "$default->rootUrl/control.php?action=editLink", | |
| 49 | - 4=> "$default->rootUrl/control.php?action=removeLink"); | |
| 50 | - | |
| 51 | - | |
| 52 | - $oSearchResults = & new PatternTableSqlQuery($sQuery, $aColumns, $aColumnTypes, $aColumnNames, "100%", $aHyperLinkURL,$aDBColumnArray,$aQueryStringVariableNames); | |
| 53 | - $oSearchResults->setDisplayColumnHeadings(true); | |
| 54 | - $htmlTables = $oSearchResults->render() ; | |
| 55 | - | |
| 56 | - $oPatternCustom->addHtml($htmlTables); | |
| 57 | - | |
| 58 | - } // end of if checksession | |
| 59 | - | |
| 27 | + $oPatternCustom->setHtml(getPage($fGroupID)); | |
| 28 | + require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); | |
| 60 | 29 | $main->setCentralPayload($oPatternCustom); |
| 61 | - $main->render(); | |
| 30 | + $main->setFormAction($_SERVER['PHP_SELF']); | |
| 31 | + $main->render(); | |
| 62 | 32 | } |
| 63 | 33 | -?> |
| 34 | +?> | |
| 64 | 35 | \ No newline at end of file | ... | ... |
presentation/lookAndFeel/knowledgeTree/administration/linkmanagement/listLinksUI.inc
0 → 100644
| 1 | +<?php | |
| 2 | +/** | |
| 3 | +* Presentation information for list links | |
| 4 | +* | |
| 5 | +* @author Omar Rahbeeni | |
| 6 | +* @date 19 May 2003 | |
| 7 | +* @package presentation.lookAndFeel.knowledgeTree. | |
| 8 | +* | |
| 9 | +*/ | |
| 10 | + | |
| 11 | +function getQuickLinks() { | |
| 12 | + global $default; | |
| 13 | + $sQuery = "SELECT id as LinkID, name as LinkName, url LinkURL, rank as LinkRank, " . | |
| 14 | + "'Edit', 'Delete' " . | |
| 15 | + "FROM " . $default->owl_links_table . " " . | |
| 16 | + "ORDER BY name"; | |
| 17 | + | |
| 18 | + $aColumns = array("LinkName", "LinkURL", "LinkRank", "Edit", "Delete"); | |
| 19 | + $aColumnNames = array("Link Name","URL", "Rank", "Edit", "Delete"); | |
| 20 | + $aColumnTypes = array(1,1,1,3,3); | |
| 21 | + $aDBColumnArray = array("LinkID"); | |
| 22 | + $aQueryStringVariableNames = array("fLinkID"); | |
| 23 | + | |
| 24 | + $aHyperLinkURL = array( 3=> "$default->rootUrl/control.php?action=editLink", | |
| 25 | + 4=> "$default->rootUrl/control.php?action=removeLink"); | |
| 26 | + | |
| 27 | + | |
| 28 | + $oSearchResults = & new PatternTableSqlQuery($sQuery, $aColumns, $aColumnTypes, $aColumnNames, "100%", $aHyperLinkURL,$aDBColumnArray,$aQueryStringVariableNames); | |
| 29 | + $oSearchResults->setDisplayColumnHeadings(true); | |
| 30 | + return $oSearchResults->render() ; | |
| 31 | +} | |
| 32 | + | |
| 33 | +function getPage() { | |
| 34 | + global $default; | |
| 35 | + $sToRender .= renderHeading("Current System QuickLinks"); | |
| 36 | + | |
| 37 | + // add user link | |
| 38 | + $sToRender .= getAddLink("addLink", "Add A QuickLink"); | |
| 39 | + $sToRender .= getQuickLinks(); | |
| 40 | + return $sToRender; | |
| 41 | +} | |
| 42 | +?> | |
| 0 | 43 | \ No newline at end of file | ... | ... |