phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] phpgwapi/inc class.categories.inc.php


From: Dave Hall
Subject: [Phpgroupware-cvs] phpgwapi/inc class.categories.inc.php
Date: Tue, 11 Apr 2006 18:40:36 +0000

CVSROOT:        /cvsroot/phpgwapi
Module name:    phpgwapi
Branch:         
Changes by:     Dave Hall <address@hidden>      06/04/11 18:40:36

Modified files:
        inc            : class.categories.inc.php 

Log message:
        stop error in phpgw::link caused by wrongs args and make exists() not 
break

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/phpgwapi/inc/class.categories.inc.php.diff?tr1=1.123&tr2=1.124&r1=text&r2=text

Patches:
Index: phpgwapi/inc/class.categories.inc.php
diff -u phpgwapi/inc/class.categories.inc.php:1.123 
phpgwapi/inc/class.categories.inc.php:1.124
--- phpgwapi/inc/class.categories.inc.php:1.123 Thu Jan 13 11:30:00 2005
+++ phpgwapi/inc/class.categories.inc.php       Tue Apr 11 18:40:36 2006
@@ -7,7 +7,7 @@
        * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General 
Public License
        * @package phpgwapi
        * @subpackage utilities
-       * @version $Id: class.categories.inc.php,v 1.123 2005/01/13 11:30:00 
ceb Exp $
+       * @version $Id: class.categories.inc.php,v 1.124 2006/04/11 18:40:36 
skwashd Exp $
        */
 
        /**
@@ -528,13 +528,13 @@
                {
                        if(is_array($data))
                        {
-                               $format                 = 
(isset($data['format'])?$data['format']:'filter');
-                               $type                   = 
(isset($data['type'])?$data['type']:'all');
-                               $selected               = 
(isset($data['selected'])?$data['selected']:'');
-                               $self                   = 
(isset($data['self'])?$data['self']:'');
-                               $globals                = 
(isset($data['globals'])?$data['globals']:True);
-                               $link_data              = 
(isset($data['link_data'])?$data['link_data']:0);
-                               $select_name    = 
(isset($data['select_name'])?$data['select_name']:'cat_id');
+                               $format                 = 
isset($data['format']) ? $data['format'] : 'filter';
+                               $type                   = isset($data['type']) 
? $data['type'] : 'all';
+                               $selected               = 
isset($data['selected']) ? $data['selected'] : '';
+                               $self                   = isset($data['self']) 
? $data['self'] : '';
+                               $globals                = 
isset($data['globals']) ? $data['globals'] : true;
+                               $link_data              = 
isset($data['link_data']) ? $data['link_data'] : array();
+                               $select_name            = 
isset($data['select_name'])?$data['select_name'] : 'cat_id';
                        }
                        else
                        {
@@ -606,7 +606,7 @@
                                'cat_list'                              => 
$cat_list,
                                'lang_no_cat'                   => lang('no 
category'),
                                'lang_cat_statustext'   => lang('Select the 
category the data belong to. To do not use a category select NO CATEGORY'),
-                               'select_url'                    => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
+                               'select_url'                    => 
$GLOBALS['phpgw']->link('/index.php', $link_data),
                                'select_name'                   => $select_name,
                                'lang_submit'                   => 
lang('submit')
                        );
@@ -834,9 +834,18 @@
                * @param $cat_id Category ID
                * @return boolean True when the category exists otherwise false
                */
-               function exists($type,$cat_name = '',$cat_id = '')
+               function exists($type, $cat_name = '', $cat_id = 0 )
                {
-                       $cat_id = intval($cat_id);
+                       if ( is_array($type) )
+                       {
+                               $real_type = $type['type'];
+                               $cat_id = $type['cat_id'];
+                               $cat_name = $type['cat_name'];
+                               $type = $real_type;
+                               unset($real_type);
+                       }
+                       
+                       $cat_id = (int) $cat_id;
                        $filter = $this->filter($type);
 
                        if ($cat_name)




reply via email to

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