check for an existing file extension

This commit is contained in:
Uwe Steinmann 2018-11-22 08:06:05 +01:00
parent ff07a141e8
commit 6ceb14cdfd

View File

@ -45,12 +45,13 @@ class SeedDMS_View_Help extends SeedDMS_Bootstrap_Style {
<div class="span4">
<legend>Table of contents</legend>
<?php
$d = dir("../languages/".$this->params['session']->getLanguage()."/help");
$dir = "../languages/".$this->params['session']->getLanguage()."/help";
$d = dir($dir);
echo "<ul>";
while (false !== ($entry = $d->read())) {
if($entry != '..' && $entry != '.') {
$path_parts = pathinfo($dir."/".$entry);
if($path_parts['extension'] == 'html' || $path_parts['extension'] == 'md') {
if(isset($path_parts['extension']) && ($path_parts['extension'] == 'html' || $path_parts['extension'] == 'md')) {
echo "<li><a href=\"../out/out.Help.php?context=".$path_parts['filename']."\">".getMLText('help_'.$path_parts['filename'], array(), $path_parts['filename'])."</a></li>";
}
}