mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-10-06 10:12:46 +02:00
"using the global db object"
This commit is contained in:
parent
426fc2825e
commit
ec042e0f4d
@ -1,28 +1,16 @@
|
||||
<?php
|
||||
/**************************************************************************\
|
||||
* eGroupWare API - Hooks *
|
||||
* This file written by Dan Kuykendall <seek3r@phpgroupware.org> *
|
||||
* Allows applications to "hook" into each other *
|
||||
* Copyright (C) 2000, 2001 Dan Kuykendall *
|
||||
* New method hooks and docu are written by <RalfBecker@outdoor-training.de>*
|
||||
* -------------------------------------------------------------------------*
|
||||
* This library is part of the eGroupWare API *
|
||||
* http://www.egroupware.org/api *
|
||||
* ------------------------------------------------------------------------ *
|
||||
* This library is free software; you can redistribute it and/or modify it *
|
||||
* under the terms of the GNU Lesser General Public License as published by *
|
||||
* the Free Software Foundation; either version 2.1 of the License, *
|
||||
* or any later version. *
|
||||
* This library is distributed in the hope that it will be useful, but *
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
|
||||
* See the GNU Lesser General Public License for more details. *
|
||||
* You should have received a copy of the GNU Lesser General Public License *
|
||||
* along with this library; if not, write to the Free Software Foundation, *
|
||||
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
|
||||
\**************************************************************************/
|
||||
|
||||
/* $Id$ */
|
||||
/**
|
||||
* eGroupWare API - Hooks
|
||||
*
|
||||
* @link http://www.egroupware.org
|
||||
* @author Dan Kuykendall <seek3r@phpgroupware.org>
|
||||
* @author Ralf Becker <RalfBecker-AT-outdoor-training.de>
|
||||
* Copyright (C) 2000, 2001 Dan Kuykendall
|
||||
* New method hooks and docu are written by <RalfBecker@outdoor-training.de>
|
||||
* @license http://opensource.org/licenses/lgpl-license.php LGPL - GNU Lesser General Public License
|
||||
* @package api
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**
|
||||
* class which gives ability for applications to set and use hooks to communicate with each other
|
||||
@ -41,17 +29,15 @@
|
||||
* - old type, which are included files. Values can only be passed by global values and they cant return anything.
|
||||
* Old declaration in setup.inc.php:
|
||||
* $setup_info['appname']['hooks'][] = 'location';
|
||||
*
|
||||
* @author Dan Kuykendall
|
||||
* @author Ralf Becker <RalfBecker@outdoor-training.de> new method hooks
|
||||
* @license LGPL
|
||||
* @package phpgwapi
|
||||
* @access public
|
||||
*/
|
||||
|
||||
class hooks
|
||||
{
|
||||
var $found_hooks = Array();
|
||||
/**
|
||||
* Reference to the global db object
|
||||
*
|
||||
* @var egw_db
|
||||
*/
|
||||
var $db;
|
||||
var $table = 'egw_hooks';
|
||||
|
||||
@ -64,14 +50,11 @@
|
||||
{
|
||||
$this->db = $db ? $db : $GLOBALS['egw']->db; // this is to allow setup to set the db
|
||||
|
||||
$this->db->select($this->table,'hook_appname,hook_location,hook_filename',false,__LINE__,__FILE__);
|
||||
while( $this->db->next_record() )
|
||||
foreach($this->db->select($this->table,'hook_appname,hook_location,hook_filename',false,__LINE__,__FILE__) as $row)
|
||||
{
|
||||
$this->found_hooks[$this->db->f('hook_appname')][$this->db->f('hook_location')] = $this->db->f('hook_filename');
|
||||
$this->found_hooks[$row['hook_appname']][$row['hook_location']] = $row['hook_filename'];
|
||||
}
|
||||
//echo '<pre>';
|
||||
//print_r($this->found_hooks);
|
||||
//echo '</pre>';
|
||||
//_debug_array($this->found_hooks);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user