mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-08 23:19:04 +01:00
* Add filemanager actions to convert editable files to PDF or PNG
This commit is contained in:
parent
f6828a8205
commit
2a4faf0137
@ -2441,15 +2441,7 @@ abstract class Merge
|
|||||||
Vfs::get_home_dir() :
|
Vfs::get_home_dir() :
|
||||||
"/home/{$GLOBALS['egw_info']['user']['account_lid']}"
|
"/home/{$GLOBALS['egw_info']['user']['account_lid']}"
|
||||||
) . "/$filename";
|
) . "/$filename";
|
||||||
$dupe_count = 0;
|
$target = Vfs::make_unique($target);
|
||||||
while(is_file(Vfs::PREFIX.$target))
|
|
||||||
{
|
|
||||||
$dupe_count++;
|
|
||||||
$target = Vfs::dirname($_target) . '/' .
|
|
||||||
pathinfo($filename, PATHINFO_FILENAME) .
|
|
||||||
' ('.($dupe_count + 1).')' . '.' .
|
|
||||||
pathinfo($filename, PATHINFO_EXTENSION);
|
|
||||||
}
|
|
||||||
copy($result, Vfs::PREFIX . $target);
|
copy($result, Vfs::PREFIX . $target);
|
||||||
unlink($result);
|
unlink($result);
|
||||||
|
|
||||||
|
@ -2386,6 +2386,27 @@ class Vfs extends Vfs\Base
|
|||||||
}
|
}
|
||||||
return self::_call_on_backend('get_minimum_file_id', array($path));
|
return self::_call_on_backend('get_minimum_file_id', array($path));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Make sure the path is unique, by appending (#) to the filename if it already exists
|
||||||
|
*
|
||||||
|
* @param string $path
|
||||||
|
*
|
||||||
|
* @return string The same path, but modified if it exists
|
||||||
|
*/
|
||||||
|
static function make_unique($path)
|
||||||
|
{
|
||||||
|
$dupe_count = 0;
|
||||||
|
while(is_file(Vfs::PREFIX . $path))
|
||||||
|
{
|
||||||
|
$dupe_count++;
|
||||||
|
$path = Vfs::dirname($path) . '/' .
|
||||||
|
pathinfo($path, PATHINFO_FILENAME) .
|
||||||
|
' (' . ($dupe_count + 1) . ')' . '.' .
|
||||||
|
pathinfo($path, PATHINFO_EXTENSION);
|
||||||
|
}
|
||||||
|
return $path;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Vfs::init_static();
|
Vfs::init_static();
|
||||||
|
Loading…
Reference in New Issue
Block a user