phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] phpbrain/inc hook_config.inc.php, 1.5 hook_manual.inc


From: skwashd
Subject: [Phpgroupware-cvs] phpbrain/inc hook_config.inc.php, 1.5 hook_manual.inc.php, 1.3 hook_admin.inc.php, 1.10 class.bokb.inc.php, 1.18 class.uikb.inc.php, 1.18 class.sokb.inc.php, 1.18
Date: Sun, 15 May 2005 14:43:00 +0200

Update of phpbrain/inc

Modified Files:
     Branch: MAIN
            hook_config.inc.php lines: +2 -4
            hook_manual.inc.php lines: +1 -3
            hook_admin.inc.php lines: +1 -3
            class.bokb.inc.php lines: +36 -30
            class.uikb.inc.php lines: +21 -30
            class.sokb.inc.php lines: +1 -1

Log Message:
merge from 16

====================================================
Index: phpbrain/inc/hook_config.inc.php
diff -u phpbrain/inc/hook_config.inc.php:1.4 
phpbrain/inc/hook_config.inc.php:1.5
--- phpbrain/inc/hook_config.inc.php:1.4        Sun Sep  7 04:09:54 2003
+++ phpbrain/inc/hook_config.inc.php    Sun May 15 12:43:37 2005
@@ -9,8 +9,6 @@
  * Originally Written by Dave Hall - <skwashd at phpgroupware.org>     *
  * Loosely Based on phpBrain from Bart Veldhuizen - http://vrotvrot.com *
  * --------------------------------------------                                
*
- *  Development Sponsored by Creativix                                 *
- * --------------------------------------------                                
*
  * This program is Free Software; you can redistribute it and/or modify *
  * it under the terms of the GNU General Public License as published by *
  * the Free Software Foundation; either version 2 of the License, or   *

====================================================
Index: phpbrain/inc/hook_manual.inc.php
diff -u phpbrain/inc/hook_manual.inc.php:1.2 
phpbrain/inc/hook_manual.inc.php:1.3
--- phpbrain/inc/hook_manual.inc.php:1.2        Sun Sep  7 04:09:54 2003
+++ phpbrain/inc/hook_manual.inc.php    Sun May 15 12:43:37 2005
@@ -9,8 +9,6 @@
  * Originally Written by Dave Hall - <skwashd at phpgroupware.org>     *
  * Loosely Based on phpBrain from Bart Veldhuizen - http://vrotvrot.com *
  * --------------------------------------------                                
*
- *  Development Sponsored by Creativix                                 *
- * --------------------------------------------                                
*
  * This program is Free Software; you can redistribute it and/or modify *
  * it under the terms of the GNU General Public License as published by *
  * the Free Software Foundation; either version 2 of the License, or   *

====================================================
Index: phpbrain/inc/hook_admin.inc.php
diff -u phpbrain/inc/hook_admin.inc.php:1.9 phpbrain/inc/hook_admin.inc.php:1.10
--- phpbrain/inc/hook_admin.inc.php:1.9 Sun Sep  7 04:09:54 2003
+++ phpbrain/inc/hook_admin.inc.php     Sun May 15 12:43:37 2005
@@ -9,8 +9,6 @@
  * Originally Written by Dave Hall - <skwashd at phpgroupware.org>     *
  * Loosely Based on phpBrain from Bart Veldhuizen - http://vrotvrot.com *
  * --------------------------------------------                                
*
- *  Development Sponsored by Creativix                                 *
- * --------------------------------------------                                
*
  * This program is Free Software; you can redistribute it and/or modify *
  * it under the terms of the GNU General Public License as published by *
  * the Free Software Foundation; either version 2 of the License, or   *

====================================================
Index: phpbrain/inc/class.bokb.inc.php
diff -u phpbrain/inc/class.bokb.inc.php:1.17 
phpbrain/inc/class.bokb.inc.php:1.18
--- phpbrain/inc/class.bokb.inc.php:1.17        Sun Sep  7 04:09:54 2003
+++ phpbrain/inc/class.bokb.inc.php     Sun May 15 12:43:37 2005
@@ -8,9 +8,6 @@
  *                                                                     *
  * Originally Written by Dave Hall - <skwashd at phpgroupware.org>     *
  * Loosely Based on phpBrain from Bart Veldhuizen - http://vrotvrot.com *
- * --------------------------------------------                                
*
- *  Development Sponsored by Creativix                                 *
- * --------------------------------------------                                
*
  * This program is Free Software; you can redistribute it and/or modify *
  * it under the terms of the GNU General Public License as published by *
  * the Free Software Foundation; either version 2 of the License, or   *
@@ -36,39 +33,48 @@

                function get_cat_data($cat_id)
                {
-                       $cat_id = (int) $cat_id;
-                       $cats = $this->cats->return_array('all', 0, False, '', 
'', '', False, $cat_id);
-                       if(is_array($cats))
+                       if($cat_id)
                        {
-                       foreach ($cats as $c_key => $c_vals)
-                       {
-                               $id = $c_vals['id'];
-                               $return_cats[$id] = array('name'                
=> $c_vals['name'],
-                                                                               
'num_entries'   => $this->so->get_count($id)
-                                                                               
);
-
-                               $sub_cats = $this->cats->return_array('subs', 
0, False, '', '', '', False, $id);
-                               if(is_array($sub_cats))
+                               $level = 'subs';
+                       }
+                       else
+                       {
+                               $level = 'mains';
+                       }
+
+                       $cats = $this->cats->return_array($level, 0, False, '', 
'', '', False, $cat_id);
+
+                       if( count($cats) )
+                       {
+                               foreach ($cats as $c_key => $c_vals)
                                {
-                                       foreach($sub_cats as $sub_key => 
$sub_vals)
-                                       {
-                                               $sub_id = $sub_vals['id'];
-                                               
$return_cats[$id]['subs'][$sub_id]
-                                                       = array('name'  => 
$sub_vals['name'],
-                                                               'num_entries'   
=> $this->so->get_count($sub_id)
-                                                               );
-                                       }//end foreach(subcats)
-                                       unset($sub_cats);
-                               }//end if is_array(sub_cats)
-                       }//end foreach(cats)
+                                       $id = $c_vals['id'];
+                                       $return_cats[$id] = array('name'        
=> $c_vals['name'],
+                                                               'num_entries'   
=> $this->so->get_count($id)
+                                                       );
+
+                                       $sub_cats = 
$this->cats->return_array('subs', 0, False, '', '', '', False, $id);
+                                       if( count($sub_cats) )
+                                       {
+                                               foreach($sub_cats as $sub_key 
=> $sub_vals)
+                                               {
+                                                       $sub_id = 
$sub_vals['id'];
+                                                       
$return_cats[$id]['subs'][$sub_id]
+                                                               = array('name'  
=> $sub_vals['name'],
+                                                                       
'num_entries'   => $this->so->get_count($sub_id)
+                                                                       );
+                                               }
+                                               unset($sub_cats);
+                                       }
+                               }
                                return $return_cats;
                        }
                        else //no cats
                        {
-                               return false;
-                       }//end if is_array(cats)
+                               return array();
+                       }

-               }//end get_cat_data
+               }

                function delete_comment($comment_id)
                {

====================================================
Index: phpbrain/inc/class.uikb.inc.php
diff -u phpbrain/inc/class.uikb.inc.php:1.17 
phpbrain/inc/class.uikb.inc.php:1.18
--- phpbrain/inc/class.uikb.inc.php:1.17        Sun Sep  7 04:09:54 2003
+++ phpbrain/inc/class.uikb.inc.php     Sun May 15 12:43:37 2005
@@ -9,8 +9,6 @@
  * Originally Written by Dave Hall - <skwashd at phpgroupware.org>     *
  * Loosely Based on phpBrain from Bart Veldhuizen - http://vrotvrot.com *
  * --------------------------------------------                                
*
- *  Development Sponsored by Creativix                                 *
- * --------------------------------------------                                
*
  * This program is Free Software; you can redistribute it and/or modify *
  * it under the terms of the GNU General Public License as published by *
  * the Free Software Foundation; either version 2 of the License, or   *
@@ -50,14 +48,13 @@
                        $this->bo       = createObject('phpbrain.bokb');
                        $this->cats     = CreateObject('phpgwapi.categories');
                        $this->theme    = $GLOBALS['phpgw_info']['theme'];
-                       $this->t        = $GLOBALS['phpgw']->template;
+                       $this->t        = &$GLOBALS['phpgw']->template;
                        $this->t->unknowns = 'remove';
                }

                function index()
                {
                        $this->browse();
-                       $GLOBALS['phpgw']->common->phpgw_exit();
                }

                function add()
@@ -68,7 +65,6 @@
                                $this->edit_vals['question_id'] = 
trim($_GET['question_id']);
                        }//end if question
                        $this->edit_answer(True);
-                       $GLOBALS['phpgw']->common->phpgw_exit();
                }//end add

                function add_comment()
@@ -98,8 +94,6 @@
                        }

                        header('Location: ' . 
$GLOBALS['phpgw']->link('/index.php',$link));
-                       $GLOBALS['phpgw']->common->phpgw_exit();
-
                }//end add comment

                function add_question()
@@ -120,8 +114,6 @@
                                $msg = 'not added - error';
                        }// if ok
                        $this->unanswered($msg);
-                       $GLOBALS['phpgw']->common->phpgw_exit();
-
                }//end add question

                function browse()
@@ -143,12 +135,15 @@
                        {
                                $cat_name = $this->cats->id2name($cat_id);
                                $this->t->set_var('cur_category_name', 
$cat_name);
-                               $this->t->set_var('up_category_url', 
$GLOBALS['phpgw']->link('/index.php',
-                                                                               
        array('menuaction' => 'phpbrain.uikb.browse',
-                                                                               
                'cat_id'        => $this->cats->id2name($cat_id,'parent')
-                                                                               
                )
-                                                                               
        )
-                                               );
+
+                               $this->t->set_var('up_category_url',
+                                       $GLOBALS['phpgw']->link('/index.php',
+                                               array('menuaction'      => 
'phpbrain.uikb.browse',
+                                                       'cat_id'        => 
$this->cats->id2name($cat_id,'parent')
+                                               )
+                                       )
+                               );
+
                                $this->t->set_var('lang_up', lang('up'));
                                $this->t->parse('ccname', 'cur_cat_name');
                        }
@@ -167,6 +162,7 @@

                                foreach( $cat_data as $cat_key => $cat_fields)
                                {
+                                       $this->t->set_var('sub_cats', '');
                                        if(is_array($cat_fields['subs']))
                                        {
                                                foreach($cat_fields['subs'] as 
$sub_id => $sub_vals)
@@ -186,13 +182,14 @@
                                                                
$this->t->set_var('sub_cat_count', '');
                                                        }//count(entries)

-                                                       
$this->t->parse('subcats','sub_cat',true);
+                                                       
$this->t->parse('sub_cats','sub_cat', true);
                                                }//end foreach(subcats)

                                        }
                                        else //!is_array(subcats)
                                        {
                                                $this->t->set_var('subcats', 
'');
+                                               $this->t->set_var('sub_cats', 
'');
                                        }//end is_array(subcats)

                                        
$this->t->set_var('cat_link',$GLOBALS['phpgw']->link('/index.php',
@@ -230,9 +227,9 @@
                                        $this->t->parse('cells', 'cell', true);
                                        $this->t->parse('row', 'cells');//, 
true);
                                        $this->t->parse('rows', 'cat_row', 
true);
-                               }//end if is_even(cells)
+                       }//end if is_even(cells)

-                               $this->t->parse('tbl','table');
+                       $this->t->parse('tbl','table');
                        }
                        else //!is_array(cats)
                        {
@@ -308,7 +305,6 @@
                        $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)
@@ -372,7 +368,6 @@
                        echo parse_navbar();
                        echo '<h2>Coming Soon!</h2>';
                        echo 'This will link to the manual for this app when 
completed';
-                       $GLOBALS['phpgw']->common->phpgw_exit();
                }//end help

                function maint_answer()
@@ -383,7 +378,6 @@
                        echo parse_navbar();
                                echo '<h2 align="center">Coming Soon!</h2>';
                                echo 'A proper manual will be added soon';
-                               $GLOBALS['phpgw']->common->exit();
                        }
                        else//must be admin
                        {
@@ -463,14 +457,15 @@
                                }
                        $GLOBALS['phpgw']->common->phpgw_header();
                        echo parse_navbar();
-                       $this->t->set_file('admin_maint', 'admin_maint.tpl');
+
+                       $this->t->set_file('admin_maint', 'admin_maint.tpl');
                        $this->t->set_block('admin_maint', 'pending_list', 
'pending_items');
                        $this->t->set_block('admin_maint', 'pending_block', 
'p_block');
                        $this->t->set_var('admin_url', 
$GLOBALS['phpgw']->link('/admin/index.php'));
                        $this->t->set_var('lang_return_to_admin', 
lang('return_to_admin'));
-                               $this->t->set_var('msg', ((strlen($msg) !=0) ? 
$msg : '&nbsp;'));
-
-                               $questions = $this->bo->get_questions(true);
+                       $this->t->set_var('msg', ((strlen($msg) !=0) ? $msg : 
'&nbsp;'));
+
+                       $questions = $this->bo->get_questions(true);
                        if(is_array($questions))
                        {
                                foreach($questions as $key => $val)
@@ -503,7 +498,6 @@
                function preview()
                {
                        $this->view(false);
-                       $GLOBALS['phpgw']->common->phpgw_exit();
                }

                function rate()
@@ -515,7 +509,6 @@
                                $this->bo->set_rating($faq_id, $rating);
                        }
                        $this->view();
-                       $GLOBALS['phpgw']->common->phpgw_exit();
                }//end rate

                function save()
@@ -539,7 +532,6 @@
                                                                                
)
                                                                        )
                                        );
-                       $GLOBALS['phpgw']->common->phpgw_exit();
                        }
                        else
                        {
@@ -579,7 +571,6 @@
                        else
                        {
                                $this->browse();
-                               $GLOBALS['phpgw']->common->phpgw_exit();
                        }
                }//end search


====================================================
Index: phpbrain/inc/class.sokb.inc.php
diff -u phpbrain/inc/class.sokb.inc.php:1.17 
phpbrain/inc/class.sokb.inc.php:1.18
--- phpbrain/inc/class.sokb.inc.php:1.17        Fri Jun  6 23:13:28 2003
+++ phpbrain/inc/class.sokb.inc.php     Sun May 15 12:43:37 2005
@@ -348,7 +348,7 @@
                        return $rows;
                }//end search ansisql

-               function search_mysql($search, $show)
+               function search_mysql($search, $show)//broken
                {
                        $sql  = 'SELECT *, ';
                        $sql .= "MATCH text,keywords,title AGAINST('" . 
$this->db->db_addslashes($search) ."') AS score ";






reply via email to

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