Index: inc/class.boacl.inc.php =================================================================== RCS file: /cvsroot/phpgroupware/news_admin/inc/class.boacl.inc.php,v retrieving revision 1.1.2.3 diff -u -r1.1.2.3 class.boacl.inc.php --- inc/class.boacl.inc.php 9 Jul 2003 05:02:55 -0000 1.1.2.3 +++ inc/class.boacl.inc.php 17 Jan 2005 12:08:19 -0000 @@ -28,7 +28,6 @@ function boacl($session=False) { $this->so = CreateObject('news_admin.soacl'); - $this->accounts = $GLOBALS['phpgw']->accounts->get_list(); $this->debug = False; //all this is only needed when called from uiacl. not from ui, if($session) @@ -106,6 +105,7 @@ $writecat = $write ? $write : array(); $this->so->remove_location('L' . $cat_id); + $this->accounts = $GLOBALS['phpgw']->accounts->get_list(); reset($this->accounts); while (list($null,$account) = each($this->accounts)) { Index: inc/class.bonews.inc.php =================================================================== RCS file: /cvsroot/phpgroupware/news_admin/inc/Attic/class.bonews.inc.php,v retrieving revision 1.1.2.1.2.8 diff -u -r1.1.2.1.2.8 class.bonews.inc.php --- inc/class.bonews.inc.php 19 Mar 2004 15:52:20 -0000 1.1.2.1.2.8 +++ inc/class.bonews.inc.php 17 Jan 2005 12:08:19 -0000 @@ -32,7 +32,7 @@ { $this->acl = CreateObject('news_admin.boacl'); $this->sonews = CreateObject('news_admin.sonews'); - $this->accounts = $GLOBALS['phpgw']->accounts->get_list(); +/* $this->accounts = $GLOBALS['phpgw']->accounts->get_list(); */ $this->debug = False; if($session) { Index: inc/class.sonews.inc.php =================================================================== RCS file: /cvsroot/phpgroupware/news_admin/inc/Attic/class.sonews.inc.php,v retrieving revision 1.1.2.1.2.10 diff -u -r1.1.2.1.2.10 class.sonews.inc.php --- inc/class.sonews.inc.php 19 Mar 2004 15:52:30 -0000 1.1.2.1.2.10 +++ inc/class.sonews.inc.php 17 Jan 2005 12:08:19 -0000 @@ -70,6 +70,7 @@ 'teaser' => htmlentities($this->db->f('news_teaser', True)), 'content' => $this->db->f('news_content',True), 'is_html' => ($this->db->f('is_html') ? True : False), + 'cat_id' => $this->db->f('news_cat'), ); } return $news; Index: inc/class.uiacl.inc.php =================================================================== RCS file: /cvsroot/phpgroupware/news_admin/inc/class.uiacl.inc.php,v retrieving revision 1.1.2.1 diff -u -r1.1.2.1 class.uiacl.inc.php --- inc/class.uiacl.inc.php 23 Jun 2003 19:20:52 -0000 1.1.2.1 +++ inc/class.uiacl.inc.php 17 Jan 2005 12:08:19 -0000 @@ -107,8 +107,8 @@ function selectlist($right) { - reset($this->bo->accounts); - while (list($null,$account) = each($this->bo->accounts)) + reset($this->accounts); + while (list($null,$account) = each($this->accounts)) { $selectlist .= '') : ''; $cats = is_array($this->bo->cats) ? $this->bo->cats : array(); + if (!$default) + { + $link_data['cat_id'] = 'all'; + $selectlist .= '' . "\n"; + } foreach($cats as $cat) { if($this->bo->acl->is_permitted($cat['id'],$right)) @@ -70,12 +76,6 @@ $selectlist .= '>' . $cat['name'] . '' . "\n"; } } - if (!$default) - { - $link_data['cat_id'] = 'all'; - $selectlist .= '' . "\n"; - } return $selectlist; } @@ -99,6 +99,9 @@ $GLOBALS['phpgw']->common->phpgw_header(); echo parse_navbar(); $this->template->set_block('main','category'); + $this->template->set_block('main','category_name_tpl'); + $this->template->set_block('main','category_icon_tpl'); + $var['lang_read'] = lang('Read'); $var['lang_write'] = lang('Write'); $var['readable'] = $this->selectlist('read'); @@ -119,7 +122,26 @@ 'submitedby' => 'Submitted by ' . $GLOBALS['phpgw']->accounts->id2name($newsitem['submittedby']) . ' on ' . $GLOBALS['phpgw']->common->show_date($newsitem['date']), 'content' => ($newsitem['is_html'] ? $newsitem['content'] : nl2br($newsitem['content'])), ); - + if ( $this->cat_id == 'all' ) + { + $cat_name = $this->bo->catbo->id2name($newsitem['cat_id']); + $cat_img = $GLOBALS['phpgw']->common->image('news_admin','news-'.$cat_name); //without the .gif/.png image give the right one + if ( empty($cat_img) ) + { + $val = array('category_name' => $cat_name .': '); + $this->template->set_var($val); + $this->template->fp('category_icon','category_name_tpl',False); + } + else + { + $val = array( + 'category_name' => $cat_name, + 'category_img' => $cat_img + ); + $this->template->set_var($val); + $this->template->fp('category_icon','category_icon_tpl',False); + } + } $this->template->set_var($var); $this->template->parse('rows','row',True); } Index: templates/default/read.tpl =================================================================== RCS file: /cvsroot/phpgroupware/news_admin/templates/default/read.tpl,v retrieving revision 1.1.2.1 diff -u -r1.1.2.1 read.tpl --- templates/default/read.tpl 23 Jun 2003 19:20:52 -0000 1.1.2.1 +++ templates/default/read.tpl 17 Jan 2005 12:08:19 -0000 @@ -13,7 +13,10 @@
{content}
@@ -42,3 +45,11 @@ {maintainlink} + + + + + + + {category_name} +