egroupware_official/admin/inc/class.boapplications.inc.php

96 lines
2.2 KiB
PHP
Raw Normal View History

2001-09-14 21:45:06 +02:00
<?php
/**************************************************************************\
* phpGroupWare - administration *
* http://www.phpgroupware.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. *
\**************************************************************************/
/* $Id$ */
class boapplications
{
var $public_functions = array(
'register_all_hooks' => True
);
2001-09-14 21:45:06 +02:00
var $so;
function boapplications()
{
$this->so = CreateObject('admin.soapplications');
}
function get_list()
{
return $this->so->get_list();
}
function read($app_name)
{
return $this->so->read($app_name);
}
2001-09-14 21:53:24 +02:00
function add($data)
{
return $this->so->add($data);
}
2001-09-14 21:45:06 +02:00
function save($data)
{
return $this->so->save($data);
}
function exists($app_name)
{
return $this->so->exists($app_name);
}
function app_order()
{
return $this->so->app_order();
}
function delete($app_name)
{
return $this->so->delete($app_name);
}
function register_hook($hook_app)
{
return $this->so->register_hook($hook_app);
}
function register_all_hooks()
{
$SEP = filesystem_separator();
$app_list = $this->get_list();
$hooks = CreateObject('phpgwapi.hooks');
while(list($app_name,$app) = each($app_list))
{
$f = PHPGW_SERVER_ROOT . $SEP . $app_name . $SEP . 'setup' . $SEP . 'setup.inc.php';
if(@file_exists($f))
{
include($f);
2002-01-06 06:37:17 +01:00
while(is_array($setup_info[$app_name]['hooks']) && list(,$hook) = @each($setup_info[$app_name]['hooks']))
{
2002-01-06 06:56:19 +01:00
if(!@$hooks->found_hooks[$app_name][$hook])
{
$this->register_hook(
Array(
'app_name' => $app_name,
'hook' => $hook
)
);
}
}
}
}
Header('Location: '.$GLOBALS['phpgw']->link('/admin/index.php'));
2002-01-06 06:37:17 +01:00
$GLOBALS['phpgw']->common->phpgw_exit();
}
2001-09-14 21:45:06 +02:00
}