Ignore:
Timestamp:
Jan 1, 2012, 10:10:43 PM (12 years ago)
Author:
rvelices
Message:

feature 2541 multisize

  • admin GUI for choosing derivative parameters + persistence
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/include/functions.php

    r12797 r12820  
    20552055
    20562056    case 'configuration':
     2057    case 'derivatives':
    20572058    case 'extend_for_templates':
    20582059    case 'menubar':
     
    22482249}
    22492250
    2250 function clear_derivative_cache($type='all')
     2251/** delete all derivative files for one or several types */
     2252function clear_derivative_cache($types='all')
    22512253{
    22522254  $pattern='#.*-';
    2253   if ($type == 'all')
     2255  if ($types == 'all')
     2256  {
     2257    $types = ImageStdParams::get_all_types();
     2258    $types[] = IMG_CUSTOM;
     2259  }
     2260  elseif (!is_array($types))
     2261  {
     2262    $types = array($types);
     2263  }
     2264
     2265  if (count($types)>1)
    22542266  {
    22552267    $type_urls = array();
    2256     foreach(ImageStdParams::get_all_types() as $dtype)
     2268    foreach($types as $dtype)
    22572269    {
    22582270      $type_urls[] = derivative_to_url($dtype);
    22592271    }
    2260     $type_urls[] = derivative_to_url(IMG_CUSTOM);
    22612272    $pattern .= '(' . implode('|',$type_urls) . ')';
    22622273  }
    22632274  else
    22642275  {
    2265     $pattern .= derivative_to_url($type);
    2266   }
     2276    $pattern .= derivative_to_url($types[0]);
     2277  }
     2278 
    22672279  $pattern.='(_[a-zA-Z0-9]+)*\.[a-zA-Z0-9]{3,4}$#';
    22682280  if ($contents = opendir(PHPWG_ROOT_PATH.PWG_DERIVATIVE_DIR))
     
    23212333      }
    23222334      clearstatcache();
    2323       rmdir($path);
     2335      @rmdir($path);
    23242336    }
    23252337    return $rmdir;
Note: See TracChangeset for help on using the changeset viewer.