From 720ff498338e4ac05fb41477f0257311fa9a6bbc Mon Sep 17 00:00:00 2001 From: Eric Rasmussen <eric@unl.edu> Date: Wed, 4 Apr 2012 18:34:48 +0000 Subject: [PATCH] [gh-308] Merging test into staging git-svn-id: file:///tmp/wdn_thm_drupal/branches/drupal-7.x/staging@1518 20a16fea-79d4-4915-8869-1ea9d5ebf173 --- README-UNL.txt | 4 + sites/all/modules/imce/LICENSE.txt | 601 ++++++++++-------- sites/all/modules/imce/imce.info | 6 +- sites/all/modules/imce/imce.install | 2 + sites/all/modules/imce/inc/imce.page.inc | 23 +- sites/all/modules/imce_mkdir/LICENSE.txt | 601 ++++++++++-------- sites/all/modules/imce_mkdir/README.txt | 1 - sites/all/modules/imce_mkdir/imce_mkdir.css | 1 - sites/all/modules/imce_mkdir/imce_mkdir.inc | 170 +++++ sites/all/modules/imce_mkdir/imce_mkdir.info | 10 +- .../all/modules/imce_mkdir/imce_mkdir.install | 1 - sites/all/modules/imce_mkdir/imce_mkdir.js | 5 +- .../all/modules/imce_mkdir/imce_mkdir.module | 162 +---- sites/all/modules/imce_wysiwyg/CHANGELOG.txt | 4 +- sites/all/modules/imce_wysiwyg/LICENSE.txt | 601 ++++++++++-------- .../modules/imce_wysiwyg/imce_wysiwyg.info | 7 +- .../modules/imce_wysiwyg/imce_wysiwyg.module | 2 +- sites/all/modules/unl/includes/common.php | 10 +- sites/all/modules/unl/unl.module | 76 +-- sites/all/modules/wysiwyg/CHANGELOG.txt | 21 +- sites/all/modules/wysiwyg/README.txt | 14 +- .../all/modules/wysiwyg/editors/ckeditor.inc | 8 +- .../wysiwyg/editors/css/openwysiwyg.css | 1 - .../modules/wysiwyg/editors/css/tinymce-2.css | 1 - .../modules/wysiwyg/editors/css/tinymce-3.css | 1 - .../all/modules/wysiwyg/editors/fckeditor.inc | 1 - .../wysiwyg/editors/js/ckeditor-3.0.js | 6 +- .../wysiwyg/editors/js/fckeditor-2.6.js | 1 - .../wysiwyg/editors/js/fckeditor.config.js | 1 - .../modules/wysiwyg/editors/js/jwysiwyg.js | 1 - .../modules/wysiwyg/editors/js/markitup.js | 1 - .../all/modules/wysiwyg/editors/js/nicedit.js | 14 +- sites/all/modules/wysiwyg/editors/js/none.js | 1 - .../modules/wysiwyg/editors/js/openwysiwyg.js | 1 - .../modules/wysiwyg/editors/js/tinymce-2.js | 1 - .../modules/wysiwyg/editors/js/tinymce-3.js | 4 +- .../wysiwyg/editors/js/whizzywig-56.js | 10 +- .../wysiwyg/editors/js/whizzywig-60.js | 12 +- .../modules/wysiwyg/editors/js/whizzywig.js | 10 +- .../modules/wysiwyg/editors/js/wymeditor.js | 1 - sites/all/modules/wysiwyg/editors/js/yui.js | 1 - .../all/modules/wysiwyg/editors/jwysiwyg.inc | 1 - .../all/modules/wysiwyg/editors/markitup.inc | 1 - sites/all/modules/wysiwyg/editors/nicedit.inc | 1 - .../modules/wysiwyg/editors/openwysiwyg.inc | 1 - sites/all/modules/wysiwyg/editors/tinymce.inc | 10 +- .../all/modules/wysiwyg/editors/whizzywig.inc | 1 - .../all/modules/wysiwyg/editors/wymeditor.inc | 1 - sites/all/modules/wysiwyg/editors/yui.inc | 1 - sites/all/modules/wysiwyg/plugins/break.inc | 1 - .../modules/wysiwyg/plugins/break/break.css | 1 - .../modules/wysiwyg/plugins/break/break.js | 1 - .../modules/wysiwyg/plugins/break/langs/ca.js | 1 - .../modules/wysiwyg/plugins/break/langs/de.js | 1 - .../modules/wysiwyg/plugins/break/langs/en.js | 1 - .../modules/wysiwyg/plugins/break/langs/es.js | 1 - sites/all/modules/wysiwyg/tests/wysiwyg.test | 7 + .../modules/wysiwyg/tests/wysiwyg_test.info | 14 + .../wysiwyg/tests/wysiwyg_test.install | 7 + .../modules/wysiwyg/tests/wysiwyg_test.module | 7 + .../wysiwyg/wysiwyg-dialog-page.tpl.php | 1 - sites/all/modules/wysiwyg/wysiwyg.admin.inc | 24 +- sites/all/modules/wysiwyg/wysiwyg.api.js | 1 - sites/all/modules/wysiwyg/wysiwyg.api.php | 3 +- sites/all/modules/wysiwyg/wysiwyg.dialog.inc | 1 - sites/all/modules/wysiwyg/wysiwyg.info | 12 +- sites/all/modules/wysiwyg/wysiwyg.init.js | 1 - sites/all/modules/wysiwyg/wysiwyg.install | 6 +- sites/all/modules/wysiwyg/wysiwyg.js | 3 +- sites/all/modules/wysiwyg/wysiwyg.module | 103 ++- 70 files changed, 1458 insertions(+), 1155 deletions(-) create mode 100644 sites/all/modules/imce_mkdir/imce_mkdir.inc create mode 100644 sites/all/modules/wysiwyg/tests/wysiwyg.test create mode 100644 sites/all/modules/wysiwyg/tests/wysiwyg_test.info create mode 100644 sites/all/modules/wysiwyg/tests/wysiwyg_test.install create mode 100644 sites/all/modules/wysiwyg/tests/wysiwyg_test.module diff --git a/README-UNL.txt b/README-UNL.txt index f8b30552..112d7802 100644 --- a/README-UNL.txt +++ b/README-UNL.txt @@ -78,3 +78,7 @@ Add Trigger Support Patch to Workbench Moderation * from http://drupal.org/node/1079134 * Don't upgrade WB Moderation without first applying this patch unless the new version supports Triggers +------------------------------------ +wysiwyg/editors/js/tinymce-3.js + * Comment out the part that switches wrappers from table-based to div. We need the original TinyMCE code for the PDW toggle plugin to work + diff --git a/sites/all/modules/imce/LICENSE.txt b/sites/all/modules/imce/LICENSE.txt index 2c095c8d..d159169d 100644 --- a/sites/all/modules/imce/LICENSE.txt +++ b/sites/all/modules/imce/LICENSE.txt @@ -1,274 +1,339 @@ -GNU GENERAL PUBLIC LICENSE - - Version 2, June 1991 - -Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave, -Cambridge, MA 02139, USA. Everyone is permitted to copy and distribute -verbatim copies of this license document, but changing it is not allowed. - - Preamble - -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 Library General Public License -instead.) You can apply it to your programs, too. - -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. - -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. - -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. + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + 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. + + Preamble + + 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. + + 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. + + 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. + + 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.) +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 +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 +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. diff --git a/sites/all/modules/imce/imce.info b/sites/all/modules/imce/imce.info index 30a923f6..6394ad4e 100644 --- a/sites/all/modules/imce/imce.info +++ b/sites/all/modules/imce/imce.info @@ -4,9 +4,9 @@ core = "7.x" package = "Media" configure = "admin/config/media/imce" -; Information added by drupal.org packaging script on 2011-06-06 -version = "7.x-1.4" +; Information added by drupal.org packaging script on 2011-10-20 +version = "7.x-1.5" core = "7.x" project = "imce" -datestamp = "1307386616" +datestamp = "1319104232" diff --git a/sites/all/modules/imce/imce.install b/sites/all/modules/imce/imce.install index 865236bb..8d3e4201 100644 --- a/sites/all/modules/imce/imce.install +++ b/sites/all/modules/imce/imce.install @@ -27,7 +27,9 @@ function imce_uninstall() { variable_del('imce_settings_disable_private'); variable_del('imce_custom_content'); variable_del('imce_custom_process'); + variable_del('imce_custom_init'); variable_del('imce_custom_scan'); + variable_del('imce_custom_response'); } /** diff --git a/sites/all/modules/imce/inc/imce.page.inc b/sites/all/modules/imce/inc/imce.page.inc index c5b6907c..27b27ada 100644 --- a/sites/all/modules/imce/inc/imce.page.inc +++ b/sites/all/modules/imce/inc/imce.page.inc @@ -101,6 +101,12 @@ function imce_js($user, $scheme, $jsop = '') { if (function_exists($func = 'imce_js_' . $jsop)) { $response['data'] = $func($imce); } + // Allow alteration of response. + foreach (variable_get('imce_custom_response', array()) as $func => $state) { + if ($state && function_exists($func)) { + $func($jsop, $response, $imce, $user); + } + } } } //messages @@ -697,6 +703,12 @@ function imce_initiate_profile($user, $scheme = NULL) { //check user profile and translate tokens in directory paths and evaluate php paths. if ($imce = imce_user_profile($user, $scheme)) { + // Allow alteration of raw profile + foreach (variable_get('imce_custom_init', array()) as $func => $state) { + if ($state && function_exists($func)) { + $func($imce, $user); + } + } imce_process_directories($imce, $user); if (!empty($imce['directories'])) { $imce['uid'] = (int) $user->uid; @@ -879,7 +891,7 @@ function imce_directory_info($dirname, $imce) { $diruri = imce_dir_uri($imce, $dirname); if (file_prepare_directory($diruri)) { foreach ($imce['directories'] as $name => $prop) { - if ($prop['subnav'] && ($name == '.' || strpos($dirname . '/', $name . '/') === 0)) { + if ($prop['subnav'] && ($name === '.' || strpos($dirname . '/', $name . '/') === 0)) { $info = $prop; $info['name'] = $dirname; } @@ -896,11 +908,15 @@ function imce_directory_info($dirname, $imce) { function imce_subdirectories_accessible(&$imce) { if (!empty($imce['subdirectories'])) { + if (!empty($imce['perm']['subnav'])) { + return TRUE; + } //checking only the first one is sufficient. $dirname = ($imce['dir'] == '.' ? '' : $imce['dir'] . '/') . $imce['subdirectories'][0]; //check if any setting is applicable for this subdirectory through any directory in the list. foreach ($imce['directories'] as $name => $info) { + $name = (string) $name; if ($info['subnav'] && $dirname != $name && ($name == '.' || strpos($dirname . '/', $name . '/') === 0)) { return TRUE; } @@ -947,9 +963,10 @@ function imce_scan_directory($dirname, $imce) { return $directory; } - $exclude = array('.' => 1, '..' => 1, 'CVS' => 1, '.svn' => 1, '.htaccess' => 1); while (($file = readdir($handle)) !== FALSE) { - if (isset($exclude[$file])) { + + // Do not include dot files and folders + if (substr($file, 0, 1) === '.') { continue; } diff --git a/sites/all/modules/imce_mkdir/LICENSE.txt b/sites/all/modules/imce_mkdir/LICENSE.txt index 2c095c8d..d159169d 100644 --- a/sites/all/modules/imce_mkdir/LICENSE.txt +++ b/sites/all/modules/imce_mkdir/LICENSE.txt @@ -1,274 +1,339 @@ -GNU GENERAL PUBLIC LICENSE - - Version 2, June 1991 - -Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave, -Cambridge, MA 02139, USA. Everyone is permitted to copy and distribute -verbatim copies of this license document, but changing it is not allowed. - - Preamble - -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 Library General Public License -instead.) You can apply it to your programs, too. - -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. - -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. - -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. + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + 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. + + Preamble + + 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. + + 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. + + 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. + + 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.) +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 +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 +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. diff --git a/sites/all/modules/imce_mkdir/README.txt b/sites/all/modules/imce_mkdir/README.txt index 767b17b2..202257a1 100644 --- a/sites/all/modules/imce_mkdir/README.txt +++ b/sites/all/modules/imce_mkdir/README.txt @@ -1,4 +1,3 @@ -// $Id: README.txt,v 1.2 2010/06/19 15:21:02 ufku Exp $ IMCE Mkdir http://drupal.org/project/imce_mkdir diff --git a/sites/all/modules/imce_mkdir/imce_mkdir.css b/sites/all/modules/imce_mkdir/imce_mkdir.css index 81212925..11b783c4 100644 --- a/sites/all/modules/imce_mkdir/imce_mkdir.css +++ b/sites/all/modules/imce_mkdir/imce_mkdir.css @@ -1,4 +1,3 @@ -/* $Id: imce_mkdir.css,v 1.3 2010/09/27 21:30:56 ufku Exp $ */ #op-item-mngdir a { background-image: url(dirmanage.png); } diff --git a/sites/all/modules/imce_mkdir/imce_mkdir.inc b/sites/all/modules/imce_mkdir/imce_mkdir.inc new file mode 100644 index 00000000..5bb6ec55 --- /dev/null +++ b/sites/all/modules/imce_mkdir/imce_mkdir.inc @@ -0,0 +1,170 @@ +<?php + +/** + * Implements hook_form_formID_alter(). + */ +function _imce_mkdir_form_imce_profile_form_alter(&$form, &$form_state) { + foreach (element_children($form['profile']['directories']) as $key) { + $form['profile']['directories'][$key]['mkdir'] = array( + '#type' => 'checkbox', + '#title' => t('Add subdirectories'), + '#default_value' => isset($form_state['profile']['directories'][$key]['mkdir']) ? $form_state['profile']['directories'][$key]['mkdir'] : 0, + ); + $form['profile']['directories'][$key]['rmdir'] = array( + '#type' => 'checkbox', + '#title' => t('Remove subdirectories'), + '#default_value' => isset($form_state['profile']['directories'][$key]['rmdir']) ? $form_state['profile']['directories'][$key]['rmdir'] : 0, + ); + } + $form['profile']['mkdirnum'] = array( + '#type' => 'textfield', + '#title' => t('Maximum number of subdirectories'), + '#default_value' => isset($form_state['profile']['mkdirnum']) ? $form_state['profile']['mkdirnum'] : 2, + '#description' => t('This setting is applicable only if you allow subdirectory creation under any of the predefined directories. Define here the maximum number of subdirectories a directory can have. Setting this to 0 removes the limit and also allows infinite subdirectory depth.'), + ); +} + +/** + * Mkdir form. + */ +function _imce_mkdir_form($form, &$form_state, &$imce) { + $mkdir['html1']['#markup'] = '<div class="container-inline">'; + $mkdir['dirname'] = array( + '#type' => 'textfield', + '#title' => t('Subdirectory name'), + '#size' => 12, + '#maxlength' => 255, + ); + if (imce_perm_exists($imce, 'mkdir')) { + $mkdir['mkdir'] = array( + '#type' => 'submit', + '#value' => t('Add'), + '#submit' => $imce['perm']['mkdir'] ? array('imce_mkdir_submit') : NULL, + ); + } + if (imce_perm_exists($imce, 'rmdir')) { + $mkdir['rmdir'] = array( + '#type' => 'submit', + '#value' => t('Remove'), + '#submit' => $imce['perm']['rmdir'] ? array('imce_mkdir_rmdir_submit') : NULL, + ); + } + $mkdir['html2']['#markup'] = '</div>'; + $form['fset_mkdir'] = array( + '#type' => 'fieldset', + '#title' => t('Directory'), + ) + $mkdir; + $form['#action'] = $imce['url']; + return $form; +} + +/** + * Submits mkdir form. + */ +function imce_mkdir_submit($form, &$form_state) { + $form_state['redirect'] = FALSE; + $imce = &$form_state['build_info']['args'][0]['imce']; + imce_mkdir_batch($imce, array(rawurldecode($form_state['values']['dirname']))); +} + +/** + * Batch adds directories. + */ +function imce_mkdir_batch(&$imce, $dirnames = array()) { + if (!isset($imce['diradded'])) { + $imce['diradded'] = array(); + } + $parent = imce_dir_uri($imce); + + foreach ($dirnames as $dirname) { + if (!preg_match('/^[A-Za-z0-9_\-]+$/', $dirname)) { + drupal_set_message(t('%dirname is not a valid directory name. It should contain only alphanumeric characters, hyphen and underscore.', array('%dirname' => $dirname)), 'error'); + continue; + } + + $dirpath = $parent . $dirname; + + if (file_exists($dirpath)) { + drupal_set_message(t('Subdirectory %dir already exists.', array('%dir' => $dirname)), 'error'); + continue; + } + + if (!file_prepare_directory($dirpath, FILE_CREATE_DIRECTORY)) { + drupal_set_message(t('Subdirectory %dir could not be created.', array('%dir' => $dirname)), 'error'); + continue; + } + + drupal_set_message(t('Subdirectory %dir has been added.', array('%dir' => $dirname))); + $imce['diradded'][] = $imce['subdirectories'][] = $dirname; + } +} + +/** + * Submits rmdir form. + */ +function imce_mkdir_rmdir_submit($form, &$form_state) { + $form_state['redirect'] = FALSE; + $imce = &$form_state['build_info']['args'][0]['imce']; + imce_mkdir_rmdir_batch($imce, array(rawurldecode($form_state['values']['dirname']))); +} + +/** + * Batch removes directories. + */ +function imce_mkdir_rmdir_batch(&$imce, $dirnames = array()) { + if (!isset($imce['dirremoved'])) { + $imce['dirremoved'] = array(); + } + $parent = imce_dir_uri($imce); + $prefix = ($imce['dir'] == '.' ? '' : $imce['dir'] . '/'); + + foreach ($dirnames as $dirname) { + $index = array_search($dirname, $imce['subdirectories']); + + if ($index === FALSE) { + drupal_set_message(t('Subdirectory %dir does not exist.', array('%dir' => $dirname)), 'error'); + continue; + } + + if (isset($imce['directories'][$prefix . $dirname])) { + drupal_set_message(t('Subdirectory %dir is a predefined directory and can not be removed.', array('%dir' => $dirname)), 'error'); + continue; + } + + $dirpath = $parent . $dirname; + if (!imce_mkdir_rmdir_recursive($dirpath)) { + drupal_set_message(t('Subdirectory %dir could not be removed.', array('%dir' => $dirname)), 'error'); + continue; + } + + drupal_set_message(t('Subdirectory %dir has been removed.', array('%dir' => $dirname))); + $imce['dirremoved'] = array_merge($imce['dirremoved'], array_splice($imce['subdirectories'], $index, 1)); + } +} + +/** + * Recursive directory deletion + */ +function imce_mkdir_rmdir_recursive($path) { + static $dirlen; + if (!isset($dirlen)) { + $dirlen = strlen(file_uri_scheme($path)) + 3; + } + if (is_dir($path) && !is_link($path)) { + if ($handle = @opendir($path)) { + while (($file = readdir($handle)) !== FALSE) { + if ($file == '.' || $file == '..') { + continue; + } + $filepath = $path . '/' . $file; + if (!imce_mkdir_rmdir_recursive($filepath)) { + drupal_set_message(t('%path could not be removed.', array('%path' => substr($filepath, $dirlen))), 'error'); + break; + } + } + closedir($handle); + } + return @rmdir($path); + } + return imce_delete_filepath($path); +} \ No newline at end of file diff --git a/sites/all/modules/imce_mkdir/imce_mkdir.info b/sites/all/modules/imce_mkdir/imce_mkdir.info index 6407a511..45bfa334 100644 --- a/sites/all/modules/imce_mkdir/imce_mkdir.info +++ b/sites/all/modules/imce_mkdir/imce_mkdir.info @@ -1,17 +1,13 @@ -; $Id: imce_mkdir.info,v 1.3 2010/06/19 15:21:02 ufku Exp $ name = "IMCE Mkdir" description = "Allows users manage directories in IMCE" core = "7.x" package = "Media" dependencies[] = "imce" -files[] = "imce_mkdir.install" -files[] = "imce_mkdir.module" - -; Information added by drupal.org packaging script on 2010-10-09 -version = "7.x-1.0-beta2" +; Information added by drupal.org packaging script on 2011-10-20 +version = "7.x-1.0" core = "7.x" project = "imce_mkdir" -datestamp = "1286608569" +datestamp = "1319103332" diff --git a/sites/all/modules/imce_mkdir/imce_mkdir.install b/sites/all/modules/imce_mkdir/imce_mkdir.install index cd0b13de..3985b317 100644 --- a/sites/all/modules/imce_mkdir/imce_mkdir.install +++ b/sites/all/modules/imce_mkdir/imce_mkdir.install @@ -1,5 +1,4 @@ <?php -// $Id: imce_mkdir.install,v 1.3 2010/09/27 21:30:56 ufku Exp $ /** * @file diff --git a/sites/all/modules/imce_mkdir/imce_mkdir.js b/sites/all/modules/imce_mkdir/imce_mkdir.js index b9016f6e..75122d17 100644 --- a/sites/all/modules/imce_mkdir/imce_mkdir.js +++ b/sites/all/modules/imce_mkdir/imce_mkdir.js @@ -1,4 +1,3 @@ -// $Id: imce_mkdir.js,v 1.4 2010/09/27 21:30:56 ufku Exp $ (function($) { //add hook:load. process mkdir form @@ -15,7 +14,7 @@ imce.hooks.load.push(function () { var dop = this.id.substr(5); $(imce.mkdirOps[dop] = this).click(function() {imce.dopSubmit(dop); return false;}); }); - imce.opAdd({name: 'mngdir', title: Drupal.t('Manage directories'), content: form}); + imce.opAdd({name: 'mngdir', title: Drupal.t('Directory'), content: form}); imce.mkdirRefreshOps(); //add hook:navigate. set dirops visibility imce.hooks.navigate.push(function (data, olddir, cached) { @@ -115,7 +114,7 @@ imce.mkdirSubSelector = function () { var ie7 = $('html').is('.ie-7'); var $inp = $(imce.el('edit-dirname')); // create selector - var $subsel = $(imce.newEl('div')).attr({id: 'subdir-selector'}).hide().appendTo(document.body); + var $subsel = $(imce.newEl('div')).attr({id: 'subdir-selector'}).css('display', 'none').appendTo(document.body); // create selector button var $button = $(imce.newEl('a')).attr({id: 'subdir-selector-button', href: '#'}).click(function() { var offset = $inp.offset(); diff --git a/sites/all/modules/imce_mkdir/imce_mkdir.module b/sites/all/modules/imce_mkdir/imce_mkdir.module index cffc7095..602a1fd4 100644 --- a/sites/all/modules/imce_mkdir/imce_mkdir.module +++ b/sites/all/modules/imce_mkdir/imce_mkdir.module @@ -1,28 +1,11 @@ <?php -// $Id: imce_mkdir.module,v 1.6 2010/10/09 05:53:37 ufku Exp $ /** * Implements hook_form_formID_alter(). */ function imce_mkdir_form_imce_profile_form_alter(&$form, &$form_state) { - foreach (element_children($form['profile']['directories']) as $key) { - $form['profile']['directories'][$key]['mkdir'] = array( - '#type' => 'checkbox', - '#title' => t('Add subdirectories'), - '#default_value' => isset($form_state['profile']['directories'][$key]['mkdir']) ? $form_state['profile']['directories'][$key]['mkdir'] : 0, - ); - $form['profile']['directories'][$key]['rmdir'] = array( - '#type' => 'checkbox', - '#title' => t('Remove subdirectories'), - '#default_value' => isset($form_state['profile']['directories'][$key]['rmdir']) ? $form_state['profile']['directories'][$key]['rmdir'] : 0, - ); - } - $form['profile']['mkdirnum'] = array( - '#type' => 'textfield', - '#title' => t('Maximum number of subdirectories'), - '#default_value' => isset($form_state['profile']['mkdirnum']) ? $form_state['profile']['mkdirnum'] : 2, - '#description' => t('This setting is applicable only if you allow subdirectory creation under any of the predefined directories. Define here the maximum number of subdirectories a directory can have. Setting this to 0 removes the limit and also allows infinite subdirectory depth.'), - ); + include_once DRUPAL_ROOT . '/' . drupal_get_path('module', 'imce_mkdir') . '/imce_mkdir.inc'; + return _imce_mkdir_form_imce_profile_form_alter($form, $form_state); } /** @@ -54,145 +37,8 @@ function imce_mkdir_content(&$imce) { */ function imce_mkdir_form($form, &$form_state, $ref) { $imce =& $ref['imce']; - $mkdir['html1']['#markup'] = '<div class="container-inline">'; - $mkdir['dirname'] = array( - '#type' => 'textfield', - '#title' => t('Subdirectory name'), - '#size' => 12, - '#maxlength' => 255, - ); - if (imce_perm_exists($imce, 'mkdir')) { - $mkdir['mkdir'] = array( - '#type' => 'submit', - '#value' => t('Add'), - '#submit' => $imce['perm']['mkdir'] ? array('imce_mkdir_submit') : NULL, - ); - } - if (imce_perm_exists($imce, 'rmdir')) { - $mkdir['rmdir'] = array( - '#type' => 'submit', - '#value' => t('Remove'), - '#submit' => $imce['perm']['rmdir'] ? array('imce_mkdir_rmdir_submit') : NULL, - ); - } - $mkdir['html2']['#markup'] = '</div>'; - $form['fset_mkdir'] = array( - '#type' => 'fieldset', - '#title' => t('Manage subdirectories'), - ) + $mkdir; - $form['#action'] = $imce['url']; - return $form; -} - -/** - * Submits mkdir form. - */ -function imce_mkdir_submit($form, &$form_state) { - $form_state['redirect'] = FALSE; - $imce = &$form_state['build_info']['args'][0]['imce']; - imce_mkdir_batch($imce, array(rawurldecode($form_state['values']['dirname']))); -} - -/** - * Batch adds directories. - */ -function imce_mkdir_batch(&$imce, $dirnames = array()) { - if (!isset($imce['diradded'])) { - $imce['diradded'] = array(); - } - $parent = imce_dir_uri($imce); - - foreach ($dirnames as $dirname) { - if (!preg_match('/^[A-Za-z0-9_\-]+$/', $dirname)) { - drupal_set_message(t('%dirname is not a valid directory name. It should contain only alphanumeric characters, hyphen and underscore.', array('%dirname' => $dirname)), 'error'); - continue; - } - - $dirpath = $parent . $dirname; - - if (file_exists($dirpath)) { - drupal_set_message(t('Subdirectory %dir already exists.', array('%dir' => $dirname)), 'error'); - continue; - } - - if (!file_prepare_directory($dirpath, FILE_CREATE_DIRECTORY)) { - drupal_set_message(t('Subdirectory %dir could not be created.', array('%dir' => $dirname)), 'error'); - continue; - } - - drupal_set_message(t('Subdirectory %dir has been added.', array('%dir' => $dirname))); - $imce['diradded'][] = $imce['subdirectories'][] = $dirname; - } -} - -/** - * Submits rmdir form. - */ -function imce_mkdir_rmdir_submit($form, &$form_state) { - $form_state['redirect'] = FALSE; - $imce = &$form_state['build_info']['args'][0]['imce']; - imce_mkdir_rmdir_batch($imce, array(rawurldecode($form_state['values']['dirname']))); -} - -/** - * Batch removes directories. - */ -function imce_mkdir_rmdir_batch(&$imce, $dirnames = array()) { - if (!isset($imce['dirremoved'])) { - $imce['dirremoved'] = array(); - } - $parent = imce_dir_uri($imce); - $prefix = ($imce['dir'] == '.' ? '' : $imce['dir'] . '/'); - - foreach ($dirnames as $dirname) { - $index = array_search($dirname, $imce['subdirectories']); - - if ($index === FALSE) { - drupal_set_message(t('Subdirectory %dir does not exist.', array('%dir' => $dirname)), 'error'); - continue; - } - - if (isset($imce['directories'][$prefix . $dirname])) { - drupal_set_message(t('Subdirectory %dir is a predefined directory and can not be removed.', array('%dir' => $dirname)), 'error'); - continue; - } - - $dirpath = $parent . $dirname; - if (!imce_mkdir_rmdir_recursive($dirpath)) { - drupal_set_message(t('Subdirectory %dir could not be removed.', array('%dir' => $dirname)), 'error'); - continue; - } - - drupal_set_message(t('Subdirectory %dir has been removed.', array('%dir' => $dirname))); - $imce['dirremoved'] = array_merge($imce['dirremoved'], array_splice($imce['subdirectories'], $index, 1)); - } -} - -/** - * Recursive directory deletion - */ -function imce_mkdir_rmdir_recursive($path) { - static $dirlen; - if (!isset($dirlen)) { - $dirlen = strlen(file_uri_scheme($path)) + 3; - } - if (is_dir($path) && !is_link($path)) { - if ($handle = @opendir($path)) { - while (($file = readdir($handle)) !== FALSE) { - if ($file == '.' || $file == '..') { - continue; - } - $filepath = $path . '/' . $file; - if (!imce_mkdir_rmdir_recursive($filepath)) { - drupal_set_message(t('%path could not be removed.', array('%path' => substr($filepath, $dirlen))), 'error'); - break; - } - } - closedir($handle); - } - return @rmdir($path); - } - return imce_delete_filepath($path); + include_once DRUPAL_ROOT . '/' . drupal_get_path('module', 'imce_mkdir') . '/imce_mkdir.inc'; + return _imce_mkdir_form($form, $form_state, $imce); } /** diff --git a/sites/all/modules/imce_wysiwyg/CHANGELOG.txt b/sites/all/modules/imce_wysiwyg/CHANGELOG.txt index 7e7f9a81..053eb23c 100644 --- a/sites/all/modules/imce_wysiwyg/CHANGELOG.txt +++ b/sites/all/modules/imce_wysiwyg/CHANGELOG.txt @@ -1,9 +1,9 @@ -IMCE Wysiwyg x.x-x.x, xxxx-xx-xx +IMCE Wysiwyg 7.x-1.x, xxxx-xx-xx -------------------------------- -IMCE Wysiwyg 7.x-1.x, xxxx-xx-xx +IMCE Wysiwyg 7.x-1.0, 2011-10-05 -------------------------------- #670818 by Onopoc: Fixed port to Drupal 7. #670818 by sun: Ported to Drupal 7. diff --git a/sites/all/modules/imce_wysiwyg/LICENSE.txt b/sites/all/modules/imce_wysiwyg/LICENSE.txt index 2c095c8d..d159169d 100644 --- a/sites/all/modules/imce_wysiwyg/LICENSE.txt +++ b/sites/all/modules/imce_wysiwyg/LICENSE.txt @@ -1,274 +1,339 @@ -GNU GENERAL PUBLIC LICENSE - - Version 2, June 1991 - -Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave, -Cambridge, MA 02139, USA. Everyone is permitted to copy and distribute -verbatim copies of this license document, but changing it is not allowed. - - Preamble - -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 Library General Public License -instead.) You can apply it to your programs, too. - -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. - -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. - -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. + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + 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. + + Preamble + + 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. + + 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. + + 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. + + 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.) +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 +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 +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. diff --git a/sites/all/modules/imce_wysiwyg/imce_wysiwyg.info b/sites/all/modules/imce_wysiwyg/imce_wysiwyg.info index 83a67558..238fbc6a 100644 --- a/sites/all/modules/imce_wysiwyg/imce_wysiwyg.info +++ b/sites/all/modules/imce_wysiwyg/imce_wysiwyg.info @@ -4,11 +4,10 @@ package = User interface core = 7.x dependencies[] = imce dependencies[] = wysiwyg -files[] = imce_wysiwyg.module -; Information added by drupal.org packaging script on 2011-02-25 -version = "7.x-1.x-dev" +; Information added by drupal.org packaging script on 2011-10-05 +version = "7.x-1.0" core = "7.x" project = "imce_wysiwyg" -datestamp = "1298619435" +datestamp = "1317851503" diff --git a/sites/all/modules/imce_wysiwyg/imce_wysiwyg.module b/sites/all/modules/imce_wysiwyg/imce_wysiwyg.module index c1b819a2..709861f7 100644 --- a/sites/all/modules/imce_wysiwyg/imce_wysiwyg.module +++ b/sites/all/modules/imce_wysiwyg/imce_wysiwyg.module @@ -7,7 +7,7 @@ */ /** - * Implementation of hook_wysiwyg_plugin(). + * Implements hook_wysiwyg_plugin(). */ function imce_wysiwyg_plugin($editor, $version) { static $integrated = array(); diff --git a/sites/all/modules/unl/includes/common.php b/sites/all/modules/unl/includes/common.php index b90d3d17..8ad88591 100644 --- a/sites/all/modules/unl/includes/common.php +++ b/sites/all/modules/unl/includes/common.php @@ -143,10 +143,12 @@ function unl_tidy($string) { ); // Prevent Tidy from trying to move <script>,<style>,comments to the head if it is the first thing - if (strtolower(substr(trim($string), 0, 7)) == '<script' || - strtolower(substr(trim($string), 0, 6)) == '<style' || - substr(trim($string), 0, 4) == '<!--') { - $string = " <!-- Tidy: Start field with something other than script , style, or comment to remove this -->\n" . $string; + if (strtolower(substr(trim($string), 0, 7)) == '<script' || strtolower(substr(trim($string), 0, 6)) == '<style' || substr(trim($string), 0, 4) == '<!--') { + $statement = ''; + if (substr(trim($string), 0, 9) !== '<!-- Tidy') { + $statement = "<!-- Tidy: Start field with something other than script , style, or comment to remove this -->\n"; + } + $string = " " . $statement . $string; } $tidy->parseString($string, $options, 'utf8'); diff --git a/sites/all/modules/unl/unl.module b/sites/all/modules/unl/unl.module index 84cc9aed..992872f0 100644 --- a/sites/all/modules/unl/unl.module +++ b/sites/all/modules/unl/unl.module @@ -197,52 +197,54 @@ function unl_wysiwyg_plugin($editor) { case 'tinymce': return array( 'unl' => array( - // A URL to the plugin's homepage. 'url' => 'http://gforge.unl.edu/gf/project/wdn_tinymce/', - // The full path to the native editor plugin. 'path' => $editor['library path'] . '/plugins/unl', - // A list of editor extensions provided by this native plugin. - // Extensions are not displayed as buttons and touch the editor's - // internals, so you should know what you are doing. - 'extensions' => array( - 'unl' => 'UNL Extension' - ), - // Boolean whether this plugin is a native plugin, i.e. shipped with - // the editor. Definition must be ommitted for plugins provided by - // other modules. 'internal' => TRUE, - // Boolean whether the editor needs to load this plugin. When TRUE, - // the editor will automatically load the plugin based on the 'path' - // variable provided. If FALSE, the plugin either does not need to - // be loaded or is already loaded by something else on the page. - // Most plugins should define TRUE here. 'load' => TRUE, - // A list of buttons provided by this native plugin. The key has to - // match the corresponding JavaScript implementation. The value is - // is displayed on the editor configuration form only. 'buttons' => array( - 'unlZenBox' => 'UNL Zen Box', - 'unlZenTable' => 'UNL Zen Table', + 'unlZenBox' => 'UNL Zenbox', 'unlGrid' => 'UNL Grid', - 'unlLayout' => 'UNL Layout', 'unlTooltip' => 'UNL Tooltip', ), - // A list of global, native editor configuration settings to - // override. To be used rarely and only when required. - 'options' => array( - 'skin' => 'unl', - 'table_styles' => 'ZenTable Bright (yellow)=zentable bright;ZenTable Cool (blue)=zentable cool;ZenTable Energetic (orange)=zentable energetic;ZenTable Soothing (green)=zentable soothing;ZenTable Primary (red)=zentable primary;ZenTable Neutral (gray)=zentable neutral;', 'doctype' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">', - 'valid_elements' => '*[*],script[charset|defer|id|src|type=text/javascript]', - 'forced_root_block' => false, - ), - ) - // Wysiwyg wrapper plugin AJAX callback. - // 'callback' => url('myplugin/browse'), - // 'icon' => drupal_get_path('module', 'mymodule') . '/myplugin/myplugin.png', - // Might need to be set later on; after retrieving customized editor - // layout. - //'theme_advanced_buttons1' => array(t('Button title (optional)') => 'myplugin'), + ), ); + break; + } +} + +/** + * Implementation of hook_wysiwyg_editor_settings_alter(). + */ +function unl_wysiwyg_editor_settings_alter(&$settings, $context) { + switch($context['editor']['name']) { + case 'tinymce': + // Set custom settings + $settings['theme'] = 'advanced'; + $settings['skin'] = 'unl'; + $settings['forced_root_block'] = false; + $settings['plugins'] .= ',pdw,inlinepopups'; + + // Process a default order for the buttons + $enabled_buttons = preg_split('/,/', $settings['theme_advanced_buttons1']); + $default_buttons = array('bold', 'italic', 'strikethrough', '|', 'bullist', 'numlist', 'blockquote', '|', 'justifyleft', 'justifycenter','justifyright','|','link', 'unlink', 'image', '|', 'pastetext', 'pasteword', 'removeformat', '|', 'pdw_toggle', + 'PAGEBREAK', 'formatselect', 'styleselect', '|', 'underline', '|', 'justifyfull', '|', 'sup', 'sub', 'charmap', '|', 'indent', 'outdent', '|', 'unlGrid', 'unlZenBox', 'unlTooltip', '|', 'undo', 'redo', '|', 'fullscreen', ); + foreach($default_buttons as $button) { + if (in_array($button, $enabled_buttons)) { + unset($enabled_buttons[array_search($button, $enabled_buttons)]); + } + elseif ($button != '|' && $button != 'PAGEBREAK' && $button != 'pdw_toggle') { + unset($default_buttons[array_search($button, $default_buttons)]); + } + } + + // Define the final button settings + $default_buttons_list = preg_split('/,PAGEBREAK,/', implode(',', $default_buttons)); + $settings['theme_advanced_buttons1'] = $default_buttons_list[0]; + $settings['theme_advanced_buttons2'] = $default_buttons_list[1]; + $settings['theme_advanced_buttons3'] = (count($enabled_buttons) > 0) ? implode(',', $enabled_buttons) : NULL; + $settings['pdw_toggle_on'] = '1'; + $settings['pdw_toggle_toolbars'] = (count($enabled_buttons) > 0) ? '2,3' : '2'; + break; } } diff --git a/sites/all/modules/wysiwyg/CHANGELOG.txt b/sites/all/modules/wysiwyg/CHANGELOG.txt index 5317afa3..2b79f35b 100644 --- a/sites/all/modules/wysiwyg/CHANGELOG.txt +++ b/sites/all/modules/wysiwyg/CHANGELOG.txt @@ -1,9 +1,24 @@ -// $Id: CHANGELOG.txt,v 1.243 2011/01/06 02:08:10 sun Exp $ Wysiwyg 7.x-2.x, xxxx-xx-xx --------------------------- +Wysiwyg 7.x-2.1, 2011-06-19 +--------------------------- +#679056 by TwoD: Fixed patch for pressing enter in autocomplete, new jQuery API. +#524126 by sun: Re-added #wysiwyg property to enforce no editor via code. +#1153458 by Deciphered: Fixed TinyMCE 'Verify HTML' setting being ignored. +#1079694 by TwoD: Fixed Whizzywig not restoring textarea styles when detached. +#1132142 by tacituseu, TwoD, sun: Fixed nicEdit not removing its submit handler. +#1143104 by EugenMayer: Fixed CKEditor 3.5.4 version detection. +#1009880 by AndyF: Fixed another CKEditor selection handling issue. +#1048556 by cousin_itt, TwoD: Fixed TinyMCE insertdatetime plugin setting. +#1036900 by mattyoung: Minor code clean-up in wysiwyg_tinymce_version(). +#1026088 by sun: Fixed installation instructions in README.txt. +by sun: Merged in module baseline to facilitate testing. +#1034476 by quartsize, sun: Changed Wysiwyg profiles into entities. + + Wysiwyg 7.x-2.0, 2010-01-06 --------------------------- #950216 by TwoD, sun: Fixed missing editor for a single text format. @@ -21,8 +36,10 @@ Wysiwyg 7.x-2.0, 2010-01-06 #585932 by sun: Ported to Drupal 7. -Wysiwyg 6.x-2.x, xxxx-xx-xx +Wysiwyg 6.x-2.3, 2011-01-30 --------------------------- +#1025296 by TwoD: Updated CKEditor to support iFrame button. +#737318 by TwoD: Fixed CKEditor default skin array not being reindexed. by sun: Fixed coding style in wysiwyg_schema(). #964978 by sun, TwoD: Added hook_wysiwyg_editor_settings_alter() documentation. #775972 by TwoD, Agileware, sun: Fixed broken user default status preferences. diff --git a/sites/all/modules/wysiwyg/README.txt b/sites/all/modules/wysiwyg/README.txt index 8cdca4e0..cc81447a 100644 --- a/sites/all/modules/wysiwyg/README.txt +++ b/sites/all/modules/wysiwyg/README.txt @@ -1,4 +1,3 @@ -/* $Id: README.txt,v 1.8 2009/09/26 05:37:56 sun Exp $ */ -- SUMMARY -- @@ -6,9 +5,9 @@ Wysiwyg API allows to users of your site to use WYSIWYG/rich-text, and other client-side editors for editing contents. This module depends on third-party editor libraries, most often based on JavaScript. -For a full description visit the project page: +For a full description of the module, visit the project page: http://drupal.org/project/wysiwyg -Bug reports, feature suggestions and latest developments: +To submit bug reports and feature suggestions, or to track changes: http://drupal.org/project/issues/wysiwyg @@ -21,15 +20,14 @@ Bug reports, feature suggestions and latest developments: * Install as usual, see http://drupal.org/node/70151 for further information. -* Go to Administer > Configuration and modules > Content authoring > Wysiwyg, +* Go to Administration » Configuration » Content authoring » Wysiwyg, and follow the displayed installation instructions to download and install one of the supported editors. -- CONFIGURATION -- -* Go to Administer > Configuration and modules > Content authoring > Text - formats and +* Go to Administration » Configuration » Content authoring » Text formats, and - either configure the Full HTML format, assign it to trusted roles, and disable "HTML filter", "Line break converter", and (optionally) "URL filter". @@ -37,8 +35,8 @@ Bug reports, feature suggestions and latest developments: - or add a new text format, assign it to trusted roles, and ensure that above mentioned input filters are disabled. -* Setup editor profiles in Administer > Configuration and modules > Content - authoring > Wysiwyg. +* Setup editor profiles in Administration » Configuration » Content authoring + » Wysiwyg. -- CONTACT -- diff --git a/sites/all/modules/wysiwyg/editors/ckeditor.inc b/sites/all/modules/wysiwyg/editors/ckeditor.inc index 3109e7ab..0a56fe08 100644 --- a/sites/all/modules/wysiwyg/editors/ckeditor.inc +++ b/sites/all/modules/wysiwyg/editors/ckeditor.inc @@ -1,5 +1,4 @@ <?php -// $Id: ckeditor.inc,v 1.11 2010/12/25 19:12:56 sun Exp $ /** * @file @@ -65,7 +64,7 @@ function wysiwyg_ckeditor_version($editor) { } $library = fopen($library, 'r'); $max_lines = 8; - while ($max_lines && $line = fgets($library, 140)) { + while ($max_lines && $line = fgets($library, 500)) { // version:'CKEditor 3.0 SVN',revision:'3665' // version:'3.0 RC',revision:'3753' // version:'3.0.1',revision:'4391' @@ -104,6 +103,7 @@ function wysiwyg_ckeditor_themes($editor, $profile) { } closedir($dir_handle); natcasesort($themes); + $themes = array_values($themes); return !empty($themes) ? $themes : array('default'); } else { @@ -313,6 +313,7 @@ function wysiwyg_ckeditor_plugins($editor) { 'SelectAll' => t('Select all'), 'Find' => t('Search'), 'Replace' => t('Replace'), 'Flash' => t('Flash'), 'Smiley' => t('Smiley'), 'CreateDiv' => t('Div container'), + 'Iframe' => t('iFrame'), 'Maximize' => t('Maximize'), 'SpellChecker' => t('Check spelling'), 'Scayt' => t('Check spelling as you type'), 'About' => t('About'), @@ -324,6 +325,9 @@ function wysiwyg_ckeditor_plugins($editor) { if (version_compare($editor['installed version'], '3.1.0.4885', '<')) { unset($plugins['default']['buttons']['CreateDiv']); } + if (version_compare($editor['installed version'], '3.5.0.6260', '<')) { + unset($plugins['default']['buttons']['Iframe']); + } return $plugins; } diff --git a/sites/all/modules/wysiwyg/editors/css/openwysiwyg.css b/sites/all/modules/wysiwyg/editors/css/openwysiwyg.css index 7744aaab..2fea7fb3 100644 --- a/sites/all/modules/wysiwyg/editors/css/openwysiwyg.css +++ b/sites/all/modules/wysiwyg/editors/css/openwysiwyg.css @@ -1,4 +1,3 @@ -/* $Id: openwysiwyg.css,v 1.1 2009/06/06 05:20:09 sun Exp $ */ /** * openWYSIWYG. diff --git a/sites/all/modules/wysiwyg/editors/css/tinymce-2.css b/sites/all/modules/wysiwyg/editors/css/tinymce-2.css index c990419c..4aa201d4 100644 --- a/sites/all/modules/wysiwyg/editors/css/tinymce-2.css +++ b/sites/all/modules/wysiwyg/editors/css/tinymce-2.css @@ -1,4 +1,3 @@ -/* $Id: tinymce-2.css,v 1.2 2008/10/29 00:35:11 sun Exp $ */ /** * TinyMCE 2.x diff --git a/sites/all/modules/wysiwyg/editors/css/tinymce-3.css b/sites/all/modules/wysiwyg/editors/css/tinymce-3.css index 04de8b71..5d0ebe94 100644 --- a/sites/all/modules/wysiwyg/editors/css/tinymce-3.css +++ b/sites/all/modules/wysiwyg/editors/css/tinymce-3.css @@ -1,4 +1,3 @@ -/* $Id: tinymce-3.css,v 1.3 2008/10/29 00:35:11 sun Exp $ */ /** * TinyMCE 3.x diff --git a/sites/all/modules/wysiwyg/editors/fckeditor.inc b/sites/all/modules/wysiwyg/editors/fckeditor.inc index d33a0c7e..70954da6 100644 --- a/sites/all/modules/wysiwyg/editors/fckeditor.inc +++ b/sites/all/modules/wysiwyg/editors/fckeditor.inc @@ -1,5 +1,4 @@ <?php -// $Id: fckeditor.inc,v 1.22 2010/12/19 23:26:56 sun Exp $ /** * @file diff --git a/sites/all/modules/wysiwyg/editors/js/ckeditor-3.0.js b/sites/all/modules/wysiwyg/editors/js/ckeditor-3.0.js index 8c4e8f43..d2cf3005 100644 --- a/sites/all/modules/wysiwyg/editors/js/ckeditor-3.0.js +++ b/sites/all/modules/wysiwyg/editors/js/ckeditor-3.0.js @@ -1,4 +1,3 @@ -// $Id: ckeditor-3.0.js,v 1.11 2010/12/29 20:02:10 twod Exp $ (function($) { Drupal.wysiwyg.editor.init.ckeditor = function(settings) { @@ -111,8 +110,9 @@ Drupal.wysiwyg.editor.attach.ckeditor = function(context, params, settings) { }, selectionChange: function (event) { - if (Drupal.settings.wysiwyg.plugins[params.format]) { - $.each(Drupal.settings.wysiwyg.plugins[params.format].drupal, function (name) { + var pluginSettings = Drupal.settings.wysiwyg.plugins[params.format]; + if (pluginSettings && pluginSettings.drupal) { + $.each(pluginSettings.drupal, function (name) { var plugin = Drupal.wysiwyg.plugins[name]; if ($.isFunction(plugin.isNode)) { var node = event.data.selection.getSelectedElement(); diff --git a/sites/all/modules/wysiwyg/editors/js/fckeditor-2.6.js b/sites/all/modules/wysiwyg/editors/js/fckeditor-2.6.js index 12d582c2..4ee2cff7 100644 --- a/sites/all/modules/wysiwyg/editors/js/fckeditor-2.6.js +++ b/sites/all/modules/wysiwyg/editors/js/fckeditor-2.6.js @@ -1,4 +1,3 @@ -// $Id: fckeditor-2.6.js,v 1.22 2010/11/13 18:53:15 sun Exp $ (function($) { /** diff --git a/sites/all/modules/wysiwyg/editors/js/fckeditor.config.js b/sites/all/modules/wysiwyg/editors/js/fckeditor.config.js index 1b4e8c21..d3fbc2fc 100644 --- a/sites/all/modules/wysiwyg/editors/js/fckeditor.config.js +++ b/sites/all/modules/wysiwyg/editors/js/fckeditor.config.js @@ -1,4 +1,3 @@ -// $Id: fckeditor.config.js,v 1.7 2009/09/29 01:48:23 sun Exp $ Drupal = window.parent.Drupal; diff --git a/sites/all/modules/wysiwyg/editors/js/jwysiwyg.js b/sites/all/modules/wysiwyg/editors/js/jwysiwyg.js index 2fa5aadb..ae478532 100644 --- a/sites/all/modules/wysiwyg/editors/js/jwysiwyg.js +++ b/sites/all/modules/wysiwyg/editors/js/jwysiwyg.js @@ -1,4 +1,3 @@ -// $Id: jwysiwyg.js,v 1.4 2009/09/26 05:37:57 sun Exp $ (function($) { /** diff --git a/sites/all/modules/wysiwyg/editors/js/markitup.js b/sites/all/modules/wysiwyg/editors/js/markitup.js index b0d33243..66918114 100644 --- a/sites/all/modules/wysiwyg/editors/js/markitup.js +++ b/sites/all/modules/wysiwyg/editors/js/markitup.js @@ -1,4 +1,3 @@ -// $Id: markitup.js,v 1.3 2009/09/26 05:37:57 sun Exp $ (function($) { /** diff --git a/sites/all/modules/wysiwyg/editors/js/nicedit.js b/sites/all/modules/wysiwyg/editors/js/nicedit.js index 245c73a4..d5d97957 100644 --- a/sites/all/modules/wysiwyg/editors/js/nicedit.js +++ b/sites/all/modules/wysiwyg/editors/js/nicedit.js @@ -1,13 +1,25 @@ -// $Id: nicedit.js,v 1.5 2010/02/07 14:36:00 sun Exp $ (function($) { /** * Attach this editor to a target element. */ Drupal.wysiwyg.editor.attach.nicedit = function(context, params, settings) { + // Intercept and ignore submit handlers or they will revert changes made + // since the instance was removed. The handlers are anonymous and hidden out + // of scope in a closure so we can't unbind them. The same operations are + // performed when the instance is detached anyway. + var oldAddEvent = bkLib.addEvent; + bkLib.addEvent = function(obj, type, fn) { + if (type != 'submit') { + oldAddEvent(obj, type, fn); + } + } // Attach editor. var editor = new nicEditor(settings); editor.panelInstance(params.field); + // The old addEvent() must be restored after creating a new instance, as + // plugins with dialogs use it to bind submit handlers to their forms. + bkLib.addEvent = oldAddEvent; editor.addEvent('focus', function () { Drupal.wysiwyg.activeId = params.field; }); diff --git a/sites/all/modules/wysiwyg/editors/js/none.js b/sites/all/modules/wysiwyg/editors/js/none.js index 0a3bbf92..34020240 100644 --- a/sites/all/modules/wysiwyg/editors/js/none.js +++ b/sites/all/modules/wysiwyg/editors/js/none.js @@ -1,4 +1,3 @@ -// $Id: none.js,v 1.8 2010/03/20 14:54:29 sun Exp $ (function($) { /** diff --git a/sites/all/modules/wysiwyg/editors/js/openwysiwyg.js b/sites/all/modules/wysiwyg/editors/js/openwysiwyg.js index 2c94e6c6..89a5337e 100644 --- a/sites/all/modules/wysiwyg/editors/js/openwysiwyg.js +++ b/sites/all/modules/wysiwyg/editors/js/openwysiwyg.js @@ -1,4 +1,3 @@ -// $Id: openwysiwyg.js,v 1.4 2010/11/13 19:07:44 sun Exp $ // Backup $ and reset it to jQuery. Drupal.wysiwyg._openwysiwyg = $; diff --git a/sites/all/modules/wysiwyg/editors/js/tinymce-2.js b/sites/all/modules/wysiwyg/editors/js/tinymce-2.js index 4b5726d2..088021f7 100644 --- a/sites/all/modules/wysiwyg/editors/js/tinymce-2.js +++ b/sites/all/modules/wysiwyg/editors/js/tinymce-2.js @@ -1,4 +1,3 @@ -// $Id: tinymce-2.js,v 1.14 2010/10/17 20:52:40 twod Exp $ (function($) { /** diff --git a/sites/all/modules/wysiwyg/editors/js/tinymce-3.js b/sites/all/modules/wysiwyg/editors/js/tinymce-3.js index 52d9648c..bbb453cb 100644 --- a/sites/all/modules/wysiwyg/editors/js/tinymce-3.js +++ b/sites/all/modules/wysiwyg/editors/js/tinymce-3.js @@ -1,4 +1,3 @@ -// $Id: tinymce-3.js,v 1.22 2010/10/17 20:52:40 twod Exp $ (function($) { /** @@ -51,6 +50,7 @@ Drupal.wysiwyg.editor.attach.tinymce = function(context, params, settings) { ed.onEvent.add(function(ed, e) { Drupal.wysiwyg.activeId = ed.id; }); + /* START UNL CHANGE // Make toolbar buttons wrappable (required for IE). ed.onPostRender.add(function (ed) { var $toolbar = $('<div class="wysiwygToolbar"></div>'); @@ -60,7 +60,7 @@ Drupal.wysiwyg.editor.attach.tinymce = function(context, params, settings) { $('#' + ed.editorContainer + ' table.mceLayout td.mceToolbar').append($toolbar); $('#' + ed.editorContainer + ' table.mceToolbar').remove(); }); - + END UNL CHANGE */ // Remove TinyMCE's internal mceItem class, which was incorrectly added to // submitted content by Wysiwyg <2.1. TinyMCE only temporarily adds the class // for placeholder elements. If preemptively set, the class prevents (native) diff --git a/sites/all/modules/wysiwyg/editors/js/whizzywig-56.js b/sites/all/modules/wysiwyg/editors/js/whizzywig-56.js index cca41865..229a70b2 100644 --- a/sites/all/modules/wysiwyg/editors/js/whizzywig-56.js +++ b/sites/all/modules/wysiwyg/editors/js/whizzywig-56.js @@ -1,4 +1,3 @@ -// $Id: whizzywig-56.js,v 1.4 2010/10/18 19:53:12 sun Exp $ var wysiwygWhizzywig = { currentField: null, fields: {} }; var buttonPath = null; @@ -75,9 +74,7 @@ Drupal.wysiwyg.editor.attach.whizzywig = function(context, params, settings) { // Whizzywig needs to have the width set 'inline'. $field = $('#' + params.field); var originalValues = Drupal.wysiwyg.instances[params.field]; - originalValues.originalWidth = $field.css('width'); - originalValues.originalColor = $field.css('color'); - originalValues.originalZindex = $field.css('zIndex'); + originalValues.originalStyle = $field.attr('style'); $field.css('width', $field.width() + 'px'); // Attach editor. @@ -114,9 +111,8 @@ Drupal.wysiwyg.editor.detach.whizzywig = function(context, params) { // Restore original textarea styling. var originalValues = Drupal.wysiwyg.instances[id]; - $field.css('width', originalValues.originalWidth); - $field.css('color', originalValues.originalColor); - $field.css('zIndex', originalValues.originalZindex); + $field.removeAttr('style'); + $field.attr('style', originalValues.originalStyle); }; if (typeof params != 'undefined') { diff --git a/sites/all/modules/wysiwyg/editors/js/whizzywig-60.js b/sites/all/modules/wysiwyg/editors/js/whizzywig-60.js index b87df9aa..dc995f6c 100644 --- a/sites/all/modules/wysiwyg/editors/js/whizzywig-60.js +++ b/sites/all/modules/wysiwyg/editors/js/whizzywig-60.js @@ -1,4 +1,3 @@ -// $Id: whizzywig-60.js,v 1.1 2010/10/18 19:37:44 sun Exp $ var buttonPath = null; @@ -24,9 +23,7 @@ Drupal.wysiwyg.editor.attach.whizzywig = function(context, params, settings) { // Whizzywig needs to have the width set 'inline'. $field = $('#' + params.field); var originalValues = Drupal.wysiwyg.instances[params.field]; - originalValues.originalWidth = $field.css('width'); - originalValues.originalColor = $field.css('color'); - originalValues.originalZindex = $field.css('zIndex'); + originalValues.originalStyle = $field.attr('style'); $field.css('width', $field.width() + 'px'); // Attach editor. @@ -66,10 +63,9 @@ Drupal.wysiwyg.editor.detach.whizzywig = function(context, params) { // Restore original textarea styling. var originalValues = Drupal.wysiwyg.instances[id]; - $field.css('width', originalValues.originalWidth); - $field.css('color', originalValues.originalColor); - $field.css('zIndex', originalValues.originalZindex); - }; + $field.removeAttr('style'); + $field.attr('style', originalValues.originalStyle); + } if (typeof params != 'undefined') { for (var i = 0; i < whizzies.length; i++) { diff --git a/sites/all/modules/wysiwyg/editors/js/whizzywig.js b/sites/all/modules/wysiwyg/editors/js/whizzywig.js index 95052b4d..e98bc4da 100644 --- a/sites/all/modules/wysiwyg/editors/js/whizzywig.js +++ b/sites/all/modules/wysiwyg/editors/js/whizzywig.js @@ -1,4 +1,3 @@ -// $Id: whizzywig.js,v 1.9 2010/10/18 19:53:12 sun Exp $ var wysiwygWhizzywig = { currentField: null, fields: {} }; var buttonPath = null; @@ -66,9 +65,7 @@ Drupal.wysiwyg.editor.attach.whizzywig = function(context, params, settings) { // Whizzywig needs to have the width set 'inline'. $field = $('#' + params.field); var originalValues = Drupal.wysiwyg.instances[params.field]; - originalValues.originalWidth = $field.css('width'); - originalValues.originalColor = $field.css('color'); - originalValues.originalZindex = $field.css('zIndex'); + originalValues.originalStyle = $field.attr('style'); $field.css('width', $field.width() + 'px'); // Attach editor. @@ -107,9 +104,8 @@ Drupal.wysiwyg.editor.detach.whizzywig = function(context, params) { // Restore original textarea styling. var originalValues = Drupal.wysiwyg.instances[id]; - $field.css('width', originalValues.originalWidth); - $field.css('color', originalValues.originalColor); - $field.css('zIndex', originalValues.originalZindex); + $field.removeAttr('style'); + $field.attr('style', originalValues.originalStyle); }; if (typeof params != 'undefined') { diff --git a/sites/all/modules/wysiwyg/editors/js/wymeditor.js b/sites/all/modules/wysiwyg/editors/js/wymeditor.js index ee6bd432..ed667848 100644 --- a/sites/all/modules/wysiwyg/editors/js/wymeditor.js +++ b/sites/all/modules/wysiwyg/editors/js/wymeditor.js @@ -1,4 +1,3 @@ -// $Id: wymeditor.js,v 1.4 2009/09/26 05:37:57 sun Exp $ (function($) { /** diff --git a/sites/all/modules/wysiwyg/editors/js/yui.js b/sites/all/modules/wysiwyg/editors/js/yui.js index 7f5257c7..ad8be368 100644 --- a/sites/all/modules/wysiwyg/editors/js/yui.js +++ b/sites/all/modules/wysiwyg/editors/js/yui.js @@ -1,4 +1,3 @@ -// $Id: yui.js,v 1.3 2010/02/06 22:34:16 sun Exp $ (function($) { /** diff --git a/sites/all/modules/wysiwyg/editors/jwysiwyg.inc b/sites/all/modules/wysiwyg/editors/jwysiwyg.inc index a40b0f89..fa65b741 100644 --- a/sites/all/modules/wysiwyg/editors/jwysiwyg.inc +++ b/sites/all/modules/wysiwyg/editors/jwysiwyg.inc @@ -1,5 +1,4 @@ <?php -// $Id: jwysiwyg.inc,v 1.5 2010/04/02 14:05:36 sun Exp $ /** * @file diff --git a/sites/all/modules/wysiwyg/editors/markitup.inc b/sites/all/modules/wysiwyg/editors/markitup.inc index 75373e51..57a37e83 100644 --- a/sites/all/modules/wysiwyg/editors/markitup.inc +++ b/sites/all/modules/wysiwyg/editors/markitup.inc @@ -1,5 +1,4 @@ <?php -// $Id: markitup.inc,v 1.12 2010/12/19 19:19:56 sun Exp $ /** * @file diff --git a/sites/all/modules/wysiwyg/editors/nicedit.inc b/sites/all/modules/wysiwyg/editors/nicedit.inc index bddaa611..779660c9 100644 --- a/sites/all/modules/wysiwyg/editors/nicedit.inc +++ b/sites/all/modules/wysiwyg/editors/nicedit.inc @@ -1,5 +1,4 @@ <?php -// $Id: nicedit.inc,v 1.8 2010/11/13 18:31:20 sun Exp $ /** * @file diff --git a/sites/all/modules/wysiwyg/editors/openwysiwyg.inc b/sites/all/modules/wysiwyg/editors/openwysiwyg.inc index 4b11cd6e..f521da56 100644 --- a/sites/all/modules/wysiwyg/editors/openwysiwyg.inc +++ b/sites/all/modules/wysiwyg/editors/openwysiwyg.inc @@ -1,5 +1,4 @@ <?php -// $Id: openwysiwyg.inc,v 1.7 2010/11/13 18:31:21 sun Exp $ /** * @file diff --git a/sites/all/modules/wysiwyg/editors/tinymce.inc b/sites/all/modules/wysiwyg/editors/tinymce.inc index 2c40eb6b..a7250f35 100644 --- a/sites/all/modules/wysiwyg/editors/tinymce.inc +++ b/sites/all/modules/wysiwyg/editors/tinymce.inc @@ -1,5 +1,4 @@ <?php -// $Id: tinymce.inc,v 1.46 2010/12/19 23:26:56 sun Exp $ /** * @file @@ -88,13 +87,12 @@ function wysiwyg_tinymce_version($editor) { $script = fopen($script, 'r'); // Version is contained in the first 200 chars. $line = fgets($script, 200); + fclose($script); // 2.x: this.majorVersion="2";this.minorVersion="1.3" // 3.x: majorVersion:'3',minorVersion:'2.0.1' if (preg_match('@majorVersion[=:]["\'](\d).+?minorVersion[=:]["\']([\d\.]+)@', $line, $version)) { - fclose($script); return $version[1] . '.' . $version[2]; } - fclose($script); } /** @@ -180,7 +178,7 @@ function wysiwyg_tinymce_settings($editor, $config, $theme) { $settings['remove_linebreaks'] = $config['remove_linebreaks']; } if (isset($config['verify_html'])) { - $settings['verify_html'] = $config['verify_html']; + $settings['verify_html'] = (bool) $config['verify_html']; } if (!empty($config['css_classes'])) { @@ -477,8 +475,8 @@ function wysiwyg_tinymce_plugins($editor) { 'path' => $editor['library path'] . '/plugins/insertdatetime', 'buttons' => array('insertdate' => t('Insert date'), 'inserttime' => t('Insert time')), 'options' => array( - 'plugin_insertdate_dateFormat' => array('%Y-%m-%d'), - 'plugin_insertdate_timeFormat' => array('%H:%M:%S'), + 'plugin_insertdate_dateFormat' => '%Y-%m-%d', + 'plugin_insertdate_timeFormat' => '%H:%M:%S', ), 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/insertdatetime', 'internal' => TRUE, diff --git a/sites/all/modules/wysiwyg/editors/whizzywig.inc b/sites/all/modules/wysiwyg/editors/whizzywig.inc index 4b8e643f..d82cc0fe 100644 --- a/sites/all/modules/wysiwyg/editors/whizzywig.inc +++ b/sites/all/modules/wysiwyg/editors/whizzywig.inc @@ -1,5 +1,4 @@ <?php -// $Id: whizzywig.inc,v 1.8 2010/11/13 18:31:21 sun Exp $ /** * @file diff --git a/sites/all/modules/wysiwyg/editors/wymeditor.inc b/sites/all/modules/wysiwyg/editors/wymeditor.inc index 872ec3a0..3e8ffd24 100644 --- a/sites/all/modules/wysiwyg/editors/wymeditor.inc +++ b/sites/all/modules/wysiwyg/editors/wymeditor.inc @@ -1,5 +1,4 @@ <?php -// $Id: wymeditor.inc,v 1.9 2010/11/13 18:31:21 sun Exp $ /** * @file diff --git a/sites/all/modules/wysiwyg/editors/yui.inc b/sites/all/modules/wysiwyg/editors/yui.inc index c056017b..7e3c697c 100644 --- a/sites/all/modules/wysiwyg/editors/yui.inc +++ b/sites/all/modules/wysiwyg/editors/yui.inc @@ -1,5 +1,4 @@ <?php -// $Id: yui.inc,v 1.11 2010/11/13 18:31:21 sun Exp $ /** * @file diff --git a/sites/all/modules/wysiwyg/plugins/break.inc b/sites/all/modules/wysiwyg/plugins/break.inc index 4bda6f27..887d5905 100644 --- a/sites/all/modules/wysiwyg/plugins/break.inc +++ b/sites/all/modules/wysiwyg/plugins/break.inc @@ -1,5 +1,4 @@ <?php -// $Id: break.inc,v 1.4 2009/06/09 00:18:12 sun Exp $ /** * @file diff --git a/sites/all/modules/wysiwyg/plugins/break/break.css b/sites/all/modules/wysiwyg/plugins/break/break.css index afff4dbb..4aaab761 100644 --- a/sites/all/modules/wysiwyg/plugins/break/break.css +++ b/sites/all/modules/wysiwyg/plugins/break/break.css @@ -1,4 +1,3 @@ -/* $Id: break.css,v 1.2 2008/06/11 04:29:01 sun Exp $ */ .wysiwyg-break { display: block; diff --git a/sites/all/modules/wysiwyg/plugins/break/break.js b/sites/all/modules/wysiwyg/plugins/break/break.js index b2eede46..54aac4cd 100644 --- a/sites/all/modules/wysiwyg/plugins/break/break.js +++ b/sites/all/modules/wysiwyg/plugins/break/break.js @@ -1,4 +1,3 @@ -// $Id: break.js,v 1.8 2010/02/13 23:57:52 sun Exp $ (function ($) { // @todo Array syntax required; 'break' is a predefined token in JavaScript. diff --git a/sites/all/modules/wysiwyg/plugins/break/langs/ca.js b/sites/all/modules/wysiwyg/plugins/break/langs/ca.js index 5e1b5ef4..5ead9380 100644 --- a/sites/all/modules/wysiwyg/plugins/break/langs/ca.js +++ b/sites/all/modules/wysiwyg/plugins/break/langs/ca.js @@ -1,4 +1,3 @@ -// $Id: ca.js,v 1.1 2008/10/25 13:35:51 sun Exp $ tinyMCE.addToLang('break', { title: 'Inserir marcador de document retallat', diff --git a/sites/all/modules/wysiwyg/plugins/break/langs/de.js b/sites/all/modules/wysiwyg/plugins/break/langs/de.js index 9cba218b..d869a697 100644 --- a/sites/all/modules/wysiwyg/plugins/break/langs/de.js +++ b/sites/all/modules/wysiwyg/plugins/break/langs/de.js @@ -1,4 +1,3 @@ -// $Id: de.js,v 1.1 2008/06/15 17:28:15 sun Exp $ tinyMCE.addToLang('break', { title: 'Anrisstext trennen', diff --git a/sites/all/modules/wysiwyg/plugins/break/langs/en.js b/sites/all/modules/wysiwyg/plugins/break/langs/en.js index 0817f68a..6d75ef73 100644 --- a/sites/all/modules/wysiwyg/plugins/break/langs/en.js +++ b/sites/all/modules/wysiwyg/plugins/break/langs/en.js @@ -1,4 +1,3 @@ -// $Id: en.js,v 1.1 2008/06/10 18:20:14 sun Exp $ tinyMCE.addToLang('break', { title: 'Insert teaser break', diff --git a/sites/all/modules/wysiwyg/plugins/break/langs/es.js b/sites/all/modules/wysiwyg/plugins/break/langs/es.js index 08b6bfb0..206023da 100644 --- a/sites/all/modules/wysiwyg/plugins/break/langs/es.js +++ b/sites/all/modules/wysiwyg/plugins/break/langs/es.js @@ -1,4 +1,3 @@ -// $Id: es.js,v 1.1 2008/10/25 13:35:51 sun Exp $ tinyMCE.addToLang('break', { title: 'Insertar marcador de documento recortado', diff --git a/sites/all/modules/wysiwyg/tests/wysiwyg.test b/sites/all/modules/wysiwyg/tests/wysiwyg.test new file mode 100644 index 00000000..263563c2 --- /dev/null +++ b/sites/all/modules/wysiwyg/tests/wysiwyg.test @@ -0,0 +1,7 @@ +<?php + +/** + * @file + * Tests for Wysiwyg module. + */ + diff --git a/sites/all/modules/wysiwyg/tests/wysiwyg_test.info b/sites/all/modules/wysiwyg/tests/wysiwyg_test.info new file mode 100644 index 00000000..1314897d --- /dev/null +++ b/sites/all/modules/wysiwyg/tests/wysiwyg_test.info @@ -0,0 +1,14 @@ +name = Wysiwyg testing +description = Tests Wysiwyg module functionality. Do not enable. +core = 7.x +package = Testing +hidden = TRUE +dependencies[] = wysiwyg +files[] = wysiwyg_test.module + +; Information added by drupal.org packaging script on 2011-06-19 +version = "7.x-2.1" +core = "7.x" +project = "wysiwyg" +datestamp = "1308450722" + diff --git a/sites/all/modules/wysiwyg/tests/wysiwyg_test.install b/sites/all/modules/wysiwyg/tests/wysiwyg_test.install new file mode 100644 index 00000000..fc4f5271 --- /dev/null +++ b/sites/all/modules/wysiwyg/tests/wysiwyg_test.install @@ -0,0 +1,7 @@ +<?php + +/** + * @file + * Installation functionality for Wysiwyg testing module. + */ + diff --git a/sites/all/modules/wysiwyg/tests/wysiwyg_test.module b/sites/all/modules/wysiwyg/tests/wysiwyg_test.module new file mode 100644 index 00000000..c908e29c --- /dev/null +++ b/sites/all/modules/wysiwyg/tests/wysiwyg_test.module @@ -0,0 +1,7 @@ +<?php + +/** + * @file + * Testing functionality for Wysiwyg module. + */ + diff --git a/sites/all/modules/wysiwyg/wysiwyg-dialog-page.tpl.php b/sites/all/modules/wysiwyg/wysiwyg-dialog-page.tpl.php index 40725f54..0811ae78 100644 --- a/sites/all/modules/wysiwyg/wysiwyg-dialog-page.tpl.php +++ b/sites/all/modules/wysiwyg/wysiwyg-dialog-page.tpl.php @@ -1,5 +1,4 @@ <?php -// $Id: wysiwyg-dialog-page.tpl.php,v 1.1 2009/02/01 09:20:48 sun Exp $ /** * @file diff --git a/sites/all/modules/wysiwyg/wysiwyg.admin.inc b/sites/all/modules/wysiwyg/wysiwyg.admin.inc index 7111758d..510e1e31 100644 --- a/sites/all/modules/wysiwyg/wysiwyg.admin.inc +++ b/sites/all/modules/wysiwyg/wysiwyg.admin.inc @@ -1,5 +1,4 @@ <?php -// $Id: wysiwyg.admin.inc,v 1.29 2011/01/06 00:03:13 sun Exp $ /** * @file @@ -333,8 +332,14 @@ function wysiwyg_profile_form_submit($form, &$form_state) { unset($values['submit'], $values['form_id'], $values['op'], $values['form_token'], $values['form_build_id']); // Insert new profile data. - db_query("UPDATE {wysiwyg} SET settings = :settings WHERE format = :format", array(':settings' => serialize($values), ':format' => $format)); - cache_clear_all('wysiwyg_profiles', 'cache'); + db_merge('wysiwyg') + ->key(array('format' => $format)) + ->fields(array( + 'editor' => $editor, + 'settings' => serialize($values), + )) + ->execute(); + wysiwyg_profile_cache_clear(); drupal_set_message(t('Wysiwyg profile for %format has been saved.', array('%format' => $input_format))); @@ -518,7 +523,7 @@ function wysiwyg_profile_overview_submit($form, &$form_state) { )) ->execute(); } - cache_clear_all('wysiwyg_profiles', 'cache'); + wysiwyg_profile_cache_clear(); } /** @@ -544,18 +549,9 @@ function wysiwyg_profile_delete_confirm($form, &$form_state, $profile) { function wysiwyg_profile_delete_confirm_submit($form, &$form_state) { $format = $form_state['values']['format']; wysiwyg_profile_delete($format->format); - cache_clear_all('wysiwyg_profiles', 'cache'); + wysiwyg_profile_cache_clear(); drupal_set_message(t('Wysiwyg profile for %name has been deleted.', array('%name' => $format->name))); $form_state['redirect'] = 'admin/config/content/wysiwyg'; } -/** - * Remove a profile from the database. - */ -function wysiwyg_profile_delete($format) { - db_delete('wysiwyg') - ->condition('format', $format) - ->execute(); -} - diff --git a/sites/all/modules/wysiwyg/wysiwyg.api.js b/sites/all/modules/wysiwyg/wysiwyg.api.js index d30e07cb..0318b0b4 100644 --- a/sites/all/modules/wysiwyg/wysiwyg.api.js +++ b/sites/all/modules/wysiwyg/wysiwyg.api.js @@ -1,4 +1,3 @@ -// $Id: wysiwyg.api.js,v 1.1 2009/08/09 02:46:50 sun Exp $ /** * Wysiwyg plugin button implementation for Awesome plugin. diff --git a/sites/all/modules/wysiwyg/wysiwyg.api.php b/sites/all/modules/wysiwyg/wysiwyg.api.php index bd021e0d..5f5b8390 100644 --- a/sites/all/modules/wysiwyg/wysiwyg.api.php +++ b/sites/all/modules/wysiwyg/wysiwyg.api.php @@ -1,9 +1,8 @@ <?php -// $Id: wysiwyg.api.php,v 1.7 2011/01/06 00:19:01 sun Exp $ /** * @file - * Wysiwyg API documentation. + * API documentation for Wysiwyg module. * * To implement a "Drupal plugin" button, you need to write a Wysiwyg plugin: * - Implement hook_wysiwyg_include_directory() to register the directory diff --git a/sites/all/modules/wysiwyg/wysiwyg.dialog.inc b/sites/all/modules/wysiwyg/wysiwyg.dialog.inc index 25dc0bea..500f78d7 100644 --- a/sites/all/modules/wysiwyg/wysiwyg.dialog.inc +++ b/sites/all/modules/wysiwyg/wysiwyg.dialog.inc @@ -1,5 +1,4 @@ <?php -// $Id: wysiwyg.dialog.inc,v 1.2 2009/08/08 07:11:25 sun Exp $ /** * @file diff --git a/sites/all/modules/wysiwyg/wysiwyg.info b/sites/all/modules/wysiwyg/wysiwyg.info index 4bb7336e..840817ae 100644 --- a/sites/all/modules/wysiwyg/wysiwyg.info +++ b/sites/all/modules/wysiwyg/wysiwyg.info @@ -1,17 +1,17 @@ -; $Id: wysiwyg.info,v 1.6 2011/01/06 00:06:18 sun Exp $ name = Wysiwyg -description = Allows users to edit contents with client-side editors. +description = Allows to edit content with client-side editors. package = User interface ;dependencies[] = libraries ;dependencies[] = ctools -;dependencies[] = popups ;dependencies[] = debug core = 7.x configure = admin/config/content/wysiwyg +files[] = wysiwyg.module +files[] = tests/wysiwyg.test -; Information added by drupal.org packaging script on 2011-01-06 -version = "7.x-2.0" +; Information added by drupal.org packaging script on 2011-06-19 +version = "7.x-2.1" core = "7.x" project = "wysiwyg" -datestamp = "1294281172" +datestamp = "1308450722" diff --git a/sites/all/modules/wysiwyg/wysiwyg.init.js b/sites/all/modules/wysiwyg/wysiwyg.init.js index b3a87bfb..6ccdb314 100644 --- a/sites/all/modules/wysiwyg/wysiwyg.init.js +++ b/sites/all/modules/wysiwyg/wysiwyg.init.js @@ -1,4 +1,3 @@ -// $Id: wysiwyg.init.js,v 1.4 2010/11/13 18:53:15 sun Exp $ Drupal.wysiwyg = Drupal.wysiwyg || { 'instances': {} }; diff --git a/sites/all/modules/wysiwyg/wysiwyg.install b/sites/all/modules/wysiwyg/wysiwyg.install index ba4c5ea5..038ba46b 100644 --- a/sites/all/modules/wysiwyg/wysiwyg.install +++ b/sites/all/modules/wysiwyg/wysiwyg.install @@ -1,5 +1,9 @@ <?php -// $Id: wysiwyg.install,v 1.12 2011/01/06 01:49:52 sun Exp $ + +/** + * @file + * Installation functions for Wysiwyg module. + */ /** * Implementation of hook_schema(). diff --git a/sites/all/modules/wysiwyg/wysiwyg.js b/sites/all/modules/wysiwyg/wysiwyg.js index f9336407..72ca1569 100644 --- a/sites/all/modules/wysiwyg/wysiwyg.js +++ b/sites/all/modules/wysiwyg/wysiwyg.js @@ -1,4 +1,3 @@ -// $Id: wysiwyg.js,v 1.22 2011/01/06 00:11:48 sun Exp $ (function($) { /** @@ -74,7 +73,7 @@ Drupal.behaviors.attachWysiwyg = { // Detach any editor when the containing form is submitted. $('#' + params.field).parents('form').submit(function (event) { // Do not detach if the event was cancelled. - if (event.originalEvent.returnValue === false) { + if (event.isDefaultPrevented()) { return; } Drupal.wysiwygDetach(context, params[format]); diff --git a/sites/all/modules/wysiwyg/wysiwyg.module b/sites/all/modules/wysiwyg/wysiwyg.module index 8e8b3c7d..771cbd79 100644 --- a/sites/all/modules/wysiwyg/wysiwyg.module +++ b/sites/all/modules/wysiwyg/wysiwyg.module @@ -1,11 +1,47 @@ <?php -// $Id: wysiwyg.module,v 1.51 2011/01/06 01:43:26 sun Exp $ /** * @file - * Integrate client-side editors with Drupal. + * Integrates client-side editors with Drupal. */ +/** + * Implements hook_entity_info(). + */ +function wysiwyg_entity_info() { + $types['wysiwyg_profile'] = array( + 'label' => t('Wysiwyg profile'), + 'base table' => 'wysiwyg', + 'controller class' => 'WysiwygProfileController', + 'fieldable' => FALSE, + // When loading all entities, DrupalDefaultEntityController::load() ignores + // its static cache. Therefore, wysiwyg_profile_load_all() implements a + // custom static cache. + 'static cache' => FALSE, + 'entity keys' => array( + 'id' => 'format', + ), + ); + return $types; +} + +/** + * Controller class for Wysiwyg profiles. + */ +class WysiwygProfileController extends DrupalDefaultEntityController { + /** + * Overrides DrupalDefaultEntityController::attachLoad(). + */ + function attachLoad(&$queried_entities, $revision_id = FALSE) { + // Unserialize the profile settings. + foreach ($queried_entities as $key => $record) { + $queried_entities[$key]->settings = unserialize($record->settings); + } + // Call the default attachLoad() method. + parent::attachLoad($queried_entities, $revision_id); + } +} + /** * Implementation of hook_menu(). */ @@ -115,6 +151,11 @@ function wysiwyg_pre_render_text_format($element) { if (!isset($element['format']) || !empty($element['value']['#disabled'])) { return $element; } + // Allow modules to programmatically enforce no client-side editor by setting + // the #wysiwyg property to FALSE. + if (isset($element['#wysiwyg']) && !$element['#wysiwyg']) { + return $element; + } $format_field = &$element['format']; $field = &$element['value']; @@ -587,44 +628,58 @@ function wysiwyg_get_css() { } /** - * Load profile for a given input format. + * Loads a profile for a given text format. + * + * Since there are commonly not many text formats, and each text format-enabled + * form element will possibly have to load every single profile, all existing + * profiles are loaded and cached once to reduce the amount of database queries. */ function wysiwyg_profile_load($format) { - static $profiles; - - if ($cached = cache_get('wysiwyg_profiles')) { - $profiles = $cached->data; - } - else { - $result = db_query('SELECT format, editor, settings FROM {wysiwyg}'); - foreach ($result as $profile) { - $profile->settings = unserialize($profile->settings); - $profiles[$profile->format] = $profile; - } - cache_set('wysiwyg_profiles', $profiles); - } - + $profiles = wysiwyg_profile_load_all(); return (isset($profiles[$format]) ? $profiles[$format] : FALSE); } /** - * Load all profiles. + * Loads all profiles. */ function wysiwyg_profile_load_all() { - static $profiles; + // entity_load(..., FALSE) does not re-use its own static cache upon + // repetitive calls, so a custom static cache is required. + // @see wysiwyg_entity_info() + $profiles = &drupal_static(__FUNCTION__); if (!isset($profiles)) { - $profiles = array(); - $result = db_query('SELECT format, editor, settings FROM {wysiwyg}'); - foreach ($result as $profile) { - $profile->settings = unserialize($profile->settings); - $profiles[$profile->format] = $profile; + // Additional database cache to support alternative caches like memcache. + if ($cached = cache_get('wysiwyg_profiles')) { + $profiles = $cached->data; + } + else { + $profiles = entity_load('wysiwyg_profile', FALSE); + cache_set('wysiwyg_profiles', $profiles); } } return $profiles; } +/** + * Deletes a profile from the database. + */ +function wysiwyg_profile_delete($format) { + db_delete('wysiwyg') + ->condition('format', $format) + ->execute(); +} + +/** + * Clear all Wysiwyg profile caches. + */ +function wysiwyg_profile_cache_clear() { + entity_get_controller('wysiwyg_profile')->resetCache(); + drupal_static_reset('wysiwyg_profile_load_all'); + cache_clear_all('wysiwyg_profiles', 'cache'); +} + /** * Implements hook_form_FORM_ID_alter(). */ -- GitLab