Skip to content

Commit

Permalink
version 1.1.0
Browse files Browse the repository at this point in the history
- updated plupload to 3.1.5
- updated docs
  • Loading branch information
richard-keasley committed Feb 7, 2023
1 parent 16d61c8 commit 946b5e6
Show file tree
Hide file tree
Showing 96 changed files with 20,180 additions and 201 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ Simple File Manager for website content, compatible with Tiny MCE.
- *jQuery:* Include the UI style sheet. No ui components are used directly by FileMan.
- *plupload:* Plupload is included in the plug-in add_file. It can be replaced if you want. Plupload uses jQuery and jQuery-ui.
- *icomoon font:* IcoMoon font is used to create icons.

21 changes: 17 additions & 4 deletions add_file.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
var url = fm_settings.url + '/plupload'
FileMan.head.push(['script', {type:'text/javascript', charset:'UTF-8', src: url+'/plupload.full.min.js'}]);
FileMan.head.push(['script', {type:'text/javascript', charset:'UTF-8', src: url+'/jquery.plupload.queue.min.js'}]);
FileMan.head.push(['link', {type:'text/css', rel:'stylesheet', href: url+'/css/jquery.plupload.queue.css'}]);
// plupload
var url = fm_settings.url + '/plupload-3.1.5/js'
FileMan.head.push(['script', {
type:'text/javascript',
charset:'UTF-8',
src: url + '/plupload.full.min.js'
}]);
FileMan.head.push(['script', {
type:'text/javascript',
charset:'UTF-8',
src: url + '/jquery.plupload.queue/jquery.plupload.queue.min.js'
}]);
FileMan.head.push(['link', {
type:'text/css',
rel:'stylesheet',
href: url + '/jquery.plupload.queue/css/jquery.plupload.queue.css'
}]);

const dlg_add_file = {
selector: false,
Expand Down
7 changes: 7 additions & 0 deletions docs/_foot.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<footer>
<nav>
<a class="icon-undo ui-button ui-corner-all ui-widget" href="." role="button">home</a>
</nav>
</footer>
</body>
</html>
14 changes: 14 additions & 0 deletions docs/_head.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="description" content="FileMan File Manager">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="Richard Keasley">
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js"></script>
<link href="https://code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.css" rel="stylesheet" type="text/css" media="all">
<link href="../icomoon/style.css" rel="stylesheet" type="text/css" media="all">
<title>FileMan</title>
</head>
<body>
109 changes: 49 additions & 60 deletions docs/index.htm → docs/index.php
Original file line number Diff line number Diff line change
@@ -1,60 +1,49 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="description" content="FileMan File Manager">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="Richard Keasley">
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js"></script>
<link href="https://code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.css" rel="stylesheet" type="text/css" media="all">
<link href="../icomoon/style.css" rel="stylesheet" type="text/css" media="all">
<title>FileMan</title>
</head>
<body>
<h1>FileMan</h1>

<h2>installation</h2>
<p>Copy the entire folder. Make sure it sits within your Website root path.</p>
<p>Plug-ins can be included as <code>(command).js</code>. There may be other helper files associated with the plug-in. They should all be named <code>(command)*</code>. <strong>Example:</strong> <code>add_file.js</code>, <code>add_file.php</code> are used to run the command "add_file".</p>
<p>You need to create <a href="settings.htm">fileman.settings.php</a> for your application.</p>

<h2>Dependencies</h2>
<dl>
<dt>PHP</dt>
<dd>Nothing extreme</dd>
<dt>jQuery<dt>
<dd>Including the UI style sheet. No ui components are used directly by FileMan. The Plupload queue widget relies on jQuery and jQuery-ui.</dd>
<dt>plupload<dt>
<dd><a href="https://www.plupload.com/">Plupload (Queue widget)</a> is used as (<code>add_file</code>). It can be replaced if you want.</dd>
<dt>icomoon font</dt>
<dd><a href="https://icomoon.io/">IcoMoon font</a> is used to create icons. <a href="../icomoon/">View the icon set</a>.</dd>
</dl>

<h2>Implementation</h2>
<ul>
<li>Include the main <code>include.php</code></li>
<li>Put the containing elements in</li>
<li>Use jQuery to initialize the FileMan</li>
</ul>
<p>Plug-ins appear as buttons in the button bar. Note plug-in elements are not loaded until the corresponding button is clicked.</p>
<p>The file manager is set up with the "init" method: <code>FileMan.init(selector=0, fm_path='', filter='')</code>. Leave all values blank for the default popup to be created.</p>
<dl>
<dt>selector (string)</dt>
<dd>String to describe element. This will be used as a jQuery object <code>$(selector)</code>. Leave it blank for default pop-up dialog.</dd>
<dt>fm_path (string)</dt>
<dd>The start path for FileMan. Note: This path is relative to <code>fm_root</code> in settings. Leave it blank for <code>fm_root</code>.</dt>
<dt>filter (string)</dt>
<dd>The filter to use for FileMan (including uploads). NB: This should be one of the <code>upload_types</code> in settings. Leave it blank to show all files. Note: Even if there is no filter, you can only upload file types registered in <code>upload_types</code>.</dd>
</dl>

<h2>Examples</h2>
<ul>
<li><a href="simple.php">Simple</a></li>
<li><a href="popup1.php">Dialog</a></li>
<li><a href="popup2.php">Dialog with start path and filter</a></li>
<li><a href="tiny.php">TinyMCE integration for images</a></li>
</ul>

</body>
</html>
<?php include __DIR__ . '/_head.php';?>
<h1>FileMan</h1>

<h2>installation</h2>
<p>Copy the entire folder. Make sure it sits within your Website root path.</p>
<p>Plug-ins can be included as <code>(command).js</code>.
There may be other helper files associated with the plug-in.
They should all be named <code>(command)*</code>.
<strong>Example:</strong> <code>add_file.js</code>, <code>add_file.php</code> are used to run the command "add_file".</p>
<p>You need to create <a href="settings.php">fileman.settings.php</a> for your application.</p>

<h2>Dependencies</h2>
<dl>
<dt>PHP</dt>
<dd>Nothing extreme</dd>
<dt>jQuery<dt>
<dd>Including the UI style sheet. No ui components are used directly by FileMan. The Plupload queue widget relies on jQuery and jQuery-ui.</dd>
<dt>plupload<dt>
<dd><a href="https://www.plupload.com/">Plupload (Queue widget)</a> is used as (<code>add_file</code>). It can be replaced if you want.</dd>
<dt>icomoon font</dt>
<dd><a href="https://icomoon.io/">IcoMoon font</a> is used to create icons. <a href="../icomoon/">View the icon set</a>.</dd>
</dl>

<h2>Implementation</h2>
<ul>
<li>Include the main <code>include.php</code></li>
<li>Put the containing elements in</li>
<li>Use jQuery to initialize the FileMan</li>
</ul>
<p>Plug-ins appear as buttons in the button bar. Note plug-in elements are not loaded until the corresponding button is clicked.</p>
<p>The file manager is set up with the "init" method: <code>FileMan.init(selector=0, fm_path='', filter='')</code>. Leave all values blank for the default popup to be created.</p>
<dl>
<dt>selector (string)</dt>
<dd>String to describe element. This will be used as a jQuery object <code>$(selector)</code>. Leave it blank for default pop-up dialog.</dd>
<dt>fm_path (string)</dt>
<dd>The start path for FileMan. Note: This path is relative to <code>fm_root</code> in settings. Leave it blank for <code>fm_root</code>.</dt>
<dt>filter (string)</dt>
<dd>The filter to use for FileMan (including uploads). NB: This should be one of the <code>upload_types</code> in settings. Leave it blank to show all files. Note: Even if there is no filter, you can only upload file types registered in <code>upload_types</code>.</dd>
</dl>

<h2>Examples</h2>
<ul>
<li><a href="simple.php">Simple</a></li>
<li><a href="popup1.php">Dialog</a></li>
<li><a href="popup2.php">Dialog with start path and filter</a></li>
<li><a href="tiny.php">TinyMCE integration for images</a></li>
</ul>

<?php include __DIR__ . '/_foot.php';
27 changes: 3 additions & 24 deletions docs/popup1.php
Original file line number Diff line number Diff line change
@@ -1,19 +1,6 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="description" content="FileMan">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="Richard Keasley">
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js"></script>
<link href="https://code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.css" rel="stylesheet" type="text/css" media="all">
<link href="../icomoon/style.css" rel="stylesheet" type="text/css" media="all">
<title>FileMan - popup 1</title>
</head>
<body>
<?php include __DIR__ . '/_head.php';?>

<h1>FileMan - popup 1</h1>
<p class="nav"><a class="icon-undo" href=".">back</a></p>
<h2>Dialog</h2>

<?php include_once dirname(__DIR__) . '/include.php';?>
Expand Down Expand Up @@ -51,12 +38,4 @@
});
&lt;/script&gt;
</pre>

<p class="nav"><a class="icon-undo" href=".">back</a></p>
<script>
$(function() {
$('.nav .icon-undo').button();
});
</script>
</body>
</html>
<?php include __DIR__ . '/_foot.php';
24 changes: 3 additions & 21 deletions docs/popup2.php
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="description" content="FileMan">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="Richard Keasley">
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js"></script>
<link href="https://code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.css" rel="stylesheet" type="text/css" media="all">
<link href="../icomoon/style.css" rel="stylesheet" type="text/css" media="all">
<?php include __DIR__ . '/_head.php';?>

<title>FileMan - popup 2</title>
</head>
<body>
<h1>FileMan - popup 2</h1>
<p class="nav"><a class="icon-undo" href=".">back</a></p>
<h2>Dialog with start folder and filter</h2>

<?php include_once dirname(__DIR__) . '/include.php';?>
Expand Down Expand Up @@ -51,12 +41,4 @@
});
&lt;/script&gt;
</pre>

<p class="nav"><a class="icon-undo" href=".">back</a></p>
<script>
$(function() {
$('.nav .icon-undo').button();
});
</script>
</body>
</html>
<?php include __DIR__ . '/_foot.php';
20 changes: 4 additions & 16 deletions docs/settings.htm → docs/settings.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="description" content="FileMan File Manager">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="Richard Keasley">
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js"></script>
<link href="https://code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.css" rel="stylesheet" type="text/css" media="all">
<link href="../icomoon/style.css" rel="stylesheet" type="text/css" media="all">
<title>FileMan - settings</title>
</head>
<body>
<?php include __DIR__ . '/_head.php';?>

<h1>FileMan - settings</h1>

<p>FileMan will attempt to load <code>../fileman.settings.php</code>. You can create the settings file from the template <code>fileman.settings.php</code>. Save this in the <strong>parent folder</strong> of FileMan. If no settings file is found, FileMan will return the following message:</p>
Expand Down Expand Up @@ -66,5 +54,5 @@ <h3>Settings</h3>
fm_settings::$upload_types['image'] = 'jpg,gif,png';
fm_settings::$upload_types['pdf'] = 'pdf';
</pre>
</body>
</html>

<?php include __DIR__ . '/_foot.php';
26 changes: 3 additions & 23 deletions docs/simple.php
Original file line number Diff line number Diff line change
@@ -1,19 +1,6 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="description" content="FileMan File Manager">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="Richard Keasley">
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js"></script>
<link href="https://code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.css" rel="stylesheet" type="text/css" media="all">
<link href="../icomoon/style.css" rel="stylesheet" type="text/css" media="all">
<title>FileMan - simple</title>
</head>
<body>
<?php include __DIR__ . '/_head.php';?>

<h1>FileMan - simple</h1>
<p class="nav"><a class="icon-undo" href=".">back</a></p>
<h2>Simple element on the page.</h2>

<?php include_once dirname(__DIR__) . '/include.php';?>
Expand All @@ -34,11 +21,4 @@
&lt;/script&gt;
</pre>

<p class="nav"><a class="icon-undo" href=".">back</a></p>
<script>
$(function() {
$('.nav .icon-undo').button();
});
</script>
</body>
</html>
<?php include __DIR__ . '/_foot.php';
26 changes: 3 additions & 23 deletions docs/tiny.php
Original file line number Diff line number Diff line change
@@ -1,19 +1,6 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="description" content="FileMan File Manager">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="Richard Keasley">
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js"></script>
<link href="https://code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.css" rel="stylesheet" type="text/css" media="all">
<link href="../icomoon/style.css" rel="stylesheet" type="text/css" media="all">
<title>FileMan - TinyMCE</title>
</head>
<body>
<?php include __DIR__ . '/_head.php';?>

<h1>FileMan - TinyMCE</h1>
<p class="nav"><a class="icon-undo" href=".">back</a></p>
<h2>TinyMCE integration for inserting images / downloads into HTML</h2>

<textarea class="html"></textarea>
Expand Down Expand Up @@ -70,11 +57,4 @@
&lt;/script&gt;
</pre>

<p class="nav"><a class="icon-undo" href=".">back</a></p>
<script>
$(function() {
$('.nav .icon-undo').button();
});
</script>
</body>
</html>
<?php include __DIR__ . '/_foot.php';
22 changes: 12 additions & 10 deletions get_dir.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,32 +79,34 @@ static function check_access($function) {

static function get_settings() {
self::check_access(__FUNCTION__);
$list = array(
echo '<ul>';
$list = [
'version' => fm_settings::version,
'released' => fm_settings::released,
'web_root' => fm_settings::$url_root,
'file_manager_root' => fm_settings::$fm_root,
'file_manager_url' => fm_settings::url(),
'max_file_size' => fm_settings::$max_file_size,
'upload_types' => fm_settings::$upload_types,
'perms' => implode(', ', fm_settings::$perms)
);

echo '<ul>';
];
foreach($list as $key=>$item) {
echo "<li><strong>$key:</strong> ";
echo "<li><strong>{$key}:</strong> ";
if(is_array($item)) {
echo '<ul>';
foreach($item as $subkey=>$subitem) echo "<li><strong>$subkey:</strong> $subitem</li>";
foreach($item as $subkey=>$subitem) echo "<li><strong>{$subkey}:</strong> {$subitem}</li>";
echo '</ul>';
}
else echo $item;
echo "</li>";
}

echo '</ul>';
$include = dirname($list['file_manager_url']) . '/fileman.settings.php';
echo <<<EOT
$include = dirname($list['file_manager_url']) . '/fileman.settings.php';
echo <<<EOT
<hr>
<p>Modify settings in <code>$include</code>.</p>
<p><a href="$list[file_manager_url]/docs/" target="docs">Read how to setup</a></p>
<p>Modify settings in <code>{$include}</code>.</p>
<p><a href="{$list['file_manager_url']}/docs/" target="docs">Read how to setup</a></p>
EOT;
get_dir_die(0, 'done');
}
Expand Down
1 change: 1 addition & 0 deletions plupload-3.1.5/SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Tiny values the work of security researchers in improving the security of technology products worldwide. We welcome researchers who wish to responsibly disclose vulnerabilities in our products or systems. Note that we do not offer any “bug bounty” program or any form of payment for disclosed vulnerabilities. If you would like to report a vulnerability, please email infosec@tiny.cloud.
Loading

0 comments on commit 946b5e6

Please sign in to comment.