[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] CVS: phpbrain/inc class.bokb.inc.php,1.9,1.10 class.
From: |
Dave Hall <address@hidden> |
Subject: |
[Phpgroupware-cvs] CVS: phpbrain/inc class.bokb.inc.php,1.9,1.10 class.uikb.inc.php,1.9,1.10 |
Date: |
Thu, 17 Apr 2003 06:13:44 -0400 |
Update of /cvsroot/phpgroupware/phpbrain/inc
In directory subversions:/tmp/cvs-serv17932/inc
Modified Files:
class.bokb.inc.php class.uikb.inc.php
Log Message:
added edit link and some more langs
Index: class.bokb.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpbrain/inc/class.bokb.inc.php,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** class.bokb.inc.php 16 Apr 2003 12:02:07 -0000 1.9
--- class.bokb.inc.php 17 Apr 2003 10:13:42 -0000 1.10
***************
*** 116,132 ****
}//end get_faq_list
! function get_item($faq_id)
{
$item = $this->so->get_item($faq_id);
if(is_array($item))
{
! $item['last_mod'] = date('d-M-Y',
$item['modified']);
$item['username'] =
$GLOBALS['phpgw']->common->grab_owner_name($item['user_id']);
! $item['rating'] = ($item['votes']
! ?
round(($item['total']/$item['votes']),2) : 0);
$item['comments'] =
$this->get_comments($faq_id);
! $item['title'] = ($item['is_faq']
?
lang('question') . ': '. $item['title']
:
lang('tutorial') . ': '. $item['title']);
}//end if is_array(item)
--- 116,135 ----
}//end get_faq_list
! function get_item($faq_id, $show_type = True)
{
$item = $this->so->get_item($faq_id);
if(is_array($item))
{
! $item['last_mod'] = date('d-M-Y',
$item['modified']);
$item['username'] =
$GLOBALS['phpgw']->common->grab_owner_name($item['user_id']);
! $item['rating'] = ($item['votes']
! ?
round(($item['total']/$item['votes']),2) : 0);
$item['comments'] =
$this->get_comments($faq_id);
! if($show_type)
! {
! $item['title'] = ($item['is_faq']
?
lang('question') . ': '. $item['title']
:
lang('tutorial') . ': '. $item['title']);
+ }
}//end if is_array(item)
Index: class.uikb.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpbrain/inc/class.uikb.inc.php,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** class.uikb.inc.php 16 Apr 2003 12:02:07 -0000 1.9
--- class.uikb.inc.php 17 Apr 2003 10:13:42 -0000 1.10
***************
*** 62,66 ****
$this->edit_vals['question_id'] =
trim($_GET['question_id']);
}//end if question
! $this->edit_answer();
$GLOBALS['phpgw']->common->phpgw_exit();
}//end add
--- 62,66 ----
$this->edit_vals['question_id'] =
trim($_GET['question_id']);
}//end if question
! $this->edit_answer(True);
$GLOBALS['phpgw']->common->phpgw_exit();
}//end add
***************
*** 292,301 ****
{
$faq_id = (int) (isset($_GET['faq_id']) ?
trim($_GET['faq_id']) : 0);
! $this->edit_vals = $this->bo->get_item($faq_id);
! $this->edit_answer();
$GLOBALS['phpgw']->common->phpgw_exit();
}//end edit
! function edit_answer()
{
$GLOBALS['phpgw']->common->phpgw_header();
--- 292,301 ----
{
$faq_id = (int) (isset($_GET['faq_id']) ?
trim($_GET['faq_id']) : 0);
! $this->edit_vals = $this->bo->get_item($faq_id, false);
! $this->edit_answer(False);
$GLOBALS['phpgw']->common->phpgw_exit();
}//end edit
! function edit_answer($new)
{
$GLOBALS['phpgw']->common->phpgw_header();
***************
*** 313,317 ****
$this->t->set_var($this->edit_vals);
! $lang = array('lang_add_answer' =>
lang('add_answer'),
'lang_check_before_submit' =>
lang('check_before_submit'),
'lang_not_submit_qs_warn' =>
lang('not_submit_qs_warn'),
--- 313,318 ----
$this->t->set_var($this->edit_vals);
! $add_answer = ($new ? 'add_answer' : 'edit_answer');
! $lang = array('lang_add_answer' =>
lang($add_answer),
'lang_check_before_submit' =>
lang('check_before_submit'),
'lang_not_submit_qs_warn' =>
lang('not_submit_qs_warn'),
***************
*** 733,737 ****
if(is_array($item) && $faq_id)
{
! $this->t->set_file('showitem', 'showitem.tpl');
$lang = array('msg' => ($msg ?
lang($msg) : ''),
'lang_submitted_by' =>
lang('submitted_by'),
--- 734,738 ----
if(is_array($item) && $faq_id)
{
! $this->t->set_file('showitem', 'showitem.tpl');
$lang = array('msg' => ($msg ?
lang($msg) : ''),
'lang_submitted_by' =>
lang('submitted_by'),
***************
*** 747,754 ****
);
$this->t->set_block('showitem', 'click_rating',
'click_ratings');
! $rate_url =
$GLOBALS['phpgw']->link('/index.php' , array('menuaction' =>
'phpbrain.uikb.rate',
!
'faq_id'
=> $faq_id
!
)
!
);
for($i=1; $i<=5; $i++)
{
--- 748,756 ----
);
$this->t->set_block('showitem', 'click_rating',
'click_ratings');
! $rate_url =
$GLOBALS['phpgw']->link('/index.php',
! array('menuaction' =>
'phpbrain.uikb.rate',
! 'faq_id' => $faq_id
! )
! );
for($i=1; $i<=5; $i++)
{
***************
*** 826,829 ****
--- 828,847 ----
)
);
+ $this->t->set_block('showitem', 'admin_option',
'admin_options');
+ if($this->bo->is_admin())
+ {
+ $this->t->set_var('admin_url',
$GLOBALS['phpgw']->link('/index.php',
+
array('menuaction' => 'phpbrain.uikb.edit',
+
'faq_id' => $item['faq_id']
+
)
+ )
+ );
+ $this->t->set_var('lang_admin_text',
lang('edit_faq'));
+ $this->t->parse('admin_options',
'admin_option', true);
+ }
+ else
+ {
+ $this->t->set_var('admin_options', '');
+ }
$this->t->set_var($lang);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] CVS: phpbrain/inc class.bokb.inc.php,1.9,1.10 class.uikb.inc.php,1.9,1.10,
Dave Hall <address@hidden> <=