phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] property/inc class.custom_functions.inc.php,1.2


From: ceb
Subject: [Phpgroupware-cvs] property/inc class.custom_functions.inc.php,1.2
Date: Thu, 24 Feb 2005 14:36:33 -0000

Update of property/inc

Added Files:
     Branch: MAIN
            class.custom_functions.inc.php lines: +73 -0

Log Message:
committed prop-18-branch version to head

====================================================
Index: class.custom_functions.inc.php
<?php
        /**
        * phpGroupWare - property
        * address@hidden http://www.phpgroupware.org}
        *
        * Property: a Facilities Management System.
        *
        * Copyright 2000 - 2003 Free Software Foundation, Inc
        * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
        *
        * 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 (at your
        * option) any later version.
        *
        * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
        * @author Sigurd Nes
        * @package property
        * @subpackage core
        * @version $Id: class.custom_functions.inc.php,v 1.2 2005/01/13 
17:00:04 ceb Exp $
        */

        /**
         * This is a class used to gain access to custom classes stored in 
/inc/custom to be run as cron jobs
         * or from the admin interface.
         * @package property
         */

        class custom_functions
        {

                var $public_functions = array(
                        'index' => True
                );

                function custom_functions ()
                {
                        $GLOBALS['phpgw_info']['flags']['noheader'] = True;
                        $GLOBALS['phpgw_info']['flags']['nonavbar'] = True;


                        $GLOBALS['phpgw_info']['flags']['currentapp']   =       
'property';

                        $this->currentapp               = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->config           = 
CreateObject('phpgwapi.config',$this->currentapp);

                }

                /**
                 * @param mixed $data
                 * If $data is an array - then the process is run as cron - and 
will look for $data['function'] to
                 * determine which custom class to load
                 */

                function index($data='')
                {
                        if(is_array($data))
                        {
                                $function = $data['function'];
                        }
                        else
                        {
                                $function       = 
get_var('function',array('POST','GET'));
                        }

                        
include_once(PHPGW_SERVER_ROOT.'/'.'property'.'/inc/custom/' . $function . 
'.php');
                        $custom = new $function;
                        $custom->pre_run($data);
                }


        }
?>






reply via email to

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