3 * FusionForge plugin system
5 * Copyright 2002, Roland Mas
7 * This file is part of FusionForge.
9 * FusionForge is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published
11 * by the Free Software Foundation; either version 2 of the License,
12 * or (at your option) any later version.
14 * FusionForge is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with FusionForge; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
25 class Plugin extends Error {
30 * Plugin() - constructor
36 $this->hooks = array () ;
40 * GetHooks() - get list of hooks to subscribe to
42 * @return List of strings
44 function GetHooks () {
49 * GetName() - get plugin name
51 * @return the plugin name
58 * GetInstallDir() - get installation dir for the plugin
60 * @return the directory where the plugin should be linked.
62 function GetInstallDir () {
63 if (isset($this->installdir) && $this->installdir)
64 return $this->installdir;
66 return 'plugins/'.$this->name ;
70 * CallHook() - call a particular hook
72 * @param hookname - the "handle" of the hook
73 * @param params - array of parameters to pass the hook
75 function CallHook ($hookname, $params) {
83 // c-file-style: "bsd"