Use message:warning to display a warning message if graphviz is not installed
This commit is contained in:
parent
c77a792f61
commit
8e4dc39e33
@ -115,9 +115,13 @@ class Admin_Developer_Controller extends Admin_Controller {
|
||||
$v->content = new View("mptt_tree.html");
|
||||
|
||||
$v->content->tree = $this->_build_tree();
|
||||
|
||||
$v->content->url = exec("which /usr/bin/dot") ? url::site("admin/developer/mptt_graph") : null;
|
||||
|
||||
if (exec("which /usr/bin/dot")) {
|
||||
$v->content->url = url::site("admin/developer/mptt_graph");
|
||||
} else {
|
||||
$v->content->url = null;
|
||||
message::warning(t("The package 'graphviz' is not installed, degrading to text view"));
|
||||
}
|
||||
print $v;
|
||||
}
|
||||
|
||||
|
@ -5,7 +5,6 @@
|
||||
</h2>
|
||||
<div id="gMPTT">
|
||||
<? if (empty($url)): ?>
|
||||
<p class="gWarning"><?= t("The package 'graphviz' is not installed, degrading to text view") ?></p>
|
||||
<pre><?= $tree ?></pre>
|
||||
<? else: ?>
|
||||
<object type="image/svg+xml" data="<?= $url ?>" ><pre><?= $tree ?></pre></object>
|
||||
|
Reference in New Issue
Block a user