function advagg_validator_admin_test_advagg_css_directory_submit

cis7 advagg_validator.admin.inc advagg_validator_admin_test_advagg_css_directory_submit($form, &$form_state)
cle7 advagg_validator.admin.inc advagg_validator_admin_test_advagg_css_directory_submit($form, &$form_state)
elmsmedia7 advagg_validator.admin.inc advagg_validator_admin_test_advagg_css_directory_submit($form, &$form_state)
icor7 advagg_validator.admin.inc advagg_validator_admin_test_advagg_css_directory_submit($form, &$form_state)
meedjum_blog7 advagg_validator.admin.inc advagg_validator_admin_test_advagg_css_directory_submit($form, &$form_state)
mooc7 advagg_validator.admin.inc advagg_validator_admin_test_advagg_css_directory_submit($form, &$form_state)

Display file info in a drupal message.

File

sites/all/modules/ulmus/advagg/advagg_validator/advagg_validator.admin.inc, line 284
Admin page callbacks for the advagg validator module.

Code

function advagg_validator_admin_test_advagg_css_directory_submit($form, &$form_state) {
  if (!empty($form_state['input']['ajax_page_state']) || empty($form_state['values']['op']) || strpos($form_state['values']['op'], t('Check this Directory:')) !== 0) {
    return;
  }
  module_load_include('inc', 'advagg_validator', 'advagg_validator');

  $dir = trim(substr($form_state['values']['op'], strpos($form_state['values']['op'], ':') + 1));
  $slash_count = substr_count('/' . $dir, '/');

  // Get list of files.
  $files = array();
  foreach ($form_state['values'] as $key => $value) {
    if (strpos($key, 'hidden') === FALSE || strpos($value, $dir) === FALSE || substr_count($value, '/') > $slash_count || ($dir == '.' && substr_count($value, '/') > 0)) {
      continue;
    }
    $files[] = $value;
  }

  // Check list.
  $info = advagg_validator_test_css_files($files);
  $info = advagg_validator_admin_hide_good_files($info);
  if (module_exists('httprl')) {
    $output = httprl_pr($info);
  }
  else {
    $output = '<pre>' . check_plain(print_r($info, TRUE)) . '</pre>';
  }
  // @ignore security_dsm
  drupal_set_message($output);
}