egroupware_official/admin/inc/hook_config_validate.inc.php
Ralf Becker 54bf7a3d2d - fixed image map was empty created when not loged in (now directories are used and not $GLOBALS['egw_info']['apps'])
- fixed not working vfs-image-dir
- deleteing image-maps when:
  + apps get installed, updated or removed
  + admin >> register hooks
  + admin >> site configuration: vfs-image-dir get changed
- fixed not displayed validation errors (thought there were no validation) in admin >> site config
--> you need to register hooks, in order to get the admin >> site configuration validation hook ;-)
2011-08-31 10:16:12 +00:00

38 lines
1.1 KiB
PHP

<?php
/**
* EGroupware administration
*
* @link http://www.egroupware.org
* @package setup
* @author Ralf Becker <RalfBecker-AT-outdoor-training.de>
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @version $Id$
*/
/*
Set a global flag to indicate this file was found by setup/config.php.
config.php will unset it after parsing the form values.
*/
$GLOBALS['egw_info']['server']['found_validation_hook'] = True;
/**
* Check VFS dir exists and delete image map to recreate it, if vfs-image-dir changes
*
* @param string
*/
function vfs_image_dir($vfs_image_dir)
{
//error_log(__FUNCTION__.'() vfs_image_dir='.array2string($vfs_image_dir).' was '.array2string($GLOBALS['egw_info']['server']['vfs_image_dir']));
if (!empty($vfs_image_dir))
{
if (!egw_vfs::file_exists($vfs_image_dir) || !egw_vfs::is_dir($vfs_image_dir))
{
$GLOBALS['config_error'] = lang('VFS directory "%1" NOT found!',$vfs_image_dir);
return;
}
}
if ($vfs_image_dir != (string)$GLOBALS['egw_info']['server']['vfs_image_dir'])
{
common::delete_image_map();
}
}