mirror of
https://github.com/nadrad/h-m-m.git
synced 2024-06-15 04:55:00 +02:00
name fix for non-existing filename as argument
This commit is contained in:
parent
44a7ab6b82
commit
17b9cec51b
7
h-m-m
7
h-m-m
|
@ -470,7 +470,6 @@ function load_file(&$mm)
|
|||
$lines = file($mm['filename'], FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
|
||||
else
|
||||
{
|
||||
unset($mm['filename']);
|
||||
load_empty_map($mm);
|
||||
return;
|
||||
}
|
||||
|
@ -2528,9 +2527,13 @@ function load_empty_map(&$mm)
|
|||
]
|
||||
;
|
||||
|
||||
$title = basename( $mm['filename'] ?? 'root' );
|
||||
if (substr($title,-4)=='.hmm')
|
||||
$title = substr($title,0,-4);
|
||||
|
||||
$mm['nodes'][1] =
|
||||
[
|
||||
'title'=> basename( $mm['filename'] ?? 'root' )
|
||||
'title'=> $title
|
||||
,'is_leaf'=>true
|
||||
,'children'=>[]
|
||||
,'collapsed'=>false
|
||||
|
|
Loading…
Reference in a new issue