Browse Source

Merge pull request #251 from nigelgbanks/7.x-dir-message

Added a helper function for displaying if the given directory exists.
pull/252/head
Jonathan Green 12 years ago
parent
commit
dc22e80964
  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