Changeset 13052 for trunk/admin/include/functions.php
- Timestamp:
- Feb 7, 2012, 10:25:20 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/include/functions.php
r13025 r13052 203 203 204 204 $ok = true; 205 206 207 208 209 210 211 212 213 214 215 216 205 if (!isset($conf['never_delete_originals'])) 206 { 207 foreach ($files as $path) 208 { 209 if (is_file($path) and !unlink($path)) 210 { 211 $ok = false; 212 trigger_error('"'.$path.'" cannot be removed', E_USER_WARNING); 213 break; 214 } 215 } 216 } 217 217 218 218 if ($ok) … … 2307 2307 } 2308 2308 2309 function delete_element_derivatives($infos )2309 function delete_element_derivatives($infos, $type='all') 2310 2310 { 2311 2311 $path = $infos['path']; … … 2318 2318 $path = substr($path, 3); 2319 2319 } 2320 $dot = strpos($path, '.'); 2321 $path = substr_replace($path, '-*', $dot, 0); 2320 $dot = strrpos($path, '.'); 2321 if ($type=='all') 2322 { 2323 $pattern = '-*'; 2324 } 2325 else 2326 { 2327 $pattern = '-'.derivative_to_url($type).'*'; 2328 } 2329 $path = substr_replace($path, $pattern, $dot, 0); 2322 2330 foreach( glob(PHPWG_ROOT_PATH.PWG_DERIVATIVE_DIR.$path) as $file) 2323 2331 {
Note: See TracChangeset
for help on using the changeset viewer.