You are here

function _mobile_codes_presets_flush in Mobile Codes 5

Same name and namespace in other branches
  1. 6 mobile_codes.admin.inc \_mobile_codes_presets_flush()
2 calls to _mobile_codes_presets_flush()
mobile_codes_presets_form_submit in ./mobile_codes.admin.inc
_mobile_codes_preset_delete in ./mobile_codes.admin.inc

File

./mobile_codes.admin.inc, line 287

Code

function _mobile_codes_presets_flush($pid) {
  if (variable_get('mobile_codes_flush', 1) == 1) {
    drupal_set_message(t('Flushed Preset Images (ID: @pid)', array(
      '@pid' => $pid,
    )));
    $dir = realpath(file_directory_path() . '/mobile_codes/' . $pid);
    if (is_dir($dir)) {
      _mobile_codes_recursive_delete($dir);
    }
    db_query('DELETE FROM {mobile_codes} where pid = %d', $pid);
  }
}