function delete_cachefiles_for_preset($preset_id) { $cache_files = get_cachefiles_for_preset($preset_id); foreach ($cache_files as $cache_file) { unlink('../usr/cache/' . $cache_file); } }
<tr><th><?php echo L_PRESETEDITOR_ID; ?> </th><th><?php echo L_NAME; ?> </th><th><?php echo L_PRESETEDITOR_CACHE_SIZE; ?> </th><th></th></tr> </thead> <tbody> <?php foreach ($config_preset as $preset_id => $settings) { if (isset($settings['cache']) && $settings['cache']) { $cachefiles = get_cachefiles_for_preset($preset_id); $cachesize = 0; foreach ($cachefiles as $cachefile) { $cachesize += filesize('../usr/cache/' . $cachefile); } $cachesize = round($cachesize / 1000) . 'KB'; } else { $cachesize = ''; } if (!isset($settings['cacheable']) || $settings['cacheable']) { $cache_link = '<a href="preset_editor.php?' . SIDX . '&preset=' . $preset_id . '&cache=' . ($settings['cache'] ? '0' : '1') . '">'; if ($settings['cache']) { $cache_image = '<img src="img/cached.png" title="' . L_PRESETEDITOR_CACHE_NOT . '" alt="' . L_PRESETEDITOR_CACHE_NOT . '" />'; } else { $cache_image = '<img src="img/cache.png" title="' . L_PRESETEDITOR_CACHE . '" alt="' . L_PRESETEDITOR_CACHE . '" />'; }