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.2.2.2.


From: Dave Hall <address@hidden>
Subject: [Phpgroupware-cvs] CVS: news_admin/inc class.boadmin.inc.php,1.8.2.2.2.1,1.8.2.2.2.2 class.bonews.inc.php,1.1.2.1,1.1.2.1.2.1 class.soadmin.inc.php,1.6.2.3.2.1,1.6.2.3.2.2 class.sonews.inc.php,1.1.2.1.2.2,1.1.2.1.2.3 class.uiadmin.inc.php,1.12.2.4.2.1,1.12.2.4.2.2 class.uinews.inc.php,1.10.2.6.2.1,1.10.2.6.2.2
Date: Sat, 31 May 2003 04:18:23 -0400

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

Modified Files:
      Tag: Version-0_9_16-branch
        class.boadmin.inc.php class.bonews.inc.php 
        class.soadmin.inc.php class.sonews.inc.php 
        class.uiadmin.inc.php class.uinews.inc.php 
Log Message:
added teaser text and modified date

Index: class.boadmin.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/news_admin/inc/class.boadmin.inc.php,v
retrieving revision 1.8.2.2.2.1
retrieving revision 1.8.2.2.2.2
diff -C2 -r1.8.2.2.2.1 -r1.8.2.2.2.2
*** class.boadmin.inc.php       4 May 2003 06:12:12 -0000       1.8.2.2.2.1
--- class.boadmin.inc.php       31 May 2003 08:18:21 -0000      1.8.2.2.2.2
***************
*** 17,22 ****
        class boadmin
        {
-               var $public_functions = array('delete'  => True);
- 
                function boadmin()
                {
--- 17,20 ----
***************
*** 87,88 ****
--- 85,87 ----
                }
        }
+ ?>

Index: class.bonews.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/news_admin/inc/class.bonews.inc.php,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.1.2.1
diff -C2 -r1.1.2.1 -r1.1.2.1.2.1
*** class.bonews.inc.php        30 Aug 2002 08:00:19 -0000      1.1.2.1
--- class.bonews.inc.php        31 May 2003 08:18:21 -0000      1.1.2.1.2.1
***************
*** 34,37 ****
--- 34,42 ----
                }
  
+               function get_all_public_news($limit = 5)
+               {
+                       return $this->sonews->get_all_public_news($limit);
+               }
+ 
                function get_news($news_id)
                {
***************
*** 39,40 ****
--- 44,46 ----
                }
        }
+ ?>

Index: class.soadmin.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/news_admin/inc/class.soadmin.inc.php,v
retrieving revision 1.6.2.3.2.1
retrieving revision 1.6.2.3.2.2
diff -C2 -r1.6.2.3.2.1 -r1.6.2.3.2.2
*** class.soadmin.inc.php       4 May 2003 06:12:12 -0000       1.6.2.3.2.1
--- class.soadmin.inc.php       31 May 2003 08:18:21 -0000      1.6.2.3.2.2
***************
*** 26,33 ****
                function add($news)
                {
!                       $sql  = 'INSERT INTO phpgw_news 
(news_date,news_submittedby,news_content,news_subject,news_status,news_cat) ';
!                       $sql .= 'VALUES (' . time() . ',' . 
$GLOBALS['phpgw_info']['user']['account_id'] . ",'";
!                       $sql .=  $this->db->db_addslashes($news['content']) 
."','" . $this->db->db_addslashes($news['subject']) . "','";
!                       $sql .=  $this->db->db_addslashes($news['status']) . 
"'," . intval($news['category']) . ')';
                        $this->db->query($sql);
  
--- 26,34 ----
                function add($news)
                {
!                       $sql  = 'INSERT INTO phpgw_news 
(news_date,news_submittedby,news_content,news_subject,news_status,news_teaser,news_cat)
 ';
!                       $sql .= 'VALUES (' . mktime(0,0,0, 
intval($news['date_m']), intval($news['date_d']), intval($news['daate_y'])) . 
',';
!                       $sql .=  $GLOBALS['phpgw_info']['user']['account_id'] . 
",'" . $this->db->db_addslashes($news['content']) ."','";
!                       $sql .=  $this->db->db_addslashes($news['subject']) 
."','" . $this->db->db_addslashes($news['status']) . "','";
!                       $sql .=  $this->db->db_addslashes($news['teaser']) . 
"'," . intval($news['category']) . ')';
                        $this->db->query($sql);
  
***************
*** 38,44 ****
                {
                        $this->db->query("UPDATE phpgw_news SET "
!                               . "news_date='" . time() . "',"
                                . "news_content='" . 
$this->db->db_addslashes($news['content']) . "',"
                                . "news_subject='" . 
$this->db->db_addslashes($news['subject']) . "' "
                                . "WHERE news_id=" . 
intval($news['id']),__LINE__,__FILE__);
                }
--- 39,46 ----
                {
                        $this->db->query("UPDATE phpgw_news SET "
!                               . "news_date='" . 
mktime(0,0,0,intval($news['date_m']), intval($news['date_d']), 
intval($news['date_y'])) . "',"
                                . "news_content='" . 
$this->db->db_addslashes($news['content']) . "',"
                                . "news_subject='" . 
$this->db->db_addslashes($news['subject']) . "' "
+                               . "news_teaser='" . 
$this->db->db_addslashes($news['teaser']) . "' "
                                . "WHERE news_id=" . 
intval($news['id']),__LINE__,__FILE__);
                }
***************
*** 67,70 ****
--- 69,73 ----
                                'subject'     => $this->db->f('news_subject'),
                                'submittedby' => 
$this->db->f('news_submittedby'),
+                               'teaser'                        => 
$this->db->f('news_teaser'),
                                'content'     => $this->db->f('news_content'),
                                'status'      => $this->db->f('news_status'),

Index: class.sonews.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/news_admin/inc/class.sonews.inc.php,v
retrieving revision 1.1.2.1.2.2
retrieving revision 1.1.2.1.2.3
diff -C2 -r1.1.2.1.2.2 -r1.1.2.1.2.3
*** class.sonews.inc.php        4 May 2003 22:08:38 -0000       1.1.2.1.2.2
--- class.sonews.inc.php        31 May 2003 08:18:21 -0000      1.1.2.1.2.3
***************
*** 75,82 ****
--- 75,103 ----
                        {
                                $news[$this->db->f('news_id')] = array(
+                                       'subject'       => 
htmlentities(stripslashes($this->db->f('news_subject'))),
+                                       'submittedby'   => 
$this->db->f('news_submittedby'),
+                                       'submissiondate' => 
$this->db->f('news_date'),
+                                       'id' => $this->db->f('news_id'),
+                                       'teaser' => 
htmlentities(stripslashes($this->db->f('news_teaser'))),
+                                       'content'       => 
nl2br(htmlentities(stripslashes($this->db->f('news_content'))))
+                               );
+                       }
+                       return $news;
+               }
+ 
+               function get_all_public_news($limit=5)
+               {
+                       $this->db->limit_query("SELECT * FROM phpgw_news WHERE 
news_status='Active' ORDER BY news_date DESC",0,__LINE__,__FILE__,$limit);
+ 
+                       $news = array();
+ 
+                       while ($this->db->next_record())
+                       {
+                               $news[$this->db->f('news_id')] = array(
                                        'subject'       => 
$this->db->f('news_subject'),
                                        'submittedby'   => 
$this->db->f('news_submittedby'),
                                        'submissiondate' => 
$this->db->f('news_date'),
                                        'id' => $this->db->f('news_id'),
+                                       'teaser' => $this->db->f('news_teaser'),
                                        'content'       => 
nl2br(stripslashes($this->db->f('news_content')))
                                );
***************
*** 84,86 ****
--- 105,109 ----
                        return $news;
                }
+ 
+ 
        }

Index: class.uiadmin.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/news_admin/inc/class.uiadmin.inc.php,v
retrieving revision 1.12.2.4.2.1
retrieving revision 1.12.2.4.2.2
diff -C2 -r1.12.2.4.2.1 -r1.12.2.4.2.2
*** class.uiadmin.inc.php       4 May 2003 06:12:12 -0000       1.12.2.4.2.1
--- class.uiadmin.inc.php       31 May 2003 08:18:21 -0000      1.12.2.4.2.2
***************
*** 18,22 ****
        {
                var $bo;
!               var $template;
                var $session_data;
                var $public_functions = array(
--- 18,24 ----
        {
                var $bo;
!               var $news_data;
!               var $news_id;
!               var $sbox;
                var $session_data;
                var $public_functions = array(
***************
*** 35,164 ****
                        $this->bo   = createobject('news_admin.boadmin');
                        $this->cats = createobject('phpgwapi.categories');
                }
  
!               function common_header()
!               {
!                       $GLOBALS['phpgw']->common->phpgw_header();
!                       echo parse_navbar();
!               }
! 
!               function save_session_data()
!               {
!                       
$GLOBALS['phpgw']->session->appsession('session_data','news_admin',$this->session_data);
!               }
! 
!               function view()
!               {
!                       $news_id = $GLOBALS['HTTP_POST_VARS']['news_id'] ? 
$GLOBALS['HTTP_POST_VARS']['news_id'] : $GLOBALS['HTTP_GET_VARS']['news_id'];
! 
!                       $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');
!               }
! 
!               function delete()
                {
!                       $news_id = $GLOBALS['HTTP_POST_VARS']['news_id'] ? 
$GLOBALS['HTTP_POST_VARS']['news_id'] : $GLOBALS['HTTP_GET_VARS']['news_id'];
!                       $cat_id  = $GLOBALS['HTTP_POST_VARS']['cat_id'] ? 
$GLOBALS['HTTP_POST_VARS']['cat_id'] : $GLOBALS['HTTP_GET_VARS']['cat_id'];
! 
!                       $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.uiadmin.delete_item&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))
                                {
!                                       $id = $this->bo->add($news);
!                                       $message = lang('News item has been 
added');
!                                       $this->edit($message, $id);
!                                       exit;
                                }
                        }
! 
!                       $this->common_header();
! 
!                       $GLOBALS['phpgw']->template->set_file(array(
!                               'form' => 'admin_form.tpl'
!                       ));
! 
!                       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']);
!                       
$GLOBALS['phpgw']->template->set_var('row_on',$GLOBALS['phpgw_info']['theme']['row_on']);
!                       
$GLOBALS['phpgw']->template->set_var('row_off',$GLOBALS['phpgw_info']['theme']['row_off']);
!                       
$GLOBALS['phpgw']->template->set_var('bgcolor',$GLOBALS['phpgw_info']['theme']['bgcolor']);
! 
!                       
$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') . ':');
!                       
$GLOBALS['phpgw']->template->set_var('value_subject','<input 
name="news[subject]" size="60" value="' . $news['subject'] . '">');
  
!                       
$GLOBALS['phpgw']->template->set_var('label_content',lang('Content') . ':');
!                       
$GLOBALS['phpgw']->template->set_var('value_content','<textarea cols="60" 
rows="6" name="news[content]" wrap="virtual">' . stripslashes($news['content']) 
. '</textarea>');
  
!                       
$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'], True) . 
'</select>');
  
!                       
$GLOBALS['phpgw']->template->set_var('label_status',lang('Status') . ':');
!                       
$GLOBALS['phpgw']->template->set_var('value_status','<select 
name="news[status]"><option value="Active">'
!                               . lang('Active') . '</option><option 
value="Disabled">'
!                               . lang('Disabled') . '</option></select>');
  
!                       $GLOBALS['phpgw']->template->pfp('out','form');
                }
  
--- 37,104 ----
                        $this->bo   = createobject('news_admin.boadmin');
                        $this->cats = createobject('phpgwapi.categories');
+                       $this->sbox = createObject('phpgwapi.sbox');
                }
  
!               function add()
                {
!                       if($_POST['cancel'])
                        {
                                Header('Location: ' . 
$GLOBALS['phpgw']->link('/index.php','menuaction=news_admin.uiadmin.news_list'));
                        }
!                       if($_POST['submitit'])
                        {
!                               $this->news_data = $_POST['news'];
!                               
!                               if (! $this->news_data['subject'])
                                {
                                        $errors[] = lang('The subject is 
missing');
                                }
!                               if (! $this->news_data['content'])
                                {
                                        $errors[] = lang('The news content is 
missing');
                                }
                                if (!is_array($errors))
                                {
!                                       $this->news_id = $this->bo->add($news);
!                               }
!                               else
!                               {
!                                       $this->message = $errors;
                                }
                        }
!                       else
                        {
!                               $this->news_data = array('date_d' => date('j'),
!                                                                               
 'date_m' => date('j'),
!                                                                               
 'date_y' => date('Y'),
!                                                                               
 'news_category' => $_POST['news']['category']
!                                                                       );
                        }
+                       $this->modify($message, 'add');
+               }
  
!               function common_header()
!               {
!                       $GLOBALS['phpgw']->common->phpgw_header();
!                       echo parse_navbar();
!               }
  
!               function delete()
!               {
!                       $news_id = $_POST['news_id'] ? $_POST['news_id'] : 
$_GET['news_id'];
!                       $cat_id  = $_POST['cat_id'] ? $_POST['cat_id'] : 
$_GET['cat_id'];
  
!                       $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.uiadmin.delete_item&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');
                }
  
***************
*** 178,212 ****
                }
  
!               function edit($errors = '', $id=0)
                {
!                       $news    = $_POST['news'];
!                       $news_id = (isset($_GET['news_id']) ? 
trim($_GET['news_id']) : $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();
  
--- 118,161 ----
                }
  
!               function edit()
                {
!                       $this->news_data        = $_POST['news'];
!                       $this->news_id          = (isset($_GET['news_id']) ? 
$_GET['news_id'] 
!                                                                               
: $_POST['news']['id']);
  
!                       if($_POST['cancel'])
                        {
                                Header('Location: ' . 
$GLOBALS['phpgw']->link('/index.php','menuaction=news_admin.uiadmin.news_list'));
                        }
!                       if(is_array($this->news_data))
                        {
!                               if(! $$this->news_data['subject'])
                                {
                                        $errors[] = lang('The subject is 
missing');
                                }
!                               if(! $this->news_data['content'])
                                {
                                        $errors[] = lang('The news content is 
missing');
                                }
  
!                               if(!is_array($errors))
                                {
                                        $this->bo->edit($news);
                                        $message = lang('News item has been 
updated');
                                }
+                               else
+                               {
+                                       $message = $errors;
+                               }
                        }
                        else
                        {
!                               $this->news_data = 
$this->bo->view($this->news_id,True);
                        }
+                       $this->modify($message);
+               }
  
+               function modify($messages = '', $type = 'edit')
+               {
                        $this->common_header();
  
***************
*** 215,247 ****
                        ));
  
!                       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']);
!                       
$GLOBALS['phpgw']->template->set_var('row_on',$GLOBALS['phpgw_info']['theme']['row_on']);
!                       
$GLOBALS['phpgw']->template->set_var('row_off',$GLOBALS['phpgw_info']['theme']['row_off']);
!                       
$GLOBALS['phpgw']->template->set_var('bgcolor',$GLOBALS['phpgw_info']['theme']['bgcolor']);
! 
!                       
$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') . ':');
!                       
$GLOBALS['phpgw']->template->set_var('value_subject','<input 
name="news[subject]" size="60" value="' . $news['subject'] . '">');
  
                        
$GLOBALS['phpgw']->template->set_var('label_content',lang('Content') . ':');
!                       
$GLOBALS['phpgw']->template->set_var('value_content','<textarea cols="60" 
rows="6" name="news[content]" wrap="virtual">' . stripslashes($news['content']) 
. '</textarea>');
  
                        
$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'], True) . 
'</select>');
  
                        
$GLOBALS['phpgw']->template->set_var('label_status',lang('Status') . ':');
--- 164,198 ----
                        ));
  
!                       if (is_array($messages))
                        {
                                
$GLOBALS['phpgw']->template->set_var('errors',$GLOBALS['phpgw']->common->error_list($errors));
                        }
!                       elseif($messages)
                        {
!                               
$GLOBALS['phpgw']->template->set_var('errors',$messages);
                        }
  
!                       
$GLOBALS['phpgw']->template->set_var('lang_header',lang($type . ' news item'));
!                       
$GLOBALS['phpgw']->template->set_var('form_action',$GLOBALS['phpgw']->link('/index.php',
!                               array('menuaction'      => 
'news_admin.uiadmin.'.$type,
!                                               'news_id'       => 
$this->news_id
!                                       )
!                               )
!                       );
!                       
$GLOBALS['phpgw']->template->set_var('form_button','<input type="submit" 
name="submitit" value="' . lang('save') . '">');
!                       
$GLOBALS['phpgw']->template->set_var('value_id',$this->news_id);
                        
$GLOBALS['phpgw']->template->set_var('done_button','<input type="submit" 
name="cancel" value="' . lang('Done') . '">');
  
                        
$GLOBALS['phpgw']->template->set_var('label_subject',lang('subject') . ':');
!                       
$GLOBALS['phpgw']->template->set_var('value_subject','<input 
name="news[subject]" size="60" value="' . $this->news_data['subject'] . '">');
! 
!                       
$GLOBALS['phpgw']->template->set_var('label_teaser',lang('teaser') . ':');
!                       
$GLOBALS['phpgw']->template->set_var('value_teaser','<input name="news[teaser]" 
size="60" value="' . stripslashes($this->news_data['teaser']) . '" 
maxLength=100>');
  
                        
$GLOBALS['phpgw']->template->set_var('label_content',lang('Content') . ':');
!                       
$GLOBALS['phpgw']->template->set_var('value_content','<textarea cols="60" 
rows="6" name="news[content]" wrap="virtual">' . 
stripslashes($this->news_data['content']) . '</textarea>');
  
                        
$GLOBALS['phpgw']->template->set_var('label_category',lang('Category') . ':');
!                       
$GLOBALS['phpgw']->template->set_var('value_category','<select 
name="news[category]"><option value="0">' . lang('Global News') . '</option>' . 
$this->cats->formated_list('select','all',$this->news_data['category'], True) . 
'</select>');
  
                        
$GLOBALS['phpgw']->template->set_var('label_status',lang('Status') . ':');
***************
*** 250,261 ****
                                . lang('Disabled') . '</option></select>');
  
                        $GLOBALS['phpgw']->template->pfp('out','form');
                }
! 
                function news_list($message = '')
                {
!                       $news_id = $GLOBALS['HTTP_POST_VARS']['news_id'] ? 
$GLOBALS['HTTP_POST_VARS']['news_id'] : $GLOBALS['HTTP_GET_VARS']['news_id'];
!                       $sort    = $GLOBALS['HTTP_POST_VARS']['sort']    ? 
$GLOBALS['HTTP_POST_VARS']['sort']    : $GLOBALS['HTTP_GET_VARS']['sort'];
!                       $cat_id  = $GLOBALS['HTTP_POST_VARS']['cat_id']  ? 
$GLOBALS['HTTP_POST_VARS']['cat_id']  : $GLOBALS['HTTP_GET_VARS']['cat_id'];
  
                        $this->common_header();
--- 201,217 ----
                                . lang('Disabled') . '</option></select>');
  
+                       $GLOBALS['phpgw']->template->set_var('label_date', 
$GLOBALS['phpgw']->lang('Publish Date') . ':');
+                       $GLOBALS['phpgw']->template->set_var('value_date_d', 
$this->sbox->getDays('news[date_d]', date('j') ) );
+                       $GLOBALS['phpgw']->template->set_var('value_date_m', 
$this->sbox->getMonthText('news[date_m]', date('n') ) );
+                       $GLOBALS['phpgw']->template->set_var('value_date_y', 
$this->sbox->getYears('news[date_y]', date('Y') ) );
+                       
                        $GLOBALS['phpgw']->template->pfp('out','form');
                }
!               
                function news_list($message = '')
                {
!                       $news_id = $_POST['news_id'] ? $_POST['news_id'] : 
$_GET['news_id'];
!                       $sort    = $_POST['sort']    ? $_POST['sort']    : 
$_GET['sort'];
!                       $cat_id  = $_POST['cat_id']  ? $_POST['cat_id']  : 
$_GET['cat_id'];
  
                        $this->common_header();
***************
*** 314,321 ****
                        
$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,
 True));
  
                        
$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'));
--- 270,277 ----
                        
$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('Global_News'));
  
                        
$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','all',$cat_id,
 True));
  
                        
$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'));
***************
*** 375,377 ****
--- 331,364 ----
                        $GLOBALS['phpgw']->template->pfp('out','list');
                }
+               function save_session_data()
+               {
+                       
$GLOBALS['phpgw']->session->appsession('session_data','news_admin',$this->session_data);
+               }
+ 
+               function view()
+               {
+                       $news_id = get_var('news_id' ,array('POST', 'GET'));
+ 
+                       $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');
+               }
+ 
        }
+ ?>

Index: class.uinews.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/news_admin/inc/class.uinews.inc.php,v
retrieving revision 1.10.2.6.2.1
retrieving revision 1.10.2.6.2.2
diff -C2 -r1.10.2.6.2.1 -r1.10.2.6.2.2
*** class.uinews.inc.php        4 May 2003 06:12:12 -0000       1.10.2.6.2.1
--- class.uinews.inc.php        31 May 2003 08:18:21 -0000      1.10.2.6.2.2
***************
*** 46,57 ****
                        }
  
!                       if (function_exists('get_var'))
!                       {
!                               $news_id = get_var('news_id',Array('GET'));
!                       }
!                       else
!                       {       
!                               $news_id = $GLOBALS['HTTP_GET_VARS']['news_id'];
!                       }
  
                        if($news_id)
--- 46,50 ----
                        }
  
!                       $news_id = get_var('news_id',Array('GET'));
  
                        if($news_id)
***************
*** 187,191 ****
                function show_news_website($section='mid')
                {
!                       global $cat_id, $start, $oldnews;
  
                        if (! $cat_id)
--- 180,187 ----
                function show_news_website($section='mid')
                {
!                       $cat_id = $_GET['cat_id'];
!                       $start = $_GET['start'];
!                       $oldnews = $_GET['oldnews'];
!                       $news_id = $_GET['news_id'];
  
                        if (! $cat_id)
***************
*** 201,212 ****
                        $this->template->set_block('_news','category');
  
-                       if (function_exists('get_var'))
-                       {
-                               $news_id = get_var('news_id',Array('GET'));
-                       }
-                       else
-                       {   
-                               $news_id = $GLOBALS['HTTP_GET_VARS']['news_id'];
-                       }
  
                        if($news_id)
--- 197,200 ----
***************
*** 254,255 ****
--- 242,244 ----
                }
        }
+ ?>





reply via email to

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