Browse Source

Added a helper function for displaying if the given directory exists.

This can be used in admin setting forms and else where to indicate if the given
directory exists.
pull/251/head
Nigel Banks 12 years ago
parent
commit
370532007a
  1. 22
      includes/utilities.inc

22
includes/utilities.inc

@ -515,3 +515,25 @@ function islandora_executable_available_message($path, $version = NULL, $require
}
return $image . $message;
}
/**
* Create a message stating if the given directory exists.
*
* @param string $path
* The absolute path to an executable to check for availability.
*
* @return string
* A message in HTML detailing if the given directory is exists.
*/
function islandora_directory_exists_message($path) {
$available = is_dir($path);
if ($available) {
$image = theme_image(array('path' => 'misc/watchdog-ok.png', 'attributes' => array()));
$message = t('Directory found at @path', array('@path' => $path));
}
else {
$image = theme_image(array('path' => 'misc/watchdog-error.png', 'attributes' => array()));
$message = t('Unable to locate directory at @path', array('@path' => $path));
}
return $image . $message;
}

Loading…
Cancel
Save