Commit afefb6511f93bbbb07d97449abaf43d430399cfd

Authored by Michael Joseph
1 parent 2e26fb28

only display dashboard news if there is something to display


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@1809 c91229c3-7414-0410-bfa2-8a42b809f60b
presentation/lookAndFeel/knowledgeTree/dashboardUI.inc
@@ -155,9 +155,11 @@ function renderDashboardNews() { @@ -155,9 +155,11 @@ function renderDashboardNews() {
155 $sToRender .= "\t\t\t<table border=\"0\" width=\"100%\">\n"; 155 $sToRender .= "\t\t\t<table border=\"0\" width=\"100%\">\n";
156 // the main news item 156 // the main news item
157 $oMainDashboardNews = $aDashboardNews[0]; 157 $oMainDashboardNews = $aDashboardNews[0];
158 - $sToRender .= "\t\t\t\t<tr><td><strong>" . $oMainDashboardNews->getSynopsis() . "</strong></td></tr>\n";  
159 - $sToRender .= "\t\t\t\t<tr><td>" . $oMainDashboardNews->getImageLink() . "</td></tr>\n";  
160 - $sToRender .= "\t\t\t\t<tr><td>" . $oMainDashboardNews->getBodyFragment() . "..... <a href=\"#\" onClick=\"javascript:window.open('" . generateControllerUrl("viewNewsItem", "fNewsID=" . $oMainDashboardNews->getID()) . "', 'newwindow', config='height=200,width=300,left=0,top=0, toolbar=no, menubar=no, scrollbars=yes, resizable=no,location=no, directories=no, status=no');return false;\">more</a></td></tr>\n"; 158 + if ($oMainDashboardNews) {
  159 + $sToRender .= "\t\t\t\t<tr><td><strong>" . $oMainDashboardNews->getSynopsis() . "</strong></td></tr>\n";
  160 + $sToRender .= "\t\t\t\t<tr><td>" . $oMainDashboardNews->getImageLink() . "</td></tr>\n";
  161 + $sToRender .= "\t\t\t\t<tr><td>" . $oMainDashboardNews->getBodyFragment() . "..... <a href=\"#\" onClick=\"javascript:window.open('" . generateControllerUrl("viewNewsItem", "fNewsID=" . $oMainDashboardNews->getID()) . "', 'newwindow', config='height=200,width=300,left=0,top=0, toolbar=no, menubar=no, scrollbars=yes, resizable=no,location=no, directories=no, status=no');return false;\">more</a></td></tr>\n";
  162 + }
161 163
162 // links to old news items 164 // links to old news items
163 /* 165 /*