1
0

Use message:warning to display a warning message if graphviz is not installed

This commit is contained in:
Tim Almdal 2009-03-17 05:06:24 +00:00
parent c77a792f61
commit 8e4dc39e33
2 changed files with 6 additions and 3 deletions

View File

@ -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;
}

View File

@ -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>