Add a site status warning for when dcraw is not installed.
This commit is contained in:
parent
e1a15fbff3
commit
9796ea6ac8
|
@ -23,10 +23,13 @@ class Admin_RawPhoto_Controller extends Admin_Controller {
|
|||
}
|
||||
|
||||
private function _get_view($errors = array(), $icc_path = null) {
|
||||
$dcraw = rawphoto_graphics::detect_dcraw();
|
||||
rawphoto_graphics::report_dcraw_support($dcraw);
|
||||
|
||||
$view = new Admin_View("admin.html");
|
||||
$view->content = new View("admin_rawphoto.html");
|
||||
$view->content->is_keeporiginal_active = module::is_active("keeporiginal");
|
||||
$view->content->dcraw = rawphoto_graphics::detect_dcraw();
|
||||
$view->content->dcraw = $dcraw;
|
||||
$toolkit_names = array("imagemagick" => "ImageMagick",
|
||||
"graphicsmagick" => "GraphicsMagick");
|
||||
$toolkit_id = module::get_var("gallery", "graphics_toolkit");
|
||||
|
|
|
@ -44,6 +44,17 @@ class rawphoto_graphics {
|
|||
"graphicsmagick" => "GraphicsMagick");
|
||||
}
|
||||
|
||||
static function report_dcraw_support($dcraw) {
|
||||
if ($dcraw->installed) {
|
||||
site_status::clear("rawphoto_needs_dcraw");
|
||||
} else {
|
||||
site_status::warning(
|
||||
t('The Raw Photos module requires the <a href="%dcraw_url">dcraw</a> tool to be installed.',
|
||||
array("dcraw_url" => "http://www.cybercom.net/~dcoffin/dcraw/")),
|
||||
"rawphoto_needs_dcraw");
|
||||
}
|
||||
}
|
||||
|
||||
static function report_ppm_support($toolkit_id) {
|
||||
if (array_key_exists($toolkit_id, self::get_supported_toolkits())) {
|
||||
site_status::clear("rawphoto_needs_ppm_support");
|
||||
|
|
|
@ -23,11 +23,14 @@ class rawphoto_installer {
|
|||
}
|
||||
|
||||
static function activate() {
|
||||
$dcraw = rawphoto_graphics::detect_dcraw()
|
||||
rawphoto_graphics::report_dcraw_support($dcraw);
|
||||
$toolkit_id = module::get_var("gallery", "graphics_toolkit");
|
||||
rawphoto_graphics::report_ppm_support($toolkit_id);
|
||||
}
|
||||
|
||||
static function deactivate() {
|
||||
site_status::clear("rawphoto_needs_dcraw");
|
||||
site_status::clear("rawphoto_needs_ppm_support");
|
||||
}
|
||||
}
|
||||
|
|
Reference in New Issue
Block a user