diff options
author | nachoparker <nacho@ownyourbits.com> | 2019-01-07 03:58:41 +0300 |
---|---|---|
committer | nachoparker <nacho@ownyourbits.com> | 2019-01-07 04:43:09 +0300 |
commit | 1a056212f17a20cbfccb6a68fb7439088128d352 (patch) | |
tree | c1c3a27051566f5edf27740f7a6391f12e302ba2 /ncp-web/elements.php | |
parent | bda1fc468d072c9cf94ef55dc4febd597b22748b (diff) |
ncp-web: file type and case insensitive search
Diffstat (limited to 'ncp-web/elements.php')
-rw-r--r-- | ncp-web/elements.php | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/ncp-web/elements.php b/ncp-web/elements.php index 0541db93..ab475784 100644 --- a/ncp-web/elements.php +++ b/ncp-web/elements.php @@ -36,7 +36,7 @@ HTML; $class = ''; if (array_key_exists('type', $param) && ($param['type'] == 'directory' || $param['type'] == 'file')) - $class = 'path'; + $class = $param['type']; $ret .= "<td> <input type=\"text\" @@ -54,9 +54,19 @@ HTML; if (array_key_exists('type', $param) && $param['type'] == 'directory') { if (file_exists($param['value'])) - $ret .= " <span class=\"ok-field\">directory exists</span>"; + $ret .= " <span class=\"ok-field\">path exists</span>"; else - $ret .= " <span class=\"error-field\">directory doesn't exist</span>"; + $ret .= " <span class=\"error-field\">path doesn't exist</span>"; + } + + if (array_key_exists('type', $param) && $param['type'] == 'file') + { + error_log($param['value']); + error_log(dirname($param['value'])); + if (file_exists(dirname($param['value']))) + $ret .= " <span class=\"ok-field\">path exists</span>"; + else + $ret .= " <span class=\"error-field\">path doesn't exist</span>"; } $ret .= "</td>"; |