2011-08-31 12:16:12 +02:00
|
|
|
<?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$
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
2014-04-23 16:36:08 +02:00
|
|
|
Set global flag to indicate for which config settings we have equally named validation methods
|
2011-08-31 12:16:12 +02:00
|
|
|
*/
|
2014-04-23 16:36:08 +02:00
|
|
|
$GLOBALS['egw_info']['server']['found_validation_hook'] = array('vfs_image_dir');
|
2011-08-31 12:16:12 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 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();
|
2015-02-17 19:45:14 +01:00
|
|
|
|
|
|
|
// Set the global now, or the old value will get re-loaded
|
|
|
|
$GLOBALS['egw_info']['server']['vfs_image_dir'] = $vfs_image_dir;
|
2011-08-31 12:16:12 +02:00
|
|
|
}
|
|
|
|
}
|