phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: sitemgr/modules class.module_news.inc.php,1.5,1.


From: Michael Totschnig <address@hidden>
Subject: [Phpgroupware-cvs] CVS: sitemgr/modules class.module_news.inc.php,1.5,1.6
Date: Thu, 05 Jun 2003 22:14:58 -0400

Update of /cvsroot/phpgroupware/sitemgr/modules
In directory subversions:/tmp/cvs-serv2674/modules

Modified Files:
        class.module_news.inc.php 
Log Message:
simplify application header and integrate menus into idots template


Index: class.module_news.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/sitemgr/modules/class.module_news.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** class.module_news.inc.php   1 Jun 2003 01:00:39 -0000       1.5
--- class.module_news.inc.php   6 Jun 2003 02:14:55 -0000       1.6
***************
*** 8,17 ****
                        $this->arguments = array(
                                'category' => array('type' => 'select', 'label' 
=> lang('Choose a category'), 'options' => array()),
!                               'rsslink' => array('type' => 'checkbox', 
'label' => lang('Do you want to publish a RSS feed for this news category'))
                        );
!                       $this->get = array('item');
                        $this->properties = array();
                        $this->title = lang('News module');
!                       $this->description = lang('This module publishes news 
from the news_admin application on your website.');
                        $this->template;
                }
--- 8,23 ----
                        $this->arguments = array(
                                'category' => array('type' => 'select', 'label' 
=> lang('Choose a category'), 'options' => array()),
!                               'rsslink' => array('type' => 'checkbox', 
'label' => lang('Do you want to publish a RSS feed for this news category')),
!                               'limit' => array(
!                                       'type' => 'textfield', 
!                                       'label' => lang('Number of news items 
to be displayed on page'),
!                                       'params' => array('size' => 3)
!                               )
                        );
!                       $this->get = array('item','start');
!                       $this->session = array('item','start');
                        $this->properties = array();
                        $this->title = lang('News module');
!                       $this->description = lang('This module publishes news 
from the news_admin application on your website. Be aware of news_admin\'s ACL 
restrictions.');
                        $this->template;
                }
***************
*** 22,27 ****
                        //and not when it is generated for the web site, thus 
speeding the latter up slightly
                        $cat = 
createobject('phpgwapi.categories','','news_admin');
!                       $cats = $cat->return_array('mains',0,False);
!                       $cat_ids = array(0 => lang('Mains'));
                        while (list(,$category) = @each($cats))
                        {
--- 28,32 ----
                        //and not when it is generated for the web site, thus 
speeding the latter up slightly
                        $cat = 
createobject('phpgwapi.categories','','news_admin');
!                       $cats = 
$cat->return_array('all',0,False,'','','cat_name',True);
                        while (list(,$category) = @each($cats))
                        {
***************
*** 34,38 ****
                function get_content(&$arguments,$properties)
                {
!                       $bonews = CreateObject('news_admin.bonews');
  
                        $this->template = Createobject('phpgwapi.Template');
--- 39,43 ----
                function get_content(&$arguments,$properties)
                {
!                       $bonews = CreateObject('news_admin.bo');
  
                        $this->template = Createobject('phpgwapi.Template');
***************
*** 42,53 ****
                        
$this->template->set_block('news','RssBlock','rsshandle');
  
                        $item = $arguments['item'];
                        if ($item)
                        {
                                $newsitem = $bonews->get_news($item);
!                               if ($newsitem)
                                {
!                                       $this->render($newsitem[$item]);
!                                       return 
$this->template->get_var('newsitem');
                                }
                                else
--- 47,74 ----
                        
$this->template->set_block('news','RssBlock','rsshandle');
  
+                       if ($arguments['rsslink'])
+                       {
+                               $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');
+                       }
+                       else
+                       {
+                               $this->template->set_var('rsshandle','');
+                       }
+ 
                        $item = $arguments['item'];
                        if ($item)
                        {
                                $newsitem = $bonews->get_news($item);
!                               if ($newsitem && ($newsitem['category'] == 
$arguments['category']))
                                {
!                                       $this->render($newsitem);
!                                       $link_data['item'] = 0;
!                                       $this->template->set_var('morelink',
!                                               '<a href="' . 
$this->link($link_data) . '">' . lang('More news') . '</a>'
!                                       );
!                                       return 
$this->template->parse('out','news');
! //                                    return 
$this->template->get_var('newsitem');
                                }
                                else
***************
*** 57,76 ****
                        }
  
!                       $newslist = 
$bonews->get_NewsList($arguments['category'], false);
  
!                       if ($arguments['rss'])
                        {
!                               $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');
                        }
!                       else
                        {
!                               $this->template->set_var('rsshandle','');
                        }
! 
!                       while (list(,$newsitem) = @each($newslist))
                        {
!                               $this->render($newsitem);
                        }
                        return $this->template->parse('out','news');
--- 78,101 ----
                        }
  
!                       $newslist = 
$bonews->get_newslist($arguments['category'],$arguments['start'],'','',$arguments['limit'],True);
!                       $total = $bonews->total($arguments['category'],True);
  
!                       while (list(,$newsitem) = @each($newslist))
                        {
!                               $this->render($newsitem);
                        }
!                       if ($arguments['start'])
                        {
!                               $link_data['start'] = $arguments['start'] - 
$arguments['limit'];
!                               $this->template->set_var('lesslink',
!                                       '<a href="' . $this->link($link_data) . 
'">&lt;&lt;&lt;</a>'
!                               );
                        }
!                       if ($total > $arguments['start'] + $arguments['limit'])
                        {
!                               $link_data['start'] = $arguments['start'] + 
$arguments['limit'];
!                               $this->template->set_var('morelink',
!                                       '<a href="' . $this->link($link_data) . 
'">' . lang('More news') . '</a>'
!                               );
                        }
                        return $this->template->parse('out','news');
***************
*** 82,86 ****
                                'news_title' => $newsitem['subject'],
                                'news_submitter' => 
$GLOBALS['phpgw']->accounts->id2name($newsitem['submittedby']),
!                               'news_date' => 
$GLOBALS['phpgw']->common->show_date($newsitem['submissiondate']),
                                'news_content' => $newsitem['content']
                        ));
--- 107,111 ----
                                'news_title' => $newsitem['subject'],
                                'news_submitter' => 
$GLOBALS['phpgw']->accounts->id2name($newsitem['submittedby']),
!                               'news_date' => 
$GLOBALS['phpgw']->common->show_date($newsitem['date']),
                                'news_content' => $newsitem['content']
                        ));





reply via email to

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