-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfilemanager.php
More file actions
executable file
·113 lines (113 loc) · 3.94 KB
/
filemanager.php
File metadata and controls
executable file
·113 lines (113 loc) · 3.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<?php
/**
* @package Flatnux
* @author Alessandro Vernassa <speleoalex@gmail.com>
* @copyright Copyright (c) 1011
* @license http://opensource.org/licenses/gpl-license.php GNU General Public License
*/
global $_FN;
$_FN=array();
include "./include/flatnux.php";
header("Content-Type: text/html; charset={$_FN['charset_page']}");
$sess_filemanager_editor=FN_GetParam("filemanager_editor",$_GET,"html");
$sess_filemanager_editor=basename($sess_filemanager_editor);
if (strstr($sess_filemanager_editor,"..") || strstr($sess_filemanager_editor,'/') || strstr($sess_filemanager_editor,'\\'))
$sess_filemanager_editor=basename($sess_filemanager_editor);
?><!DOCTYPE html>
<html><head>
<link rel='StyleSheet' type='text/css' href="modules/filemanager/style.css?v2" />
<meta name="viewport" content="initial-scale = 1.0, maximum-scale = 1.0, user-scalable = no, width = device-width">
<style>
html, body { height: 100% }
* {
font-family: Verdana, Arial;
font-size: 12px;
margin: 0px;
padding: 0px;
}
td {
font: 12px Arial, Helvetica, sans-serif;
}
form {
font: 12px Arial, Helvetica, sans-serif;
}
body {
background-color: #ffffff;
color: #000000;
margin: 0px;
padding: 0px;
top:0px;
left:0px;
}
a {
text-decoration: none;
color: #000000;
}
a:hover {
text-decoration: underline;
}
form {
border: 0px;
}
</style>
<script type="text/javascript">
function check(url)
{
if (confirm("<?php echo FN_i18n("are you sure you want to do it?")?>"))
window.location = url;
}
</script>
<title>Filemanager</title>
</head>
<?php
if ($sess_filemanager_editor!= "" && file_exists("include/htmleditors/$sess_filemanager_editor/filemanager.php"))
{
include ("include/htmleditors/$sess_filemanager_editor/filemanager.php");
}
else
{
echo "<body>";
$opener=FN_GetParam("opener",$_GET);
echo "
<script type=\"text/javascript\" >
// function called by the filemanager when the file is selected
function insertElement(URL) {
";
if ($opener!= "")
{
echo "
try{
window.opener.document.getElementById('$opener').value = URL;
}catch (e){alert(e)}";
}
echo "window.close();
}
</script>
";
echo FN_HtmlContent("modules/filemanager/");
$mime=FN_GetParam("mime",$_GET,"html");
$dir=FN_GetParam("dir",$_GET,"html");
$dir=FN_RelativePath($dir);
if (!empty($_GET['linklocalfs']) && empty($_GET['opmod']))
{
echo "<button onclick=\"insertElement('$dir"."')\" >".FN_i18n("insert")."</button>";
}
if (!empty($_GET['linklocalpages']) && empty($_GET['opmod']))
{
$html="<div style=\"position:absolute;bottom:0px;\">".FN_i18n("link to local page",false,"Aa").": <select id=\"sectionstree\" >";
$sections=FN_GetSections(false,true,true,true,true);
//sort sections --------------------------------------------------------------->
$sections=FNCC_SortSectionsByTree("",$sections);
//sort sections ---------------------------------------------------------------<
foreach($sections as $section)
{
$margin=(count($section['path']) * 10)."px";
$html.="<option title=\"".htmlspecialchars($section['title'])."\" style=\"font-size:10px;width:200px;overflow:hidden;padding-left:$margin;\" value=\"{$_FN['siteurl']}index.php?mod={$section['id']}\" >".htmlspecialchars($section['title'])."</option>";
}
$html.="</select>";
echo "$html<button onclick=\"insertElement(document.getElementById('sectionstree').options[document.getElementById('sectionstree').selectedIndex].value)\">".FN_i18n("insert")."</button>";
echo "</div>";
}
echo "</body>";
}
?></html>