-
Notifications
You must be signed in to change notification settings - Fork 3
/
elfinder.php
186 lines (168 loc) · 4.69 KB
/
elfinder.php
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
<?php
/**
* @file elfinder.php
* @brief Containing Elfinder class.
*
* Elfinder plugin elfinder.php
*
* @author David Stutz
* @version 1.0.0
* @license GPLv3
* @package elfinder
* @see http://sourceforge.net/projects/cmsimplepictures/
*
* This file is part of the elfinder filebrowser plugin for CMSimple.
*
* The plugin is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* The plugin is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* @see <http://www.gnu.org/licenses/>.
*/
/*! \mainpage CMSimple Elfinder Filebrowser
*
* This plugin provides the Elfinder filebrowser for usage in your CMSimple installation.
*
* This is a generated documentation of the plugin.
*
* \mainpage
*/
/**
* @class Elfinder
*
* Elfinder class for generla informartion and script including.
*
* @author David Stutz
* @since 1.0.0
* @package elfinder
*/
class Elfinder {
/**
* Current version.
*
* @var <string>
*/
const VERSION = '1.0.0beta1';
/**
* @static
* @public
* Get plugin's name.
*
* @return <string> name
*/
static function name()
{
return "Elfinder filebrowser plugin.";
}
/**
* @static
* @public
* Get plugin's release date.
*
* @return <string> release date.
*/
static function release_date()
{
return "27th October 2014";
}
/**
* @static
* @public
* Get plugin's author.
*
* @return <string> author.
*/
static function author()
{
return "David Stutz";
}
/**
* @static
* @public
* Get plugin's website.
*
* @return <string> website link
*/
static function github()
{
return '<a href="https://github.com/davidstutz/cmsimple-elfinder" target="_blank">GitHub Repository</a>';
}
/**
* @static
* @public
* Get plugin's description.
*
* @return <string> description
*/
static function description()
{
return 'Elfinder filebrowser plugin.';
}
/**
* @static
* @public
* Legal notes on elfinder.
*
* @return <string> legal
*/
static function legal()
{
return '<q>elFinder is an open-source file manager for web, written in JavaScript using jQuery UI. As you can see its creation is inspired by simplicity and convenience of Finder program used in Mac OS X operating system.</q><br />'
.'For more information see: <a href="https://github.com/Studio-42/elFinder" target="_blank">elFinder Website</a><br />'
.'elFinder license: BSD - see <a href="http://en.wikipedia.org/wiki/BSD_licenses">Wikipedia</a><br />'
.'JQuery and JQuery-UI license: MIT and GPL - see <a href="http://en.wikipedia.org/wiki/MIT_License">Wikipedia MIT License</a> - <a href="http://en.wikipedia.org/wiki/Gpl">Wikipedia MIT License</a><br />';
}
/**
* @static
* @public
* Include jquery.
*
* @global hjs
* @global pth
* @global plugin
*
*/
public static function include_jquery()
{
global $pth, $plugin, $hjs;
$plugin = basename(dirname(__FILE__),"/");
static $jquery_included = FALSE;
if (!$jquery_included)
{
$hjs .= '<script src="'.$pth['folder']['plugins'] . $plugin . '/jquery/js/jquery-1.7.1.min.js" type="text/javascript"></script>';
$hjs .= '<script src="'.$pth['folder']['plugins'] . $plugin . '/jquery/js/jquery-ui-1.8.13.custom.min.js" type="text/javascript"></script>';
$jquery_included = TRUE;
}
}
/**
* @static
* @public
* Init elfinder.
*
* @global pth
* @global plugin
* @global hjs
* @global sl
*/
public static function include_elfinder()
{
global $pth, $plugin, $hjs, $sl;
$plugin = basename(dirname(__FILE__),"/");
static $elfinder_included = FALSE;
if (!$elfinder_included)
{
$hjs .= '<link rel="stylesheet" href="' . $pth['folder']['plugins']. 'elfinder/elfinder/css/elfinder.css" type="text/css" media="screen" charset="utf-8">';
$hjs .= '<link rel="stylesheet" href="' . $pth['folder']['plugins']. 'elfinder/elfinder/css/theme.css" type="text/css" media="screen" charset="utf-8">';
$hjs .= '<script src="' . $pth['folder']['plugins'] . 'elfinder/elfinder/js/elfinder.min.js" type="text/javascript" charset="utf-8"></script>';
$hjs .= '<script src="' . $pth['folder']['plugins'] . 'elfinder/elfinder/js/i18n/elfinder.' . $sl . '.js" type="text/javascript" charset="utf-8"></script>';
$hjs .= '<script src="' . $pth['folder']['plugins'] . 'elfinder/init.js" type="text/javascript"></script>';
$elfinder_included = TRUE;
}
}
}