function advagg_validator_admin_test_advagg_css_directory_callback

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

Display file info via ajax callback.

File

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

Code

function advagg_validator_admin_test_advagg_css_directory_callback($form, &$form_state) {
  if (empty($form_state['values']['op']) || strpos($form_state['values']['op'], t('Check this Directory:')) !== 0) {
    return '<div></div>';
  }
  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);
  if (empty($info)) {
    return '<div id="' . $wrapper . '" class="results"></div>';
  }
  $info = advagg_validator_admin_hide_good_files($info);
  if (module_exists('httprl')) {
    $output = httprl_pr($info);
  }
  else {
    $output = '<pre>' . print_r($info, TRUE) . '</pre>';
  }

  $form_api_dirname = str_replace(array('/', '.'), array('__', '--'), $dir);
  $wrapper = 'advagg-validator-css-validator-ajax' . $form_api_dirname;
  return '<div id="' . $wrapper . '" class="results">' . $output . '</div>';
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.