mirror of
https://github.com/nadrad/h-m-m.git
synced 2024-05-20 23:16:32 +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);
|
$lines = file($mm['filename'], FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
unset($mm['filename']);
|
|
||||||
load_empty_map($mm);
|
load_empty_map($mm);
|
||||||
return;
|
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] =
|
$mm['nodes'][1] =
|
||||||
[
|
[
|
||||||
'title'=> basename( $mm['filename'] ?? 'root' )
|
'title'=> $title
|
||||||
,'is_leaf'=>true
|
,'is_leaf'=>true
|
||||||
,'children'=>[]
|
,'children'=>[]
|
||||||
,'collapsed'=>false
|
,'collapsed'=>false
|
||||||
|
|
Loading…
Reference in a new issue