phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: news_admin/inc class.boadmin.inc.php,1.8,1.9 cla


From: Miles Lott <address@hidden>
Subject: [Phpgroupware-cvs] CVS: news_admin/inc class.boadmin.inc.php,1.8,1.9 class.soadmin.inc.php,1.6,1.7 class.uiadmin.inc.php,1.14,1.15
Date: Tue, 29 Jan 2002 23:29:18 -0500

Update of /cvsroot/phpgroupware/news_admin/inc
In directory subversions:/tmp/cvs-serv27292

Modified Files:
        class.boadmin.inc.php class.soadmin.inc.php 
        class.uiadmin.inc.php 
Log Message:
Reorganize how bo/ui/so are called



Index: class.boadmin.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/news_admin/inc/class.boadmin.inc.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** class.boadmin.inc.php       29 Dec 2001 12:48:10 -0000      1.8
--- class.boadmin.inc.php       30 Jan 2002 04:29:16 -0000      1.9
***************
*** 17,28 ****
        class boadmin
        {
-               var $public_functions = array(
-                       'add'    => True,
-                       'edit'   => True,
-                       'delete' => True
-                       );
- 
                function boadmin()
                {
                }
  
--- 17,23 ----
        class boadmin
        {
                function boadmin()
                {
+                       $this->so = createobject('news_admin.soadmin');
                }
  
***************
*** 31,67 ****
                        $news_id = $GLOBALS['HTTP_POST_VARS']['news_id'] ? 
$GLOBALS['HTTP_POST_VARS']['news_id'] : $GLOBALS['HTTP_GET_VARS']['news_id'];
  
!                       $so = createobject('news_admin.soadmin');
!                       $ui = createobject('news_admin.uiadmin');
! 
!                       $so->delete($news_id);
!                       $ui->news_list(lang('Item has been deleted'));
                }
  
!               function add()
                {
!                       $news = $GLOBALS['HTTP_POST_VARS']['news'];
! 
!                       $so = createobject('news_admin.soadmin');
!                       $ui = createobject('news_admin.uiadmin');
! 
!                       if (! $news['subject'])
!                       {
!                               $errors[] = lang('The subject is missing');
!                       }
! 
!                       if (! $news['content'])
!                       {
!                               $errors[] = lang('The news content is missing');
!                       }
  
!                       if (is_array($errors))
!                       {
!                               $ui->add($errors);
!                       }
!                       else
!                       {
!                               $so->add($news);
!                               $ui->news_list(lang('New item has been added'));
!                       }
                }
  
--- 26,41 ----
                        $news_id = $GLOBALS['HTTP_POST_VARS']['news_id'] ? 
$GLOBALS['HTTP_POST_VARS']['news_id'] : $GLOBALS['HTTP_GET_VARS']['news_id'];
  
!                       $this->so->delete($news_id);
!                       
ExecMethod('news_admin.uiadmin.news_list',array('message' => lang('Item has 
been deleted')));
                }
  
!               function add($news)
                {
!                       return $this->so->add($news);
!               }
  
!               function edit($news)
!               {
!                       return $this->so->edit($news);
                }
  
***************
*** 84,89 ****
                function view($news_id, $raw_values = False)
                {
!                       $so     = createobject('news_admin.soadmin');
!                       $item   = $so->view($news_id);
  
                        if (! $raw_values)
--- 58,62 ----
                function view($news_id, $raw_values = False)
                {
!                       $item = $this->so->view($news_id);
  
                        if (! $raw_values)
***************
*** 101,113 ****
                function total($cat_id)
                {
!                       $so = createobject('news_admin.soadmin');
!                       return $so->total($cat_id);
                }
  
                function getlist($order,$sort,$cat_id)
                {
!                       $so = createobject('news_admin.soadmin');
! 
!                       $items = $so->getlist($order,$sort,$cat_id);
  
                        while (is_array($items) && $item = each($items))
--- 74,83 ----
                function total($cat_id)
                {
!                       return $this->so->total($cat_id);
                }
  
                function getlist($order,$sort,$cat_id)
                {
!                       $items = $this->so->getlist($order,$sort,$cat_id);
  
                        while (is_array($items) && $item = each($items))

Index: class.soadmin.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/news_admin/inc/class.soadmin.inc.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** class.soadmin.inc.php       29 Dec 2001 12:48:10 -0000      1.6
--- class.soadmin.inc.php       30 Jan 2002 04:29:16 -0000      1.7
***************
*** 21,48 ****
                function soadmin()
                {
!                       $this->template = $GLOBALS['phpgw']->template;
!                       $this->db       = $GLOBALS['phpgw']->db;
                }
  
                function add($news)
                {
!                       $this->db->query("insert into phpgw_news 
(news_date,news_submittedby,news_content,news_subject,"
!                               . "news_status,news_cat) values ('" . time() . 
"','" . $GLOBALS['phpgw_info']['user']['account_id'] . "','"
                                . addslashes($news['content']) . "','" . 
addslashes($news['subject']) . "','"
                                . $news['status'] . "','" . $news['category'] . 
"')",__LINE__,__FILE__);
                }
  
!               function edit($news_id)
                {
                }
  
                function delete($news_id)
                {
!                       $this->db->query("delete from phpgw_news where 
news_id='$news_id'",__LINE__,__FILE__);
                }
  
                function total($cat_id)
                {
!                       $this->db->query("select count(*) from phpgw_news where 
news_cat='$cat_id'",__LINE__,__FILE__);
                        $this->db->next_record();
  
--- 21,53 ----
                function soadmin()
                {
!                       $this->db = $GLOBALS['phpgw']->db;
                }
  
                function add($news)
                {
!                       $this->db->query("INSERT INTO phpgw_news 
(news_date,news_submittedby,news_content,news_subject,"
!                               . "news_status,news_cat) VALUES ('" . time() . 
"','" . $GLOBALS['phpgw_info']['user']['account_id'] . "','"
                                . addslashes($news['content']) . "','" . 
addslashes($news['subject']) . "','"
                                . $news['status'] . "','" . $news['category'] . 
"')",__LINE__,__FILE__);
                }
  
!               function edit($news)
                {
+                       $this->db->query("UPDATE phpgw_news SET "
+                               . "news_date='" . time() . "',"
+                               . "news_submittedby='" . 
$GLOBALS['phpgw_info']['user']['account_id'] . "',"
+                               . "news_content='" . 
addslashes($news['content']) . "',"
+                               . "news_subject='" . 
addslashes($news['subject']) . "' "
+                               . "WHERE news_id=" . 
intval($news['id']),__LINE__,__FILE__);
                }
  
                function delete($news_id)
                {
!                       $this->db->query("DELETE FROM phpgw_news WHERE 
news_id='$news_id'",__LINE__,__FILE__);
                }
  
                function total($cat_id)
                {
!                       $this->db->query("SELECT COUNT(*) FROM phpgw_news WHERE 
news_cat='$cat_id'",__LINE__,__FILE__);
                        $this->db->next_record();
  
***************
*** 52,56 ****
                function view($news_id)
                {
!                       $this->db->query("select * from phpgw_news where 
news_id='$news_id'",__LINE__,__FILE__);
                        $this->db->next_record();
  
--- 57,61 ----
                function view($news_id)
                {
!                       $this->db->query("SELECT * FROM phpgw_news WHERE 
news_id='$news_id'",__LINE__,__FILE__);
                        $this->db->next_record();
  
***************
*** 71,79 ****
                        if ($order)
                        {
!                               $ordermethod = "order by $order $sort";
                        }
                        else
                        {
!                               $ordermethod = 'order by news_date desc';
                        }
  
--- 76,84 ----
                        if ($order)
                        {
!                               $ordermethod = "ORDER BY $order $sort";
                        }
                        else
                        {
!                               $ordermethod = 'ORDER BY news_date DESC';
                        }
  
***************
*** 83,87 ****
                        }
  
!                       $this->db->query("select * from phpgw_news where 
news_cat='$cat_id' $ordermethod",__LINE__,__FILE__);
                        while ($this->db->next_record())
                        {
--- 88,92 ----
                        }
  
!                       $this->db->query("SELECT * FROM phpgw_news WHERE 
news_cat='$cat_id' $ordermethod",__LINE__,__FILE__);
                        while ($this->db->next_record())
                        {

Index: class.uiadmin.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/news_admin/inc/class.uiadmin.inc.php,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -r1.14 -r1.15
*** class.uiadmin.inc.php       23 Jan 2002 12:42:32 -0000      1.14
--- class.uiadmin.inc.php       30 Jan 2002 04:29:16 -0000      1.15
***************
*** 17,21 ****
        class uiadmin
        {
!               var $db;
                var $template;
                var $session_data;
--- 17,21 ----
        class uiadmin
        {
!               var $bo;
                var $template;
                var $session_data;
***************
*** 26,37 ****
                        'edit'      => True,
                        'delete'    => True
!                       );
  
                function uiadmin()
                {
                        $GLOBALS['phpgw']->nextmatchs = 
createobject('phpgwapi.nextmatchs');
-                       $this->template     = $GLOBALS['phpgw']->template;
-                       $this->db           = $GLOBALS['phpgw']->db;
                        $this->session_data = 
$GLOBALS['phpgw']->session->appsession('session_data','news_admin');
                }
  
--- 26,37 ----
                        'edit'      => True,
                        'delete'    => True
!               );
  
                function uiadmin()
                {
                        $GLOBALS['phpgw']->nextmatchs = 
createobject('phpgwapi.nextmatchs');
                        $this->session_data = 
$GLOBALS['phpgw']->session->appsession('session_data','news_admin');
+                       $this->bo   = createobject('news_admin.boadmin');
+                       $this->cats = createobject('phpgwapi.categories');
                }
  
***************
*** 53,74 ****
                        $this->common_header();
  
!                       
$this->template->set_root($GLOBALS['phpgw']->common->get_tpl_dir('news_admin'));
!                       $this->template->set_file(array(
                                '_news' => 'news.tpl',
                        ));
!                       $this->template->set_block('_news','news_form');
!                       $this->template->set_block('_news','row');
  
!                       $bo     = createobject('news_admin.boadmin');
!                       $fields = $bo->view($news_id);
  
!                       
$this->template->set_var('icon',$GLOBALS['phpgw']->common->get_image_path('news_admin')
 . '/news-corner.gif');
!                       $this->template->set_var('subject',$fields['subject']);
!                       $this->template->set_var('submitedby','Submitted by ' . 
$GLOBALS['phpgw']->accounts->id2name($fields['submittedby']) . ' on ' . 
$fields['date']);
!                       
$this->template->set_var('content',nl2br($fields['content']));
  
!                       $this->template->parse('rows','row',True);
  
!                       $this->template->pfp('_out','news_form');
                }
  
--- 53,73 ----
                        $this->common_header();
  
!                       
$GLOBALS['phpgw']->template->set_root($GLOBALS['phpgw']->common->get_tpl_dir('news_admin'));
!                       $GLOBALS['phpgw']->template->set_file(array(
                                '_news' => 'news.tpl',
                        ));
!                       
$GLOBALS['phpgw']->template->set_block('_news','news_form');
!                       $GLOBALS['phpgw']->template->set_block('_news','row');
  
!                       $fields = $this->bo->view($news_id);
  
!                       
$GLOBALS['phpgw']->template->set_var('icon',$GLOBALS['phpgw']->common->get_image_path('news_admin')
 . '/news-corner.gif');
!                       
$GLOBALS['phpgw']->template->set_var('subject',$fields['subject']);
!                       
$GLOBALS['phpgw']->template->set_var('submitedby','Submitted by ' . 
$GLOBALS['phpgw']->accounts->id2name($fields['submittedby']) . ' on ' . 
$fields['date']);
!                       
$GLOBALS['phpgw']->template->set_var('content',nl2br($fields['content']));
  
!                       $GLOBALS['phpgw']->template->parse('rows','row',True);
  
!                       $GLOBALS['phpgw']->template->pfp('_out','news_form');
                }
  
***************
*** 79,102 ****
  
                        $this->common_header();
!                       $this->template->set_file(array(
                                'form' => 'admin_delete.tpl'
                        ));
!                       $this->template->set_var('lang_message',lang('Are you 
sure you want to delete this entry ?'));
!                       $this->template->set_var('lang_yes',lang('Yes'));
!                       $this->template->set_var('lang_no',lang('No'));
  
!                       
$this->template->set_var('link_yes',$GLOBALS['phpgw']->link('/index.php','menuaction=news_admin.boadmin.delete&news_id='
 . $news_id));
!                       
$this->template->set_var('link_no',$GLOBALS['phpgw']->link('/index.php','menuaction=news_admin.uiadmin.news_list'));
  
!                       $this->template->pfp('_out','form');
                }
  
                function add($errors = '')
                {
!                       $news = $GLOBALS['HTTP_POST_VARS']['news'];
  
!                       $this->common_header();
  
!                       $cats = createobject('phpgwapi.categories');
  
                        $GLOBALS['phpgw']->template->set_file(array(
--- 78,122 ----
  
                        $this->common_header();
!                       $GLOBALS['phpgw']->template->set_file(array(
                                'form' => 'admin_delete.tpl'
                        ));
!                       
$GLOBALS['phpgw']->template->set_var('lang_message',lang('Are you sure you want 
to delete this entry ?'));
!                       
$GLOBALS['phpgw']->template->set_var('lang_yes',lang('Yes'));
!                       
$GLOBALS['phpgw']->template->set_var('lang_no',lang('No'));
  
!                       
$GLOBALS['phpgw']->template->set_var('link_yes',$GLOBALS['phpgw']->link('/index.php','menuaction=news_admin.boadmin.delete&news_id='
 . $news_id));
!                       
$GLOBALS['phpgw']->template->set_var('link_no',$GLOBALS['phpgw']->link('/index.php','menuaction=news_admin.uiadmin.news_list'));
  
!                       $GLOBALS['phpgw']->template->pfp('_out','form');
                }
  
                function add($errors = '')
                {
!                       $news   = $GLOBALS['HTTP_POST_VARS']['news'];
!                       $submit = $GLOBALS['HTTP_POST_VARS']['submit'];
  
!                       if($GLOBALS['HTTP_POST_VARS']['cancel'])
!                       {
!                               Header('Location: ' . 
$GLOBALS['phpgw']->link('/index.php','menuaction=news_admin.uiadmin.news_list'));
!                       }
!                       if($submit)
!                       {
!                               if (! $news['subject'])
!                               {
!                                       $errors[] = lang('The subject is 
missing');
!                               }
!                               if (! $news['content'])
!                               {
!                                       $errors[] = lang('The news content is 
missing');
!                               }
  
!                               if (!is_array($errors))
!                               {
!                                       $this->bo->add($news);
!                                       $message = lang('News item has been 
added');
!                               }
!                       }
! 
!                       $this->common_header();
  
                        $GLOBALS['phpgw']->template->set_file(array(
***************
*** 108,111 ****
--- 128,135 ----
                                
$GLOBALS['phpgw']->template->set_var('errors',$GLOBALS['phpgw']->common->error_list($errors));
                        }
+                       elseif($message)
+                       {
+                               
$GLOBALS['phpgw']->template->set_var('errors',$message);
+                       }
  
                        
$GLOBALS['phpgw']->template->set_var('th_bg',$GLOBALS['phpgw_info']['theme']['th_bg']);
***************
*** 115,120 ****
  
                        
$GLOBALS['phpgw']->template->set_var('lang_header',lang('Add news item'));
!                       
$GLOBALS['phpgw']->template->set_var('form_action',$GLOBALS['phpgw']->link('/index.php','menuaction=news_admin.boadmin.add'));
                        
$GLOBALS['phpgw']->template->set_var('form_button','<input type="submit" 
name="submit" value="' . lang('Add') . '">');
  
                        
$GLOBALS['phpgw']->template->set_var('label_subject',lang('subject') . ':');
--- 139,145 ----
  
                        
$GLOBALS['phpgw']->template->set_var('lang_header',lang('Add news item'));
!                       
$GLOBALS['phpgw']->template->set_var('form_action',$GLOBALS['phpgw']->link('/index.php','menuaction=news_admin.uiadmin.add'));
                        
$GLOBALS['phpgw']->template->set_var('form_button','<input type="submit" 
name="submit" value="' . lang('Add') . '">');
+                       
$GLOBALS['phpgw']->template->set_var('done_button','<input type="submit" 
name="cancel" value="' . lang('Done') . '">');
  
                        
$GLOBALS['phpgw']->template->set_var('label_subject',lang('subject') . ':');
***************
*** 125,129 ****
  
                        
$GLOBALS['phpgw']->template->set_var('label_category',lang('Category') . ':');
!                       
$GLOBALS['phpgw']->template->set_var('value_category','<select 
name="news[category]"><option value="0">' . lang('Main') . '</option>' . 
$cats->formated_list('select','mains',$news['category']) . '</select>');
  
                        
$GLOBALS['phpgw']->template->set_var('label_status',lang('Status') . ':');
--- 150,154 ----
  
                        
$GLOBALS['phpgw']->template->set_var('label_category',lang('Category') . ':');
!                       
$GLOBALS['phpgw']->template->set_var('value_category','<select 
name="news[category]"><option value="0">' . lang('Main') . '</option>' . 
$this->cats->formated_list('select','mains',$news['category']) . '</select>');
  
                        
$GLOBALS['phpgw']->template->set_var('label_status',lang('Status') . ':');
***************
*** 137,144 ****
                function edit($errors = '')
                {
!                       $news = $GLOBALS['HTTP_POST_VARS']['news'];
  
                        $this->common_header();
-                       $cats = createobject('phpgwapi.categories');
  
                        $GLOBALS['phpgw']->template->set_file(array(
--- 162,195 ----
                function edit($errors = '')
                {
!                       $news    = $GLOBALS['HTTP_POST_VARS']['news'];
!                       $news_id = $GLOBALS['HTTP_GET_VARS']['news_id'];
! 
!                       if($GLOBALS['HTTP_POST_VARS']['cancel'])
!                       {
!                               Header('Location: ' . 
$GLOBALS['phpgw']->link('/index.php','menuaction=news_admin.uiadmin.news_list'));
!                       }
!                       if (is_array($news))
!                       {
!                               if (! $news['subject'])
!                               {
!                                       $errors[] = lang('The subject is 
missing');
!                               }
!                               if (! $news['content'])
!                               {
!                                       $errors[] = lang('The news content is 
missing');
!                               }
! 
!                               if (!is_array($errors))
!                               {
!                                       $this->bo->edit($news);
!                                       $message = lang('News item has been 
updated');
!                               }
!                       }
!                       else
!                       {
!                               $news = $this->bo->view($news_id,True);
!                       }
  
                        $this->common_header();
  
                        $GLOBALS['phpgw']->template->set_file(array(
***************
*** 146,153 ****
                        ));
  
!                       if (is_array($errors))
                        {
                                
$GLOBALS['phpgw']->template->set_var('errors',$GLOBALS['phpgw']->common->error_list($errors));
                        }
  
                        
$GLOBALS['phpgw']->template->set_var('th_bg',$GLOBALS['phpgw_info']['theme']['th_bg']);
--- 197,208 ----
                        ));
  
!                       if(is_array($errors))
                        {
                                
$GLOBALS['phpgw']->template->set_var('errors',$GLOBALS['phpgw']->common->error_list($errors));
                        }
+                       elseif($message)
+                       {
+                               
$GLOBALS['phpgw']->template->set_var('errors',$message);
+                       }
  
                        
$GLOBALS['phpgw']->template->set_var('th_bg',$GLOBALS['phpgw_info']['theme']['th_bg']);
***************
*** 158,169 ****
                        
$GLOBALS['phpgw']->template->set_var('lang_header',lang('Edit news item'));
  
!                       if (is_array($fields))
!                       {
!                               $bo     = createobject('news_admin.boadmin');
!                               $fields = $bo->view($news_id,True);
!                       }
! 
!                       
$GLOBALS['phpgw']->template->set_var('form_action',$GLOBALS['phpgw']->link('/index.php','menuaction=news_admin.boadmin.edit'));
                        
$GLOBALS['phpgw']->template->set_var('form_button','<input type="submit" 
name="submit" value="' . lang('Edit') . '">');
  
                        
$GLOBALS['phpgw']->template->set_var('label_subject',lang('subject') . ':');
--- 213,220 ----
                        
$GLOBALS['phpgw']->template->set_var('lang_header',lang('Edit news item'));
  
!                       
$GLOBALS['phpgw']->template->set_var('form_action',$GLOBALS['phpgw']->link('/index.php','menuaction=news_admin.uiadmin.edit'));
                        
$GLOBALS['phpgw']->template->set_var('form_button','<input type="submit" 
name="submit" value="' . lang('Edit') . '">');
+                       
$GLOBALS['phpgw']->template->set_var('done_button','<input type="submit" 
name="cancel" value="' . lang('Done') . '">');
+                       
$GLOBALS['phpgw']->template->set_var('value_id',$news_id);
  
                        
$GLOBALS['phpgw']->template->set_var('label_subject',lang('subject') . ':');
***************
*** 174,178 ****
  
                        
$GLOBALS['phpgw']->template->set_var('label_category',lang('Category') . ':');
!                       
$GLOBALS['phpgw']->template->set_var('value_category','<select 
name="news[category]"><option value="0">' . lang('Main') . '</option>' . 
$cats->formated_list('select','mains',$news['category']) . '</select>');
  
                        
$GLOBALS['phpgw']->template->set_var('label_status',lang('Status') . ':');
--- 225,229 ----
  
                        
$GLOBALS['phpgw']->template->set_var('label_category',lang('Category') . ':');
!                       
$GLOBALS['phpgw']->template->set_var('value_category','<select 
name="news[category]"><option value="0">' . lang('Main') . '</option>' . 
$this->cats->formated_list('select','mains',$news['category']) . '</select>');
  
                        
$GLOBALS['phpgw']->template->set_var('label_status',lang('Status') . ':');
***************
*** 229,265 ****
                        $this->save_session_data();
  
!                       $this->template->set_file(array(
                                '_list' => 'admin_list.tpl'
                        ));
!                       $this->template->set_block('_list','list');
!                       $this->template->set_block('_list','row');
!                       $this->template->set_block('_list','row_empty');
  
                        if ($message)
                        {
!                               $this->template->set_var('message',$message);
                        }
  
!                       
$this->template->set_var('th_bg',$GLOBALS['phpgw_info']['theme']['th_bg']);
!                       
$this->template->set_var('bgcolor',$GLOBALS['phpgw_info']['theme']['bgcolor']);
!                       $this->template->set_var('lang_header',lang('Webpage 
news admin'));
!                       
$this->template->set_var('lang_category',lang('Category'));
!                       $this->template->set_var('lang_main',lang('Main'));
! 
!                       $cats = createobject('phpgwapi.categories');
!                       
$this->template->set_var('form_action',$GLOBALS['phpgw']->link('/index.php','menuaction=news_admin.uiadmin.news_list'));
!                       
$this->template->set_var('input_category',$cats->formated_list('select','mains',$cat_id));
! 
!                       
$this->template->set_var('header_date',$GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,'news_date',$order,'/index.php',lang('Date'),'&menuaction=news_admin.uiadmin.news_list'));
!                       
$this->template->set_var('header_subject',$GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,'news_subject',$order,'/index.php',lang('Subject'),'&menuaction=news_admin.uiadmin.news_list'));
!                       
$this->template->set_var('header_status',$GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,'news_status',$order,'/index.php',lang('Status'),'&menuaction=news_admin.uiadmin.news_list'));
!                       $this->template->set_var('header_edit','edit');
!                       $this->template->set_var('header_delete','delete');
!                       $this->template->set_var('header_view','view');
  
                        $nextmatchs = createobject('phpgwapi.nextmatchs');
!                       $bo         = createobject('news_admin.boadmin');
!                       $total      = $bo->total($cat_id);
!                       $items      = $bo->getlist($order,$sort,$cat_id);
  
                        while (is_array($items) && $_item = each($items))
--- 280,314 ----
                        $this->save_session_data();
  
!                       $GLOBALS['phpgw']->template->set_file(array(
                                '_list' => 'admin_list.tpl'
                        ));
!                       $GLOBALS['phpgw']->template->set_block('_list','list');
!                       $GLOBALS['phpgw']->template->set_block('_list','row');
!                       
$GLOBALS['phpgw']->template->set_block('_list','row_empty');
  
                        if ($message)
                        {
!                               
$GLOBALS['phpgw']->template->set_var('message',$message);
                        }
  
!                       
$GLOBALS['phpgw']->template->set_var('th_bg',$GLOBALS['phpgw_info']['theme']['th_bg']);
!                       
$GLOBALS['phpgw']->template->set_var('bgcolor',$GLOBALS['phpgw_info']['theme']['bgcolor']);
!                       
$GLOBALS['phpgw']->template->set_var('lang_header',lang('Webpage news admin'));
!                       
$GLOBALS['phpgw']->template->set_var('lang_category',lang('Category'));
!                       
$GLOBALS['phpgw']->template->set_var('lang_main',lang('Main'));
! 
!                       
$GLOBALS['phpgw']->template->set_var('form_action',$GLOBALS['phpgw']->link('/index.php','menuaction=news_admin.uiadmin.news_list'));
!                       
$GLOBALS['phpgw']->template->set_var('input_category',$this->cats->formated_list('select','mains',$cat_id));
! 
!                       
$GLOBALS['phpgw']->template->set_var('header_date',$GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,'news_date',$order,'/index.php',lang('Date'),'&menuaction=news_admin.uiadmin.news_list'));
!                       
$GLOBALS['phpgw']->template->set_var('header_subject',$GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,'news_subject',$order,'/index.php',lang('Subject'),'&menuaction=news_admin.uiadmin.news_list'));
!                       
$GLOBALS['phpgw']->template->set_var('header_status',$GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,'news_status',$order,'/index.php',lang('Status'),'&menuaction=news_admin.uiadmin.news_list'));
!                       
$GLOBALS['phpgw']->template->set_var('header_edit','edit');
!                       
$GLOBALS['phpgw']->template->set_var('header_delete','delete');
!                       
$GLOBALS['phpgw']->template->set_var('header_view','view');
  
                        $nextmatchs = createobject('phpgwapi.nextmatchs');
!                       $total      = $this->bo->total($cat_id);
!                       $items      = $this->bo->getlist($order,$sort,$cat_id);
  
                        while (is_array($items) && $_item = each($items))
***************
*** 267,272 ****
                                $item = $_item[1];
  
!                               
$nextmatchs->template_alternate_row_color(&$this->template);
!                               
$this->template->set_var('row_date',$item['date']);
                                if (strlen($item['news_subject']) > 40)
                                {
--- 316,321 ----
                                $item = $_item[1];
  
!                               
$nextmatchs->template_alternate_row_color(&$GLOBALS['phpgw']->template);
!                               
$GLOBALS['phpgw']->template->set_var('row_date',$item['date']);
                                if (strlen($item['news_subject']) > 40)
                                {
***************
*** 277,310 ****
                                        $subject = 
$GLOBALS['phpgw']->strip_html($item['subject']);
                                }
!                               
$this->template->set_var('row_subject',$subject);
!                               
$this->template->set_var('row_status',$item['status']);
  
!                               $this->template->set_var('row_view','<a href="' 
. 
$GLOBALS['phpgw']->link('/index.php','menuaction=news_admin.uiadmin.view&news_id='
 . $item['id']) . '">' . lang('view') . '</a>');
!                               $this->template->set_var('row_edit','<a href="' 
. 
$GLOBALS['phpgw']->link('/index.php','menuaction=news_admin.uiadmin.edit&news_id='
 . $item['id']) . '">' . lang('edit') . '</a>');
!                               $this->template->set_var('row_delete','<a 
href="' . 
$GLOBALS['phpgw']->link('/index.php','menuaction=news_admin.uiadmin.delete&news_id='
 . $item['id']) . '">' . lang('Delete') . '</a>');
  
!                               $this->template->parse('rows','row',True);
                        }
  
                        if (! $total)
                        {
!                               
$nextmatchs->template_alternate_row_color(&$this->template);
!                               $this->template->set_var('row_message',lang('No 
entries found'));
!                               $this->template->parse('rows','row_empty',True);
                        }
  
                        if ($total)
                        {
!                               $this->template->set_var('link_view_cat','<a 
href="' . 
$GLOBALS['phpgw']->link('/index.php','menuaction=news_admin.uinews.show_news&cat_id='
 . $cat_id) . '">' . lang('View this category') . '</a>');
                        }
                        else
                        {
!                               
$this->template->set_var('link_view_cat',lang('View this category'));
                        }
  
!                       
$this->template->set_var('link_add',$GLOBALS['phpgw']->link('/index.php','menuaction=news_admin.uiadmin.add&news%5Bcategory%5D='
 . $cat_id));
!                       $this->template->set_var('lang_add',lang('add'));
  
!                       $this->template->pfp('out','list');
                }
        }
--- 326,359 ----
                                        $subject = 
$GLOBALS['phpgw']->strip_html($item['subject']);
                                }
!                               
$GLOBALS['phpgw']->template->set_var('row_subject',$subject);
!                               
$GLOBALS['phpgw']->template->set_var('row_status',$item['status']);
  
!                               
$GLOBALS['phpgw']->template->set_var('row_view','<a href="' . 
$GLOBALS['phpgw']->link('/index.php','menuaction=news_admin.uiadmin.view&news_id='
 . $item['id']) . '">' . lang('view') . '</a>');
!                               
$GLOBALS['phpgw']->template->set_var('row_edit','<a href="' . 
$GLOBALS['phpgw']->link('/index.php','menuaction=news_admin.uiadmin.edit&news_id='
 . $item['id']) . '">' . lang('edit') . '</a>');
!                               
$GLOBALS['phpgw']->template->set_var('row_delete','<a href="' . 
$GLOBALS['phpgw']->link('/index.php','menuaction=news_admin.uiadmin.delete&news_id='
 . $item['id']) . '">' . lang('Delete') . '</a>');
  
!                               
$GLOBALS['phpgw']->template->parse('rows','row',True);
                        }
  
                        if (! $total)
                        {
!                               
$nextmatchs->template_alternate_row_color(&$GLOBALS['phpgw']->template);
!                               
$GLOBALS['phpgw']->template->set_var('row_message',lang('No entries found'));
!                               
$GLOBALS['phpgw']->template->parse('rows','row_empty',True);
                        }
  
                        if ($total)
                        {
!                               
$GLOBALS['phpgw']->template->set_var('link_view_cat','<a href="' . 
$GLOBALS['phpgw']->link('/index.php','menuaction=news_admin.uinews.show_news&cat_id='
 . $cat_id) . '">' . lang('View this category') . '</a>');
                        }
                        else
                        {
!                               
$GLOBALS['phpgw']->template->set_var('link_view_cat',lang('View this 
category'));
                        }
  
!                       
$GLOBALS['phpgw']->template->set_var('link_add',$GLOBALS['phpgw']->link('/index.php','menuaction=news_admin.uiadmin.add&news%5Bcategory%5D='
 . $cat_id));
!                       
$GLOBALS['phpgw']->template->set_var('lang_add',lang('add'));
  
!                       $GLOBALS['phpgw']->template->pfp('out','list');
                }
        }




reply via email to

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