phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] api/class.apps.php, 1.1.1.1.2.6


From: nomail
Subject: [Phpgroupware-cvs] api/class.apps.php, 1.1.1.1.2.6
Date: Thu, 20 May 2004 14:47:20 -0000

Update of /api
Modified Files:
        Branch: proposal-branch
          class.apps.php

date: 2004/04/16 20:59:48;  author: seek3r;  state: Exp;  lines: +53 -44

Log Message:
bringing savannah cvs back up to date with what we were doing on our private 
cvs server. We will not be doing dev from this cvs tree
=====================================================================
No syntax errors detected in -
=====================================================================
Index: api/class.apps.php
diff -u api/class.apps.php:1.1.1.1.2.5 api/class.apps.php:1.1.1.1.2.6
--- api/class.apps.php:1.1.1.1.2.5      Sat Feb 28 10:42:25 2004
+++ api/class.apps.php  Fri Apr 16 20:59:48 2004
@@ -33,27 +33,36 @@
                        /*
                        $tmp = $this->db->Halt_On_Error;
                        $this->db->Halt_On_Error = 'no';
-                       $this->db->query("SELECT * FROM phpgw_apps WHERE 
app_enabled=1 order by app_title",__LINE__,__FILE__);
+                       $this->db->query("SELECT * FROM phpgw_apps WHERE 
app_enabled=1 order by app_title");
                        $this->db->Halt_On_Error = $tmp;
                        */
-                       $dbresult = $GLOBALS['phpgw']->db->execute("SELECT * 
FROM phpgw_apps WHERE app_enabled=1 order by app_title",__LINE__,__FILE__);
+                       $dbresult = $GLOBALS['phpgw']->db->Execute("SELECT * 
FROM phpgw_apps WHERE app_enabled=1 order by app_title");
                        if($dbresult !== false)
                        {
                                while (!$dbresult->EOF)
                                {
                                        $title = 
lang($dbresult->fields['app_title'], $dbresult->fields['app_name']);
-                                       
$this->allapps[$dbresult->fields['app_name']] = 
array('name'=>$dbresult->fields['app_name'], 'title'=>$title);
+                                       $iconfile = 
$dbresult->fields['app_name'].'/skins/'.$GLOBALS['phpgw_data']['prefs']['api.skin'].'/images/icon.png';
+                                       
if(!file_exists(PHPGW_ROOT.SEP.$app.SEP.'skins'.SEP.$GLOBALS['phpgw_data']['prefs']['api.skin'].SEP.'images'.SEP.'icon.png')
 && $GLOBALS['phpgw_data']['prefs']['api.skin'] != 'default')
+                                       {
+                                               
if(!file_exists(PHPGW_ROOT.SEP.$app.SEP.'skins'.SEP.'default'.SEP.'images'.SEP.'icon.png'))
+                                               {
+                                                       $iconfile = 
$dbresult->fields['app_name'].'/skins/default/images/icon.png';
+                                               }
+                                       }
+                                       
+                                       
$this->allapps[$dbresult->fields['app_name']] = 
array('name'=>$dbresult->fields['app_name'], 'title'=>$title, 
'icon'=>$iconfile);
                                        $dbresult->MoveNext();
                                }
                        }
                }
 
-               function pre_serialize()
+               function __sleep()
                {
                        // stub so its gets cache'd. No cleanup needed.
                }
                
-               function post_serialize()
+               function __wakeup()
                {
                }
 
@@ -61,11 +70,11 @@
                {
                        $args = new safe_args();
                        $args->set('account_id', 
$GLOBALS['phpgw_data']['user']['id'], 'number');
-                       $args = $args->get(func_get_args(),__LINE__,__FILE__);
+                       $args = $args->get(func_get_args());
 
                        if ($args['account_id'] != 
$GLOBALS['phpgw_data']['user']['id'])
                        {
-                               $acl = createobject('api_acl',$args);
+                               $acl = createObject('api_acl',$args);
                        }
                        else
                        {
@@ -85,18 +94,18 @@
                function has_rights()
                {
                        $args = new safe_args();
-                       $args->set('appname', '##REQUIRED##', 'string');
-                       $args = $args->get(func_get_args(),__LINE__,__FILE__);
+                       $args->set('appname', REQUIRED, 'string');
+                       $args = $args->get(func_get_args());
 
                        $userapps = array();
                        foreach($this->allapps as $key=>$val)                   
        
                        {
                                if($val['name'] == $args['appname'] && 
$GLOBALS['phpgw']->acl->check($val['name'].'.base.start',1))
                                {
-                                       return True;
+                                       return true;
                                }
                        }
-                       return False;
+                       return false;
                }
 
                function fill_phpgw_data()
@@ -109,100 +118,100 @@
                                        $GLOBALS['phpgw_data']['apps'][] = $val;
                                }
                        }
-                       return True;
+                       return true;
                }
 
                function add ()
                {
                        $args = new safe_args();
-                       $args->set('name', '##REQUIRED##', 'string');
-                       $args->set('title', '##REQUIRED##', 'string');
+                       $args->set('name', REQUIRED, 'string');
+                       $args->set('title', REQUIRED, 'string');
                        $args->set('version', '1.9', 'string');
                        $args->set('enabled', 1, 'int');
-                       $args = $args->get(func_get_args(),__LINE__,__FILE__);
+                       $args = $args->get(func_get_args());
                        
 
                        /*
                        $tmp = $this->db->Halt_On_Error;
                        $this->db->Halt_On_Error = 'no';
-                       $this->db->query("SELECT * FROM phpgw_apps WHERE 
app_name='".$args['name']."'",__LINE__,__FILE__);
+                       $this->db->query("SELECT * FROM phpgw_apps WHERE 
app_name='".$args['name']."'");
                        $this->db->Halt_On_Error = $tmp;
                        */
-                       $dbresult = $GLOBALS['phpgw']->db->execute("SELECT * 
FROM phpgw_apps WHERE app_name='".$args['name']."'",__LINE__,__FILE__);
+                       $dbresult = $GLOBALS['phpgw']->db->Execute("SELECT * 
FROM phpgw_apps WHERE app_name='".$args['name']."'");
                        
                        if($dbresult === false)
                        {
-                               return False;
+                               return false;
                        }
                        $sql = "insert into phpgw_apps (app_name, app_title, 
app_version, app_enabled)";
                        $sql .= " values ('".$args['name']."', 
'".$args['title']."', '".$args['version']."', ".$args['enabled'].")";
-                       $GLOBALS['phpgw']->db->execute($sql,__LINE__,__FILE__);
-                       return True;
+                       $GLOBALS['phpgw']->db->Execute($sql);
+                       return true;
                }
 
                function remove ()
                {
                        $args = new safe_args();
-                       $args->set('name', '##REQUIRED##', 'string');
-                       $args = $args->get(func_get_args(),__LINE__,__FILE__);
+                       $args->set('name', REQUIRED, 'string');
+                       $args = $args->get(func_get_args());
                        $sql = "delete from phpgw_apps where 
app_name='".$args['name']."'";
-                       $GLOBALS['phpgw']->db->execute($sql,__LINE__,__FILE__);
-                       return True;
+                       $GLOBALS['phpgw']->db->Execute($sql);
+                       return true;
                }
 
                function upgrade ()
                {
                        $args = new safe_args();
-                       $args->set('name', '##REQUIRED##', 'string');
-                       $args->set('title', '##REQUIRED##', 'string');
-                       $args->set('version', '##REQUIRED##', 'string');
+                       $args->set('name', REQUIRED, 'string');
+                       $args->set('title', REQUIRED, 'string');
+                       $args->set('version', REQUIRED, 'string');
                        $args->set('enabled', 1, 'int');
-                       $args = $args->get(func_get_args(),__LINE__,__FILE__);
+                       $args = $args->get(func_get_args());
                        
                        $this->remove($args);
                        $this->add($args);
-                       return True;
+                       return true;
                }
 
                function disable ()
                {
                        $args = new safe_args();
-                       $args->set('name', '##REQUIRED##', 'string');
-                       $args = $args->get(func_get_args(),__LINE__,__FILE__);
+                       $args->set('name', REQUIRED, 'string');
+                       $args = $args->get(func_get_args());
                        $sql = "UPDATE phpgw_apps SET app_enabled=0 where 
app_name='".$args['name']."'";
-                       $GLOBALS['phpgw']->db->execute($sql,__LINE__,__FILE__);
-                       return True;
+                       $GLOBALS['phpgw']->db->Execute($sql);
+                       return true;
                }
 
                function enable ()
                {
                        $args = new safe_args();
-                       $args->set('name', '##REQUIRED##', 'string');
-                       $args = $args->get(func_get_args(),__LINE__,__FILE__);
+                       $args->set('name', REQUIRED, 'string');
+                       $args = $args->get(func_get_args());
                        $sql = "UPDATE phpgw_apps SET app_enabled=1 where 
app_name='".$args['name']."'";
-                       $GLOBALS['phpgw']->db->execute($sql,__LINE__,__FILE__);
-                       return True;
+                       $GLOBALS['phpgw']->db->Execute($sql);
+                       return true;
                }
 
                function get_version ()
                {
                        $args = new safe_args();
-                       $args->set('name', '##REQUIRED##', 'string');
-                       $args = $args->get(func_get_args(),__LINE__,__FILE__);
+                       $args->set('name', REQUIRED, 'string');
+                       $args = $args->get(func_get_args());
 
                        /*
                        $tmp = $this->db->Halt_On_Error;
                        $this->db->Halt_On_Error = 'no';
-                       $this->db->query("SELECT app_version FROM phpgw_apps 
WHERE app_name='".$args['name']."'",__LINE__,__FILE__);
+                       $this->db->query("SELECT app_version FROM phpgw_apps 
WHERE app_name='".$args['name']."'");
                        $this->db->Halt_On_Error = $tmp;
                        */
 
-                       $dbresult = $GLOBALS['phpgw']->db->execute("SELECT 
app_version FROM phpgw_apps WHERE 
app_name='".$args['name']."'",__LINE__,__FILE__);
+                       $dbresult = $GLOBALS['phpgw']->db->Execute("SELECT 
app_version FROM phpgw_apps WHERE app_name='".$args['name']."'");
                        
                        if($dbresult !== false)
                        {
                                return $dbresult->fields['app_version'];
                        }                       
-                       return False;
+                       return false;
                }
        }




reply via email to

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