updated elysia_cron, elfinder, metatag, libraries, email_registration, migrate, nodeform_cols
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
2.x-dev
|
||||
-------
|
||||
- Now requires elFinder 2.0.9+
|
||||
- Now requires elFinder 2.0.9+ or 2.1.38+
|
||||
- Added multiple root directories support
|
||||
- Added Drupal file_managed table synchronization
|
||||
- Added per-role configurable profiles support
|
||||
@@ -8,4 +8,7 @@
|
||||
- Added CKEditor and FCKeditor Upload tab support
|
||||
- New library search algoritm with install profiles and multiple sites support
|
||||
- Search support
|
||||
- Inline preview support for PSD, md, html, office docs (by Google/Microsoft online tools), CAD (by sharecad.org online tools), etc (disabled by default, be careful)
|
||||
- Auto fit window
|
||||
- File owner available in list view
|
||||
|
||||
|
@@ -1,339 +1,14 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
elFinder Integration
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
Copyright (c) 2010-2018, Alexey Sukhotin. All rights reserved.
|
||||
|
||||
Preamble
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
3. Neither the name of the Alexey Sukhotin nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program 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 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program 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.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License.
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL "ALEXEY SUKHOTIN" OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
@@ -1,83 +1,79 @@
|
||||
elFinder file manager integration module for Drupal
|
||||
===================================================
|
||||
|
||||
System Requirements:
|
||||
|
||||
- Drupal 7.x
|
||||
- elFinder 2.0.9+
|
||||
|
||||
Note: elFinder 2.0rc1 no more supported - use 2.x dev build from
|
||||
http://sourceforge.net/projects/drupal-elfinder/files/Library/
|
||||
or use production version if it is available
|
||||
|
||||
Optional:
|
||||
|
||||
- Wysiwyg module
|
||||
- Wysiwyg editor:
|
||||
|
||||
- CKEditor
|
||||
- FCKeditor
|
||||
- TinyMCE 3
|
||||
- BUEdtor
|
||||
- jWYSIWYG (jWYSIWYG 0.93+, jquery 1.3+, jquery ui 1.7+)
|
||||
- YUI Editor
|
||||
- WYMeditor
|
||||
|
||||
|
||||
Installation:
|
||||
|
||||
1. Unpack archive contents into modules/elfinder
|
||||
2. Get latest elFinder at http://sourceforge.net/projects/drupal-elfinder/files/Library/ and it's contents to sites/all/libraries/elfinder
|
||||
3. REMOVE following files from library directory if it exists to avoid security hole:
|
||||
|
||||
sites/all/libraries/elfinder/elfinder.php.html
|
||||
sites/all/libraries/elfinder/connectors/php/connector.php
|
||||
sites/all/libraries/elfinder/php/connector.php
|
||||
|
||||
4. Enable elFinder module in Modules > List menu
|
||||
5. Add 'use file manager' permission to users who will be able to use elFinder at Modules > elFinder > Permissions menu
|
||||
6. Enable elFinder checkbox in your editor Wysiwyg profile at Configuration > Wysiwyg profiles > <Editor Profile> Buttons and Plugins
|
||||
|
||||
Usage:
|
||||
|
||||
1. Administration backend
|
||||
|
||||
a. Open /elfinder url (or ?q=elfinder if seo-capable urls disabled)
|
||||
b. Go to Administer page. Click 'Files' under Content section.
|
||||
|
||||
2. Inside CKEditor (FCKeditor)
|
||||
2.1. Open Image Properties dialog in editor
|
||||
2.2. Click Browse Server button near image url
|
||||
|
||||
3. Inside TinyMCE
|
||||
3.1. Open Insert/edit image dialog
|
||||
3.2. Click Browse button near image url
|
||||
|
||||
4. Inside BUEditor
|
||||
4.1. Click 'Insert/edit image'
|
||||
4.2. Click 'Browse'
|
||||
4.3. Select file
|
||||
4.4. Enter alt text then click OK
|
||||
|
||||
5. Inside jWYSIWYG
|
||||
5.1. Make sure that you have jWYSYWIG 0.93+ (http://github.com/akzhan/jwysiwyg/), jQuery 1.3+ and jQuery UI 1.7+ installed
|
||||
5.2. Click 'Insert image' button
|
||||
5.3. Click 'Browse Server' button near image url
|
||||
|
||||
6. Inside YUI Editor
|
||||
6.1. Click 'Insert Image' button
|
||||
6.2. Click 'Browse Server' button near image url
|
||||
|
||||
7. Inside WYMeditor
|
||||
7.1. Click 'Image' button
|
||||
7.2. Click 'Browse Server' button near image url
|
||||
|
||||
|
||||
|
||||
Known Issues:
|
||||
|
||||
- Not all editors supported
|
||||
- Conflicting with some devel module features
|
||||
|
||||
|
||||
|
||||
elFinder file manager integration module for Drupal
|
||||
===================================================
|
||||
|
||||
System Requirements:
|
||||
|
||||
- Drupal 7.x
|
||||
- elFinder 2.0.9+ or 2.1.38+
|
||||
|
||||
Note: elFinder 2.0rc1 no more supported - use 2.0.9+ or 2.1.38+ dev build from
|
||||
http://elfinder.org
|
||||
or use production version if it is available
|
||||
|
||||
Optional:
|
||||
|
||||
- Wysiwyg module
|
||||
- Wysiwyg editor:
|
||||
|
||||
- CKEditor
|
||||
- FCKeditor
|
||||
- TinyMCE 3
|
||||
- BUEdtor
|
||||
- jWYSIWYG (jWYSIWYG 0.93+, jquery 1.3+, jquery ui 1.7+)
|
||||
- YUI Editor
|
||||
- WYMeditor
|
||||
|
||||
|
||||
Installation:
|
||||
|
||||
1. Unpack archive contents into modules/elfinder
|
||||
2. Get latest elFinder at http://elfinder.org and it's contents to sites/all/libraries/elfinder
|
||||
3. REMOVE following files from library directory if it exists to avoid security hole:
|
||||
|
||||
sites/all/libraries/elfinder/connectors/php/connector.php
|
||||
sites/all/libraries/elfinder/php/connector.php
|
||||
|
||||
4. Enable elFinder module in Modules > List menu
|
||||
5. Add 'use file manager' permission to users who will be able to use elFinder at Modules > elFinder > Permissions menu
|
||||
6. Enable elFinder checkbox in your editor Wysiwyg profile at Configuration > Wysiwyg profiles > <Editor Profile> Buttons and Plugins
|
||||
|
||||
Usage:
|
||||
|
||||
1. Administration backend
|
||||
a. Open /elfinder url (or ?q=elfinder if seo-capable urls disabled)
|
||||
b. Go to Administer page. Click 'Files' under Content section.
|
||||
|
||||
2. Inside CKEditor (FCKeditor)
|
||||
2.1. Open Image Properties dialog in editor
|
||||
2.2. Click Browse Server button near image url
|
||||
|
||||
3. Inside TinyMCE
|
||||
3.1. Open Insert/edit image dialog
|
||||
3.2. Click Browse button near image url
|
||||
|
||||
4. Inside BUEditor
|
||||
4.1. Click 'Insert/edit image'
|
||||
4.2. Click 'Browse'
|
||||
4.3. Select file
|
||||
4.4. Enter alt text then click OK
|
||||
|
||||
5. Inside jWYSIWYG
|
||||
5.1. Make sure that you have jWYSYWIG 0.93+ (http://github.com/akzhan/jwysiwyg/), jQuery 1.3+ and jQuery UI 1.7+ installed
|
||||
5.2. Click 'Insert image' button
|
||||
5.3. Click 'Browse Server' button near image url
|
||||
|
||||
6. Inside YUI Editor
|
||||
6.1. Click 'Insert Image' button
|
||||
6.2. Click 'Browse Server' button near image url
|
||||
|
||||
7. Inside WYMeditor
|
||||
7.1. Click 'Image' button
|
||||
7.2. Click 'Browse Server' button near image url
|
||||
|
||||
|
||||
Known Issues:
|
||||
|
||||
- Not all editors supported
|
||||
- Conflicting with some devel module features
|
||||
|
||||
|
||||
|
@@ -1,5 +1,11 @@
|
||||
.elfinder-field-wrapper-volume-path {
|
||||
float:left;
|
||||
width:300px;
|
||||
bborder:#f00 1px solid;
|
||||
/*
|
||||
* elFinder Integration
|
||||
*
|
||||
* Copyright (c) 2010-2018, Alexey Sukhotin. All rights reserved.
|
||||
*/
|
||||
|
||||
.elfinder-field-wrapper-volume-path {
|
||||
float: left;
|
||||
width: 300px;
|
||||
bborder: #f00 1px solid;
|
||||
}
|
@@ -1,27 +1,48 @@
|
||||
|
||||
.el-finder-nav ul li {
|
||||
background:none;
|
||||
padding:0;
|
||||
margin:0;
|
||||
}
|
||||
.elfinder-cwd, .elfinder-navbar {
|
||||
font-size:13px!important;
|
||||
}
|
||||
|
||||
.elfinder-cwd-view-icons .elfinder-cwd-file {
|
||||
height: 150px;
|
||||
width: 100px;
|
||||
}
|
||||
|
||||
.elfinder-cwd-view-icons .elfinder-cwd-filename {
|
||||
white-space: normal;
|
||||
overflow:visible;
|
||||
}
|
||||
|
||||
body.elfinder #finder {
|
||||
border: none;
|
||||
}
|
||||
|
||||
body.elfinder .elfinder-toolbar, body.elfinder .elfinder-statusbar {
|
||||
border-radius: 0 !important;
|
||||
}
|
||||
/*
|
||||
* elFinder Integration
|
||||
*
|
||||
* Copyright (c) 2010-2018, Alexey Sukhotin. All rights reserved.
|
||||
*/
|
||||
|
||||
#finder .elfinder-statusbar {
|
||||
padding: .2em 1em;
|
||||
}
|
||||
|
||||
#finder fieldset.elfinder-resize-preset-container {
|
||||
padding: .5em;
|
||||
}
|
||||
|
||||
#finder .ui-dialog input[type='text'] {
|
||||
padding: 1px 2px;
|
||||
}
|
||||
|
||||
#finder .ui-dialog tr td {
|
||||
border-right: none;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
#finder .ui-dialog textarea#elfinder-fm-file-desc {
|
||||
background: #FFF;
|
||||
}
|
||||
|
||||
#finder .elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-bgurl:before {
|
||||
font-family: inherit;
|
||||
}
|
||||
|
||||
/* elfinder popup window */
|
||||
body.elfinder #finder {
|
||||
border: none;
|
||||
}
|
||||
|
||||
body.elfinder .elfinder-toolbar,
|
||||
body.elfinder .elfinder-statusbar {
|
||||
border-radius: 0 !important;
|
||||
}
|
||||
|
||||
#elfinder-messages {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#elfinder-messages.legacy {
|
||||
display: block;
|
||||
}
|
@@ -1,6 +1,11 @@
|
||||
|
||||
.el-finder-nav ul li {
|
||||
background:none;
|
||||
padding:0;
|
||||
margin:0;
|
||||
/*
|
||||
* elFinder Integration
|
||||
*
|
||||
* Copyright (c) 2010-2018, Alexey Sukhotin. All rights reserved.
|
||||
*/
|
||||
|
||||
.el-finder-nav ul li {
|
||||
background: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
@@ -1,9 +0,0 @@
|
||||
|
||||
.el-finder-nav ul {
|
||||
list-style-type:none!important;
|
||||
}
|
||||
|
||||
.el-finder-cwd label {
|
||||
font-weight:normal!important;
|
||||
overflow:visible!important;
|
||||
}
|
@@ -1,3 +1,8 @@
|
||||
/*
|
||||
* elFinder Integration
|
||||
*
|
||||
* Copyright (c) 2010-2018, Alexey Sukhotin. All rights reserved.
|
||||
*/
|
||||
@import url('jquery-ui.min.css');
|
||||
@import url('jquery-ui.structure.min.css');
|
||||
@import url('jquery-ui.theme.min.css');
|
||||
|
File diff suppressed because one or more lines are too long
@@ -1 +1,19 @@
|
||||
// $Id$
|
||||
/*
|
||||
* elFinder Integration
|
||||
*
|
||||
* Copyright (c) 2010-2018, Alexey Sukhotin. All rights reserved.
|
||||
*/
|
||||
|
||||
function elfinder_bueditor_callback(url) {
|
||||
var img = jQuery('<img/>').attr('src', url).css('display', 'none').insertBefore(jQuery('#finder'));
|
||||
parent.jQuery("#bue-tgd-form input[name=attr_width]").val(img.width());
|
||||
parent.jQuery("#bue-tgd-form input[name=attr_height]").val(img.height());
|
||||
parent.BUE.imce.target.value = url;
|
||||
parent.BUE.popups['bue-imce-pop'].close();
|
||||
}
|
||||
|
||||
function elfinder_bue_callback(url) {
|
||||
elfinder_bueditor_callback(url);
|
||||
}
|
||||
|
||||
|
||||
|
@@ -1,23 +1,29 @@
|
||||
<?php
|
||||
/**
|
||||
* elFinder Integration
|
||||
*
|
||||
* Copyright (c) 2010-2018, Alexey Sukhotin. All rights reserved.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* BUEditor integration plugin
|
||||
*/
|
||||
|
||||
/**
|
||||
* Pseudo-hook for elfinder hook_wysiwyg_plugin implementation
|
||||
*/
|
||||
* Pseudo-hook for elfinder hook_wysiwyg_plugin implementation
|
||||
*/
|
||||
function elfinder_bueditor_elfinder_editor_plugin($options) {
|
||||
drupal_add_js(array('elfinder' => array('moduleUrl' => url('elfinder'))), 'setting');
|
||||
drupal_add_js(array('elfinder' => array('moduleUrl' => url('elfinder'))), 'setting');
|
||||
drupal_add_js($options['plugin_url_base'] . '/bueditor.js');
|
||||
drupal_add_js(array('elfinder' => array('moduleUrl' => url('elfinder'))), 'setting');
|
||||
drupal_add_js(array('elfinder' => array('moduleUrl' => url('elfinder'))), 'setting');
|
||||
drupal_add_js($options['plugin_url_base'] . '/bueditor.js');
|
||||
|
||||
return array(
|
||||
'elfinder' => array(
|
||||
'extensions' => array('elfinder' => t('elFinder')),
|
||||
'url' => $options['homepage_url'],
|
||||
'options' => array(),
|
||||
'load' => FALSE,
|
||||
),
|
||||
);
|
||||
return array(
|
||||
'elfinder' => array(
|
||||
'extensions' => array('elfinder' => t('elFinder')),
|
||||
'url' => $options['homepage_url'],
|
||||
'options' => array(),
|
||||
'load' => FALSE,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
@@ -1,12 +1,18 @@
|
||||
/*
|
||||
* elFinder Integration
|
||||
*
|
||||
* Copyright (c) 2010-2018, Alexey Sukhotin. All rights reserved.
|
||||
*/
|
||||
|
||||
// $Id: elfinder.bueditor.js,v 1.1 2010/10/06 09:44:51 ph0enix Exp $
|
||||
|
||||
Drupal.elfinder.editor.bueditor = {
|
||||
fn : {
|
||||
fn: {
|
||||
attach: Drupal.wysiwyg.editor.attach.bueditor
|
||||
}
|
||||
}
|
||||
|
||||
Drupal.wysiwyg.editor.attach.bueditor = function(context, params, settings) {
|
||||
Drupal.settings.BUE.imceURL = Drupal.settings.elfinder.moduleUrl;
|
||||
Drupal.elfinder.editor.bueditor.fn.attach.apply(this, arguments);
|
||||
Drupal.settings.BUE.imceURL = Drupal.settings.elfinder.moduleUrl;
|
||||
Drupal.elfinder.editor.bueditor.fn.attach.apply(this, arguments);
|
||||
}
|
||||
|
@@ -1,4 +1,8 @@
|
||||
|
||||
/*
|
||||
* elFinder Integration
|
||||
*
|
||||
* Copyright (c) 2010-2019, Alexey Sukhotin. All rights reserved.
|
||||
*/
|
||||
|
||||
function elfinder_ckeditor_callback(arg1) {
|
||||
|
||||
@@ -7,13 +11,23 @@ function elfinder_ckeditor_callback(arg1) {
|
||||
if (typeof arg1 == 'object') {
|
||||
url = arg1.url;
|
||||
}
|
||||
|
||||
funcNum = window.location.search.replace(/^.*CKEditorFuncNum=(\d+).*$/, "$1");
|
||||
|
||||
window.opener.CKEDITOR.tools.callFunction(funcNum, url, function() {
|
||||
// adapted from http://docs.ckeditor.com/#!/guide/dev_file_browser_api
|
||||
|
||||
var dialog = this.getDialog();
|
||||
if (dialog.getName() == 'link' ) {
|
||||
|
||||
if (dialog.getName() == 'link') {
|
||||
|
||||
var element = dialog.getContentElement('info', 'linkDisplayText');
|
||||
var display_text = element.getValue();
|
||||
var display_text = null;
|
||||
|
||||
if (element) {
|
||||
display_text = element.getValue();
|
||||
}
|
||||
|
||||
// If display text is blank, insert the filename.
|
||||
if (element && !display_text) {
|
||||
element.setValue(arg1.name);
|
||||
@@ -24,7 +38,7 @@ function elfinder_ckeditor_callback(arg1) {
|
||||
// Avoid beforeunload event when selecting an image.
|
||||
// See https://github.com/Studio-42/elFinder/issues/1340
|
||||
// Maybe remove this when elfinder js library gets updated.
|
||||
$(window).off('beforeunload');
|
||||
jQuery(window).off('beforeunload');
|
||||
|
||||
window.close();
|
||||
}
|
||||
|
@@ -1,4 +1,9 @@
|
||||
<?php
|
||||
/**
|
||||
* elFinder Integration
|
||||
*
|
||||
* Copyright (c) 2010-2018, Alexey Sukhotin. All rights reserved.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
@@ -6,8 +11,8 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* Pseudo-hook for elfinder hook_wysiwyg_plugin implementation
|
||||
*/
|
||||
* Pseudo-hook for elfinder hook_wysiwyg_plugin implementation
|
||||
*/
|
||||
function elfinder_ckeditor_elfinder_editor_plugin($options) {
|
||||
return array(
|
||||
'elfinder' => array(
|
||||
@@ -18,6 +23,7 @@ function elfinder_ckeditor_elfinder_editor_plugin($options) {
|
||||
'filebrowserUploadUrl' => url('elfinder/upload/ckeditor'),
|
||||
'filebrowserImageUploadUrl' => url('elfinder/upload/ckeditor'),
|
||||
'filebrowserFlashUploadUrl' => url('elfinder/upload/ckeditor'),
|
||||
//'filebrowserBrowseUrl' => 'javascript:alert(12345);return false;//',
|
||||
),
|
||||
'load' => FALSE,
|
||||
),
|
||||
|
@@ -1,36 +1,42 @@
|
||||
<?php
|
||||
/**
|
||||
* elFinder Integration
|
||||
*
|
||||
* Copyright (c) 2010-2018, Alexey Sukhotin. All rights reserved.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
*
|
||||
* CKeditor Upload tab support
|
||||
*/
|
||||
|
||||
function elfinder_editor_upload_ckeditor() {
|
||||
|
||||
|
||||
$p = elfinder_get_user_profile();
|
||||
|
||||
$dest = file_build_uri('');
|
||||
|
||||
if (!strpos($p->settings['ckeditor_upload_directory'], '://')) {
|
||||
$dest .= $p->settings['ckeditor_upload_directory'];
|
||||
} else {
|
||||
$dest = $p->settings['ckeditor_upload_directory'];
|
||||
}
|
||||
|
||||
$dest = elfinder_parse_path_tokens($dest);
|
||||
|
||||
$destabs = drupal_realpath($dest);
|
||||
|
||||
if (!file_prepare_directory($destabs, FILE_CREATE_DIRECTORY)) {
|
||||
if (!strpos($p->settings['ckeditor_upload_directory'], '://')) {
|
||||
$dest .= $p->settings['ckeditor_upload_directory'];
|
||||
} else {
|
||||
$dest = $p->settings['ckeditor_upload_directory'];
|
||||
}
|
||||
|
||||
$dest = elfinder_parse_path_tokens($dest);
|
||||
|
||||
$destabs = drupal_realpath($dest);
|
||||
|
||||
if (!file_prepare_directory($destabs, FILE_CREATE_DIRECTORY)) {
|
||||
drupal_set_message(t('Error. Cannot initialize directory %dir', array('%dir' => $destabs)), 'error');
|
||||
}
|
||||
|
||||
|
||||
$tmpf = $_FILES;
|
||||
|
||||
|
||||
foreach (array_keys($_FILES['upload']) as $key) {
|
||||
$tmpf['files'][$key]['upload'] = $_FILES['upload'][$key];
|
||||
}
|
||||
|
||||
|
||||
$_FILES = $tmpf;
|
||||
|
||||
$file = file_save_upload('upload', array(), $dest);
|
||||
@@ -38,7 +44,7 @@ function elfinder_editor_upload_ckeditor() {
|
||||
file_save($file);
|
||||
|
||||
header('Content-Type: text/html');
|
||||
|
||||
|
||||
print '<script type="text/javascript">';
|
||||
|
||||
if ($file) {
|
||||
|
@@ -1,5 +1,10 @@
|
||||
// $Id$
|
||||
/*
|
||||
* elFinder Integration
|
||||
*
|
||||
* Copyright (c) 2010-2018, Alexey Sukhotin. All rights reserved.
|
||||
*/
|
||||
|
||||
function elfinder_drupalnodeattach_callback(url) {
|
||||
parent.jQuery('input#edit-attach-url').val(url);
|
||||
parent.jQuery('input#edit-attach-url').val(url);
|
||||
alert(url);
|
||||
}
|
@@ -1 +1,10 @@
|
||||
// $Id$
|
||||
/*
|
||||
* elFinder Integration
|
||||
*
|
||||
* Copyright (c) 2010-2018, Alexey Sukhotin. All rights reserved.
|
||||
*/
|
||||
|
||||
function elfinder_fckeditor_callback(url) {
|
||||
window.opener.SetUrl(url);
|
||||
window.close();
|
||||
}
|
@@ -1,34 +1,40 @@
|
||||
<?php
|
||||
/**
|
||||
* elFinder Integration
|
||||
*
|
||||
* Copyright (c) 2010-2018, Alexey Sukhotin. All rights reserved.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* FCKeditor integration plugin
|
||||
*/
|
||||
|
||||
/**
|
||||
* Pseudo-hook for elfinder hook_wysiwyg_plugin implementation
|
||||
*/
|
||||
* Pseudo-hook for elfinder hook_wysiwyg_plugin implementation
|
||||
*/
|
||||
function elfinder_fckeditor_elfinder_editor_plugin($options) {
|
||||
return array(
|
||||
'elfinder' => array(
|
||||
'extensions' => array('elfinder' => t('elFinder')),
|
||||
'url' => $options['homepage_url'],
|
||||
'options' => array(
|
||||
'LinkBrowser' => TRUE,
|
||||
'LinkBrowserURL' => $options['elfinder_url'],
|
||||
'ImageBrowser' => TRUE,
|
||||
'ImageBrowserURL' => $options['elfinder_url'],
|
||||
'FlashBrowser' => TRUE,
|
||||
'FlashBrowserURL' => $options['elfinder_url'],
|
||||
'ImageUpload' => TRUE,
|
||||
'ImageUploadURL' => url('elfinder/upload/fckeditor'),
|
||||
'FlashUpload' => TRUE,
|
||||
// 'FlashUploadURL' => $options['elfinder_connector_url'],
|
||||
'LinkUpload' => TRUE,
|
||||
// 'LinkUploadURL' => $options['elfinder_connector_url'],
|
||||
|
||||
return array(
|
||||
'elfinder' => array(
|
||||
'extensions' => array('elfinder' => t('elFinder')),
|
||||
'url' => $options['homepage_url'],
|
||||
'options' => array(
|
||||
'LinkBrowser' => TRUE,
|
||||
'LinkBrowserURL' => $options['elfinder_url'],
|
||||
'ImageBrowser' => TRUE,
|
||||
'ImageBrowserURL' => $options['elfinder_url'],
|
||||
'FlashBrowser' => TRUE,
|
||||
'FlashBrowserURL' => $options['elfinder_url'],
|
||||
'ImageUpload' => TRUE,
|
||||
'ImageUploadURL' => url('elfinder/upload/fckeditor'),
|
||||
'FlashUpload' => TRUE,
|
||||
// 'FlashUploadURL' => $options['elfinder_connector_url'],
|
||||
'LinkUpload' => TRUE,
|
||||
// 'LinkUploadURL' => $options['elfinder_connector_url'],
|
||||
|
||||
),
|
||||
'load' => FALSE,
|
||||
),
|
||||
);
|
||||
|
||||
),
|
||||
'load' => FALSE,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
@@ -1,53 +1,59 @@
|
||||
<?php
|
||||
/**
|
||||
* elFinder Integration
|
||||
*
|
||||
* Copyright (c) 2010-2018, Alexey Sukhotin. All rights reserved.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
*
|
||||
* FCKeditor Upload tab support
|
||||
*/
|
||||
|
||||
function elfinder_editor_upload_fckeditor() {
|
||||
|
||||
|
||||
$p = elfinder_get_user_profile();
|
||||
|
||||
$dest = file_build_uri('');
|
||||
|
||||
if (!strpos($p->settings['ckeditor_upload_directory'], '://')) {
|
||||
$dest .= $p->settings['ckeditor_upload_directory'];
|
||||
} else {
|
||||
$dest = $p->settings['ckeditor_upload_directory'];
|
||||
}
|
||||
|
||||
$dest = elfinder_parse_path_tokens($dest);
|
||||
|
||||
$destabs = drupal_realpath($dest);
|
||||
|
||||
if (!file_prepare_directory($destabs, FILE_CREATE_DIRECTORY)) {
|
||||
if (!strpos($p->settings['ckeditor_upload_directory'], '://')) {
|
||||
$dest .= $p->settings['ckeditor_upload_directory'];
|
||||
} else {
|
||||
$dest = $p->settings['ckeditor_upload_directory'];
|
||||
}
|
||||
|
||||
$dest = elfinder_parse_path_tokens($dest);
|
||||
|
||||
$destabs = drupal_realpath($dest);
|
||||
|
||||
if (!file_prepare_directory($destabs, FILE_CREATE_DIRECTORY)) {
|
||||
drupal_set_message(t('Error. Cannot initialize directory %dir', array('%dir' => $destabs)), 'error');
|
||||
}
|
||||
|
||||
$tmpf = $_FILES;
|
||||
|
||||
|
||||
foreach (array_keys($_FILES['NewFile']) as $key) {
|
||||
$tmpf['files'][$key]['NewFile'] = $_FILES['NewFile'][$key];
|
||||
}
|
||||
|
||||
|
||||
$_FILES = $tmpf;
|
||||
|
||||
$file = file_save_upload('NewFile', array(), $dest);
|
||||
$file->status = FILE_STATUS_PERMANENT;
|
||||
file_save($file);
|
||||
|
||||
|
||||
|
||||
header('Content-Type: text/html');
|
||||
|
||||
print '<script type="text/javascript">';
|
||||
|
||||
|
||||
if ($file) {
|
||||
print "window.parent.OnUploadCompleted(0, '" . file_create_url($file->uri) . "', '" . $file->filename . "', '') ;";
|
||||
} else {
|
||||
print 'window.parent.OnUploadCompleted(1,"","", "' . t('Error uploading file!') . '") ;';
|
||||
}
|
||||
|
||||
|
||||
print '</script>';
|
||||
|
||||
exit();
|
||||
|
@@ -1 +1,10 @@
|
||||
// $Id$
|
||||
/*
|
||||
* elFinder Integration
|
||||
*
|
||||
* Copyright (c) 2010-2018, Alexey Sukhotin. All rights reserved.
|
||||
*/
|
||||
|
||||
function elfinder_jwysiwyg_callback(url) {
|
||||
window.opener.jQuery('.ui-dialog input[type=text][name=url]').val(url);
|
||||
window.close();
|
||||
}
|
@@ -1,29 +1,39 @@
|
||||
<?php
|
||||
/**
|
||||
* elFinder Integration
|
||||
*
|
||||
* Copyright (c) 2010-2018, Alexey Sukhotin. All rights reserved.
|
||||
*/
|
||||
|
||||
// $Id$
|
||||
|
||||
/**
|
||||
* @file
|
||||
* jWYSIWYG integration plugin
|
||||
*/
|
||||
|
||||
/**
|
||||
* Pseudo-hook for elfinder hook_wysiwyg_plugin implementation
|
||||
*/
|
||||
* Pseudo-hook for elfinder hook_wysiwyg_plugin implementation
|
||||
*/
|
||||
function elfinder_jwysiwyg_elfinder_editor_plugin($options) {
|
||||
if (module_exists('jquery_update') && module_exists('jquery_ui')) {
|
||||
drupal_add_css(JQUERY_UI_PATH . '/themes/base/ui.all.css');
|
||||
jquery_ui_add(array('ui.dialog', 'ui.accordion', 'ui.draggable', 'ui.droppable', 'ui.selectable'));
|
||||
} else {
|
||||
drupal_set_message(t('elFinder requires jQuery 1.3+ and jQuery UI 1.7+ for jWYSIWYG support. Please install and enable <a href="http://drupal.org/project/jquery_update">jquery_update</a> and <a href="http://drupal.org/project/jquery_ui">jquery_ui</a> modules.'), 'error');
|
||||
}
|
||||
|
||||
drupal_add_js(array('elfinder' => array('file_browser_url' => $options['elfinder_url'])), 'setting');
|
||||
drupal_add_js($options['plugin_url_base'] . '/jwysiwyg.js');
|
||||
|
||||
return array(
|
||||
'elfinder' => array(
|
||||
'extensions' => array('elfinder' => t('elFinder')),
|
||||
'url' => $options['homepage_url'],
|
||||
'options' => array(),
|
||||
'load' => FALSE,
|
||||
),
|
||||
);
|
||||
if (VERSION < 7) {
|
||||
if (module_exists('jquery_update') && module_exists('jquery_ui')) {
|
||||
drupal_add_css(JQUERY_UI_PATH . '/themes/base/ui.all.css');
|
||||
jquery_ui_add(array('ui.dialog', 'ui.accordion', 'ui.draggable', 'ui.droppable', 'ui.selectable'));
|
||||
} else {
|
||||
drupal_set_message(t('elFinder requires jQuery 1.3+ and jQuery UI 1.7+ for jWYSIWYG support. Please install and enable <a href="http://drupal.org/project/jquery_update">jquery_update</a> and <a href="http://drupal.org/project/jquery_ui">jquery_ui</a> modules.'), 'error');
|
||||
}
|
||||
}
|
||||
|
||||
drupal_add_js(array('elfinder' => array('file_browser_url' => $options['elfinder_url'])), 'setting');
|
||||
drupal_add_js($options['plugin_url_base'] . '/jwysiwyg.js');
|
||||
|
||||
return array(
|
||||
'elfinder' => array(
|
||||
'extensions' => array('elfinder' => t('elFinder')),
|
||||
'url' => $options['homepage_url'],
|
||||
'options' => array(),
|
||||
'load' => FALSE,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
@@ -1,34 +1,40 @@
|
||||
/*
|
||||
* elFinder Integration
|
||||
*
|
||||
* Copyright (c) 2010-2018, Alexey Sukhotin. All rights reserved.
|
||||
*/
|
||||
|
||||
// $Id: elfinder.jwysiwyg.js,v 1.1 2010/10/06 09:44:51 ph0enix Exp $
|
||||
|
||||
(function($) {
|
||||
|
||||
Drupal.elfinder.editor.jwysiwyg = {
|
||||
fn : {
|
||||
attach: Drupal.wysiwyg.editor.attach.jwysiwyg
|
||||
}
|
||||
}
|
||||
|
||||
Drupal.wysiwyg.editor.attach.jwysiwyg = function(context, params, settings) {
|
||||
|
||||
var imgHtml = null;
|
||||
|
||||
if (jQuery.fn.wysiwyg.defaults) {
|
||||
imgHtml = jQuery.fn.wysiwyg.defaults.formImageHtml;
|
||||
}
|
||||
|
||||
var oImgHtml = $('<div>'+imgHtml+'</div>');
|
||||
var oUrl = $("input[name=url]", oImgHtml);
|
||||
var browsebutton = $('<input type="button">');
|
||||
|
||||
browsebutton.attr('value', Drupal.t('Browse Server'));
|
||||
browsebutton.attr('onclick', 'var w = window; w.open("' + Drupal.settings.elfinder.file_browser_url + '","","toolbar=no,menubar=no,width=600,height=600")');
|
||||
browsebutton.insertAfter(oUrl);
|
||||
|
||||
if (jQuery.fn.wysiwyg.defaults) {
|
||||
jQuery.fn.wysiwyg.defaults.formImageHtml = oImgHtml.html();
|
||||
Drupal.elfinder.editor.jwysiwyg = {
|
||||
fn: {
|
||||
attach: Drupal.wysiwyg.editor.attach.jwysiwyg
|
||||
}
|
||||
}
|
||||
|
||||
Drupal.elfinder.editor.jwysiwyg.fn.attach.apply(this, arguments);
|
||||
}
|
||||
Drupal.wysiwyg.editor.attach.jwysiwyg = function(context, params, settings) {
|
||||
|
||||
var imgHtml = null;
|
||||
|
||||
if (jQuery.fn.wysiwyg.defaults) {
|
||||
imgHtml = jQuery.fn.wysiwyg.defaults.formImageHtml;
|
||||
}
|
||||
|
||||
var oImgHtml = $('<div>' + imgHtml + '</div>');
|
||||
var oUrl = $("input[name=url]", oImgHtml);
|
||||
var browsebutton = $('<input type="button">');
|
||||
|
||||
browsebutton.attr('value', Drupal.t('Browse Server'));
|
||||
browsebutton.attr('onclick', 'var w = window; w.open("' + Drupal.settings.elfinder.file_browser_url + '","","toolbar=no,menubar=no,width=600,height=600")');
|
||||
browsebutton.insertAfter(oUrl);
|
||||
|
||||
if (jQuery.fn.wysiwyg.defaults) {
|
||||
jQuery.fn.wysiwyg.defaults.formImageHtml = oImgHtml.html();
|
||||
}
|
||||
|
||||
Drupal.elfinder.editor.jwysiwyg.fn.attach.apply(this, arguments);
|
||||
}
|
||||
|
||||
})(jQuery);
|
@@ -1 +1,38 @@
|
||||
// $Id$
|
||||
/*
|
||||
* elFinder Integration
|
||||
*
|
||||
* Copyright (c) 2010-2018, Alexey Sukhotin. All rights reserved.
|
||||
*/
|
||||
|
||||
var elfinder_tinymce_callback = function(arg1) {
|
||||
var url = arg1;
|
||||
|
||||
if (typeof arg1 == 'object') {
|
||||
url = arg1.url;
|
||||
}
|
||||
/* window.tinymceFileWin.document.forms[0].elements[window.tinymceFileField].value = url;
|
||||
window.tinymceFileWin.focus();
|
||||
window.close();*/
|
||||
|
||||
//make inline popup work
|
||||
|
||||
var win = tinyMCEPopup.getWindowArg("window");
|
||||
|
||||
// insert information now
|
||||
win.document.getElementById(tinyMCEPopup.getWindowArg("input")).value = url;
|
||||
|
||||
// are we an image browser
|
||||
if (typeof (win.ImageDialog) != "undefined") {
|
||||
// we are, so update image dimensions...
|
||||
if (win.ImageDialog.getImageData)
|
||||
win.ImageDialog.getImageData();
|
||||
|
||||
// ... and preview if necessary
|
||||
if (win.ImageDialog.showPreviewImage)
|
||||
win.ImageDialog.showPreviewImage(url);
|
||||
}
|
||||
|
||||
// close popup window
|
||||
tinyMCEPopup.close();
|
||||
|
||||
}
|
||||
|
@@ -1,24 +1,30 @@
|
||||
<?php
|
||||
/**
|
||||
* elFinder Integration
|
||||
*
|
||||
* Copyright (c) 2010-2018, Alexey Sukhotin. All rights reserved.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* TinyMCE integration plugin
|
||||
*/
|
||||
|
||||
/**
|
||||
* Pseudo-hook for elfinder hook_wysiwyg_plugin implementation
|
||||
*/
|
||||
* Pseudo-hook for elfinder hook_wysiwyg_plugin implementation
|
||||
*/
|
||||
function elfinder_tinymce_elfinder_editor_plugin($options) {
|
||||
drupal_add_js($options['plugin_url_base'] . '/tinymce.js');
|
||||
return array(
|
||||
'elfinder' => array(
|
||||
'extensions' => array('elfinder' => t('elFinder')),
|
||||
'url' => $options['homepage_url'],
|
||||
'options' => array(
|
||||
'file_browser_callback' => 'elfinder_tinymce_browse_callback',
|
||||
'file_browser_url' => $options['elfinder_url'], // non standard TinyMCE configuration variable to pass source application to elFinder
|
||||
'inline_styles' => TRUE,
|
||||
),
|
||||
'load' => FALSE,
|
||||
),
|
||||
);
|
||||
drupal_add_js($options['plugin_url_base'] . '/tinymce.js');
|
||||
return array(
|
||||
'elfinder' => array(
|
||||
'extensions' => array('elfinder' => t('elFinder')),
|
||||
'url' => $options['homepage_url'],
|
||||
'options' => array(
|
||||
'file_browser_callback' => 'elfinder_tinymce_browse_callback',
|
||||
'file_browser_url' => $options['elfinder_url'], // non standard TinyMCE configuration variable to pass source application to elFinder
|
||||
'inline_styles' => TRUE,
|
||||
),
|
||||
'load' => FALSE,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
@@ -1,27 +1,46 @@
|
||||
/*
|
||||
* elFinder Integration
|
||||
*
|
||||
* Copyright (c) 2010-2018, Alexey Sukhotin. All rights reserved.
|
||||
*/
|
||||
|
||||
// $Id$
|
||||
|
||||
/*function elfinder_tinymce_browse_callback(field_name, url, type, win) {
|
||||
var w = window.open(tinymce.settings.file_browser_url, null, 'toolbar=yes,menubar=yes,width=600,height=500, inline=yes');
|
||||
w.tinymceFileField = field_name;
|
||||
w.tinymceFileWin = win;
|
||||
}*/
|
||||
|
||||
// MAKE INLINE POPUP WORK
|
||||
|
||||
function elfinder_tinymce_browse_callback(field_name, url, type, win) {
|
||||
/*var w = window.open(tinymce.settings.file_browser_url, null, 'toolbar=yes,menubar=yes,width=600,height=500, inline=yes');
|
||||
w.tinymceFileField = field_name;
|
||||
w.tinymceFileWin = win;*/
|
||||
|
||||
var cmsURL = tinymce.settings.file_browser_url; // script URL - use an absolute path!
|
||||
if (cmsURL.indexOf("?") < 0) {
|
||||
//add the type as the only query parameter
|
||||
cmsURL = cmsURL + "?type=" + type;
|
||||
} else {
|
||||
//add the type as an additional query parameter
|
||||
// (PHP session ID is now included if there is one at all)
|
||||
cmsURL = cmsURL + "&type=" + type;
|
||||
}
|
||||
var cmsURL = tinymce.settings.file_browser_url; // script URL - use an absolute path!
|
||||
if (cmsURL.indexOf("?") < 0) {
|
||||
//add the type as the only query parameter
|
||||
cmsURL = cmsURL + "?type=" + type;
|
||||
} else {
|
||||
//add the type as an additional query parameter
|
||||
// (PHP session ID is now included if there is one at all)
|
||||
cmsURL = cmsURL + "&type=" + type;
|
||||
}
|
||||
|
||||
tinyMCE.activeEditor.windowManager.open({
|
||||
file: cmsURL,
|
||||
title: 'File Manager',
|
||||
width: 900,
|
||||
height: 450,
|
||||
resizable: "yes",
|
||||
inline: "yes", // This parameter only has an effect if you use the inlinepopups plugin!
|
||||
popup_css: false, // Disable TinyMCE's default popup CSS
|
||||
close_previous: "no"
|
||||
}, {
|
||||
window: win,
|
||||
input: field_name
|
||||
});
|
||||
return false;
|
||||
tinyMCE.activeEditor.windowManager.open({
|
||||
file: cmsURL,
|
||||
title: 'File Manager',
|
||||
width: 900,
|
||||
height: 450,
|
||||
resizable: "yes",
|
||||
inline: "yes", // This parameter only has an effect if you use the inlinepopups plugin!
|
||||
popup_css: false, // Disable TinyMCE's default popup CSS
|
||||
close_previous: "no"
|
||||
}, {
|
||||
window: win,
|
||||
input: field_name
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
@@ -1,4 +1,10 @@
|
||||
/*
|
||||
* elFinder Integration
|
||||
*
|
||||
* Copyright (c) 2010-2018, Alexey Sukhotin. All rights reserved.
|
||||
*/
|
||||
|
||||
function elfinder_wymeditor_callback(url) {
|
||||
window.opener.jQuery('input.wym_src').val(url);
|
||||
window.close();
|
||||
window.opener.jQuery('input.wym_src').val(url);
|
||||
window.close();
|
||||
}
|
||||
|
@@ -1,4 +1,10 @@
|
||||
<?php
|
||||
/**
|
||||
* elFinder Integration
|
||||
*
|
||||
* Copyright (c) 2010-2018, Alexey Sukhotin. All rights reserved.
|
||||
*/
|
||||
|
||||
// $Id$
|
||||
|
||||
/**
|
||||
@@ -7,17 +13,17 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* Pseudo-hook for elfinder hook_wysiwyg_plugin implementation
|
||||
*/
|
||||
* Pseudo-hook for elfinder hook_wysiwyg_plugin implementation
|
||||
*/
|
||||
function elfinder_wymeditor_elfinder_editor_plugin($options) {
|
||||
drupal_add_js($options['plugin_url_base'] . '/wymeditor.js');
|
||||
drupal_add_js(array('elfinder' => array('file_browser_url' => $options['elfinder_url'])), 'setting');
|
||||
return array(
|
||||
'elfinder' => array(
|
||||
'extensions' => array('elfinder' => t('elFinder')),
|
||||
'url' => $options['homepage_url'],
|
||||
'options' => array(),
|
||||
'load' => FALSE,
|
||||
),
|
||||
);
|
||||
drupal_add_js($options['plugin_url_base'] . '/wymeditor.js');
|
||||
drupal_add_js(array('elfinder' => array('file_browser_url' => $options['elfinder_url'])), 'setting');
|
||||
return array(
|
||||
'elfinder' => array(
|
||||
'extensions' => array('elfinder' => t('elFinder')),
|
||||
'url' => $options['homepage_url'],
|
||||
'options' => array(),
|
||||
'load' => FALSE,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
@@ -1,52 +1,64 @@
|
||||
/*
|
||||
* elFinder Integration
|
||||
*
|
||||
* Copyright (c) 2010-2018, Alexey Sukhotin. All rights reserved.
|
||||
*/
|
||||
|
||||
// $Id: elfinder.wymeditor.js,v 1.1.2.2 2010/12/11 11:53:49 ph0enix Exp $
|
||||
|
||||
(function($) {
|
||||
|
||||
Drupal.elfinder.editor.wymeditor = {
|
||||
fn : {
|
||||
attach: Drupal.wysiwyg.editor.attach.wymeditor
|
||||
}
|
||||
}
|
||||
|
||||
Drupal.wysiwyg.editor.attach.wymeditor = function(context, params, settings) {
|
||||
|
||||
Drupal.elfinder.editor.wymeditor.fn.attach.apply(this, arguments);
|
||||
|
||||
var $field = $('#' + params.field);
|
||||
var index = $field.data(WYMeditor.WYM_INDEX);
|
||||
|
||||
if (typeof index != 'undefined') {
|
||||
var instance = WYMeditor.INSTANCES[index];
|
||||
|
||||
var imgHtml = instance._options.dialogImageHtml;
|
||||
|
||||
var oImgHtml = $('<div>'+imgHtml+'</div>');
|
||||
|
||||
var oUrl = $("input.wym_src", oImgHtml);
|
||||
var browsebutton = $('<input type="button">');
|
||||
browsebutton.attr('value', Drupal.t('Browse Server'));
|
||||
|
||||
/* FIXME: url parameters duplicates for some reason */
|
||||
var tmp = Drupal.settings.elfinder.file_browser_url;
|
||||
var bugpos = tmp.indexOf(",");
|
||||
|
||||
var elfinderUrl = '';
|
||||
|
||||
if (bugpos != -1) {
|
||||
elfinderUrl = tmp.slice(0, bugpos);
|
||||
Drupal.elfinder.editor.wymeditor = {
|
||||
fn: {
|
||||
attach: Drupal.wysiwyg.editor.attach.wymeditor
|
||||
}
|
||||
}
|
||||
|
||||
Drupal.wysiwyg.editor.attach.wymeditor = function(context, params, settings) {
|
||||
|
||||
Drupal.elfinder.editor.wymeditor.fn.attach.apply(this, arguments);
|
||||
|
||||
var $field = $('#' + params.field);
|
||||
var index = $field.data(WYMeditor.WYM_INDEX);
|
||||
|
||||
if (typeof index != 'undefined') {
|
||||
var instance = WYMeditor.INSTANCES[index];
|
||||
|
||||
var imgHtml = instance._options.dialogImageHtml;
|
||||
|
||||
var oImgHtml = $('<div>' + imgHtml + '</div>');
|
||||
|
||||
|
||||
//$('body', oImgHtml).addClass('wym_dialog wym_dialog_image');
|
||||
//$('body', oImgHtml).attr('omload', 'WYMeditor.INIT_DIALOG(' + index + ')');
|
||||
|
||||
var oUrl = $("input.wym_src", oImgHtml);
|
||||
var browsebutton = $('<input type="button">');
|
||||
browsebutton.attr('value', Drupal.t('Browse Server'));
|
||||
|
||||
/* FIXME: url parameters duplicates for some reason */
|
||||
var tmp = Drupal.settings.elfinder.file_browser_url;
|
||||
var bugpos = tmp.indexOf(",");
|
||||
|
||||
var elfinderUrl = '';
|
||||
|
||||
if (bugpos != -1) {
|
||||
elfinderUrl = tmp.slice(0, bugpos);
|
||||
}
|
||||
else {
|
||||
elfinderUrl = tmp;
|
||||
}
|
||||
|
||||
/* */
|
||||
|
||||
browsebutton.attr('onclick', 'var w = window; w.open("' + elfinderUrl + '","","toolbar=no,menubar=no,width=600,height=600")');
|
||||
browsebutton.insertAfter(oUrl);
|
||||
|
||||
|
||||
ImgHtml = '<body class="wym_dialog wym_dialog_image" onload="WYMeditor.INIT_DIALOG(' + index + ')">' + oImgHtml.html() + '</body>';
|
||||
|
||||
instance._options.dialogImageHtml = ImgHtml;
|
||||
}
|
||||
else {
|
||||
elfinderUrl = tmp;
|
||||
}
|
||||
|
||||
browsebutton.attr('onclick', 'var w = window; w.open("' + elfinderUrl + '","","toolbar=no,menubar=no,width=600,height=600")');
|
||||
browsebutton.insertAfter(oUrl);
|
||||
|
||||
|
||||
ImgHtml = '<body class="wym_dialog wym_dialog_image" onload="WYMeditor.INIT_DIALOG(' + index + ')">' + oImgHtml.html() + '</body>';
|
||||
|
||||
instance._options.dialogImageHtml = ImgHtml;
|
||||
}
|
||||
}
|
||||
|
||||
})(jQuery);
|
||||
|
@@ -1,5 +1,11 @@
|
||||
/*
|
||||
* elFinder Integration
|
||||
*
|
||||
* Copyright (c) 2010-2018, Alexey Sukhotin. All rights reserved.
|
||||
*/
|
||||
|
||||
function elfinder_yui_callback(url) {
|
||||
var editorId = window.opener.Drupal.wysiwyg.activeId;
|
||||
window.opener.jQuery('input#' + editorId + '_insertimage_url').val(url);
|
||||
window.close();
|
||||
var editorId = window.opener.Drupal.wysiwyg.activeId;
|
||||
window.opener.jQuery('input#' + editorId + '_insertimage_url').val(url);
|
||||
window.close();
|
||||
}
|
||||
|
@@ -1,21 +1,29 @@
|
||||
<?php
|
||||
/**
|
||||
* elFinder Integration
|
||||
*
|
||||
* Copyright (c) 2010-2018, Alexey Sukhotin. All rights reserved.
|
||||
*/
|
||||
|
||||
// $Id$
|
||||
|
||||
/**
|
||||
* @file
|
||||
* YUI editor integration plugin
|
||||
*/
|
||||
|
||||
/**
|
||||
* Pseudo-hook for elfinder hook_wysiwyg_plugin implementation
|
||||
*/
|
||||
* Pseudo-hook for elfinder hook_wysiwyg_plugin implementation
|
||||
*/
|
||||
function elfinder_yui_elfinder_editor_plugin($options) {
|
||||
drupal_add_js($options['plugin_url_base'] . '/yui.js');
|
||||
drupal_add_js(array('elfinder' => array('file_browser_url' => $options['elfinder_url'])), 'setting');
|
||||
return array(
|
||||
'elfinder' => array(
|
||||
'extensions' => array('elfinder' => t('elFinder')),
|
||||
'url' => $options['homepage_url'],
|
||||
'options' => array(),
|
||||
'load' => FALSE,
|
||||
),
|
||||
);
|
||||
drupal_add_js($options['plugin_url_base'] . '/yui.js');
|
||||
drupal_add_js(array('elfinder' => array('file_browser_url' => $options['elfinder_url'])), 'setting');
|
||||
return array(
|
||||
'elfinder' => array(
|
||||
'extensions' => array('elfinder' => t('elFinder')),
|
||||
'url' => $options['homepage_url'],
|
||||
'options' => array(),
|
||||
'load' => FALSE,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
@@ -1,33 +1,41 @@
|
||||
/*
|
||||
* elFinder Integration
|
||||
*
|
||||
* Copyright (c) 2010-2018, Alexey Sukhotin. All rights reserved.
|
||||
*/
|
||||
|
||||
// $Id: elfinder.yui.js,v 1.1 2010/10/06 09:44:51 ph0enix Exp $
|
||||
|
||||
(function($) {
|
||||
|
||||
Drupal.elfinder.editor.yui = {
|
||||
fn : {
|
||||
attach: Drupal.wysiwyg.editor.attach.yui
|
||||
Drupal.elfinder.editor.yui = {
|
||||
fn: {
|
||||
attach: Drupal.wysiwyg.editor.attach.yui
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Drupal.wysiwyg.editor.attach.yui = function(context, params, settings) {
|
||||
|
||||
$('#' + params.field).parent().addClass('yui-skin-' + settings.theme);
|
||||
// Attach editor.
|
||||
var editor = new YAHOO.widget.Editor(params.field, settings);
|
||||
|
||||
editor.on('windowInsertImageRender', function(e) {
|
||||
|
||||
var dialogcode = $('#' + params.field + '-panel');
|
||||
|
||||
var oUrl = $('input#' + params.field + '_insertimage_url');
|
||||
var browsebutton = $('<input type="button">');
|
||||
Drupal.wysiwyg.editor.attach.yui = function(context, params, settings) {
|
||||
|
||||
browsebutton.attr('value', Drupal.t('Browse Server'));
|
||||
browsebutton.attr('onclick', 'var w = window; w.open("' + Drupal.settings.elfinder.file_browser_url + '","","toolbar=no,menubar=no,width=600,height=600")');
|
||||
browsebutton.insertAfter(oUrl);
|
||||
$('#' + params.field).parent().addClass('yui-skin-' + settings.theme);
|
||||
// Attach editor.
|
||||
var editor = new YAHOO.widget.Editor(params.field, settings);
|
||||
|
||||
}, editor, true);
|
||||
|
||||
editor.render();
|
||||
}
|
||||
editor.on('windowInsertImageRender', function(e) {
|
||||
|
||||
var dialogcode = $('#' + params.field + '-panel');
|
||||
|
||||
|
||||
//var oImgHtml = $('<div>'+imgHtml+'</div>');
|
||||
var oUrl = $('input#' + params.field + '_insertimage_url');
|
||||
var browsebutton = $('<input type="button">');
|
||||
|
||||
browsebutton.attr('value', Drupal.t('Browse Server'));
|
||||
browsebutton.attr('onclick', 'var w = window; w.open("' + Drupal.settings.elfinder.file_browser_url + '","","toolbar=no,menubar=no,width=600,height=600")');
|
||||
browsebutton.insertAfter(oUrl);
|
||||
|
||||
}, editor, true);
|
||||
|
||||
editor.render();
|
||||
}
|
||||
|
||||
})(jQuery);
|
@@ -6,8 +6,9 @@ configure = "admin/config/media/elfinder"
|
||||
core = 7.x
|
||||
project status url = https://drupal-elfinder.sourceforge.io/release-history.php
|
||||
|
||||
; Information added by Drupal.org packaging script on 2018-12-03
|
||||
; Information added by Drupal.org packaging script on 2017-11-16
|
||||
version = "7.x-2.x-dev"
|
||||
core = "7.x"
|
||||
project = "elfinder"
|
||||
datestamp = "1543843700"
|
||||
datestamp = "1555577224"
|
||||
|
||||
|
@@ -1,4 +1,10 @@
|
||||
<?php
|
||||
/**
|
||||
* elFinder Integration
|
||||
*
|
||||
* Copyright (c) 2010-2019, Alexey Sukhotin. All rights reserved.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Installation file for elfinder.
|
||||
@@ -11,77 +17,74 @@ function elfinder_requirements($phase) {
|
||||
require_once drupal_get_path('module', 'elfinder') . "/elfinder.module";
|
||||
|
||||
$requirements = array();
|
||||
|
||||
$ver_major = 0;
|
||||
$ver_minor = 0;
|
||||
$ver_release = 0;
|
||||
$min_major = 2;
|
||||
$min_minor = 0;
|
||||
|
||||
$min_ver = "$min_major.$min_minor";
|
||||
|
||||
$ver_major = 0;
|
||||
$ver_minor = 0;
|
||||
$ver_release = 0;
|
||||
$min_major = 2;
|
||||
$min_minor = 0;
|
||||
|
||||
$min_ver = "$min_major.$min_minor";
|
||||
|
||||
$libpath = elfinder_lib_path();
|
||||
$ver = '';
|
||||
|
||||
|
||||
$install_t = t('Please download it from <a href="@url">@url</a> and install to @libpath.', array('@url' => 'http://elfinder.org', '@libpath' => $libpath));
|
||||
$ver = '';
|
||||
|
||||
|
||||
$install_t = t('Please download it from <a href="@url">@url</a> and install to @libpath.', array('@url' => elfinder_download_url(), '@libpath' => $libpath));
|
||||
|
||||
if ($phase == 'runtime' || $phase == 'install' || $phase == 'update') {
|
||||
$description = t('elFinder library was not found.') . ' ' . $install_t;
|
||||
|
||||
$severity = '';
|
||||
$value = t('Not found');
|
||||
|
||||
if ( (is_readable($libpath . '/connectors/php/elFinder.class.php') || is_readable($libpath . '/php/elFinder.class.php') ) && is_readable($libpath . '/js/elfinder.min.js') ) {
|
||||
|
||||
$editor_file_content = file_get_contents($libpath . '/js/elfinder.min.js');
|
||||
if ((is_readable($libpath . '/connectors/php/elFinder.class.php') || is_readable($libpath . '/php/elFinder.class.php')) && is_readable($libpath . '/js/elfinder.min.js')) {
|
||||
|
||||
$editor_file_content = file_get_contents($libpath . '/js/elfinder.min.js');
|
||||
|
||||
$value = t('Exists');
|
||||
|
||||
if (preg_match("/(?:this|elFinder\.prototype|\.prototype)\.version\s*=\s*[\"\']([^\"\']+)[\"\']/", $editor_file_content, $matches)) {
|
||||
$ver = $matches[1];
|
||||
$ver = $matches[1];
|
||||
$value = t('@ver', array('@ver' => $ver));
|
||||
}
|
||||
|
||||
$description = '';
|
||||
|
||||
if (preg_match("/^(\d+)\.(\d+|x)(\.(\d+))?/", $ver, $matches)) {
|
||||
$ver_major = (int)$matches[1];
|
||||
$ver_minor = $matches[2];
|
||||
$ver = "$ver_major.$ver_minor";
|
||||
if (count($matches) == 5) {
|
||||
$ver_release = (int)$matches[4];
|
||||
$ver = "$ver_major.$ver_minor.$ver_release";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if (($ver_major < $min_major) || ($ver_major == 2 && $ver_minor == '1' && $ver_release < 38)) {
|
||||
$description = t('Not supported elFinder library. Please upgrade to @minver.', array('@ver' => $ver, '@minver' => $min_ver)) . ' ' . $install_t;
|
||||
$severity = REQUIREMENT_ERROR;
|
||||
} else {
|
||||
$severity = REQUIREMENT_OK;
|
||||
}
|
||||
|
||||
$badpaths_check = elfinder_check_badpaths();
|
||||
|
||||
if ($badpaths_check['result'] == FALSE) {
|
||||
$severity = REQUIREMENT_ERROR;
|
||||
$description = $badpaths_check['message'];
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
if (preg_match("/^(\d+)\.(\d+|x)(\.(\d+))?/", $ver, $matches)) {
|
||||
$ver_major = (int)$matches[1];
|
||||
$ver_minor = $matches[2];
|
||||
$ver = "$ver_major.$ver_minor";
|
||||
if (count($matches) == 5) {
|
||||
$ver_release = (int)$matches[4];
|
||||
$ver = "$ver_major.$ver_minor.$ver_release";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (($ver_major < $min_major) || ($ver_major == 2 && $ver_minor == '1' && $ver_release < 38)) {
|
||||
$description = t('Not supported elFinder library. Please upgrade to @minver.', array('@ver' => $ver, '@minver' => $min_ver)) . ' ' . $install_t;
|
||||
$severity = REQUIREMENT_ERROR;
|
||||
} else {
|
||||
$severity = REQUIREMENT_OK;
|
||||
}
|
||||
|
||||
$badpaths_check = elfinder_check_badpaths();
|
||||
|
||||
if ($badpaths_check['result'] == FALSE) {
|
||||
$severity = REQUIREMENT_ERROR;
|
||||
$description = $badpaths_check['message'];
|
||||
}
|
||||
|
||||
} else {
|
||||
$severity = REQUIREMENT_ERROR;
|
||||
}
|
||||
|
||||
$requirements['elfinder'] = array(
|
||||
'title' => 'elFinder',
|
||||
'description' => $description,
|
||||
'value' => $value,
|
||||
'severity' => $severity
|
||||
'title' => 'elFinder',
|
||||
'description' => $description,
|
||||
'value' => $value,
|
||||
'severity' => $severity
|
||||
);
|
||||
}
|
||||
|
||||
@@ -102,47 +105,48 @@ function elfinder_schema() {
|
||||
$schema['elfinder_file_extinfo'] = array(
|
||||
'description' => 'Stores additional filesystem attributes',
|
||||
'fields' => array(
|
||||
'extid' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE),
|
||||
'fid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => FALSE),
|
||||
'description' => array('type' => 'varchar', 'length' => 255, 'not null' => FALSE, 'default' => ''),
|
||||
'extid' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE),
|
||||
'fid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => FALSE),
|
||||
'description' => array('type' => 'varchar', 'length' => 255, 'not null' => FALSE, 'default' => ''),
|
||||
),
|
||||
'primary key' => array('extid'),
|
||||
);
|
||||
|
||||
|
||||
$schema['elfinder_profile'] = array(
|
||||
'description' => 'Stores configuration profiles',
|
||||
'fields' => array(
|
||||
'pid' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE),
|
||||
'name' => array('type' => 'varchar', 'length' => 255, 'not null' => FALSE, 'default' => ''),
|
||||
'description' => array('type' => 'varchar', 'length' => 255, 'not null' => FALSE, 'default' => ''),
|
||||
'settings' => array('type' => 'text', 'not null' => FALSE),
|
||||
'pid' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE),
|
||||
'name' => array('type' => 'varchar', 'length' => 255, 'not null' => FALSE, 'default' => ''),
|
||||
'description' => array('type' => 'varchar', 'length' => 255, 'not null' => FALSE, 'default' => ''),
|
||||
'settings' => array('type' => 'text', 'not null' => FALSE),
|
||||
),
|
||||
'primary key' => array('pid'),
|
||||
);
|
||||
|
||||
|
||||
return $schema;
|
||||
|
||||
|
||||
}
|
||||
|
||||
function elfinder_update_7101() {
|
||||
// drupal_install_schema('elfinder');
|
||||
}
|
||||
|
||||
function elfinder_update_7102() {
|
||||
$ret = array();
|
||||
|
||||
if (db_table_exists('elfinder_profile') == FALSE) {
|
||||
drupal_install_schema('elfinder');
|
||||
drupal_install_schema('elfinder');
|
||||
}
|
||||
|
||||
|
||||
if (!db_field_exists('elfinder_profile', 'settings')) {
|
||||
db_add_field($ret, 'elfinder_profile', 'settings', array('type' => 'text', 'not null' => FALSE));
|
||||
db_add_field($ret, 'elfinder_profile', 'settings', array('type' => 'text', 'not null' => FALSE));
|
||||
}
|
||||
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
function elfinder_update_7103() {
|
||||
drupal_flush_all_caches();
|
||||
drupal_flush_all_caches();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -150,13 +154,12 @@ function elfinder_update_7103() {
|
||||
*/
|
||||
function elfinder_update_7104() {
|
||||
$results = db_query("SELECT pid, name, description, settings from {elfinder_profile}");
|
||||
foreach($results as $row) {
|
||||
foreach ($results as $row) {
|
||||
$settings = unserialize($row->settings);
|
||||
if (!is_array($settings['profile_role'])) {
|
||||
if (isset($settings['profile_role']) && $settings['profile_role'] > 0) {
|
||||
$settings['profile_role'] = array($settings['profile_role'] => $settings['profile_role']);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$settings['profile_role'] = array();
|
||||
}
|
||||
db_update('elfinder_profile')
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,9 @@
|
||||
<?php
|
||||
/**
|
||||
* elFinder Integration
|
||||
*
|
||||
* Copyright (c) 2010-2018, Alexey Sukhotin. All rights reserved.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
@@ -28,30 +33,29 @@ function elfinder_admin_profile_links($profile_name) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Settings form definition
|
||||
*/
|
||||
function elfinder_admin_form(&$form_state) {
|
||||
global $user, $language;
|
||||
$path = drupal_get_path('module', 'elfinder');
|
||||
// require_once $path .'/inc/' . 'elfinder.admin.profiles.inc';
|
||||
// require_once $path .'/inc/' . 'elfinder.admin.profiles.inc';
|
||||
|
||||
$langCode = isset($language->language) ? $language->language : 'en';
|
||||
|
||||
|
||||
$form['profiles'] = array(
|
||||
'#type' => 'fieldset',
|
||||
'#title' => t('Profiles'),
|
||||
'#collapsible' => TRUE,
|
||||
'#collapsed' => FALSE,
|
||||
);
|
||||
|
||||
|
||||
$profiles = elfinder_admin_profile_get();
|
||||
|
||||
|
||||
$roles = user_roles();
|
||||
|
||||
|
||||
$rows = array();
|
||||
|
||||
|
||||
if ($profiles) {
|
||||
if (is_array($profiles)) {
|
||||
foreach ($profiles as $profile) {
|
||||
@@ -61,21 +65,21 @@ function elfinder_admin_form(&$form_state) {
|
||||
$profile = $profiles;
|
||||
$rows[] = array($profile->pid, $profile->name, $profile->description, implode(', ', array_intersect_key($roles, $profile->settings['profile_role'])), elfinder_admin_profile_links($profile->name));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
$profile_table = theme('table', array(
|
||||
$profile_table = theme('table', array(
|
||||
'header' => array(t('Id'), t('Name'), t('Description'), t('Role'), ''),
|
||||
'rows' => $rows
|
||||
));
|
||||
|
||||
|
||||
$addprofile = l(t('Add profile'), 'admin/config/media/elfinder/profile');
|
||||
|
||||
|
||||
$form['profiles']['profile_list'] = array(
|
||||
'#type' => 'markup',
|
||||
'#markup' => "$profile_table<br/>$addprofile",
|
||||
);
|
||||
|
||||
|
||||
$form['filesystem_settings'] = array(
|
||||
'#type' => 'fieldset',
|
||||
'#title' => t('File system settings'),
|
||||
@@ -110,7 +114,7 @@ function elfinder_admin_form(&$form_state) {
|
||||
'#default_value' => variable_get('elfinder_settings_filesystem_unmanaged_root_label', ''),
|
||||
'#description' => t('Root directory label in directory tree'),
|
||||
);
|
||||
|
||||
|
||||
$form['filesystem_settings']['filesystem_root_custom'] = array(
|
||||
'#prefix' => '<div class="custom-container">',
|
||||
'#suffix' => '</div>',
|
||||
@@ -137,7 +141,7 @@ function elfinder_admin_form(&$form_state) {
|
||||
'auto' => t('Automatical detection'),
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
$form['filesystem_settings']['filesystem_allowed_extensions'] = array(
|
||||
'#prefix' => '<div class="custom-container">',
|
||||
'#suffix' => '</div>',
|
||||
@@ -147,7 +151,7 @@ function elfinder_admin_form(&$form_state) {
|
||||
'#default_value' => variable_get('elfinder_settings_filesystem_allowed_extensions', ''),
|
||||
'#description' => t('Separate extensions with a space or comma and do not include the leading dot.'),
|
||||
);
|
||||
|
||||
|
||||
if (function_exists('finfo_open')) {
|
||||
$form['filesystem_settings']['mime_detect']['#options']['finfo'] = t('php finfo');
|
||||
}
|
||||
@@ -160,8 +164,41 @@ function elfinder_admin_form(&$form_state) {
|
||||
$form['filesystem_settings']['mime_detect']['#options']['bsd'] = t('file -Ib (bsd)');
|
||||
$form['filesystem_settings']['mime_detect']['#options']['internal'] = t('By file extension (built-in)');
|
||||
$form['filesystem_settings']['mime_detect']['#options']['drupal'] = t('Drupal API');
|
||||
|
||||
|
||||
|
||||
|
||||
$form['filesystem_settings']['filesystem_inline_preview'] = array(
|
||||
'#type' => 'radios',
|
||||
'#title' => t('Preview'),
|
||||
'#default_value' => variable_get('elfinder_settings_filesystem_inline_preview', 'default'),
|
||||
'#description' => t('File types allowed to display in preview'),
|
||||
'#options' => array(
|
||||
'default' => t('Default - images, video, audio, pdf, text'),
|
||||
'all' => t('All supported for preview files - additional: md, psd, html, archives, swf, sharecad.org, MS Office Online, Google Docs - be careful'),
|
||||
'custom' => t('Custom regex'),
|
||||
'disabled' => t('Disabled'),
|
||||
),
|
||||
);
|
||||
|
||||
$form['filesystem_settings']['filesystem_inline_preview_custom'] = array(
|
||||
'#prefix' => '<div class="custom-container">',
|
||||
'#suffix' => '</div>',
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Custom preview match regex'),
|
||||
'#default_value' => variable_get('elfinder_settings_filesystem_inlinepreviewcustom', '^(?:(?:image|video|audio)|application/(?:x-mpegURL|dash\\+xml)|(?:text/plain|application/pdf)$)'),
|
||||
'#description' => t('Custom mime type match regex for preview'),
|
||||
);
|
||||
|
||||
$form['filesystem_settings']['filesystem_external_preview'] = array(
|
||||
'#type' => 'radios',
|
||||
'#title' => t('External Service Preview'),
|
||||
'#default_value' => variable_get('elfinder_settings_filesystem_external_preview', 'disabled'),
|
||||
'#description' => t('Use Microsoft, Google and other online services to preview some office documents. <b>Warning!</b> By previewing document with external services <b>YOU ARE ULOADING</b> the document to them. Google, Microsoft and other service owners usually <b>TRACK</b> your activity and <b>share it with Sales, CIA, FSB (KGB), FBI, governors, etc.</b>'),
|
||||
'#options' => array(
|
||||
'default' => t('Use Microsoft Office and Google Docs for preview'),
|
||||
'disabled' => t('Disabled'),
|
||||
),
|
||||
);
|
||||
|
||||
$form['filesystem_settings']['file_url_type'] = array(
|
||||
'#type' => 'radios',
|
||||
'#title' => t('Selected file url type'),
|
||||
@@ -170,7 +207,7 @@ function elfinder_admin_form(&$form_state) {
|
||||
'true' => t('Absolute'),
|
||||
'false' => t('Relative'),
|
||||
),
|
||||
);
|
||||
);
|
||||
|
||||
$form['filesystem_settings']['file_perm'] = array(
|
||||
'#type' => 'textfield',
|
||||
@@ -195,7 +232,7 @@ function elfinder_admin_form(&$form_state) {
|
||||
'#size' => 10,
|
||||
'#weight' => 5,
|
||||
);
|
||||
|
||||
|
||||
$form['filesystem_settings']['max_filecount'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Maximum folder size'),
|
||||
@@ -204,7 +241,7 @@ function elfinder_admin_form(&$form_state) {
|
||||
'#size' => 10,
|
||||
'#weight' => 5,
|
||||
);
|
||||
|
||||
|
||||
$form['filesystem_settings']['handleprivate'] = array(
|
||||
'#type' => 'radios',
|
||||
'#title' => t('Handle private downloads'),
|
||||
@@ -222,7 +259,7 @@ function elfinder_admin_form(&$form_state) {
|
||||
'#collapsible' => TRUE,
|
||||
'#collapsed' => FALSE,
|
||||
);
|
||||
|
||||
|
||||
$form['thumbnail_settings']['tmbsize'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Thumbnail size'),
|
||||
@@ -244,7 +281,7 @@ function elfinder_admin_form(&$form_state) {
|
||||
'#options' => array(
|
||||
'auto' => t('Automatical detection'),
|
||||
'imagick' => t('Image Magick'),
|
||||
'gd' => t('GD'),
|
||||
'gd' => t('GD'),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -265,7 +302,7 @@ function elfinder_admin_form(&$form_state) {
|
||||
'#collapsible' => TRUE,
|
||||
'#collapsed' => FALSE,
|
||||
);
|
||||
|
||||
|
||||
$form['misc_settings']['rememberlastdir'] = array(
|
||||
'#type' => 'radios',
|
||||
'#title' => t('Remember last opened directory'),
|
||||
@@ -312,7 +349,7 @@ function elfinder_admin_form(&$form_state) {
|
||||
|
||||
$form['submit'] = array('#type' => 'submit', '#value' => t('Save configuration'));
|
||||
$form['#submit'][] = 'elfinder_admin_submit';
|
||||
|
||||
|
||||
return $form;
|
||||
}
|
||||
|
||||
@@ -344,11 +381,25 @@ function elfinder_admin_submit($form, &$form_state) {
|
||||
variable_set('elfinder_settings_filesystem_public_root_label', $form_state['values']['filesystem_public_root_label']);
|
||||
variable_set('elfinder_settings_filesystem_private_root_label', $form_state['values']['filesystem_private_root_label']);
|
||||
variable_set('elfinder_settings_filesystem_unmanaged_root_label', $form_state['values']['filesystem_unmanaged_root_label']);
|
||||
variable_set('elfinder_settings_misc_manager_width', $form_state['values']['manager_width']);
|
||||
variable_set('elfinder_settings_misc_manager_height', $form_state['values']['manager_height']);
|
||||
variable_set('elfinder_settings_misc_manager_width', $form_state['values']['manager_width']);
|
||||
variable_set('elfinder_settings_misc_manager_height', $form_state['values']['manager_height']);
|
||||
variable_set('elfinder_settings_misc_hidden_folders', $form_state['values']['hidden_folders']);
|
||||
variable_set('elfinder_settings_filesystem_allowed_extensions', $form_state['values']['filesystem_allowed_extensions']);
|
||||
|
||||
|
||||
if ($form_state['values']['filesystem_inline_preview'] == 'default') {
|
||||
variable_set('elfinder_settings_filesystem_inlinepreviewregex', '^(?:(?:image|video|audio)|application/(?:x-mpegURL|dash\\+xml)|(?:text/plain|application/pdf)$)');
|
||||
} else if ($form_state['values']['filesystem_inline_preview'] == 'all') {
|
||||
variable_set('elfinder_settings_filesystem_inlinepreviewregex', '.');
|
||||
} else if ($form_state['values']['filesystem_inline_preview'] == 'custom') {
|
||||
variable_set('elfinder_settings_filesystem_inlinepreviewregex', variable_get('elfinder_settings_filesystem_inlinepreviewcustom', '^$'));
|
||||
} else {
|
||||
variable_set('elfinder_settings_filesystem_inlinepreviewregex', '^$');
|
||||
}
|
||||
|
||||
variable_set('elfinder_settings_filesystem_inline_preview', $form_state['values']['filesystem_inline_preview']);
|
||||
variable_set('elfinder_settings_filesystem_inlinepreviewcustom', $form_state['values']['filesystem_inline_preview_custom']);
|
||||
variable_set('elfinder_settings_filesystem_external_preview', $form_state['values']['filesystem_external_preview']);
|
||||
|
||||
drupal_set_message(t('Changes have been saved.'));
|
||||
}
|
||||
|
||||
@@ -398,4 +449,4 @@ function elfinder_admin_form_validate($form, &$form_state) {
|
||||
if ($tmbsize && !is_numeric($tmbsize)) {
|
||||
form_set_error('tmbsize', t('Thumbnail size should be a number'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,4 +1,9 @@
|
||||
<?php
|
||||
/**
|
||||
* elFinder Integration
|
||||
*
|
||||
* Copyright (c) 2010-2018, Alexey Sukhotin. All rights reserved.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
@@ -31,69 +36,69 @@ function elfinder_admin_profile($form, &$form_state) {
|
||||
|
||||
if ($action == 'profile_add') {
|
||||
$form['profile_name'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Profile Name'),
|
||||
'#default_value' => '',
|
||||
'#size' => 14,
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Profile Name'),
|
||||
'#default_value' => '',
|
||||
'#size' => 14,
|
||||
);
|
||||
} else {
|
||||
$form['profile_name_label'] = array(
|
||||
'#title' => t('Profile Name'),
|
||||
'#markup' => $profile_name,
|
||||
'#size' => 14,
|
||||
'#type' => 'item',
|
||||
'#title' => t('Profile Name'),
|
||||
'#markup' => $profile_name,
|
||||
'#size' => 14,
|
||||
'#type' => 'item',
|
||||
);
|
||||
|
||||
$form['profile_name'] = array(
|
||||
'#default_value' => $profile_name,
|
||||
'#type' => 'hidden',
|
||||
'#default_value' => $profile_name,
|
||||
'#type' => 'hidden',
|
||||
);
|
||||
}
|
||||
|
||||
$form['profile_description'] = array(
|
||||
'#type' => 'textarea',
|
||||
'#title' => t('Description'),
|
||||
'#default_value' => isset($p->description) ? $p->description : '',
|
||||
'#type' => 'textarea',
|
||||
'#title' => t('Description'),
|
||||
'#default_value' => isset($p->description) ? $p->description : '',
|
||||
);
|
||||
|
||||
$form['profile_role'] = array(
|
||||
'#type' => 'checkboxes',
|
||||
'#title' => t('Roles'),
|
||||
'#default_value' => isset($profile['profile_role']) ? array_keys($profile['profile_role']) : array(),
|
||||
'#options' => user_roles(),
|
||||
'#description' => t('Roles for which profile settings will be applied'),
|
||||
'#type' => 'checkboxes',
|
||||
'#title' => t('Roles'),
|
||||
'#default_value' => isset($profile['profile_role']) ? array_keys($profile['profile_role']) : array(),
|
||||
'#options' => user_roles(),
|
||||
'#description' => t('Roles for which profile settings will be applied'),
|
||||
);
|
||||
|
||||
$form['profile_action'] = array(
|
||||
'#default_value' => $action,
|
||||
'#type' => 'hidden',
|
||||
'#default_value' => $action,
|
||||
'#type' => 'hidden',
|
||||
);
|
||||
|
||||
$form['filesystem_settings'] = array(
|
||||
'#type' => 'fieldset',
|
||||
'#title' => t('File system'),
|
||||
'#collapsible' => TRUE,
|
||||
'#collapsed' => TRUE,
|
||||
'#type' => 'fieldset',
|
||||
'#title' => t('File system'),
|
||||
'#collapsible' => TRUE,
|
||||
'#collapsed' => TRUE,
|
||||
);
|
||||
|
||||
$form['volumes'] = array(
|
||||
'#type' => 'fieldset',
|
||||
'#title' => t('Volumes'),
|
||||
'#collapsible' => TRUE,
|
||||
'#collapsed' => FALSE,
|
||||
'#type' => 'fieldset',
|
||||
'#title' => t('Volumes'),
|
||||
'#collapsible' => TRUE,
|
||||
'#collapsed' => FALSE,
|
||||
);
|
||||
|
||||
$form['volumes']['volumes_wrapper'] = array(
|
||||
'#weight' => -4,
|
||||
'#prefix' => '<div class="clear-block" id="poll-choice-wrapper">',
|
||||
'#suffix' => '</div>',
|
||||
'#weight' => -4,
|
||||
'#prefix' => '<div class="clear-block" id="poll-choice-wrapper">',
|
||||
'#suffix' => '</div>',
|
||||
);
|
||||
|
||||
$form['volumes']['volumes_wrapper']['volume'] = array(
|
||||
'#prefix' => '<div id="profile-volumes">',
|
||||
'#suffix' => '</div>',
|
||||
'#type' => 'markup',
|
||||
'#value' => ' ',
|
||||
'#prefix' => '<div id="profile-volumes">',
|
||||
'#suffix' => '</div>',
|
||||
'#type' => 'markup',
|
||||
'#value' => ' ',
|
||||
);
|
||||
|
||||
|
||||
@@ -129,35 +134,35 @@ function elfinder_admin_profile($form, &$form_state) {
|
||||
foreach ($form['volumes']['volumes_wrapper']['volume'] as $volume) {
|
||||
if (is_array($volume) && isset($volume['volume_settings'])) {
|
||||
$ckeditor_volumes[] = t('Volume @i (@path)', array(
|
||||
'@i' => $i,
|
||||
'@path' => $volume['volume_settings']['path']['#default_value'],
|
||||
));
|
||||
'@i' => $i,
|
||||
'@path' => $volume['volume_settings']['path']['#default_value'],
|
||||
));
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
$form['volumes']['volumes_wrapper']['volume_add'] = array(
|
||||
'#type' => 'submit',
|
||||
'#value' => t('Add volume'),
|
||||
'#weight' => 1,
|
||||
'#name' => 'addfield',
|
||||
'#submit' => array('elfinder_admin_profile_change_volume'),
|
||||
'#ajax' => array(
|
||||
'wrapper' => 'profile-volumes',
|
||||
'callback' => 'elfinder_admin_profile_callback',
|
||||
'method' => 'replace',
|
||||
'effect' => 'fade',
|
||||
),
|
||||
'#type' => 'submit',
|
||||
'#value' => t('Add volume'),
|
||||
'#weight' => 1,
|
||||
'#name' => 'addfield',
|
||||
'#submit' => array('elfinder_admin_profile_change_volume'),
|
||||
'#ajax' => array(
|
||||
'wrapper' => 'profile-volumes',
|
||||
'callback' => 'elfinder_admin_profile_callback',
|
||||
'method' => 'replace',
|
||||
'effect' => 'fade',
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
$form['filesystem_settings']['mime_detect'] = array(
|
||||
'#type' => 'radios',
|
||||
'#title' => t('File type detection'),
|
||||
'#default_value' => isset($profile['mimedetect']) ? $profile['mimedetect'] : 'auto',
|
||||
'#options' => array(
|
||||
'auto' => t('Automatical detection'),
|
||||
),
|
||||
'#type' => 'radios',
|
||||
'#title' => t('File type detection'),
|
||||
'#default_value' => isset($profile['mimedetect']) ? $profile['mimedetect'] : 'auto',
|
||||
'#options' => array(
|
||||
'auto' => t('Automatical detection'),
|
||||
),
|
||||
);
|
||||
|
||||
if (function_exists('finfo_open')) {
|
||||
@@ -175,144 +180,144 @@ function elfinder_admin_profile($form, &$form_state) {
|
||||
|
||||
|
||||
$form['filesystem_settings']['file_url_type'] = array(
|
||||
'#type' => 'radios',
|
||||
'#title' => t('Selected file url type'),
|
||||
'#default_value' => $profile['file_url_type'] == 'true' ? 'true' : 'false',
|
||||
'#options' => array(
|
||||
'true' => t('Absolute'),
|
||||
'false' => t('Relative'),
|
||||
),
|
||||
'#type' => 'radios',
|
||||
'#title' => t('Selected file url type'),
|
||||
'#default_value' => $profile['file_url_type'] == 'true' ? 'true' : 'false',
|
||||
'#options' => array(
|
||||
'true' => t('Absolute'),
|
||||
'false' => t('Relative'),
|
||||
),
|
||||
);
|
||||
|
||||
$form['filesystem_settings']['file_perm'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Created file permissions'),
|
||||
'#default_value' => isset($profile['file_perm']) ? $profile['file_perm'] : '0666',
|
||||
'#size' => 4,
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Created file permissions'),
|
||||
'#default_value' => isset($profile['file_perm']) ? $profile['file_perm'] : '0666',
|
||||
'#size' => 4,
|
||||
);
|
||||
|
||||
$form['filesystem_settings']['dir_perm'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Created directory permissions'),
|
||||
'#default_value' => isset($profile['dir_perm']) ? $profile['dir_perm'] : '0777',
|
||||
'#size' => 4,
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Created directory permissions'),
|
||||
'#default_value' => isset($profile['dir_perm']) ? $profile['dir_perm'] : '0777',
|
||||
'#size' => 4,
|
||||
);
|
||||
|
||||
|
||||
$form['filesystem_settings']['max_filesize'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Maximum upload size'),
|
||||
'#default_value' => isset($profile['max_filesize']) ? $profile['max_filesize'] : '',
|
||||
'#description' => t('Enter a value like "512" (bytes), "80 KB" (kilobytes) or "50 MB" (megabytes) in order to restrict the allowed file size. If left empty the file sizes will be limited only by PHP\'s maximum post and file upload sizes (current limit <strong>%limit</strong>).', array('%limit' => format_size(file_upload_max_size()))),
|
||||
'#size' => 10,
|
||||
'#weight' => 5,
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Maximum upload size'),
|
||||
'#default_value' => isset($profile['max_filesize']) ? $profile['max_filesize'] : '',
|
||||
'#description' => t('Enter a value like "512" (bytes), "80 KB" (kilobytes) or "50 MB" (megabytes) in order to restrict the allowed file size. If left empty the file sizes will be limited only by PHP\'s maximum post and file upload sizes (current limit <strong>%limit</strong>).', array('%limit' => format_size(file_upload_max_size()))),
|
||||
'#size' => 10,
|
||||
'#weight' => 5,
|
||||
);
|
||||
|
||||
$form['filesystem_settings']['user_quota'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('User quota'),
|
||||
'#default_value' => isset($profile['user_quota']) ? $profile['user_quota'] : '',
|
||||
'#description' => t('Enter a value like "512" (bytes), "80 KB" (kilobytes) or "50 MB" (megabytes) in order to restrict the allowed file size. If left empty the file sizes will be unlimited.'),
|
||||
'#size' => 10,
|
||||
'#weight' => 5,
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('User quota'),
|
||||
'#default_value' => isset($profile['user_quota']) ? $profile['user_quota'] : '',
|
||||
'#description' => t('Enter a value like "512" (bytes), "80 KB" (kilobytes) or "50 MB" (megabytes) in order to restrict the allowed file size. If left empty the file sizes will be unlimited.'),
|
||||
'#size' => 10,
|
||||
'#weight' => 5,
|
||||
);
|
||||
|
||||
$form['thumbnail_settings'] = array(
|
||||
'#type' => 'fieldset',
|
||||
'#title' => t('Thumbnails'),
|
||||
'#collapsible' => TRUE,
|
||||
'#collapsed' => TRUE,
|
||||
'#type' => 'fieldset',
|
||||
'#title' => t('Thumbnails'),
|
||||
'#collapsible' => TRUE,
|
||||
'#collapsed' => TRUE,
|
||||
);
|
||||
|
||||
$form['thumbnail_settings']['tmbsize'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Thumbnail size'),
|
||||
'#default_value' => isset($profile['tmbsize']) ? $profile['tmbsize'] : '48',
|
||||
'#size' => 4,
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Thumbnail size'),
|
||||
'#default_value' => isset($profile['tmbsize']) ? $profile['tmbsize'] : '48',
|
||||
'#size' => 4,
|
||||
);
|
||||
|
||||
$form['thumbnail_settings']['tmbdirname'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Thumbnail directory name'),
|
||||
'#default_value' => isset($profile['tmbdirname']) ? $profile['tmbdirname'] : 'tmb',
|
||||
'#size' => 10,
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Thumbnail directory name'),
|
||||
'#default_value' => isset($profile['tmbdirname']) ? $profile['tmbdirname'] : 'tmb',
|
||||
'#size' => 10,
|
||||
);
|
||||
|
||||
$form['thumbnail_settings']['imglib'] = array(
|
||||
'#type' => 'radios',
|
||||
'#title' => t('Image manipulation library'),
|
||||
'#default_value' => isset($profile['imglib']) ? $profile['imglib'] : 'auto',
|
||||
'#options' => array(
|
||||
'auto' => t('Automatical detection'),
|
||||
'imagick' => t('Image Magick'),
|
||||
'gd' => t('GD'),
|
||||
),
|
||||
'#type' => 'radios',
|
||||
'#title' => t('Image manipulation library'),
|
||||
'#default_value' => isset($profile['imglib']) ? $profile['imglib'] : 'auto',
|
||||
'#options' => array(
|
||||
'auto' => t('Automatical detection'),
|
||||
'imagick' => t('Image Magick'),
|
||||
'gd' => t('GD'),
|
||||
),
|
||||
);
|
||||
|
||||
$form['thumbnail_settings']['tmbcrop'] = array(
|
||||
'#type' => 'radios',
|
||||
'#title' => t('Image crop'),
|
||||
'#default_value' => $profile['tmbcrop'] == 'true' ? 'true' : 'false',
|
||||
'#options' => array(
|
||||
'true' => t('Yes'),
|
||||
'false' => t('No'),
|
||||
),
|
||||
'#description' => t('Crop image to fit thumbnail size. Yes - crop, No - scale image to fit thumbnail size.'),
|
||||
'#type' => 'radios',
|
||||
'#title' => t('Image crop'),
|
||||
'#default_value' => $profile['tmbcrop'] == 'true' ? 'true' : 'false',
|
||||
'#options' => array(
|
||||
'true' => t('Yes'),
|
||||
'false' => t('No'),
|
||||
),
|
||||
'#description' => t('Crop image to fit thumbnail size. Yes - crop, No - scale image to fit thumbnail size.'),
|
||||
);
|
||||
|
||||
$form['misc_settings'] = array(
|
||||
'#type' => 'fieldset',
|
||||
'#title' => t('Miscellaneous'),
|
||||
'#collapsible' => TRUE,
|
||||
'#collapsed' => TRUE,
|
||||
'#type' => 'fieldset',
|
||||
'#title' => t('Miscellaneous'),
|
||||
'#collapsible' => TRUE,
|
||||
'#collapsed' => TRUE,
|
||||
);
|
||||
|
||||
$form['misc_settings']['rememberlastdir'] = array(
|
||||
'#type' => 'radios',
|
||||
'#title' => t('Remember last opened directory'),
|
||||
'#default_value' => $profile['rememberlastdir'] == 'true' ? 'true' : 'false',
|
||||
'#options' => array(
|
||||
'true' => t('Yes'),
|
||||
'false' => t('No'),
|
||||
),
|
||||
'#description' => t('Creates a cookie. Disable if you have issues with caching.'),
|
||||
'#type' => 'radios',
|
||||
'#title' => t('Remember last opened directory'),
|
||||
'#default_value' => $profile['rememberlastdir'] == 'true' ? 'true' : 'false',
|
||||
'#options' => array(
|
||||
'true' => t('Yes'),
|
||||
'false' => t('No'),
|
||||
),
|
||||
'#description' => t('Creates a cookie. Disable if you have issues with caching.'),
|
||||
);
|
||||
|
||||
|
||||
$form['misc_settings']['manager_width'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('File manager width'),
|
||||
'#default_value' => isset($profile['manager_width']) ? $profile['manager_width'] : '',
|
||||
'#size' => 4,
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('File manager width'),
|
||||
'#default_value' => isset($profile['manager_width']) ? $profile['manager_width'] : '',
|
||||
'#size' => 4,
|
||||
);
|
||||
|
||||
$form['misc_settings']['manager_height'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('File manager height'),
|
||||
'#default_value' => isset($profile['manager_height']) ? $profile['manager_height'] : '',
|
||||
'#size' => 4,
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('File manager height'),
|
||||
'#default_value' => isset($profile['manager_height']) ? $profile['manager_height'] : '',
|
||||
'#size' => 4,
|
||||
);
|
||||
|
||||
$form['misc_settings']['ckeditor_upload_settings'] = array(
|
||||
'#type' => 'fieldset',
|
||||
'#title' => t('CKEditor/FCKeditor Upload Settings'),
|
||||
'#collapsible' => TRUE,
|
||||
'#collapsed' => TRUE,
|
||||
'#description' => t('CKEditor and FCKeditor allowing to upload and insert image files directly from Insert Image dialog.'),
|
||||
'#type' => 'fieldset',
|
||||
'#title' => t('CKEditor/FCKeditor Upload Settings'),
|
||||
'#collapsible' => TRUE,
|
||||
'#collapsed' => TRUE,
|
||||
'#description' => t('CKEditor and FCKeditor allowing to upload and insert image files directly from Insert Image dialog.'),
|
||||
);
|
||||
|
||||
$form['misc_settings']['ckeditor_upload_settings']['ckeditor_upload_directory'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Path'),
|
||||
'#default_value' => isset($profile['ckeditor_upload_directory']) ? $profile['ckeditor_upload_directory'] : '',
|
||||
'#size' => 40,
|
||||
'#description' => t('Image upload path. Default file uri is used if no uri prefix specified. Examples: public://ckeditor - image will be uploaded into public://ckeditor; images/ckeditor - image will be uploaded to :uriimages/ckeditor', array(':uri' => file_build_uri(''))),
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Path'),
|
||||
'#default_value' => isset($profile['ckeditor_upload_directory']) ? $profile['ckeditor_upload_directory'] : '',
|
||||
'#size' => 40,
|
||||
'#description' => t('Image upload path. Default file uri is used if no uri prefix specified. Examples: public://ckeditor - image will be uploaded into public://ckeditor; images/ckeditor - image will be uploaded to :uriimages/ckeditor', array(':uri' => file_build_uri(''))),
|
||||
);
|
||||
|
||||
$form['submit'] = array(
|
||||
'#type' => 'submit',
|
||||
'#name' => 'save_profile',
|
||||
'#value' => t('Save configuration')
|
||||
'#type' => 'submit',
|
||||
'#name' => 'save_profile',
|
||||
'#value' => t('Save configuration')
|
||||
);
|
||||
|
||||
$form['#submit'][] = 'elfinder_admin_submit';
|
||||
@@ -343,8 +348,8 @@ function elfinder_admin_profiles($action = '', $profile_name = '') {
|
||||
function elfinder_admin_profiles_delete_form($form_id, &$form_state, $action, $profile_name) {
|
||||
$form = array();
|
||||
$form['profile_name'] = array(
|
||||
'#type' => 'hidden',
|
||||
'#default_value' => $profile_name,
|
||||
'#type' => 'hidden',
|
||||
'#default_value' => $profile_name,
|
||||
);
|
||||
|
||||
|
||||
@@ -381,53 +386,53 @@ function elfinder_admin_dir_form($delta, $values = array(), $votes = 0) {
|
||||
|
||||
|
||||
$form['volume_settings'] = array(
|
||||
'#type' => 'fieldset',
|
||||
'#title' => t('Volume @n (@p)', array('@n' => ($delta + 1), '@p' => $values['path'])),
|
||||
'#collapsible' => TRUE,
|
||||
'#collapsed' => FALSE,
|
||||
'#type' => 'fieldset',
|
||||
'#title' => t('Volume @n (@p)', array('@n' => ($delta + 1), '@p' => isset($values['path']) ? $values['path'] : '')),
|
||||
'#collapsible' => TRUE,
|
||||
'#collapsed' => FALSE,
|
||||
);
|
||||
|
||||
$form['volume_settings']['path'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Path'),
|
||||
'#default_value' => isset($values['path']) ? $values['path'] : '',
|
||||
'#parents' => array('volume', $delta, 'path'),
|
||||
'#prefix' => '<div class="elfinder-field-wrapper-volume-path">',
|
||||
'#suffix' => '</div>',
|
||||
'#size' => 40,
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Path'),
|
||||
'#default_value' => isset($values['path']) ? $values['path'] : '',
|
||||
'#parents' => array('volume', $delta, 'path'),
|
||||
'#prefix' => '<div class="elfinder-field-wrapper-volume-path">',
|
||||
'#suffix' => '</div>',
|
||||
'#size' => 40,
|
||||
);
|
||||
|
||||
$form['volume_settings']['label'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Label'),
|
||||
'#size' => 15,
|
||||
'#default_value' => isset($values['label']) ? $values['label'] : '',
|
||||
'#description' => t('Root directory label in directory tree'),
|
||||
'#parents' => array('volume', $delta, 'label'),
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Label'),
|
||||
'#size' => 15,
|
||||
'#default_value' => isset($values['label']) ? $values['label'] : '',
|
||||
'#description' => t('Root directory label in directory tree'),
|
||||
'#parents' => array('volume', $delta, 'label'),
|
||||
);
|
||||
|
||||
$form['volume_settings']['url'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('URL'),
|
||||
'#default_value' => isset($values['url']) ? $values['url'] : '',
|
||||
'#parents' => array('volume', $delta, 'url'),
|
||||
'#prefix' => '<div class="elfinder-field-wrapper-volume-path">',
|
||||
'#suffix' => '</div>',
|
||||
'#description' => t('Custom URL prefix (default %def)', array('%def' => $defaulturl)),
|
||||
'#size' => 40,
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('URL'),
|
||||
'#default_value' => isset($values['url']) ? $values['url'] : '',
|
||||
'#parents' => array('volume', $delta, 'url'),
|
||||
'#prefix' => '<div class="elfinder-field-wrapper-volume-path">',
|
||||
'#suffix' => '</div>',
|
||||
'#description' => t('Custom URL prefix (default %def)', array('%def' => $defaulturl)),
|
||||
'#size' => 40,
|
||||
);
|
||||
|
||||
$form['volume_settings']['delete'] = array(
|
||||
'#type' => 'submit',
|
||||
'#value' => t('Delete'),
|
||||
'#name' => 'rmfield-' . $delta,
|
||||
'#submit' => array('elfinder_admin_profile_change_volume'),
|
||||
'#ajax' => array(
|
||||
'callback' => 'elfinder_admin_profile_callback',
|
||||
'wrapper' => 'profile-volumes',
|
||||
'method' => 'replace',
|
||||
'effect' => 'fade',
|
||||
),
|
||||
'#type' => 'submit',
|
||||
'#value' => t('Delete'),
|
||||
'#name' => 'rmfield-' . $delta,
|
||||
'#submit' => array('elfinder_admin_profile_change_volume'),
|
||||
'#ajax' => array(
|
||||
'callback' => 'elfinder_admin_profile_callback',
|
||||
'wrapper' => 'profile-volumes',
|
||||
'method' => 'replace',
|
||||
'effect' => 'fade',
|
||||
),
|
||||
);
|
||||
|
||||
return $form;
|
||||
@@ -466,28 +471,28 @@ function elfinder_admin_submit($form, &$form_state) {
|
||||
|
||||
foreach ($settings as $setting) {
|
||||
if (isset($form_state['values'][$setting])) {
|
||||
|
||||
|
||||
/* Excluding empty volumes */
|
||||
if ($setting == 'volume') {
|
||||
for ($i = 0; $i < count($form_state['values']['volume']); $i++) {
|
||||
if (empty($form_state['values']['volume'][$i]['path'])) {
|
||||
unset($form_state['values']['volume'][$i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($setting == 'volume') {
|
||||
for ($i = 0; $i < count($form_state['values']['volume']); $i++) {
|
||||
if (empty($form_state['values']['volume'][$i]['path'])) {
|
||||
unset($form_state['values']['volume'][$i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$profile_settings[$setting] = $form_state['values'][$setting];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Save roles.
|
||||
$profile_settings['profile_role'] = array();
|
||||
foreach($form_state['values']['profile_role'] as $rid) {
|
||||
foreach ($form_state['values']['profile_role'] as $rid) {
|
||||
if ($rid != 0) {
|
||||
$profile_settings['profile_role'][$rid] = $rid;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$profile_name = $form_state['values']['profile_name'];
|
||||
$profile_description = $form_state['values']['profile_description'];
|
||||
|
||||
|
@@ -1,265 +1,285 @@
|
||||
<?php
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* elFinder conenctor class
|
||||
*/
|
||||
|
||||
class elFinderDrupal extends elFinder {
|
||||
public function __construct($opts) {
|
||||
if (is_callable(array($this, 'version'))) {
|
||||
|
||||
$ver = floatval($this->version());
|
||||
|
||||
if (isset(elFinder::$ApiVersion)) {
|
||||
$ver = elFinder::$ApiVersion;
|
||||
}
|
||||
|
||||
if ($ver == 2.1 && is_callable(array($this, 'revision')) && $this->revision() < 37) {
|
||||
$this->connector_unsupported_error();
|
||||
}
|
||||
|
||||
parent::__construct($opts);
|
||||
|
||||
$this->commands['desc'] = array('target' => TRUE, 'content' => FALSE);
|
||||
$this->commands['owner'] = array('target' => TRUE, 'content' => FALSE);
|
||||
$this->commands['downloadcount'] = array('target' => TRUE);
|
||||
|
||||
} else {
|
||||
$this->connector_unsupported_error();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function connector_unsupported_error() {
|
||||
$this->connector_error(t('Unsupported elFinder library version. Please upgrade.'));
|
||||
}
|
||||
|
||||
public function connector_error($message) {
|
||||
exit(drupal_json_encode(array('error' => array(strip_tags($message)))));
|
||||
}
|
||||
|
||||
/* Overriding search query argument name 'q' since it's already used in Drupal */
|
||||
|
||||
public function commandArgsList($cmd) {
|
||||
$this->commands['search']['elfinder_search_q'] = TRUE;
|
||||
return $this->commandExists($cmd) ? $this->commands[$cmd] : array();
|
||||
}
|
||||
|
||||
protected function search($args) {
|
||||
$q = trim($args['elfinder_search_q']);
|
||||
$mimes = !empty($args['mimes']) && is_array($args['mimes']) ? $args['mimes'] : array();
|
||||
$target = !empty($args['target']) ? $args['target'] : null;
|
||||
$result = array();
|
||||
$errors = array();
|
||||
|
||||
if ($target) {
|
||||
if ($volume = $this->volume($target)) {
|
||||
$result = $volume->search($q, $mimes, $target);
|
||||
$errors = array_merge($errors, $volume->error());
|
||||
}
|
||||
} else {
|
||||
foreach ($this->volumes as $volume) {
|
||||
$result = array_merge($result, $volume->search($q, $mimes));
|
||||
$errors = array_merge($errors, $volume->error());
|
||||
}
|
||||
}
|
||||
|
||||
// Exclude hidden folders from search results.
|
||||
$hidden_folders = variable_get('elfinder_settings_misc_hidden_folders', '');
|
||||
if($hidden_folders) {
|
||||
$hidden_folders = explode(',', $hidden_folders);
|
||||
foreach($result AS $key => $file) {
|
||||
$parts = explode('/', $file['path']);
|
||||
if(in_array($parts[1], $hidden_folders)) {
|
||||
unset($result[$key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$result = array('files' => $result);
|
||||
if ($errors) {
|
||||
$result['warning'] = $errors;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
protected function desc($args) {
|
||||
$target = $args['target'];
|
||||
$desc = $args['content'];
|
||||
$error = array(self::ERROR_UNKNOWN, '#' . $target);
|
||||
|
||||
if (($volume = $this->volume($target)) == FALSE
|
||||
|| ($file = $volume->file($target)) == FALSE) {
|
||||
return array('error' => $this->error($error, self::ERROR_FILE_NOT_FOUND));
|
||||
}
|
||||
|
||||
$error[1] = $file['name'];
|
||||
|
||||
if ($volume->driverId() == 'f') {
|
||||
return array('desc' => '');
|
||||
}
|
||||
|
||||
if ($volume->commandDisabled('desc')) {
|
||||
return array('error' => $this->error($error, self::ERROR_ACCESS_DENIED));
|
||||
}
|
||||
|
||||
if (($desc = $volume->desc($target, $desc)) == -1) {
|
||||
return array('error' => $this->error($error, $volume->error()));
|
||||
}
|
||||
|
||||
return array('desc' => $desc);
|
||||
}
|
||||
|
||||
protected function owner($args) {
|
||||
$target = $args['target'];
|
||||
|
||||
$error = array(self::ERROR_UNKNOWN, '#' . $target);
|
||||
|
||||
if (($volume = $this->volume($target)) == FALSE
|
||||
|| ($file = $volume->file($target)) == FALSE) {
|
||||
return array('error' => $this->error($error, self::ERROR_FILE_NOT_FOUND));
|
||||
}
|
||||
|
||||
$error[1] = $file['name'];
|
||||
|
||||
if ($volume->driverId() == 'f') {
|
||||
return array('owner' => '');
|
||||
}
|
||||
|
||||
if ($volume->commandDisabled('owner')) {
|
||||
return array('error' => $this->error($error, self::ERROR_ACCESS_DENIED));
|
||||
}
|
||||
|
||||
if (($owner = $volume->owner($target)) == FALSE) {
|
||||
return array('error' => $this->error($error, $volume->error()));
|
||||
}
|
||||
|
||||
return array('owner' => $owner);
|
||||
}
|
||||
|
||||
protected function downloadcount($args) {
|
||||
$target = $args['target'];
|
||||
|
||||
$error = array(self::ERROR_UNKNOWN, '#' . $target);
|
||||
|
||||
if (($volume = $this->volume($target)) == FALSE
|
||||
|| ($file = $volume->file($target)) == FALSE) {
|
||||
return array('error' => $this->error($error, self::ERROR_FILE_NOT_FOUND));
|
||||
}
|
||||
|
||||
$error[1] = $file['name'];
|
||||
|
||||
if ($volume->driverId() == 'f') {
|
||||
return array('downloadcount' => '');
|
||||
}
|
||||
|
||||
if ($volume->commandDisabled('downloadcount')) {
|
||||
return array('error' => $this->error($error, self::ERROR_ACCESS_DENIED));
|
||||
}
|
||||
|
||||
if (($downloadcount = $volume->downloadcount($target)) == FALSE) {
|
||||
return array('error' => $this->error($error, $volume->error()));
|
||||
}
|
||||
|
||||
return array('downloadcount' => $downloadcount);
|
||||
}
|
||||
|
||||
/**
|
||||
* Required to output file in browser when volume URL is not set
|
||||
* Return array contains opened file pointer, root itself and required headers
|
||||
*
|
||||
* @param array command arguments
|
||||
* @return array
|
||||
* @author Dmitry (dio) Levashov
|
||||
* */
|
||||
protected function file($args) {
|
||||
$target = $args['target'];
|
||||
$download = !empty($args['download']);
|
||||
$h403 = 'HTTP/1.x 403 Access Denied';
|
||||
$h404 = 'HTTP/1.x 404 Not Found';
|
||||
|
||||
if (($volume = $this->volume($target)) == FALSE) {
|
||||
return array('error' => self::$errors[self::ERROR_FILE_NOT_FOUND], 'header' => $h404, 'raw' => TRUE);
|
||||
}
|
||||
|
||||
if (($file = $volume->file($target)) == FALSE) {
|
||||
return array('error' => self::$errors[self::ERROR_FILE_NOT_FOUND], 'header' => $h404, 'raw' => TRUE);
|
||||
}
|
||||
|
||||
if (!$file['read']) {
|
||||
return array('error' => self::$errors[self::ERROR_ACCESS_DENIED], 'header' => $h403, 'raw' => TRUE);
|
||||
}
|
||||
|
||||
if ($volume->driverId() != 'f' && (($fp = $volume->open($target)) == FALSE)) {
|
||||
return array('error' => self::$errors[self::ERROR_FILE_NOT_FOUND], 'header' => $h404, 'raw' => TRUE);
|
||||
}
|
||||
|
||||
$mime = ($download) ? 'application/octet-stream' : $file['mime'];
|
||||
|
||||
$result = array(
|
||||
'volume' => $volume,
|
||||
'pointer' => $fp,
|
||||
'info' => $file,
|
||||
'header' => array(
|
||||
"Content-Type: " . $mime,
|
||||
"Content-Disposition: " . $this->GetContentDisposition($file['name'], $mime, $download),
|
||||
"Content-Location: " . $file['name'],
|
||||
'Content-Transfer-Encoding: binary',
|
||||
"Content-Length: " . $file['size'],
|
||||
"Connection: close"
|
||||
)
|
||||
);
|
||||
|
||||
$real_path = $this->realpath($target);
|
||||
module_invoke_all('file_download', $volume->drupalpathtouri($real_path));
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generating Content-Disposition HTTP header
|
||||
*
|
||||
* @param string $file Filename
|
||||
* @param string $filemime MIME Type
|
||||
* @param bool $download Disposition type (true = download file, false = open file in browser)
|
||||
* @return string
|
||||
* @author Dmitry (dio) Levashov, Alexey Sukhotin
|
||||
* */
|
||||
public static function GetContentDisposition($file, $filemime, $download = FALSE) {
|
||||
|
||||
$disp = '';
|
||||
$filename = $file;
|
||||
$ua = $_SERVER["HTTP_USER_AGENT"];
|
||||
$mime = $filemime;
|
||||
|
||||
if ($download) {
|
||||
$disp = 'attachment';
|
||||
$mime = 'application/octet-stream';
|
||||
} else {
|
||||
$disp = preg_match('/^(image|text)/i', $mime)
|
||||
|| $mime == 'application/x-shockwave-flash' ? 'inline' : 'attachment';
|
||||
}
|
||||
|
||||
$disp .= '; ';
|
||||
|
||||
if (preg_match("/MSIE ([0-9]{1,}[\.0-9]{0,})/", $ua)) {
|
||||
$filename = rawurlencode($filename);
|
||||
$filename = str_replace("+", "%20", $filename);
|
||||
//$filename = str_replace(" ", "%20", $filename);
|
||||
$disp .= "filename=" . $filename;
|
||||
} elseif (preg_match("/Firefox\/(\d+)/", $ua, $m)) {
|
||||
if ($m[1] >= 8) {
|
||||
$disp .= "filename*=?UTF-8''" . rawurlencode($filename);
|
||||
} else {
|
||||
$disp .= "filename*=\"?UTF-8''" . rawurlencode($filename) . "\";";
|
||||
}
|
||||
} else {
|
||||
$disp .= "filename=" . $filename;
|
||||
}
|
||||
|
||||
return $disp;
|
||||
}
|
||||
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* elFinder Integration
|
||||
*
|
||||
* Copyright (c) 2010-2019, Alexey Sukhotin. All rights reserved.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* elFinder conenctor class
|
||||
*/
|
||||
class elFinderDrupal extends elFinder {
|
||||
|
||||
protected $elFinderDrupalLibVersion;
|
||||
protected $elFinderDrupalLibRevision;
|
||||
|
||||
public function __construct($opts) {
|
||||
if (is_callable(array($this, 'version'))) {
|
||||
|
||||
$this->elFinderDrupalLibVersion = floatval($this->version());
|
||||
|
||||
if (isset(elFinder::$ApiVersion)) {
|
||||
$this->elFinderDrupalLibVersion = elFinder::$ApiVersion;
|
||||
}
|
||||
|
||||
if (is_callable(array($this, 'revision'))) {
|
||||
$this->elFinderDrupalLibRevision = $this->revision();
|
||||
}
|
||||
|
||||
if ($this->elFinderDrupalLibVersion == 2.1 && is_callable(array($this, 'revision')) && $this->revision() < 37) {
|
||||
$this->connector_unsupported_error();
|
||||
}
|
||||
|
||||
parent::__construct($opts);
|
||||
|
||||
$this->commands['desc'] = array('target' => TRUE, 'content' => FALSE);
|
||||
$this->commands['owner'] = array('target' => TRUE, 'content' => FALSE);
|
||||
$this->commands['downloadcount'] = array('target' => TRUE);
|
||||
|
||||
} else {
|
||||
$this->connector_unsupported_error();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function connector_unsupported_error() {
|
||||
$this->connector_error(t('Unsupported elFinder library version. Please upgrade.'));
|
||||
}
|
||||
|
||||
public function connector_error($message) {
|
||||
exit(drupal_json_encode(array('error' => array(strip_tags($message)))));
|
||||
}
|
||||
|
||||
/* Overriding search query argument name 'q' since it's already used in Drupal */
|
||||
|
||||
public function commandArgsList($cmd) {
|
||||
$this->commands['search']['elfinder_search_q'] = TRUE;
|
||||
return $this->commandExists($cmd) ? $this->commands[$cmd] : array();
|
||||
}
|
||||
|
||||
protected function search($args) {
|
||||
$q = trim($args['elfinder_search_q']);
|
||||
$mimes = !empty($args['mimes']) && is_array($args['mimes']) ? $args['mimes'] : array();
|
||||
$target = !empty($args['target']) ? $args['target'] : null;
|
||||
$result = array();
|
||||
$errors = array();
|
||||
|
||||
if ($target) {
|
||||
if ($volume = $this->volume($target)) {
|
||||
$result = $volume->search($q, $mimes, $target);
|
||||
$errors = array_merge($errors, $volume->error());
|
||||
}
|
||||
} else {
|
||||
foreach ($this->volumes as $volume) {
|
||||
$result = array_merge($result, $volume->search($q, $mimes));
|
||||
$errors = array_merge($errors, $volume->error());
|
||||
}
|
||||
}
|
||||
|
||||
// Exclude hidden folders from search results.
|
||||
$hidden_folders = variable_get('elfinder_settings_misc_hidden_folders', '');
|
||||
if($hidden_folders) {
|
||||
$hidden_folders = explode(',', $hidden_folders);
|
||||
foreach($result AS $key => $file) {
|
||||
$parts = explode('/', $file['path']);
|
||||
if(in_array($parts[1], $hidden_folders)) {
|
||||
unset($result[$key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$result = array('files' => $result);
|
||||
if ($errors) {
|
||||
$result['warning'] = $errors;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
protected function desc($args) {
|
||||
$target = $args['target'];
|
||||
$desc = $args['content'];
|
||||
$error = array(self::ERROR_UNKNOWN, '#' . $target);
|
||||
|
||||
if (($volume = $this->volume($target)) == FALSE
|
||||
|| ($file = $volume->file($target)) == FALSE) {
|
||||
return array('error' => $this->error($error, self::ERROR_FILE_NOT_FOUND));
|
||||
}
|
||||
|
||||
$error[1] = $file['name'];
|
||||
|
||||
if ($volume->driverId() == 'f') {
|
||||
return array('desc' => '');
|
||||
}
|
||||
|
||||
if ($volume->commandDisabled('desc')) {
|
||||
return array('error' => $this->error($error, self::ERROR_ACCESS_DENIED));
|
||||
}
|
||||
|
||||
if (($desc = $volume->desc($target, $desc)) == -1) {
|
||||
return array('error' => $this->error($error, $volume->error()));
|
||||
}
|
||||
|
||||
return array('desc' => $desc);
|
||||
}
|
||||
|
||||
protected function owner($args) {
|
||||
$target = $args['target'];
|
||||
|
||||
$error = array(self::ERROR_UNKNOWN, '#' . $target);
|
||||
|
||||
if (($volume = $this->volume($target)) == FALSE
|
||||
|| ($file = $volume->file($target)) == FALSE) {
|
||||
return array('error' => $this->error($error, self::ERROR_FILE_NOT_FOUND));
|
||||
}
|
||||
|
||||
$error[1] = $file['name'];
|
||||
|
||||
if ($volume->driverId() == 'f') {
|
||||
return array('owner' => '');
|
||||
}
|
||||
|
||||
if ($volume->commandDisabled('owner')) {
|
||||
return array('error' => $this->error($error, self::ERROR_ACCESS_DENIED));
|
||||
}
|
||||
|
||||
if (($owner = $volume->owner($target)) == FALSE) {
|
||||
return array('error' => $this->error($error, $volume->error()));
|
||||
}
|
||||
|
||||
return array('owner' => $owner);
|
||||
}
|
||||
|
||||
protected function downloadcount($args) {
|
||||
$target = $args['target'];
|
||||
|
||||
$error = array(self::ERROR_UNKNOWN, '#' . $target);
|
||||
|
||||
if (($volume = $this->volume($target)) == FALSE
|
||||
|| ($file = $volume->file($target)) == FALSE) {
|
||||
return array('error' => $this->error($error, self::ERROR_FILE_NOT_FOUND));
|
||||
}
|
||||
|
||||
$error[1] = $file['name'];
|
||||
|
||||
if ($volume->driverId() == 'f') {
|
||||
return array('downloadcount' => '');
|
||||
}
|
||||
|
||||
if ($volume->commandDisabled('downloadcount')) {
|
||||
return array('error' => $this->error($error, self::ERROR_ACCESS_DENIED));
|
||||
}
|
||||
|
||||
if (($downloadcount = $volume->downloadcount($target)) == FALSE) {
|
||||
return array('error' => $this->error($error, $volume->error()));
|
||||
}
|
||||
|
||||
return array('downloadcount' => $downloadcount);
|
||||
}
|
||||
|
||||
/**
|
||||
* Required to output file in browser when volume URL is not set
|
||||
* Return array contains opened file pointer, root itself and required headers
|
||||
*
|
||||
* @param array command arguments
|
||||
* @return array
|
||||
* @author Dmitry (dio) Levashov
|
||||
* */
|
||||
protected function file($args) {
|
||||
|
||||
if ($this->elFinderDrupalLibVersion >= 2.1 && $this->elFinderDrupalLibRevision > 38) {
|
||||
return parent::file($args);
|
||||
}
|
||||
|
||||
$target = $args['target'];
|
||||
$download = !empty($args['download']);
|
||||
$h403 = 'HTTP/1.x 403 Access Denied';
|
||||
$h404 = 'HTTP/1.x 404 Not Found';
|
||||
|
||||
if (($volume = $this->volume($target)) == FALSE) {
|
||||
return array('error' => self::$errors[self::ERROR_FILE_NOT_FOUND], 'header' => $h404, 'raw' => TRUE);
|
||||
}
|
||||
|
||||
if (($file = $volume->file($target)) == FALSE) {
|
||||
return array('error' => self::$errors[self::ERROR_FILE_NOT_FOUND], 'header' => $h404, 'raw' => TRUE);
|
||||
}
|
||||
|
||||
if (!$file['read']) {
|
||||
return array('error' => self::$errors[self::ERROR_ACCESS_DENIED], 'header' => $h403, 'raw' => TRUE);
|
||||
}
|
||||
|
||||
if ($volume->driverId() != 'f' && (($fp = $volume->open($target)) == FALSE)) {
|
||||
return array('error' => self::$errors[self::ERROR_FILE_NOT_FOUND], 'header' => $h404, 'raw' => TRUE);
|
||||
}
|
||||
|
||||
$mime = ($download) ? 'application/octet-stream' : $file['mime'];
|
||||
|
||||
$result = array(
|
||||
'volume' => $volume,
|
||||
'pointer' => $fp,
|
||||
'info' => $file,
|
||||
'header' => array(
|
||||
"Content-Type: " . $mime,
|
||||
"Content-Disposition: " . $this->GetContentDisposition($file['name'], $mime, $download),
|
||||
"Content-Location: " . $file['name'],
|
||||
'Content-Transfer-Encoding: binary',
|
||||
"Content-Length: " . $file['size'],
|
||||
"Connection: close"
|
||||
)
|
||||
);
|
||||
|
||||
$real_path = $this->realpath($target);
|
||||
module_invoke_all('file_download', $volume->drupalpathtouri($real_path));
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generating Content-Disposition HTTP header
|
||||
*
|
||||
* @param string $file Filename
|
||||
* @param string $filemime MIME Type
|
||||
* @param bool $download Disposition type (true = download file, false = open file in browser)
|
||||
* @return string
|
||||
* @author Dmitry (dio) Levashov, Alexey Sukhotin
|
||||
* */
|
||||
public static function GetContentDisposition($file, $filemime, $download = FALSE) {
|
||||
|
||||
$disp = '';
|
||||
$filename = $file;
|
||||
$ua = $_SERVER["HTTP_USER_AGENT"];
|
||||
$mime = $filemime;
|
||||
|
||||
if ($download) {
|
||||
$disp = 'attachment';
|
||||
$mime = 'application/octet-stream';
|
||||
} else {
|
||||
$disp = preg_match('/^(image|text)/i', $mime)
|
||||
|| $mime == 'application/x-shockwave-flash' ? 'inline' : 'attachment';
|
||||
}
|
||||
|
||||
$disp .= '; ';
|
||||
|
||||
if (preg_match("/MSIE ([0-9]{1,}[\.0-9]{0,})/", $ua)) {
|
||||
$filename = rawurlencode($filename);
|
||||
$filename = str_replace("+", "%20", $filename);
|
||||
//$filename = str_replace(" ", "%20", $filename);
|
||||
$disp .= "filename=" . $filename;
|
||||
} elseif (preg_match("/Firefox\/(\d+)/", $ua, $m)) {
|
||||
if ($m[1] >= 8) {
|
||||
$disp .= "filename*=?UTF-8''" . rawurlencode($filename);
|
||||
} else {
|
||||
$disp .= "filename*=\"?UTF-8''" . rawurlencode($filename) . "\";";
|
||||
}
|
||||
} elseif (preg_match("/Chrome\/(\d+)/", $ua, $m)) {
|
||||
$disp .= "filename=\"" . $filename . "\"";
|
||||
} else {
|
||||
$disp .= "filename=" . $filename;
|
||||
}
|
||||
|
||||
return $disp;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@@ -1,108 +1,114 @@
|
||||
<?php
|
||||
/**
|
||||
* @file
|
||||
* elfinder ACL class
|
||||
*/
|
||||
class elFinderDrupalACL {
|
||||
|
||||
public function fsAccessPublic($attr, $path, $data, $volume) {
|
||||
|
||||
if (strpos(basename($path), '.') === 0 && $attr == 'hidden') {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* Hiding thumbnail folder */
|
||||
if (strstr($path, DIRECTORY_SEPARATOR . variable_get('elfinder_settings_thumbnail_dirname', 'tmb')) && $attr == 'hidden') {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// Hide folders hidden by config settings.
|
||||
$f = drupal_realpath("public://") . "/";
|
||||
$folder = str_replace($f, "", $path);
|
||||
$hidden_folder = preg_split("/[\s,]+/", variable_get('elfinder_settings_misc_hidden_folders', ''));
|
||||
if (in_array($folder, $hidden_folder) && $attr == 'hidden') {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (strstr($path, DIRECTORY_SEPARATOR . '.quarantine') && $attr == 'hidden') {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if ($attr == 'read') {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if ($attr == 'write') {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* if ($attr == 'write' && user_access('write public files')) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if ($attr == 'locked' && !user_access('write public files')) {
|
||||
return TRUE;
|
||||
} */
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
public function fsAccessPrivate($attr, $path, $data, $volume) {
|
||||
|
||||
if (strpos(basename($path), '.') === 0 && $attr == 'hidden') {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* Hiding thumbnail folder */
|
||||
if (strstr($path, DIRECTORY_SEPARATOR . variable_get('elfinder_settings_thumbnail_dirname', 'tmb')) && $attr == 'hidden') {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (strstr($path, DIRECTORY_SEPARATOR . '.quarantine') && $attr == 'hidden') {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if ($attr == 'read') {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
if ($attr == 'write') {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* if ($attr == 'write' && user_access('write public files')) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if ($attr == 'locked' && !user_access('write public files')) {
|
||||
return TRUE;
|
||||
} */
|
||||
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
public function fsAccessUnmanaged($attr, $path, $data, $volume) {
|
||||
|
||||
if (strpos(basename($path), '.') === 0 && $attr == 'hidden') {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* Hiding thumbnail folder */
|
||||
if (strstr($path, DIRECTORY_SEPARATOR . variable_get('elfinder_settings_thumbnail_dirname', 'tmb')) && $attr == 'hidden') {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (strstr($path, DIRECTORY_SEPARATOR . '.quarantine') && $attr == 'hidden') {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if ($attr == 'read') {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
<?php
|
||||
/**
|
||||
* elFinder Integration
|
||||
*
|
||||
* Copyright (c) 2010-2018, Alexey Sukhotin. All rights reserved.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* elfinder ACL class
|
||||
*/
|
||||
class elFinderDrupalACL {
|
||||
|
||||
public function fsAccessPublic($attr, $path, $data, $volume) {
|
||||
|
||||
if (strpos(basename($path), '.') === 0 && $attr == 'hidden') {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* Hiding thumbnail folder */
|
||||
if (strstr($path, DIRECTORY_SEPARATOR . variable_get('elfinder_settings_thumbnail_dirname', 'tmb')) && $attr == 'hidden') {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// Hide folders hidden by config settings.
|
||||
$f = drupal_realpath("public://") . "/";
|
||||
$folder = str_replace($f, "", $path);
|
||||
$hidden_folder = preg_split("/[\s,]+/", variable_get('elfinder_settings_misc_hidden_folders', ''));
|
||||
if (in_array($folder, $hidden_folder) && $attr == 'hidden') {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (strstr($path, DIRECTORY_SEPARATOR . '.quarantine') && $attr == 'hidden') {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if ($attr == 'read') {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if ($attr == 'write') {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* if ($attr == 'write' && user_access('write public files')) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if ($attr == 'locked' && !user_access('write public files')) {
|
||||
return TRUE;
|
||||
} */
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
public function fsAccessPrivate($attr, $path, $data, $volume) {
|
||||
|
||||
if (strpos(basename($path), '.') === 0 && $attr == 'hidden') {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* Hiding thumbnail folder */
|
||||
if (strstr($path, DIRECTORY_SEPARATOR . variable_get('elfinder_settings_thumbnail_dirname', 'tmb')) && $attr == 'hidden') {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (strstr($path, DIRECTORY_SEPARATOR . '.quarantine') && $attr == 'hidden') {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if ($attr == 'read') {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
if ($attr == 'write') {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* if ($attr == 'write' && user_access('write public files')) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if ($attr == 'locked' && !user_access('write public files')) {
|
||||
return TRUE;
|
||||
} */
|
||||
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
public function fsAccessUnmanaged($attr, $path, $data, $volume) {
|
||||
|
||||
if (strpos(basename($path), '.') === 0 && $attr == 'hidden') {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* Hiding thumbnail folder */
|
||||
if (strstr($path, DIRECTORY_SEPARATOR . variable_get('elfinder_settings_thumbnail_dirname', 'tmb')) && $attr == 'hidden') {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (strstr($path, DIRECTORY_SEPARATOR . '.quarantine') && $attr == 'hidden') {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if ($attr == 'read') {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
}
|
@@ -40,15 +40,16 @@ class elFinderVolumeDrupal extends elFinderVolumeLocalFileSystem {
|
||||
$pvtpath = drupal_realpath('private://');
|
||||
$pubpath = drupal_realpath('public://');
|
||||
$tmppath = drupal_realpath('temporary://');
|
||||
$final_path = DIRECTORY_SEPARATOR !== '/' ? str_replace(DIRECTORY_SEPARATOR, '/', $path) : $path;
|
||||
|
||||
$uri = '';
|
||||
|
||||
if (strpos($path, $pvtpath) === 0) {
|
||||
$uri = 'private://' . substr($path, strlen($pvtpath) + 1);
|
||||
} elseif (strpos($path, $tmppath) === 0) {
|
||||
$uri = 'temporary://' . substr($path, strlen($tmppath) + 1);
|
||||
if (strpos($final_path, $pvtpath) === 0) {
|
||||
$uri = 'private://' . substr($final_path, strlen($pvtpath) + 1);
|
||||
} elseif (strpos($final_path, $tmppath) === 0) {
|
||||
$uri = 'temporary://' . substr($final_path, strlen($tmppath) + 1);
|
||||
} else {
|
||||
$uri = 'public://' . substr($path, strlen($pubpath) + 1);
|
||||
$uri = 'public://' . substr($final_path, strlen($pubpath) + 1);
|
||||
}
|
||||
|
||||
return @file_stream_wrapper_uri_normalize($uri);
|
||||
@@ -357,7 +358,8 @@ class elFinderVolumeDrupal extends elFinderVolumeLocalFileSystem {
|
||||
$this->setError(strip_tags(implode(' ', $validation_errors)));
|
||||
return FALSE;
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
watchdog('elfinder', 'File upload "' . $name . '" not found in $_FILES');
|
||||
}
|
||||
return TRUE;
|
||||
@@ -405,6 +407,12 @@ class elFinderVolumeDrupal extends elFinderVolumeLocalFileSystem {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
public static function stat_corrector(&$stat, $path, $statOwner, $volumeDriveInstance) {
|
||||
if (method_exists($volumeDriveInstance, 'owner')) {
|
||||
$stat['owner'] = $volumeDriveInstance->owner($volumeDriveInstance->encode($path));
|
||||
}
|
||||
}
|
||||
|
||||
public function desc($target, $newdesc = NULL) {
|
||||
$path = $this->decode($target);
|
||||
|
||||
|
@@ -1,239 +1,414 @@
|
||||
/*
|
||||
* elFinder Integration
|
||||
*
|
||||
* Copyright (c) 2010-2018, Alexey Sukhotin. All rights reserved.
|
||||
*/
|
||||
|
||||
// $Id: elfinder.callback.js 106 2011-02-26 08:19:56Z ph0enix $
|
||||
|
||||
(function($) {
|
||||
|
||||
/**
|
||||
* @class elFinder command "search"
|
||||
* Find files
|
||||
*
|
||||
* @author Dmitry (dio) Levashov
|
||||
**/
|
||||
elFinder.prototype.commands.search = function() {
|
||||
this.title = 'Find files';
|
||||
this.options = {ui : 'searchbutton'}
|
||||
this.alwaysEnabled = true;
|
||||
this.updateOnSelect = false;
|
||||
|
||||
/**
|
||||
* Return command status.
|
||||
* Search does not support old api.
|
||||
*
|
||||
* @return Number
|
||||
**/
|
||||
this.getstate = function() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Send search request to backend.
|
||||
*
|
||||
* @param String search string
|
||||
* @return $.Deferred
|
||||
**/
|
||||
this.exec = function(q) {
|
||||
var fm = this.fm;
|
||||
|
||||
if (typeof(q) == 'string' && q) {
|
||||
return fm.request({
|
||||
data : {cmd : 'search', elfinder_search_q : q},
|
||||
notify : {type : 'search', cnt : 1, hideCnt : true}
|
||||
});
|
||||
}
|
||||
fm.getUI('toolbar').find('.'+fm.res('class', 'searchbtn')+' :text').focus();
|
||||
return $.Deferred().reject();
|
||||
}
|
||||
/**
|
||||
* @class elFinder command "search"
|
||||
* Find files
|
||||
*
|
||||
* @author Dmitry (dio) Levashov
|
||||
**/
|
||||
elFinder.prototype.commands.search = function() {
|
||||
this.title = 'Find files';
|
||||
this.options = {ui: 'searchbutton'}
|
||||
this.alwaysEnabled = true;
|
||||
this.updateOnSelect = false;
|
||||
|
||||
}
|
||||
/**
|
||||
* Return command status.
|
||||
* Search does not support old api.
|
||||
*
|
||||
* @return Number
|
||||
**/
|
||||
this.getstate = function() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
elFinder.prototype.commands.test134 = function() {
|
||||
this.title = 'Test Command';
|
||||
//this.options = {ui : 'uploadbutton'}
|
||||
this.alwaysEnabled = true;
|
||||
this.updateOnSelect = false;
|
||||
this.state = 0;
|
||||
|
||||
this.getstate = function() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Send search request to backend.
|
||||
*
|
||||
* @param String search string
|
||||
* @return $.Deferred
|
||||
**/
|
||||
this.exec = function(q) {
|
||||
var fm = this.fm;
|
||||
|
||||
alert(Drupal.t('test command. arg=') + q);
|
||||
|
||||
return $.Deferred().reject();
|
||||
}
|
||||
/**
|
||||
* Send search request to backend.
|
||||
*
|
||||
* @param String search string
|
||||
* @return $.Deferred
|
||||
**/
|
||||
this.exec = function(q) {
|
||||
var fm = this.fm;
|
||||
|
||||
}
|
||||
if (typeof(q) == 'string' && q) {
|
||||
return fm.request({
|
||||
data: {cmd: 'search', elfinder_search_q: q},
|
||||
notify: {type: 'search', cnt: 1, hideCnt: true}
|
||||
});
|
||||
}
|
||||
fm.getUI('toolbar').find('.' + fm.res('class', 'searchbtn') + ' :text').focus();
|
||||
return $.Deferred().reject();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
elFinder.prototype.commands.test134 = function() {
|
||||
this.title = 'Test Command';
|
||||
//this.options = {ui : 'uploadbutton'}
|
||||
this.alwaysEnabled = true;
|
||||
this.updateOnSelect = false;
|
||||
this.state = 0;
|
||||
|
||||
this.getstate = function() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Send search request to backend.
|
||||
*
|
||||
* @param String search string
|
||||
* @return $.Deferred
|
||||
**/
|
||||
this.exec = function(q) {
|
||||
var fm = this.fm;
|
||||
|
||||
alert(Drupal.t('test command. arg=') + q);
|
||||
|
||||
return $.Deferred().reject();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
$().ready(function() {
|
||||
var uiopts = elFinder.prototype._options.uiOptions.toolbar;
|
||||
$().ready(function() {
|
||||
var uiopts = elFinder.prototype._options.uiOptions.toolbar;
|
||||
|
||||
var newOpts = new Array();
|
||||
var newOpts = new Array();
|
||||
|
||||
var disabledCommands = Drupal.settings.elfinder.disabledCommands;
|
||||
|
||||
|
||||
for (var i in uiopts) {
|
||||
var optsGroup = uiopts[i];
|
||||
var newOptsGroup = Array();
|
||||
var disabledCommands = Drupal.settings.elfinder.disabledCommands;
|
||||
|
||||
for (var j in optsGroup) {
|
||||
|
||||
for (var i in uiopts) {
|
||||
var optsGroup = uiopts[i];
|
||||
var newOptsGroup = Array();
|
||||
|
||||
|
||||
for (var j in optsGroup) {
|
||||
var found = false;
|
||||
for (var k in disabledCommands) {
|
||||
if (disabledCommands[k] == optsGroup[j]) {
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (found == false) {
|
||||
newOptsGroup.push(optsGroup[j]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (i == 0) {
|
||||
newOptsGroup.push('up');
|
||||
}
|
||||
|
||||
if (newOptsGroup.length >= 1) {
|
||||
newOpts.push(newOptsGroup);
|
||||
}
|
||||
}
|
||||
|
||||
/*elFinder.prototype._options.contextmenu.files.push('|');
|
||||
elFinder.prototype._options.contextmenu.files.push('rename'); */
|
||||
|
||||
var contextMenuCwd = elFinder.prototype._options.contextmenu.cwd;
|
||||
var contextMenuFiles = elFinder.prototype._options.contextmenu.files;
|
||||
var contextMenuNavbar = elFinder.prototype._options.contextmenu.navbar;
|
||||
|
||||
var newContextMenuCwd = Array();
|
||||
var newContextMenuFiles = Array();
|
||||
var newContextMenuNavbar = Array();
|
||||
|
||||
for (var i in contextMenuCwd) {
|
||||
var found = false;
|
||||
for (var k in disabledCommands) {
|
||||
if (disabledCommands[k] == optsGroup[j]) {
|
||||
if (disabledCommands[k] == contextMenuCwd[i]) {
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (found == false) {
|
||||
newOptsGroup.push(optsGroup[j]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (i == 0) {
|
||||
newOptsGroup.push('up');
|
||||
}
|
||||
|
||||
if (newOptsGroup.length >= 1) {
|
||||
newOpts.push(newOptsGroup);
|
||||
}
|
||||
}
|
||||
|
||||
var contextMenuCwd = elFinder.prototype._options.contextmenu.cwd;
|
||||
var contextMenuFiles = elFinder.prototype._options.contextmenu.files;
|
||||
var contextMenuNavbar = elFinder.prototype._options.contextmenu.navbar;
|
||||
|
||||
var newContextMenuCwd = Array();
|
||||
var newContextMenuFiles = Array();
|
||||
var newContextMenuNavbar = Array();
|
||||
|
||||
for (var i in contextMenuCwd) {
|
||||
var found = false;
|
||||
for (var k in disabledCommands) {
|
||||
if (disabledCommands[k] == contextMenuCwd[i]) {
|
||||
found = true;
|
||||
|
||||
if (found == false && contextMenuCwd[i] != '|') {
|
||||
newContextMenuCwd.push(contextMenuCwd[i]);
|
||||
}
|
||||
}
|
||||
|
||||
if (found == false && contextMenuCwd[i] != '|') {
|
||||
newContextMenuCwd.push(contextMenuCwd[i]);
|
||||
}
|
||||
}
|
||||
|
||||
for (var i in contextMenuFiles) {
|
||||
var found = false;
|
||||
for (var k in disabledCommands) {
|
||||
if (disabledCommands[k] == contextMenuFiles[i]) {
|
||||
found = true;
|
||||
|
||||
for (var i in contextMenuFiles) {
|
||||
var found = false;
|
||||
for (var k in disabledCommands) {
|
||||
if (disabledCommands[k] == contextMenuFiles[i]) {
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (found == false && contextMenuFiles[i] != '|') {
|
||||
newContextMenuFiles.push(contextMenuFiles[i]);
|
||||
}
|
||||
}
|
||||
|
||||
if (found == false && contextMenuFiles[i] != '|') {
|
||||
newContextMenuFiles.push(contextMenuFiles[i]);
|
||||
}
|
||||
}
|
||||
|
||||
for (var i in contextMenuNavbar) {
|
||||
var found = false;
|
||||
for (var k in disabledCommands) {
|
||||
if (disabledCommands[k] == contextMenuNavbar[i]) {
|
||||
found = true;
|
||||
|
||||
for (var i in contextMenuNavbar) {
|
||||
var found = false;
|
||||
for (var k in disabledCommands) {
|
||||
if (disabledCommands[k] == contextMenuNavbar[i]) {
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (found == false && contextMenuNavbar[i] != '|') {
|
||||
newContextMenuNavbar.push(contextMenuNavbar[i]);
|
||||
}
|
||||
}
|
||||
|
||||
if (found == false && contextMenuNavbar[i] != '|') {
|
||||
newContextMenuNavbar.push(contextMenuNavbar[i]);
|
||||
}
|
||||
}
|
||||
elFinder.prototype._options.uiOptions.toolbar = newOpts;
|
||||
elFinder.prototype._options.contextmenu.cwd = newContextMenuCwd;
|
||||
elFinder.prototype._options.contextmenu.files = newContextMenuFiles;
|
||||
elFinder.prototype._options.contextmenu.navbar = newContextMenuNavbar;
|
||||
elFinder.prototype._options.uiOptions.toolbar = newOpts;
|
||||
elFinder.prototype._options.contextmenu.cwd = newContextMenuCwd;
|
||||
elFinder.prototype._options.contextmenu.files = newContextMenuFiles;
|
||||
elFinder.prototype._options.contextmenu.navbar = newContextMenuNavbar;
|
||||
|
||||
});
|
||||
//elFinder.prototype._options.ui.push('mouseover');
|
||||
});
|
||||
|
||||
|
||||
$().ready(function() {
|
||||
if (Drupal.settings.elfinder) {
|
||||
var editorApp = Drupal.settings.elfinder.editorApp;
|
||||
|
||||
$().ready(function() {
|
||||
if (Drupal.settings.elfinder) {
|
||||
var editorApp = Drupal.settings.elfinder.editorApp;
|
||||
var elfinderOpts = {
|
||||
url: Drupal.settings.elfinder.connectorUrl,
|
||||
lang: Drupal.settings.elfinder.langCode,
|
||||
rememberLastDir: Drupal.settings.elfinder.rememberLastDir,
|
||||
closeOnEditorCallback: false,
|
||||
customData: {token: Drupal.settings.elfinder.token},
|
||||
commandsOptions_: {}
|
||||
}
|
||||
|
||||
var elfinderOpts = {
|
||||
url : Drupal.settings.elfinder.connectorUrl,
|
||||
lang : Drupal.settings.elfinder.langCode,
|
||||
rememberLastDir : Drupal.settings.elfinder.rememberLastDir,
|
||||
closeOnEditorCallback : false,
|
||||
customData : {token: Drupal.settings.elfinder.token}
|
||||
}
|
||||
|
||||
/* Pushing all settings to elFinder */
|
||||
$.extend(elfinderOpts, Drupal.settings.elfinder);
|
||||
|
||||
if (editorApp && typeof window[Drupal.settings.elfinder.editorCallback] == 'function') {
|
||||
elfinderOpts.editorCallback = window[Drupal.settings.elfinder.editorCallback];
|
||||
}
|
||||
// help tab rendering issues in admin theme
|
||||
if (Drupal.settings.elfinder.browserMode != 'default' && elFinder.prototype._options.commandsOptions.help) {
|
||||
final_options = [];
|
||||
|
||||
if (editorApp && typeof window[Drupal.settings.elfinder.editorCallback] == 'function') {
|
||||
elfinderOpts.getFileCallback = window[Drupal.settings.elfinder.editorCallback];
|
||||
}
|
||||
|
||||
if (elfinderOpts.api21) {
|
||||
//alert('api21');
|
||||
for (var i in elFinder.prototype._options.commandsOptions.help.view) {
|
||||
var option = elFinder.prototype._options.commandsOptions.help.view[i];
|
||||
if (option != 'help') {
|
||||
final_options.push(option);
|
||||
}
|
||||
}
|
||||
|
||||
elFinder.prototype._options.commandsOptions.help['view'] = final_options;
|
||||
}
|
||||
|
||||
/* Pushing all settings to elFinder */
|
||||
$.extend(elfinderOpts, Drupal.settings.elfinder);
|
||||
|
||||
if (editorApp && typeof window[Drupal.settings.elfinder.editorCallback] == 'function') {
|
||||
elfinderOpts.editorCallback = window[Drupal.settings.elfinder.editorCallback];
|
||||
}
|
||||
|
||||
if (editorApp && typeof window[Drupal.settings.elfinder.editorCallback] == 'function') {
|
||||
elfinderOpts.getFileCallback = window[Drupal.settings.elfinder.editorCallback];
|
||||
}
|
||||
|
||||
if (elfinderOpts.api21) {
|
||||
console.log('2.1 api');
|
||||
elfinderOpts['commandsOptions'] = {
|
||||
info: {
|
||||
// Key is the same as your command name
|
||||
desc : {
|
||||
// Field label
|
||||
label : 'Description1',
|
||||
|
||||
// HTML Template
|
||||
tpl : '<div class="elfinder-info-desc"><span class="elfinder-info-spinner"></span></div>',
|
||||
|
||||
// Action that sends the request to the server and get the description
|
||||
action : function(file, filemanager, dialog) {
|
||||
// Use the @filemanager object to issue a request
|
||||
filemanager.request({
|
||||
// Issuing the custom 'desc' command, targetting the selected file
|
||||
data : { cmd: 'desc', target: file.hash, },
|
||||
preventDefault: true,
|
||||
})
|
||||
// If the request fails, populate the field with 'Unknown'
|
||||
.fail(function() {
|
||||
dialog.find('.elfinder-info-desc').html(filemanager.i18n('unknown'));
|
||||
})
|
||||
// When the request is successful, show the description
|
||||
.done(function(data) {
|
||||
dialog.find('.elfinder-info-desc').html(data.desc);
|
||||
});
|
||||
},
|
||||
},
|
||||
elfinderOpts['commandsOptions']['info'] = {
|
||||
custom: {}
|
||||
|
||||
};
|
||||
|
||||
/* elfinderOpts['commandsOptions']['quicklook'] = {
|
||||
officeOnlineMimes : ['application/msword', 'application/vnd.ms-word', 'application/vnd.ms-excel', 'application/vnd.ms-powerpoint', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'],
|
||||
}*/
|
||||
|
||||
var disabledCommands = Drupal.settings.elfinder.disabledCommands,
|
||||
viewDesc = $.inArray('desc', disabledCommands) == -1 ? true : false,
|
||||
editDesc = $.inArray('editdesc', disabledCommands) == -1 ? true : false,
|
||||
viewOwner = $.inArray('owner', disabledCommands) == -1 ? true : false,
|
||||
viewDownloads = $.inArray('downloadcount', disabledCommands) == -1 ? true : false;
|
||||
|
||||
|
||||
if (viewDesc || editDesc) {
|
||||
|
||||
// Key is the same as your command name
|
||||
elfinderOpts['commandsOptions']['info']['custom']['desc'] = {
|
||||
// Field label
|
||||
label: Drupal.t('Description'),
|
||||
|
||||
// HTML Template
|
||||
tpl: '<div class="elfinder-info-desc"><span class="elfinder-info-spinner"></span></div><div class="elfinder-info-save"></div>',
|
||||
|
||||
// Action that sends the request to the server and get the description
|
||||
action: function(file, filemanager, dialog) {
|
||||
console.log('desc action');
|
||||
|
||||
console.log('fm');
|
||||
console.log(file.mime);
|
||||
|
||||
// Use the @filemanager object to issue a request
|
||||
filemanager.request({
|
||||
// Issuing the custom 'desc' command, targetting the selected file
|
||||
data: {cmd: 'desc', target: file.hash,},
|
||||
preventDefault: true,
|
||||
})
|
||||
// If the request fails, populate the field with 'Unknown'
|
||||
.fail(function() {
|
||||
console.log('desc fail');
|
||||
dialog.find('.elfinder-info-desc').html(filemanager.i18n('unknown'));
|
||||
})
|
||||
// When the request is successful, show the description
|
||||
.done(function(data) {
|
||||
console.log('desc done');
|
||||
dialog.find('.elfinder-info-desc').html(data.desc);
|
||||
|
||||
if (editDesc) {
|
||||
//filemanager.lockfiles({files : [file.hash]})
|
||||
dialog.find('.elfinder-info-desc').html('<textarea cols="20" rows="5" id="elfinder-fm-file-desc" class="ui-widget ui-widget-content">' + data.desc + '</textarea>');
|
||||
|
||||
$('.elfinder-info-save').append('<input type="button" id="elfinder-fm-file-desc-btn-save" class="ui-widget ui-button" value="' + filemanager.i18n('btnSave') + '" />');
|
||||
|
||||
var btnSave = $('#elfinder-fm-file-desc-btn-save', dialog).button();
|
||||
console.log(btnSave);
|
||||
|
||||
btnSave.click(function() {
|
||||
filemanager.lockfiles({files: [file.hash]});
|
||||
filemanager.request({
|
||||
data: {cmd: 'desc', target: file.hash, content: $('#elfinder-fm-file-desc').val()},
|
||||
notify: {type: 'desc', cnt: 1}
|
||||
})
|
||||
.always(function() {
|
||||
filemanager.unlockfiles({files: [file.hash]});
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (viewOwner) {
|
||||
// Key is the same as your command name
|
||||
elfinderOpts['commandsOptions']['info']['custom']['owner'] = {
|
||||
// Field label
|
||||
label: Drupal.t('Owner'),
|
||||
|
||||
// HTML Template
|
||||
tpl: '<div class="elfinder-info-owner"><span class="elfinder-info-spinner"></span></div>',
|
||||
|
||||
// Action that sends the request to the server and get the description
|
||||
action: function(file, filemanager, dialog) {
|
||||
console.log('owner action');
|
||||
|
||||
// Use the @filemanager object to issue a request
|
||||
filemanager.request({
|
||||
// Issuing the custom 'desc' command, targetting the selected file
|
||||
data: {cmd: 'owner', target: file.hash,},
|
||||
preventDefault: true,
|
||||
})
|
||||
// If the request fails, populate the field with 'Unknown'
|
||||
.fail(function() {
|
||||
console.log('owner fail');
|
||||
dialog.find('.elfinder-info-owner').html(filemanager.i18n('unknown'));
|
||||
})
|
||||
// When the request is successful, show the description
|
||||
.done(function(data) {
|
||||
console.log('owner done');
|
||||
dialog.find('.elfinder-info-owner').html(data.owner);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
elFinder.prototype._options.uiOptions.cwd.listView.columns.push('owner');
|
||||
elFinder.prototype._options.uiOptions.cwd.listView.columnsCustomName['owner'] = Drupal.t('Owner');
|
||||
|
||||
}
|
||||
|
||||
if (viewDownloads) {
|
||||
elfinderOpts['commandsOptions']['info']['custom']['downloadcount'] = {
|
||||
// Field label
|
||||
label: Drupal.t('Downloads'),
|
||||
|
||||
// HTML Template
|
||||
tpl: '<div class="elfinder-info-downloadcount"><span class="elfinder-info-spinner"></span></div>',
|
||||
|
||||
// Action that sends the request to the server and get the description
|
||||
action: function(file, filemanager, dialog) {
|
||||
// Use the @filemanager object to issue a request
|
||||
filemanager.request({
|
||||
// Issuing the custom 'desc' command, targetting the selected file
|
||||
data: {cmd: 'downloadcount', target: file.hash,},
|
||||
preventDefault: true,
|
||||
})
|
||||
// If the request fails, populate the field with 'Unknown'
|
||||
.fail(function() {
|
||||
dialog.find('.elfinder-info-downloadcount').html(0);
|
||||
})
|
||||
// When the request is successful, show the description
|
||||
.done(function(data) {
|
||||
dialog.find('.elfinder-info-downloadcount').html(data.desc);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
// console.log(elfinderOpts);
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
$('#finder').elfinder(elfinderOpts);
|
||||
var fm = $('#finder').elfinder(elfinderOpts);
|
||||
|
||||
var instance = fm.elfinder('instance');
|
||||
|
||||
// console.log(typeof instance == 'object' && typeof instance.toast == 'function');
|
||||
|
||||
if (typeof instance == 'object' && typeof instance.toast == 'function') {
|
||||
instance.bind('load', function(event) {
|
||||
var messages = '#elfinder-messages .messages';
|
||||
$(messages).each(function(index, value) {
|
||||
var mode = 'info';
|
||||
if ($(value).hasClass('warning')) {
|
||||
mode = 'warning';
|
||||
} else if ($(value).hasClass('error')) {
|
||||
mode = 'error';
|
||||
}
|
||||
|
||||
instance.toast({
|
||||
msg: $(value).html(),
|
||||
hideDuration: 500,
|
||||
showDuration: 300,
|
||||
timeOut: 1000,
|
||||
mode: mode
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
} else {
|
||||
$('#elfinder-messages').addClass('legacy');
|
||||
}
|
||||
//$('#finder').toast({msg: '123'});
|
||||
|
||||
var h;
|
||||
|
||||
if (elfinderOpts.browserMode != 'backend') {
|
||||
h = ($(window).height());
|
||||
} else {
|
||||
h = ($('#page').height());
|
||||
}
|
||||
|
||||
if(elfinderOpts.browserMode != 'backend') {
|
||||
// If this is a popup, add an event so that elfinder fills the window.
|
||||
$(window).resize(function() {
|
||||
var h = ($(window).height());
|
||||
if($('#finder').height() != h) {
|
||||
if ($('#finder').height() != h) {
|
||||
$('#finder').height(h).resize();
|
||||
}
|
||||
});
|
||||
|
||||
$(window).trigger('resize');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
})(jQuery);
|
||||
|
13
sites/all/modules/contrib/files/elfinder/js/elfinder.jquery-ui.legacy.min.js
vendored
Normal file
13
sites/all/modules/contrib/files/elfinder/js/elfinder.jquery-ui.legacy.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
5
sites/all/modules/contrib/files/elfinder/js/elfinder.jquery.legacy.min.js
vendored
Normal file
5
sites/all/modules/contrib/files/elfinder/js/elfinder.jquery.legacy.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,3 +1,9 @@
|
||||
/*
|
||||
* elFinder Integration
|
||||
*
|
||||
* Copyright (c) 2010-2018, Alexey Sukhotin. All rights reserved.
|
||||
*/
|
||||
|
||||
Drupal.elfinder = {
|
||||
editor: {}
|
||||
|
||||
|
@@ -1,3 +1,9 @@
|
||||
/*
|
||||
* elFinder Integration
|
||||
*
|
||||
* Copyright (c) 2010-2018, Alexey Sukhotin. All rights reserved.
|
||||
*/
|
||||
|
||||
// $Id: helper.js 100 2011-02-20 19:14:25Z ph0enix $
|
||||
|
||||
Drupal.elfinder = {
|
||||
|
@@ -1,84 +1,90 @@
|
||||
/*
|
||||
* elFinder Integration
|
||||
*
|
||||
* Copyright (c) 2010-2018, Alexey Sukhotin. All rights reserved.
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
/**
|
||||
* @class elFinder command "info".
|
||||
* @class elFinder command "info".
|
||||
* Display dialog with file properties.
|
||||
*
|
||||
* @author Dmitry (dio) Levashov, dio@std42.ru
|
||||
**/
|
||||
|
||||
|
||||
(function($) {
|
||||
|
||||
elFinder.prototype.commands.info = function() {
|
||||
var m = 'msg',
|
||||
fm = this.fm,
|
||||
spclass = 'elfinder-info-spinner',
|
||||
msg = {
|
||||
calc : fm.i18n('calc'),
|
||||
size : fm.i18n('size'),
|
||||
unknown : fm.i18n('unknown'),
|
||||
path : fm.i18n('path'),
|
||||
aliasfor : fm.i18n('aliasfor'),
|
||||
modify : fm.i18n('modify'),
|
||||
perms : fm.i18n('perms'),
|
||||
locked : fm.i18n('locked'),
|
||||
dim : fm.i18n('dim'),
|
||||
kind : fm.i18n('kind'),
|
||||
files : fm.i18n('files'),
|
||||
folders : fm.i18n('folders'),
|
||||
items : fm.i18n('items'),
|
||||
yes : fm.i18n('yes'),
|
||||
no : fm.i18n('no'),
|
||||
link : fm.i18n('link'),
|
||||
owner : fm.i18n('owner'),
|
||||
desc : fm.i18n('description'),
|
||||
downloads: fm.i18n('downloads')
|
||||
};
|
||||
|
||||
this.tpl = {
|
||||
main : '<div class="ui-helper-clearfix elfinder-info-title"><span class="elfinder-cwd-icon {class} ui-corner-all"/>{title}</div><table class="elfinder-info-tb">{content}</table>',
|
||||
itemTitle : '<strong>{name}</strong><span class="elfinder-info-kind">{kind}</span>',
|
||||
groupTitle : '<strong>{items}: {num}</strong>',
|
||||
row : '<tr><td>{label} : </td><td>{value}</td></tr>',
|
||||
spinner : '<span>{text}</span> <span class="'+spclass+' '+spclass+'-'+'{id}"/>'
|
||||
}
|
||||
|
||||
this.alwaysEnabled = true;
|
||||
this.updateOnSelect = false;
|
||||
this.shortcuts = [{
|
||||
pattern : 'ctrl+i'
|
||||
}];
|
||||
|
||||
this.init = function() {
|
||||
$.each(msg, function(k, v) {
|
||||
msg[k] = fm.i18n(v);
|
||||
});
|
||||
}
|
||||
|
||||
this.getstate = function() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
this.exec = function(hashes) {
|
||||
elFinder.prototype.commands.info = function() {
|
||||
var m = 'msg',
|
||||
fm = this.fm,
|
||||
spclass = 'elfinder-info-spinner',
|
||||
msg = {
|
||||
calc: fm.i18n('calc'),
|
||||
size: fm.i18n('size'),
|
||||
unknown: fm.i18n('unknown'),
|
||||
path: fm.i18n('path'),
|
||||
aliasfor: fm.i18n('aliasfor'),
|
||||
modify: fm.i18n('modify'),
|
||||
perms: fm.i18n('perms'),
|
||||
locked: fm.i18n('locked'),
|
||||
dim: fm.i18n('dim'),
|
||||
kind: fm.i18n('kind'),
|
||||
files: fm.i18n('files'),
|
||||
folders: fm.i18n('folders'),
|
||||
items: fm.i18n('items'),
|
||||
yes: fm.i18n('yes'),
|
||||
no: fm.i18n('no'),
|
||||
link: fm.i18n('link'),
|
||||
owner: fm.i18n('owner'),
|
||||
desc: fm.i18n('description'),
|
||||
downloads: fm.i18n('downloads')
|
||||
};
|
||||
|
||||
var self = this,
|
||||
fm = this.fm,
|
||||
tpl = this.tpl,
|
||||
row = tpl.row,
|
||||
files = this.files(hashes),
|
||||
cnt = files.length,
|
||||
content = [],
|
||||
view = tpl.main,
|
||||
l = '{label}',
|
||||
v = '{value}',
|
||||
opts = {
|
||||
title : this.title,
|
||||
width : 'auto',
|
||||
modal : true,
|
||||
this.tpl = {
|
||||
main: '<div class="ui-helper-clearfix elfinder-info-title"><span class="elfinder-cwd-icon {class} ui-corner-all"/>{title}</div><table class="elfinder-info-tb">{content}</table>',
|
||||
itemTitle: '<strong>{name}</strong><span class="elfinder-info-kind">{kind}</span>',
|
||||
groupTitle: '<strong>{items}: {num}</strong>',
|
||||
row: '<tr><td>{label} : </td><td>{value}</td></tr>',
|
||||
spinner: '<span>{text}</span> <span class="' + spclass + ' ' + spclass + '-' + '{id}"/>'
|
||||
}
|
||||
|
||||
this.alwaysEnabled = true;
|
||||
this.updateOnSelect = false;
|
||||
this.shortcuts = [{
|
||||
pattern: 'ctrl+i'
|
||||
}];
|
||||
|
||||
this.init = function() {
|
||||
$.each(msg, function(k, v) {
|
||||
msg[k] = fm.i18n(v);
|
||||
});
|
||||
}
|
||||
|
||||
this.getstate = function() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
this.exec = function(hashes) {
|
||||
|
||||
var self = this,
|
||||
fm = this.fm,
|
||||
tpl = this.tpl,
|
||||
row = tpl.row,
|
||||
files = this.files(hashes),
|
||||
cnt = files.length,
|
||||
content = [],
|
||||
view = tpl.main,
|
||||
l = '{label}',
|
||||
v = '{value}',
|
||||
opts = {
|
||||
title: this.title,
|
||||
width: 'auto',
|
||||
modal: true,
|
||||
close: function() {
|
||||
$(this).elfinderdialog('destroy');
|
||||
}
|
||||
},
|
||||
count = [],
|
||||
},
|
||||
count = [],
|
||||
replSpinner = function(msg) {
|
||||
dialog.find('.' + spclass).parent().text(msg);
|
||||
},
|
||||
@@ -88,208 +94,208 @@ elFinder.prototype.commands.info = function() {
|
||||
id = fm.namespace + '-info-' + $.map(files, function(f) {
|
||||
return f.hash
|
||||
}).join('-'),
|
||||
dialog = fm.getUI().find('#'+id),
|
||||
size, tmb, file, title, dcnt;
|
||||
|
||||
var disabledCommands = Drupal.settings.elfinder.disabledCommands,
|
||||
dialog = fm.getUI().find('#' + id),
|
||||
size, tmb, file, title, dcnt;
|
||||
|
||||
var disabledCommands = Drupal.settings.elfinder.disabledCommands,
|
||||
viewDesc = $.inArray('desc', disabledCommands) == -1 ? true : false,
|
||||
editDesc = $.inArray('editdesc', disabledCommands) == -1 ? true : false,
|
||||
viewOwner = $.inArray('owner', disabledCommands) == -1 ? true : false,
|
||||
viewDownloads = $.inArray('downloadcount', disabledCommands) == -1 ? true : false;
|
||||
|
||||
if (!cnt) {
|
||||
return $.Deferred().reject();
|
||||
}
|
||||
|
||||
if (dialog.length) {
|
||||
dialog.elfinderdialog('toTop');
|
||||
return $.Deferred().resolve();
|
||||
}
|
||||
|
||||
|
||||
if (cnt == 1) {
|
||||
file = files[0];
|
||||
view = view.replace('{class}', fm.mime2class(file.mime));
|
||||
title = tpl.itemTitle.replace('{name}', file.name).replace('{kind}', fm.mime2kind(file));
|
||||
|
||||
if (file.tmb) {
|
||||
tmb = fm.option('tmbUrl')+file.tmb;
|
||||
}
|
||||
|
||||
if (!file.read) {
|
||||
size = msg.unknown;
|
||||
} else if (file.mime != 'directory' || file.alias) {
|
||||
size = fm.formatSize(file.size);
|
||||
} else {
|
||||
/* adding spinner id to separate field updates */
|
||||
size = tpl.spinner.replace('{text}', msg.calc).replace('{id}', 'size');
|
||||
count.push(file.hash);
|
||||
}
|
||||
|
||||
content.push(row.replace(l, msg.size).replace(v, size));
|
||||
file.alias && content.push(row.replace(l, msg.aliasfor).replace(v, file.alias));
|
||||
content.push(row.replace(l, msg.path).replace(v, fm.escape(fm.path(file.hash))));
|
||||
file.read && content.push(row.replace(l, msg.link).replace(v, '<a href="'+fm.url(file.hash)+'" target="_blank">'+file.name+'</a>'));
|
||||
|
||||
if (file.dim) { // old api
|
||||
content.push(row.replace(l, msg.dim).replace(v, file.dim));
|
||||
} else if (file.mime.indexOf('image') !== -1) {
|
||||
content.push(row.replace(l, msg.dim).replace(v, tpl.spinner.replace('{text}', msg.calc).replace('{id}', 'dim')));
|
||||
fm.request({
|
||||
data : {cmd : 'dim', target : file.hash},
|
||||
preventDefault : true
|
||||
})
|
||||
.fail(function() {
|
||||
replSpinnerById(msg.unknown, 'dim');
|
||||
})
|
||||
.done(function(data) {
|
||||
replSpinnerById(data.dim || msg.unknown, 'dim');
|
||||
});
|
||||
}
|
||||
|
||||
content.push(row.replace(l, msg.modify).replace(v, fm.formatDate(file)));
|
||||
content.push(row.replace(l, msg.perms).replace(v, fm.formatPermissions(file)));
|
||||
content.push(row.replace(l, msg.locked).replace(v, file.locked ? msg.yes : msg.no));
|
||||
|
||||
/* Don't show fields if command not allowed */
|
||||
if (viewOwner) {
|
||||
content.push(row.replace(l, Drupal.t('Owner')).replace(v, tpl.spinner.replace('{text}', msg.calc).replace('{id}', 'owner')));
|
||||
|
||||
fm.request({
|
||||
data : {cmd : 'owner', target : file.hash},
|
||||
preventDefault : true
|
||||
})
|
||||
.fail(function() {
|
||||
replSpinnerById(msg.unknown, 'owner');
|
||||
})
|
||||
.done(function(data) {
|
||||
replSpinnerById(data.owner || msg.unknown, 'owner');
|
||||
});
|
||||
if (!cnt) {
|
||||
return $.Deferred().reject();
|
||||
}
|
||||
|
||||
/* Don't show fields if command not allowed */
|
||||
if (viewDownloads) {
|
||||
content.push(row.replace(l, Drupal.t('Downloads')).replace(v, tpl.spinner.replace('{text}', msg.calc).replace('{id}', 'downloads')));
|
||||
|
||||
fm.request({
|
||||
data : {cmd : 'downloadcount', target : file.hash},
|
||||
preventDefault : true
|
||||
})
|
||||
.fail(function() {
|
||||
replSpinnerById(msg.unknown, 'downloads');
|
||||
})
|
||||
.done(function(data) {
|
||||
replSpinnerById(data.downloadcount || msg.unknown, 'downloads');
|
||||
});
|
||||
|
||||
if (dialog.length) {
|
||||
dialog.elfinderdialog('toTop');
|
||||
return $.Deferred().resolve();
|
||||
}
|
||||
|
||||
/* Don't show fields if command not allowed */
|
||||
if (viewDesc || editDesc) {
|
||||
|
||||
var desc = '<div id="elfinder-fm-file-desc">' + msg.calc + '</div>';
|
||||
|
||||
if (editDesc) {
|
||||
|
||||
desc = '<textarea cols="20" rows="5" id="elfinder-fm-file-desc" class="ui-widget ui-widget-content" disabled="true" >' + msg.calc + '</textarea><input type="button" id="elfinder-fm-file-desc-btn-save" value="' + fm.i18n('btnSave') + '" />';
|
||||
|
||||
|
||||
if (cnt == 1) {
|
||||
file = files[0];
|
||||
view = view.replace('{class}', fm.mime2class(file.mime));
|
||||
title = tpl.itemTitle.replace('{name}', file.name).replace('{kind}', fm.mime2kind(file));
|
||||
|
||||
if (file.tmb) {
|
||||
tmb = fm.option('tmbUrl') + file.tmb;
|
||||
}
|
||||
|
||||
content.push(row.replace(l, Drupal.t('Description')).replace(v , desc));
|
||||
|
||||
fm.request({
|
||||
data : {cmd : 'desc', target : file.hash},
|
||||
preventDefault : true
|
||||
})
|
||||
.done(function(data) {
|
||||
var fieldDesc = dialog.find('#elfinder-fm-file-desc');
|
||||
|
||||
if (editDesc) {
|
||||
fieldDesc.val(data.desc || '');
|
||||
fieldDesc.removeAttr('disabled');
|
||||
} else {
|
||||
fieldDesc.empty();
|
||||
fieldDesc.html(data.desc || '');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
view = view.replace('{class}', 'elfinder-cwd-icon-group');
|
||||
title = tpl.groupTitle.replace('{items}', msg.items).replace('{num}', cnt);
|
||||
if (!file.read) {
|
||||
size = msg.unknown;
|
||||
} else if (file.mime != 'directory' || file.alias) {
|
||||
size = fm.formatSize(file.size);
|
||||
} else {
|
||||
/* adding spinner id to separate field updates */
|
||||
size = tpl.spinner.replace('{text}', msg.calc).replace('{id}', 'size');
|
||||
count.push(file.hash);
|
||||
}
|
||||
|
||||
content.push(row.replace(l, msg.size).replace(v, size));
|
||||
file.alias && content.push(row.replace(l, msg.aliasfor).replace(v, file.alias));
|
||||
content.push(row.replace(l, msg.path).replace(v, fm.escape(fm.path(file.hash))));
|
||||
file.read && content.push(row.replace(l, msg.link).replace(v, '<a href="' + fm.url(file.hash) + '" target="_blank">' + file.name + '</a>'));
|
||||
|
||||
if (file.dim) { // old api
|
||||
content.push(row.replace(l, msg.dim).replace(v, file.dim));
|
||||
} else if (file.mime.indexOf('image') !== -1) {
|
||||
content.push(row.replace(l, msg.dim).replace(v, tpl.spinner.replace('{text}', msg.calc).replace('{id}', 'dim')));
|
||||
fm.request({
|
||||
data: {cmd: 'dim', target: file.hash},
|
||||
preventDefault: true
|
||||
})
|
||||
.fail(function() {
|
||||
replSpinnerById(msg.unknown, 'dim');
|
||||
})
|
||||
.done(function(data) {
|
||||
replSpinnerById(data.dim || msg.unknown, 'dim');
|
||||
});
|
||||
}
|
||||
|
||||
content.push(row.replace(l, msg.modify).replace(v, fm.formatDate(file)));
|
||||
content.push(row.replace(l, msg.perms).replace(v, fm.formatPermissions(file)));
|
||||
content.push(row.replace(l, msg.locked).replace(v, file.locked ? msg.yes : msg.no));
|
||||
|
||||
/* Don't show fields if command not allowed */
|
||||
if (viewOwner) {
|
||||
content.push(row.replace(l, Drupal.t('Owner')).replace(v, tpl.spinner.replace('{text}', msg.calc).replace('{id}', 'owner')));
|
||||
|
||||
fm.request({
|
||||
data: {cmd: 'owner', target: file.hash},
|
||||
preventDefault: true
|
||||
})
|
||||
.fail(function() {
|
||||
replSpinnerById(msg.unknown, 'owner');
|
||||
})
|
||||
.done(function(data) {
|
||||
replSpinnerById(data.owner || msg.unknown, 'owner');
|
||||
});
|
||||
}
|
||||
|
||||
/* Don't show fields if command not allowed */
|
||||
if (viewDownloads) {
|
||||
content.push(row.replace(l, Drupal.t('Downloads')).replace(v, tpl.spinner.replace('{text}', msg.calc).replace('{id}', 'downloads')));
|
||||
|
||||
fm.request({
|
||||
data: {cmd: 'downloadcount', target: file.hash},
|
||||
preventDefault: true
|
||||
})
|
||||
.fail(function() {
|
||||
replSpinnerById(msg.unknown, 'downloads');
|
||||
})
|
||||
.done(function(data) {
|
||||
replSpinnerById(data.downloadcount || msg.unknown, 'downloads');
|
||||
});
|
||||
}
|
||||
|
||||
/* Don't show fields if command not allowed */
|
||||
if (viewDesc || editDesc) {
|
||||
|
||||
var desc = '<div id="elfinder-fm-file-desc">' + msg.calc + '</div>';
|
||||
|
||||
if (editDesc) {
|
||||
|
||||
desc = '<textarea cols="20" rows="5" id="elfinder-fm-file-desc" class="ui-widget ui-widget-content" disabled="true" >' + msg.calc + '</textarea><input type="button" id="elfinder-fm-file-desc-btn-save" value="' + fm.i18n('btnSave') + '" />';
|
||||
}
|
||||
|
||||
content.push(row.replace(l, Drupal.t('Description')).replace(v, desc));
|
||||
|
||||
fm.request({
|
||||
data: {cmd: 'desc', target: file.hash},
|
||||
preventDefault: true
|
||||
})
|
||||
.done(function(data) {
|
||||
var fieldDesc = dialog.find('#elfinder-fm-file-desc');
|
||||
|
||||
if (editDesc) {
|
||||
fieldDesc.val(data.desc || '');
|
||||
fieldDesc.removeAttr('disabled');
|
||||
} else {
|
||||
fieldDesc.empty();
|
||||
fieldDesc.html(data.desc || '');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
view = view.replace('{class}', 'elfinder-cwd-icon-group');
|
||||
title = tpl.groupTitle.replace('{items}', msg.items).replace('{num}', cnt);
|
||||
dcnt = $.map(files, function(f) {
|
||||
return f.mime == 'directory' ? 1 : null
|
||||
}).length;
|
||||
if (!dcnt) {
|
||||
size = 0;
|
||||
$.each(files, function(h, f) {
|
||||
var s = parseInt(f.size);
|
||||
|
||||
if (s >= 0 && size >= 0) {
|
||||
size += s;
|
||||
} else {
|
||||
size = 'unknown';
|
||||
}
|
||||
});
|
||||
content.push(row.replace(l, msg.kind).replace(v, msg.files));
|
||||
content.push(row.replace(l, msg.size).replace(v, fm.formatSize(size)));
|
||||
} else {
|
||||
content.push(row.replace(l, msg.kind).replace(v, dcnt == cnt ? msg.folders : msg.folders+' '+dcnt+', '+msg.files+' '+(cnt-dcnt)))
|
||||
content.push(row.replace(l, msg.size).replace(v, tpl.spinner.replace('{text}', msg.calc).replace('{id}', 'size')));
|
||||
if (!dcnt) {
|
||||
size = 0;
|
||||
$.each(files, function(h, f) {
|
||||
var s = parseInt(f.size);
|
||||
|
||||
if (s >= 0 && size >= 0) {
|
||||
size += s;
|
||||
} else {
|
||||
size = 'unknown';
|
||||
}
|
||||
});
|
||||
content.push(row.replace(l, msg.kind).replace(v, msg.files));
|
||||
content.push(row.replace(l, msg.size).replace(v, fm.formatSize(size)));
|
||||
} else {
|
||||
content.push(row.replace(l, msg.kind).replace(v, dcnt == cnt ? msg.folders : msg.folders + ' ' + dcnt + ', ' + msg.files + ' ' + (cnt - dcnt)))
|
||||
content.push(row.replace(l, msg.size).replace(v, tpl.spinner.replace('{text}', msg.calc).replace('{id}', 'size')));
|
||||
count = $.map(files, function(f) {
|
||||
return f.hash
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
view = view.replace('{title}', title).replace('{content}', content.join(''));
|
||||
|
||||
dialog = fm.dialog(view, opts);
|
||||
dialog.attr('id', id);
|
||||
|
||||
if (editDesc) {
|
||||
var inputDesc = $('#elfinder-fm-file-desc', dialog);
|
||||
var btnSave = $('#elfinder-fm-file-desc-btn-save', dialog).button();
|
||||
|
||||
btnSave.click(function() {
|
||||
fm.lockfiles({files : [file.hash]});
|
||||
fm.request({
|
||||
data : {cmd : 'desc', target : file.hash, content : inputDesc.val()},
|
||||
notify : {type : 'desc', cnt : 1}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
view = view.replace('{title}', title).replace('{content}', content.join(''));
|
||||
|
||||
dialog = fm.dialog(view, opts);
|
||||
dialog.attr('id', id);
|
||||
|
||||
if (editDesc) {
|
||||
var inputDesc = $('#elfinder-fm-file-desc', dialog);
|
||||
var btnSave = $('#elfinder-fm-file-desc-btn-save', dialog).button();
|
||||
|
||||
btnSave.click(function() {
|
||||
fm.lockfiles({files: [file.hash]});
|
||||
fm.request({
|
||||
data: {cmd: 'desc', target: file.hash, content: inputDesc.val()},
|
||||
notify: {type: 'desc', cnt: 1}
|
||||
})
|
||||
.always(function() {
|
||||
fm.unlockfiles({files : [file.hash]})
|
||||
});
|
||||
});
|
||||
}
|
||||
// load thumbnail
|
||||
if (tmb) {
|
||||
$('<img/>')
|
||||
.always(function() {
|
||||
fm.unlockfiles({files: [file.hash]})
|
||||
});
|
||||
});
|
||||
}
|
||||
// load thumbnail
|
||||
if (tmb) {
|
||||
$('<img/>')
|
||||
.load(function() {
|
||||
dialog.find('.elfinder-cwd-icon').css('background', 'url("' + tmb + '") center center no-repeat');
|
||||
})
|
||||
.attr('src', tmb);
|
||||
}
|
||||
|
||||
// send request to count total size
|
||||
if (count.length) {
|
||||
fm.request({
|
||||
data : {cmd : 'size', targets : count},
|
||||
preventDefault : true
|
||||
})
|
||||
.fail(function() {
|
||||
replSpinnerById(msg.unknown, 'size');
|
||||
})
|
||||
.done(function(data) {
|
||||
var size = parseInt(data.size);
|
||||
fm.log(data.size)
|
||||
replSpinnerById(size >= 0 ? fm.formatSize(size) : msg.unknown, 'size');
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
.attr('src', tmb);
|
||||
}
|
||||
|
||||
// send request to count total size
|
||||
if (count.length) {
|
||||
fm.request({
|
||||
data: {cmd: 'size', targets: count},
|
||||
preventDefault: true
|
||||
})
|
||||
.fail(function() {
|
||||
replSpinnerById(msg.unknown, 'size');
|
||||
})
|
||||
.done(function(data) {
|
||||
var size = parseInt(data.size);
|
||||
fm.log(data.size)
|
||||
replSpinnerById(size >= 0 ? fm.formatSize(size) : msg.unknown, 'size');
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
})(jQuery);
|
@@ -3,12 +3,14 @@ name = elFinder BUEditor integration
|
||||
description = Adding elFinder to BUEditor Insert Image dialog
|
||||
package = User interface
|
||||
core = 7.x
|
||||
project status url = https://drupal-elfinder.sourceforge.io/release-history.php
|
||||
|
||||
dependencies[] = bueditor
|
||||
dependencies[] = elfinder
|
||||
|
||||
; Information added by Drupal.org packaging script on 2018-12-03
|
||||
; Information added by Drupal.org packaging script on 2017-11-16
|
||||
version = "7.x-2.x-dev"
|
||||
core = "7.x"
|
||||
project = "elfinder"
|
||||
datestamp = "1543843700"
|
||||
datestamp = "1555577224"
|
||||
|
||||
|
@@ -1,15 +1,16 @@
|
||||
<?php
|
||||
// $Id: elfinder.module 102 2011-02-20 20:11:52Z ph0enix $
|
||||
|
||||
/**
|
||||
* BUEditor support for elFinder
|
||||
* Copyright (c) 2011, Alexey Sukhotin
|
||||
* elFinder Integration
|
||||
*
|
||||
* Copyright (c) 2010-2018, Alexey Sukhotin. All rights reserved.
|
||||
*/
|
||||
|
||||
// $Id: elfinder.module 102 2011-02-20 20:11:52Z ph0enix $
|
||||
|
||||
function elfinder_bueditor_elfinder_js_settings($settings) {
|
||||
|
||||
$newsettings['editorCallback'] = 'elfinder_bue_callback';
|
||||
|
||||
|
||||
$newsettings['browserscripts'][] = drupal_get_path('module', 'elfinder') . '/editors/bueditor/bueditor.callback.js';
|
||||
|
||||
return array('bue' => $newsettings, 'bueditor' => $newsettings);
|
||||
@@ -18,7 +19,7 @@ function elfinder_bueditor_elfinder_js_settings($settings) {
|
||||
/* D7 Support */
|
||||
function elfinder_bueditor_init() {
|
||||
$settings = array();
|
||||
$settings['BUE']['imceURL'] = url('elfinder', array('query' => array('app' => 'bueditor' )));
|
||||
$settings['BUE']['imceURL'] = url('elfinder', array('query' => array('app' => 'bueditor')));
|
||||
drupal_add_js($settings, 'setting');
|
||||
}
|
||||
|
||||
|
@@ -2,12 +2,14 @@ name = elFinder File Field Source
|
||||
description = File Field Sources elFinder connector
|
||||
package = User interface
|
||||
core = 7.x
|
||||
project status url = https://drupal-elfinder.sourceforge.io/release-history.php
|
||||
|
||||
dependencies[] = filefield_sources
|
||||
dependencies[] = elfinder
|
||||
|
||||
; Information added by Drupal.org packaging script on 2018-12-03
|
||||
; Information added by Drupal.org packaging script on 2017-11-16
|
||||
version = "7.x-2.x-dev"
|
||||
core = "7.x"
|
||||
project = "elfinder"
|
||||
datestamp = "1543843700"
|
||||
datestamp = "1555577224"
|
||||
|
||||
|
@@ -1,4 +1,9 @@
|
||||
<?php
|
||||
/**
|
||||
* elFinder Integration
|
||||
*
|
||||
* Copyright (c) 2010-2018, Alexey Sukhotin. All rights reserved.
|
||||
*/
|
||||
|
||||
// Main hooks to tell FielField Sources about our source
|
||||
function elfinder_ffsel_filefield_sources_info() {
|
||||
@@ -52,11 +57,11 @@ function filefield_source_elfinder_info() {
|
||||
function filefield_source_elfinder_menu() {
|
||||
$items = array();
|
||||
$items['filefield/elfinder/%/%'] = array(
|
||||
'page callback' => 'filefield_source_elfinder_page',
|
||||
'page arguments' => array(2, 3),
|
||||
'access callback' => 'filefield_edit_access',
|
||||
'access arguments' => array(2, 3),
|
||||
'type' => MENU_CALLBACK,
|
||||
'page callback' => 'filefield_source_elfinder_page',
|
||||
'page arguments' => array(2, 3),
|
||||
'access callback' => 'filefield_edit_access',
|
||||
'access arguments' => array(2, 3),
|
||||
'type' => MENU_CALLBACK,
|
||||
);
|
||||
return $items;
|
||||
}
|
||||
@@ -66,9 +71,9 @@ function filefield_source_elfinder_menu() {
|
||||
*/
|
||||
function elfinder_ffsel_theme() {
|
||||
return array(
|
||||
'filefield_source_elfinder_element' => array(
|
||||
'render element' => 'element',
|
||||
),
|
||||
'filefield_source_elfinder_element' => array(
|
||||
'render element' => 'element',
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -90,58 +95,58 @@ function filefield_source_elfinder_process($element, &$form_state, $form) {
|
||||
$instance = field_widget_instance($element, $form_state);
|
||||
|
||||
$element['filefield_elfinder'] = array(
|
||||
'#weight' => 100.5,
|
||||
'#theme' => 'filefield_source_elfinder_element',
|
||||
'#filefield_source' => TRUE, // Required for proper theming.
|
||||
'#description' => filefield_sources_element_validation_help($element['#upload_validators']),
|
||||
'#weight' => 100.5,
|
||||
'#theme' => 'filefield_source_elfinder_element',
|
||||
'#filefield_source' => TRUE, // Required for proper theming.
|
||||
'#description' => filefield_sources_element_validation_help($element['#upload_validators']),
|
||||
);
|
||||
|
||||
$filepath_id = $element['#id'] . '-elfinder-path';
|
||||
$display_id = $element['#id'] . '-elfinder-display';
|
||||
$select_id = $element['#id'] . '-elfinder-select';
|
||||
$element['filefield_elfinder']['file_path'] = array(
|
||||
'#type' => 'hidden',
|
||||
'#attributes' => array(
|
||||
'id' => $filepath_id,
|
||||
'onchange' => "if (!jQuery('#$select_id').attr('disabled')) { jQuery('#$select_id').mousedown().attr('disabled', true); jQuery('#$display_id').html(this.value); }",
|
||||
),
|
||||
'#value_callback' => 'elfinder_ffsel_element_value',
|
||||
'#upload_validators' => $element['#upload_validators'],
|
||||
'#maxlength' => NULL,
|
||||
'#type' => 'hidden',
|
||||
'#attributes' => array(
|
||||
'id' => $filepath_id,
|
||||
'onchange' => "if (!jQuery('#$select_id').attr('disabled')) { jQuery('#$select_id').mousedown().attr('disabled', true); jQuery('#$display_id').html(this.value); }",
|
||||
),
|
||||
'#value_callback' => 'elfinder_ffsel_element_value',
|
||||
'#upload_validators' => $element['#upload_validators'],
|
||||
'#maxlength' => NULL,
|
||||
);
|
||||
|
||||
$width = variable_get('elfinder_settings_misc_manager_width', '');
|
||||
if(!$width) {
|
||||
if (!$width) {
|
||||
$width = ELFINDER_POPUP_WIDTH;
|
||||
}
|
||||
$height = variable_get('elfinder_settings_misc_manager_height', '');
|
||||
if(!$height) {
|
||||
if (!$height) {
|
||||
$height = ELFINDER_POPUP_HEIGHT;
|
||||
}
|
||||
|
||||
$elfinder_function = 'var left = window.screenX + (window.innerWidth / 2) - (' . $width . ' / 2); var top = window.screenY + (window.innerHeight / 2) - (' . $height . ' / 2); window.open(\'' . url('elfinder', array('query' => array('app' => 'ffs', 'field_name' => $element['#field_name'], 'filepath_id' => $filepath_id, 'select_id' => $select_id))) . '\', \'\', \'width=' . $width . ',height=' . $height . ',top=\'+top+\',left=\'+left+\',resizable=1\'); return false;';
|
||||
|
||||
$element['filefield_elfinder']['display_path'] = array(
|
||||
'#type' => 'markup',
|
||||
'#markup' => '<span id="' . $display_id . '" class="filefield-sources-elfinder-display">' . t('No file selected') . '</span> (<a class="filefield-sources-elfinder-browse" href="#" onclick="' . $elfinder_function . '">' . t('browse') . '</a>)',
|
||||
'#type' => 'markup',
|
||||
'#markup' => '<span id="' . $display_id . '" class="filefield-sources-elfinder-display">' . t('No file selected') . '</span> (<a class="filefield-sources-elfinder-browse" href="#" onclick="' . $elfinder_function . '">' . t('browse') . '</a>)',
|
||||
);
|
||||
|
||||
$element['filefield_elfinder']['upload_button'] = array(
|
||||
'#name' => implode('_', $element['#array_parents']) . '_elfinder_select',
|
||||
'#type' => 'submit',
|
||||
'#value' => t('Select'),
|
||||
'#validate' => array(),
|
||||
'#submit' => array('filefield_sources_field_submit'),
|
||||
'#limit_validation_errors' => array($element['#parents']),
|
||||
'#name' => $element['#name'] . '[filefield_elfinder][button]',
|
||||
'#id' => $select_id,
|
||||
'#attributes' => array('style' => 'display: none;'),
|
||||
'#ajax' => array(
|
||||
'path' => 'file/ajax/' . implode('/', $element['#array_parents']) . '/' . $form['form_build_id']['#value'],
|
||||
'wrapper' => $element['upload_button']['#ajax']['wrapper'],
|
||||
'method' => 'replace',
|
||||
'effect' => 'fade',
|
||||
),
|
||||
'#name' => implode('_', $element['#array_parents']) . '_elfinder_select',
|
||||
'#type' => 'submit',
|
||||
'#value' => t('Select'),
|
||||
'#validate' => array(),
|
||||
'#submit' => array('filefield_sources_field_submit'),
|
||||
'#limit_validation_errors' => array($element['#parents']),
|
||||
'#name' => $element['#name'] . '[filefield_elfinder][button]',
|
||||
'#id' => $select_id,
|
||||
'#attributes' => array('style' => 'display: none;'),
|
||||
'#ajax' => array(
|
||||
'path' => 'file/ajax/' . implode('/', $element['#array_parents']) . '/' . $form['form_build_id']['#value'],
|
||||
'wrapper' => $element['upload_button']['#ajax']['wrapper'],
|
||||
'method' => 'replace',
|
||||
'effect' => 'fade',
|
||||
),
|
||||
);
|
||||
|
||||
return $element;
|
||||
@@ -163,21 +168,21 @@ function filefield_source_elfinder_value($element, &$item) {
|
||||
|
||||
// Resolve the file path to an FID.
|
||||
$fid = db_select('file_managed', 'f')
|
||||
->condition('uri', rawurldecode($uri))
|
||||
->fields('f', array('fid'))
|
||||
->execute()
|
||||
->fetchField();
|
||||
->condition('uri', rawurldecode($uri))
|
||||
->fields('f', array('fid'))
|
||||
->execute()
|
||||
->fetchField();
|
||||
if ($fid) {
|
||||
$file = file_load($fid);
|
||||
if (filefield_sources_element_validate($element, $file)) {
|
||||
$item = array_merge($item, (array) $file);
|
||||
$item = array_merge($item, (array)$file);
|
||||
}
|
||||
} else {
|
||||
$local_root = elfinder_document_root() . '/' . $file_directory_prefix . '/';
|
||||
$file_path = preg_replace('/.*(' . preg_quote('/' . $file_directory_prefix . '/', '/') . ')/', $local_root, $item['filefield_elfinder']['file_path']);
|
||||
|
||||
if ($file = filefield_sources_save_file($file_path, $element['#upload_validators'], $element['#upload_location'], FILE_EXISTS_REPLACE)) {
|
||||
$item = array_merge($item, (array) $file);
|
||||
$item = array_merge($item, (array)$file);
|
||||
drupal_set_message(t('File created'));
|
||||
} else {
|
||||
form_error($element, t('The selected file could not be used because the file does not exist in the database.'));
|
||||
@@ -237,7 +242,7 @@ function elfinder_ffsel_elfinder_js_settings($settings) {
|
||||
*/
|
||||
function elfinder_ffsel_element_value($element, $input = FALSE, &$form_state = NULL) {
|
||||
|
||||
if(empty($input)) {
|
||||
if (empty($input)) {
|
||||
return array();
|
||||
}
|
||||
|
||||
@@ -265,22 +270,22 @@ function elfinder_ffsel_element_value($element, $input = FALSE, &$form_state = N
|
||||
|
||||
$files = explode('%%', $input);
|
||||
|
||||
foreach($files AS $delta => $file) {
|
||||
foreach ($files AS $delta => $file) {
|
||||
// Respect the field's count limit.
|
||||
if($upload_delta == $field['cardinality']) {
|
||||
if ($upload_delta == $field['cardinality']) {
|
||||
break;
|
||||
}
|
||||
$uri = preg_replace('/.*(' . preg_quote('/' . $file_directory_prefix . '/', '/') . ')/', $scheme . '://', $file);
|
||||
// Resolve the file path to an FID.
|
||||
$fid = db_select('file_managed', 'f')
|
||||
->condition('uri', rawurldecode($uri))
|
||||
->fields('f', array('fid'))
|
||||
->execute()
|
||||
->fetchField();
|
||||
->condition('uri', rawurldecode($uri))
|
||||
->fields('f', array('fid'))
|
||||
->execute()
|
||||
->fetchField();
|
||||
if ($fid) {
|
||||
$file = file_load($fid);
|
||||
if (filefield_sources_element_validate($element, $file)) {
|
||||
$items[$upload_delta] = (array) $file;
|
||||
$items[$upload_delta] = (array)$file;
|
||||
$items[$upload_delta]['_weight'] = $upload_delta;
|
||||
$upload_delta++;
|
||||
}
|
||||
@@ -289,7 +294,7 @@ function elfinder_ffsel_element_value($element, $input = FALSE, &$form_state = N
|
||||
$file_path = preg_replace('/.*(' . preg_quote('/' . $file_directory_prefix . '/', '/') . ')/', $local_root, $file);
|
||||
|
||||
if ($file = filefield_sources_save_file($file_path, $element['#upload_validators'], $element['#upload_location'], FILE_EXISTS_REPLACE)) {
|
||||
$items[$upload_delta] = (array) $file;
|
||||
$items[$upload_delta] = (array)$file;
|
||||
$items[$upload_delta]['_weight'] = $upload_delta;
|
||||
$upload_delta++;
|
||||
drupal_set_message(t('File created'));
|
||||
|
@@ -1,26 +1,39 @@
|
||||
/*
|
||||
* elFinder Integration
|
||||
*
|
||||
* Copyright (c) 2010-2018, Alexey Sukhotin. All rights reserved.
|
||||
*/
|
||||
|
||||
function elfinder_ffs_callback(arg1) {
|
||||
var fieldName = Drupal.settings.elfinder.field_name;
|
||||
var fieldId = Drupal.settings.elfinder.filepath_id;
|
||||
|
||||
var fieldName = Drupal.settings.elfinder.field_name;
|
||||
var fieldId = Drupal.settings.elfinder.filepath_id;
|
||||
var url = arg1;
|
||||
|
||||
var url = arg1;
|
||||
if (typeof arg1 == 'object') {
|
||||
if ($.isArray(arg1)) {
|
||||
url = arg1[0];
|
||||
} else {
|
||||
url = arg1.url;
|
||||
}
|
||||
}
|
||||
|
||||
if (typeof arg1 == 'object') {
|
||||
url = arg1.url;
|
||||
}
|
||||
|
||||
var filePath = url;
|
||||
|
||||
/* Needs rework: must support both classic single file selection and multiple selection */
|
||||
//var filePath = arg1.join('%%');
|
||||
var filePath = url;
|
||||
|
||||
window.opener.jQuery('input#'+fieldId).val(filePath).change();
|
||||
window.opener.focus();
|
||||
/* Needs rework: must support both classic single file selection and multiple selection */
|
||||
//var filePath = arg1.join('%%');
|
||||
|
||||
// Avoid beforeunload event when selecting an image.
|
||||
// https://github.com/Studio-42/elFinder/issues/1340
|
||||
// Maybe remove this when elfinder js library gets updated.
|
||||
//$(window).off('beforeunload');
|
||||
if (typeof filePath == 'undefined') {
|
||||
console.log('Undefined filePath, please check integration');
|
||||
}
|
||||
|
||||
window.close();
|
||||
window.opener.jQuery('input#' + fieldId).val(filePath).change();
|
||||
window.opener.focus();
|
||||
|
||||
// Avoid beforeunload event when selecting an image.
|
||||
// https://github.com/Studio-42/elFinder/issues/1340
|
||||
// Maybe remove this when elfinder js library gets updated.
|
||||
//$(window).off('beforeunload');
|
||||
|
||||
window.close();
|
||||
}
|
||||
|
@@ -0,0 +1,14 @@
|
||||
name = elFinder TinyMCE integration
|
||||
description = Extended tinyMCE integration
|
||||
package = User interface
|
||||
core = 7.x
|
||||
project status url = https://drupal-elfinder.sourceforge.io/release-history.php
|
||||
|
||||
dependencies[] = elfinder
|
||||
|
||||
; Information added by Drupal.org packaging script on 2017-11-16
|
||||
version = "7.x-2.x-dev"
|
||||
core = "7.x"
|
||||
project = "elfinder"
|
||||
datestamp = "1555577224"
|
||||
|
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/**
|
||||
* elFinder Integration
|
||||
*
|
||||
* Copyright (c) 2010-2018, Alexey Sukhotin. All rights reserved.
|
||||
*/
|
||||
|
||||
// $Id: elfinder.module 102 2011-02-20 20:11:52Z ph0enix $
|
||||
|
||||
function elfinder_tinymce_elfinder_js_settings($settings) {
|
||||
|
||||
// $newsettings['editorCallback'] = 'elfinder_bue_callback';
|
||||
|
||||
$newsettings['browserscripts'][] = drupal_get_path('module', 'elfinder') . '/editors/bueditor/bueditor.callback.js';
|
||||
|
||||
return array('bue' => $newsettings, 'bueditor' => $newsettings);
|
||||
}
|
||||
|
||||
/* D7 Support */
|
||||
function elfinder_tinymce_init() {
|
||||
$settings = array();
|
||||
drupal_add_js($settings, 'setting');
|
||||
}
|
||||
|
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* elFinder file browser page template
|
||||
* Copyright (c) 2010, Alexey Sukhotin
|
||||
*/
|
||||
?>
|
||||
<div id="finder"></div>
|
||||
<?php
|
||||
|
||||
/**
|
||||
* elFinder Integration
|
||||
*
|
||||
* Copyright (c) 2010-2018, Alexey Sukhotin. All rights reserved.
|
||||
*/
|
||||
?>
|
||||
<div id="finder"></div>
|
||||
|
@@ -1,26 +1,26 @@
|
||||
<?php
|
||||
/**
|
||||
* @file
|
||||
* elFinder file browser page template
|
||||
* Copyright (c) 2010, Alexey Sukhotin
|
||||
* elFinder Integration
|
||||
*
|
||||
* Copyright (c) 2010-2018, Alexey Sukhotin. All rights reserved.
|
||||
*/
|
||||
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"
|
||||
lang="<?php print isset($language->language) ? $language->language : 'en'; ?>"
|
||||
xml:lang="<?php print isset($language->language) ? $language->language : 'en'; ?>">
|
||||
<head>
|
||||
<title><?php print t('File Browser'); ?></title>
|
||||
<head>
|
||||
<title><?php print t('File Browser'); ?></title>
|
||||
|
||||
<?php
|
||||
print drupal_get_html_head();
|
||||
print elfinder_browser_css();
|
||||
print elfinder_browser_js();
|
||||
?>
|
||||
<!-- make inline popup WORK -->
|
||||
</head>
|
||||
<body class="elfinder">
|
||||
<div id="elfinder-messages"><?php print theme('status_messages'); ?></div>
|
||||
<div id="finder"></div>
|
||||
<?php print drupal_get_js('footer'); ?>
|
||||
</body>
|
||||
<?php
|
||||
print drupal_get_html_head();
|
||||
print elfinder_browser_css();
|
||||
print elfinder_browser_js();
|
||||
?>
|
||||
<!-- make inline popup WORK -->
|
||||
</head>
|
||||
<body class="elfinder">
|
||||
<div id="elfinder-messages"><?php print theme('status_messages'); ?></div>
|
||||
<div id="finder"></div>
|
||||
<?php print drupal_get_js('footer'); ?>
|
||||
</body>
|
||||
</html>
|
||||
|
Reference in New Issue
Block a user