phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] sitemgr modules/class.module_news.inc.php sitem... [s


From: Dave Hall
Subject: [Phpgroupware-cvs] sitemgr modules/class.module_news.inc.php sitem... [skwashd-16-compat]
Date: Sun, 13 Aug 2006 11:09:46 +0000

CVSROOT:        /cvsroot/phpgroupware
Module name:    sitemgr
Branch:         skwashd-16-compat
Changes by:     Dave Hall <skwashd>     06/08/13 11:09:46

Modified files:
        modules        : class.module_news.inc.php 
        sitemgr-site/templates/default/modules/news: newsblock.tpl 
Added files:
        sitemgr-site/templates/default/modules/news/images: 
                                                            feed-icon.png 
                                                            feed-icon.svg 
Removed files:
        sitemgr-site/templates/NukeNews/modules/news: newsblock.tpl 
        sitemgr-site/templates/phpgroupware/modules/news: newsblock.tpl 

Log message:
        fix news block

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/sitemgr/modules/class.module_news.inc.php?cvsroot=phpgroupware&only_with_tag=skwashd-16-compat&r1=1.2.2.5&r2=1.2.2.5.4.1
http://cvs.savannah.gnu.org/viewcvs/sitemgr/sitemgr-site/templates/default/modules/news/newsblock.tpl?cvsroot=phpgroupware&only_with_tag=skwashd-16-compat&r1=1.1.2.1&r2=1.1.2.1.4.1
http://cvs.savannah.gnu.org/viewcvs/sitemgr/sitemgr-site/templates/default/modules/news/images/feed-icon.png?cvsroot=phpgroupware&only_with_tag=skwashd-16-compat&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/sitemgr/sitemgr-site/templates/default/modules/news/images/feed-icon.svg?cvsroot=phpgroupware&only_with_tag=skwashd-16-compat&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/sitemgr/sitemgr-site/templates/NukeNews/modules/news/newsblock.tpl?cvsroot=phpgroupware&only_with_tag=skwashd-16-compat&r1=1.1.2.1&r2=0
http://cvs.savannah.gnu.org/viewcvs/sitemgr/sitemgr-site/templates/phpgroupware/modules/news/newsblock.tpl?cvsroot=phpgroupware&only_with_tag=skwashd-16-compat&r1=1.1.2.1&r2=0

Patches:
Index: modules/class.module_news.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/sitemgr/modules/class.module_news.inc.php,v
retrieving revision 1.2.2.5
retrieving revision 1.2.2.5.4.1
diff -u -b -r1.2.2.5 -r1.2.2.5.4.1
--- modules/class.module_news.inc.php   28 Jun 2003 16:14:42 -0000      1.2.2.5
+++ modules/class.module_news.inc.php   13 Aug 2006 11:09:46 -0000      
1.2.2.5.4.1
@@ -44,11 +44,11 @@
                {
                        $bonews = CreateObject('news_admin.bonews');
 
-                       $this->template = Createobject('phpgwapi.Template');
+                       $this->template = createobject('phpgwapi.Template');
                        $this->template->set_root($this->find_template_dir());
-                       $this->template->set_file('news','newsblock.tpl');
-                       
$this->template->set_block('news','NewsBlock','newsitem');
-                       
$this->template->set_block('news','RssBlock','rsshandle');
+                       $this->template->set_file('news', 'newsblock.tpl');
+                       $this->template->set_block('news', 'newsitem', 
'newsitems');
+                       $this->template->set_block('news', 'rss', 'rsshandle');
 
                        $limit = $arguments['limit'] ? $arguments['limit'] : 5;
 
@@ -56,18 +56,17 @@
                        {
                                $this->template->set_var('rsslink',
                                        
$GLOBALS['phpgw_info']['server']['webserver_url'] . 
'/news_admin/website/export.php?cat_id=' . $arguments['category']);
-                               $this->template->parse('rsshandle','RssBlock');
+                               $this->template->parse('rsshandle','rss');
                        }
                        else
                        {
                                $this->template->set_var('rsshandle','');
                        }
 
-                       $item = $arguments['item'];
-                       if ($item)
+                       if ( isset($arguments['item']) && (int) 
$arguments['item'] > 0 )
                        {
-                               $newsitem = $bonews->get_news($item);
-                               if ($newsitem && ($newsitem['category'] == 
$arguments['category']))
+                               $newsitem = 
$bonews->get_news($arguments['item']);
+                               if ( is_array($newsitem) && 
($newsitem['category'] == $arguments['category']))
                                {
                                        $this->render($newsitem);
                                        $link_data['item'] = 0;
@@ -75,7 +74,6 @@
                                                '<a href="' . 
$this->link($link_data) . '">' . lang('More news') . '</a>'
                                        );
                                        return 
$this->template->parse('out','news');
-//                                     return 
$this->template->get_var('newsitem');
                                }
                                else
                                {
@@ -85,18 +83,23 @@
 
                        $newslist = 
$bonews->get_newslist($arguments['category'],$arguments['start'],'','',$limit,True);
 
-                       while (list(,$newsitem) = @each($newslist))
+                       if ( !is_array($newslist) )
+                       {
+                               return $this->template->parse('out','news');
+                       }
+
+                       foreach ( $newslist as $newsitem )
                        {
                                $this->render($newsitem);
                        }
-                       if ($arguments['start'])
+                       if ( isset($arguments['start']) )
                        {
                                $link_data['start'] = $arguments['start'] - 
$limit;
                                $this->template->set_var('lesslink',
                                        '<a href="' . $this->link($link_data) . 
'">&lt;&lt;&lt;</a>'
                                );
                        }
-                       if ($bonews->total > $arguments['start'] + $limit)
+                       if ( $bonews->total > 0 && $bonews->total > 
($arguments['start'] + $limit) )
                        {
                                $link_data['start'] = $arguments['start'] + 
$limit;
                                $this->template->set_var('morelink',
@@ -114,6 +117,6 @@
                                'news_date' => 
$GLOBALS['phpgw']->common->show_date($newsitem['date']),
                                'news_content' => $newsitem['content']
                        ));
-                       $this->template->parse('newsitem','NewsBlock',True);
+                       $this->template->parse('newsitems','newsitem',True);
                }
        }

Index: sitemgr-site/templates/default/modules/news/newsblock.tpl
===================================================================
RCS file: 
/cvsroot/phpgroupware/sitemgr/sitemgr-site/templates/default/modules/news/newsblock.tpl,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.1.4.1
diff -u -b -r1.1.2.1 -r1.1.2.1.4.1
--- sitemgr-site/templates/default/modules/news/newsblock.tpl   30 Jun 2004 
04:29:16 -0000      1.1.2.1
+++ sitemgr-site/templates/default/modules/news/newsblock.tpl   13 Aug 2006 
11:09:46 -0000      1.1.2.1.4.1
@@ -1,33 +1,13 @@
-<!-- BEGIN NewsBlock -->
-<div align="right">
-<table width="95%" border="0" cellspacing="0" cellpadding="0">
-<tr>
-       <td height="23" width="432">
-               <b>
-                               {news_title}
-               </b>
-       </td>
-</tr>
-<tr> 
-       <td height="23"> 
-               <table width="100%" border="0" cellspacing="0" cellpadding="0">
-                       <tr> 
-                               <td> 
-                                       <p>
-                                               <i>Submitted by 
'{news_submitter}' {news_date}</i>
-                                               <br>
-                                               <br>
+<!-- BEGIN newsitem -->
+<div class="news_item">
+       <h2>{news_title}</h2>
+       <h3>Submitted by '{news_submitter}' {news_date}</h3>
+       <div class="news_content">
                                                        {news_content}
-                                       </p>
-                               </td>
-                       </tr>
-               </table>
-       </td>
-</tr>
-</table>
-<!-- BEGIN RssBlock -->
-<div align="right"><a href="{rsslink}">XML RSS</a></div>
-<!-- END RssBlock -->
+       </div>
 </div>
-<br><br>
-<!-- END NewsBlock -->
+<!-- END newsitem -->
+{lesslink} {morelink}
+<!-- BEGIN rss -->
+       <div class="news_rss_link"><a href="{rsslink}"><img 
src="templates/default/modules/news/images/feed-icon.png" alt="XML RSS" 
/>RSS</a></div>
+<!-- END rss -->

Index: sitemgr-site/templates/default/modules/news/images/feed-icon.png
===================================================================
RCS file: sitemgr-site/templates/default/modules/news/images/feed-icon.png
diff -N sitemgr-site/templates/default/modules/news/images/feed-icon.png
Binary files /dev/null and /tmp/cvsHjJxxh differ

Index: sitemgr-site/templates/default/modules/news/images/feed-icon.svg
===================================================================
RCS file: sitemgr-site/templates/default/modules/news/images/feed-icon.svg
diff -N sitemgr-site/templates/default/modules/news/images/feed-icon.svg
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ sitemgr-site/templates/default/modules/news/images/feed-icon.svg    13 Aug 
2006 11:09:46 -0000      1.1.2.1
@@ -0,0 +1,18 @@
+<?xml version="1.0"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" 
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd";> 
+<svg xmlns="http://www.w3.org/2000/svg"; version="1.1" width="128px" 
height="128px" id="RSSicon" viewBox="0 0 256 256">
+<defs>
+<linearGradient x1="0.085" y1="0.085" x2="0.915" y2="0.915" id="RSSg">
+<stop  offset="0.0" stop-color="#E3702D"/><stop  offset="0.1071" 
stop-color="#EA7D31"/>
+<stop  offset="0.3503" stop-color="#F69537"/><stop  offset="0.5" 
stop-color="#FB9E3A"/>
+<stop  offset="0.7016" stop-color="#EA7C31"/><stop  offset="0.8866" 
stop-color="#DE642B"/>
+<stop  offset="1.0" stop-color="#D95B29"/>
+</linearGradient>
+</defs>
+<rect width="256" height="256" rx="55" ry="55" x="0"  y="0"  fill="#CC5D15"/>
+<rect width="246" height="246" rx="50" ry="50" x="5"  y="5"  fill="#F49C52"/>
+<rect width="236" height="236" rx="47" ry="47" x="10" y="10" 
fill="url(#RSSg)"/>
+<circle cx="68" cy="189" r="24" fill="#FFF"/>
+<path d="M160 213h-34a82 82 0 0 0 -82 -82v-34a116 116 0 0 1 116 116z" 
fill="#FFF"/>
+<path d="M184 213A140 140 0 0 0 44 73 V 38a175 175 0 0 1 175 175z" 
fill="#FFF"/>
+</svg>

Index: sitemgr-site/templates/NukeNews/modules/news/newsblock.tpl
===================================================================
RCS file: sitemgr-site/templates/NukeNews/modules/news/newsblock.tpl
diff -N sitemgr-site/templates/NukeNews/modules/news/newsblock.tpl
--- sitemgr-site/templates/NukeNews/modules/news/newsblock.tpl  30 Jun 2004 
04:29:16 -0000      1.1.2.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,14 +0,0 @@
-<!-- BEGIN NewsBlock -->
-<table border="0" cellpadding="0" cellspacing="0" bgcolor="#ffffff" 
width="100%"><tr><td>
-<table border="0" cellpadding="1" cellspacing="0" bgcolor="#000000" 
width="100%"><tr><td>
-<table border="0" cellpadding="3" cellspacing="0" bgcolor="#cfcfbb" 
width="100%"><tr><td align="left">
-<font class="option" color="#363636"><b>{news_title}</b></font><br>
-<font class="content">{news_date}</font>
-</td></tr></table></td></tr></table><br>
-<font class="content">{news_content}</font>
-</td></tr></table><br>
-<!-- END NewsBlock -->
-<!-- BEGIN RssBlock -->
-<div align="right"><a href="{rsslink}">XML RSS</a></div>
-<!-- END RssBlock -->
-

Index: sitemgr-site/templates/phpgroupware/modules/news/newsblock.tpl
===================================================================
RCS file: sitemgr-site/templates/phpgroupware/modules/news/newsblock.tpl
diff -N sitemgr-site/templates/phpgroupware/modules/news/newsblock.tpl
--- sitemgr-site/templates/phpgroupware/modules/news/newsblock.tpl      23 Jun 
2003 20:31:22 -0000      1.1.2.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,40 +0,0 @@
-<!-- BEGIN RssBlock -->
-<div align="right"><a href="{rsslink}">XML RSS</a></div>
-<!-- END RssBlock -->
-<!-- BEGIN NewsBlock -->
-<div align="right">
-<table width="95%" border="0" cellspacing="0" cellpadding="0">
-<tr>
-       <td bgcolor="537991" height="23" width="432">
-               <b>
-                       <font color="#FFFFFF" size="2" face="Verdana, Arial, 
Helvetica, sans-serif">
-                               {news_title}
-                       </font>
-               </b>
-       </td>
-</tr>
-<tr> 
-       <td height="23"> 
-               <table width="100%" border="0" cellspacing="0" cellpadding="0">
-                       <tr> 
-                               <td> 
-                                       <p>
-                                       <font size="1" color="#FFFFFF" 
face="Verdana, Arial, Helvetica, sans-serif">
-                                               <i>Submitted by 
'{news_submitter}' {news_date}</i>
-                                               <br>
-                                               <br>
-                                               <font size="2">
-                                                       {news_content}
-                                               </font>
-                                       </font>
-                                       </p>
-                               </td>
-                       </tr>
-               </table>
-       </td>
-</tr>
-</table>
-</div>
-<br><br>
-<!-- END NewsBlock -->
-<table width="95%"><tr><td align="left">{lesslink}</td><td 
align="right">{morelink}</td></tr></table>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]