From 6e6e17d6046a70b1df1de34c57bfd72ffbf48ef9 Mon Sep 17 00:00:00 2001 From: andrew Date: Thu, 5 Feb 2004 12:41:44 +0000 Subject: [PATCH] Type: Functionality change. Description: Added a configurable MARQUEE'd scrolling news to dashboard. Credit: This patch was supplied by Stefano Ciancio. --- lib/dashboard/DashboardNews.inc | 20 +++++++++----------- presentation/lookAndFeel/knowledgeTree/dashboardUI.inc | 45 +++++++++++++++++++++++++++++---------------- 2 files changed, 38 insertions(+), 27 deletions(-) diff --git a/lib/dashboard/DashboardNews.inc b/lib/dashboard/DashboardNews.inc index d9a21e7..4162de4 100644 --- a/lib/dashboard/DashboardNews.inc +++ b/lib/dashboard/DashboardNews.inc @@ -312,10 +312,10 @@ class DashboardNews { //set the current news item primary key $this->iId = $sql->insert_id(); - if ($this->bActive) { - // we're setting this entry to active, so set all the others to inactive - $sql->query("UPDATE $default->news_table SET active=0 WHERE id <> $this->iId"); - } +// if ($this->bActive) { +// // we're setting this entry to active, so set all the others to inactive +// $sql->query("UPDATE $default->news_table SET active=0 WHERE id <> $this->iId"); +// } return true; } @@ -345,14 +345,12 @@ class DashboardNews { $result = $sql->query($sQuery); if ($result) { if ($this->bActive) { - // we're setting this entry to active, so set all the others to inactive - $sql->query("UPDATE $default->news_table SET active=0"); // now set our entry to active $sql->query("UPDATE $default->news_table SET active=1 where id=$this->iId"); - } else { - // set this to inactive - $sql->query("UPDATE $default->news_table SET active=0 where id=$this->iId"); - } + } else { + // set this to inactive + $sql->query("UPDATE $default->news_table SET active=0 where id=$this->iId"); + } return true; } return false; @@ -477,4 +475,4 @@ class DashboardNews { return ""; } } -} \ No newline at end of file +} diff --git a/presentation/lookAndFeel/knowledgeTree/dashboardUI.inc b/presentation/lookAndFeel/knowledgeTree/dashboardUI.inc index aa1086b..a845e50 100644 --- a/presentation/lookAndFeel/knowledgeTree/dashboardUI.inc +++ b/presentation/lookAndFeel/knowledgeTree/dashboardUI.inc @@ -228,23 +228,36 @@ function renderDashboardNews() { // retrieve all news items $aDashboardNews = DashboardNews::getList("active=1"); + if ($default->ScrollingNews) { + + $sToRender .= ""; $sToRender .= "\t\t\t\n"; - // the main news item - $oMainDashboardNews = $aDashboardNews[0]; - if ($oMainDashboardNews) { - $sToRender .= "\t\t\t\t\n"; - $sToRender .= "\t\t\t\t\n"; - $sToRender .= "\t\t\t\t\n"; - } - - // links to old news items - /* - for ($i=1; $i\n"; - } - */ - $sToRender .= "\t\t\t
" . $oMainDashboardNews->getSynopsis() . "
" . $oMainDashboardNews->getImageLink() . "
" . $oMainDashboardNews->getBodyFragment() . "..... more
\n"; + + // For each news ... + foreach($aDashboardNews as $key => $oMainDashboardNews) { + + $sToRender .= "\t\t\t\t". $oMainDashboardNews->getImageLink() . "\t".$oMainDashboardNews->getSynopsis() . "...\n"; + } + + $sToRender .= "\t\t\t\n"; + $sToRender .= "
"; + + } else { + + $sToRender .= "\t\t\t\n"; + + // the main news item + $oMainDashboardNews = $aDashboardNews[0]; + if ($oMainDashboardNews) { + $sToRender .= "\t\t\t\t\n"; + $sToRender .= "\t\t\t\t\n"; + $sToRender .= "\t\t\t\t\n"; + } + $sToRender .= "\t\t\t
" . $oMainDashboardNews->getSynopsis() . "
" . $oMainDashboardNews->getImageLink() . "
" . $oMainDashboardNews->getBodyFragment() . "..... more
\n"; + + } + return $sToRender; } @@ -324,4 +337,4 @@ function renderNewsItemPage($oDashboardNews) { return $sToRender; } -?> \ No newline at end of file +?> -- libgit2 0.21.4