summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--htdocs/index.php10
-rw-r--r--utils/modules/icons.php14
2 files changed, 14 insertions, 10 deletions
diff --git a/htdocs/index.php b/htdocs/index.php
index 797f10b..4ca2c36 100644
--- a/htdocs/index.php
+++ b/htdocs/index.php
@@ -58,10 +58,12 @@ foreach($ps as $p) {
?>>
<?php
$menu = $config->value('menu');
-foreach($menu as $_m => $_t) {
- echo " <a href=\"?page=".$_m."\" class=\"menu_entry_".$_m."\"></a>\n";
- echo " <a href=\"?page=".$_m."\" class=\"menutitle\">".$t."</a>\n";
- echo "\n";
+if(sizeof($menu)) {
+ foreach($menu as $_m => $_t) {
+ echo " <a href=\"?page=".$_m."\" class=\"menu_entry_".$_m."\"></a>\n";
+ echo " <a href=\"?page=".$_m."\" class=\"menutitle\">".$t."</a>\n";
+ echo "\n";
+ }
}
?>
</div>
diff --git a/utils/modules/icons.php b/utils/modules/icons.php
index 44df7e9..3a9d716 100644
--- a/utils/modules/icons.php
+++ b/utils/modules/icons.php
@@ -110,13 +110,15 @@ class Icons {
public function Icons($prefix)
{
$this->prefix = $prefix;
- $df = opendir($prefix);
- while(false !== ($file = readdir($df))) {
- if($file == '.' || $file == '..') continue;
- $icon = new Icon($file, $prefix);
- $this->icons[$file] = $icon;
+ if(is_dir($prefix)) {
+ $df = opendir($prefix);
+ while(false !== ($file = readdir($df))) {
+ if($file == '.' || $file == '..') continue;
+ $icon = new Icon($file, $prefix);
+ $this->icons[$file] = $icon;
+ }
+ closedir($df);
}
- closedir($df);
}
}