Commit ef3b4551baea514a7d39589e3c023222d009c6e6
1 parent
780b3800
(#2800) added empty table message
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@2413 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
2 changed files
with
15 additions
and
4 deletions
lib/visualpatterns/PatternListFromQuery.inc
| ... | ... | @@ -35,7 +35,9 @@ class PatternListFromQuery { |
| 35 | 35 | var $iTableWidth = null; |
| 36 | 36 | /** Picture paths */ |
| 37 | 37 | var $sChkPicPath = "widgets/checked.gif"; |
| 38 | - var $sUnChkPicPath = "widgets/unchecked.gif"; | |
| 38 | + var $sUnChkPicPath = "widgets/unchecked.gif"; | |
| 39 | + /** message that will be displayed if the table is empty*/ | |
| 40 | + var $sEmptyTableMessage; | |
| 39 | 41 | |
| 40 | 42 | /** |
| 41 | 43 | * Default constructor |
| ... | ... | @@ -72,6 +74,10 @@ class PatternListFromQuery { |
| 72 | 74 | $this->bIndividualTableForEachResult = $bNewValue; |
| 73 | 75 | } |
| 74 | 76 | |
| 77 | + function setEmptyTableMessage($sNewValue) { | |
| 78 | + $this->sEmptyTableMessage = $sNewValue; | |
| 79 | + } | |
| 80 | + | |
| 75 | 81 | function & render() { |
| 76 | 82 | global $default; |
| 77 | 83 | $sSectionName = $default->siteMap->getSectionName(substr($_SERVER["PHP_SELF"], strlen($default->rootUrl), strlen($_SERVER["PHP_SELF"]))); |
| ... | ... | @@ -87,8 +93,12 @@ class PatternListFromQuery { |
| 87 | 93 | } |
| 88 | 94 | |
| 89 | 95 | if ($sql->num_rows() == 0) { |
| 90 | - $sToRender .= "<tr>\n"; | |
| 91 | - $sToRender .= "<td colspan=" . count($this->aColumns) . ">No " . (isset($this->sTableHeading) ? "$this->sTableHeading" : "") . " data</td>\n"; | |
| 96 | + $sToRender .= "<tr>\n"; | |
| 97 | + if (isset($this->sEmptyTableMessage)) { | |
| 98 | + $sToRender .= "<td colspan=" . count($this->aColumns) . ">$this->sEmptyTableMessage</td>\n"; | |
| 99 | + } else { | |
| 100 | + $sToRender .= "<td colspan=" . count($this->aColumns) . ">No " . (isset($this->sTableHeading) ? "$this->sTableHeading" : "") . " data</td>\n"; | |
| 101 | + } | |
| 92 | 102 | $sToRender .= "</tr>\n"; |
| 93 | 103 | } else { |
| 94 | 104 | $iColour = 0; | ... | ... |
presentation/lookAndFeel/knowledgeTree/documentmanagement/viewUI.inc
| ... | ... | @@ -46,7 +46,8 @@ function renderDocumentData($oDocument, $bEditable, $sStatusMessage = "") { |
| 46 | 46 | $aColumnTypes = array(1,1,1,1,1,1,1,1); |
| 47 | 47 | $oPatternListFromQuery = & new PatternListFromQuery($sQuery, $aColumns, $aColumnNames, $aColumnTypes); |
| 48 | 48 | $oPatternListFromQuery->setTableHeading("Document Data"); |
| 49 | - $oPatternListFromQuery->setTableWidth("400"); | |
| 49 | + $oPatternListFromQuery->setEmptyTableMessage("No Document Data"); | |
| 50 | + $oPatternListFromQuery->setTableWidth("400"); | |
| 50 | 51 | |
| 51 | 52 | $sToRender .= "\t<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"100%\">\n"; |
| 52 | 53 | if ($sStatusMessage) { | ... | ... |