aboutsummaryrefslogtreecommitdiffstats
path: root/admin/include
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2012-02-07 21:25:20 +0000
committerrvelices <rv-github@modusoptimus.com>2012-02-07 21:25:20 +0000
commitecf196ba31267f589618fdddec007e3570866334 (patch)
tree7bc37e1c91ebb30a387adfe6c6542c3278c6c3a0 /admin/include
parent14a17a5ab2c5d2b8674506572f7eb0c7c4958bae (diff)
upgrade jquery to 1.7.1
mouseout on index drop down bozes improved multisize center of interest git-svn-id: http://piwigo.org/svn/trunk@13052 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--admin/include/functions.php38
1 files changed, 23 insertions, 15 deletions
diff --git a/admin/include/functions.php b/admin/include/functions.php
index b25991bed..9e6901f27 100644
--- a/admin/include/functions.php
+++ b/admin/include/functions.php
@@ -202,18 +202,18 @@ SELECT
}
$ok = true;
- if (!isset($conf['never_delete_originals']))
- {
- foreach ($files as $path)
- {
- if (is_file($path) and !unlink($path))
- {
- $ok = false;
- trigger_error('"'.$path.'" cannot be removed', E_USER_WARNING);
- break;
- }
- }
- }
+ if (!isset($conf['never_delete_originals']))
+ {
+ foreach ($files as $path)
+ {
+ if (is_file($path) and !unlink($path))
+ {
+ $ok = false;
+ trigger_error('"'.$path.'" cannot be removed', E_USER_WARNING);
+ break;
+ }
+ }
+ }
if ($ok)
{
@@ -2306,7 +2306,7 @@ function clear_derivative_cache_rec($path, $pattern)
}
}
-function delete_element_derivatives($infos)
+function delete_element_derivatives($infos, $type='all')
{
$path = $infos['path'];
if (!empty($infos['representative_ext']))
@@ -2317,8 +2317,16 @@ function delete_element_derivatives($infos)
{
$path = substr($path, 3);
}
- $dot = strpos($path, '.');
- $path = substr_replace($path, '-*', $dot, 0);
+ $dot = strrpos($path, '.');
+ if ($type=='all')
+ {
+ $pattern = '-*';
+ }
+ else
+ {
+ $pattern = '-'.derivative_to_url($type).'*';
+ }
+ $path = substr_replace($path, $pattern, $dot, 0);
foreach( glob(PHPWG_ROOT_PATH.PWG_DERIVATIVE_DIR.$path) as $file)
{
@unlink($file);