From 6fcd4678f9b9b473a36617ee0cc5f9f4359a1d6b Mon Sep 17 00:00:00 2001 From: yama Date: Sat, 20 Apr 2013 19:28:34 +0900 Subject: [PATCH 001/530] Refactor #9863 Convert to utf-8 all core files http://tracker.modx.com/issues/9863 --- .../ajaxSearch/ajaxSearch_version_192.txt | 2 +- install/instprocessor.php | 2 +- .../media/ImageEditor/assets/EditorContent.js | 2 +- manager/media/ImageEditor/assets/editor.js | 6 +-- .../mcpuk/connectors/php/connector.php | 41 ++++++++++--------- 5 files changed, 27 insertions(+), 26 deletions(-) diff --git a/assets/snippets/ajaxSearch/ajaxSearch_version_192.txt b/assets/snippets/ajaxSearch/ajaxSearch_version_192.txt index 75d1d43a2e..0dfca34c16 100644 --- a/assets/snippets/ajaxSearch/ajaxSearch_version_192.txt +++ b/assets/snippets/ajaxSearch/ajaxSearch_version_192.txt @@ -104,7 +104,7 @@ Previous versions : ==== Accented characters - search html entities too The html entity version of the search terms are also searched. - e.g: "ph&eactute;nomène" and "phnomne" are searched when "phnomne" is searched. + e.g: "ph&eactute;nomène" and "phénomène" are searched when "phénomène" is searched. ==== advSearch - exactphrase diff --git a/install/instprocessor.php b/install/instprocessor.php index 87b9752956..9088b29426 100755 --- a/install/instprocessor.php +++ b/install/instprocessor.php @@ -246,7 +246,7 @@ function parseProperties($propertyString) { $site_url= ((isset ($_SERVER[\'HTTPS\']) && strtolower($_SERVER[\'HTTPS\']) == \'on\') || $_SERVER[\'SERVER_PORT\'] == $https_port) ? \'https://\' : \'http://\'; $site_url .= $_SERVER[\'HTTP_HOST\']; if ($_SERVER[\'SERVER_PORT\'] != 80) - $site_url= str_replace(\':\' . $_SERVER[\'SERVER_PORT\'], \'\', $site_url); // remove port from HTTP_HOST   + $site_url= str_replace(\':\' . $_SERVER[\'SERVER_PORT\'], \'\', $site_url); // remove port from HTTP_HOST $site_url .= ($_SERVER[\'SERVER_PORT\'] == 80 || (isset ($_SERVER[\'HTTPS\']) && strtolower($_SERVER[\'HTTPS\']) == \'on\') || $_SERVER[\'SERVER_PORT\'] == $https_port) ? \'\' : \':\' . $_SERVER[\'SERVER_PORT\']; $site_url .= $base_url; diff --git a/manager/media/ImageEditor/assets/EditorContent.js b/manager/media/ImageEditor/assets/EditorContent.js index 97788adf0c..3e2357bfa2 100644 --- a/manager/media/ImageEditor/assets/EditorContent.js +++ b/manager/media/ImageEditor/assets/EditorContent.js @@ -237,7 +237,7 @@ function moveContent(e) } } -//Code add for constraints by Frdric Klee +//Code add for constraints by Frédéric Klee function moveHandle(e) { if (dragapproved) diff --git a/manager/media/ImageEditor/assets/editor.js b/manager/media/ImageEditor/assets/editor.js index 99f514ad9e..d247f07ca0 100644 --- a/manager/media/ImageEditor/assets/editor.js +++ b/manager/media/ImageEditor/assets/editor.js @@ -37,7 +37,7 @@ editor.setMode(current_action); //constraints on the scale, - //code by Frdric Klee + //code by Frédéric Klee if(action == 'scale') { var theImage = editor.window.document.getElementById('theImage'); @@ -67,7 +67,7 @@ } } - //Togggle constraints, by Frdric Klee + //Togggle constraints, by Frédéric Klee function toggleConstraints() { var lock = document.getElementById("scaleConstImg"); @@ -89,7 +89,7 @@ } } - //check the constraints, by Frdric Klee + //check the constraints, by Frédéric Klee function checkConstrains(changed) { var constrained = document.getElementById('constProp'); diff --git a/manager/media/browser/mcpuk/connectors/php/connector.php b/manager/media/browser/mcpuk/connectors/php/connector.php index c8e893610a..3c9dd0696c 100644 --- a/manager/media/browser/mcpuk/connectors/php/connector.php +++ b/manager/media/browser/mcpuk/connectors/php/connector.php @@ -1,27 +1,28 @@ - Date: Sat, 20 Apr 2013 19:30:40 +0900 Subject: [PATCH 002/530] Refactor #9861 Should be core files line feed code is "lf" (part 1) http://tracker.modx.com/issues/9861 --- assets/docs/index.html | 2 +- assets/docs/license.txt | 560 +++++++++++++++++++------------------- assets/export/index.html | 2 +- assets/flash/index.html | 2 +- assets/images/index.html | 2 +- assets/js/csshover3.htc | 26 +- assets/js/index.html | 2 +- assets/modules/index.html | 2 +- assets/plugins/index.html | 2 +- 9 files changed, 300 insertions(+), 300 deletions(-) diff --git a/assets/docs/index.html b/assets/docs/index.html index fdd3791786..cfb7d0fe18 100755 --- a/assets/docs/index.html +++ b/assets/docs/index.html @@ -1,2 +1,2 @@ -

Unauthorized access

+

Unauthorized access

You're not allowed to access file folder \ No newline at end of file diff --git a/assets/docs/license.txt b/assets/docs/license.txt index 2128a66ea7..960fe7469f 100755 --- a/assets/docs/license.txt +++ b/assets/docs/license.txt @@ -1,280 +1,280 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 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. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 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. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS diff --git a/assets/export/index.html b/assets/export/index.html index fdd3791786..cfb7d0fe18 100644 --- a/assets/export/index.html +++ b/assets/export/index.html @@ -1,2 +1,2 @@ -

Unauthorized access

+

Unauthorized access

You're not allowed to access file folder \ No newline at end of file diff --git a/assets/flash/index.html b/assets/flash/index.html index fdd3791786..cfb7d0fe18 100755 --- a/assets/flash/index.html +++ b/assets/flash/index.html @@ -1,2 +1,2 @@ -

Unauthorized access

+

Unauthorized access

You're not allowed to access file folder \ No newline at end of file diff --git a/assets/images/index.html b/assets/images/index.html index fdd3791786..cfb7d0fe18 100644 --- a/assets/images/index.html +++ b/assets/images/index.html @@ -1,2 +1,2 @@ -

Unauthorized access

+

Unauthorized access

You're not allowed to access file folder \ No newline at end of file diff --git a/assets/js/csshover3.htc b/assets/js/csshover3.htc index 7ce43fa71c..6b160b01aa 100644 --- a/assets/js/csshover3.htc +++ b/assets/js/csshover3.htc @@ -1,14 +1,14 @@ - - \ No newline at end of file diff --git a/assets/js/index.html b/assets/js/index.html index fdd3791786..cfb7d0fe18 100644 --- a/assets/js/index.html +++ b/assets/js/index.html @@ -1,2 +1,2 @@ -

Unauthorized access

+

Unauthorized access

You're not allowed to access file folder \ No newline at end of file diff --git a/assets/modules/index.html b/assets/modules/index.html index fdd3791786..cfb7d0fe18 100755 --- a/assets/modules/index.html +++ b/assets/modules/index.html @@ -1,2 +1,2 @@ -

Unauthorized access

+

Unauthorized access

You're not allowed to access file folder \ No newline at end of file diff --git a/assets/plugins/index.html b/assets/plugins/index.html index fdd3791786..cfb7d0fe18 100755 --- a/assets/plugins/index.html +++ b/assets/plugins/index.html @@ -1,2 +1,2 @@ -

Unauthorized access

+

Unauthorized access

You're not allowed to access file folder \ No newline at end of file From d8611dcdaa5ab9f963cb17029ba41c0fe116ffd1 Mon Sep 17 00:00:00 2001 From: yama Date: Sat, 20 Apr 2013 19:31:06 +0900 Subject: [PATCH 003/530] Refactor #9861 Should be core files line feed code is "lf" (part 2) http://tracker.modx.com/issues/9861 --- assets/media/index.html | 2 +- assets/plugins/qm/css/colorbox.css | 114 +- assets/plugins/qm/css/ie.css | 6 +- assets/plugins/qm/readme.html | 1748 ++++++++--------- .../plugins/fullpage/css/fullpage.css | 284 +-- .../tiny_mce/plugins/fullpage/fullpage.htm | 518 ++--- .../tiny_mce/plugins/fullpage/js/fullpage.js | 464 ++--- 7 files changed, 1568 insertions(+), 1568 deletions(-) diff --git a/assets/media/index.html b/assets/media/index.html index fdd3791786..cfb7d0fe18 100755 --- a/assets/media/index.html +++ b/assets/media/index.html @@ -1,2 +1,2 @@ -

Unauthorized access

+

Unauthorized access

You're not allowed to access file folder \ No newline at end of file diff --git a/assets/plugins/qm/css/colorbox.css b/assets/plugins/qm/css/colorbox.css index 7acb45ab52..518e8d8773 100755 --- a/assets/plugins/qm/css/colorbox.css +++ b/assets/plugins/qm/css/colorbox.css @@ -1,57 +1,57 @@ -/* - ColorBox Core Style - The following rules are the styles that are consistant between themes. - Avoid changing this area to maintain compatability with future versions of ColorBox. -*/ -#colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;} -#cboxOverlay{position:fixed; width:100%; height:100%;} -#cboxMiddleLeft, #cboxBottomLeft{clear:left;} -#cboxContent{position:relative; overflow:hidden;} -#cboxLoadedContent{overflow:auto;} -#cboxLoadedContent iframe{display:block; width:100%; height:100%; border:0;} -#cboxTitle{margin:0;} -#cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%;} -#cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;} - -/* - Example user style - The following rules are ordered and tabbed in a way that represents the - order/nesting of the generated HTML, so that the structure easier to understand. -*/ -#cboxOverlay{background:#000;} -#colorbox{} - #cboxTopLeft{width:21px; height:21px; background:url(images/controls.png) -100px 0 no-repeat;} - #cboxTopRight{width:21px; height:21px; background:url(images/controls.png) -129px 0 no-repeat;} - #cboxBottomLeft{width:21px; height:21px; background:url(images/controls.png) -100px -29px no-repeat;} - #cboxBottomRight{width:21px; height:21px; background:url(images/controls.png) -129px -29px no-repeat;} - #cboxMiddleLeft{width:21px; background:url(images/controls.png) left top repeat-y;} - #cboxMiddleRight{width:21px; background:url(images/controls.png) right top repeat-y;} - #cboxTopCenter{height:21px; background:url(images/border.png) 0 0 repeat-x;} - #cboxBottomCenter{height:21px; background:url(images/border.png) 0 -29px repeat-x;} - #cboxContent{background:#fff;} - #cboxLoadedContent{margin-bottom:28px;} - #cboxTitle{position:absolute; bottom:3px; left:0; text-align:center; width:100%; color:#949494;} - #cboxCurrent{position:absolute; bottom:3px; left:58px; color:#949494;} - #cboxSlideshow{position:absolute; bottom:3px; right:30px; color:#0092ef;} - #cboxPrevious{position:absolute; bottom:0; left:0px; background:url(images/controls.png) -75px 0px no-repeat; width:25px; height:25px; text-indent:-9999px;} - #cboxPrevious.hover{background-position:-75px -25px;} - #cboxNext{position:absolute; bottom:0; left:27px; background:url(images/controls.png) -50px 0px no-repeat; width:25px; height:25px; text-indent:-9999px;} - #cboxNext.hover{background-position:-50px -25px;} - #cboxLoadingOverlay{background:url(images/loading_background.png) center center no-repeat;} - #cboxLoadingGraphic{background:url(images/ajax-loader.gif) center center no-repeat;} - #cboxClose{position:absolute; bottom:0; right:0; background:url(images/controls.png) -25px 0px no-repeat; width:25px; height:25px; text-indent:-9999px;} - #cboxClose.hover{background-position:-25px -25px;} - -/* - The following fixes png-transparency for IE6. - It is also necessary for png-transparency in IE7 & IE8 to avoid 'black halos' with the fade transition - - Since this method does not support CSS background-positioning, it is incompatible with CSS sprites. - Colorbox preloads navigation hover classes to account for this. - - !! Important Note: AlphaImageLoader src paths are relative to the HTML document, - while regular CSS background images are relative to the CSS document. - - => Moved to qm.inc.php for friendly url compatibility -*/ - +/* + ColorBox Core Style + The following rules are the styles that are consistant between themes. + Avoid changing this area to maintain compatability with future versions of ColorBox. +*/ +#colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;} +#cboxOverlay{position:fixed; width:100%; height:100%;} +#cboxMiddleLeft, #cboxBottomLeft{clear:left;} +#cboxContent{position:relative; overflow:hidden;} +#cboxLoadedContent{overflow:auto;} +#cboxLoadedContent iframe{display:block; width:100%; height:100%; border:0;} +#cboxTitle{margin:0;} +#cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%;} +#cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;} + +/* + Example user style + The following rules are ordered and tabbed in a way that represents the + order/nesting of the generated HTML, so that the structure easier to understand. +*/ +#cboxOverlay{background:#000;} +#colorbox{} + #cboxTopLeft{width:21px; height:21px; background:url(images/controls.png) -100px 0 no-repeat;} + #cboxTopRight{width:21px; height:21px; background:url(images/controls.png) -129px 0 no-repeat;} + #cboxBottomLeft{width:21px; height:21px; background:url(images/controls.png) -100px -29px no-repeat;} + #cboxBottomRight{width:21px; height:21px; background:url(images/controls.png) -129px -29px no-repeat;} + #cboxMiddleLeft{width:21px; background:url(images/controls.png) left top repeat-y;} + #cboxMiddleRight{width:21px; background:url(images/controls.png) right top repeat-y;} + #cboxTopCenter{height:21px; background:url(images/border.png) 0 0 repeat-x;} + #cboxBottomCenter{height:21px; background:url(images/border.png) 0 -29px repeat-x;} + #cboxContent{background:#fff;} + #cboxLoadedContent{margin-bottom:28px;} + #cboxTitle{position:absolute; bottom:3px; left:0; text-align:center; width:100%; color:#949494;} + #cboxCurrent{position:absolute; bottom:3px; left:58px; color:#949494;} + #cboxSlideshow{position:absolute; bottom:3px; right:30px; color:#0092ef;} + #cboxPrevious{position:absolute; bottom:0; left:0px; background:url(images/controls.png) -75px 0px no-repeat; width:25px; height:25px; text-indent:-9999px;} + #cboxPrevious.hover{background-position:-75px -25px;} + #cboxNext{position:absolute; bottom:0; left:27px; background:url(images/controls.png) -50px 0px no-repeat; width:25px; height:25px; text-indent:-9999px;} + #cboxNext.hover{background-position:-50px -25px;} + #cboxLoadingOverlay{background:url(images/loading_background.png) center center no-repeat;} + #cboxLoadingGraphic{background:url(images/ajax-loader.gif) center center no-repeat;} + #cboxClose{position:absolute; bottom:0; right:0; background:url(images/controls.png) -25px 0px no-repeat; width:25px; height:25px; text-indent:-9999px;} + #cboxClose.hover{background-position:-25px -25px;} + +/* + The following fixes png-transparency for IE6. + It is also necessary for png-transparency in IE7 & IE8 to avoid 'black halos' with the fade transition + + Since this method does not support CSS background-positioning, it is incompatible with CSS sprites. + Colorbox preloads navigation hover classes to account for this. + + !! Important Note: AlphaImageLoader src paths are relative to the HTML document, + while regular CSS background images are relative to the CSS document. + + => Moved to qm.inc.php for friendly url compatibility +*/ + diff --git a/assets/plugins/qm/css/ie.css b/assets/plugins/qm/css/ie.css index 72a11dd4d8..9a4ddf4beb 100755 --- a/assets/plugins/qm/css/ie.css +++ b/assets/plugins/qm/css/ie.css @@ -1,4 +1,4 @@ -#qmEditor ul -{ - padding-top: 0; +#qmEditor ul +{ + padding-top: 0; } \ No newline at end of file diff --git a/assets/plugins/qm/readme.html b/assets/plugins/qm/readme.html index 7d71ea6921..dc16e9576d 100755 --- a/assets/plugins/qm/readme.html +++ b/assets/plugins/qm/readme.html @@ -1,875 +1,875 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - QuickManager+ -

QuickManager+

- -@author Mikko Lammi, www.maagit.fi/quickmanager-plus
- -@license GNU General Public -License (GPL v3), www.gnu.org/copyleft/gpl.html
- -@version 1.5.5 updated 12/01/2011
- -@requirements MODx 1.0.0+ -              - 
- -

Description

- -QuickManager+ enables front-end content editing.
-

Installation

- -If this is an update from earlier version delete first your old -QuickManager+ plugin and all files at "assets/plugins/qm/".
- -

1. Extract all files from package to site root.

- -NOTICE: If you are using Mac OS X don't extract files to the site root or you will overwrite your whole assets folder.
- -

-2. Create plugin with

- -
    - -
  • Name: QuickManager+
  • -
  • Description: <strong>1.5.5</strong> Enables front-end -content editing
    -
  • -
- -

3. Copy paste plugin code:

- - - - - - -
/**
- * QuickManager+
- *
- * @author Mikko Lammi, www.maagit.fi/quickmanager-plus
- * @license GNU General Public License (GPL), http://www.gnu.org/copyleft/gpl.html
- * @version 1.5.5 updated 12/01/2011   
- */
-
-// In manager
-if (isset($_SESSION['mgrValidated'])) {
-
-    $show = TRUE;
-   
-    if ($disabled  != '') {
-        $arr = explode(",", $disabled );
-        if (in_array($modx->documentIdentifier, $arr)) {
-            $show = FALSE;
-        }
-    }
-   
-    if ($show) {
-        // Replace [*#tv*] with QM+ edit TV button placeholders
-        if ($tvbuttons == 'true') {
-            $e = $modx->Event;
-            if ($e->name == 'OnParseDocument') {
-                 -$output = -&$modx->documentOutput;              -
-                 -$output = preg_replace('~\[\*#(.*?)\*\]~', '<!-- '.$tvbclass.' $1 --->[*$1*]', $output);  
-                 -$modx->documentOutput = $output;
-             }   
-         }
-        // In manager
-        if (isset($_SESSION['mgrValidated'])) {
-            -include_once($modx->config['base_path'].'assets/plugins/qm/qm.inc.php');
-            $qm -= new Qm($modx, $jqpath, $loadmanagerjq, $loadfrontendjq, -$noconflictjq, $loadtb, $tbwidth, $tbheight, $hidefields, $hidetabs, -$hidesections, $addbutton, $tpltype, $tplid, $custombutton, -$managerbutton, $logout, $autohide, $editbuttons, $editbclass, -$newbuttons, $newbclass, $tvbuttons, $tvbclass);
-        }
-    }
-}
- - -

4. Check events:

- -
    - -
  • OnParseDocument
    -
  • -
  • OnWebPagePrerender
  • - -
  • OnDocFormPrerender
  • -
  • OnDocFormSave
  • - -
  • OnManagerLogout 
    -
  • - -
- -NOTICE: Make sure QuickManager+ is the first plugin on OnParseDocument -event: Elements > Manage Elements > Plugins > Edit Plugin -Execution Order by Event > OnParseDocument -

5. Copy paste plugin default configuration:

- - - - - - - -
&jqpath=Path -to jQuery;text;assets/js/jquery-1.4.4.min.js &loadmanagerjq=Load -jQuery in manager;list;true,false;false &loadfrontendjq=Load jQuery -in front-end;list;true,false;true &noconflictjq=jQuery noConflict -mode in front-end;list;true,false;true &loadtb=Load modal box in -front-end;list;true,false;true &tbwidth=Modal box window -width;text;80% &tbheight=Modal box window height;text;90% -&hidefields=Hide document fields from front-end editors;text;parent -&hidetabs=Hide document tabs from front-end editors;text; -&hidesections=Hide document sections from front-end editors;text; -&addbutton=Show add document here button;list;true,false;true -&tpltype=New document template type;list;parent,id,selected;parent -&tplid=New document template id;int;3  -&custombutton=Custom buttons;textarea; &1=undefined;; -&managerbutton=Show go to manager button;list;true,false;true -&logout=Logout to;list;manager,front-end;manager -&disabled=Plugin disabled on documents;text; &autohide=Autohide -toolbar;list;true,false;true &editbuttons=Inline edit buttons;list;true,false;false &editbclass=Edit button CSS -class;text;qm-edit &newbuttons=Inline new -resource buttons;list;true,false;false &newbclass=New resource -button CSS -class;text;qm-new &tvbuttons=Inline template variable -buttons;list;true,false;false &tvbclass=Template variable button CSS -class;text;qm-tv

-

6. Save plugin.   
-

-

+ 7. Rich text editors (optional)
-

-If you don't need inline template variable buttons you can skip this.
-
-You don't need to change anything if your rich text editor version is at least:
-- TinyMCE 3.3.6r2 for MODx
-- CKEditor 3.3 for modx alpha 3
- -
Now the hardest part. To get rich text editors to work properly -with -QuickManager+ inline template variable buttons you will need to edit -the rich text editor plugin code. If you won't do this change the rich -text editors will use web theme buttons when editing richtext template -variables.
- -
- -TinyMCE 3.2.4.1 (MODx 1.0.2 and below):
-
- - -In MODx manager go to: Elements > Manage Elements > Plugins > TinyMCE
- -
- -Replace line:
- -if(isset($forfrontend)||$modx->isFrontend()){
- -
- -With:
- -if(isset($forfrontend)||($modx->isFrontend() -&& (intval($_GET['quickmanagertv'] != 1) && -!(isset($_SESSION['mgrValidated']))))){
- -
- -TinyMCE 3.3.2 (MODx 1.0.3) and 3.3.5.1 (MODX 1.0.4):
-
- - -In MODx manager go to: Elements > Manage Elements > Plugins > TinyMCE
- -
- -Replace line:
- -if($modx->isBackend())
- - -
- - -With:
- -if($modx->isBackend() || (intval($_GET['quickmanagertv']) == 1 && isset($_SESSION['mgrValidated'])))
- - -

Configuration

- -Go to plugin configuration tab.
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Configuration -optionDefault -valuePossible -valuesInstructions
Path to jQuery  assets/js/jquery-1.4.4.min.js  textPath to your jQuery script. 
Load jQuery in -manager truetrue || falsePrevent loading jQuery twice if you are already using -some other plugin -which loads jQuery such as ManagerManager.
Load jQuery in -front-end truetrue || false  Prevent loading jQuery twice if you are already using -it in your site -template.
jQuery noConflict mode in front-endtruetrue || falseDefine -if jQuery should use noConflict mode. NoConflict mode is useful if you -use other JavaScript libraries in front-end such as Mootools.
Load modal box in -front-end truetrue || false  Prevent loading the modal box JavaScript (ColorBox) twice if you are already -using -it in your site -template.
Modal box window width80%number || percentDefine modal box (ColorBox) window width, for example: -800 or 75%.
Modal box window height90%number || percentDefine modal box (ColorBox) window height, for example: -500 or 75%.
Hide document fields from front-end editors parenttextSeparate fields with commas, for example: -parent,template,menuindex
-
-Parent selection doesn't work at all with QuickManager+ due -missing menu tree -frame, so it should be hidden from front-end editors.
-
-Possible fields to hide: content, pagetitle, -longtitle, menuindex, parent, description, alias, link_attributes, -introtext, template, menutitle
-
-NOTICE! Hiding document fields may not work if fields are moved to -other tabs with ManagerManager plugin.
Hide document tabs from front-end -editors
-
textSeparate tabs with commas, for example: settings,access
-
-Possible tabs to hide: general, settings, access
-
-NOTICE! Hiding tabs may not work properly if tab -order is changed with ManagerManager plugin.
Hide document sections from front-end -editors
-
textSeparate sections with commas, for example: -content,tvs
-
-Possible sections to hide: docsettings, content, tvs
-
-NOTICE! Hiding sections may not work properly if you are hiding sections -with ManagerManager plugin.
Show add document here -button truetrue || false  Define if it's possible to add documents with -QuickManager+.
New document template -type parentparent || id || selected How to determine a -new document template:
-
-- parent: Use parent document template
-- id: Use template based on id number
-- selected: Define template based on parent document "inheritTpl" -template variable used by "Inherit Selected Template" plugin http://modxcms.com/extras.html?view=package/view&package=214. -You don't have to install the plugin, but you still have to -have "inheritTpl" template variable on parent document with correct -template id number.
New document template id3numberDefine which template id to use with new documents. -Used only if new -document template type is id.
Custom buttons
-
textDefine custom buttons, for example add document to site -root or add news document
-
-- New document button: 'button title','new','parent -id','template id','visible for user role ids'
-
-- Link button: 'button -title','link','http://www.example.com','','visible for user role ids'
-
-- Modal button: 'button -title','modal','http://www.example.com','','visible for user role ids'
-
MODx link tag, e.g. [~23~], works for link and modal button links.
MODx id tag [*id*] works, e.g. http://www.example.com?refererMODxPageId=[*id*]
-Every custom button has individual CSS class, e.g. qm-custom-"index"
-
-Visible for user role ids: leave empty to accept all roles, role 1 = -Administrator
-
-Separate different buttons with ||
-
-Basic example:
-'Site statistics','link','http://www.google.com/analytics/','',''
-
Advanced example: -
-'New root document','new','0','3',''||'Add -news','new','10','4','4,5,6'||'For admins only','link','[~45~]','','1,4'||'Site -statistics','modal','http://www.google.com/analytics/','','1,4'
Show go to manager -buttontruetrue || falseDefine is go to manager button visible.
Logout tomanagermanager || front-endDefine where to logout: to manager login screen or to -active document -on front-end.
Plugin disabled on documents
-

-
textDocument id numbers where the plugin is disabled.
-Separate fields with commas, for example: -34,22,7,19
Autohide toolbar
-
true
-
true || falseDefine if toolbar hides automatically or is always visible (manually close the toolbar by clicking MODx logo or X button)
-
Inline edit buttons
-
false
-
true || falseDefine if special edit buttons are searched inside content.
-
-Purpose:
-Edit any page from other page, e.g. for editing ditto listings.
-
-How it works:
-- Add anywhere in to your page: <!-- "Edit button CSS class" "document id to be edited" '"Button title"' -->
-- This will create an edit button inside your page when logged in manager
-- For regular visitors it will be shown as a regular HTML comment visible only in the HTML source code
-
-Basic example:
-- Add in to your template <!-- qm-edit 1 'Edit this' -->
-- Creates button to edit page id 1
-
-Advanced example:
-- Add in to your Ditto template chunk: <!-- qm-edit [+id+] 'Edit news item' -->
-- Creates edit buttons for news listings etc. inside the container page
-
-NOTICE! Button title will fail if you use accented characters. Use HTML entities instead, for example &auml;
-
Edit button CSS classqm-edit
-
text
-
Default qm-edit class can be found at: assets/plugins/qm/css/style.css
-
-You can use your own class if you want to make your own edit button or for added security measure.
-
Inline new resource buttonsfalse
-
true || falseDefine if special new resource buttons are searched inside content.
- -
- -Purpose:
- -Create any page from other page, e.g. create new news items.
- -
- -How it works:
- -- Add anywhere in to your page: <!-- "New resource button CSS class" "parent id" "template id" '"Button title"' -->
- -- This will create an new resource button inside your page when logged in manager
- -- For regular visitors it will be shown as a regular HTML comment visible only in the HTML source code
- -
- -Basic example:
- -- Add in to your template <!-- qm-new 1 3 'New news item' -->
- -- Creates new resource button
-- Parent id: 1 (new resource will be created under document id 1)
-- Template id: 3 (uses template id 3)
-- Button title: New news item
-
-NOTICE! Button title will fail if you use accented characters. Use HTML entities instead, for example &auml;
-
New resource button CSS classqm-new
-
text
-
Default qm-new class can be found at: assets/plugins/qm/css/style.css
- -
- -You can use your own class if you want to make your own new resource button or for added security measure.
Inline template variable buttonsfalse
-
true || falseDefine if special template variable buttons are searched inside content.
- -
- -Purpose:
- -Edit any template variable.
- -
-Editable default MODx fields:
- pagetitle, longtitle, description, content, menutitle, introtext
-
- -How it works:
- -- Add anywhere in to your page: [*#tvName*], notice the "#"
-  OR
- -- Add anywhere in to your page: <!-- "Template variable button CSS class" "tvName" -->
- -- This will create a template variable button inside your page when logged in manager
- -- For regular visitors it will be shown as a regular HTML comment visible only in the HTML source code
- -
- -Basic example:
- -- Add in to your template [*#tvName*]
- -- Creates button to edit tvName template variable (and outputs the template variable)
- -
- -Advanced example:
- -- Add in to your template: <!-- qm-tv tvName -->
- -- Creates button to edit tvName template variable
-
Template variable button CSS classqm-tvtext
-
Default qm-tv class can be found at: assets/plugins/qm/css/style.css
- -
- -You can use your own class if you want to make your own template variable button or for added security measure.
- -
- -

How to use

- -Just login, open frontend and enjoy!
-

- -Known issues -

-
    -
  • Parent selection is hidden and doesn't work at all with QuickManager+ due -missing menu tree frame.
  • -
-

Special thanks

-
    -
  • QuickManager+ is orginally based on QuickManager by Urique -Dertlian
  • -
  • Template variable editing ideas from QuickEdit by Adam Crownoble
    -
  • -
- - -

Changelog

-1.5.5 - 12/01/2011
- - -
    -
  • Changed: QM+ toolbar close button changed to li element for better cross-browser compatibility
    -
  • -
  • Fixed: Multiple little CSS fixes for better protection against global CSS definitions
  • -
- -1.5.4 - 03/01/2011
- - -
    -
  • Changed: Updated ColorBox to 1.3.15: http://colorpowered.com/colorbox/
  • -
  • Fixed: Support for jQuery 1.4.4
    -
  • -
  • Fixed: Inline template variable edit/save was still causing error -if "'" mark was used (was affecting pagetitle etc default fields)
  • -
-1.5.3 - 12/10/2010
- - -
    -
  • Changed: Plugin code checks immeditally at start if user is in manager to save processing time
    -
  • -
  • Fixed: Inline template variable edit/save was causing error if "'" mark was used
    -
  • - -
-1.5.2 - 14/09/2010
- -
    -
  • Added: CSS classes to toolbar buttons, also li elements: qmCustom, qmManager, qmLogout
  • -
  • Changed: Inline buttons div => span, validates correctly
    -
  • -
  • Fixed: Inline template variable editing when TV type is checkbox
    -
  • -
-1.5.1 - 02/08/2010
-
    -
  • Added: CSS classes to toolbar buttons: qmCustom, qmManager, qmLogout
    -
  • -
  • Fixed: Updated ColorBox to 1.3.9 that solves TinyMCE image align problems with IE6 and IE7
    -
  • -
-1.5
- -
    -
  • Added: Inline template variable buttons!!! Edit template variables with QuickEdit style. Off by default though.
    -
  • - -
  • Added: OnParseDocument plugin event
  • -
  • Added: Image TV preview
  • -
  • Added: Preserve alias on save
  • -
  • Added: "documentDirty=false;" to cancel button to prevent unnecessary MODx manager alert message
  • -
  • Added: Custom buttons now support standard MODx [*id*] tag, e.g. http://www.example.com?refererMODxPageId=[*id*]
  • -
  • Added: Individual CSS class for every custom button, e.g. qm-custom-"index"
    -
  • - - - - - -
  • Changed: Plugin content
  • -
  • Changed: TV access routine
    -
  • -
  • Fixed: TV edit form button labels
  • -
  • Removed: close.php => now implemented with OnWebPagePrerender event to preserve alias
    -
  • - - -
-1.4.1
-
    -
  • Added: Individual user language check, previously QM+ used global language setting for all users
    -
  • -
  • Changed: Edit buttons in content => Inline edit buttons, New resource buttons in content => Inline new resource buttons
  • -
  • Changed: Inline edit buttons "placeholder markup" changed to: <!-- "Edit button CSS class" "document id to be edited" '"Button title"' -->
  • -
  • Fixed: Inline edit/new buttons access control
    -
  • -
-1.4
-
    -
  • Added: Edit buttons inside content. Edit any page from other page, e.g. for editing ditto listings.
  • -
  • Added: New resource buttons inside content. Create any page from other page, e.g. create new news item.
  • -
  • Added: Custom buttons works now with default MODx links, e.g. [~23~]
    -
  • -
  • Added: Show friendly alias after saving the document. Notice: This is still an experimental feature in is off by default.
    -
  • -
  • Changed: Multiple CSS tweaks mainly for IE
  • -
  • Changed: close.php uses now sessions instead of JavaScript cookies
    -
  • -
  • Fixed: PHP4 support fixed (Thanks yama!)
  • -
  • Fixed: Hiding tabs and sections fixed (access -tab and docsettings -section)
  • -
  • Removed: .htaccess file under qm -folder that was accidentally left there is not needed at all.
    -
  • -
-1.3.4.1
-
    -
  • Changed: CSS tweaks for IE, opacity now works fine with IE8 but unfortunately with IE7 ugly fonts remain (Thanks again uxello!)
  • -
- - -1.3.4
- -
    - -
  • Added: Autohide toolbar configuration option
  • -
  • Changed: Updated ColorBox to 1.3.6: http://colorpowered.com/colorbox/
    -
  • -
  • Changed: CSS tweaks, mainly for IE (opacity removed for IE, it breaks cleartype fonts resulting very ugly looking fonts)
  • -
  • Changed: Plugin code moved from text file to this file (Installation / 3. Copy paste plugin code)
    -
  • -
  • Fixed: -Document lock problem solved, now document lock is released when cancel -button is pressed (Thanks uxello for the solution!)
    -
  • -
  • Fixed: Toolbar is now valid XHTML 1.0 Transitional code
  • - -
  • Removed: Unnecessary $disabled variable from edit code
  • -
  • Removed: Images folder, all images are now under css > images
    -
  • - -
- - -1.3.3
- -
    - -
  • Added: A fallback to English if the languages are missing in the -Manager/user settings
  • -
  • Added: -Little tweaks with QuickManager action buttons: small hide/show -animations and possibilty to close the menu by clicking the MODx logo
  • -
  • Added: New option for custom buttons: modal = any link opened in -a modal box (ColorBox)
  • -
  • Changed:  Custom buttons separator is now || instead of # -(reserved for URL anchors)
  • -
  • Changed: Rounded modal box is back, finally resolved bugs -with ColorBox CSS in IE and friendly urls
  • -
  • Changed: qm-colorbox.css renamed back to colorbox.css
  • -
  • Fixed: Satinitized possible XSS vulnerabilities
  • -
  • Removed: OnManagerPageInit plugin event removed
  • -
  • Removed: IE6 support dropped, QuickManager+ is not tested with -IE6 as MODx manager doesn't offially support IE6
  • -
- -1.3.2.1
- -
    - -
  • Fixed: Language file loading
  • -
- -1.3.2
- -
    - -
  • Added: New configuration option - jQuery noConflict mode in -front-end
  • -
  • Added: Check user manager access permissions to current document -and show action buttons according to permissions
  • -
  • Added: It's now possible to hide QM+ action buttons
  • -
  • Added: Hide parent frame scrollbars and QM+ buttons when modal -box is visible (ColorBox bindings)
  • -
  • Added: Modal box can't be accidentally closed by clicking the -overlay
  • -
  • Changed: -Stylish ColorBox CSS style didn't work properly with IE and crashed too -often with Safari, had to replace it with minimalistic style for better -cross-browser compatibility
  • -
  • Changed: Updated ColorBox to version 1.3.1, includes for example -IE ClearType fix (no more ugly fonts)
  • -
  • Changed: colorbox.css renamed to qm-colorbox.css and moved to QM+ -css folder
  • -
  • Fixed: -All normal MODx manager actions including template and RTE selection -works now just fine (thank you very much Susan O. for your ideas!)
  • -
  • Fixed: Multiple small CSS fixes for IE
  • -
  • Fixed: Alias friendly logout code (thanks Mar!)
  • -
  • Fixed: Language selection a bit more robust and offer a level of -fallback
  • -
  • Removed: Use with ManagerManager -plugin  -option deprecated
  • -
- -1.3.1
- -
    - -
  • Added: -It's now possible to change template once. After that you can't change -the template again but of course you can press cancel button and try -again.
    -Note: ToDo: Investigate if there is a way to detect parent frame in PHP -to solve this problem
  • -
- -1.3
- -
    - -
  • Added: Support for MODx Evolution 1.0.0 version, better -combatibility with MODx Carbon manager theme
  • -
  • Added: Support for jQuery in noConflict mode by default
  • -
  • Added: ColorBox modal box support
  • -
  • Added: Modal box (ColorBox) window width
  • -
  • Added: Modal box (ColorBox) window height
  • -
  • Added: Possibility to add custom link buttons
  • -
  • Removed: Thickbox window max width
  • -
  • Removed: MODx versions below 1.0.0 are not supported due -manager interface changes
  • -
  • Removed: ThickBox modal box support
  • -
- -1.2
- -
    - -
  • Added: Plugin disabled option
  • -
  • Added: Show go to manager -button option
  • -
  • Added: Custom add buttons option
  • -
  • Added: Hide document sections from front-end -editors option
  • -
  • Added: Hide document tabs from front-end -editors option
  • -
  • Added: Dynamic ThickBox windows size adjustement, window size is -calculated without refreshing the window
  • -
  • Added: ThickBox window max width option 
  • -
  • Added: Logout to configuration option added, needs -event OnManagerLogout 
  • -
  • Fixed: Documentation changed to html file
  • -
  • Fixed: Clearer plugin folder structure
  • -
  • Fixed: Hiding templates if only one template
  • -
  • Fixed: Load jQuery in -front-end was not working properly
  • -
  • Fixed: mcc.class.php => hideTab & hideSection
  • -
  • Removed: ThickBox windows width and height options removed.
  • -
- -1.1.1
- -
    - -
  • Fixed: Logout function changed. Previous version had a problem -with multiple users resulting document locked issues. Now plugin logs -user nicely out to the manager login page.
  • -
- + + + + + + + + + + + + + + + + + + + + + + + + + + + + QuickManager+ +

QuickManager+

+ +@author Mikko Lammi, www.maagit.fi/quickmanager-plus
+ +@license GNU General Public +License (GPL v3), www.gnu.org/copyleft/gpl.html
+ +@version 1.5.5 updated 12/01/2011
+ +@requirements MODx 1.0.0+ +              + 
+ +

Description

+ +QuickManager+ enables front-end content editing.
+

Installation

+ +If this is an update from earlier version delete first your old +QuickManager+ plugin and all files at "assets/plugins/qm/".
+ +

1. Extract all files from package to site root.

+ +NOTICE: If you are using Mac OS X don't extract files to the site root or you will overwrite your whole assets folder.
+ +

+2. Create plugin with

+ +
    + +
  • Name: QuickManager+
  • +
  • Description: <strong>1.5.5</strong> Enables front-end +content editing
    +
  • +
+ +

3. Copy paste plugin code:

+ + + + + + +
/**
+ * QuickManager+
+ *
+ * @author Mikko Lammi, www.maagit.fi/quickmanager-plus
+ * @license GNU General Public License (GPL), http://www.gnu.org/copyleft/gpl.html
+ * @version 1.5.5 updated 12/01/2011   
+ */
+
+// In manager
+if (isset($_SESSION['mgrValidated'])) {
+
+    $show = TRUE;
+   
+    if ($disabled  != '') {
+        $arr = explode(",", $disabled );
+        if (in_array($modx->documentIdentifier, $arr)) {
+            $show = FALSE;
+        }
+    }
+   
+    if ($show) {
+        // Replace [*#tv*] with QM+ edit TV button placeholders
+        if ($tvbuttons == 'true') {
+            $e = $modx->Event;
+            if ($e->name == 'OnParseDocument') {
+                 +$output = +&$modx->documentOutput;              +
+                 +$output = preg_replace('~\[\*#(.*?)\*\]~', '<!-- '.$tvbclass.' $1 +-->[*$1*]', $output);  
+                 +$modx->documentOutput = $output;
+             }   
+         }
+        // In manager
+        if (isset($_SESSION['mgrValidated'])) {
+            +include_once($modx->config['base_path'].'assets/plugins/qm/qm.inc.php');
+            $qm += new Qm($modx, $jqpath, $loadmanagerjq, $loadfrontendjq, +$noconflictjq, $loadtb, $tbwidth, $tbheight, $hidefields, $hidetabs, +$hidesections, $addbutton, $tpltype, $tplid, $custombutton, +$managerbutton, $logout, $autohide, $editbuttons, $editbclass, +$newbuttons, $newbclass, $tvbuttons, $tvbclass);
+        }
+    }
+}
+ + +

4. Check events:

+ +
    + +
  • OnParseDocument
    +
  • +
  • OnWebPagePrerender
  • + +
  • OnDocFormPrerender
  • +
  • OnDocFormSave
  • + +
  • OnManagerLogout 
    +
  • + +
+ +NOTICE: Make sure QuickManager+ is the first plugin on OnParseDocument +event: Elements > Manage Elements > Plugins > Edit Plugin +Execution Order by Event > OnParseDocument +

5. Copy paste plugin default configuration:

+ + + + + + + +
&jqpath=Path +to jQuery;text;assets/js/jquery-1.4.4.min.js &loadmanagerjq=Load +jQuery in manager;list;true,false;false &loadfrontendjq=Load jQuery +in front-end;list;true,false;true &noconflictjq=jQuery noConflict +mode in front-end;list;true,false;true &loadtb=Load modal box in +front-end;list;true,false;true &tbwidth=Modal box window +width;text;80% &tbheight=Modal box window height;text;90% +&hidefields=Hide document fields from front-end editors;text;parent +&hidetabs=Hide document tabs from front-end editors;text; +&hidesections=Hide document sections from front-end editors;text; +&addbutton=Show add document here button;list;true,false;true +&tpltype=New document template type;list;parent,id,selected;parent +&tplid=New document template id;int;3  +&custombutton=Custom buttons;textarea; &1=undefined;; +&managerbutton=Show go to manager button;list;true,false;true +&logout=Logout to;list;manager,front-end;manager +&disabled=Plugin disabled on documents;text; &autohide=Autohide +toolbar;list;true,false;true &editbuttons=Inline edit buttons;list;true,false;false &editbclass=Edit button CSS +class;text;qm-edit &newbuttons=Inline new +resource buttons;list;true,false;false &newbclass=New resource +button CSS +class;text;qm-new &tvbuttons=Inline template variable +buttons;list;true,false;false &tvbclass=Template variable button CSS +class;text;qm-tv

+

6. Save plugin.   
+

+

+ 7. Rich text editors (optional)
+

+If you don't need inline template variable buttons you can skip this.
+
+You don't need to change anything if your rich text editor version is at least:
+- TinyMCE 3.3.6r2 for MODx
+- CKEditor 3.3 for modx alpha 3
+ +
Now the hardest part. To get rich text editors to work properly +with +QuickManager+ inline template variable buttons you will need to edit +the rich text editor plugin code. If you won't do this change the rich +text editors will use web theme buttons when editing richtext template +variables.
+ +
+ +TinyMCE 3.2.4.1 (MODx 1.0.2 and below):
+
+ + +In MODx manager go to: Elements > Manage Elements > Plugins > TinyMCE
+ +
+ +Replace line:
+ +if(isset($forfrontend)||$modx->isFrontend()){
+ +
+ +With:
+ +if(isset($forfrontend)||($modx->isFrontend() +&& (intval($_GET['quickmanagertv'] != 1) && +!(isset($_SESSION['mgrValidated']))))){
+ +
+ +TinyMCE 3.3.2 (MODx 1.0.3) and 3.3.5.1 (MODX 1.0.4):
+
+ + +In MODx manager go to: Elements > Manage Elements > Plugins > TinyMCE
+ +
+ +Replace line:
+ +if($modx->isBackend())
+ + +
+ + +With:
+ +if($modx->isBackend() || (intval($_GET['quickmanagertv']) == 1 && isset($_SESSION['mgrValidated'])))
+ + +

Configuration

+ +Go to plugin configuration tab.
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Configuration +optionDefault +valuePossible +valuesInstructions
Path to jQuery  assets/js/jquery-1.4.4.min.js  textPath to your jQuery script. 
Load jQuery in +manager truetrue || falsePrevent loading jQuery twice if you are already using +some other plugin +which loads jQuery such as ManagerManager.
Load jQuery in +front-end truetrue || false  Prevent loading jQuery twice if you are already using +it in your site +template.
jQuery noConflict mode in front-endtruetrue || falseDefine +if jQuery should use noConflict mode. NoConflict mode is useful if you +use other JavaScript libraries in front-end such as Mootools.
Load modal box in +front-end truetrue || false  Prevent loading the modal box JavaScript (ColorBox) twice if you are already +using +it in your site +template.
Modal box window width80%number || percentDefine modal box (ColorBox) window width, for example: +800 or 75%.
Modal box window height90%number || percentDefine modal box (ColorBox) window height, for example: +500 or 75%.
Hide document fields from front-end editors parenttextSeparate fields with commas, for example: +parent,template,menuindex
+
+Parent selection doesn't work at all with QuickManager+ due +missing menu tree +frame, so it should be hidden from front-end editors.
+
+Possible fields to hide: content, pagetitle, +longtitle, menuindex, parent, description, alias, link_attributes, +introtext, template, menutitle
+
+NOTICE! Hiding document fields may not work if fields are moved to +other tabs with ManagerManager plugin.
Hide document tabs from front-end +editors
+
textSeparate tabs with commas, for example: settings,access
+
+Possible tabs to hide: general, settings, access
+
+NOTICE! Hiding tabs may not work properly if tab +order is changed with ManagerManager plugin.
Hide document sections from front-end +editors
+
textSeparate sections with commas, for example: +content,tvs
+
+Possible sections to hide: docsettings, content, tvs
+
+NOTICE! Hiding sections may not work properly if you are hiding sections +with ManagerManager plugin.
Show add document here +button truetrue || false  Define if it's possible to add documents with +QuickManager+.
New document template +type parentparent || id || selected How to determine a +new document template:
+
+- parent: Use parent document template
+- id: Use template based on id number
+- selected: Define template based on parent document "inheritTpl" +template variable used by "Inherit Selected Template" plugin http://modxcms.com/extras.html?view=package/view&package=214. +You don't have to install the plugin, but you still have to +have "inheritTpl" template variable on parent document with correct +template id number.
New document template id3numberDefine which template id to use with new documents. +Used only if new +document template type is id.
Custom buttons
+
textDefine custom buttons, for example add document to site +root or add news document
+
+- New document button: 'button title','new','parent +id','template id','visible for user role ids'
+
+- Link button: 'button +title','link','http://www.example.com','','visible for user role ids'
+
+- Modal button: 'button +title','modal','http://www.example.com','','visible for user role ids'
+
MODx link tag, e.g. [~23~], works for link and modal button links.
MODx id tag [*id*] works, e.g. http://www.example.com?refererMODxPageId=[*id*]
+Every custom button has individual CSS class, e.g. qm-custom-"index"
+
+Visible for user role ids: leave empty to accept all roles, role 1 = +Administrator
+
+Separate different buttons with ||
+
+Basic example:
+'Site statistics','link','http://www.google.com/analytics/','',''
+
Advanced example: +
+'New root document','new','0','3',''||'Add +news','new','10','4','4,5,6'||'For admins only','link','[~45~]','','1,4'||'Site +statistics','modal','http://www.google.com/analytics/','','1,4'
Show go to manager +buttontruetrue || falseDefine is go to manager button visible.
Logout tomanagermanager || front-endDefine where to logout: to manager login screen or to +active document +on front-end.
Plugin disabled on documents
+

+
textDocument id numbers where the plugin is disabled.
+Separate fields with commas, for example: +34,22,7,19
Autohide toolbar
+
true
+
true || falseDefine if toolbar hides automatically or is always visible (manually close the toolbar by clicking MODx logo or X button)
+
Inline edit buttons
+
false
+
true || falseDefine if special edit buttons are searched inside content.
+
+Purpose:
+Edit any page from other page, e.g. for editing ditto listings.
+
+How it works:
+- Add anywhere in to your page: <!-- "Edit button CSS class" "document id to be edited" '"Button title"' -->
+- This will create an edit button inside your page when logged in manager
+- For regular visitors it will be shown as a regular HTML comment visible only in the HTML source code
+
+Basic example:
+- Add in to your template <!-- qm-edit 1 'Edit this' -->
+- Creates button to edit page id 1
+
+Advanced example:
+- Add in to your Ditto template chunk: <!-- qm-edit [+id+] 'Edit news item' -->
+- Creates edit buttons for news listings etc. inside the container page
+
+NOTICE! Button title will fail if you use accented characters. Use HTML entities instead, for example &auml;
+
Edit button CSS classqm-edit
+
text
+
Default qm-edit class can be found at: assets/plugins/qm/css/style.css
+
+You can use your own class if you want to make your own edit button or for added security measure.
+
Inline new resource buttonsfalse
+
true || falseDefine if special new resource buttons are searched inside content.
+ +
+ +Purpose:
+ +Create any page from other page, e.g. create new news items.
+ +
+ +How it works:
+ +- Add anywhere in to your page: <!-- "New resource button CSS class" "parent id" "template id" '"Button title"' -->
+ +- This will create an new resource button inside your page when logged in manager
+ +- For regular visitors it will be shown as a regular HTML comment visible only in the HTML source code
+ +
+ +Basic example:
+ +- Add in to your template <!-- qm-new 1 3 'New news item' -->
+ +- Creates new resource button
+- Parent id: 1 (new resource will be created under document id 1)
+- Template id: 3 (uses template id 3)
+- Button title: New news item
+
+NOTICE! Button title will fail if you use accented characters. Use HTML entities instead, for example &auml;
+
New resource button CSS classqm-new
+
text
+
Default qm-new class can be found at: assets/plugins/qm/css/style.css
+ +
+ +You can use your own class if you want to make your own new resource button or for added security measure.
Inline template variable buttonsfalse
+
true || falseDefine if special template variable buttons are searched inside content.
+ +
+ +Purpose:
+ +Edit any template variable.
+ +
+Editable default MODx fields:
+ pagetitle, longtitle, description, content, menutitle, introtext
+
+ +How it works:
+ +- Add anywhere in to your page: [*#tvName*], notice the "#"
+  OR
+ +- Add anywhere in to your page: <!-- "Template variable button CSS class" "tvName" -->
+ +- This will create a template variable button inside your page when logged in manager
+ +- For regular visitors it will be shown as a regular HTML comment visible only in the HTML source code
+ +
+ +Basic example:
+ +- Add in to your template [*#tvName*]
+ +- Creates button to edit tvName template variable (and outputs the template variable)
+ +
+ +Advanced example:
+ +- Add in to your template: <!-- qm-tv tvName -->
+ +- Creates button to edit tvName template variable
+
Template variable button CSS classqm-tvtext
+
Default qm-tv class can be found at: assets/plugins/qm/css/style.css
+ +
+ +You can use your own class if you want to make your own template variable button or for added security measure.
+ +
+ +

How to use

+ +Just login, open frontend and enjoy!
+

+ +Known issues +

+
    +
  • Parent selection is hidden and doesn't work at all with QuickManager+ due +missing menu tree frame.
  • +
+

Special thanks

+
    +
  • QuickManager+ is orginally based on QuickManager by Urique +Dertlian
  • +
  • Template variable editing ideas from QuickEdit by Adam Crownoble
    +
  • +
+ + +

Changelog

+1.5.5 - 12/01/2011
+ + +
    +
  • Changed: QM+ toolbar close button changed to li element for better cross-browser compatibility
    +
  • +
  • Fixed: Multiple little CSS fixes for better protection against global CSS definitions
  • +
+ +1.5.4 - 03/01/2011
+ + +
    +
  • Changed: Updated ColorBox to 1.3.15: http://colorpowered.com/colorbox/
  • +
  • Fixed: Support for jQuery 1.4.4
    +
  • +
  • Fixed: Inline template variable edit/save was still causing error +if "'" mark was used (was affecting pagetitle etc default fields)
  • +
+1.5.3 - 12/10/2010
+ + +
    +
  • Changed: Plugin code checks immeditally at start if user is in manager to save processing time
    +
  • +
  • Fixed: Inline template variable edit/save was causing error if "'" mark was used
    +
  • + +
+1.5.2 - 14/09/2010
+ +
    +
  • Added: CSS classes to toolbar buttons, also li elements: qmCustom, qmManager, qmLogout
  • +
  • Changed: Inline buttons div => span, validates correctly
    +
  • +
  • Fixed: Inline template variable editing when TV type is checkbox
    +
  • +
+1.5.1 - 02/08/2010
+
    +
  • Added: CSS classes to toolbar buttons: qmCustom, qmManager, qmLogout
    +
  • +
  • Fixed: Updated ColorBox to 1.3.9 that solves TinyMCE image align problems with IE6 and IE7
    +
  • +
+1.5
+ +
    +
  • Added: Inline template variable buttons!!! Edit template variables with QuickEdit style. Off by default though.
    +
  • + +
  • Added: OnParseDocument plugin event
  • +
  • Added: Image TV preview
  • +
  • Added: Preserve alias on save
  • +
  • Added: "documentDirty=false;" to cancel button to prevent unnecessary MODx manager alert message
  • +
  • Added: Custom buttons now support standard MODx [*id*] tag, e.g. http://www.example.com?refererMODxPageId=[*id*]
  • +
  • Added: Individual CSS class for every custom button, e.g. qm-custom-"index"
    +
  • + + + + + +
  • Changed: Plugin content
  • +
  • Changed: TV access routine
    +
  • +
  • Fixed: TV edit form button labels
  • +
  • Removed: close.php => now implemented with OnWebPagePrerender event to preserve alias
    +
  • + + +
+1.4.1
+
    +
  • Added: Individual user language check, previously QM+ used global language setting for all users
    +
  • +
  • Changed: Edit buttons in content => Inline edit buttons, New resource buttons in content => Inline new resource buttons
  • +
  • Changed: Inline edit buttons "placeholder markup" changed to: <!-- "Edit button CSS class" "document id to be edited" '"Button title"' -->
  • +
  • Fixed: Inline edit/new buttons access control
    +
  • +
+1.4
+
    +
  • Added: Edit buttons inside content. Edit any page from other page, e.g. for editing ditto listings.
  • +
  • Added: New resource buttons inside content. Create any page from other page, e.g. create new news item.
  • +
  • Added: Custom buttons works now with default MODx links, e.g. [~23~]
    +
  • +
  • Added: Show friendly alias after saving the document. Notice: This is still an experimental feature in is off by default.
    +
  • +
  • Changed: Multiple CSS tweaks mainly for IE
  • +
  • Changed: close.php uses now sessions instead of JavaScript cookies
    +
  • +
  • Fixed: PHP4 support fixed (Thanks yama!)
  • +
  • Fixed: Hiding tabs and sections fixed (access -tab and docsettings -section)
  • +
  • Removed: .htaccess file under qm -folder that was accidentally left there is not needed at all.
    +
  • +
+1.3.4.1
+
    +
  • Changed: CSS tweaks for IE, opacity now works fine with IE8 but unfortunately with IE7 ugly fonts remain (Thanks again uxello!)
  • +
+ + +1.3.4
+ +
    + +
  • Added: Autohide toolbar configuration option
  • +
  • Changed: Updated ColorBox to 1.3.6: http://colorpowered.com/colorbox/
    +
  • +
  • Changed: CSS tweaks, mainly for IE (opacity removed for IE, it breaks cleartype fonts resulting very ugly looking fonts)
  • +
  • Changed: Plugin code moved from text file to this file (Installation / 3. Copy paste plugin code)
    +
  • +
  • Fixed: +Document lock problem solved, now document lock is released when cancel +button is pressed (Thanks uxello for the solution!)
    +
  • +
  • Fixed: Toolbar is now valid XHTML 1.0 Transitional code
  • + +
  • Removed: Unnecessary $disabled variable from edit code
  • +
  • Removed: Images folder, all images are now under css > images
    +
  • + +
+ + +1.3.3
+ +
    + +
  • Added: A fallback to English if the languages are missing in the +Manager/user settings
  • +
  • Added: +Little tweaks with QuickManager action buttons: small hide/show +animations and possibilty to close the menu by clicking the MODx logo
  • +
  • Added: New option for custom buttons: modal = any link opened in +a modal box (ColorBox)
  • +
  • Changed:  Custom buttons separator is now || instead of # +(reserved for URL anchors)
  • +
  • Changed: Rounded modal box is back, finally resolved bugs +with ColorBox CSS in IE and friendly urls
  • +
  • Changed: qm-colorbox.css renamed back to colorbox.css
  • +
  • Fixed: Satinitized possible XSS vulnerabilities
  • +
  • Removed: OnManagerPageInit plugin event removed
  • +
  • Removed: IE6 support dropped, QuickManager+ is not tested with +IE6 as MODx manager doesn't offially support IE6
  • +
+ +1.3.2.1
+ +
    + +
  • Fixed: Language file loading
  • +
+ +1.3.2
+ +
    + +
  • Added: New configuration option - jQuery noConflict mode in +front-end
  • +
  • Added: Check user manager access permissions to current document +and show action buttons according to permissions
  • +
  • Added: It's now possible to hide QM+ action buttons
  • +
  • Added: Hide parent frame scrollbars and QM+ buttons when modal +box is visible (ColorBox bindings)
  • +
  • Added: Modal box can't be accidentally closed by clicking the +overlay
  • +
  • Changed: +Stylish ColorBox CSS style didn't work properly with IE and crashed too +often with Safari, had to replace it with minimalistic style for better +cross-browser compatibility
  • +
  • Changed: Updated ColorBox to version 1.3.1, includes for example +IE ClearType fix (no more ugly fonts)
  • +
  • Changed: colorbox.css renamed to qm-colorbox.css and moved to QM+ +css folder
  • +
  • Fixed: +All normal MODx manager actions including template and RTE selection +works now just fine (thank you very much Susan O. for your ideas!)
  • +
  • Fixed: Multiple small CSS fixes for IE
  • +
  • Fixed: Alias friendly logout code (thanks Mar!)
  • +
  • Fixed: Language selection a bit more robust and offer a level of +fallback
  • +
  • Removed: Use with ManagerManager +plugin  -option deprecated
  • +
+ +1.3.1
+ +
    + +
  • Added: +It's now possible to change template once. After that you can't change +the template again but of course you can press cancel button and try +again.
    +Note: ToDo: Investigate if there is a way to detect parent frame in PHP +to solve this problem
  • +
+ +1.3
+ +
    + +
  • Added: Support for MODx Evolution 1.0.0 version, better +combatibility with MODx Carbon manager theme
  • +
  • Added: Support for jQuery in noConflict mode by default
  • +
  • Added: ColorBox modal box support
  • +
  • Added: Modal box (ColorBox) window width
  • +
  • Added: Modal box (ColorBox) window height
  • +
  • Added: Possibility to add custom link buttons
  • +
  • Removed: Thickbox window max width
  • +
  • Removed: MODx versions below 1.0.0 are not supported due +manager interface changes
  • +
  • Removed: ThickBox modal box support
  • +
+ +1.2
+ +
    + +
  • Added: Plugin disabled option
  • +
  • Added: Show go to manager +button option
  • +
  • Added: Custom add buttons option
  • +
  • Added: Hide document sections from front-end +editors option
  • +
  • Added: Hide document tabs from front-end +editors option
  • +
  • Added: Dynamic ThickBox windows size adjustement, window size is +calculated without refreshing the window
  • +
  • Added: ThickBox window max width option 
  • +
  • Added: Logout to configuration option added, needs +event OnManagerLogout 
  • +
  • Fixed: Documentation changed to html file
  • +
  • Fixed: Clearer plugin folder structure
  • +
  • Fixed: Hiding templates if only one template
  • +
  • Fixed: Load jQuery in +front-end was not working properly
  • +
  • Fixed: mcc.class.php => hideTab & hideSection
  • +
  • Removed: ThickBox windows width and height options removed.
  • +
+ +1.1.1
+ +
    + +
  • Fixed: Logout function changed. Previous version had a problem +with multiple users resulting document locked issues. Now plugin logs +user nicely out to the manager login page.
  • +
+ \ No newline at end of file diff --git a/assets/plugins/tinymce/tiny_mce/plugins/fullpage/css/fullpage.css b/assets/plugins/tinymce/tiny_mce/plugins/fullpage/css/fullpage.css index 2675cec155..28b721f9b3 100644 --- a/assets/plugins/tinymce/tiny_mce/plugins/fullpage/css/fullpage.css +++ b/assets/plugins/tinymce/tiny_mce/plugins/fullpage/css/fullpage.css @@ -1,143 +1,143 @@ -/* Hide the advanced tab */ -#advanced_tab { - display: none; -} - -#metatitle, #metakeywords, #metadescription, #metaauthor, #metacopyright { - width: 280px; -} - -#doctype, #docencoding { - width: 200px; -} - -#langcode { - width: 30px; -} - -#bgimage { - width: 220px; -} - -#fontface { - width: 240px; -} - -#leftmargin, #rightmargin, #topmargin, #bottommargin { - width: 50px; -} - -.panel_wrapper div.current { - height: 400px; -} - -#stylesheet, #style { - width: 240px; -} - -#doctypes { - width: 200px; -} - -/* Head list classes */ - -.headlistwrapper { - width: 100%; -} - -.selected { - border: 1px solid #0A246A; - background-color: #B6BDD2; -} - -.toolbar { - width: 100%; -} - -#headlist { - width: 100%; - margin-top: 3px; - font-size: 11px; -} - -#info, #title_element, #meta_element, #script_element, #style_element, #base_element, #link_element, #comment_element, #unknown_element { - display: none; -} - -#addmenu { - position: absolute; - border: 1px solid gray; - display: none; - z-index: 100; - background-color: white; -} - -#addmenu a { - display: block; - width: 100%; - line-height: 20px; - text-decoration: none; - background-color: white; -} - -#addmenu a:hover { - background-color: #B6BDD2; - color: black; -} - -#addmenu span { - padding-left: 10px; - padding-right: 10px; -} - -#updateElementPanel { - display: none; -} - -#script_element .panel_wrapper div.current { - height: 108px; -} - -#style_element .panel_wrapper div.current { - height: 108px; -} - -#link_element .panel_wrapper div.current { - height: 140px; -} - -#element_script_value { - width: 100%; - height: 100px; -} - -#element_comment_value { - width: 100%; - height: 120px; -} - -#element_style_value { - width: 100%; - height: 100px; -} - -#element_title, #element_script_src, #element_meta_name, #element_meta_content, #element_base_href, #element_link_href, #element_link_title { - width: 250px; -} - -.updateElementButton { - margin-top: 3px; -} - -/* MSIE specific styles */ - -* html .addbutton, * html .removebutton, * html .moveupbutton, * html .movedownbutton { - width: 22px; - height: 22px; -} - -textarea { - height: 55px; -} - +/* Hide the advanced tab */ +#advanced_tab { + display: none; +} + +#metatitle, #metakeywords, #metadescription, #metaauthor, #metacopyright { + width: 280px; +} + +#doctype, #docencoding { + width: 200px; +} + +#langcode { + width: 30px; +} + +#bgimage { + width: 220px; +} + +#fontface { + width: 240px; +} + +#leftmargin, #rightmargin, #topmargin, #bottommargin { + width: 50px; +} + +.panel_wrapper div.current { + height: 400px; +} + +#stylesheet, #style { + width: 240px; +} + +#doctypes { + width: 200px; +} + +/* Head list classes */ + +.headlistwrapper { + width: 100%; +} + +.selected { + border: 1px solid #0A246A; + background-color: #B6BDD2; +} + +.toolbar { + width: 100%; +} + +#headlist { + width: 100%; + margin-top: 3px; + font-size: 11px; +} + +#info, #title_element, #meta_element, #script_element, #style_element, #base_element, #link_element, #comment_element, #unknown_element { + display: none; +} + +#addmenu { + position: absolute; + border: 1px solid gray; + display: none; + z-index: 100; + background-color: white; +} + +#addmenu a { + display: block; + width: 100%; + line-height: 20px; + text-decoration: none; + background-color: white; +} + +#addmenu a:hover { + background-color: #B6BDD2; + color: black; +} + +#addmenu span { + padding-left: 10px; + padding-right: 10px; +} + +#updateElementPanel { + display: none; +} + +#script_element .panel_wrapper div.current { + height: 108px; +} + +#style_element .panel_wrapper div.current { + height: 108px; +} + +#link_element .panel_wrapper div.current { + height: 140px; +} + +#element_script_value { + width: 100%; + height: 100px; +} + +#element_comment_value { + width: 100%; + height: 120px; +} + +#element_style_value { + width: 100%; + height: 100px; +} + +#element_title, #element_script_src, #element_meta_name, #element_meta_content, #element_base_href, #element_link_href, #element_link_title { + width: 250px; +} + +.updateElementButton { + margin-top: 3px; +} + +/* MSIE specific styles */ + +* html .addbutton, * html .removebutton, * html .moveupbutton, * html .movedownbutton { + width: 22px; + height: 22px; +} + +textarea { + height: 55px; +} + .panel_wrapper div.current {height:420px;} \ No newline at end of file diff --git a/assets/plugins/tinymce/tiny_mce/plugins/fullpage/fullpage.htm b/assets/plugins/tinymce/tiny_mce/plugins/fullpage/fullpage.htm index 14ab8652ea..200f2b8e6c 100644 --- a/assets/plugins/tinymce/tiny_mce/plugins/fullpage/fullpage.htm +++ b/assets/plugins/tinymce/tiny_mce/plugins/fullpage/fullpage.htm @@ -1,259 +1,259 @@ - - - - {#fullpage_dlg.title} - - - - - - - -
- - -
-
-
- {#fullpage_dlg.meta_props} - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
 
 
 
 
  - -
-
- -
- {#fullpage_dlg.langprops} - - - - - - - - - - - - - - - - - - - - - - -
- -
  - -
 
- -
 
-
-
- -
-
- {#fullpage_dlg.appearance_textprops} - - - - - - - - - - - - - - - - -
- -
- -
- - - - - -
 
-
-
- -
- {#fullpage_dlg.appearance_bgprops} - - - - - - - - - - -
- - - - - -
 
-
- - - - - -
 
-
-
- -
- {#fullpage_dlg.appearance_marginprops} - - - - - - - - - - - - - - -
-
- -
- {#fullpage_dlg.appearance_linkprops} - - - - - - - - - - - - - - - - - -
- - - - - -
-
- - - - - -
 
-
- - - - - -
 
-
  
-
- -
- {#fullpage_dlg.appearance_style} - - - - - - - - - - -
- - - - -
 
-
-
-
- -
- - -
-
- - + + + + {#fullpage_dlg.title} + + + + + + + +
+ + +
+
+
+ {#fullpage_dlg.meta_props} + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
 
 
 
 
  + +
+
+ +
+ {#fullpage_dlg.langprops} + + + + + + + + + + + + + + + + + + + + + + +
+ +
  + +
 
+ +
 
+
+
+ +
+
+ {#fullpage_dlg.appearance_textprops} + + + + + + + + + + + + + + + + +
+ +
+ +
+ + + + + +
 
+
+
+ +
+ {#fullpage_dlg.appearance_bgprops} + + + + + + + + + + +
+ + + + + +
 
+
+ + + + + +
 
+
+
+ +
+ {#fullpage_dlg.appearance_marginprops} + + + + + + + + + + + + + + +
+
+ +
+ {#fullpage_dlg.appearance_linkprops} + + + + + + + + + + + + + + + + + +
+ + + + + +
+
+ + + + + +
 
+
+ + + + + +
 
+
  
+
+ +
+ {#fullpage_dlg.appearance_style} + + + + + + + + + + +
+ + + + +
 
+
+
+
+ +
+ + +
+
+ + diff --git a/assets/plugins/tinymce/tiny_mce/plugins/fullpage/js/fullpage.js b/assets/plugins/tinymce/tiny_mce/plugins/fullpage/js/fullpage.js index 3f672ad3ba..66eec2d7b4 100644 --- a/assets/plugins/tinymce/tiny_mce/plugins/fullpage/js/fullpage.js +++ b/assets/plugins/tinymce/tiny_mce/plugins/fullpage/js/fullpage.js @@ -1,232 +1,232 @@ -/** - * fullpage.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - tinyMCEPopup.requireLangPack(); - - var defaultDocTypes = - 'XHTML 1.0 Transitional=,' + - 'XHTML 1.0 Frameset=,' + - 'XHTML 1.0 Strict=,' + - 'XHTML 1.1=,' + - 'HTML 4.01 Transitional=,' + - 'HTML 4.01 Strict=,' + - 'HTML 4.01 Frameset='; - - var defaultEncodings = - 'Western european (iso-8859-1)=iso-8859-1,' + - 'Central European (iso-8859-2)=iso-8859-2,' + - 'Unicode (UTF-8)=utf-8,' + - 'Chinese traditional (Big5)=big5,' + - 'Cyrillic (iso-8859-5)=iso-8859-5,' + - 'Japanese (iso-2022-jp)=iso-2022-jp,' + - 'Greek (iso-8859-7)=iso-8859-7,' + - 'Korean (iso-2022-kr)=iso-2022-kr,' + - 'ASCII (us-ascii)=us-ascii'; - - var defaultFontNames = 'Arial=arial,helvetica,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,times new roman,times,serif;Tahoma=tahoma,arial,helvetica,sans-serif;Times New Roman=times new roman,times,serif;Verdana=verdana,arial,helvetica,sans-serif;Impact=impact;WingDings=wingdings'; - var defaultFontSizes = '10px,11px,12px,13px,14px,15px,16px'; - - function setVal(id, value) { - var elm = document.getElementById(id); - - if (elm) { - value = value || ''; - - if (elm.nodeName == "SELECT") - selectByValue(document.forms[0], id, value); - else if (elm.type == "checkbox") - elm.checked = !!value; - else - elm.value = value; - } - }; - - function getVal(id) { - var elm = document.getElementById(id); - - if (elm.nodeName == "SELECT") - return elm.options[elm.selectedIndex].value; - - if (elm.type == "checkbox") - return elm.checked; - - return elm.value; - }; - - window.FullPageDialog = { - changedStyle : function() { - var val, styles = tinyMCEPopup.editor.dom.parseStyle(getVal('style')); - - setVal('fontface', styles['font-face']); - setVal('fontsize', styles['font-size']); - setVal('textcolor', styles['color']); - - if (val = styles['background-image']) - setVal('bgimage', val.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1")); - else - setVal('bgimage', ''); - - setVal('bgcolor', styles['background-color']); - - // Reset margin form elements - setVal('topmargin', ''); - setVal('rightmargin', ''); - setVal('bottommargin', ''); - setVal('leftmargin', ''); - - // Expand margin - if (val = styles['margin']) { - val = val.split(' '); - styles['margin-top'] = val[0] || ''; - styles['margin-right'] = val[1] || val[0] || ''; - styles['margin-bottom'] = val[2] || val[0] || ''; - styles['margin-left'] = val[3] || val[0] || ''; - } - - if (val = styles['margin-top']) - setVal('topmargin', val.replace(/px/, '')); - - if (val = styles['margin-right']) - setVal('rightmargin', val.replace(/px/, '')); - - if (val = styles['margin-bottom']) - setVal('bottommargin', val.replace(/px/, '')); - - if (val = styles['margin-left']) - setVal('leftmargin', val.replace(/px/, '')); - - updateColor('bgcolor_pick', 'bgcolor'); - updateColor('textcolor_pick', 'textcolor'); - }, - - changedStyleProp : function() { - var val, dom = tinyMCEPopup.editor.dom, styles = dom.parseStyle(getVal('style')); - - styles['font-face'] = getVal('fontface'); - styles['font-size'] = getVal('fontsize'); - styles['color'] = getVal('textcolor'); - styles['background-color'] = getVal('bgcolor'); - - if (val = getVal('bgimage')) - styles['background-image'] = "url('" + val + "')"; - else - styles['background-image'] = ''; - - delete styles['margin']; - - if (val = getVal('topmargin')) - styles['margin-top'] = val + "px"; - else - styles['margin-top'] = ''; - - if (val = getVal('rightmargin')) - styles['margin-right'] = val + "px"; - else - styles['margin-right'] = ''; - - if (val = getVal('bottommargin')) - styles['margin-bottom'] = val + "px"; - else - styles['margin-bottom'] = ''; - - if (val = getVal('leftmargin')) - styles['margin-left'] = val + "px"; - else - styles['margin-left'] = ''; - - // Serialize, parse and reserialize this will compress redundant styles - setVal('style', dom.serializeStyle(dom.parseStyle(dom.serializeStyle(styles)))); - this.changedStyle(); - }, - - update : function() { - var data = {}; - - tinymce.each(tinyMCEPopup.dom.select('select,input,textarea'), function(node) { - data[node.id] = getVal(node.id); - }); - - tinyMCEPopup.editor.plugins.fullpage._dataToHtml(data); - tinyMCEPopup.close(); - } - }; - - function init() { - var form = document.forms[0], i, item, list, editor = tinyMCEPopup.editor; - - // Setup doctype select box - list = editor.getParam("fullpage_doctypes", defaultDocTypes).split(','); - for (i = 0; i < list.length; i++) { - item = list[i].split('='); - - if (item.length > 1) - addSelectValue(form, 'doctype', item[0], item[1]); - } - - // Setup fonts select box - list = editor.getParam("fullpage_fonts", defaultFontNames).split(';'); - for (i = 0; i < list.length; i++) { - item = list[i].split('='); - - if (item.length > 1) - addSelectValue(form, 'fontface', item[0], item[1]); - } - - // Setup fontsize select box - list = editor.getParam("fullpage_fontsizes", defaultFontSizes).split(','); - for (i = 0; i < list.length; i++) - addSelectValue(form, 'fontsize', list[i], list[i]); - - // Setup encodings select box - list = editor.getParam("fullpage_encodings", defaultEncodings).split(','); - for (i = 0; i < list.length; i++) { - item = list[i].split('='); - - if (item.length > 1) - addSelectValue(form, 'docencoding', item[0], item[1]); - } - - // Setup color pickers - document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor'); - document.getElementById('link_color_pickcontainer').innerHTML = getColorPickerHTML('link_color_pick','link_color'); - document.getElementById('visited_color_pickcontainer').innerHTML = getColorPickerHTML('visited_color_pick','visited_color'); - document.getElementById('active_color_pickcontainer').innerHTML = getColorPickerHTML('active_color_pick','active_color'); - document.getElementById('textcolor_pickcontainer').innerHTML = getColorPickerHTML('textcolor_pick','textcolor'); - document.getElementById('stylesheet_browsercontainer').innerHTML = getBrowserHTML('stylesheetbrowser','stylesheet','file','fullpage'); - document.getElementById('bgimage_pickcontainer').innerHTML = getBrowserHTML('bgimage_browser','bgimage','image','fullpage'); - - // Resize some elements - if (isVisible('stylesheetbrowser')) - document.getElementById('stylesheet').style.width = '220px'; - - if (isVisible('link_href_browser')) - document.getElementById('element_link_href').style.width = '230px'; - - if (isVisible('bgimage_browser')) - document.getElementById('bgimage').style.width = '210px'; - - // Update form - tinymce.each(tinyMCEPopup.getWindowArg('data'), function(value, key) { - setVal(key, value); - }); - - FullPageDialog.changedStyle(); - - // Update colors - updateColor('textcolor_pick', 'textcolor'); - updateColor('bgcolor_pick', 'bgcolor'); - updateColor('visited_color_pick', 'visited_color'); - updateColor('active_color_pick', 'active_color'); - updateColor('link_color_pick', 'link_color'); - }; - - tinyMCEPopup.onInit.add(init); -})(); +/** + * fullpage.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinyMCEPopup.requireLangPack(); + + var defaultDocTypes = + 'XHTML 1.0 Transitional=,' + + 'XHTML 1.0 Frameset=,' + + 'XHTML 1.0 Strict=,' + + 'XHTML 1.1=,' + + 'HTML 4.01 Transitional=,' + + 'HTML 4.01 Strict=,' + + 'HTML 4.01 Frameset='; + + var defaultEncodings = + 'Western european (iso-8859-1)=iso-8859-1,' + + 'Central European (iso-8859-2)=iso-8859-2,' + + 'Unicode (UTF-8)=utf-8,' + + 'Chinese traditional (Big5)=big5,' + + 'Cyrillic (iso-8859-5)=iso-8859-5,' + + 'Japanese (iso-2022-jp)=iso-2022-jp,' + + 'Greek (iso-8859-7)=iso-8859-7,' + + 'Korean (iso-2022-kr)=iso-2022-kr,' + + 'ASCII (us-ascii)=us-ascii'; + + var defaultFontNames = 'Arial=arial,helvetica,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,times new roman,times,serif;Tahoma=tahoma,arial,helvetica,sans-serif;Times New Roman=times new roman,times,serif;Verdana=verdana,arial,helvetica,sans-serif;Impact=impact;WingDings=wingdings'; + var defaultFontSizes = '10px,11px,12px,13px,14px,15px,16px'; + + function setVal(id, value) { + var elm = document.getElementById(id); + + if (elm) { + value = value || ''; + + if (elm.nodeName == "SELECT") + selectByValue(document.forms[0], id, value); + else if (elm.type == "checkbox") + elm.checked = !!value; + else + elm.value = value; + } + }; + + function getVal(id) { + var elm = document.getElementById(id); + + if (elm.nodeName == "SELECT") + return elm.options[elm.selectedIndex].value; + + if (elm.type == "checkbox") + return elm.checked; + + return elm.value; + }; + + window.FullPageDialog = { + changedStyle : function() { + var val, styles = tinyMCEPopup.editor.dom.parseStyle(getVal('style')); + + setVal('fontface', styles['font-face']); + setVal('fontsize', styles['font-size']); + setVal('textcolor', styles['color']); + + if (val = styles['background-image']) + setVal('bgimage', val.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1")); + else + setVal('bgimage', ''); + + setVal('bgcolor', styles['background-color']); + + // Reset margin form elements + setVal('topmargin', ''); + setVal('rightmargin', ''); + setVal('bottommargin', ''); + setVal('leftmargin', ''); + + // Expand margin + if (val = styles['margin']) { + val = val.split(' '); + styles['margin-top'] = val[0] || ''; + styles['margin-right'] = val[1] || val[0] || ''; + styles['margin-bottom'] = val[2] || val[0] || ''; + styles['margin-left'] = val[3] || val[0] || ''; + } + + if (val = styles['margin-top']) + setVal('topmargin', val.replace(/px/, '')); + + if (val = styles['margin-right']) + setVal('rightmargin', val.replace(/px/, '')); + + if (val = styles['margin-bottom']) + setVal('bottommargin', val.replace(/px/, '')); + + if (val = styles['margin-left']) + setVal('leftmargin', val.replace(/px/, '')); + + updateColor('bgcolor_pick', 'bgcolor'); + updateColor('textcolor_pick', 'textcolor'); + }, + + changedStyleProp : function() { + var val, dom = tinyMCEPopup.editor.dom, styles = dom.parseStyle(getVal('style')); + + styles['font-face'] = getVal('fontface'); + styles['font-size'] = getVal('fontsize'); + styles['color'] = getVal('textcolor'); + styles['background-color'] = getVal('bgcolor'); + + if (val = getVal('bgimage')) + styles['background-image'] = "url('" + val + "')"; + else + styles['background-image'] = ''; + + delete styles['margin']; + + if (val = getVal('topmargin')) + styles['margin-top'] = val + "px"; + else + styles['margin-top'] = ''; + + if (val = getVal('rightmargin')) + styles['margin-right'] = val + "px"; + else + styles['margin-right'] = ''; + + if (val = getVal('bottommargin')) + styles['margin-bottom'] = val + "px"; + else + styles['margin-bottom'] = ''; + + if (val = getVal('leftmargin')) + styles['margin-left'] = val + "px"; + else + styles['margin-left'] = ''; + + // Serialize, parse and reserialize this will compress redundant styles + setVal('style', dom.serializeStyle(dom.parseStyle(dom.serializeStyle(styles)))); + this.changedStyle(); + }, + + update : function() { + var data = {}; + + tinymce.each(tinyMCEPopup.dom.select('select,input,textarea'), function(node) { + data[node.id] = getVal(node.id); + }); + + tinyMCEPopup.editor.plugins.fullpage._dataToHtml(data); + tinyMCEPopup.close(); + } + }; + + function init() { + var form = document.forms[0], i, item, list, editor = tinyMCEPopup.editor; + + // Setup doctype select box + list = editor.getParam("fullpage_doctypes", defaultDocTypes).split(','); + for (i = 0; i < list.length; i++) { + item = list[i].split('='); + + if (item.length > 1) + addSelectValue(form, 'doctype', item[0], item[1]); + } + + // Setup fonts select box + list = editor.getParam("fullpage_fonts", defaultFontNames).split(';'); + for (i = 0; i < list.length; i++) { + item = list[i].split('='); + + if (item.length > 1) + addSelectValue(form, 'fontface', item[0], item[1]); + } + + // Setup fontsize select box + list = editor.getParam("fullpage_fontsizes", defaultFontSizes).split(','); + for (i = 0; i < list.length; i++) + addSelectValue(form, 'fontsize', list[i], list[i]); + + // Setup encodings select box + list = editor.getParam("fullpage_encodings", defaultEncodings).split(','); + for (i = 0; i < list.length; i++) { + item = list[i].split('='); + + if (item.length > 1) + addSelectValue(form, 'docencoding', item[0], item[1]); + } + + // Setup color pickers + document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor'); + document.getElementById('link_color_pickcontainer').innerHTML = getColorPickerHTML('link_color_pick','link_color'); + document.getElementById('visited_color_pickcontainer').innerHTML = getColorPickerHTML('visited_color_pick','visited_color'); + document.getElementById('active_color_pickcontainer').innerHTML = getColorPickerHTML('active_color_pick','active_color'); + document.getElementById('textcolor_pickcontainer').innerHTML = getColorPickerHTML('textcolor_pick','textcolor'); + document.getElementById('stylesheet_browsercontainer').innerHTML = getBrowserHTML('stylesheetbrowser','stylesheet','file','fullpage'); + document.getElementById('bgimage_pickcontainer').innerHTML = getBrowserHTML('bgimage_browser','bgimage','image','fullpage'); + + // Resize some elements + if (isVisible('stylesheetbrowser')) + document.getElementById('stylesheet').style.width = '220px'; + + if (isVisible('link_href_browser')) + document.getElementById('element_link_href').style.width = '230px'; + + if (isVisible('bgimage_browser')) + document.getElementById('bgimage').style.width = '210px'; + + // Update form + tinymce.each(tinyMCEPopup.getWindowArg('data'), function(value, key) { + setVal(key, value); + }); + + FullPageDialog.changedStyle(); + + // Update colors + updateColor('textcolor_pick', 'textcolor'); + updateColor('bgcolor_pick', 'bgcolor'); + updateColor('visited_color_pick', 'visited_color'); + updateColor('active_color_pick', 'active_color'); + updateColor('link_color_pick', 'link_color'); + }; + + tinyMCEPopup.onInit.add(init); +})(); From 28ddd43038e4699befc6d84891c93d075027789c Mon Sep 17 00:00:00 2001 From: yama Date: Sat, 20 Apr 2013 19:31:22 +0900 Subject: [PATCH 004/530] Refactor #9861 Should be core files line feed code is "lf" (part 3) http://tracker.modx.com/issues/9861 --- .../modules/docmanager/lang/english.inc.php | 324 +++++++++--------- .../docmanager/lang/japanese-utf8.inc.php | 322 ++++++++--------- .../docmanager/lang/russian-UTF8.inc.php | 324 +++++++++--------- 3 files changed, 485 insertions(+), 485 deletions(-) diff --git a/assets/modules/docmanager/lang/english.inc.php b/assets/modules/docmanager/lang/english.inc.php index f5e44bc31b..199306a556 100644 --- a/assets/modules/docmanager/lang/english.inc.php +++ b/assets/modules/docmanager/lang/english.inc.php @@ -1,162 +1,162 @@ -Key (where n is a document ID number):

- n* - Change setting for this document and immediate children
- n** - Change setting for this document and ALL children
- n-n2 - Change setting for this range of documents
- n - Change setting for a single document

-

Example: 1*,4**,2-20,25 - This will change the selected setting - for documents 1 and its children, document 4 and all children, documents 2 - through 20 and document 25.

'; -$_lang['DM_select_tree'] ='View and select documents using the Document Tree'; - -//-- process tree/range messages -$_lang['DM_process_noselection'] = 'No selection was made. '; -$_lang['DM_process_novalues'] = 'No values have been specified.'; -$_lang['DM_process_limits_error'] = 'Upper limit less than lower limit:'; -$_lang['DM_process_invalid_error'] = 'Invalid Value:'; -$_lang['DM_process_update_success'] = 'Update was completed successfully, with no errors.'; -$_lang['DM_process_update_error'] = 'Update has completed but encountered errors:'; -$_lang['DM_process_back'] = 'Back'; - -//-- manager access logging -$_lang['DM_log_template'] = 'Document Manager: Templates changed.'; -$_lang['DM_log_templatevariables'] = 'Document Manager: Template variables changed.'; -$_lang['DM_log_docpermissions'] ='Document Manager: Document Permissions changed.'; -$_lang['DM_log_sortmenu']='Document Manager: Menu Index operation completed.'; -$_lang['DM_log_publish']='Document Manager: Document Manager: Documents Published/Unpublished settings changed.'; -$_lang['DM_log_hidemenu']='Document Manager: Documents Hide/Show in Menu settings changed.'; -$_lang['DM_log_search']='Document Manager: Documents Searchable/Unsearchable settings changed.'; -$_lang['DM_log_cache']='Document Manager: Documents Cacheable/Uncacheable settings changed.'; -$_lang['DM_log_richtext']='Document Manager: Documents Use Richtext Editor settings changed.'; -$_lang['DM_log_delete']='Document Manager: Documents Delete/Undelete settings changed.'; -$_lang['DM_log_dates']='Document Manager: Documents Date settings changed.'; -$_lang['DM_log_authors']='Document Manager: Documents Author settings changed.'; - -?> +Key (where n is a document ID number):

+ n* - Change setting for this document and immediate children
+ n** - Change setting for this document and ALL children
+ n-n2 - Change setting for this range of documents
+ n - Change setting for a single document

+

Example: 1*,4**,2-20,25 - This will change the selected setting + for documents 1 and its children, document 4 and all children, documents 2 + through 20 and document 25.

'; +$_lang['DM_select_tree'] ='View and select documents using the Document Tree'; + +//-- process tree/range messages +$_lang['DM_process_noselection'] = 'No selection was made. '; +$_lang['DM_process_novalues'] = 'No values have been specified.'; +$_lang['DM_process_limits_error'] = 'Upper limit less than lower limit:'; +$_lang['DM_process_invalid_error'] = 'Invalid Value:'; +$_lang['DM_process_update_success'] = 'Update was completed successfully, with no errors.'; +$_lang['DM_process_update_error'] = 'Update has completed but encountered errors:'; +$_lang['DM_process_back'] = 'Back'; + +//-- manager access logging +$_lang['DM_log_template'] = 'Document Manager: Templates changed.'; +$_lang['DM_log_templatevariables'] = 'Document Manager: Template variables changed.'; +$_lang['DM_log_docpermissions'] ='Document Manager: Document Permissions changed.'; +$_lang['DM_log_sortmenu']='Document Manager: Menu Index operation completed.'; +$_lang['DM_log_publish']='Document Manager: Document Manager: Documents Published/Unpublished settings changed.'; +$_lang['DM_log_hidemenu']='Document Manager: Documents Hide/Show in Menu settings changed.'; +$_lang['DM_log_search']='Document Manager: Documents Searchable/Unsearchable settings changed.'; +$_lang['DM_log_cache']='Document Manager: Documents Cacheable/Uncacheable settings changed.'; +$_lang['DM_log_richtext']='Document Manager: Documents Use Richtext Editor settings changed.'; +$_lang['DM_log_delete']='Document Manager: Documents Delete/Undelete settings changed.'; +$_lang['DM_log_dates']='Document Manager: Documents Date settings changed.'; +$_lang['DM_log_authors']='Document Manager: Documents Author settings changed.'; + +?> diff --git a/assets/modules/docmanager/lang/japanese-utf8.inc.php b/assets/modules/docmanager/lang/japanese-utf8.inc.php index 193f32055b..0b3f8657bd 100755 --- a/assets/modules/docmanager/lang/japanese-utf8.inc.php +++ b/assets/modules/docmanager/lang/japanese-utf8.inc.php @@ -1,162 +1,162 @@ -サイトルートか、並べ替えたい範囲の親リソース(コンテナ)をクリックしてください。'; -$_lang['DM_sort_updating'] = '更新中 ...'; -$_lang['DM_sort_updated'] = '更新しました。「閉じる」または「戻る」ボタンをクリックしてください。'; -$_lang['DM_sort_nochildren'] = 'このリソースにはサブリソースがありません。'; -$_lang['DM_sort_noid']='リソースが選択されていません。戻ってリソースを選択してください。'; - -//-- other tab -$_lang['DM_other_header'] = 'リソースの各種設定'; -$_lang['DM_misc_label'] = '変更対象の設定:'; -$_lang['DM_misc_desc'] = '変更する設定をドロップダウンメニューから選択してください。そして必要なオプションを指定します。一度にひとつの設定しか変更できません。'; - -$_lang['DM_other_dropdown_publish'] = '公開/非公開'; -$_lang['DM_other_dropdown_show'] = 'メニューに表示/非表示'; -$_lang['DM_other_dropdown_search'] = '検索対象/非対象'; -$_lang['DM_other_dropdown_cache'] = 'キャッシュ/不可'; -$_lang['DM_other_dropdown_richtext'] = 'エディタ/なし'; -$_lang['DM_other_dropdown_delete'] = '削除/復活'; - -//-- radio button text -$_lang['DM_other_publish_radio1'] = '公開'; -$_lang['DM_other_publish_radio2'] = '非公開'; -$_lang['DM_other_show_radio1'] = 'メニューから隠す'; -$_lang['DM_other_show_radio2'] = 'メニューに表示'; -$_lang['DM_other_search_radio1'] = '検索対象'; -$_lang['DM_other_search_radio2'] = '検索しない'; -$_lang['DM_other_cache_radio1'] = 'キャッシュする'; -$_lang['DM_other_cache_radio2'] = 'キャッシュしない'; -$_lang['DM_other_richtext_radio1'] = 'エディタ使用'; -$_lang['DM_other_richtext_radio2'] = 'エディタ不要'; -$_lang['DM_other_delete_radio1'] = '削除'; -$_lang['DM_other_delete_radio2'] = '削除から復活'; - -//-- adjust dates -$_lang['DM_adjust_dates_header'] = 'リソースの各種日時設定'; -$_lang['DM_adjust_dates_desc'] = '複数のリソースの日時設定をまとめて変更できます。'; -$_lang['DM_view_calendar'] = 'カレンダーを表示'; -$_lang['DM_clear_date'] = 'リセット'; - -//-- adjust authors -$_lang['DM_adjust_authors_header'] = '作成者などの設定'; -$_lang['DM_adjust_authors_desc'] = 'リソースの作成者/編集者をリストから選んでください'; -$_lang['DM_adjust_authors_createdby'] = '作成者:'; -$_lang['DM_adjust_authors_editedby'] = '編集者:'; -$_lang['DM_adjust_authors_noselection'] = '変更なし'; - - //-- labels -$_lang['DM_date_pubdate'] = '公開日時:'; -$_lang['DM_date_unpubdate'] = '公開終了日時:'; -$_lang['DM_date_createdon'] = '作成日時:'; -$_lang['DM_date_editedon'] = '編集日時:'; -//$_lang['DM_date_deletedon'] = 'Deleted On Date'; - -$_lang['DM_date_notset'] = ' (変更しません)'; -//deprecated -$_lang['DM_date_dateselect_label'] = '日付を選択: '; - -//-- document select section -$_lang['DM_select_submit'] = '適用'; -$_lang['DM_select_range'] = 'ID指定画面に戻ります'; -$_lang['DM_select_range_text'] = '

指定方法(n、m はリソースIDを示す数字です):

-
  • n*  - その親リソース(コンテナ)と直下のサブリソースを意味する指定
  • -
  • n** - その親リソース(コンテナ)と配下の子、孫など全てのリソースを意味する指定
  • -
  • n-m - n から m までのIDの範囲を意味る指定。n、m を含みます
  • -
  • n   - IDがnの1つのリソースを意味する指定
  • -
  • 例:1*,4**,2-20,25 - この指定では、1、1のサブリソース、4、4の全配下リソース、 - 2から20までの19個のリソース及び25 の各IDのリソースが指定されています。
'; -$_lang['DM_select_tree'] ='ツリー表示からリソースを選択します'; - -//-- process tree/range messages -$_lang['DM_process_noselection'] = '必要な指定がされていません。'; -$_lang['DM_process_novalues'] = '値が指定されていませんでした。'; -$_lang['DM_process_limits_error'] = '上限が下限よりも小さいです:'; -$_lang['DM_process_invalid_error'] = '値がイレギュラーです '; -$_lang['DM_process_update_success'] = '変更は無事完了しました。'; -$_lang['DM_process_update_error'] = '変更は完了しましたが、エラーがありました:'; -$_lang['DM_process_back'] = '戻る'; - -//-- manager access logging -$_lang['DM_log_template'] = 'Doc Manager: テンプレートを変更しました。'; -$_lang['DM_log_templatevariables'] = 'Doc Manager: テンプレート変数を変更しました。'; -$_lang['DM_log_docpermissions'] ='Doc Manager: リソースのアクセス制限を変更しました。'; -$_lang['DM_log_sortmenu']='Document Manager: メニューインデックス操作を完了しました。'; -$_lang['DM_log_publish']='Document Manager: リソースの公開/非公開を変更しました。'; -$_lang['DM_log_hidemenu']='Document Manager: リソースのメニュー表示/非表示を変更しました。'; -$_lang['DM_log_search']='Document Manager: リソースの検索対象/非対象を変更しました。'; -$_lang['DM_log_cache']='Document Manager: リソースのキャッシュ可/不可を変更しました。'; -$_lang['DM_log_richtext']='Document Manager: リソースのリッチテキストエディタの設定を変更しました。'; -$_lang['DM_log_delete']='Document Manager: リソースの削除/復活を変更しました。'; -$_lang['DM_log_dates']='Document Manager: リソースの各種日付を変更しました。'; -$_lang['DM_log_authors']='Document Manager: リソースの作成者などの情報を変更しました。'; - +サイトルートか、並べ替えたい範囲の親リソース(コンテナ)をクリックしてください。'; +$_lang['DM_sort_updating'] = '更新中 ...'; +$_lang['DM_sort_updated'] = '更新しました。「閉じる」または「戻る」ボタンをクリックしてください。'; +$_lang['DM_sort_nochildren'] = 'このリソースにはサブリソースがありません。'; +$_lang['DM_sort_noid']='リソースが選択されていません。戻ってリソースを選択してください。'; + +//-- other tab +$_lang['DM_other_header'] = 'リソースの各種設定'; +$_lang['DM_misc_label'] = '変更対象の設定:'; +$_lang['DM_misc_desc'] = '変更する設定をドロップダウンメニューから選択してください。そして必要なオプションを指定します。一度にひとつの設定しか変更できません。'; + +$_lang['DM_other_dropdown_publish'] = '公開/非公開'; +$_lang['DM_other_dropdown_show'] = 'メニューに表示/非表示'; +$_lang['DM_other_dropdown_search'] = '検索対象/非対象'; +$_lang['DM_other_dropdown_cache'] = 'キャッシュ/不可'; +$_lang['DM_other_dropdown_richtext'] = 'エディタ/なし'; +$_lang['DM_other_dropdown_delete'] = '削除/復活'; + +//-- radio button text +$_lang['DM_other_publish_radio1'] = '公開'; +$_lang['DM_other_publish_radio2'] = '非公開'; +$_lang['DM_other_show_radio1'] = 'メニューから隠す'; +$_lang['DM_other_show_radio2'] = 'メニューに表示'; +$_lang['DM_other_search_radio1'] = '検索対象'; +$_lang['DM_other_search_radio2'] = '検索しない'; +$_lang['DM_other_cache_radio1'] = 'キャッシュする'; +$_lang['DM_other_cache_radio2'] = 'キャッシュしない'; +$_lang['DM_other_richtext_radio1'] = 'エディタ使用'; +$_lang['DM_other_richtext_radio2'] = 'エディタ不要'; +$_lang['DM_other_delete_radio1'] = '削除'; +$_lang['DM_other_delete_radio2'] = '削除から復活'; + +//-- adjust dates +$_lang['DM_adjust_dates_header'] = 'リソースの各種日時設定'; +$_lang['DM_adjust_dates_desc'] = '複数のリソースの日時設定をまとめて変更できます。'; +$_lang['DM_view_calendar'] = 'カレンダーを表示'; +$_lang['DM_clear_date'] = 'リセット'; + +//-- adjust authors +$_lang['DM_adjust_authors_header'] = '作成者などの設定'; +$_lang['DM_adjust_authors_desc'] = 'リソースの作成者/編集者をリストから選んでください'; +$_lang['DM_adjust_authors_createdby'] = '作成者:'; +$_lang['DM_adjust_authors_editedby'] = '編集者:'; +$_lang['DM_adjust_authors_noselection'] = '変更なし'; + + //-- labels +$_lang['DM_date_pubdate'] = '公開日時:'; +$_lang['DM_date_unpubdate'] = '公開終了日時:'; +$_lang['DM_date_createdon'] = '作成日時:'; +$_lang['DM_date_editedon'] = '編集日時:'; +//$_lang['DM_date_deletedon'] = 'Deleted On Date'; + +$_lang['DM_date_notset'] = ' (変更しません)'; +//deprecated +$_lang['DM_date_dateselect_label'] = '日付を選択: '; + +//-- document select section +$_lang['DM_select_submit'] = '適用'; +$_lang['DM_select_range'] = 'ID指定画面に戻ります'; +$_lang['DM_select_range_text'] = '

指定方法(n、m はリソースIDを示す数字です):

+
  • n*  - その親リソース(コンテナ)と直下のサブリソースを意味する指定
  • +
  • n** - その親リソース(コンテナ)と配下の子、孫など全てのリソースを意味する指定
  • +
  • n-m - n から m までのIDの範囲を意味る指定。n、m を含みます
  • +
  • n   - IDがnの1つのリソースを意味する指定
  • +
  • 例:1*,4**,2-20,25 - この指定では、1、1のサブリソース、4、4の全配下リソース、 + 2から20までの19個のリソース及び25 の各IDのリソースが指定されています。
'; +$_lang['DM_select_tree'] ='ツリー表示からリソースを選択します'; + +//-- process tree/range messages +$_lang['DM_process_noselection'] = '必要な指定がされていません。'; +$_lang['DM_process_novalues'] = '値が指定されていませんでした。'; +$_lang['DM_process_limits_error'] = '上限が下限よりも小さいです:'; +$_lang['DM_process_invalid_error'] = '値がイレギュラーです '; +$_lang['DM_process_update_success'] = '変更は無事完了しました。'; +$_lang['DM_process_update_error'] = '変更は完了しましたが、エラーがありました:'; +$_lang['DM_process_back'] = '戻る'; + +//-- manager access logging +$_lang['DM_log_template'] = 'Doc Manager: テンプレートを変更しました。'; +$_lang['DM_log_templatevariables'] = 'Doc Manager: テンプレート変数を変更しました。'; +$_lang['DM_log_docpermissions'] ='Doc Manager: リソースのアクセス制限を変更しました。'; +$_lang['DM_log_sortmenu']='Document Manager: メニューインデックス操作を完了しました。'; +$_lang['DM_log_publish']='Document Manager: リソースの公開/非公開を変更しました。'; +$_lang['DM_log_hidemenu']='Document Manager: リソースのメニュー表示/非表示を変更しました。'; +$_lang['DM_log_search']='Document Manager: リソースの検索対象/非対象を変更しました。'; +$_lang['DM_log_cache']='Document Manager: リソースのキャッシュ可/不可を変更しました。'; +$_lang['DM_log_richtext']='Document Manager: リソースのリッチテキストエディタの設定を変更しました。'; +$_lang['DM_log_delete']='Document Manager: リソースの削除/復活を変更しました。'; +$_lang['DM_log_dates']='Document Manager: リソースの各種日付を変更しました。'; +$_lang['DM_log_authors']='Document Manager: リソースの作成者などの情報を変更しました。'; + ?> \ No newline at end of file diff --git a/assets/modules/docmanager/lang/russian-UTF8.inc.php b/assets/modules/docmanager/lang/russian-UTF8.inc.php index 7200da9692..8913928d7d 100755 --- a/assets/modules/docmanager/lang/russian-UTF8.inc.php +++ b/assets/modules/docmanager/lang/russian-UTF8.inc.php @@ -1,163 +1,163 @@ -Можно использовать следующий синтаксис при задании диапазона (вместо "n" указывайте число ID ресурса):

-
    -
  • n* - изменить свойства ресурса с ID=n и непосредственных дочерних ресурсов;
  • -
  • n** - изменить свойства ресурса с ID=n и ВСЕХ его дочерних ресурсов;
  • -
  • n-n2 - изменить свойства для всех ресурсов, ID которых находятся в указанном диапазоне;
  • -
  • n - изменить свойства для одного ресурса с ID=n;
  • -
  • n*,n**,n-n2,n - можно сразу указать несколько диапазонов, разделяя их запятыми.
  • -

Пример: 1*,4**,2-20,25 - будут изменены свойства для ресурса с ID=1 и его непосредственных дочерних ресурсов, ресурса с ID=4 и всех его дочерних ресурсов, ресурсов с ID в диапазоне от 2 до 20, и ресурса с ID=25.

'; -$_lang['DM_select_tree'] = 'Просмотреть и выбрать ресурсы в дереве'; - -//-- process tree/range messages -$_lang['DM_process_noselection'] = 'Ничего не выбрано. '; -$_lang['DM_process_novalues'] = 'Никаких значений не задано.'; -$_lang['DM_process_limits_error'] = 'Верхняя граница диапазона меньше нижней границы:'; -$_lang['DM_process_invalid_error'] = 'Недопустимое значение:'; -$_lang['DM_process_update_success'] = 'Изменение прошло успешно.'; -$_lang['DM_process_update_error'] = 'Изменение завершено с ошибками:'; -$_lang['DM_process_back'] = 'Назад'; - -//-- manager access logging -$_lang['DM_log_template'] = 'Менеджер ресурсов: шаблоны изменены.'; -$_lang['DM_log_templatevariables'] = 'Менеджер ресурсов: параметры (TV) изменены.'; -$_lang['DM_log_docpermissions'] = 'Менеджер ресурсов: права на ресурсы изменены.'; -$_lang['DM_log_sortmenu'] = 'Менеджер ресурсов: изменение индексов пунктов меню завершено.'; -$_lang['DM_log_publish'] = 'Менеджер ресурсов: свойство ресурсов "Опубликовать / Отменить публикацию" изменено.'; -$_lang['DM_log_hidemenu'] = 'Менеджер ресурсов: свойство ресурсов "Показывать / Не показывать в меню" изменено.'; -$_lang['DM_log_search'] = 'Менеджер ресурсов: свойство ресурсов "Разрешить / Запретить поиск в содержимом" изменено.'; -$_lang['DM_log_cache'] = 'Менеджер ресурсов: свойство ресурсов "Кэшировать / Не кэшировать" изменено.'; -$_lang['DM_log_richtext'] = 'Менеджер ресурсов: свойство ресурсов "Использовать / Не использовать HTML-редактор" изменено.'; -$_lang['DM_log_delete'] = 'Менеджер ресурсов: удаление / отмена удаления прошла успешно.'; -$_lang['DM_log_dates'] = 'Менеджер ресурсов: даты ресурсов изменены.'; -$_lang['DM_log_authors'] = 'Менеджер ресурсов: авторы ресурсов изменены.'; - +Можно использовать следующий синтаксис при задании диапазона (вместо "n" указывайте число ID ресурса):

+
    +
  • n* - изменить свойства ресурса с ID=n и непосредственных дочерних ресурсов;
  • +
  • n** - изменить свойства ресурса с ID=n и ВСЕХ его дочерних ресурсов;
  • +
  • n-n2 - изменить свойства для всех ресурсов, ID которых находятся в указанном диапазоне;
  • +
  • n - изменить свойства для одного ресурса с ID=n;
  • +
  • n*,n**,n-n2,n - можно сразу указать несколько диапазонов, разделяя их запятыми.
  • +

Пример: 1*,4**,2-20,25 - будут изменены свойства для ресурса с ID=1 и его непосредственных дочерних ресурсов, ресурса с ID=4 и всех его дочерних ресурсов, ресурсов с ID в диапазоне от 2 до 20, и ресурса с ID=25.

'; +$_lang['DM_select_tree'] = 'Просмотреть и выбрать ресурсы в дереве'; + +//-- process tree/range messages +$_lang['DM_process_noselection'] = 'Ничего не выбрано. '; +$_lang['DM_process_novalues'] = 'Никаких значений не задано.'; +$_lang['DM_process_limits_error'] = 'Верхняя граница диапазона меньше нижней границы:'; +$_lang['DM_process_invalid_error'] = 'Недопустимое значение:'; +$_lang['DM_process_update_success'] = 'Изменение прошло успешно.'; +$_lang['DM_process_update_error'] = 'Изменение завершено с ошибками:'; +$_lang['DM_process_back'] = 'Назад'; + +//-- manager access logging +$_lang['DM_log_template'] = 'Менеджер ресурсов: шаблоны изменены.'; +$_lang['DM_log_templatevariables'] = 'Менеджер ресурсов: параметры (TV) изменены.'; +$_lang['DM_log_docpermissions'] = 'Менеджер ресурсов: права на ресурсы изменены.'; +$_lang['DM_log_sortmenu'] = 'Менеджер ресурсов: изменение индексов пунктов меню завершено.'; +$_lang['DM_log_publish'] = 'Менеджер ресурсов: свойство ресурсов "Опубликовать / Отменить публикацию" изменено.'; +$_lang['DM_log_hidemenu'] = 'Менеджер ресурсов: свойство ресурсов "Показывать / Не показывать в меню" изменено.'; +$_lang['DM_log_search'] = 'Менеджер ресурсов: свойство ресурсов "Разрешить / Запретить поиск в содержимом" изменено.'; +$_lang['DM_log_cache'] = 'Менеджер ресурсов: свойство ресурсов "Кэшировать / Не кэшировать" изменено.'; +$_lang['DM_log_richtext'] = 'Менеджер ресурсов: свойство ресурсов "Использовать / Не использовать HTML-редактор" изменено.'; +$_lang['DM_log_delete'] = 'Менеджер ресурсов: удаление / отмена удаления прошла успешно.'; +$_lang['DM_log_dates'] = 'Менеджер ресурсов: даты ресурсов изменены.'; +$_lang['DM_log_authors'] = 'Менеджер ресурсов: авторы ресурсов изменены.'; + ?> \ No newline at end of file From 72f6068a71856853b8d05f29d1d28f2dab3ae3bd Mon Sep 17 00:00:00 2001 From: yama Date: Sat, 20 Apr 2013 19:31:36 +0900 Subject: [PATCH 005/530] Refactor #9861 Should be core files line feed code is "lf" (part 4) http://tracker.modx.com/issues/9861 --- manager/frames/1.php | 72 +- manager/includes/session_keepalive.php | 42 +- .../php/Commands/GetFoldersAndFiles.php | 368 +++++----- manager/media/style/common/login.tpl | 688 +++++++++--------- 4 files changed, 585 insertions(+), 585 deletions(-) diff --git a/manager/frames/1.php b/manager/frames/1.php index 05692303bf..b33848b85f 100755 --- a/manager/frames/1.php +++ b/manager/frames/1.php @@ -1,36 +1,36 @@ -INCLUDE_ORDERING_ERROR

Please use the MODx Content Manager instead of accessing this file directly."); -include_once ("browsercheck.inc.php"); -$browser = $client->property('browser'); -$_SESSION['browser'] = $browser; -$version = $client->property('version'); -$_SESSION['browser_version'] = $version; -$mxla = $modx_lang_attribute ? $modx_lang_attribute : 'en'; -if(!isset($modx->config['manager_menu_height'])) $modx->config['manager_menu_height'] = '70'; -if(!isset($modx->config['manager_tree_width'])) $modx->config['manager_tree_width'] = '260'; -?> - -> - - <?php echo $site_name?> - (MODX CMS Manager) - - - - - - - - - - - - - - - -This software requires a browser with support for frames. - +INCLUDE_ORDERING_ERROR

Please use the MODx Content Manager instead of accessing this file directly."); +include_once ("browsercheck.inc.php"); +$browser = $client->property('browser'); +$_SESSION['browser'] = $browser; +$version = $client->property('version'); +$_SESSION['browser_version'] = $version; +$mxla = $modx_lang_attribute ? $modx_lang_attribute : 'en'; +if(!isset($modx->config['manager_menu_height'])) $modx->config['manager_menu_height'] = '70'; +if(!isset($modx->config['manager_tree_width'])) $modx->config['manager_tree_width'] = '260'; +?> + +> + + <?php echo $site_name?> - (MODX CMS Manager) + + + + + + + + + + + + + + + +This software requires a browser with support for frames. + diff --git a/manager/includes/session_keepalive.php b/manager/includes/session_keepalive.php index 21a4fe47fc..19d9417424 100644 --- a/manager/includes/session_keepalive.php +++ b/manager/includes/session_keepalive.php @@ -1,21 +1,21 @@ -fckphp_config=$fckphp_config; - $this->type=$type; - $this->raw_cwd=$cwd; - $this->actual_cwd=str_replace("//","/",($fckphp_config['UserFilesPath']."/$type/".$this->raw_cwd)); - $this->real_cwd=str_replace("//","/",($this->fckphp_config['basedir']."/".$this->actual_cwd)); - } - - function run() { - - header ("Content-Type: application/xml; charset=utf-8"); - echo "\n"; - ?> - - - - - - - - - - - - - - - - - - - - -] > - - - - -real_cwd)) { - - /** - * Initiate the array to store the foldernames - */ - $folders_array = array(); - - while (($filename=readdir($dh))!==false) { - - if (($filename!=".")&&($filename!="..")) { - if (is_dir($this->real_cwd."/$filename")) { - //check if$fckphp_configured not to show this folder - $hide=false; - for($i=0;$ifckphp_config['ResourceAreas'][$this->type]['HideFolders']);$i++) - $hide=(preg_match("/".$this->fckphp_config['ResourceAreas'][$this->type]['HideFolders'][$i]."/",$filename)?true:$hide); - - /** - * Dont echo the entry, push it in the array - */ - //if (!$hide) echo "\t\t\n"; - if (!$hide) array_push($folders_array,$filename); - - } else { - array_push($files,$filename); - } - } - } - closedir($dh); - - /** - * Sort the array by the way you like and show it. - */ - natcasesort($folders_array); - foreach($folders_array as $k=>$v) - { - echo ''."\n"; - } - - } - - echo "\t\n"; - echo "\t\n"; - - /** - * The filenames are in the array $files - * SORT IT! - */ - natcasesort($files); - $files = array_values($files); - - for ($i=0;$ifckphp_config['ResourceAreas'][$this->type]['AllowedExtensions'])) { - - //check if$fckphp_configured not to show this file - $editable=$hide=false; - for($j=0;$jfckphp_config['ResourceAreas'][$this->type]['HideFiles']);$j++) - $hide=(preg_match("/".$this->fckphp_config['ResourceAreas'][$this->type]['HideFiles'][$j]."/",$files[$i])?true:$hide); - - if (!$hide) { - if ($this->fckphp_config['ResourceAreas'][$this->type]['AllowImageEditing']) - $editable=$this->isImageEditable($this->real_cwd."/".$files[$i]); - - if(extension_loaded('mbstring')) { - $name = mb_convert_encoding($files [$i] , 'UTF-8', mb_detect_encoding($files[$i] , 'UTF-8, windows-1251, ASCII, ISO-8859-1')); - } else { - $name = $files[$i]; - } - // $this->fckphp_config['modx']['charset'] if needed - echo "\t\treal_cwd."/".$files [$i] )/1024)."\" editable=\"" . ( $editable?"1":"0" ) . "\" />\n"; - } - - } - - } - - echo "\t\n"; - echo "\n"; - } - - - function isImageEditable($file) { - $fh=fopen($file,"r"); - if ($fh) { - $start4=fread($fh,4); - fclose($fh); - - $start3=substr($start4,0,3); - - if ($start4=="\x89PNG") { //PNG - return (function_exists("imagecreatefrompng") && function_exists("imagepng")); - - } elseif ($start3=="GIF") { //GIF - return (function_exists("imagecreatefromgif") && function_exists("imagegif")); - - } elseif ($start3=="\xFF\xD8\xFF") { //JPEG - return (function_exists("imagecreatefromjpeg")&& function_exists("imagejpeg")); - - } elseif ($start4=="hsi1") { //JPEG - return (function_exists("imagecreatefromjpeg")&& function_exists("imagejpeg")); - - } else { - return false; - } - - } else { - return false; - } - } - - -} - +fckphp_config=$fckphp_config; + $this->type=$type; + $this->raw_cwd=$cwd; + $this->actual_cwd=str_replace("//","/",($fckphp_config['UserFilesPath']."/$type/".$this->raw_cwd)); + $this->real_cwd=str_replace("//","/",($this->fckphp_config['basedir']."/".$this->actual_cwd)); + } + + function run() { + + header ("Content-Type: application/xml; charset=utf-8"); + echo "\n"; + ?> + + + + + + + + + + + + + + + + + + + + +] > + + + + +real_cwd)) { + + /** + * Initiate the array to store the foldernames + */ + $folders_array = array(); + + while (($filename=readdir($dh))!==false) { + + if (($filename!=".")&&($filename!="..")) { + if (is_dir($this->real_cwd."/$filename")) { + //check if$fckphp_configured not to show this folder + $hide=false; + for($i=0;$ifckphp_config['ResourceAreas'][$this->type]['HideFolders']);$i++) + $hide=(preg_match("/".$this->fckphp_config['ResourceAreas'][$this->type]['HideFolders'][$i]."/",$filename)?true:$hide); + + /** + * Dont echo the entry, push it in the array + */ + //if (!$hide) echo "\t\t\n"; + if (!$hide) array_push($folders_array,$filename); + + } else { + array_push($files,$filename); + } + } + } + closedir($dh); + + /** + * Sort the array by the way you like and show it. + */ + natcasesort($folders_array); + foreach($folders_array as $k=>$v) + { + echo ''."\n"; + } + + } + + echo "\t\n"; + echo "\t\n"; + + /** + * The filenames are in the array $files + * SORT IT! + */ + natcasesort($files); + $files = array_values($files); + + for ($i=0;$ifckphp_config['ResourceAreas'][$this->type]['AllowedExtensions'])) { + + //check if$fckphp_configured not to show this file + $editable=$hide=false; + for($j=0;$jfckphp_config['ResourceAreas'][$this->type]['HideFiles']);$j++) + $hide=(preg_match("/".$this->fckphp_config['ResourceAreas'][$this->type]['HideFiles'][$j]."/",$files[$i])?true:$hide); + + if (!$hide) { + if ($this->fckphp_config['ResourceAreas'][$this->type]['AllowImageEditing']) + $editable=$this->isImageEditable($this->real_cwd."/".$files[$i]); + + if(extension_loaded('mbstring')) { + $name = mb_convert_encoding($files [$i] , 'UTF-8', mb_detect_encoding($files[$i] , 'UTF-8, windows-1251, ASCII, ISO-8859-1')); + } else { + $name = $files[$i]; + } + // $this->fckphp_config['modx']['charset'] if needed + echo "\t\treal_cwd."/".$files [$i] )/1024)."\" editable=\"" . ( $editable?"1":"0" ) . "\" />\n"; + } + + } + + } + + echo "\t\n"; + echo "\n"; + } + + + function isImageEditable($file) { + $fh=fopen($file,"r"); + if ($fh) { + $start4=fread($fh,4); + fclose($fh); + + $start3=substr($start4,0,3); + + if ($start4=="\x89PNG") { //PNG + return (function_exists("imagecreatefrompng") && function_exists("imagepng")); + + } elseif ($start3=="GIF") { //GIF + return (function_exists("imagecreatefromgif") && function_exists("imagegif")); + + } elseif ($start3=="\xFF\xD8\xFF") { //JPEG + return (function_exists("imagecreatefromjpeg")&& function_exists("imagejpeg")); + + } elseif ($start4=="hsi1") { //JPEG + return (function_exists("imagecreatefromjpeg")&& function_exists("imagejpeg")); + + } else { + return false; + } + + } else { + return false; + } + } + + +} + ?> \ No newline at end of file diff --git a/manager/media/style/common/login.tpl b/manager/media/style/common/login.tpl index 21826a3554..d5d53cd5ad 100644 --- a/manager/media/style/common/login.tpl +++ b/manager/media/style/common/login.tpl @@ -1,345 +1,345 @@ - - - - MODx CMF Manager Login - - - - - - - -
[+site_name+]MODX Evolution
-
-
- - [+OnManagerLoginFormPrerender+] -

[+login_message+]

-
- - -
-

[+login_captcha_message+]

- [+captcha_image+] - [+captcha_input+] -
- - - - [+OnManagerLoginFormRender+] -
-
-
- © 2005-2013 by MODX®, and licensed under the GPL. -
-
- - - - + + + + MODx CMF Manager Login + + + + + + + +
[+site_name+]MODX Evolution
+
+
+ + [+OnManagerLoginFormPrerender+] +

[+login_message+]

+
+ + +
+

[+login_captcha_message+]

+ [+captcha_image+] + [+captcha_input+] +
+ + + + [+OnManagerLoginFormRender+] +
+
+
+ © 2005-2013 by MODX®, and licensed under the GPL. +
+
+ + + + \ No newline at end of file From ab52e6335b3538cff4afc00a7689975d2cdef3f1 Mon Sep 17 00:00:00 2001 From: yama Date: Mon, 22 Apr 2013 22:10:08 +0900 Subject: [PATCH 006/530] Refactor #9720 Separation deprecated core functions http://tracker.modx.com/issues/9720 --- .../includes/document.parser.class.inc.php | 218 ++---------------- .../extenders/deprecated.functions.inc.php | 184 +++++++++++++++ 2 files changed, 200 insertions(+), 202 deletions(-) create mode 100644 manager/includes/extenders/deprecated.functions.inc.php diff --git a/manager/includes/document.parser.class.inc.php b/manager/includes/document.parser.class.inc.php index 97ef7d0b5a..6e2bb3d847 100755 --- a/manager/includes/document.parser.class.inc.php +++ b/manager/includes/document.parser.class.inc.php @@ -68,6 +68,11 @@ function DocumentParser() { $this->error_reporting = 1; } + function __call($name,$args) { + include_once(MODX_BASE_PATH . 'manager/includes/extenders/deprecated.functions.inc.php'); + if(method_exists($this->old,$name)) return call_user_func_array(array($this->old,$name),$args); + } + // loads an extension from the extenders folder function loadExtension($extname) { global $database_type; @@ -186,45 +191,6 @@ function sendUnauthorizedPage() { exit(); } - // function to connect to the database - // - deprecated use $modx->db->connect() - function dbConnect() { - $this->db->connect(); - $this->rs= $this->db->conn; // for compatibility - } - - // function to query the database - // - deprecated use $modx->db->query() - function dbQuery($sql) { - return $this->db->query($sql); - } - - // function to count the number of rows in a record set - function recordCount($rs) { - return $this->db->getRecordCount($rs); - } - - // - deprecated, use $modx->db->getRow() - function fetchRow($rs, $mode= 'assoc') { - return $this->db->getRow($rs, $mode); - } - - // - deprecated, use $modx->db->getAffectedRows() - function affectedRows($rs) { - return $this->db->getAffectedRows($rs); - } - - // - deprecated, use $modx->db->getInsertId() - function insertId($rs) { - return $this->db->getInsertId($rs); - } - - // function to close a database connection - // - deprecated, use $modx->db->disconnect() - function dbClose() { - $this->db->disconnect(); - } - function getSettings() { if (!is_array($this->config) || empty ($this->config)) { if ($included= file_exists(MODX_BASE_PATH . 'assets/cache/siteCache.idx.php')) { @@ -672,35 +638,6 @@ function postProcess() { // end post processing } - function mergeDocumentMETATags($template) { - if ($this->documentObject['haskeywords'] == 1) { - // insert keywords - $keywords = $this->getKeywords(); - if (is_array($keywords) && count($keywords) > 0) { - $keywords = implode(", ", $keywords); - $metas= "\t\n"; - } - - // Don't process when cached - $this->documentObject['haskeywords'] = '0'; - } - if ($this->documentObject['hasmetatags'] == 1) { - // insert meta tags - $tags= $this->getMETATags(); - foreach ($tags as $n => $col) { - $tag= strtolower($col['tag']); - $tagvalue= $col['tagvalue']; - $tagstyle= $col['http_equiv'] ? 'http-equiv' : 'name'; - $metas .= "\t\n"; - } - - // Don't process when cached - $this->documentObject['hasmetatags'] = '0'; - } - if ($metas) $template = preg_replace("/()/i", "\\1\n\t" . trim($metas), $template); - return $template; - } - // mod by Raymond function mergeDocumentContent($template) { $replace= array (); @@ -1037,15 +974,6 @@ private function _get_snip_properties($snip_call) return $snippetObject; } - function makeFriendlyURL($pre, $suff, $alias, $isfolder=0) { - $Alias = explode('/',$alias); - $alias = array_pop($Alias); - $dir = implode('/', $Alias); - unset($Alias); - if($this->config['make_folders']==='1' && $isfolder==1) $suff = '/'; - return ($dir != '' ? "$dir/" : '') . $pre . $alias . $suff; - } - function rewriteUrls($documentSource) { // rewrite the urls if ($this->config['friendly_urls'] == 1) { @@ -1181,7 +1109,9 @@ function parseDocumentSource($source) { // replace HTMLSnippets in document $source= $this->mergeChunkContent($source); // insert META tags & keywords - $source= $this->mergeDocumentMETATags($source); + if(isset($this->config['show_meta']) && $this->config['show_meta']==1) { + $source= $this->mergeDocumentMETATags($source); + } // find and merge snippets $source= $this->evalSnippets($source); // find and replace Placeholders (must be parsed last) - Added by Raymond @@ -1488,12 +1418,18 @@ function logEvent($evtid, $type, $msg, $source= 'Parser') { # Returns true if parser is executed in backend (manager) mode function isBackend() { - return $this->insideManager() ? true : false; + if(defined('IN_MANAGER_MODE') && IN_MANAGER_MODE == 'true') { + return true; + } + else return false; } # Returns true if parser is executed in frontend mode function isFrontend() { - return !$this->insideManager() ? true : false; + if(defined('IN_MANAGER_MODE') && IN_MANAGER_MODE == 'true') { + return false; + } + else return true; } function getAllChildren($id= 0, $sort= 'menuindex', $dir= 'ASC', $fields= 'id, pagetitle, description, parent, alias, menutitle') { @@ -1792,97 +1728,6 @@ function getVersionData($data=null) { return (!is_null($data) && is_array($this->version) && isset($this->version[$data])) ? $this->version[$data] : $this->version; } - function makeList($array, $ulroot= 'root', $ulprefix= 'sub_', $type= '', $ordered= false, $tablevel= 0) { - // first find out whether the value passed is an array - if (!is_array($array)) { - return "
  • Bad list
"; - } - if (!empty ($type)) { - $typestr= " style='list-style-type: $type'"; - } else { - $typestr= ""; - } - $tabs= ""; - for ($i= 0; $i < $tablevel; $i++) { - $tabs .= "\t"; - } - $listhtml= $ordered == true ? $tabs . "
    \n" : $tabs . "
      \n"; - foreach ($array as $key => $value) { - if (is_array($value)) { - $listhtml .= $tabs . "\t
    • " . $key . "\n" . $this->makeList($value, $ulprefix . $ulroot, $ulprefix, $type, $ordered, $tablevel +2) . $tabs . "\t
    • \n"; - } else { - $listhtml .= $tabs . "\t
    • " . $value . "
    • \n"; - } - } - $listhtml .= $ordered == true ? $tabs . "
\n" : $tabs . "\n"; - return $listhtml; - } - - function userLoggedIn() { - $userdetails= array (); - if ($this->isFrontend() && isset ($_SESSION['webValidated'])) { - // web user - $userdetails['loggedIn']= true; - $userdetails['id']= $_SESSION['webInternalKey']; - $userdetails['username']= $_SESSION['webShortname']; - $userdetails['usertype']= 'web'; // added by Raymond - return $userdetails; - } else - if ($this->isBackend() && isset ($_SESSION['mgrValidated'])) { - // manager user - $userdetails['loggedIn']= true; - $userdetails['id']= $_SESSION['mgrInternalKey']; - $userdetails['username']= $_SESSION['mgrShortname']; - $userdetails['usertype']= 'manager'; // added by Raymond - return $userdetails; - } else { - return false; - } - } - - function getKeywords($id= 0) { - if ($id == 0) { - $id= $this->documentObject['id']; - } - $tblKeywords= $this->getFullTableName('site_keywords'); - $tblKeywordXref= $this->getFullTableName('keyword_xref'); - $sql= "SELECT keywords.keyword FROM " . $tblKeywords . " AS keywords INNER JOIN " . $tblKeywordXref . " AS xref ON keywords.id=xref.keyword_id WHERE xref.content_id = '$id'"; - $result= $this->db->query($sql); - $limit= $this->db->getRecordCount($result); - $keywords= array (); - if ($limit > 0) { - for ($i= 0; $i < $limit; $i++) { - $row= $this->db->getRow($result); - $keywords[]= $row['keyword']; - } - } - return $keywords; - } - - function getMETATags($id= 0) { - if ($id == 0) { - $id= $this->documentObject['id']; - } - $sql= "SELECT smt.* " . - "FROM " . $this->getFullTableName("site_metatags") . " smt " . - "INNER JOIN " . $this->getFullTableName("site_content_metatags") . " cmt ON cmt.metatag_id=smt.id " . - "WHERE cmt.content_id = '$id'"; - $ds= $this->db->query($sql); - $limit= $this->db->getRecordCount($ds); - $metatags= array (); - if ($limit > 0) { - for ($i= 0; $i < $limit; $i++) { - $row= $this->db->getRow($ds); - $metatags[$row['name']]= array ( - "tag" => $row['tag'], - "tagvalue" => $row['tagvalue'], - "http_equiv" => $row['http_equiv'] - ); - } - } - return $metatags; - } - function runSnippet($snippetName, $params= array ()) { if (isset ($this->snippetCache[$snippetName])) { $snippet= $this->snippetCache[$snippetName]; @@ -1911,11 +1756,6 @@ function getChunk($chunkName) { return $t; } - // deprecated - function putChunk($chunkName) { // alias name >.< - return $this->getChunk($chunkName); - } - function parseChunk($chunkName, $chunkArr, $prefix= "{", $suffix= "}") { if (!is_array($chunkArr)) { return false; @@ -1927,11 +1767,6 @@ function parseChunk($chunkName, $chunkArr, $prefix= "{", $suffix= "}") { return $chunk; } - function getUserData() { - include $this->config["base_path"] . "manager/includes/extenders/getUserData.extender.php"; - return $tmpArray; - } - function toDateFormat($timestamp = 0, $mode = '') { $timestamp = trim($timestamp); $timestamp = intval($timestamp); @@ -2227,21 +2062,6 @@ function sendAlert($type, $to, $from, $subject, $msg, $private= 0) { $rs= $this->db->query($sql); } - # Returns true, install or interact when inside manager - // deprecated - function insideManager() { - $m= false; - if (defined('IN_MANAGER_MODE') && IN_MANAGER_MODE == 'true') { - $m= true; - if (defined('SNIPPET_INTERACTIVE_MODE') && SNIPPET_INTERACTIVE_MODE == 'true') - $m= "interact"; - else - if (defined('SNIPPET_INSTALL_MODE') && SNIPPET_INSTALL_MODE == 'true') - $m= "install"; - } - return $m; - } - # Returns current user id function getLoginUserID($context= '') { if ($context && isset ($_SESSION[$context . 'Validated'])) { @@ -2351,9 +2171,6 @@ function getUserDocGroups($resolveIds= false) { return $dgn; } } - function getDocGroups() { - return $this->getUserDocGroups(); - } // deprecated # Change current web user's password - returns true if successful, oterhwise return error message function changeWebUserPassword($oldPwd, $newPwd) { @@ -2386,9 +2203,6 @@ function changeWebUserPassword($oldPwd, $newPwd) { } } } - function changePassword($o, $n) { - return changeWebUserPassword($o, $n); - } // deprecated # returns true if the current web user is a member the specified groups function isMemberOfWebGroup($groupNames= array ()) { diff --git a/manager/includes/extenders/deprecated.functions.inc.php b/manager/includes/extenders/deprecated.functions.inc.php new file mode 100644 index 0000000000..bffddfebaa --- /dev/null +++ b/manager/includes/extenders/deprecated.functions.inc.php @@ -0,0 +1,184 @@ +old = new OldFunctions(); +class OldFunctions { + + function dbConnect() {global $modx; $modx->db->connect();$modx->rs = $modx->db->conn;} + function dbQuery($sql) {global $modx;return $modx->db->query($sql);} + function recordCount($rs) {global $modx;return $modx->db->getRecordCount($rs);} + function fetchRow($rs,$mode='assoc') {global $modx;return $modx->db->getRow($rs, $mode);} + function affectedRows($rs) {global $modx;return $modx->db->getAffectedRows($rs);} + function insertId($rs) {global $modx;return $modx->db->getInsertId($rs);} + function dbClose() {global $modx; $modx->db->disconnect();} + + function makeList($array, $ulroot= 'root', $ulprefix= 'sub_', $type= '', $ordered= false, $tablevel= 0) { + // first find out whether the value passed is an array + if (!is_array($array)) { + return "
  • Bad list
"; + } + if (!empty ($type)) { + $typestr= " style='list-style-type: $type'"; + } else { + $typestr= ""; + } + $tabs= ""; + for ($i= 0; $i < $tablevel; $i++) { + $tabs .= "\t"; + } + $listhtml= $ordered == true ? $tabs . "
    \n" : $tabs . "
      \n"; + foreach ($array as $key => $value) { + if (is_array($value)) { + $listhtml .= $tabs . "\t
    • " . $key . "\n" . $this->makeList($value, $ulprefix . $ulroot, $ulprefix, $type, $ordered, $tablevel +2) . $tabs . "\t
    • \n"; + } else { + $listhtml .= $tabs . "\t
    • " . $value . "
    • \n"; + } + } + $listhtml .= $ordered == true ? $tabs . "
\n" : $tabs . "\n"; + return $listhtml; + } + + + function getUserData() { + global $modx; + include $modx->config["base_path"] . "manager/includes/extenders/getUserData.extender.php"; + return $tmpArray; + } + + # Returns true, install or interact when inside manager + // deprecated + function insideManager() { + $m= false; + if (defined('IN_MANAGER_MODE') && IN_MANAGER_MODE == 'true') { + $m= true; + if (defined('SNIPPET_INTERACTIVE_MODE') && SNIPPET_INTERACTIVE_MODE == 'true') + $m= "interact"; + else + if (defined('SNIPPET_INSTALL_MODE') && SNIPPET_INSTALL_MODE == 'true') + $m= "install"; + } + return $m; + } + + // deprecated + function putChunk($chunkName) { // alias name >.< + global $modx; + return $modx->getChunk($chunkName); + } + + function getDocGroups() { + global $modx; + return $modx->getUserDocGroups(); + } // deprecated + + function changePassword($o, $n) { + return changeWebUserPassword($o, $n); + } // deprecated + + function mergeDocumentMETATags($template) { + global $modx; + if ($modx->documentObject['haskeywords'] == 1) { + // insert keywords + $keywords = $modx->getKeywords(); + if (is_array($keywords) && count($keywords) > 0) { + $keywords = implode(", ", $keywords); + $metas= "\t\n"; + } + + // Don't process when cached + $modx->documentObject['haskeywords'] = '0'; + } + if ($modx->documentObject['hasmetatags'] == 1) { + // insert meta tags + $tags= $modx->getMETATags(); + foreach ($tags as $n => $col) { + $tag= strtolower($col['tag']); + $tagvalue= $col['tagvalue']; + $tagstyle= $col['http_equiv'] ? 'http-equiv' : 'name'; + $metas .= "\t\n"; + } + + // Don't process when cached + $modx->documentObject['hasmetatags'] = '0'; + } + if ($metas) $template = preg_replace("/()/i", "\\1\n\t" . trim($metas), $template); + return $template; + } + + function getMETATags($id= 0) { + global $modx; + if ($id == 0) { + $id= $modx->documentObject['id']; + } + $sql= "SELECT smt.* " . + "FROM " . $modx->getFullTableName("site_metatags") . " smt " . + "INNER JOIN " . $modx->getFullTableName("site_content_metatags") . " cmt ON cmt.metatag_id=smt.id " . + "WHERE cmt.content_id = '$id'"; + $ds= $modx->db->query($sql); + $limit= $modx->db->getRecordCount($ds); + $metatags= array (); + if ($limit > 0) { + for ($i= 0; $i < $limit; $i++) { + $row= $modx->db->getRow($ds); + $metatags[$row['name']]= array ( + "tag" => $row['tag'], + "tagvalue" => $row['tagvalue'], + "http_equiv" => $row['http_equiv'] + ); + } + } + return $metatags; + } + + function userLoggedIn() { + global $modx; + $userdetails= array (); + if ($modx->isFrontend() && isset ($_SESSION['webValidated'])) { + // web user + $userdetails['loggedIn']= true; + $userdetails['id']= $_SESSION['webInternalKey']; + $userdetails['username']= $_SESSION['webShortname']; + $userdetails['usertype']= 'web'; // added by Raymond + return $userdetails; + } else + if ($modx->isBackend() && isset ($_SESSION['mgrValidated'])) { + // manager user + $userdetails['loggedIn']= true; + $userdetails['id']= $_SESSION['mgrInternalKey']; + $userdetails['username']= $_SESSION['mgrShortname']; + $userdetails['usertype']= 'manager'; // added by Raymond + return $userdetails; + } else { + return false; + } + } + + function getKeywords($id= 0) { + global $modx; + if ($id == 0) { + $id= $modx->documentObject['id']; + } + $tblKeywords= $modx->getFullTableName('site_keywords'); + $tblKeywordXref= $modx->getFullTableName('keyword_xref'); + $sql= "SELECT keywords.keyword FROM " . $tblKeywords . " AS keywords INNER JOIN " . $tblKeywordXref . " AS xref ON keywords.id=xref.keyword_id WHERE xref.content_id = '$id'"; + $result= $modx->db->query($sql); + $limit= $modx->db->getRecordCount($result); + $keywords= array (); + if ($limit > 0) { + for ($i= 0; $i < $limit; $i++) { + $row= $modx->db->getRow($result); + $keywords[]= $row['keyword']; + } + } + return $keywords; + } + + function makeFriendlyURL($pre, $suff, $alias, $isfolder=0) { + global $modx; + $Alias = explode('/',$alias); + $alias = array_pop($Alias); + $dir = implode('/', $Alias); + unset($Alias); + if($modx->config['make_folders']==='1' && $isfolder==1) $suff = '/'; + return ($dir != '' ? "$dir/" : '') . $pre . $alias . $suff; + } + +} \ No newline at end of file From 1163e54dc5e6e6d7e97388d0160ac03e2fbd6670 Mon Sep 17 00:00:00 2001 From: yama Date: Mon, 22 Apr 2013 22:20:27 +0900 Subject: [PATCH 007/530] Refactor #9860 Delete Etomite database functions http://tracker.modx.com/issues/9860 --- .../includes/document.parser.class.inc.php | 184 ----------------- .../extenders/deprecated.functions.inc.php | 191 ++++++++++++++++++ 2 files changed, 191 insertions(+), 184 deletions(-) diff --git a/manager/includes/document.parser.class.inc.php b/manager/includes/document.parser.class.inc.php index 6e2bb3d847..8e64ee5400 100755 --- a/manager/includes/document.parser.class.inc.php +++ b/manager/includes/document.parser.class.inc.php @@ -2441,190 +2441,6 @@ function parseProperties($propertyString) { return $parameter; } - /*############################################ - Etomite_dbFunctions.php - New database functions for Etomite CMS - Author: Ralph A. Dahlgren - rad14701@yahoo.com - Etomite ID: rad14701 - See documentation for usage details - ############################################*/ - function getIntTableRows($fields= "*", $from= "", $where= "", $sort= "", $dir= "ASC", $limit= "") { - // function to get rows from ANY internal database table - if ($from == "") { - return false; - } else { - $where= ($where != "") ? "WHERE $where" : ""; - $sort= ($sort != "") ? "ORDER BY $sort $dir" : ""; - $limit= ($limit != "") ? "LIMIT $limit" : ""; - $tbl= $this->getFullTableName($from); - $sql= "SELECT $fields FROM $tbl $where $sort $limit;"; - $result= $this->db->query($sql); - $resourceArray= array (); - for ($i= 0; $i < @ $this->db->getRecordCount($result); $i++) { - array_push($resourceArray, @ $this->db->getRow($result)); - } - return $resourceArray; - } - } - - function putIntTableRow($fields= "", $into= "") { - // function to put a row into ANY internal database table - if (($fields == "") || ($into == "")) { - return false; - } else { - $tbl= $this->getFullTableName($into); - $sql= "INSERT INTO $tbl SET "; - foreach ($fields as $key => $value) { - $sql .= $key . "="; - if (is_numeric($value)) - $sql .= $value . ","; - else - $sql .= "'" . $value . "',"; - } - $sql= rtrim($sql, ","); - $sql .= ";"; - $result= $this->db->query($sql); - return $result; - } - } - - function updIntTableRow($fields= "", $into= "", $where= "", $sort= "", $dir= "ASC", $limit= "") { - // function to update a row into ANY internal database table - if (($fields == "") || ($into == "")) { - return false; - } else { - $where= ($where != "") ? "WHERE $where" : ""; - $sort= ($sort != "") ? "ORDER BY $sort $dir" : ""; - $limit= ($limit != "") ? "LIMIT $limit" : ""; - $tbl= $this->getFullTableName($into); - $sql= "UPDATE $tbl SET "; - foreach ($fields as $key => $value) { - $sql .= $key . "="; - if (is_numeric($value)) - $sql .= $value . ","; - else - $sql .= "'" . $value . "',"; - } - $sql= rtrim($sql, ","); - $sql .= " $where $sort $limit;"; - $result= $this->db->query($sql); - return $result; - } - } - - function getExtTableRows($host= "", $user= "", $pass= "", $dbase= "", $fields= "*", $from= "", $where= "", $sort= "", $dir= "ASC", $limit= "") { - // function to get table rows from an external MySQL database - if (($host == "") || ($user == "") || ($pass == "") || ($dbase == "") || ($from == "")) { - return false; - } else { - $where= ($where != "") ? "WHERE $where" : ""; - $sort= ($sort != "") ? "ORDER BY $sort $dir" : ""; - $limit= ($limit != "") ? "LIMIT $limit" : ""; - $tbl= $dbase . "." . $from; - $this->dbExtConnect($host, $user, $pass, $dbase); - $sql= "SELECT $fields FROM $tbl $where $sort $limit;"; - $result= $this->db->query($sql); - $resourceArray= array (); - for ($i= 0; $i < @ $this->db->getRecordCount($result); $i++) { - array_push($resourceArray, @ $this->db->getRow($result)); - } - return $resourceArray; - } - } - - function putExtTableRow($host= "", $user= "", $pass= "", $dbase= "", $fields= "", $into= "") { - // function to put a row into an external database table - if (($host == "") || ($user == "") || ($pass == "") || ($dbase == "") || ($fields == "") || ($into == "")) { - return false; - } else { - $this->dbExtConnect($host, $user, $pass, $dbase); - $tbl= $dbase . "." . $into; - $sql= "INSERT INTO $tbl SET "; - foreach ($fields as $key => $value) { - $sql .= $key . "="; - if (is_numeric($value)) - $sql .= $value . ","; - else - $sql .= "'" . $value . "',"; - } - $sql= rtrim($sql, ","); - $sql .= ";"; - $result= $this->db->query($sql); - return $result; - } - } - - function updExtTableRow($host= "", $user= "", $pass= "", $dbase= "", $fields= "", $into= "", $where= "", $sort= "", $dir= "ASC", $limit= "") { - // function to update a row into an external database table - if (($fields == "") || ($into == "")) { - return false; - } else { - $this->dbExtConnect($host, $user, $pass, $dbase); - $tbl= $dbase . "." . $into; - $where= ($where != "") ? "WHERE $where" : ""; - $sort= ($sort != "") ? "ORDER BY $sort $dir" : ""; - $limit= ($limit != "") ? "LIMIT $limit" : ""; - $sql= "UPDATE $tbl SET "; - foreach ($fields as $key => $value) { - $sql .= $key . "="; - if (is_numeric($value)) - $sql .= $value . ","; - else - $sql .= "'" . $value . "',"; - } - $sql= rtrim($sql, ","); - $sql .= " $where $sort $limit;"; - $result= $this->db->query($sql); - return $result; - } - } - - function dbExtConnect($host, $user, $pass, $dbase) { - // function to connect to external database - $tstart= $this->getMicroTime(); - if (@ !$this->rs= mysql_connect($host, $user, $pass)) { - $this->messageQuit("Failed to create connection to the $dbase database!"); - } else { - mysql_select_db($dbase); - $tend= $this->getMicroTime(); - $totaltime= $tend - $tstart; - if ($this->dumpSQL) { - $this->queryCode .= "
Database connection" . sprintf("Database connection to %s was created in %2.4f s", $dbase, $totaltime) . "

"; - } - $this->queryTime= $this->queryTime + $totaltime; - } - } - - function getFormVars($method= "", $prefix= "", $trim= "", $REQUEST_METHOD) { - // function to retrieve form results into an associative array - $results= array (); - $method= strtoupper($method); - if ($method == "") - $method= $REQUEST_METHOD; - if ($method == "POST") - $method= & $_POST; - elseif ($method == "GET") $method= & $_GET; - else - return false; - reset($method); - foreach ($method as $key => $value) { - if (($prefix != "") && (substr($key, 0, strlen($prefix)) == $prefix)) { - if ($trim) { - $pieces= explode($prefix, $key, 2); - $key= $pieces[1]; - $results[$key]= $value; - } else - $results[$key]= $value; - } - elseif ($prefix == "") $results[$key]= $value; - } - return $results; - } - - ######################################## - // END New database functions - rad14701 - ######################################## - /***************************************************************************************/ /* End of API functions */ /***************************************************************************************/ diff --git a/manager/includes/extenders/deprecated.functions.inc.php b/manager/includes/extenders/deprecated.functions.inc.php index bffddfebaa..513eaca3fd 100644 --- a/manager/includes/extenders/deprecated.functions.inc.php +++ b/manager/includes/extenders/deprecated.functions.inc.php @@ -181,4 +181,195 @@ function makeFriendlyURL($pre, $suff, $alias, $isfolder=0) { return ($dir != '' ? "$dir/" : '') . $pre . $alias . $suff; } + /*############################################ + Etomite_dbFunctions.php + New database functions for Etomite CMS + Author: Ralph A. Dahlgren - rad14701@yahoo.com + Etomite ID: rad14701 + See documentation for usage details + ############################################*/ + function getIntTableRows($fields= "*", $from= "", $where= "", $sort= "", $dir= "ASC", $limit= "") { + // function to get rows from ANY internal database table + global $modx; + if ($from == "") { + return false; + } else { + $where= ($where != "") ? "WHERE $where" : ""; + $sort= ($sort != "") ? "ORDER BY $sort $dir" : ""; + $limit= ($limit != "") ? "LIMIT $limit" : ""; + $tbl= $modx->getFullTableName($from); + $sql= "SELECT $fields FROM $tbl $where $sort $limit;"; + $result= $modx->db->query($sql); + $resourceArray= array (); + for ($i= 0; $i < @ $modx->db->getRecordCount($result); $i++) { + array_push($resourceArray, @ $modx->db->getRow($result)); + } + return $resourceArray; + } + } + + function putIntTableRow($fields= "", $into= "") { + // function to put a row into ANY internal database table + global $modx; + if (($fields == "") || ($into == "")) { + return false; + } else { + $tbl= $modx->getFullTableName($into); + $sql= "INSERT INTO $tbl SET "; + foreach ($fields as $key => $value) { + $sql .= $key . "="; + if (is_numeric($value)) + $sql .= $value . ","; + else + $sql .= "'" . $value . "',"; + } + $sql= rtrim($sql, ","); + $sql .= ";"; + $result= $modx->db->query($sql); + return $result; + } + } + + function updIntTableRow($fields= "", $into= "", $where= "", $sort= "", $dir= "ASC", $limit= "") { + // function to update a row into ANY internal database table + global $modx; + if (($fields == "") || ($into == "")) { + return false; + } else { + $where= ($where != "") ? "WHERE $where" : ""; + $sort= ($sort != "") ? "ORDER BY $sort $dir" : ""; + $limit= ($limit != "") ? "LIMIT $limit" : ""; + $tbl= $modx->getFullTableName($into); + $sql= "UPDATE $tbl SET "; + foreach ($fields as $key => $value) { + $sql .= $key . "="; + if (is_numeric($value)) + $sql .= $value . ","; + else + $sql .= "'" . $value . "',"; + } + $sql= rtrim($sql, ","); + $sql .= " $where $sort $limit;"; + $result= $modx->db->query($sql); + return $result; + } + } + + function getExtTableRows($host= "", $user= "", $pass= "", $dbase= "", $fields= "*", $from= "", $where= "", $sort= "", $dir= "ASC", $limit= "") { + // function to get table rows from an external MySQL database + global $modx; + if (($host == "") || ($user == "") || ($pass == "") || ($dbase == "") || ($from == "")) { + return false; + } else { + $where= ($where != "") ? "WHERE $where" : ""; + $sort= ($sort != "") ? "ORDER BY $sort $dir" : ""; + $limit= ($limit != "") ? "LIMIT $limit" : ""; + $tbl= $dbase . "." . $from; + $this->dbExtConnect($host, $user, $pass, $dbase); + $sql= "SELECT $fields FROM $tbl $where $sort $limit;"; + $result= $modx->db->query($sql); + $resourceArray= array (); + for ($i= 0; $i < @ $modx->db->getRecordCount($result); $i++) { + array_push($resourceArray, @ $modx->db->getRow($result)); + } + return $resourceArray; + } + } + + function putExtTableRow($host= "", $user= "", $pass= "", $dbase= "", $fields= "", $into= "") { + // function to put a row into an external database table + global $modx; + if (($host == "") || ($user == "") || ($pass == "") || ($dbase == "") || ($fields == "") || ($into == "")) { + return false; + } else { + $this->dbExtConnect($host, $user, $pass, $dbase); + $tbl= $dbase . "." . $into; + $sql= "INSERT INTO $tbl SET "; + foreach ($fields as $key => $value) { + $sql .= $key . "="; + if (is_numeric($value)) + $sql .= $value . ","; + else + $sql .= "'" . $value . "',"; + } + $sql= rtrim($sql, ","); + $sql .= ";"; + $result= $modx->db->query($sql); + return $result; + } + } + + function updExtTableRow($host= "", $user= "", $pass= "", $dbase= "", $fields= "", $into= "", $where= "", $sort= "", $dir= "ASC", $limit= "") { + // function to update a row into an external database table + global $modx; + if (($fields == "") || ($into == "")) { + return false; + } else { + $this->dbExtConnect($host, $user, $pass, $dbase); + $tbl= $dbase . "." . $into; + $where= ($where != "") ? "WHERE $where" : ""; + $sort= ($sort != "") ? "ORDER BY $sort $dir" : ""; + $limit= ($limit != "") ? "LIMIT $limit" : ""; + $sql= "UPDATE $tbl SET "; + foreach ($fields as $key => $value) { + $sql .= $key . "="; + if (is_numeric($value)) + $sql .= $value . ","; + else + $sql .= "'" . $value . "',"; + } + $sql= rtrim($sql, ","); + $sql .= " $where $sort $limit;"; + $result= $modx->db->query($sql); + return $result; + } + } + + function dbExtConnect($host, $user, $pass, $dbase) { + // function to connect to external database + global $modx; + $tstart= $modx->getMicroTime(); + if (@ !$modx->rs= mysql_connect($host, $user, $pass)) { + $modx->messageQuit("Failed to create connection to the $dbase database!"); + } else { + mysql_select_db($dbase); + $tend= $modx->getMicroTime(); + $totaltime= $tend - $tstart; + if ($modx->dumpSQL) { + $modx->queryCode .= "
Database connection" . sprintf("Database connection to %s was created in %2.4f s", $dbase, $totaltime) . "

"; + } + $modx->queryTime= $modx->queryTime + $totaltime; + } + } + + function getFormVars($method= "", $prefix= "", $trim= "", $REQUEST_METHOD) { + // function to retrieve form results into an associative array + global $modx; + $results= array (); + $method= strtoupper($method); + if ($method == "") + $method= $REQUEST_METHOD; + if ($method == "POST") + $method= & $_POST; + elseif ($method == "GET") $method= & $_GET; + else + return false; + reset($method); + foreach ($method as $key => $value) { + if (($prefix != "") && (substr($key, 0, strlen($prefix)) == $prefix)) { + if ($trim) { + $pieces= explode($prefix, $key, 2); + $key= $pieces[1]; + $results[$key]= $value; + } else + $results[$key]= $value; + } + elseif ($prefix == "") $results[$key]= $value; + } + return $results; + } + + ######################################## + // END New database functions - rad14701 + ######################################## } \ No newline at end of file From f3d65e979c3f0b4484872348cca755503b4a468d Mon Sep 17 00:00:00 2001 From: Thomas Jakobi Date: Mon, 22 Apr 2013 21:04:42 +0200 Subject: [PATCH 008/530] Bug #9865: Fix ManagerManager field rules The ManagerManager field rule mm_moveFieldsToTab was modified to not depend on $fieldtype. This is changed for all other field rules, too. --- .../managermanager/functions/fields.inc.php | 27 +++++++++++++------ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/assets/plugins/managermanager/functions/fields.inc.php b/assets/plugins/managermanager/functions/fields.inc.php index 51f42ca31c..94a48ba2e0 100644 --- a/assets/plugins/managermanager/functions/fields.inc.php +++ b/assets/plugins/managermanager/functions/fields.inc.php @@ -18,24 +18,26 @@ function mm_renameField($field, $newlabel, $roles='', $templates='', $newhelp='' $output = " // ----------- Rename field -------------- \n"; + $output .= '$j("select[id$=_prefix]").each( function() { $j(this).parents("tr:first").addClass("urltv"); } ); '; + switch ($field) { // Exceptions case 'keywords': - $output .= '$j("select[name*=keywords]").siblings("span.warning").empty().prepend("'.jsSafe($newlabel).'");'; + $output .= '$j("select[name*=keywords]").siblings("span.warning").html("'.jsSafe($newlabel).'");'; break; case 'metatags': - $output .= '$j("select[name*=metatags]").siblings("span.warning").empty().prepend("'.jsSafe($newlabel).'");'; + $output .= '$j("select[name*=metatags]").siblings("span.warning").html("'.jsSafe($newlabel).'");'; break; case 'hidemenu': case 'show_in_menu': - $output .= '$j("input[name=hidemenucheck]").siblings("span.warning").empty().prepend("'.jsSafe($newlabel).'");'; + $output .= '$j("input[name=hidemenucheck]").siblings("span.warning").html("'.jsSafe($newlabel).'");'; break; case 'which_editor': - $output .= '$j("#which_editor").prev("span.warning").empty().prepend("'.jsSafe($newlabel).'");'; + $output .= '$j("#which_editor").prev("span.warning").html("'.jsSafe($newlabel).'");'; break; // Ones that follow the regular pattern @@ -44,7 +46,7 @@ function mm_renameField($field, $newlabel, $roles='', $templates='', $newhelp='' if (isset($mm_fields[$field])) { $fieldtype = $mm_fields[$field]['fieldtype']; $fieldname = $mm_fields[$field]['fieldname']; - $output .= '$j("'.$fieldtype.'[name='.$fieldname.']").parents("td").prev("td").children("span.warning").empty().prepend("'.jsSafe($newlabel).'");'; + $output .= '$j(":input[name='.$fieldname.']").parents("tr:not(.urltv)").children("td:first").children("span.warning").html("'.jsSafe($newlabel).'");'; } break; @@ -86,6 +88,8 @@ function mm_hideFields($fields, $roles='', $templates='') { $output = ''; + $output .= '$j("select[id$=_prefix]").each( function() { $j(this).parents("tr:first").addClass("urltv"); } ); '; + switch ($field) { // Exceptions @@ -130,7 +134,7 @@ function mm_hideFields($fields, $roles='', $templates='') { // Ones that follow the regular pattern default: if (isset($mm_fields[$field])) { // Check the fields exist, so we're not writing JS for elements that don't exist - $output .= '$j("'.$mm_fields[$field]['fieldtype'].'[name='.$mm_fields[$field]['fieldname'].']").parents("tr").hide().next("tr").find("td[colspan=2]").parent("tr").hide(); '; + $output .= '$j(":input[name='.$mm_fields[$field]['fieldname'].']").parents("tr:not(.urltv)").hide().next("tr").find("td[colspan=2]").parent("tr").hide(); '; } break; } // end switch @@ -168,18 +172,25 @@ function mm_changeFieldHelp($field, $helptext='', $roles='', $templates='') { // Ones that follow the regular pattern default: + $output .= '$j("select[id$=_prefix]").each( function() { $j(this).parents("tr:first").addClass("urltv"); } ); ' . "\n"; + // What type is this field? if (isset($mm_fields[$field])) { $fieldtype = $mm_fields[$field]['fieldtype']; $fieldname = $mm_fields[$field]['fieldname']; // Give the help button an ID, and modify the alt/title text - $output .= '$j("'.$fieldtype.'[name='.$fieldname.']").siblings("img[style:contains(\'cursor:help\')]").attr("id", "'.$fieldname.'-help").attr("alt", "'.jsSafe($helptext).'").attr("title", "'.jsSafe($helptext).'"); '; + $output .= 'if ($j(":input[name=' . $fieldname . ']").siblings("img[style:contains(\'cursor:help\')]").length) {' . "\n"; + $output .= '$j(":input[name=' . $fieldname . ']").siblings("img[style:contains(\'cursor:help\')]").attr("id", "' . $fieldname . '-help").attr("alt", "'.jsSafe($helptext).'").attr("title", "'.jsSafe($helptext).'"); ' . "\n"; + $output .= '} else {' . "\n"; + $output .= 'var help' . $fieldname . ' = $j("").attr("id", "' . $fieldname . '-help").addClass("tooltip").css("cursor", "help").attr("src", "media/style/' . $modx->config['manager_theme'] . '/images/icons/b02_trans.gif").attr("alt", "'.jsSafe($helptext).'").attr("title", "'.jsSafe($helptext).'");' . "\n"; + $output .= '$j(":input[name=' . $fieldname . ']").closest("tr").children("td:last").append(help' . $fieldname . ');' . "\n"; + $output .= '}' . "\n"; } else { break; } - + //alt="NEW pagetitle help" break; } // end switch From 54125da0ea931b9d9bf425b9943aa66408766f75 Mon Sep 17 00:00:00 2001 From: Peter Bowyer Date: Wed, 24 Apr 2013 12:42:43 +0100 Subject: [PATCH 009/530] Refactor parser statistics into own method, so accessible from all code --- .../includes/document.parser.class.inc.php | 40 +++++++++++-------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/manager/includes/document.parser.class.inc.php b/manager/includes/document.parser.class.inc.php index 97ef7d0b5a..68d5d590ac 100755 --- a/manager/includes/document.parser.class.inc.php +++ b/manager/includes/document.parser.class.inc.php @@ -540,27 +540,18 @@ function outputContent($noEvent= false) { } } - $totalTime= ($this->getMicroTime() - $this->tstart); - $queryTime= $this->queryTime; - $phpTime= $totalTime - $queryTime; - - $queryTime= sprintf("%2.4f s", $queryTime); - $totalTime= sprintf("%2.4f s", $totalTime); - $phpTime= sprintf("%2.4f s", $phpTime); - $source= $this->documentGenerated == 1 ? "database" : "cache"; - $queries= isset ($this->executedQueries) ? $this->executedQueries : 0; - $phpMemory = (memory_get_peak_usage(true) / 1024 / 1024) . " mb"; + $stats = $this->getTimerStats($this->tstart); $out =& $this->documentOutput; if ($this->dumpSQL) { $out .= $this->queryCode; } - $out= str_replace("[^q^]", $queries, $out); - $out= str_replace("[^qt^]", $queryTime, $out); - $out= str_replace("[^p^]", $phpTime, $out); - $out= str_replace("[^t^]", $totalTime, $out); - $out= str_replace("[^s^]", $source, $out); - $out= str_replace("[^m^]", $phpMemory, $out); + $out= str_replace("[^q^]", $stats['queries'] , $out); + $out= str_replace("[^qt^]", $stats['queryTime'] , $out); + $out= str_replace("[^p^]", $stats['phpTime'] , $out); + $out= str_replace("[^t^]", $stats['totalTime'] , $out); + $out= str_replace("[^s^]", $stats['source'] , $out); + $out= str_replace("[^m^]", $stats['phpMemory'], $out); //$this->documentOutput= $out; // invoke OnWebPagePrerender event @@ -572,6 +563,23 @@ function outputContent($noEvent= false) { ob_end_flush(); } + function getTimerStats($tstart) { + $stats = array(); + + $stats['totalTime'] = ($this->getMicroTime() - $tstart); + $stats['queryTime'] = $this->queryTime; + $stats['phpTime'] = $stats['totalTime'] - $stats['queryTime']; + + $stats['queryTime'] = sprintf("%2.4f s", $stats['queryTime']); + $stats['totalTime'] = sprintf("%2.4f s", $stats['totalTime']); + $stats['phpTime'] = sprintf("%2.4f s", $stats['phpTime']); + $stats['source'] = $this->documentGenerated == 1 ? "database" : "cache"; + $stats['queries'] = isset ($this->executedQueries) ? $this->executedQueries : 0; + $stats['phpMemory'] = (memory_get_peak_usage(true) / 1024 / 1024) . " mb"; + + return $stats; + } + function checkPublishStatus() { $cacheRefreshTime= 0; @include $this->config["base_path"] . "assets/cache/sitePublishing.idx.php"; From 0516013e5f01d4e7626045534c408645ca80e2d5 Mon Sep 17 00:00:00 2001 From: Roope Date: Wed, 24 Apr 2013 17:08:26 +0300 Subject: [PATCH 010/530] Fixed 'wrong datatype' warning at install Install options page throws warning: in_array() [function.in-array]: Wrong datatype for second argument at some server setups. --- install/action.options.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install/action.options.php b/install/action.options.php index 76481506c2..27d36e5644 100644 --- a/install/action.options.php +++ b/install/action.options.php @@ -158,7 +158,7 @@ if ($limit > 0) { $pluginOutput = ''; for ($i = 0; $i < $limit; $i++) { - $class = !in_array('sample', $modulePlugins[$i][8]) ? "toggle" : "toggle demo"; + $class = !in_array('sample', (array) $modulePlugins[$i][8]) ? "toggle" : "toggle demo"; $chk = in_array($i, $plugins) || (!$options_selected) ? 'checked="checked"' : ""; $pluginOutput .= "" . $_lang['install_update'] . " " . $modulePlugins[$i][0] . " - " . $modulePlugins[$i][1] . "
"; } @@ -174,7 +174,7 @@ if ($limit > 0) { $snippetOutput = ''; for ($i = 0; $i < $limit; $i++) { - $class = !in_array('sample', $moduleSnippets[$i][5]) ? "toggle" : "toggle demo"; + $class = !in_array('sample', (array) $moduleSnippets[$i][5]) ? "toggle" : "toggle demo"; $chk = in_array($i, $snippets) || (!$options_selected) ? 'checked="checked"' : ""; $snippetOutput .= "" . $_lang['install_update'] . " " . $moduleSnippets[$i][0] . " - " . $moduleSnippets[$i][1] . "
"; } From 29b19cb2a493c5d30880c44398306f14061e6f9d Mon Sep 17 00:00:00 2001 From: Dmi3yy Date: Sun, 28 Apr 2013 23:44:44 +0300 Subject: [PATCH 011/530] add php doc and manager path constant --- .../includes/document.parser.class.inc.php | 947 ++++++++++++++++-- 1 file changed, 856 insertions(+), 91 deletions(-) diff --git a/manager/includes/document.parser.class.inc.php b/manager/includes/document.parser.class.inc.php index 97ef7d0b5a..e3bb64019c 100755 --- a/manager/includes/document.parser.class.inc.php +++ b/manager/includes/document.parser.class.inc.php @@ -50,7 +50,11 @@ class DocumentParser { var $error_reporting; private $version=array(); - // constructor + /** + * Document constructor + * + * @return DocumentParser + */ function DocumentParser() { global $database_server; if(substr(PHP_OS,0,3) === 'WIN' && $database_server==='localhost') $database_server = '127.0.0.1'; @@ -68,14 +72,21 @@ function DocumentParser() { $this->error_reporting = 1; } - // loads an extension from the extenders folder + /** + * Loads an extension from the extenders folder. + * Currently of limited use - can only load the DBAPI and ManagerAPI. + * + * @global string $database_type + * @param string $extnamegetAllChildren + * @return boolean + */ function loadExtension($extname) { global $database_type; switch ($extname) { // Database API case 'DBAPI' : - if (!include_once MODX_BASE_PATH . 'manager/includes/extenders/dbapi.' . $database_type . '.class.inc.php') + if (!include_once MODX_MANAGER_PATH . 'includes/extenders/dbapi.' . $database_type . '.class.inc.php') return false; $this->db= new DBAPI; return true; @@ -83,7 +94,7 @@ function loadExtension($extname) { // Manager API case 'ManagerAPI' : - if (!include_once MODX_BASE_PATH . 'manager/includes/extenders/manager.api.class.inc.php') + if (!include_once MODX_MANAGER_PATH . 'includes/extenders/manager.api.class.inc.php') return false; $this->manager= new ManagerAPI; return true; @@ -94,11 +105,27 @@ function loadExtension($extname) { } } + /** + * Returns the current micro time + * + * @return float + */ function getMicroTime() { list ($usec, $sec)= explode(' ', microtime()); return ((float) $usec + (float) $sec); } + /** + * Redirect + * + * @global string $base_url + * @global string $site_url + * @param string $url + * @param int $count_attempts + * @param type $type + * @param type $responseCode + * @return boolean + */ function sendRedirect($url, $count_attempts= 0, $type= '', $responseCode= '') { if (empty ($url)) { return false; @@ -146,6 +173,12 @@ function sendRedirect($url, $count_attempts= 0, $type= '', $responseCode= '') { } } + /** + * Forward to another page + * + * @param int $id + * @param string $responseCode + */ function sendForward($id, $responseCode= '') { if ($this->forwards > 0) { $this->forwards= $this->forwards - 1; @@ -163,6 +196,9 @@ function sendForward($id, $responseCode= '') { } } + /** + * Redirect to the error page, by calling sendForward(). This is called for example when the page was not found. + */ function sendErrorPage() { // invoke OnPageNotFound event $this->invokeEvent('OnPageNotFound'); @@ -186,54 +222,93 @@ function sendUnauthorizedPage() { exit(); } - // function to connect to the database - // - deprecated use $modx->db->connect() + /** + * Connect to the database + * + * @deprecated use $modx->db->connect() + */ function dbConnect() { $this->db->connect(); $this->rs= $this->db->conn; // for compatibility } - // function to query the database - // - deprecated use $modx->db->query() + /** + * Query the database + * + * @deprecated use $modx->db->query() + * @param string $sql The SQL statement to execute + * @return resource|bool + */ function dbQuery($sql) { return $this->db->query($sql); } - // function to count the number of rows in a record set + /** + * Count the number of rows in a record set + * + * @deprecated use $modx->db->getRecordCount($rs) + * @param resource + * @return int + */ function recordCount($rs) { return $this->db->getRecordCount($rs); } - // - deprecated, use $modx->db->getRow() + /** + * Get a result row + * + * @deprecated use $modx->db->getRow() + * @param array $rs + * @param string $mode + * @return array + */ function fetchRow($rs, $mode= 'assoc') { return $this->db->getRow($rs, $mode); } - // - deprecated, use $modx->db->getAffectedRows() + /** + * Get the number of rows affected in the last db operation + * + * @deprecated use $modx->db->getAffectedRows() + * @param array $rs + * @return int + */ function affectedRows($rs) { return $this->db->getAffectedRows($rs); } - // - deprecated, use $modx->db->getInsertId() + /** + * Get the ID generated in the last query + * + * @deprecated use $modx->db->getInsertId() + * @param array $rs + * @return int + */ function insertId($rs) { return $this->db->getInsertId($rs); } - // function to close a database connection - // - deprecated, use $modx->db->disconnect() + /** + * Close a database connection + * + * @deprecated use $modx->db->disconnect() + */ function dbClose() { $this->db->disconnect(); } + /** + * Get MODx settings including, but not limited to, the system_settings table + */ function getSettings() { if (!is_array($this->config) || empty ($this->config)) { if ($included= file_exists(MODX_BASE_PATH . 'assets/cache/siteCache.idx.php')) { $included= include_once (MODX_BASE_PATH . 'assets/cache/siteCache.idx.php'); } if (!$included || !is_array($this->config) || empty ($this->config)) { - include_once MODX_BASE_PATH . "/manager/processors/cache_sync.class.processor.php"; + include_once MODX_MANAGER_PATH . "processors/cache_sync.class.processor.php"; $cache = new synccache(); - $cache->setCachepath(MODX_BASE_PATH . "/assets/cache/"); + $cache->setCachepath(MODX_BASE_PATH . "assets/cache/"); $cache->setReport(false); $rebuilt = $cache->buildCache($this); $included = false; @@ -255,6 +330,8 @@ function getSettings() { $this->config['base_url']= MODX_BASE_URL; $this->config['base_path']= MODX_BASE_PATH; $this->config['site_url']= MODX_SITE_URL; + $this->config['site_manager_url']=MODX_MANAGER_URL; + $this->config['site_manager_path']=MODX_MANAGER_PATH; // load user setting if user is logged in $usrSettings= array (); @@ -304,6 +381,11 @@ function getSettings() { } } + /** + * Get the method by which the current document/resource was requested + * + * @return string 'alias' (friendly url alias) or 'id' + */ function getDocumentMethod() { // function to test the query and find the retrieval method if (isset ($_REQUEST['q'])) { @@ -316,6 +398,12 @@ function getDocumentMethod() { } } + /** + * Returns the document identifier of the current request + * + * @param string $method id and alias are allowed + * @return int + */ function getDocumentIdentifier($method) { // function to test the query and find the retrieval method $docIdentifier= $this->config['site_start']; @@ -334,7 +422,11 @@ function getDocumentIdentifier($method) { return $docIdentifier; } - // check for manager login session + /** + * Check for manager login session + * + * @return boolean + */ function checkSession() { if (isset ($_SESSION['mgrValidated'])) { return true; @@ -343,6 +435,11 @@ function checkSession() { } } + /** + * Checks, if a the result is a preview + * + * @return boolean + */ function checkPreview() { if ($this->checkSession() == true) { if (isset ($_REQUEST['z']) && $_REQUEST['z'] == 'manprev') { @@ -355,7 +452,11 @@ function checkPreview() { } } - // check if site is offline + /** + * check if site is offline + * + * @return boolean + */ function checkSiteStatus() { $siteStatus= $this->config['site_status']; if ($siteStatus == 1) { @@ -371,6 +472,12 @@ function checkSiteStatus() { } } + /** + * Create a 'clean' document identifier with path information, friendly URL suffix and prefix. + * + * @param string $qOrig + * @return string + */ function cleanDocumentIdentifier($qOrig) { (!empty($qOrig)) or $qOrig = $this->config['site_start']; $q= $qOrig; @@ -413,6 +520,12 @@ function cleanDocumentIdentifier($qOrig) { } } + /** + * Check the cache for a specific document/resource + * + * @param int $id + * @return string + */ function checkCache($id) { $cacheFile= "assets/cache/docid_" . $id . ".pageCache.php"; if (file_exists($cacheFile)) { @@ -473,6 +586,16 @@ function checkCache($id) { } } + /** + * Final processing and output of the document/resource. + * + * - runs uncached snippets + * - add javascript to + * - removes unused placeholders + * - converts URL tags [~...~] to URLs + * + * @param boolean $noEvent Default: false + */ function outputContent($noEvent= false) { $this->documentOutput= $this->documentContent; @@ -572,6 +695,9 @@ function outputContent($noEvent= false) { ob_end_flush(); } + /** + * Checks the publish state of page + */ function checkPublishStatus() { $cacheRefreshTime= 0; @include $this->config["base_path"] . "assets/cache/sitePublishing.idx.php"; @@ -645,6 +771,11 @@ function checkPublishStatus() { } } + /** + * Final jobs. + * + * - cache page + */ function postProcess() { // if the current document was generated, cache it! if ($this->documentGenerated == 1 && $this->documentObject['cacheable'] == 1 && $this->documentObject['type'] == 'document' && $this->documentObject['published'] == 1) { @@ -672,6 +803,12 @@ function postProcess() { // end post processing } + /** + * Merge meta tags + * + * @param string $template + * @return string + */ function mergeDocumentMETATags($template) { if ($this->documentObject['haskeywords'] == 1) { // insert keywords @@ -701,12 +838,17 @@ function mergeDocumentMETATags($template) { return $template; } - // mod by Raymond + /** + * Merge content fields and TVs + * + * @param string $template + * @return string + */ function mergeDocumentContent($template) { $replace= array (); preg_match_all('~\[\*(.*?)\*\]~', $template, $matches); $variableCount= count($matches[1]); - $basepath= $this->config["base_path"] . "manager/includes"; + $basepath= MODX_MANAGER_PATH . "includes"; for ($i= 0; $i < $variableCount; $i++) { $key= $matches[1][$i]; $key= substr($key, 0, 1) == '#' ? substr($key, 1) : $key; // remove # for QuickEdit format @@ -725,6 +867,12 @@ function mergeDocumentContent($template) { return $template; } + /** + * Merge system settings + * + * @param string $template + * @return string + */ function mergeSettingsContent($template) { $replace= array (); $matches= array (); @@ -740,6 +888,12 @@ function mergeSettingsContent($template) { return $template; } + /** + * Merge chunks + * + * @param string $content + * @return string + */ function mergeChunkContent($content) { $replace= array (); $matches= array (); @@ -767,7 +921,12 @@ function mergeChunkContent($content) { return $content; } - // Added by Raymond + /** + * Merge placeholder values + * + * @param string $content + * @return string + */ function mergePlaceholderContent($content) { $replace= array (); $matches= array (); @@ -788,7 +947,12 @@ function mergePlaceholderContent($content) { return $content; } - // evalPlugin + /** + * Run a plugin + * + * @param string $pluginCode Code to run + * @param array $params + */ function evalPlugin($pluginCode, $params) { $etomite= $modx= & $this; $modx->event->params= & $params; // store params inside event object @@ -817,6 +981,13 @@ function evalPlugin($pluginCode, $params) { unset ($modx->event->params); } + /** + * Run a snippet + * + * @param string $snippet Code to run + * @param array $params + * @return string + */ function evalSnippet($snippet, $params) { $etomite= $modx= & $this; @@ -849,6 +1020,12 @@ function evalSnippet($snippet, $params) { return $msg . $snip; } + /** + * Run snippets as per the tags in $documentSource and replace the tags with the returned values. + * + * @param string $documentSource + * @return string + */ function evalSnippets($documentSource) { $etomite= & $this; @@ -1036,7 +1213,15 @@ private function _get_snip_properties($snip_call) } return $snippetObject; } - + + /** + * Create a friendly URL + * + * @param string $pre + * @param string $suff + * @param string $alias + * @return string + */ function makeFriendlyURL($pre, $suff, $alias, $isfolder=0) { $Alias = explode('/',$alias); $alias = array_pop($Alias); @@ -1046,6 +1231,12 @@ function makeFriendlyURL($pre, $suff, $alias, $isfolder=0) { return ($dir != '' ? "$dir/" : '') . $pre . $alias . $suff; } + /** + * Convert URL tags [~...~] to URLs + * + * @param string $documentSource + * @return string + */ function rewriteUrls($documentSource) { // rewrite the urls if ($this->config['friendly_urls'] == 1) { @@ -1073,8 +1264,11 @@ function rewriteUrls($documentSource) { } /** - * name: getDocumentObject - used by parser - * desc: returns a document object - $method: alias, id + * Get all db fields and TVs for a document/resource + * + * @param type $method + * @param type $identifier + * @return array */ function getDocumentObject($method, $identifier) { $tblsc= $this->getFullTableName("site_content"); @@ -1153,8 +1347,14 @@ function getDocumentObject($method, $identifier) { } /** - * name: parseDocumentSource - used by parser - * desc: return document source aftering parsing tvs, snippets, chunks, etc. + * Parse a source string. + * + * Handles most MODx tags. Exceptions include: + * - uncached snippet tags [!...!] + * - URL tags [~...~] + * + * @param string $source + * @return string */ function parseDocumentSource($source) { // set the number of times we are to parse the document source @@ -1199,6 +1399,14 @@ function parseDocumentSource($source) { return $source; } + /** + * Starts the parsing operations. + * + * - connects to the db + * - gets the settings (including system_settings) + * - gets the document/resource identifier as in the query string + * - finally calls prepareResponse() + */ function executeParser() { //error_reporting(0); if (version_compare(phpversion(), "5.0.0", ">=")) @@ -1294,6 +1502,15 @@ function executeParser() { $this->prepareResponse(); } + /** + * The next step called at the end of executeParser() + * + * - checks cache + * - checks if document/resource is deleted/unpublished + * - checks if resource is a weblink and redirects if so + * - gets template and parses it + * - ensures that postProcess is called when PHP is finished + */ function prepareResponse() { // we now know the method and identifier, let's check the cache $this->documentContent= $this->checkCache($this->documentIdentifier); @@ -1319,7 +1536,7 @@ function prepareResponse() { $this->sendErrorPage(); } else { // Inculde the necessary files to check document permissions - include_once ($this->config['base_path'] . '/manager/processors/user_documents_permissions.class.php'); + include_once ($this->config['site_manager_path'] . 'processors/user_documents_permissions.class.php'); $udperms= new udperms(); $udperms->user= $this->getLoginUserID(); $udperms->document= $this->documentIdentifier; @@ -1386,10 +1603,13 @@ function prepareResponse() { //$this->postProcess(); } - /***************************************************************************************/ - /* API functions / - /***************************************************************************************/ - + /** + * Returns an array of all parent record IDs for the id passed. + * + * @param int $id Docid to get parents for. + * @param int $height The maximum number of levels to go up, default 10. + * @return array + */ function getParentIds($id, $height= 10) { $parents= array (); while ( $id && $height-- ) { @@ -1403,6 +1623,14 @@ function getParentIds($id, $height= 10) { return $parents; } + /** + * Returns an array of child IDs belonging to the specified parent. + * + * @param int $id The parent resource/document to start from + * @param int $depth How many levels deep to search for children, default: 10 + * @param array $children Optional array of docids to merge with the result. + * @return array Contains the document Listing (tree) like the sitemap + */ function getChildIds($id, $depth= 10, $children= array ()) { // Initialise a static array to index parents->children @@ -1432,7 +1660,12 @@ function getChildIds($id, $depth= 10, $children= array ()) { return $children; } - # Displays a javascript alert message in the web browser + /** + * Displays a javascript alert message in the web browser + * + * @param string $msg Message to show + * @param string $url URL to redirect to + */ function webAlert($msg, $url= "") { $msg= addslashes($this->db->escape($msg)); if (substr(strtolower($url), 0, 11) == "javascript:") { @@ -1449,7 +1682,12 @@ function webAlert($msg, $url= "") { } } - # Returns true if user has the currect permission + /** + * Returns true if user has the currect permission + * + * @param string $pm Permission name + * @return int + */ function hasPermission($pm) { $state= false; $pms= $_SESSION['mgrPermissions']; @@ -1458,7 +1696,15 @@ function hasPermission($pm) { return $state; } - # Add an a alert message to the system event log + /** + * Add an a alert message to the system event log + * + * @param int $evtid Event ID + * @param int $type Types: 1 = information, 2 = warning, 3 = error + * @param string $msg Message to be logged + * @param string $source source of the event (module, snippet name, etc.) + * Default: Parser + */ function logEvent($evtid, $type, $msg, $source= 'Parser') { $msg= $this->db->escape($msg); $source= $this->db->escape($source); @@ -1486,16 +1732,35 @@ function logEvent($evtid, $type, $msg, $source= 'Parser') { } } - # Returns true if parser is executed in backend (manager) mode + /** + * Returns true if we are currently in the manager/backend + * + * @return boolean + */ function isBackend() { return $this->insideManager() ? true : false; } - # Returns true if parser is executed in frontend mode + /** + * Returns true if we are currently in the frontend + * + * @return boolean + */ function isFrontend() { return !$this->insideManager() ? true : false; } + /** + * Gets all child documents of the specified document, including those which are unpublished or deleted. + * + * @param int $id The Document identifier to start with + * @param string $sort Sort field + * Default: menuindex + * @param string $dir Sort direction, ASC and DESC is possible + * Default: ASC + * @param string $fields Default: id, pagetitle, description, parent, alias, menutitle + * @return array + */ function getAllChildren($id= 0, $sort= 'menuindex', $dir= 'ASC', $fields= 'id, pagetitle, description, parent, alias, menutitle') { $tblsc= $this->getFullTableName("site_content"); $tbldg= $this->getFullTableName("document_groups"); @@ -1522,6 +1787,17 @@ function getAllChildren($id= 0, $sort= 'menuindex', $dir= 'ASC', $fields= 'id, p return $resourceArray; } + /** + * Gets all active child documents of the specified document, i.e. those which published and not deleted. + * + * @param int $id The Document identifier to start with + * @param string $sort Sort field + * Default: menuindex + * @param string $dir Sort direction, ASC and DESC is possible + * Default: ASC + * @param string $fields Default: id, pagetitle, description, parent, alias, menutitle + * @return array + */ function getActiveChildren($id= 0, $sort= 'menuindex', $dir= 'ASC', $fields= 'id, pagetitle, description, parent, alias, menutitle') { $tblsc= $this->getFullTableName("site_content"); $tbldg= $this->getFullTableName("document_groups"); @@ -1549,6 +1825,27 @@ function getActiveChildren($id= 0, $sort= 'menuindex', $dir= 'ASC', $fields= 'id return $resourceArray; } + /** + * Returns the children of the selected document/folder. + * + * @param int $parentid The parent document identifier + * Default: 0 (site root) + * @param int $published Whether published or unpublished documents are in the result + * Default: 1 + * @param int $deleted Whether deleted or undeleted documents are in the result + * Default: 0 (undeleted) + * @param string $fields List of fields + * Default: * (all fields) + * @param string $where Where condition in SQL style. Should include a leading 'AND ' + * Default: Empty string + * @param type $sort Should be a comma-separated list of field names on which to sort + * Default: menuindex + * @param string $dir Sort direction, ASC and DESC is possible + * Default: ASC + * @param string|int $limit Should be a valid SQL LIMIT clause without the 'LIMIT' i.e. just include the numbers as a string. + * Default: Empty string (no limit) + * @return array + */ function getDocumentChildren($parentid= 0, $published= 1, $deleted= 0, $fields= "*", $where= '', $sort= "menuindex", $dir= "ASC", $limit= "") { $limit= ($limit != "") ? "LIMIT $limit" : ""; $tblsc= $this->getFullTableName("site_content"); @@ -1579,6 +1876,28 @@ function getDocumentChildren($parentid= 0, $published= 1, $deleted= 0, $fields= return $resourceArray; } + /** + * Returns multiple documents/resources + * + * @category API-Function + * @param array $ids Documents to fetch by docid + * Default: Empty array + * @param int $published Whether published or unpublished documents are in the result + * Default: 1 + * @param int $deleted Whether deleted or undeleted documents are in the result + * Default: 0 (undeleted) + * @param string $fields List of fields + * Default: * (all fields) + * @param string $where Where condition in SQL style. Should include a leading 'AND '. + * Default: Empty string + * @param type $sort Should be a comma-separated list of field names on which to sort + * Default: menuindex + * @param string $dir Sort direction, ASC and DESC is possible + * Default: ASC + * @param string|int $limit Should be a valid SQL LIMIT clause without the 'LIMIT' i.e. just include the numbers as a string. + * Default: Empty string (no limit) + * @return array|boolean Result array with documents, or false + */ function getDocuments($ids= array (), $published= 1, $deleted= 0, $fields= "*", $where= '', $sort= "menuindex", $dir= "ASC", $limit= "") { if (count($ids) == 0) { return false; @@ -1611,6 +1930,20 @@ function getDocuments($ids= array (), $published= 1, $deleted= 0, $fields= "*", } } + /** + * Returns one document/resource + * + * @category API-Function + * @param int $id docid + * Default: 0 (no documents) + * @param string $fields List of fields + * Default: * (all fields) + * @param int $published Whether published or unpublished documents are in the result + * Default: 1 + * @param int $deleted Whether deleted or undeleted documents are in the result + * Default: 0 (undeleted) + * @return boolean|string + */ function getDocument($id= 0, $fields= "*", $published= 1, $deleted= 0) { if ($id == 0) { return false; @@ -1625,6 +1958,19 @@ function getDocument($id= 0, $fields= "*", $published= 1, $deleted= 0) { } } + /** + * Returns the page information as database row, the type of result is + * defined with the parameter $rowMode + * + * @param int $pageid The parent document identifier + * Default: -1 (no result) + * @param int $active Should we fetch only published and undeleted documents/resources? + * 1 = yes, 0 = no + * Default: 1 + * @param string $fields List of fields + * Default: id, pagetitle, description, alias + * @return boolean|array + */ function getPageInfo($pageid= -1, $active= 1, $fields= 'id, pagetitle, description, alias') { if ($pageid == 0) { return false; @@ -1651,6 +1997,18 @@ function getPageInfo($pageid= -1, $active= 1, $fields= 'id, pagetitle, descripti } } + /** + * Returns the parent document/resource of the given docid + * + * @param int $pid The parent docid. If -1, then fetch the current document/resource's parent + * Default: -1 + * @param int $active Should we fetch only published and undeleted documents/resources? + * 1 = yes, 0 = no + * Default: 1 + * @param string $fields List of fields + * Default: id, pagetitle, description, alias + * @return boolean|array + */ function getParent($pid= -1, $active= 1, $fields= 'id, pagetitle, description, alias, parent') { if ($pid == -1) { $pid= $this->documentObject['parent']; @@ -1667,6 +2025,11 @@ function getParent($pid= -1, $active= 1, $fields= 'id, pagetitle, description, a } } + /** + * Returns the id of the current snippet. + * + * @return int + */ function getSnippetId() { if ($this->currentSnippet) { $tbl= $this->getFullTableName("site_snippets"); @@ -1678,10 +2041,20 @@ function getSnippetId() { return 0; } + /** + * Returns the name of the current snippet. + * + * @return string + */ function getSnippetName() { return $this->currentSnippet; } + /** + * Clear the cache of MODX. + * + * @return boolean + */ function clearCache() { $basepath= $this->config["base_path"] . "assets/cache"; if (@ $handle= opendir($basepath)) { @@ -1703,6 +2076,20 @@ function clearCache() { } } + /** + * Create an URL for the given document identifier. The url prefix and + * postfix are used, when friendly_url is active. + * + * @param int $id The document identifier + * @param string $alias The alias name for the document + * Default: Empty string + * @param string $args The paramaters to add to the URL + * Default: Empty string + * @param string $scheme With full as valus, the site url configuration is + * used + * Default: Empty string + * @return string + */ function makeUrl($id, $alias= '', $args= '', $scheme= '') { $url= ''; $virtualDir= ''; @@ -1769,6 +2156,13 @@ function makeUrl($id, $alias= '', $args= '', $scheme= '') { } } + /** + * Returns an entry from the config + * + * Note: most code accesses the config array directly and we will continue to support this. + * + * @return boolean|string + */ function getConfig($name= '') { if (!empty ($this->config[$name])) { return $this->config[$name]; @@ -1777,11 +2171,17 @@ function getConfig($name= '') { } } + /** + * Returns the ClipperCMS version information as version, branch, release date and full application name. + * + * @return array + */ + function getVersionData($data=null) { $out=array(); if(empty($this->version) || !is_array($this->version)){ //include for compatibility modx version < 1.0.10 - include $this->config["base_path"] . "manager/includes/version.inc.php"; + include MODX_MANAGER_PATH . "includes/version.inc.php"; $this->version=array(); $this->version['version']= isset($modx_version) ? $modx_version : ''; $this->version['branch']= isset($modx_branch) ? $modx_branch : ''; @@ -1792,6 +2192,17 @@ function getVersionData($data=null) { return (!is_null($data) && is_array($this->version) && isset($this->version[$data])) ? $this->version[$data] : $this->version; } + /** + * Returns an ordered or unordered HTML list. + * + * @param array $array + * @param string $ulroot Default: root + * @param string $ulprefix Default: sub_ + * @param string $type Default: Empty string + * @param boolean $ordered Default: false + * @param int $tablevel Default: 0 + * @return string + */ function makeList($array, $ulroot= 'root', $ulprefix= 'sub_', $type= '', $ordered= false, $tablevel= 0) { // first find out whether the value passed is an array if (!is_array($array)) { @@ -1818,6 +2229,11 @@ function makeList($array, $ulroot= 'root', $ulprefix= 'sub_', $type= '', $ordere return $listhtml; } + /** + * Returns user login information, as loggedIn (true or false), internal key, username and usertype (web or manager). + * + * @return boolean|array + */ function userLoggedIn() { $userdetails= array (); if ($this->isFrontend() && isset ($_SESSION['webValidated'])) { @@ -1840,6 +2256,13 @@ function userLoggedIn() { } } + /** + * Returns an array with keywords for the current document, or a document with a given docid + * + * @param int $id The docid, 0 means the current document + * Default: 0 + * @return array + */ function getKeywords($id= 0) { if ($id == 0) { $id= $this->documentObject['id']; @@ -1859,6 +2282,13 @@ function getKeywords($id= 0) { return $keywords; } + /** + * Returns an array with meta tags for the current document, or a document with a given docid. + * + * @param int $id The document identifier, 0 means the current document + * Default: 0 + * @return array + */ function getMETATags($id= 0) { if ($id == 0) { $id= $this->documentObject['id']; @@ -1883,6 +2313,13 @@ function getMETATags($id= 0) { return $metatags; } + /** + * Executes a snippet. + * + * @param string $snippetName + * @param array $params Default: Empty array + * @return string + */ function runSnippet($snippetName, $params= array ()) { if (isset ($this->snippetCache[$snippetName])) { $snippet= $this->snippetCache[$snippetName]; @@ -1906,12 +2343,24 @@ function runSnippet($snippetName, $params= array ()) { return $this->evalSnippet($snippet, $parameters); } + /** + * Returns the chunk content for the given chunk name + * + * @param string $chunkName + * @return boolean|string + */ function getChunk($chunkName) { $t= $this->chunkCache[$chunkName]; return $t; } - // deprecated + /** + * Old method that just calls getChunk() + * + * @deprecated Use getChunk + * @param string $chunkName + * @return boolean|string + */ function putChunk($chunkName) { // alias name >.< return $this->getChunk($chunkName); } @@ -1927,11 +2376,24 @@ function parseChunk($chunkName, $chunkArr, $prefix= "{", $suffix= "}") { return $chunk; } + /** + * Get data from phpSniff + * + * @category API-Function + * @return array + */ function getUserData() { - include $this->config["base_path"] . "manager/includes/extenders/getUserData.extender.php"; + include MODX_MANAGER_PATH . "includes/extenders/getUserData.extender.php"; return $tmpArray; } + /** + * Returns the timestamp in the date format defined in $this->config['datetime_format'] + * + * @param int $timestamp Default: 0 + * @param string $mode Default: Empty string (adds the time as below). Can also be 'dateOnly' for no time or 'formatOnly' to get the datetime_format string. + * @return string + */ function toDateFormat($timestamp = 0, $mode = '') { $timestamp = trim($timestamp); $timestamp = intval($timestamp); @@ -1963,6 +2425,12 @@ function toDateFormat($timestamp = 0, $mode = '') { return $strTime; } + /** + * Make a timestamp from a string corresponding to the format in $this->config['datetime_format'] + * + * @param string $str + * @return string + */ function toTimeStamp($str) { $str = trim($str); if (empty($str)) {return '';} @@ -1993,10 +2461,30 @@ function toTimeStamp($str) { return $timeStamp; } - #:::::::::::::::::::::::::::::::::::::::: - # Added By: Raymond Irving - MODx - # - + /** + * Get the TVs of a document's children. Returns an array where each element represents one child doc. + * + * Ignores deleted children. Gets all children - there is no where clause available. + * + * @param int $parentid The parent docid + * Default: 0 (site root) + * @param array $tvidnames. Which TVs to fetch - Can relate to the TV ids in the db (array elements should be numeric only) + * or the TV names (array elements should be names only) + * Default: Empty array + * @param int $published Whether published or unpublished documents are in the result + * Default: 1 + * @param string $docsort How to sort the result array (field) + * Default: menuindex + * @param ASC $docsortdir How to sort the result array (direction) + * Default: ASC + * @param string $tvfields Fields to fetch from site_tmplvars, default '*' + * Default: * + * @param string $tvsort How to sort each element of the result array i.e. how to sort the TVs (field) + * Default: rank + * @param string $tvsortdir How to sort each element of the result array i.e. how to sort the TVs (direction) + * Default: ASC + * @return boolean|array + */ function getDocumentChildrenTVars($parentid= 0, $tvidnames= array (), $published= 1, $docsort= "menuindex", $docsortdir= "ASC", $tvfields= "*", $tvsort= "rank", $tvsortdir= "ASC") { $docs= $this->getDocumentChildren($parentid, $published, 0, '*', '', $docsort, $docsortdir); if (!$docs) @@ -2050,6 +2538,25 @@ function getDocumentChildrenTVars($parentid= 0, $tvidnames= array (), $published } } + /** + * Get the TV outputs of a document's children. + * + * Returns an array where each element represents one child doc and contains the result from getTemplateVarOutput() + * + * Ignores deleted children. Gets all children - there is no where clause available. + * + * @param int $parentid The parent docid + * Default: 0 (site root) + * @param array $tvidnames. Which TVs to fetch. In the form expected by getTemplateVarOutput(). + * Default: Empty array + * @param int $published Whether published or unpublished documents are in the result + * Default: 1 + * @param string $docsort How to sort the result array (field) + * Default: menuindex + * @param ASC $docsortdir How to sort the result array (direction) + * Default: ASC + * @return boolean|array + */ function getDocumentChildrenTVarOutput($parentid= 0, $tvidnames= array (), $published= 1, $docsort= "menuindex", $docsortdir= "ASC") { $docs= $this->getDocumentChildren($parentid, $published, 0, '*', '', $docsort, $docsortdir); if (!$docs) @@ -2065,8 +2572,21 @@ function getDocumentChildrenTVarOutput($parentid= 0, $tvidnames= array (), $publ } } - // Modified by Raymond for TV - Orig Modified by Apodigm - DocVars - # returns a single TV record. $idnames - can be an id or name that belongs the template that the current document is using + /** + * Modified by Raymond for TV - Orig Modified by Apodigm - DocVars + * Returns a single site_content field or TV record from the db. + * + * If a site content field the result is an associative array of 'name' and 'value'. + * + * If a TV the result is an array representing a db row including the fields specified in $fields. + * + * @param string $idname Can be a TV id or name + * @param string $fields Fields to fetch from site_tmplvars. Default: * + * @param type $docid Docid. Defaults to empty string which indicates the current document. + * @param int $published Whether published or unpublished documents are in the result + * Default: 1 + * @return boolean + */ function getTemplateVar($idname= "", $fields= "*", $docid= "", $published= 1) { if ($idname == "") { return false; @@ -2076,7 +2596,27 @@ function getTemplateVar($idname= "", $fields= "*", $docid= "", $published= 1) { } } - # returns an array of TV records. $idnames - can be an id or name that belongs the template that the current document is using + /** + * Returns an array of site_content field fields and/or TV records from the db + * + * Elements representing a site content field consist of an associative array of 'name' and 'value'. + * + * Elements representing a TV consist of an array representing a db row including the fields specified in $fields. + * + * @param array $idnames Which TVs to fetch - Can relate to the TV ids in the db (array elements should be numeric only) + * or the TV names (array elements should be names only) + * Default: Empty array + * @param string $fields Fields to fetch from site_tmplvars. + * Default: * + * @param string $docid Docid. Defaults to empty string which indicates the current document. + * @param int $published Whether published or unpublished documents are in the result + * Default: 1 + * @param string $sort How to sort the result array (field) + * Default: rank + * @param string $dir How to sort the result array (direction) + * Default: ASC + * @return boolean|array + */ function getTemplateVars($idnames= array (), $fields= "*", $docid= "", $published= 1, $sort= "rank", $dir= "ASC") { if (($idnames != '*' && !is_array($idnames)) || count($idnames) == 0) { return false; @@ -2126,7 +2666,18 @@ function getTemplateVars($idnames= array (), $fields= "*", $docid= "", $publishe } } - # returns an associative array containing TV rendered output values. $idnames - can be an id or name that belongs the template that the current document is using + /** + * Returns an associative array containing TV rendered output values. + * + * @param type $idnames Which TVs to fetch - Can relate to the TV ids in the db (array elements should be numeric only) + * or the TV names (array elements should be names only) + * Default: Empty array + * @param string $docid Docid. Defaults to empty string which indicates the current document. + * @param int $published Whether published or unpublished documents are in the result + * Default: 1 + * @param string $sep + * @return boolean|array + */ function getTemplateVarOutput($idnames= array (), $docid= "", $published= 1, $sep='') { if (count($idnames) == 0) { return false; @@ -2138,7 +2689,7 @@ function getTemplateVarOutput($idnames= array (), $docid= "", $published= 1, $se if ($result == false) return false; else { - $baspath= $this->config["base_path"] . "manager/includes"; + $baspath= MODX_MANAGER_PATH . "includes"; include_once $baspath . "/tmplvars.format.inc.php"; include_once $baspath . "/tmplvars.commands.inc.php"; for ($i= 0; $i < count($result); $i++) { @@ -2152,22 +2703,42 @@ function getTemplateVarOutput($idnames= array (), $docid= "", $published= 1, $se } } - # returns the full table name based on db settings + /** + * Returns the full table name based on db settings + * + * @param string $tbl Table name + * @return string Table name with prefix + */ function getFullTableName($tbl) { return $this->db->config['dbase'] . ".`" . $this->db->config['table_prefix'] . $tbl . "`"; } - # return placeholder value + /** + * Returns the placeholder value + * + * @param string $name Placeholder name + * @return string Placeholder value + */ function getPlaceholder($name) { return $this->placeholders[$name]; } - # sets a value for a placeholder + /** + * Sets a value for a placeholder + * + * @param string $name The name of the placeholder + * @param string $value The value of the placeholder + */ function setPlaceholder($name, $value) { $this->placeholders[$name]= $value; } - # set arrays or object vars as placeholders + /** + * Set placeholders en masse via an array or object. + * + * @param object|array $subject + * @param string $prefix + */ function toPlaceholders($subject, $prefix= '') { if (is_object($subject)) { $subject= get_object_vars($subject); @@ -2179,6 +2750,13 @@ function toPlaceholders($subject, $prefix= '') { } } + /** + * For use by toPlaceholders(); For setting an array or object element as placeholder. + * + * @param string $key + * @param object|array $value + * @param string $prefix + */ function toPlaceholder($key, $value, $prefix= '') { if (is_array($value) || is_object($value)) { $this->toPlaceholders($value, "{$prefix}{$key}."); @@ -2187,21 +2765,39 @@ function toPlaceholder($key, $value, $prefix= '') { } } - # returns the virtual relative path to the manager folder + /** + * Returns the manager relative URL/path with respect to the site root. + * + * @global string $base_url + * @return string The complete URL to the manager folder + */ function getManagerPath() { - global $base_url; - $pth= $base_url . 'manager/'; - return $pth; + return MODX_MANAGER_URL; } - # returns the virtual relative path to the cache folder + /** + * Returns the cache relative URL/path with respect to the site root. + * + * @global string $base_url + * @return string The complete URL to the cache folder + */ function getCachePath() { global $base_url; $pth= $base_url . 'assets/cache/'; return $pth; } - # sends a message to a user's message box + /** + * Sends a message to a user's message box. + * + * @param string $type Type of the message + * @param string $to The recipient of the message + * @param string $from The sender of the message + * @param string $subject The subject of the message + * @param string $msg The message body + * @param int $private Whether it is a private message, or not + * Default : 0 + */ function sendAlert($type, $to, $from, $subject, $msg, $private= 0) { $private= ($private) ? 1 : 0; if (!is_numeric($to)) { @@ -2227,8 +2823,12 @@ function sendAlert($type, $to, $from, $subject, $msg, $private= 0) { $rs= $this->db->query($sql); } - # Returns true, install or interact when inside manager - // deprecated + /** + * Returns true, install or interact when inside manager. + * + * @deprecated + * @return string + */ function insideManager() { $m= false; if (defined('IN_MANAGER_MODE') && IN_MANAGER_MODE == 'true') { @@ -2242,7 +2842,12 @@ function insideManager() { return $m; } - # Returns current user id + /** + * Returns current user id. + * + * @param string $context. Default is an empty string which indicates the method should automatically pick 'web (frontend) or 'mgr' (backend) + * @return string + */ function getLoginUserID($context= '') { if ($context && isset ($_SESSION[$context . 'Validated'])) { return $_SESSION[$context . 'InternalKey']; @@ -2255,7 +2860,12 @@ function getLoginUserID($context= '') { } } - # Returns current user name + /** + * Returns current user name + * + * @param string $context. Default is an empty string which indicates the method should automatically pick 'web (frontend) or 'mgr' (backend) + * @return string + */ function getLoginUserName($context= '') { if (!empty($context) && isset ($_SESSION[$context . 'Validated'])) { return $_SESSION[$context . 'Shortname']; @@ -2268,7 +2878,11 @@ function getLoginUserName($context= '') { } } - # Returns current login user type - web or manager + /** + * Returns current login user type - web or manager + * + * @return string + */ function getLoginUserType() { if ($this->isFrontend() && isset ($_SESSION['webValidated'])) { return 'web'; @@ -2280,7 +2894,12 @@ function getLoginUserType() { } } - # Returns a record for the manager user + /** + * Returns a user info record for the given manager user + * + * @param int $uid + * @return boolean|string + */ function getUserInfo($uid) { $sql= " SELECT mu.username, mu.password, mua.* @@ -2298,7 +2917,12 @@ function getUserInfo($uid) { } } - # Returns a record for the web user + /** + * Returns a record for the web user + * + * @param int $uid + * @return boolean|string + */ function getWebUserInfo($uid) { $sql= " SELECT wu.username, wu.password, wua.* @@ -2316,9 +2940,15 @@ function getWebUserInfo($uid) { } } - # Returns an array of document groups that current user is assigned to. - # This function will first return the web user doc groups when running from frontend otherwise it will return manager user's docgroup - # Set $resolveIds to true to return the document group names + /** + * Returns an array of document groups that current user is assigned to. + * This function will first return the web user doc groups when running from + * frontend otherwise it will return manager user's docgroup. + * + * @param boolean $resolveIds Set to true to return the document group names + * Default: false + * @return string|array + */ function getUserDocGroups($resolveIds= false) { if ($this->isFrontend() && isset ($_SESSION['webDocgroups']) && isset ($_SESSION['webValidated'])) { $dg= $_SESSION['webDocgroups']; @@ -2351,11 +2981,28 @@ function getUserDocGroups($resolveIds= false) { return $dgn; } } + + /** + * Returns an array of document groups that current user is assigned to. + * This function will first return the web user doc groups when running from + * frontend otherwise it will return manager user's docgroup. + * + * @deprecated + * @return string|array + */ function getDocGroups() { return $this->getUserDocGroups(); } // deprecated - # Change current web user's password - returns true if successful, oterhwise return error message + /** + * Change current web user's password + * + * @todo Make password length configurable, allow rules for passwords and translation of messages + * @param string $oldPwd + * @param string $newPwd + * @return string|boolean Returns true if successful, oterhwise return error + * message + */ function changeWebUserPassword($oldPwd, $newPwd) { $rt= false; if ($_SESSION["webValidated"] == 1) { @@ -2386,11 +3033,25 @@ function changeWebUserPassword($oldPwd, $newPwd) { } } } + + /** + * Change current web user's password + * + * @deprecated + * @param string $o + * @param string $n + * @return string|boolean + */ function changePassword($o, $n) { return changeWebUserPassword($o, $n); } // deprecated - # returns true if the current web user is a member the specified groups + /** + * Returns true if the current web user is a member the specified groups + * + * @param array $groupNames + * @return boolean + */ function isMemberOfWebGroup($groupNames= array ()) { if (!is_array($groupNames)) return false; @@ -2412,7 +3073,13 @@ function isMemberOfWebGroup($groupNames= array ()) { return false; } - # Registers Client-side CSS scripts - these scripts are loaded at inside the tag + /** + * Registers Client-side CSS scripts - these scripts are loaded at inside + * the tag + * + * @param string $src + * @param string $media Default: Empty string + */ function regClientCSS($src, $media='') { if (empty($src) || isset ($this->loadedjscripts[$src])) return ''; @@ -2427,12 +3094,24 @@ function regClientCSS($src, $media='') { } } - # Registers Startup Client-side JavaScript - these scripts are loaded at inside the tag + /** + * Registers Startup Client-side JavaScript - these scripts are loaded at inside the tag + * + * @param string $src + * @param array $options Default: 'name'=>'', 'version'=>'0', 'plaintext'=>false + */ function regClientStartupScript($src, $options= array('name'=>'', 'version'=>'0', 'plaintext'=>false)) { $this->regClientScript($src, $options, true); } - # Registers Client-side JavaScript - these scripts are loaded at the end of the page unless $startup is true + /** + * Registers Client-side JavaScript these scripts are loaded at the end of the page unless $startup is true + * + * @param string $src + * @param array $options Default: 'name'=>'', 'version'=>'0', 'plaintext'=>false + * @param boolean $startup Default: false + * @return string + */ function regClientScript($src, $options= array('name'=>'', 'version'=>'0', 'plaintext'=>false), $startup= false) { if (empty($src)) return ''; // nothing to register @@ -2496,17 +3175,31 @@ function regClientScript($src, $options= array('name'=>'', 'version'=>'0', 'plai $this->loadedjscripts[$key]['pos']= $pos; } - # Registers Client-side Startup HTML block + /** + * Returns all registered JavaScripts + * + * @return string + */ function regClientStartupHTMLBlock($html) { $this->regClientScript($html, true, true); } - # Registers Client-side HTML block + /** + * Returns all registered startup scripts + * + * @return string + */ function regClientHTMLBlock($html) { $this->regClientScript($html, true); } - # Remove unwanted html tags and snippet, settings and tags + /** + * Remove unwanted html tags and snippet, settings and tags + * + * @param string $html + * @param string $allowed Default: Empty string + * @return string + */ function stripTags($html, $allowed= "") { $t= strip_tags($html, $allowed); $t= preg_replace('~\[\*(.*?)\*\]~', "", $t); //tv @@ -2532,8 +3225,13 @@ function jsonDecode($json, $assoc = false) { $json = str_replace($masked, $unmasked, $json); return json_decode($json, $assoc); } - - # add an event listner to a plugin - only for use within the current execution cycle + /** + * Add an event listner to a plugin - only for use within the current execution cycle + * + * @param string $evtName + * @param string $pluginName + * @return boolean|int + */ function addEventListener($evtName, $pluginName) { if (!$evtName || !$pluginName) return false; @@ -2542,20 +3240,33 @@ function addEventListener($evtName, $pluginName) { return array_push($this->pluginEvent[$evtName], $pluginName); // return array count } - # remove event listner - only for use within the current execution cycle + /** + * Remove event listner - only for use within the current execution cycle + * + * @param string $evtName + * @return boolean + */ function removeEventListener($evtName) { if (!$evtName) return false; unset ($this->pluginEvent[$evtName]); } - # remove all event listners - only for use within the current execution cycle + /** + * Remove all event listners - only for use within the current execution cycle + */ function removeAllEventListener() { unset ($this->pluginEvent); $this->pluginEvent= array (); } - # invoke an event. $extParams - hash array: name=>value + /** + * Invoke an event. + * + * @param string $evtName + * @param array $extParams Parameters available to plugins. Each array key will be the PHP variable name, and the array value will be the variable value. + * @return boolean|array + */ function invokeEvent($evtName, $extParams= array ()) { if (!$evtName) return false; @@ -2607,7 +3318,12 @@ function invokeEvent($evtName, $extParams= array ()) { return $results; } - # parses a resource property string and returns the result as an array + /** + * Parses a resource property string and returns the result as an array + * + * @param string $propertyString + * @return array Associative array in the form property name => property value + */ function parseProperties($propertyString) { $parameter= array (); if (!empty ($propertyString)) { @@ -2634,6 +3350,10 @@ function parseProperties($propertyString) { Etomite ID: rad14701 See documentation for usage details ############################################*/ + + /** + * @depracted Etomite db method + */ function getIntTableRows($fields= "*", $from= "", $where= "", $sort= "", $dir= "ASC", $limit= "") { // function to get rows from ANY internal database table if ($from == "") { @@ -2653,6 +3373,9 @@ function getIntTableRows($fields= "*", $from= "", $where= "", $sort= "", $dir= " } } + /** + * @depracted Etomite db method + */ function putIntTableRow($fields= "", $into= "") { // function to put a row into ANY internal database table if (($fields == "") || ($into == "")) { @@ -2674,6 +3397,9 @@ function putIntTableRow($fields= "", $into= "") { } } + /** + * @depracted Etomite db method + */ function updIntTableRow($fields= "", $into= "", $where= "", $sort= "", $dir= "ASC", $limit= "") { // function to update a row into ANY internal database table if (($fields == "") || ($into == "")) { @@ -2698,6 +3424,9 @@ function updIntTableRow($fields= "", $into= "", $where= "", $sort= "", $dir= "AS } } + /** + * @depracted Etomite db method + */ function getExtTableRows($host= "", $user= "", $pass= "", $dbase= "", $fields= "*", $from= "", $where= "", $sort= "", $dir= "ASC", $limit= "") { // function to get table rows from an external MySQL database if (($host == "") || ($user == "") || ($pass == "") || ($dbase == "") || ($from == "")) { @@ -2718,6 +3447,9 @@ function getExtTableRows($host= "", $user= "", $pass= "", $dbase= "", $fields= " } } + /** + * @depracted Etomite db method + */ function putExtTableRow($host= "", $user= "", $pass= "", $dbase= "", $fields= "", $into= "") { // function to put a row into an external database table if (($host == "") || ($user == "") || ($pass == "") || ($dbase == "") || ($fields == "") || ($into == "")) { @@ -2740,6 +3472,9 @@ function putExtTableRow($host= "", $user= "", $pass= "", $dbase= "", $fields= "" } } + /** + * @depracted Etomite db method + */ function updExtTableRow($host= "", $user= "", $pass= "", $dbase= "", $fields= "", $into= "", $where= "", $sort= "", $dir= "ASC", $limit= "") { // function to update a row into an external database table if (($fields == "") || ($into == "")) { @@ -2765,6 +3500,9 @@ function updExtTableRow($host= "", $user= "", $pass= "", $dbase= "", $fields= "" } } + /** + * @depracted Etomite db method + */ function dbExtConnect($host, $user, $pass, $dbase) { // function to connect to external database $tstart= $this->getMicroTime(); @@ -2781,6 +3519,9 @@ function dbExtConnect($host, $user, $pass, $dbase) { } } + /** + * @depracted Etomite db method + */ function getFormVars($method= "", $prefix= "", $trim= "", $REQUEST_METHOD) { // function to retrieve form results into an associative array $results= array (); @@ -2811,10 +3552,20 @@ function getFormVars($method= "", $prefix= "", $trim= "", $REQUEST_METHOD) { // END New database functions - rad14701 ######################################## - /***************************************************************************************/ - /* End of API functions */ - /***************************************************************************************/ - + /** + * PHP error handler set by http://www.php.net/manual/en/function.set-error-handler.php + * + * Checks the PHP error and calls messageQuit() unless: + * - error_reporting() returns 0, or + * - the PHP error level is 0, or + * - the PHP error level is 8 (E_NOTICE) and stopOnNotice is false + * + * @param int $nr The PHP error level as per http://www.php.net/manual/en/errorfunc.constants.php + * @param string $text Error message + * @param string $file File where the error was detected + * @param string $line Line number within $file + * @return boolean + */ function phpError($nr, $text, $file, $line) { if (error_reporting() == 0 || $nr == 0) { return true; @@ -3030,7 +3781,7 @@ function messageQuit($msg= 'unspecified error', $query= '', $is_error= true, $nr { echo 'MODX Content Manager ' . $version . ' » ' . $release_date . ' - + ' . $str . ''; @@ -3114,7 +3865,9 @@ function nicesize($size) { } -// SystemEvent Class +/** + * System Event Class + */ class SystemEvent { var $name; var $_propagate; @@ -3127,7 +3880,12 @@ function SystemEvent($name= "") { $this->name= $name; } - // used for displaying a message to the user + /** + * Display a message to the user + * + * @global array $SystemAlertMsgQueque + * @param string $msg The message + */ function alert($msg) { global $SystemAlertMsgQueque; if ($msg == "") @@ -3139,11 +3897,18 @@ function alert($msg) { } } - // used for rendering an out on the screen + /** + * Output + * + * @param string $msg + */ function output($msg) { $this->_output .= $msg; } + /** + * Stop event propogation + */ function stopPropagation() { $this->_propagate= false; } From 0116b5a17c6c6387df33e291561b03dccd45a51b Mon Sep 17 00:00:00 2001 From: Dmi3yy Date: Sun, 28 Apr 2013 23:46:26 +0300 Subject: [PATCH 012/530] Revert "add php doc and manager path constant" This reverts commit 29b19cb2a493c5d30880c44398306f14061e6f9d. --- .../includes/document.parser.class.inc.php | 947 ++---------------- 1 file changed, 91 insertions(+), 856 deletions(-) diff --git a/manager/includes/document.parser.class.inc.php b/manager/includes/document.parser.class.inc.php index e3bb64019c..97ef7d0b5a 100755 --- a/manager/includes/document.parser.class.inc.php +++ b/manager/includes/document.parser.class.inc.php @@ -50,11 +50,7 @@ class DocumentParser { var $error_reporting; private $version=array(); - /** - * Document constructor - * - * @return DocumentParser - */ + // constructor function DocumentParser() { global $database_server; if(substr(PHP_OS,0,3) === 'WIN' && $database_server==='localhost') $database_server = '127.0.0.1'; @@ -72,21 +68,14 @@ function DocumentParser() { $this->error_reporting = 1; } - /** - * Loads an extension from the extenders folder. - * Currently of limited use - can only load the DBAPI and ManagerAPI. - * - * @global string $database_type - * @param string $extnamegetAllChildren - * @return boolean - */ + // loads an extension from the extenders folder function loadExtension($extname) { global $database_type; switch ($extname) { // Database API case 'DBAPI' : - if (!include_once MODX_MANAGER_PATH . 'includes/extenders/dbapi.' . $database_type . '.class.inc.php') + if (!include_once MODX_BASE_PATH . 'manager/includes/extenders/dbapi.' . $database_type . '.class.inc.php') return false; $this->db= new DBAPI; return true; @@ -94,7 +83,7 @@ function loadExtension($extname) { // Manager API case 'ManagerAPI' : - if (!include_once MODX_MANAGER_PATH . 'includes/extenders/manager.api.class.inc.php') + if (!include_once MODX_BASE_PATH . 'manager/includes/extenders/manager.api.class.inc.php') return false; $this->manager= new ManagerAPI; return true; @@ -105,27 +94,11 @@ function loadExtension($extname) { } } - /** - * Returns the current micro time - * - * @return float - */ function getMicroTime() { list ($usec, $sec)= explode(' ', microtime()); return ((float) $usec + (float) $sec); } - /** - * Redirect - * - * @global string $base_url - * @global string $site_url - * @param string $url - * @param int $count_attempts - * @param type $type - * @param type $responseCode - * @return boolean - */ function sendRedirect($url, $count_attempts= 0, $type= '', $responseCode= '') { if (empty ($url)) { return false; @@ -173,12 +146,6 @@ function sendRedirect($url, $count_attempts= 0, $type= '', $responseCode= '') { } } - /** - * Forward to another page - * - * @param int $id - * @param string $responseCode - */ function sendForward($id, $responseCode= '') { if ($this->forwards > 0) { $this->forwards= $this->forwards - 1; @@ -196,9 +163,6 @@ function sendForward($id, $responseCode= '') { } } - /** - * Redirect to the error page, by calling sendForward(). This is called for example when the page was not found. - */ function sendErrorPage() { // invoke OnPageNotFound event $this->invokeEvent('OnPageNotFound'); @@ -222,93 +186,54 @@ function sendUnauthorizedPage() { exit(); } - /** - * Connect to the database - * - * @deprecated use $modx->db->connect() - */ + // function to connect to the database + // - deprecated use $modx->db->connect() function dbConnect() { $this->db->connect(); $this->rs= $this->db->conn; // for compatibility } - /** - * Query the database - * - * @deprecated use $modx->db->query() - * @param string $sql The SQL statement to execute - * @return resource|bool - */ + // function to query the database + // - deprecated use $modx->db->query() function dbQuery($sql) { return $this->db->query($sql); } - /** - * Count the number of rows in a record set - * - * @deprecated use $modx->db->getRecordCount($rs) - * @param resource - * @return int - */ + // function to count the number of rows in a record set function recordCount($rs) { return $this->db->getRecordCount($rs); } - /** - * Get a result row - * - * @deprecated use $modx->db->getRow() - * @param array $rs - * @param string $mode - * @return array - */ + // - deprecated, use $modx->db->getRow() function fetchRow($rs, $mode= 'assoc') { return $this->db->getRow($rs, $mode); } - /** - * Get the number of rows affected in the last db operation - * - * @deprecated use $modx->db->getAffectedRows() - * @param array $rs - * @return int - */ + // - deprecated, use $modx->db->getAffectedRows() function affectedRows($rs) { return $this->db->getAffectedRows($rs); } - /** - * Get the ID generated in the last query - * - * @deprecated use $modx->db->getInsertId() - * @param array $rs - * @return int - */ + // - deprecated, use $modx->db->getInsertId() function insertId($rs) { return $this->db->getInsertId($rs); } - /** - * Close a database connection - * - * @deprecated use $modx->db->disconnect() - */ + // function to close a database connection + // - deprecated, use $modx->db->disconnect() function dbClose() { $this->db->disconnect(); } - /** - * Get MODx settings including, but not limited to, the system_settings table - */ function getSettings() { if (!is_array($this->config) || empty ($this->config)) { if ($included= file_exists(MODX_BASE_PATH . 'assets/cache/siteCache.idx.php')) { $included= include_once (MODX_BASE_PATH . 'assets/cache/siteCache.idx.php'); } if (!$included || !is_array($this->config) || empty ($this->config)) { - include_once MODX_MANAGER_PATH . "processors/cache_sync.class.processor.php"; + include_once MODX_BASE_PATH . "/manager/processors/cache_sync.class.processor.php"; $cache = new synccache(); - $cache->setCachepath(MODX_BASE_PATH . "assets/cache/"); + $cache->setCachepath(MODX_BASE_PATH . "/assets/cache/"); $cache->setReport(false); $rebuilt = $cache->buildCache($this); $included = false; @@ -330,8 +255,6 @@ function getSettings() { $this->config['base_url']= MODX_BASE_URL; $this->config['base_path']= MODX_BASE_PATH; $this->config['site_url']= MODX_SITE_URL; - $this->config['site_manager_url']=MODX_MANAGER_URL; - $this->config['site_manager_path']=MODX_MANAGER_PATH; // load user setting if user is logged in $usrSettings= array (); @@ -381,11 +304,6 @@ function getSettings() { } } - /** - * Get the method by which the current document/resource was requested - * - * @return string 'alias' (friendly url alias) or 'id' - */ function getDocumentMethod() { // function to test the query and find the retrieval method if (isset ($_REQUEST['q'])) { @@ -398,12 +316,6 @@ function getDocumentMethod() { } } - /** - * Returns the document identifier of the current request - * - * @param string $method id and alias are allowed - * @return int - */ function getDocumentIdentifier($method) { // function to test the query and find the retrieval method $docIdentifier= $this->config['site_start']; @@ -422,11 +334,7 @@ function getDocumentIdentifier($method) { return $docIdentifier; } - /** - * Check for manager login session - * - * @return boolean - */ + // check for manager login session function checkSession() { if (isset ($_SESSION['mgrValidated'])) { return true; @@ -435,11 +343,6 @@ function checkSession() { } } - /** - * Checks, if a the result is a preview - * - * @return boolean - */ function checkPreview() { if ($this->checkSession() == true) { if (isset ($_REQUEST['z']) && $_REQUEST['z'] == 'manprev') { @@ -452,11 +355,7 @@ function checkPreview() { } } - /** - * check if site is offline - * - * @return boolean - */ + // check if site is offline function checkSiteStatus() { $siteStatus= $this->config['site_status']; if ($siteStatus == 1) { @@ -472,12 +371,6 @@ function checkSiteStatus() { } } - /** - * Create a 'clean' document identifier with path information, friendly URL suffix and prefix. - * - * @param string $qOrig - * @return string - */ function cleanDocumentIdentifier($qOrig) { (!empty($qOrig)) or $qOrig = $this->config['site_start']; $q= $qOrig; @@ -520,12 +413,6 @@ function cleanDocumentIdentifier($qOrig) { } } - /** - * Check the cache for a specific document/resource - * - * @param int $id - * @return string - */ function checkCache($id) { $cacheFile= "assets/cache/docid_" . $id . ".pageCache.php"; if (file_exists($cacheFile)) { @@ -586,16 +473,6 @@ function checkCache($id) { } } - /** - * Final processing and output of the document/resource. - * - * - runs uncached snippets - * - add javascript to - * - removes unused placeholders - * - converts URL tags [~...~] to URLs - * - * @param boolean $noEvent Default: false - */ function outputContent($noEvent= false) { $this->documentOutput= $this->documentContent; @@ -695,9 +572,6 @@ function outputContent($noEvent= false) { ob_end_flush(); } - /** - * Checks the publish state of page - */ function checkPublishStatus() { $cacheRefreshTime= 0; @include $this->config["base_path"] . "assets/cache/sitePublishing.idx.php"; @@ -771,11 +645,6 @@ function checkPublishStatus() { } } - /** - * Final jobs. - * - * - cache page - */ function postProcess() { // if the current document was generated, cache it! if ($this->documentGenerated == 1 && $this->documentObject['cacheable'] == 1 && $this->documentObject['type'] == 'document' && $this->documentObject['published'] == 1) { @@ -803,12 +672,6 @@ function postProcess() { // end post processing } - /** - * Merge meta tags - * - * @param string $template - * @return string - */ function mergeDocumentMETATags($template) { if ($this->documentObject['haskeywords'] == 1) { // insert keywords @@ -838,17 +701,12 @@ function mergeDocumentMETATags($template) { return $template; } - /** - * Merge content fields and TVs - * - * @param string $template - * @return string - */ + // mod by Raymond function mergeDocumentContent($template) { $replace= array (); preg_match_all('~\[\*(.*?)\*\]~', $template, $matches); $variableCount= count($matches[1]); - $basepath= MODX_MANAGER_PATH . "includes"; + $basepath= $this->config["base_path"] . "manager/includes"; for ($i= 0; $i < $variableCount; $i++) { $key= $matches[1][$i]; $key= substr($key, 0, 1) == '#' ? substr($key, 1) : $key; // remove # for QuickEdit format @@ -867,12 +725,6 @@ function mergeDocumentContent($template) { return $template; } - /** - * Merge system settings - * - * @param string $template - * @return string - */ function mergeSettingsContent($template) { $replace= array (); $matches= array (); @@ -888,12 +740,6 @@ function mergeSettingsContent($template) { return $template; } - /** - * Merge chunks - * - * @param string $content - * @return string - */ function mergeChunkContent($content) { $replace= array (); $matches= array (); @@ -921,12 +767,7 @@ function mergeChunkContent($content) { return $content; } - /** - * Merge placeholder values - * - * @param string $content - * @return string - */ + // Added by Raymond function mergePlaceholderContent($content) { $replace= array (); $matches= array (); @@ -947,12 +788,7 @@ function mergePlaceholderContent($content) { return $content; } - /** - * Run a plugin - * - * @param string $pluginCode Code to run - * @param array $params - */ + // evalPlugin function evalPlugin($pluginCode, $params) { $etomite= $modx= & $this; $modx->event->params= & $params; // store params inside event object @@ -981,13 +817,6 @@ function evalPlugin($pluginCode, $params) { unset ($modx->event->params); } - /** - * Run a snippet - * - * @param string $snippet Code to run - * @param array $params - * @return string - */ function evalSnippet($snippet, $params) { $etomite= $modx= & $this; @@ -1020,12 +849,6 @@ function evalSnippet($snippet, $params) { return $msg . $snip; } - /** - * Run snippets as per the tags in $documentSource and replace the tags with the returned values. - * - * @param string $documentSource - * @return string - */ function evalSnippets($documentSource) { $etomite= & $this; @@ -1213,15 +1036,7 @@ private function _get_snip_properties($snip_call) } return $snippetObject; } - - /** - * Create a friendly URL - * - * @param string $pre - * @param string $suff - * @param string $alias - * @return string - */ + function makeFriendlyURL($pre, $suff, $alias, $isfolder=0) { $Alias = explode('/',$alias); $alias = array_pop($Alias); @@ -1231,12 +1046,6 @@ function makeFriendlyURL($pre, $suff, $alias, $isfolder=0) { return ($dir != '' ? "$dir/" : '') . $pre . $alias . $suff; } - /** - * Convert URL tags [~...~] to URLs - * - * @param string $documentSource - * @return string - */ function rewriteUrls($documentSource) { // rewrite the urls if ($this->config['friendly_urls'] == 1) { @@ -1264,11 +1073,8 @@ function rewriteUrls($documentSource) { } /** - * Get all db fields and TVs for a document/resource - * - * @param type $method - * @param type $identifier - * @return array + * name: getDocumentObject - used by parser + * desc: returns a document object - $method: alias, id */ function getDocumentObject($method, $identifier) { $tblsc= $this->getFullTableName("site_content"); @@ -1347,14 +1153,8 @@ function getDocumentObject($method, $identifier) { } /** - * Parse a source string. - * - * Handles most MODx tags. Exceptions include: - * - uncached snippet tags [!...!] - * - URL tags [~...~] - * - * @param string $source - * @return string + * name: parseDocumentSource - used by parser + * desc: return document source aftering parsing tvs, snippets, chunks, etc. */ function parseDocumentSource($source) { // set the number of times we are to parse the document source @@ -1399,14 +1199,6 @@ function parseDocumentSource($source) { return $source; } - /** - * Starts the parsing operations. - * - * - connects to the db - * - gets the settings (including system_settings) - * - gets the document/resource identifier as in the query string - * - finally calls prepareResponse() - */ function executeParser() { //error_reporting(0); if (version_compare(phpversion(), "5.0.0", ">=")) @@ -1502,15 +1294,6 @@ function executeParser() { $this->prepareResponse(); } - /** - * The next step called at the end of executeParser() - * - * - checks cache - * - checks if document/resource is deleted/unpublished - * - checks if resource is a weblink and redirects if so - * - gets template and parses it - * - ensures that postProcess is called when PHP is finished - */ function prepareResponse() { // we now know the method and identifier, let's check the cache $this->documentContent= $this->checkCache($this->documentIdentifier); @@ -1536,7 +1319,7 @@ function prepareResponse() { $this->sendErrorPage(); } else { // Inculde the necessary files to check document permissions - include_once ($this->config['site_manager_path'] . 'processors/user_documents_permissions.class.php'); + include_once ($this->config['base_path'] . '/manager/processors/user_documents_permissions.class.php'); $udperms= new udperms(); $udperms->user= $this->getLoginUserID(); $udperms->document= $this->documentIdentifier; @@ -1603,13 +1386,10 @@ function prepareResponse() { //$this->postProcess(); } - /** - * Returns an array of all parent record IDs for the id passed. - * - * @param int $id Docid to get parents for. - * @param int $height The maximum number of levels to go up, default 10. - * @return array - */ + /***************************************************************************************/ + /* API functions / + /***************************************************************************************/ + function getParentIds($id, $height= 10) { $parents= array (); while ( $id && $height-- ) { @@ -1623,14 +1403,6 @@ function getParentIds($id, $height= 10) { return $parents; } - /** - * Returns an array of child IDs belonging to the specified parent. - * - * @param int $id The parent resource/document to start from - * @param int $depth How many levels deep to search for children, default: 10 - * @param array $children Optional array of docids to merge with the result. - * @return array Contains the document Listing (tree) like the sitemap - */ function getChildIds($id, $depth= 10, $children= array ()) { // Initialise a static array to index parents->children @@ -1660,12 +1432,7 @@ function getChildIds($id, $depth= 10, $children= array ()) { return $children; } - /** - * Displays a javascript alert message in the web browser - * - * @param string $msg Message to show - * @param string $url URL to redirect to - */ + # Displays a javascript alert message in the web browser function webAlert($msg, $url= "") { $msg= addslashes($this->db->escape($msg)); if (substr(strtolower($url), 0, 11) == "javascript:") { @@ -1682,12 +1449,7 @@ function webAlert($msg, $url= "") { } } - /** - * Returns true if user has the currect permission - * - * @param string $pm Permission name - * @return int - */ + # Returns true if user has the currect permission function hasPermission($pm) { $state= false; $pms= $_SESSION['mgrPermissions']; @@ -1696,15 +1458,7 @@ function hasPermission($pm) { return $state; } - /** - * Add an a alert message to the system event log - * - * @param int $evtid Event ID - * @param int $type Types: 1 = information, 2 = warning, 3 = error - * @param string $msg Message to be logged - * @param string $source source of the event (module, snippet name, etc.) - * Default: Parser - */ + # Add an a alert message to the system event log function logEvent($evtid, $type, $msg, $source= 'Parser') { $msg= $this->db->escape($msg); $source= $this->db->escape($source); @@ -1732,35 +1486,16 @@ function logEvent($evtid, $type, $msg, $source= 'Parser') { } } - /** - * Returns true if we are currently in the manager/backend - * - * @return boolean - */ + # Returns true if parser is executed in backend (manager) mode function isBackend() { return $this->insideManager() ? true : false; } - /** - * Returns true if we are currently in the frontend - * - * @return boolean - */ + # Returns true if parser is executed in frontend mode function isFrontend() { return !$this->insideManager() ? true : false; } - /** - * Gets all child documents of the specified document, including those which are unpublished or deleted. - * - * @param int $id The Document identifier to start with - * @param string $sort Sort field - * Default: menuindex - * @param string $dir Sort direction, ASC and DESC is possible - * Default: ASC - * @param string $fields Default: id, pagetitle, description, parent, alias, menutitle - * @return array - */ function getAllChildren($id= 0, $sort= 'menuindex', $dir= 'ASC', $fields= 'id, pagetitle, description, parent, alias, menutitle') { $tblsc= $this->getFullTableName("site_content"); $tbldg= $this->getFullTableName("document_groups"); @@ -1787,17 +1522,6 @@ function getAllChildren($id= 0, $sort= 'menuindex', $dir= 'ASC', $fields= 'id, p return $resourceArray; } - /** - * Gets all active child documents of the specified document, i.e. those which published and not deleted. - * - * @param int $id The Document identifier to start with - * @param string $sort Sort field - * Default: menuindex - * @param string $dir Sort direction, ASC and DESC is possible - * Default: ASC - * @param string $fields Default: id, pagetitle, description, parent, alias, menutitle - * @return array - */ function getActiveChildren($id= 0, $sort= 'menuindex', $dir= 'ASC', $fields= 'id, pagetitle, description, parent, alias, menutitle') { $tblsc= $this->getFullTableName("site_content"); $tbldg= $this->getFullTableName("document_groups"); @@ -1825,27 +1549,6 @@ function getActiveChildren($id= 0, $sort= 'menuindex', $dir= 'ASC', $fields= 'id return $resourceArray; } - /** - * Returns the children of the selected document/folder. - * - * @param int $parentid The parent document identifier - * Default: 0 (site root) - * @param int $published Whether published or unpublished documents are in the result - * Default: 1 - * @param int $deleted Whether deleted or undeleted documents are in the result - * Default: 0 (undeleted) - * @param string $fields List of fields - * Default: * (all fields) - * @param string $where Where condition in SQL style. Should include a leading 'AND ' - * Default: Empty string - * @param type $sort Should be a comma-separated list of field names on which to sort - * Default: menuindex - * @param string $dir Sort direction, ASC and DESC is possible - * Default: ASC - * @param string|int $limit Should be a valid SQL LIMIT clause without the 'LIMIT' i.e. just include the numbers as a string. - * Default: Empty string (no limit) - * @return array - */ function getDocumentChildren($parentid= 0, $published= 1, $deleted= 0, $fields= "*", $where= '', $sort= "menuindex", $dir= "ASC", $limit= "") { $limit= ($limit != "") ? "LIMIT $limit" : ""; $tblsc= $this->getFullTableName("site_content"); @@ -1876,28 +1579,6 @@ function getDocumentChildren($parentid= 0, $published= 1, $deleted= 0, $fields= return $resourceArray; } - /** - * Returns multiple documents/resources - * - * @category API-Function - * @param array $ids Documents to fetch by docid - * Default: Empty array - * @param int $published Whether published or unpublished documents are in the result - * Default: 1 - * @param int $deleted Whether deleted or undeleted documents are in the result - * Default: 0 (undeleted) - * @param string $fields List of fields - * Default: * (all fields) - * @param string $where Where condition in SQL style. Should include a leading 'AND '. - * Default: Empty string - * @param type $sort Should be a comma-separated list of field names on which to sort - * Default: menuindex - * @param string $dir Sort direction, ASC and DESC is possible - * Default: ASC - * @param string|int $limit Should be a valid SQL LIMIT clause without the 'LIMIT' i.e. just include the numbers as a string. - * Default: Empty string (no limit) - * @return array|boolean Result array with documents, or false - */ function getDocuments($ids= array (), $published= 1, $deleted= 0, $fields= "*", $where= '', $sort= "menuindex", $dir= "ASC", $limit= "") { if (count($ids) == 0) { return false; @@ -1930,20 +1611,6 @@ function getDocuments($ids= array (), $published= 1, $deleted= 0, $fields= "*", } } - /** - * Returns one document/resource - * - * @category API-Function - * @param int $id docid - * Default: 0 (no documents) - * @param string $fields List of fields - * Default: * (all fields) - * @param int $published Whether published or unpublished documents are in the result - * Default: 1 - * @param int $deleted Whether deleted or undeleted documents are in the result - * Default: 0 (undeleted) - * @return boolean|string - */ function getDocument($id= 0, $fields= "*", $published= 1, $deleted= 0) { if ($id == 0) { return false; @@ -1958,19 +1625,6 @@ function getDocument($id= 0, $fields= "*", $published= 1, $deleted= 0) { } } - /** - * Returns the page information as database row, the type of result is - * defined with the parameter $rowMode - * - * @param int $pageid The parent document identifier - * Default: -1 (no result) - * @param int $active Should we fetch only published and undeleted documents/resources? - * 1 = yes, 0 = no - * Default: 1 - * @param string $fields List of fields - * Default: id, pagetitle, description, alias - * @return boolean|array - */ function getPageInfo($pageid= -1, $active= 1, $fields= 'id, pagetitle, description, alias') { if ($pageid == 0) { return false; @@ -1997,18 +1651,6 @@ function getPageInfo($pageid= -1, $active= 1, $fields= 'id, pagetitle, descripti } } - /** - * Returns the parent document/resource of the given docid - * - * @param int $pid The parent docid. If -1, then fetch the current document/resource's parent - * Default: -1 - * @param int $active Should we fetch only published and undeleted documents/resources? - * 1 = yes, 0 = no - * Default: 1 - * @param string $fields List of fields - * Default: id, pagetitle, description, alias - * @return boolean|array - */ function getParent($pid= -1, $active= 1, $fields= 'id, pagetitle, description, alias, parent') { if ($pid == -1) { $pid= $this->documentObject['parent']; @@ -2025,11 +1667,6 @@ function getParent($pid= -1, $active= 1, $fields= 'id, pagetitle, description, a } } - /** - * Returns the id of the current snippet. - * - * @return int - */ function getSnippetId() { if ($this->currentSnippet) { $tbl= $this->getFullTableName("site_snippets"); @@ -2041,20 +1678,10 @@ function getSnippetId() { return 0; } - /** - * Returns the name of the current snippet. - * - * @return string - */ function getSnippetName() { return $this->currentSnippet; } - /** - * Clear the cache of MODX. - * - * @return boolean - */ function clearCache() { $basepath= $this->config["base_path"] . "assets/cache"; if (@ $handle= opendir($basepath)) { @@ -2076,20 +1703,6 @@ function clearCache() { } } - /** - * Create an URL for the given document identifier. The url prefix and - * postfix are used, when friendly_url is active. - * - * @param int $id The document identifier - * @param string $alias The alias name for the document - * Default: Empty string - * @param string $args The paramaters to add to the URL - * Default: Empty string - * @param string $scheme With full as valus, the site url configuration is - * used - * Default: Empty string - * @return string - */ function makeUrl($id, $alias= '', $args= '', $scheme= '') { $url= ''; $virtualDir= ''; @@ -2156,13 +1769,6 @@ function makeUrl($id, $alias= '', $args= '', $scheme= '') { } } - /** - * Returns an entry from the config - * - * Note: most code accesses the config array directly and we will continue to support this. - * - * @return boolean|string - */ function getConfig($name= '') { if (!empty ($this->config[$name])) { return $this->config[$name]; @@ -2171,17 +1777,11 @@ function getConfig($name= '') { } } - /** - * Returns the ClipperCMS version information as version, branch, release date and full application name. - * - * @return array - */ - function getVersionData($data=null) { $out=array(); if(empty($this->version) || !is_array($this->version)){ //include for compatibility modx version < 1.0.10 - include MODX_MANAGER_PATH . "includes/version.inc.php"; + include $this->config["base_path"] . "manager/includes/version.inc.php"; $this->version=array(); $this->version['version']= isset($modx_version) ? $modx_version : ''; $this->version['branch']= isset($modx_branch) ? $modx_branch : ''; @@ -2192,17 +1792,6 @@ function getVersionData($data=null) { return (!is_null($data) && is_array($this->version) && isset($this->version[$data])) ? $this->version[$data] : $this->version; } - /** - * Returns an ordered or unordered HTML list. - * - * @param array $array - * @param string $ulroot Default: root - * @param string $ulprefix Default: sub_ - * @param string $type Default: Empty string - * @param boolean $ordered Default: false - * @param int $tablevel Default: 0 - * @return string - */ function makeList($array, $ulroot= 'root', $ulprefix= 'sub_', $type= '', $ordered= false, $tablevel= 0) { // first find out whether the value passed is an array if (!is_array($array)) { @@ -2229,11 +1818,6 @@ function makeList($array, $ulroot= 'root', $ulprefix= 'sub_', $type= '', $ordere return $listhtml; } - /** - * Returns user login information, as loggedIn (true or false), internal key, username and usertype (web or manager). - * - * @return boolean|array - */ function userLoggedIn() { $userdetails= array (); if ($this->isFrontend() && isset ($_SESSION['webValidated'])) { @@ -2256,13 +1840,6 @@ function userLoggedIn() { } } - /** - * Returns an array with keywords for the current document, or a document with a given docid - * - * @param int $id The docid, 0 means the current document - * Default: 0 - * @return array - */ function getKeywords($id= 0) { if ($id == 0) { $id= $this->documentObject['id']; @@ -2282,13 +1859,6 @@ function getKeywords($id= 0) { return $keywords; } - /** - * Returns an array with meta tags for the current document, or a document with a given docid. - * - * @param int $id The document identifier, 0 means the current document - * Default: 0 - * @return array - */ function getMETATags($id= 0) { if ($id == 0) { $id= $this->documentObject['id']; @@ -2313,13 +1883,6 @@ function getMETATags($id= 0) { return $metatags; } - /** - * Executes a snippet. - * - * @param string $snippetName - * @param array $params Default: Empty array - * @return string - */ function runSnippet($snippetName, $params= array ()) { if (isset ($this->snippetCache[$snippetName])) { $snippet= $this->snippetCache[$snippetName]; @@ -2343,24 +1906,12 @@ function runSnippet($snippetName, $params= array ()) { return $this->evalSnippet($snippet, $parameters); } - /** - * Returns the chunk content for the given chunk name - * - * @param string $chunkName - * @return boolean|string - */ function getChunk($chunkName) { $t= $this->chunkCache[$chunkName]; return $t; } - /** - * Old method that just calls getChunk() - * - * @deprecated Use getChunk - * @param string $chunkName - * @return boolean|string - */ + // deprecated function putChunk($chunkName) { // alias name >.< return $this->getChunk($chunkName); } @@ -2376,24 +1927,11 @@ function parseChunk($chunkName, $chunkArr, $prefix= "{", $suffix= "}") { return $chunk; } - /** - * Get data from phpSniff - * - * @category API-Function - * @return array - */ function getUserData() { - include MODX_MANAGER_PATH . "includes/extenders/getUserData.extender.php"; + include $this->config["base_path"] . "manager/includes/extenders/getUserData.extender.php"; return $tmpArray; } - /** - * Returns the timestamp in the date format defined in $this->config['datetime_format'] - * - * @param int $timestamp Default: 0 - * @param string $mode Default: Empty string (adds the time as below). Can also be 'dateOnly' for no time or 'formatOnly' to get the datetime_format string. - * @return string - */ function toDateFormat($timestamp = 0, $mode = '') { $timestamp = trim($timestamp); $timestamp = intval($timestamp); @@ -2425,12 +1963,6 @@ function toDateFormat($timestamp = 0, $mode = '') { return $strTime; } - /** - * Make a timestamp from a string corresponding to the format in $this->config['datetime_format'] - * - * @param string $str - * @return string - */ function toTimeStamp($str) { $str = trim($str); if (empty($str)) {return '';} @@ -2461,30 +1993,10 @@ function toTimeStamp($str) { return $timeStamp; } - /** - * Get the TVs of a document's children. Returns an array where each element represents one child doc. - * - * Ignores deleted children. Gets all children - there is no where clause available. - * - * @param int $parentid The parent docid - * Default: 0 (site root) - * @param array $tvidnames. Which TVs to fetch - Can relate to the TV ids in the db (array elements should be numeric only) - * or the TV names (array elements should be names only) - * Default: Empty array - * @param int $published Whether published or unpublished documents are in the result - * Default: 1 - * @param string $docsort How to sort the result array (field) - * Default: menuindex - * @param ASC $docsortdir How to sort the result array (direction) - * Default: ASC - * @param string $tvfields Fields to fetch from site_tmplvars, default '*' - * Default: * - * @param string $tvsort How to sort each element of the result array i.e. how to sort the TVs (field) - * Default: rank - * @param string $tvsortdir How to sort each element of the result array i.e. how to sort the TVs (direction) - * Default: ASC - * @return boolean|array - */ + #:::::::::::::::::::::::::::::::::::::::: + # Added By: Raymond Irving - MODx + # + function getDocumentChildrenTVars($parentid= 0, $tvidnames= array (), $published= 1, $docsort= "menuindex", $docsortdir= "ASC", $tvfields= "*", $tvsort= "rank", $tvsortdir= "ASC") { $docs= $this->getDocumentChildren($parentid, $published, 0, '*', '', $docsort, $docsortdir); if (!$docs) @@ -2538,25 +2050,6 @@ function getDocumentChildrenTVars($parentid= 0, $tvidnames= array (), $published } } - /** - * Get the TV outputs of a document's children. - * - * Returns an array where each element represents one child doc and contains the result from getTemplateVarOutput() - * - * Ignores deleted children. Gets all children - there is no where clause available. - * - * @param int $parentid The parent docid - * Default: 0 (site root) - * @param array $tvidnames. Which TVs to fetch. In the form expected by getTemplateVarOutput(). - * Default: Empty array - * @param int $published Whether published or unpublished documents are in the result - * Default: 1 - * @param string $docsort How to sort the result array (field) - * Default: menuindex - * @param ASC $docsortdir How to sort the result array (direction) - * Default: ASC - * @return boolean|array - */ function getDocumentChildrenTVarOutput($parentid= 0, $tvidnames= array (), $published= 1, $docsort= "menuindex", $docsortdir= "ASC") { $docs= $this->getDocumentChildren($parentid, $published, 0, '*', '', $docsort, $docsortdir); if (!$docs) @@ -2572,21 +2065,8 @@ function getDocumentChildrenTVarOutput($parentid= 0, $tvidnames= array (), $publ } } - /** - * Modified by Raymond for TV - Orig Modified by Apodigm - DocVars - * Returns a single site_content field or TV record from the db. - * - * If a site content field the result is an associative array of 'name' and 'value'. - * - * If a TV the result is an array representing a db row including the fields specified in $fields. - * - * @param string $idname Can be a TV id or name - * @param string $fields Fields to fetch from site_tmplvars. Default: * - * @param type $docid Docid. Defaults to empty string which indicates the current document. - * @param int $published Whether published or unpublished documents are in the result - * Default: 1 - * @return boolean - */ + // Modified by Raymond for TV - Orig Modified by Apodigm - DocVars + # returns a single TV record. $idnames - can be an id or name that belongs the template that the current document is using function getTemplateVar($idname= "", $fields= "*", $docid= "", $published= 1) { if ($idname == "") { return false; @@ -2596,27 +2076,7 @@ function getTemplateVar($idname= "", $fields= "*", $docid= "", $published= 1) { } } - /** - * Returns an array of site_content field fields and/or TV records from the db - * - * Elements representing a site content field consist of an associative array of 'name' and 'value'. - * - * Elements representing a TV consist of an array representing a db row including the fields specified in $fields. - * - * @param array $idnames Which TVs to fetch - Can relate to the TV ids in the db (array elements should be numeric only) - * or the TV names (array elements should be names only) - * Default: Empty array - * @param string $fields Fields to fetch from site_tmplvars. - * Default: * - * @param string $docid Docid. Defaults to empty string which indicates the current document. - * @param int $published Whether published or unpublished documents are in the result - * Default: 1 - * @param string $sort How to sort the result array (field) - * Default: rank - * @param string $dir How to sort the result array (direction) - * Default: ASC - * @return boolean|array - */ + # returns an array of TV records. $idnames - can be an id or name that belongs the template that the current document is using function getTemplateVars($idnames= array (), $fields= "*", $docid= "", $published= 1, $sort= "rank", $dir= "ASC") { if (($idnames != '*' && !is_array($idnames)) || count($idnames) == 0) { return false; @@ -2666,18 +2126,7 @@ function getTemplateVars($idnames= array (), $fields= "*", $docid= "", $publishe } } - /** - * Returns an associative array containing TV rendered output values. - * - * @param type $idnames Which TVs to fetch - Can relate to the TV ids in the db (array elements should be numeric only) - * or the TV names (array elements should be names only) - * Default: Empty array - * @param string $docid Docid. Defaults to empty string which indicates the current document. - * @param int $published Whether published or unpublished documents are in the result - * Default: 1 - * @param string $sep - * @return boolean|array - */ + # returns an associative array containing TV rendered output values. $idnames - can be an id or name that belongs the template that the current document is using function getTemplateVarOutput($idnames= array (), $docid= "", $published= 1, $sep='') { if (count($idnames) == 0) { return false; @@ -2689,7 +2138,7 @@ function getTemplateVarOutput($idnames= array (), $docid= "", $published= 1, $se if ($result == false) return false; else { - $baspath= MODX_MANAGER_PATH . "includes"; + $baspath= $this->config["base_path"] . "manager/includes"; include_once $baspath . "/tmplvars.format.inc.php"; include_once $baspath . "/tmplvars.commands.inc.php"; for ($i= 0; $i < count($result); $i++) { @@ -2703,42 +2152,22 @@ function getTemplateVarOutput($idnames= array (), $docid= "", $published= 1, $se } } - /** - * Returns the full table name based on db settings - * - * @param string $tbl Table name - * @return string Table name with prefix - */ + # returns the full table name based on db settings function getFullTableName($tbl) { return $this->db->config['dbase'] . ".`" . $this->db->config['table_prefix'] . $tbl . "`"; } - /** - * Returns the placeholder value - * - * @param string $name Placeholder name - * @return string Placeholder value - */ + # return placeholder value function getPlaceholder($name) { return $this->placeholders[$name]; } - /** - * Sets a value for a placeholder - * - * @param string $name The name of the placeholder - * @param string $value The value of the placeholder - */ + # sets a value for a placeholder function setPlaceholder($name, $value) { $this->placeholders[$name]= $value; } - /** - * Set placeholders en masse via an array or object. - * - * @param object|array $subject - * @param string $prefix - */ + # set arrays or object vars as placeholders function toPlaceholders($subject, $prefix= '') { if (is_object($subject)) { $subject= get_object_vars($subject); @@ -2750,13 +2179,6 @@ function toPlaceholders($subject, $prefix= '') { } } - /** - * For use by toPlaceholders(); For setting an array or object element as placeholder. - * - * @param string $key - * @param object|array $value - * @param string $prefix - */ function toPlaceholder($key, $value, $prefix= '') { if (is_array($value) || is_object($value)) { $this->toPlaceholders($value, "{$prefix}{$key}."); @@ -2765,39 +2187,21 @@ function toPlaceholder($key, $value, $prefix= '') { } } - /** - * Returns the manager relative URL/path with respect to the site root. - * - * @global string $base_url - * @return string The complete URL to the manager folder - */ + # returns the virtual relative path to the manager folder function getManagerPath() { - return MODX_MANAGER_URL; + global $base_url; + $pth= $base_url . 'manager/'; + return $pth; } - /** - * Returns the cache relative URL/path with respect to the site root. - * - * @global string $base_url - * @return string The complete URL to the cache folder - */ + # returns the virtual relative path to the cache folder function getCachePath() { global $base_url; $pth= $base_url . 'assets/cache/'; return $pth; } - /** - * Sends a message to a user's message box. - * - * @param string $type Type of the message - * @param string $to The recipient of the message - * @param string $from The sender of the message - * @param string $subject The subject of the message - * @param string $msg The message body - * @param int $private Whether it is a private message, or not - * Default : 0 - */ + # sends a message to a user's message box function sendAlert($type, $to, $from, $subject, $msg, $private= 0) { $private= ($private) ? 1 : 0; if (!is_numeric($to)) { @@ -2823,12 +2227,8 @@ function sendAlert($type, $to, $from, $subject, $msg, $private= 0) { $rs= $this->db->query($sql); } - /** - * Returns true, install or interact when inside manager. - * - * @deprecated - * @return string - */ + # Returns true, install or interact when inside manager + // deprecated function insideManager() { $m= false; if (defined('IN_MANAGER_MODE') && IN_MANAGER_MODE == 'true') { @@ -2842,12 +2242,7 @@ function insideManager() { return $m; } - /** - * Returns current user id. - * - * @param string $context. Default is an empty string which indicates the method should automatically pick 'web (frontend) or 'mgr' (backend) - * @return string - */ + # Returns current user id function getLoginUserID($context= '') { if ($context && isset ($_SESSION[$context . 'Validated'])) { return $_SESSION[$context . 'InternalKey']; @@ -2860,12 +2255,7 @@ function getLoginUserID($context= '') { } } - /** - * Returns current user name - * - * @param string $context. Default is an empty string which indicates the method should automatically pick 'web (frontend) or 'mgr' (backend) - * @return string - */ + # Returns current user name function getLoginUserName($context= '') { if (!empty($context) && isset ($_SESSION[$context . 'Validated'])) { return $_SESSION[$context . 'Shortname']; @@ -2878,11 +2268,7 @@ function getLoginUserName($context= '') { } } - /** - * Returns current login user type - web or manager - * - * @return string - */ + # Returns current login user type - web or manager function getLoginUserType() { if ($this->isFrontend() && isset ($_SESSION['webValidated'])) { return 'web'; @@ -2894,12 +2280,7 @@ function getLoginUserType() { } } - /** - * Returns a user info record for the given manager user - * - * @param int $uid - * @return boolean|string - */ + # Returns a record for the manager user function getUserInfo($uid) { $sql= " SELECT mu.username, mu.password, mua.* @@ -2917,12 +2298,7 @@ function getUserInfo($uid) { } } - /** - * Returns a record for the web user - * - * @param int $uid - * @return boolean|string - */ + # Returns a record for the web user function getWebUserInfo($uid) { $sql= " SELECT wu.username, wu.password, wua.* @@ -2940,15 +2316,9 @@ function getWebUserInfo($uid) { } } - /** - * Returns an array of document groups that current user is assigned to. - * This function will first return the web user doc groups when running from - * frontend otherwise it will return manager user's docgroup. - * - * @param boolean $resolveIds Set to true to return the document group names - * Default: false - * @return string|array - */ + # Returns an array of document groups that current user is assigned to. + # This function will first return the web user doc groups when running from frontend otherwise it will return manager user's docgroup + # Set $resolveIds to true to return the document group names function getUserDocGroups($resolveIds= false) { if ($this->isFrontend() && isset ($_SESSION['webDocgroups']) && isset ($_SESSION['webValidated'])) { $dg= $_SESSION['webDocgroups']; @@ -2981,28 +2351,11 @@ function getUserDocGroups($resolveIds= false) { return $dgn; } } - - /** - * Returns an array of document groups that current user is assigned to. - * This function will first return the web user doc groups when running from - * frontend otherwise it will return manager user's docgroup. - * - * @deprecated - * @return string|array - */ function getDocGroups() { return $this->getUserDocGroups(); } // deprecated - /** - * Change current web user's password - * - * @todo Make password length configurable, allow rules for passwords and translation of messages - * @param string $oldPwd - * @param string $newPwd - * @return string|boolean Returns true if successful, oterhwise return error - * message - */ + # Change current web user's password - returns true if successful, oterhwise return error message function changeWebUserPassword($oldPwd, $newPwd) { $rt= false; if ($_SESSION["webValidated"] == 1) { @@ -3033,25 +2386,11 @@ function changeWebUserPassword($oldPwd, $newPwd) { } } } - - /** - * Change current web user's password - * - * @deprecated - * @param string $o - * @param string $n - * @return string|boolean - */ function changePassword($o, $n) { return changeWebUserPassword($o, $n); } // deprecated - /** - * Returns true if the current web user is a member the specified groups - * - * @param array $groupNames - * @return boolean - */ + # returns true if the current web user is a member the specified groups function isMemberOfWebGroup($groupNames= array ()) { if (!is_array($groupNames)) return false; @@ -3073,13 +2412,7 @@ function isMemberOfWebGroup($groupNames= array ()) { return false; } - /** - * Registers Client-side CSS scripts - these scripts are loaded at inside - * the tag - * - * @param string $src - * @param string $media Default: Empty string - */ + # Registers Client-side CSS scripts - these scripts are loaded at inside the tag function regClientCSS($src, $media='') { if (empty($src) || isset ($this->loadedjscripts[$src])) return ''; @@ -3094,24 +2427,12 @@ function regClientCSS($src, $media='') { } } - /** - * Registers Startup Client-side JavaScript - these scripts are loaded at inside the tag - * - * @param string $src - * @param array $options Default: 'name'=>'', 'version'=>'0', 'plaintext'=>false - */ + # Registers Startup Client-side JavaScript - these scripts are loaded at inside the tag function regClientStartupScript($src, $options= array('name'=>'', 'version'=>'0', 'plaintext'=>false)) { $this->regClientScript($src, $options, true); } - /** - * Registers Client-side JavaScript these scripts are loaded at the end of the page unless $startup is true - * - * @param string $src - * @param array $options Default: 'name'=>'', 'version'=>'0', 'plaintext'=>false - * @param boolean $startup Default: false - * @return string - */ + # Registers Client-side JavaScript - these scripts are loaded at the end of the page unless $startup is true function regClientScript($src, $options= array('name'=>'', 'version'=>'0', 'plaintext'=>false), $startup= false) { if (empty($src)) return ''; // nothing to register @@ -3175,31 +2496,17 @@ function regClientScript($src, $options= array('name'=>'', 'version'=>'0', 'plai $this->loadedjscripts[$key]['pos']= $pos; } - /** - * Returns all registered JavaScripts - * - * @return string - */ + # Registers Client-side Startup HTML block function regClientStartupHTMLBlock($html) { $this->regClientScript($html, true, true); } - /** - * Returns all registered startup scripts - * - * @return string - */ + # Registers Client-side HTML block function regClientHTMLBlock($html) { $this->regClientScript($html, true); } - /** - * Remove unwanted html tags and snippet, settings and tags - * - * @param string $html - * @param string $allowed Default: Empty string - * @return string - */ + # Remove unwanted html tags and snippet, settings and tags function stripTags($html, $allowed= "") { $t= strip_tags($html, $allowed); $t= preg_replace('~\[\*(.*?)\*\]~', "", $t); //tv @@ -3225,13 +2532,8 @@ function jsonDecode($json, $assoc = false) { $json = str_replace($masked, $unmasked, $json); return json_decode($json, $assoc); } - /** - * Add an event listner to a plugin - only for use within the current execution cycle - * - * @param string $evtName - * @param string $pluginName - * @return boolean|int - */ + + # add an event listner to a plugin - only for use within the current execution cycle function addEventListener($evtName, $pluginName) { if (!$evtName || !$pluginName) return false; @@ -3240,33 +2542,20 @@ function addEventListener($evtName, $pluginName) { return array_push($this->pluginEvent[$evtName], $pluginName); // return array count } - /** - * Remove event listner - only for use within the current execution cycle - * - * @param string $evtName - * @return boolean - */ + # remove event listner - only for use within the current execution cycle function removeEventListener($evtName) { if (!$evtName) return false; unset ($this->pluginEvent[$evtName]); } - /** - * Remove all event listners - only for use within the current execution cycle - */ + # remove all event listners - only for use within the current execution cycle function removeAllEventListener() { unset ($this->pluginEvent); $this->pluginEvent= array (); } - /** - * Invoke an event. - * - * @param string $evtName - * @param array $extParams Parameters available to plugins. Each array key will be the PHP variable name, and the array value will be the variable value. - * @return boolean|array - */ + # invoke an event. $extParams - hash array: name=>value function invokeEvent($evtName, $extParams= array ()) { if (!$evtName) return false; @@ -3318,12 +2607,7 @@ function invokeEvent($evtName, $extParams= array ()) { return $results; } - /** - * Parses a resource property string and returns the result as an array - * - * @param string $propertyString - * @return array Associative array in the form property name => property value - */ + # parses a resource property string and returns the result as an array function parseProperties($propertyString) { $parameter= array (); if (!empty ($propertyString)) { @@ -3350,10 +2634,6 @@ function parseProperties($propertyString) { Etomite ID: rad14701 See documentation for usage details ############################################*/ - - /** - * @depracted Etomite db method - */ function getIntTableRows($fields= "*", $from= "", $where= "", $sort= "", $dir= "ASC", $limit= "") { // function to get rows from ANY internal database table if ($from == "") { @@ -3373,9 +2653,6 @@ function getIntTableRows($fields= "*", $from= "", $where= "", $sort= "", $dir= " } } - /** - * @depracted Etomite db method - */ function putIntTableRow($fields= "", $into= "") { // function to put a row into ANY internal database table if (($fields == "") || ($into == "")) { @@ -3397,9 +2674,6 @@ function putIntTableRow($fields= "", $into= "") { } } - /** - * @depracted Etomite db method - */ function updIntTableRow($fields= "", $into= "", $where= "", $sort= "", $dir= "ASC", $limit= "") { // function to update a row into ANY internal database table if (($fields == "") || ($into == "")) { @@ -3424,9 +2698,6 @@ function updIntTableRow($fields= "", $into= "", $where= "", $sort= "", $dir= "AS } } - /** - * @depracted Etomite db method - */ function getExtTableRows($host= "", $user= "", $pass= "", $dbase= "", $fields= "*", $from= "", $where= "", $sort= "", $dir= "ASC", $limit= "") { // function to get table rows from an external MySQL database if (($host == "") || ($user == "") || ($pass == "") || ($dbase == "") || ($from == "")) { @@ -3447,9 +2718,6 @@ function getExtTableRows($host= "", $user= "", $pass= "", $dbase= "", $fields= " } } - /** - * @depracted Etomite db method - */ function putExtTableRow($host= "", $user= "", $pass= "", $dbase= "", $fields= "", $into= "") { // function to put a row into an external database table if (($host == "") || ($user == "") || ($pass == "") || ($dbase == "") || ($fields == "") || ($into == "")) { @@ -3472,9 +2740,6 @@ function putExtTableRow($host= "", $user= "", $pass= "", $dbase= "", $fields= "" } } - /** - * @depracted Etomite db method - */ function updExtTableRow($host= "", $user= "", $pass= "", $dbase= "", $fields= "", $into= "", $where= "", $sort= "", $dir= "ASC", $limit= "") { // function to update a row into an external database table if (($fields == "") || ($into == "")) { @@ -3500,9 +2765,6 @@ function updExtTableRow($host= "", $user= "", $pass= "", $dbase= "", $fields= "" } } - /** - * @depracted Etomite db method - */ function dbExtConnect($host, $user, $pass, $dbase) { // function to connect to external database $tstart= $this->getMicroTime(); @@ -3519,9 +2781,6 @@ function dbExtConnect($host, $user, $pass, $dbase) { } } - /** - * @depracted Etomite db method - */ function getFormVars($method= "", $prefix= "", $trim= "", $REQUEST_METHOD) { // function to retrieve form results into an associative array $results= array (); @@ -3552,20 +2811,10 @@ function getFormVars($method= "", $prefix= "", $trim= "", $REQUEST_METHOD) { // END New database functions - rad14701 ######################################## - /** - * PHP error handler set by http://www.php.net/manual/en/function.set-error-handler.php - * - * Checks the PHP error and calls messageQuit() unless: - * - error_reporting() returns 0, or - * - the PHP error level is 0, or - * - the PHP error level is 8 (E_NOTICE) and stopOnNotice is false - * - * @param int $nr The PHP error level as per http://www.php.net/manual/en/errorfunc.constants.php - * @param string $text Error message - * @param string $file File where the error was detected - * @param string $line Line number within $file - * @return boolean - */ + /***************************************************************************************/ + /* End of API functions */ + /***************************************************************************************/ + function phpError($nr, $text, $file, $line) { if (error_reporting() == 0 || $nr == 0) { return true; @@ -3781,7 +3030,7 @@ function messageQuit($msg= 'unspecified error', $query= '', $is_error= true, $nr { echo 'MODX Content Manager ' . $version . ' » ' . $release_date . ' - + ' . $str . ''; @@ -3865,9 +3114,7 @@ function nicesize($size) { } -/** - * System Event Class - */ +// SystemEvent Class class SystemEvent { var $name; var $_propagate; @@ -3880,12 +3127,7 @@ function SystemEvent($name= "") { $this->name= $name; } - /** - * Display a message to the user - * - * @global array $SystemAlertMsgQueque - * @param string $msg The message - */ + // used for displaying a message to the user function alert($msg) { global $SystemAlertMsgQueque; if ($msg == "") @@ -3897,18 +3139,11 @@ function alert($msg) { } } - /** - * Output - * - * @param string $msg - */ + // used for rendering an out on the screen function output($msg) { $this->_output .= $msg; } - /** - * Stop event propogation - */ function stopPropagation() { $this->_propagate= false; } From 603d0355a5936c7fa7abb690c02cfda9779cea5b Mon Sep 17 00:00:00 2001 From: Dmi3yy Date: Thu, 2 May 2013 20:50:44 +0300 Subject: [PATCH 013/530] fill guid --- install/assets/modules/docmanager.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/assets/modules/docmanager.tpl b/install/assets/modules/docmanager.tpl index 70026951d4..7f860b8f5d 100644 --- a/install/assets/modules/docmanager.tpl +++ b/install/assets/modules/docmanager.tpl @@ -8,7 +8,7 @@ * @version 1.1 * @license http://www.gnu.org/copyleft/gpl.html GNU Public License (GPL) * @internal @properties - * @internal @guid + * @internal @guid docman435243542tf542t5t * @internal @shareparams 1 * @internal @dependencies requires files located at /assets/modules/docmanager/ * @internal @modx_category Manager and Admin From 2e72869eaf98801b047cd04329b5cc5c9e433dce Mon Sep 17 00:00:00 2001 From: Thomas Jakobi Date: Tue, 7 May 2013 15:34:57 +0200 Subject: [PATCH 014/530] Refactor #9911: Update AjaxSearch to 1.9.3b --- .../snippets/ajaxSearch/ajaxSearchPopup.php | 11 +- .../snippets/ajaxSearch/ajaxSearch_readme.txt | 17 +- ...on_192.txt => ajaxSearch_version_193b.txt} | 990 +++++++++--------- .../classes/ajaxSearch.class.inc.php | 8 +- .../classes/ajaxSearchConfig.class.inc.php | 10 +- .../classes/ajaxSearchCtrl.class.inc.php | 6 +- .../classes/ajaxSearchInput.class.inc.php | 7 +- .../classes/ajaxSearchLog.class.inc.php | 6 +- .../classes/ajaxSearchOutput.class.inc.php | 8 +- .../classes/ajaxSearchRequest.class.inc.php | 71 +- .../classes/ajaxSearchResults.class.inc.php | 6 +- .../classes/ajaxSearchUtil.class.inc.php | 6 +- .../classes/asPhxParser.class.inc.php | 38 +- .../ajaxSearch/configs/default.config.php | 4 +- .../documentation/AjaxSearch192_v2.pdf | Bin 123617 -> 0 bytes .../documentation/AjaxSearch193_v1.pdf | Bin 0 -> 122853 bytes .../documentation/migrationFrom185To190.txt | 0 .../ajaxSearch/documentation/readme.txt | 0 .../someConfigsExamples/custom1.config.php | 0 .../someConfigsExamples/custom2.config.php | 0 .../documentation/someCssExamples/search.css | 0 .../imgAjaxResult.tpl.html | 0 .../someTemplatesExamples/imgResult.tpl.html | 0 .../someTemplatesExamples/rankResult.tpl.html | 0 assets/snippets/ajaxSearch/images/asnext.png | Bin assets/snippets/ajaxSearch/images/asprev.png | Bin assets/snippets/ajaxSearch/images/close.png | Bin assets/snippets/ajaxSearch/images/cross.png | Bin .../ajaxSearch/images/indicator.black.gif | Bin .../ajaxSearch/images/indicator.white.gif | Bin assets/snippets/ajaxSearch/images/readme.txt | 0 .../js/ajaxSearch1/ajaxSearch-jquery.js | 6 +- .../js/ajaxSearch1/ajaxSearch-mootools2.js | 6 +- .../ajaxSearch/js/ajaxSearch1/ajaxSearch.js | 6 +- .../js/clearDefault/clearDefault.js | 4 +- .../ajaxSearch/js/comment/ajaxSearchCmt.js | 4 +- .../js/mootools2/mootools-1.2.4-core.js.txt | 0 .../js/mootools2/mootools-1.2.4.4-more.js.txt | 0 .../ajaxSearch/js/mootools2/mootools-1.2.4.js | 0 .../ajaxSearch/js/mootools2/readme.txt | 0 .../ajaxSearch/lang/arabic-utf8.inc.php | 0 .../snippets/ajaxSearch/lang/chinese.inc.php | 0 .../lang/chinese_simplified-utf8.inc.php | 0 .../lang/chinese_simplified.inc.php | 0 .../lang/chinese_traditional-utf8.inc.php | 0 .../lang/chinese_traditional.inc.php | 0 assets/snippets/ajaxSearch/lang/czech.inc.php | 0 .../snippets/ajaxSearch/lang/danish.inc.php | 0 .../ajaxSearch/lang/english-utf8.inc.php | 0 .../snippets/ajaxSearch/lang/english.inc.php | 0 .../ajaxSearch/lang/estonian-utf8.inc.php | 0 .../snippets/ajaxSearch/lang/estonian.inc.php | 0 .../snippets/ajaxSearch/lang/finnish.inc.php | 0 .../ajaxSearch/lang/francais-utf8.inc.php | 0 .../snippets/ajaxSearch/lang/francais.inc.php | 0 .../snippets/ajaxSearch/lang/german.inc.php | 0 .../snippets/ajaxSearch/lang/hebrew.inc.php | 0 .../ajaxSearch/lang/icelandic-utf8.inc.php | 0 .../ajaxSearch/lang/indonesia.inc.php | 0 .../snippets/ajaxSearch/lang/italian.inc.php | 0 .../ajaxSearch/lang/japanese-utf8.inc.php | 0 .../ajaxSearch/lang/nederlands.inc.php | 0 .../ajaxSearch/lang/norsk-utf8.inc.php | 0 assets/snippets/ajaxSearch/lang/norsk.inc.php | 0 .../snippets/ajaxSearch/lang/persian.inc.php | 0 .../ajaxSearch/lang/polish-utf8.inc.php | 0 .../ajaxSearch/lang/portuguese-br.inc.php | 0 .../ajaxSearch/lang/portuguese.inc.php | 0 .../ajaxSearch/lang/russian-UTF8.inc.php | 0 .../snippets/ajaxSearch/lang/russian.inc.php | 0 .../ajaxSearch/lang/slovak-utf8.inc.php | 0 .../snippets/ajaxSearch/lang/slovak.inc.php | 0 .../ajaxSearch/lang/spanish-utf8.inc.php | 0 .../snippets/ajaxSearch/lang/spanish.inc.php | 0 .../ajaxSearch/lang/svenska-utf8.inc.php | 0 .../snippets/ajaxSearch/lang/svenska.inc.php | 0 .../module.ajaxSearchLogManager.txt | 6 +- .../ajaxSearch/plugin.advSearchHighlight.tpl | 2 +- .../ajaxSearch/plugin.searchHighlight.tpl | 2 +- .../ajaxSearch/snippet.ajaxSearch.txt | 14 +- install/assets/plugins/searchhighlight.tpl | 2 +- install/assets/snippets/ajaxSearch.tpl | 13 +- 82 files changed, 645 insertions(+), 608 deletions(-) mode change 100644 => 100755 assets/snippets/ajaxSearch/ajaxSearchPopup.php mode change 100644 => 100755 assets/snippets/ajaxSearch/ajaxSearch_readme.txt rename assets/snippets/ajaxSearch/{ajaxSearch_version_192.txt => ajaxSearch_version_193b.txt} (92%) mode change 100644 => 100755 mode change 100644 => 100755 assets/snippets/ajaxSearch/classes/ajaxSearch.class.inc.php mode change 100644 => 100755 assets/snippets/ajaxSearch/classes/ajaxSearchConfig.class.inc.php mode change 100644 => 100755 assets/snippets/ajaxSearch/classes/ajaxSearchCtrl.class.inc.php mode change 100644 => 100755 assets/snippets/ajaxSearch/classes/ajaxSearchInput.class.inc.php mode change 100644 => 100755 assets/snippets/ajaxSearch/classes/ajaxSearchLog.class.inc.php mode change 100644 => 100755 assets/snippets/ajaxSearch/classes/ajaxSearchOutput.class.inc.php mode change 100644 => 100755 assets/snippets/ajaxSearch/classes/ajaxSearchRequest.class.inc.php mode change 100644 => 100755 assets/snippets/ajaxSearch/classes/ajaxSearchResults.class.inc.php mode change 100644 => 100755 assets/snippets/ajaxSearch/classes/ajaxSearchUtil.class.inc.php mode change 100644 => 100755 assets/snippets/ajaxSearch/classes/asPhxParser.class.inc.php mode change 100644 => 100755 assets/snippets/ajaxSearch/configs/default.config.php delete mode 100644 assets/snippets/ajaxSearch/documentation/AjaxSearch192_v2.pdf create mode 100755 assets/snippets/ajaxSearch/documentation/AjaxSearch193_v1.pdf mode change 100644 => 100755 assets/snippets/ajaxSearch/documentation/migrationFrom185To190.txt mode change 100644 => 100755 assets/snippets/ajaxSearch/documentation/readme.txt mode change 100644 => 100755 assets/snippets/ajaxSearch/documentation/someConfigsExamples/custom1.config.php mode change 100644 => 100755 assets/snippets/ajaxSearch/documentation/someConfigsExamples/custom2.config.php mode change 100644 => 100755 assets/snippets/ajaxSearch/documentation/someCssExamples/search.css mode change 100644 => 100755 assets/snippets/ajaxSearch/documentation/someTemplatesExamples/imgAjaxResult.tpl.html mode change 100644 => 100755 assets/snippets/ajaxSearch/documentation/someTemplatesExamples/imgResult.tpl.html mode change 100644 => 100755 assets/snippets/ajaxSearch/documentation/someTemplatesExamples/rankResult.tpl.html mode change 100644 => 100755 assets/snippets/ajaxSearch/images/asnext.png mode change 100644 => 100755 assets/snippets/ajaxSearch/images/asprev.png mode change 100644 => 100755 assets/snippets/ajaxSearch/images/close.png mode change 100644 => 100755 assets/snippets/ajaxSearch/images/cross.png mode change 100644 => 100755 assets/snippets/ajaxSearch/images/indicator.black.gif mode change 100644 => 100755 assets/snippets/ajaxSearch/images/indicator.white.gif mode change 100644 => 100755 assets/snippets/ajaxSearch/images/readme.txt mode change 100644 => 100755 assets/snippets/ajaxSearch/js/ajaxSearch1/ajaxSearch-jquery.js mode change 100644 => 100755 assets/snippets/ajaxSearch/js/ajaxSearch1/ajaxSearch-mootools2.js mode change 100644 => 100755 assets/snippets/ajaxSearch/js/ajaxSearch1/ajaxSearch.js mode change 100644 => 100755 assets/snippets/ajaxSearch/js/clearDefault/clearDefault.js mode change 100644 => 100755 assets/snippets/ajaxSearch/js/comment/ajaxSearchCmt.js mode change 100644 => 100755 assets/snippets/ajaxSearch/js/mootools2/mootools-1.2.4-core.js.txt mode change 100644 => 100755 assets/snippets/ajaxSearch/js/mootools2/mootools-1.2.4.4-more.js.txt mode change 100644 => 100755 assets/snippets/ajaxSearch/js/mootools2/mootools-1.2.4.js mode change 100644 => 100755 assets/snippets/ajaxSearch/js/mootools2/readme.txt mode change 100644 => 100755 assets/snippets/ajaxSearch/lang/arabic-utf8.inc.php mode change 100644 => 100755 assets/snippets/ajaxSearch/lang/chinese.inc.php mode change 100644 => 100755 assets/snippets/ajaxSearch/lang/chinese_simplified-utf8.inc.php mode change 100644 => 100755 assets/snippets/ajaxSearch/lang/chinese_simplified.inc.php mode change 100644 => 100755 assets/snippets/ajaxSearch/lang/chinese_traditional-utf8.inc.php mode change 100644 => 100755 assets/snippets/ajaxSearch/lang/chinese_traditional.inc.php mode change 100644 => 100755 assets/snippets/ajaxSearch/lang/czech.inc.php mode change 100644 => 100755 assets/snippets/ajaxSearch/lang/danish.inc.php mode change 100644 => 100755 assets/snippets/ajaxSearch/lang/english-utf8.inc.php mode change 100644 => 100755 assets/snippets/ajaxSearch/lang/english.inc.php mode change 100644 => 100755 assets/snippets/ajaxSearch/lang/estonian-utf8.inc.php mode change 100644 => 100755 assets/snippets/ajaxSearch/lang/estonian.inc.php mode change 100644 => 100755 assets/snippets/ajaxSearch/lang/finnish.inc.php mode change 100644 => 100755 assets/snippets/ajaxSearch/lang/francais-utf8.inc.php mode change 100644 => 100755 assets/snippets/ajaxSearch/lang/francais.inc.php mode change 100644 => 100755 assets/snippets/ajaxSearch/lang/german.inc.php mode change 100644 => 100755 assets/snippets/ajaxSearch/lang/hebrew.inc.php mode change 100644 => 100755 assets/snippets/ajaxSearch/lang/icelandic-utf8.inc.php mode change 100644 => 100755 assets/snippets/ajaxSearch/lang/indonesia.inc.php mode change 100644 => 100755 assets/snippets/ajaxSearch/lang/italian.inc.php mode change 100644 => 100755 assets/snippets/ajaxSearch/lang/japanese-utf8.inc.php mode change 100644 => 100755 assets/snippets/ajaxSearch/lang/nederlands.inc.php mode change 100644 => 100755 assets/snippets/ajaxSearch/lang/norsk-utf8.inc.php mode change 100644 => 100755 assets/snippets/ajaxSearch/lang/norsk.inc.php mode change 100644 => 100755 assets/snippets/ajaxSearch/lang/persian.inc.php mode change 100644 => 100755 assets/snippets/ajaxSearch/lang/polish-utf8.inc.php mode change 100644 => 100755 assets/snippets/ajaxSearch/lang/portuguese-br.inc.php mode change 100644 => 100755 assets/snippets/ajaxSearch/lang/portuguese.inc.php mode change 100644 => 100755 assets/snippets/ajaxSearch/lang/russian-UTF8.inc.php mode change 100644 => 100755 assets/snippets/ajaxSearch/lang/russian.inc.php mode change 100644 => 100755 assets/snippets/ajaxSearch/lang/slovak-utf8.inc.php mode change 100644 => 100755 assets/snippets/ajaxSearch/lang/slovak.inc.php mode change 100644 => 100755 assets/snippets/ajaxSearch/lang/spanish-utf8.inc.php mode change 100644 => 100755 assets/snippets/ajaxSearch/lang/spanish.inc.php mode change 100644 => 100755 assets/snippets/ajaxSearch/lang/svenska-utf8.inc.php mode change 100644 => 100755 assets/snippets/ajaxSearch/lang/svenska.inc.php mode change 100644 => 100755 assets/snippets/ajaxSearch/module.ajaxSearchLogManager.txt mode change 100644 => 100755 assets/snippets/ajaxSearch/plugin.advSearchHighlight.tpl mode change 100644 => 100755 assets/snippets/ajaxSearch/plugin.searchHighlight.tpl mode change 100644 => 100755 assets/snippets/ajaxSearch/snippet.ajaxSearch.txt diff --git a/assets/snippets/ajaxSearch/ajaxSearchPopup.php b/assets/snippets/ajaxSearch/ajaxSearchPopup.php old mode 100644 new mode 100755 index ac05ecd2a8..6a485f8b48 --- a/assets/snippets/ajaxSearch/ajaxSearchPopup.php +++ b/assets/snippets/ajaxSearch/ajaxSearchPopup.php @@ -4,9 +4,9 @@ * ----------------------------------------------------------------------------- * ajaxSearchPopup.php * -* @author Coroico - www.modx.wangba.fr -* @version 1.9.2 -* @date 05/12/2010 +* @author Coroico - www.evo.wangba.fr +* @version 1.9.3b +* @date 20/11/2012 * */ @@ -22,7 +22,7 @@ function parseUserConfig($ucfg) { if (isset($_POST['search'])) { - define('AS_VERSION', '1.9.2'); + define('AS_VERSION', '1.9.3'); define('AS_SPATH', 'assets/snippets/ajaxSearch/'); define('AS_PATH', MODX_BASE_PATH . AS_SPATH); @@ -48,7 +48,8 @@ function parseUserConfig($ucfg) { $config = parseUserConfig((strip_tags($_POST['ucfg']))); // Load the custom functions of the custom configuration file if needed if ($config) { - $lconfig = (substr($config, 0, 6) != "@FILE:") ? AS_PATH . "configs/$config.config.php" : $modx->config['base_path'] . trim(substr($config, 6, strlen($config)-6)); + if (substr($config, 0, 6) != "@FILE:") $lconfig = AS_PATH . "configs/{$config}.config.php"; + else return "

AjaxSearch error: @FILE: prefix not allowed !
Check your config parameter or your config file name!

"; if (file_exists($lconfig)) include $lconfig; else return "

AjaxSearch error: " . $lconfig . " not found !
Check your config parameter or your config file name!

"; } diff --git a/assets/snippets/ajaxSearch/ajaxSearch_readme.txt b/assets/snippets/ajaxSearch/ajaxSearch_readme.txt old mode 100644 new mode 100755 index 4800e60e4d..227ff5e2e1 --- a/assets/snippets/ajaxSearch/ajaxSearch_readme.txt +++ b/assets/snippets/ajaxSearch/ajaxSearch_readme.txt @@ -1,5 +1,5 @@ -AjaxSearch Readme version 1.9.2 +AjaxSearch Readme version 1.9.3b --------------------------------------------------------------- :: Snippet: AjaxSearch @@ -8,7 +8,7 @@ AjaxSearch Readme version 1.9.2 Ajax-driven & Flexible Search form Version: - 1.9.2 - 05/12/2010 + 1.9.3b - 20/11/2012 Created by: Coroico - (coroico@wangba.fr) @@ -43,10 +43,16 @@ Many fixes/additions were contributed by mikkelwe/identity/Perrine Originally based on the FlexSearchForm snippet created by jaredc (jaredc@honeydewdesign.com) ---------------------------------------------------------------- -:: Changelog: for more details see www.modx.wangba.fr +:: Changelog: for more details see www.evo.wangba.fr ---------------------------------------------------------------- + 26-september-12 (1.9.3) + -- Bug fixing + -- Removed ajaxsearch's own striptags functions and substituted the use of $modx->stripTags + -- minimum chars allowed to 2 + 05-december-10 (1.9.2) -- Bug fixing + 30-august-10 (1.9.2) -- Bug fixing @@ -457,10 +463,11 @@ The simplest snippet call is [!Ajaxsearch!] without any parameters. Maximum number of words for searching - Default: 5 ----- &minChars [ 2 < int < 100 ] (optional) +---- &minChars [ 1 < int < 100 ] (optional) Minimum number of characters to require for a word to be valid for searching. Length of each word with $advSearch = 'allwords', 'oneword' or 'nowords' Length of the search string with possible spaces with $advSearch = 'exactphrase' + Default is 3. ---- &showInputForm [1 | 0] (optional) @@ -1681,7 +1688,7 @@ Install it as the search highlight plugin. 2. Documentation : http://wiki.modxcms.com/index.php/AjaxSearch -3. Demo site : http://www.modx.wangba.fr +3. Demo site : http://www.evo.wangba.fr 4. Bugs & features : http://svn.modxcms.com/jira/browse/AJAXSEARCH Don't hesitate to signup for an account to post an issue or a new feature diff --git a/assets/snippets/ajaxSearch/ajaxSearch_version_192.txt b/assets/snippets/ajaxSearch/ajaxSearch_version_193b.txt old mode 100644 new mode 100755 similarity index 92% rename from assets/snippets/ajaxSearch/ajaxSearch_version_192.txt rename to assets/snippets/ajaxSearch/ajaxSearch_version_193b.txt index 75d1d43a2e..1ad9345f89 --- a/assets/snippets/ajaxSearch/ajaxSearch_version_192.txt +++ b/assets/snippets/ajaxSearch/ajaxSearch_version_193b.txt @@ -1,502 +1,488 @@ - - AjaxSearch - version 1.9.2 - - Coroico - http://www.modx.wangba.fr - - 05th of December 2010 - -The release 1.9.2 provide the correction of the following issues: - -==== AJAXSEARCH-75 : exactphrase doesn't work when the value is passed thru snippet call -See http://modxcms.com/forums/index.php/topic,55236.0.html - - -==== AJAXSEARCH-76 : TV names not protected in sql request -See http://modxcms.com/forums/index.php/topic,56696.msg330844.html#msg330844l - - -==== AJAXSEARCH-77 : where clause for search terms restriction when the searchstring is empty - - -==== AJAXSEARCH-78 : failed searched never logged -See http://modxcms.com/forums/index.php/topic,53897.msg331714.html#msg331714 - - -==== AJAXSEARCH-79 : tag list now interpreted as tv input list - - -==== AJAXSEARCH-80 : Incorrect strip function for MODx tags -See http://modxcms.com/forums/index.php/topic,57332.msg331855.html#msg331855 - - -==== AJAXSEARCH-81 : orderBy issue when orderBy field not in sc.content table - - -==== AJAXSEARCH-82 : can't define configuration file name with "@FILE:" prefix - - -==== AJAXSEARCH-83 : Searchstring not escaped when logging search request and results -See http://modxcms.com/forums/index.php/topic,57916.0.html - - -No new features are provided with this release. - -===================================================================================== - -Previous versions : - - 1.9.1 delivered the 30th of August 2010 - - 1.9.0 delivered the 18th of May 2010 (provided with MODx 1.0.4) - - 1.8.5 delivered the 20th of March 2010 (provided with MODx 1.0.3) - - 1.8.4 delivered the 20th of October 2009 (provided with MODx1.0.1) - - 1.8.3a delivered the 12th of July 2009 (provided with MODx1.0.0) - - 1.8.3 delivered the 08th June 2009 - - 1.8.2 delivered the 21th April 2009 - - 1.8.1 delivered the 13th October 2008 (provided with MODx0.9.6.3) - - -======================= CHANGES (since 1.8.5) ================================== - - -==== Renaming of some parameters - - For a better and a simpler undertstanding some parameters have been renamed - - AS_showForm => showInputForm - AS_landing => landingPage - AS_showResults => showResults - - -==== Renaming of some $_POST and $_GET variables - - AS_search => search - - -==== Some $_GET variables are now deprecated - - FSF_search is now non interpreted - - -==== &searchWordList deprecated - - The option is now set un the input template - - -==== &resultsPage deprecated - - use landingPage rather this deprecated parameter - - -==== &showMoreResults deprecated - - use moreResultsPage rather this deprecated parameter - - -==== Firebug mode for the debug is deprecated - - Usage of the firebug mode for the debug is deprecated - Negatives values : -1, -2, -3 are now unterstood as 1, 2, 3 - - - -====================== NEW FEATURES (since 1.8.5) ============================== - - -==== Accented characters - search html entities too - - The html entity version of the search terms are also searched. - e.g: "ph&eactute;nomène" and "phnomne" are searched when "phnomne" is searched. - - -==== advSearch - exactphrase - - The search with the advSearch parameter set to "exactphrase" returns only results which - exactly match to the searched terms. - e.g: search "and" doesn't return "band" or "land" just "and" terms. - As this search option use REGEXP, the search could be longer than for the other options. - - -==== Use Google Analytics to track AjaxSearch - - AjaxSearch forms could now use $_POST or $_GET - with $_GET, the query parameter in the URL after you search allow you to track the site - search with Google Analytics. - To do this, simply replace method="post" by method="get" in the input template used - by your ajaxSearch calls. - - -==== timeLimit - increase the allowed execution time of your script - - &timeLimit = [ int | 60 ] - Max execution time in seconds for the AjaxSearch script - 0 - If set to zero, no time limit is imposed - Default: 60 - 1 minute. - - -==== withTvs Define which Template Variables will be used for the search and display of results. - - &withTvs [ [ + | - ] [ : tvlist] ] - by default '' - - The parameter withTvs define which Tv will be added as field result for displaying - and in which tv the search will occur. Only text type TV are enabled - - e.g: - - &withTvs=`tv1,tv2,tv3` - tv1, tv2, Tv3 are added - &withTvs=`+:tv1,tv2,tv3` - tv1, tv2, Tv3 are added - &withTvs=`+` - all tvs of the site are added - - &withTvs=`-` - all tvs of the site are added - &withTvs=`-:tv1,tv2,tv3` - all tvs of the site except tv1, tv2, Tv3 are added - - &withTvs=`` - no tv added - - If &whereSearch contains 'tv' then a tv_value field which contain the concatened - values of all tv of the document is added - - So the tv added could be used for filtering with the filter parameter (see &filter) - - Like the default site content parameters (pagetitle, longtitle, ...) the - Tvs added are available with the following placeholders: - - [+as.tvname+], [+as.tvnameShow+], [+as.tvnameClass+] - - Where tvname is the MODx name of a TV - - [+as.tvname+] is the HTML output of your TV - [+as.tvnameShow+] = 1 if the TV is not NULL - [+as.tvnameClass+] : - - ajaxSearch_resultTvname for the non ajax results (&tplResult) - - AS_ajax_resultTvname for the ajax window (&tplAjaxResult) - - -==== Append the content of some Tvs to your search results with the "tvPhx" parameter - - &tvPhx [ [ + | - ] [ : tvlist] ] - by default '' - - The parameter tvPhx define which additional tv will be added as placeholder. - - e.g: - - &tvPhx=`tv1,tv2,tv3` - tv1, tv2, Tv3 are added as placeholders - &tvPhx=`+:tv1,tv2,tv3` - tv1, tv2, Tv3 are added as placeholders - &tvPhx=`+` - all tvs of the site are added as placeholders - - &tvPhx=`-` - all tvs of the site are added as placeholders - &tvPhx=`-:tv1,tv2,tv3` - all tvs of the site except tv1, tv2, Tv3 are added as placeholders - - &tvPhx=`` - no tv defined as placeholders. - - The following placeholders are anabled with the tv: - - [+as.tvname+], [+as.tvnameShow+], [+as.tvnameClass+] - - Where tvname is the MODx name of a TV - - [+as.tvname+] is the HTML output of your TV - [+as.tvnameShow+] = 1 if the TV is not NULL - [+as.tvnameClass+] : - - ajaxSearch_resultTvname for the non ajax results (&tplResult) - - AS_ajax_resultTvname for the ajax window (&tplAjaxResult) - - The tv value could be used with the filter parameter (see &filter) - - As withTvs includes the TV as a new field in the select clause of the mysql query, - tvPhx append the content of the selected tv after the search and before filer. - - -==== filter - to exclude unwanted documents of the search - - filtering by tv name is now possible - - e.g: &filter=`articleTags,volcano,7` display only documents related to volcanoes. - Documents are filtered by the TV 'articleTags'. - - IMPORTANT : here the tv should be allowed as result with the withTvs or tvPhx - parameters - - -==== Show introduction message under the input form - - &showIntro [ 0 | 1 ] - - To show or hide the introduction message displayed with the input form - Default: 1 (show) - - -==== 2 new paging type added - - &pagingType [ 0 | 1 | 2 | 3 ] : type of pagination - - Default: 1 - - 0: Results Pages 1 | 2 | 3 - 1: Previous - X-Y /Z - Next - 2: X-Y /Z - Show more 10 results - - Type 0 for non-ajax mode only - Type 1 for non-ajax and ajax mode - Type 2 for ajax mode (Jquery only) - - &tplPaging0 - Chunk to style the paging links - type 0 - - &tplPaging1 - Chunk to style the paging links - type 1 - - &tplPaging2 - Chunk to style the paging links - type 2 - - IMPORTANT: - arrow button images are provided with the images folder. - use asprev.png, asnext.png or your own images to define your previous and next buttons. - - e.g: - .paging1Prev{ width:16px; margin:0 3px 0 0;display:block; float:left; text-indent:-3000px; background:url(images/asprev.png) 0 center no-repeat; } - .paging1Next{ width:16px;display:inline-block;text-indent:-3000px; background:url(images/asnext.png) 0 center no-repeat; } - - .paging2More{ margin:10px 10px; padding:8px;background:url(images/asnext.png) 0 center no-repeat;} - - -==== Custom output - - &output [ 0 | 1 ] - - 0 - by default the results are listed below the input form - 1 - custom layout: - - To place the different AjaxSearch elements where you want, use the following placeholders - - [+as.inputForm+] : the input form with the intro message - [+as.results+] : the search results - - The parameter &tplLayout is now deprecated - - The parameter &tplInput is now used to style the ajaxSearch input form - - -==== New modifiers for the ajaxSearch Phx parser - - to include images in your templates, uses the possible following phx modifiers: - - imgwidth : image width - e.g: - provide the image width - - imgheigth : image heigth - e.g: - provide the image height - - imgattr : image attributs - e.g: - provide the image attributes as height="xxx" width="yyy" - - imgmaxwidth=`length` : image max width - e.g: - limit the width of the image to a maximum. Under this limit, keep the true width - - imgmaxheight=`length` : image max height - e.g: - limit the height of the image to a maximum. Under this limit, keep the true height - - These modifiers are particularly usefull with the ajax mode to help html to determine the height of the AjaxSearch pop-up window - - -==== Unique id for AjaxSearch instance - - &asId [ string | ''] - Any combination of characters a-z, underscores, and numbers 0-9 - This is case sensitive. Default = empty string - - This parameter allow distinguish several Ajaxsearch instances on the same page - The id is used to link the snippet calls between them - Choose a short name. eg: "as2" - - -==== Define categories - - &category [ tv_name | ''] - Any combination of characters a-z, underscores, and numbers 0-9 - This is case sensitive. Default = empty string - Name of a TV. The category of a MODx document is provided by this TV content - - e.g: &category=`category` - And the "category" tv value of a document could contain for instance Music, Arts, ... - Then the categConfig function should be defined like that: - - /* - * categConfig : To define the display of categories (output) - * Add a category as a switch item. 'uncategorized' item describe the results outside of any category - * Add a switch for a new site. The default site is named 'defsite'. - * Allowed config parameters : grpLabel, tplResult, tplAjaxResult, display, extract, rank ... - */ - if(!function_exists('categConfig')) { - function categConfig($site='defsite',$category){ - $config = array(); - $site = strtolower($site); - $category = strtolower($category); - switch($site) { - case 'defsite': - switch($category){ - case 'arts': - $config['grpLabel'] = 'Arts'; - $config['tplAjaxResult'] = 'imgResult'; // allow the display of an image - break; - case 'music': - $config['grpLabel'] = 'Music'; - $config['tplAjaxResult'] = 'imgAjaxResult'; // allow the display of an image - break; - case 'geography': - $config['grpLabel'] = 'Geography'; - $config['tplAjaxResult'] = 'imgAjaxResult'; - break; - case '': - $config['grpLabel'] = 'Site wide'; - break; - } - } - return $config; - } - } - - -==== Display the results - - &display [ 'mixed' | 'unmixed' ] - - When results comes from differents subsites (categories), you could choose to display the results mixed or unmixed. - Default: unmixed - Unmixed mode display the results grouped by site or subsite. Each group of results could be paginated. - Mixed mode mixes all the results coming from the differents sites or subsites. - With unmixed mode, results are ordered by the field provided by the first field of the order parameter - e.g: if the subsite "products" has been defined with "product_name, supplier" as order parameter and - the site "employees" has been defined with "job" as order parameter, then the results will be ordered by - "using product_name" value for products and "job" value for "employees". - - -==== GrpResult & AjaxGrpResult templates - - &tplGrpResult - Chunk to style the non-ajax output group result outer - &tplAjaxGrpResult - Chunk to style each output group result outer - - -==== Label for a group of results - - in the configuration file a label could be defined to be be linked with the group of results. - This isn't a snippet parameter. Only a variable of configuration file. - This variable shouldn't contain a comma (",") - - $config['grpLabel'] = 'Arts (Painting)'; - - -==== parents ( in / not in) - - &parents [ [ in | not in ] : comma separated list of Ids | '' ] - - e.g: - &parents=`in:24,25` - do the search in the children documents of documents 24 and 25 - - &parents=`not in:24,10` - do the search in all documents except in the children documents of documents 24 and 10 documents - - &parents=`24,25` means &parents=`in:24,25` (compatible with the 1.8.4 release) - &depth [ 0 < int ] Number of levels deep to retrieve documents - - -==== documents ( in / not in) - - &documents [ [ in | not in ] : comma separated list of Ids | '' ] - - e.g: - &documents=`in:28,29,30,31` - do the search in the documents 28,29,30,31 - - &documents=`not in:28,29,30,31` - do the search in all documents except in documents 28,29,30,31 - - &documents=`28,29,30,31` means &documents=`in:28,29,30,31` (compatible with the 1.8.4 release) - - -==== extracts - - Optimization of the extract algorithm. - - -==== Introduction of the document - - The first characters of the document are displayed when the search occurs with the "nowords" advSearch parameters - or when a filter is applied without any search term. - - The length of the indroduction is provided by extractLength parameter (200 characters by default). - The text displayed is the text defined by the extract parameter (content,description,introtext,tv_value by default) - Obviously without any search term highligthed. - - -==== JQuery & mootools libraries updated with the last versions - - Jquery 1.4.2 & mootools 1.2.4 released with ajaxSearch 1.9.0 - - -==== Javscript disabled - - define the css class "init" to mask the ajaxSearch_output div when javascript is disabled - - e.g: - - #ajaxSearch_output.init { - border: none; - background-color: #FFF; - } - - #ajaxSearch_output { - font-size:90%; - background-color:#EFEFEF; - border:1px solid #6F9303; - color:black; - width:550px; - z-index:1; - padding:5px; - margin:10px 0 15px 0; - } - - -==== pcre_backtrack limit - - The backtrack_limit setting sets the maximum number of bytes preg is allowed - to search over before it gives up. This limit is automatically set to 1600000 - at the beginning of the script and then restored to the initial value at the - end of the script. - - -==== Language files updated - - Six labels have been added for english & french language files. - Thanks to post the missing labels on the ajaxSearch forum board - - Used to display the number of results found: - $_lang['as_resultsTextSingle'] = '%d result found.'; - $_lang['as_resultsTextMultiple'] = '%d results found.'; - - Used to display the total number of results displayed: - $_lang['as_resultsDisplayed'] = 'Displayed: %d'; - - Used to display the number of results displayed by group: - $_lang['as_grpResultsDisplayedText'] = '(Displaying %d - %d of %d)'; - - Used by pagingType 1: - $_lang['as_paging1Text'] = '%d - %d / %d'; - - Used by pagingType 2: - $_lang['as_paging2Text'] = 'Show more %d results'; - - -==== AjaxSearch Logs manager - Follow up the searches of your users ! - - A simple module is provided to display in the manager the last searches run by your - users. This requires to use the asLog parameter. - Use the file module.ajaxSearchLogManager.txt to set a new module. - - -==== Documentation folder - - in the documentation folder, the cheatSheet ajaxSearch192.pdf give a quick - overview of AjaxSearch parameters. Thanks to Goldsky for this contribution. - - The someCssExamples folder give the search.css file used on the demo site to - style ajaxSearch. - - The someConfigsExamples folder provide the configs folder used on the demo - site. - - The someTemplatesExamples folder provide some templates used on the demo site. - - - + + AjaxSearch - version 1.9.3b + + Coroico - http://www.evo.wangba.fr + + 20th of november 2012 + +The release 1.9.3 provide the correction of the following issues: + +==== AJAXSEARCH-82 : can't define configuration file name with "@FILE:" prefix +See http://bugs.modx.com/issues/3533 + + +==== AJAXSEARCH-84 : Unquoted field name in orderby clause +See http://bugs.modx.com/issues/3697 + + +==== AJAXSEARCH-85 : Wrong URL construction when using an array of values (checkboxes) +See http://bugs.modx.com/issues/3698 + + +==== AJAXSEARCH-86 : number of characters not checked when a form with filters is submitted + + +&minChars=2 (less than the default) is now allowed for the search. + + +===================================================================================== + +Previous versions : + - 1.9.3 delivered the 26th of september 2012 + - 1.9.2 delivered the 5th of December 2010 (provided with MODx 1.0.4) + - 1.9.1 delivered the 30th of August 2010 + - 1.9.0 delivered the 18th of May 2010 (provided with MODx 1.0.4) + - 1.8.5 delivered the 20th of March 2010 (provided with MODx 1.0.3) + - 1.8.4 delivered the 20th of October 2009 (provided with MODx1.0.1) + - 1.8.3a delivered the 12th of July 2009 (provided with MODx1.0.0) + - 1.8.3 delivered the 08th June 2009 + - 1.8.2 delivered the 21th April 2009 + - 1.8.1 delivered the 13th October 2008 (provided with MODx0.9.6.3) + + +======================= CHANGES (since 1.8.5) ================================== + + +==== Renaming of some parameters + + For a better and a simpler undertstanding some parameters have been renamed + + AS_showForm => showInputForm + AS_landing => landingPage + AS_showResults => showResults + + +==== Renaming of some $_POST and $_GET variables + + AS_search => search + + +==== Some $_GET variables are now deprecated + + FSF_search is now non interpreted + + +==== &searchWordList deprecated + + The option is now set un the input template + + +==== &resultsPage deprecated + + use landingPage rather this deprecated parameter + + +==== &showMoreResults deprecated + + use moreResultsPage rather this deprecated parameter + + +==== Firebug mode for the debug is deprecated + + Usage of the firebug mode for the debug is deprecated + Negatives values : -1, -2, -3 are now unterstood as 1, 2, 3 + + + +====================== NEW FEATURES (since 1.8.5) ============================== + + +==== Accented characters - search html entities too + + The html entity version of the search terms are also searched. + e.g: "ph&eactute;nomène" and "phnomne" are searched when "phnomne" is searched. + + +==== advSearch - exactphrase + + The search with the advSearch parameter set to "exactphrase" returns only results which + exactly match to the searched terms. + e.g: search "and" doesn't return "band" or "land" just "and" terms. + As this search option use REGEXP, the search could be longer than for the other options. + + +==== Use Google Analytics to track AjaxSearch + + AjaxSearch forms could now use $_POST or $_GET + with $_GET, the query parameter in the URL after you search allow you to track the site + search with Google Analytics. + To do this, simply replace method="post" by method="get" in the input template used + by your ajaxSearch calls. + + +==== timeLimit - increase the allowed execution time of your script + + &timeLimit = [ int | 60 ] + Max execution time in seconds for the AjaxSearch script + 0 - If set to zero, no time limit is imposed + Default: 60 - 1 minute. + + +==== withTvs Define which Template Variables will be used for the search and display of results. + + &withTvs [ [ + | - ] [ : tvlist] ] - by default '' + + The parameter withTvs define which Tv will be added as field result for displaying + and in which tv the search will occur. Only text type TV are enabled + + e.g: + + &withTvs=`tv1,tv2,tv3` - tv1, tv2, Tv3 are added + &withTvs=`+:tv1,tv2,tv3` - tv1, tv2, Tv3 are added + &withTvs=`+` - all tvs of the site are added + + &withTvs=`-` - all tvs of the site are added + &withTvs=`-:tv1,tv2,tv3` - all tvs of the site except tv1, tv2, Tv3 are added + + &withTvs=`` - no tv added + + If &whereSearch contains 'tv' then a tv_value field which contain the concatened + values of all tv of the document is added + + So the tv added could be used for filtering with the filter parameter (see &filter) + + Like the default site content parameters (pagetitle, longtitle, ...) the + Tvs added are available with the following placeholders: + + [+as.tvname+], [+as.tvnameShow+], [+as.tvnameClass+] + + Where tvname is the MODx name of a TV + + [+as.tvname+] is the HTML output of your TV + [+as.tvnameShow+] = 1 if the TV is not NULL + [+as.tvnameClass+] : + - ajaxSearch_resultTvname for the non ajax results (&tplResult) + - AS_ajax_resultTvname for the ajax window (&tplAjaxResult) + + +==== Append the content of some Tvs to your search results with the "tvPhx" parameter + + &tvPhx [ [ + | - ] [ : tvlist] ] - by default '' + + The parameter tvPhx define which additional tv will be added as placeholder. + + e.g: + + &tvPhx=`tv1,tv2,tv3` - tv1, tv2, Tv3 are added as placeholders + &tvPhx=`+:tv1,tv2,tv3` - tv1, tv2, Tv3 are added as placeholders + &tvPhx=`+` - all tvs of the site are added as placeholders + + &tvPhx=`-` - all tvs of the site are added as placeholders + &tvPhx=`-:tv1,tv2,tv3` - all tvs of the site except tv1, tv2, Tv3 are added as placeholders + + &tvPhx=`` - no tv defined as placeholders. + + The following placeholders are anabled with the tv: + + [+as.tvname+], [+as.tvnameShow+], [+as.tvnameClass+] + + Where tvname is the MODx name of a TV + + [+as.tvname+] is the HTML output of your TV + [+as.tvnameShow+] = 1 if the TV is not NULL + [+as.tvnameClass+] : + - ajaxSearch_resultTvname for the non ajax results (&tplResult) + - AS_ajax_resultTvname for the ajax window (&tplAjaxResult) + + The tv value could be used with the filter parameter (see &filter) + + As withTvs includes the TV as a new field in the select clause of the mysql query, + tvPhx append the content of the selected tv after the search and before filer. + + +==== filter - to exclude unwanted documents of the search + + filtering by tv name is now possible + + e.g: &filter=`articleTags,volcano,7` display only documents related to volcanoes. + Documents are filtered by the TV 'articleTags'. + + IMPORTANT : here the tv should be allowed as result with the withTvs or tvPhx + parameters + + +==== Show introduction message under the input form + + &showIntro [ 0 | 1 ] + + To show or hide the introduction message displayed with the input form + Default: 1 (show) + + +==== 2 new paging type added + + &pagingType [ 0 | 1 | 2 | 3 ] : type of pagination + + Default: 1 + + 0: Results Pages 1 | 2 | 3 + 1: Previous - X-Y /Z - Next + 2: X-Y /Z - Show more 10 results + + Type 0 for non-ajax mode only + Type 1 for non-ajax and ajax mode + Type 2 for ajax mode (Jquery only) + + &tplPaging0 - Chunk to style the paging links - type 0 + + &tplPaging1 - Chunk to style the paging links - type 1 + + &tplPaging2 - Chunk to style the paging links - type 2 + + IMPORTANT: + arrow button images are provided with the images folder. + use asprev.png, asnext.png or your own images to define your previous and next buttons. + + e.g: + .paging1Prev{ width:16px; margin:0 3px 0 0;display:block; float:left; text-indent:-3000px; background:url(images/asprev.png) 0 center no-repeat; } + .paging1Next{ width:16px;display:inline-block;text-indent:-3000px; background:url(images/asnext.png) 0 center no-repeat; } + + .paging2More{ margin:10px 10px; padding:8px;background:url(images/asnext.png) 0 center no-repeat;} + + +==== Custom output + + &output [ 0 | 1 ] + + 0 - by default the results are listed below the input form + 1 - custom layout: + + To place the different AjaxSearch elements where you want, use the following placeholders + + [+as.inputForm+] : the input form with the intro message + [+as.results+] : the search results + + The parameter &tplLayout is now deprecated + + The parameter &tplInput is now used to style the ajaxSearch input form + + +==== New modifiers for the ajaxSearch Phx parser + + to include images in your templates, uses the possible following phx modifiers: + + imgwidth : image width - e.g: + provide the image width + + imgheigth : image heigth - e.g: + provide the image height + + imgattr : image attributs - e.g: + provide the image attributes as height="xxx" width="yyy" + + imgmaxwidth=`length` : image max width - e.g: + limit the width of the image to a maximum. Under this limit, keep the true width + + imgmaxheight=`length` : image max height - e.g: + limit the height of the image to a maximum. Under this limit, keep the true height + + These modifiers are particularly usefull with the ajax mode to help html to determine the height of the AjaxSearch pop-up window + + +==== Unique id for AjaxSearch instance + + &asId [ string | ''] + Any combination of characters a-z, underscores, and numbers 0-9 + This is case sensitive. Default = empty string + + This parameter allow distinguish several Ajaxsearch instances on the same page + The id is used to link the snippet calls between them + Choose a short name. eg: "as2" + + +==== Define categories + + &category [ tv_name | ''] + Any combination of characters a-z, underscores, and numbers 0-9 + This is case sensitive. Default = empty string + Name of a TV. The category of a MODx document is provided by this TV content + + e.g: &category=`category` + And the "category" tv value of a document could contain for instance Music, Arts, ... + Then the categConfig function should be defined like that: + + /* + * categConfig : To define the display of categories (output) + * Add a category as a switch item. 'uncategorized' item describe the results outside of any category + * Add a switch for a new site. The default site is named 'defsite'. + * Allowed config parameters : grpLabel, tplResult, tplAjaxResult, display, extract, rank ... + */ + if(!function_exists('categConfig')) { + function categConfig($site='defsite',$category){ + $config = array(); + $site = strtolower($site); + $category = strtolower($category); + switch($site) { + case 'defsite': + switch($category){ + case 'arts': + $config['grpLabel'] = 'Arts'; + $config['tplAjaxResult'] = 'imgResult'; // allow the display of an image + break; + case 'music': + $config['grpLabel'] = 'Music'; + $config['tplAjaxResult'] = 'imgAjaxResult'; // allow the display of an image + break; + case 'geography': + $config['grpLabel'] = 'Geography'; + $config['tplAjaxResult'] = 'imgAjaxResult'; + break; + case '': + $config['grpLabel'] = 'Site wide'; + break; + } + } + return $config; + } + } + + +==== Display the results + + &display [ 'mixed' | 'unmixed' ] + + When results comes from differents subsites (categories), you could choose to display the results mixed or unmixed. + Default: unmixed + Unmixed mode display the results grouped by site or subsite. Each group of results could be paginated. + Mixed mode mixes all the results coming from the differents sites or subsites. + With unmixed mode, results are ordered by the field provided by the first field of the order parameter + e.g: if the subsite "products" has been defined with "product_name, supplier" as order parameter and + the site "employees" has been defined with "job" as order parameter, then the results will be ordered by + "using product_name" value for products and "job" value for "employees". + + +==== GrpResult & AjaxGrpResult templates + + &tplGrpResult - Chunk to style the non-ajax output group result outer + &tplAjaxGrpResult - Chunk to style each output group result outer + + +==== Label for a group of results + + in the configuration file a label could be defined to be be linked with the group of results. + This isn't a snippet parameter. Only a variable of configuration file. + This variable shouldn't contain a comma (",") + + $config['grpLabel'] = 'Arts (Painting)'; + + +==== parents ( in / not in) + + &parents [ [ in | not in ] : comma separated list of Ids | '' ] + + e.g: + &parents=`in:24,25` - do the search in the children documents of documents 24 and 25 + + &parents=`not in:24,10` - do the search in all documents except in the children documents of documents 24 and 10 documents + + &parents=`24,25` means &parents=`in:24,25` (compatible with the 1.8.4 release) + &depth [ 0 < int ] Number of levels deep to retrieve documents + + +==== documents ( in / not in) + + &documents [ [ in | not in ] : comma separated list of Ids | '' ] + + e.g: + &documents=`in:28,29,30,31` - do the search in the documents 28,29,30,31 + + &documents=`not in:28,29,30,31` - do the search in all documents except in documents 28,29,30,31 + + &documents=`28,29,30,31` means &documents=`in:28,29,30,31` (compatible with the 1.8.4 release) + + +==== extracts + + Optimization of the extract algorithm. + + +==== Introduction of the document + + The first characters of the document are displayed when the search occurs with the "nowords" advSearch parameters + or when a filter is applied without any search term. + + The length of the indroduction is provided by extractLength parameter (200 characters by default). + The text displayed is the text defined by the extract parameter (content,description,introtext,tv_value by default) + Obviously without any search term highligthed. + + +==== JQuery & mootools libraries updated with the last versions + + Jquery 1.4.2 & mootools 1.2.4 released with ajaxSearch 1.9.0 + + +==== Javscript disabled + + define the css class "init" to mask the ajaxSearch_output div when javascript is disabled + + e.g: + + #ajaxSearch_output.init { + border: none; + background-color: #FFF; + } + + #ajaxSearch_output { + font-size:90%; + background-color:#EFEFEF; + border:1px solid #6F9303; + color:black; + width:550px; + z-index:1; + padding:5px; + margin:10px 0 15px 0; + } + + +==== pcre_backtrack limit + + The backtrack_limit setting sets the maximum number of bytes preg is allowed + to search over before it gives up. This limit is automatically set to 1600000 + at the beginning of the script and then restored to the initial value at the + end of the script. + + +==== Language files updated + + Six labels have been added for english & french language files. + Thanks to post the missing labels on the ajaxSearch forum board + + Used to display the number of results found: + $_lang['as_resultsTextSingle'] = '%d result found.'; + $_lang['as_resultsTextMultiple'] = '%d results found.'; + + Used to display the total number of results displayed: + $_lang['as_resultsDisplayed'] = 'Displayed: %d'; + + Used to display the number of results displayed by group: + $_lang['as_grpResultsDisplayedText'] = '(Displaying %d - %d of %d)'; + + Used by pagingType 1: + $_lang['as_paging1Text'] = '%d - %d / %d'; + + Used by pagingType 2: + $_lang['as_paging2Text'] = 'Show more %d results'; + + +==== AjaxSearch Logs manager - Follow up the searches of your users ! + + A simple module is provided to display in the manager the last searches run by your + users. This requires to use the asLog parameter. + Use the file module.ajaxSearchLogManager.txt to set a new module. + + +==== Documentation folder + + in the documentation folder, the cheatSheet ajaxSearch192.pdf give a quick + overview of AjaxSearch parameters. Thanks to Goldsky for this contribution. + + The someCssExamples folder give the search.css file used on the demo site to + style ajaxSearch. + + The someConfigsExamples folder provide the configs folder used on the demo + site. + + The someTemplatesExamples folder provide some templates used on the demo site. + + + diff --git a/assets/snippets/ajaxSearch/classes/ajaxSearch.class.inc.php b/assets/snippets/ajaxSearch/classes/ajaxSearch.class.inc.php old mode 100644 new mode 100755 index 6f834adcd6..4aba5da270 --- a/assets/snippets/ajaxSearch/classes/ajaxSearch.class.inc.php +++ b/assets/snippets/ajaxSearch/classes/ajaxSearch.class.inc.php @@ -4,16 +4,16 @@ * ----------------------------------------------------------------------------- * @package AjaxSearch * -* @author Coroico - www.modx.wangba.fr -* @version 1.9.2 -* @date 05/12/2010 +* @author Coroico - www.evo.wangba.fr +* @version 1.9.3 +* @date 26/09/2012 * * Purpose: * The AjaxSearch class contains all functions and data used to manage AjaxSearch * */ -define('MIN_CHARS', 3); // minimum number of characters +define('MIN_CHARS', 2); // minimum number of characters define('MAX_CHARS', 30); // maximum number of characters define('MIN_WORDS', 1); // minimum number of words define('MAX_WORDS', 10); // maximum number of words diff --git a/assets/snippets/ajaxSearch/classes/ajaxSearchConfig.class.inc.php b/assets/snippets/ajaxSearch/classes/ajaxSearchConfig.class.inc.php old mode 100644 new mode 100755 index 4551f21109..b0836be275 --- a/assets/snippets/ajaxSearch/classes/ajaxSearchConfig.class.inc.php +++ b/assets/snippets/ajaxSearch/classes/ajaxSearchConfig.class.inc.php @@ -4,9 +4,9 @@ * ----------------------------------------------------------------------------- * @package AjaxSearchConfig * -* @author Coroico - www.modx.wangba.fr -* @version 1.9.2 -* @date 05/12/2010 +* @author Coroico - www.evo.wangba.fr +* @version 1.9.3 +* @date 26/09/2012 * * Purpose: * The AjaxSearchConfig class contains all functions and data used to manage configuration context @@ -191,11 +191,11 @@ function setAsCall($ucfg) { */ function readConfigFile($config) { global $modx; - $configFile = (substr($config, 0, 5) != "@FILE") ? AS_PATH . "configs/$config.config.php" : $modx->config['base_path'] . trim(trim(substr($config, 5), ':')); + $configFile = (substr($config, 0, 6) != "@FILE:") ? AS_PATH . "configs/$config.config.php" : $modx->config['base_path'] . trim(substr($config, 6, strlen($config)-6)); $fh = fopen($configFile, 'r'); $output = fread($fh, filesize($configFile)); fclose($fh); return "\n" . $output; } } -?> +?> \ No newline at end of file diff --git a/assets/snippets/ajaxSearch/classes/ajaxSearchCtrl.class.inc.php b/assets/snippets/ajaxSearch/classes/ajaxSearchCtrl.class.inc.php old mode 100644 new mode 100755 index 0f97ffc081..fd49251453 --- a/assets/snippets/ajaxSearch/classes/ajaxSearchCtrl.class.inc.php +++ b/assets/snippets/ajaxSearch/classes/ajaxSearchCtrl.class.inc.php @@ -4,9 +4,9 @@ * ----------------------------------------------------------------------------- * @package AjaxSearchCtrl * -* @author Coroico - www.modx.wangba.fr -* @version 1.9.2 -* @date 05/12/2010 +* @author Coroico - www.evo.wangba.fr +* @version 1.9.3 +* @date 26/09/2012 * * Purpose: * The AjaxSearchCtrl class contains the logic and synchronisation between model and views diff --git a/assets/snippets/ajaxSearch/classes/ajaxSearchInput.class.inc.php b/assets/snippets/ajaxSearch/classes/ajaxSearchInput.class.inc.php old mode 100644 new mode 100755 index 41048141ce..805b69c2c7 --- a/assets/snippets/ajaxSearch/classes/ajaxSearchInput.class.inc.php +++ b/assets/snippets/ajaxSearch/classes/ajaxSearchInput.class.inc.php @@ -4,9 +4,9 @@ * ----------------------------------------------------------------------------- * @package AjaxSearchInput * -* @author Coroico - www.modx.wangba.fr -* @version 1.9.2 -* @date 05/12/2010 +* @author Coroico - www.evo.wangba.fr +* @version 1.9.3 +* @date 26/09/2012 * * Purpose: * The AjaxSearchInput class contains all functions and data used to manage Input form @@ -129,6 +129,7 @@ function _checkSearchString(&$searchString, $advSearch, &$msgErr) { } else { // check the empty input field => error message (At least 3 characters) $searchString = ''; + if ($asfSubmitted) $checkString = false; // no check if a filter is submitted } } else if (($searchString == '') && ($this->asCfg->cfg['init'] == 'all')) { diff --git a/assets/snippets/ajaxSearch/classes/ajaxSearchLog.class.inc.php b/assets/snippets/ajaxSearch/classes/ajaxSearchLog.class.inc.php old mode 100644 new mode 100755 index edf6e7b461..5aa6527ca6 --- a/assets/snippets/ajaxSearch/classes/ajaxSearchLog.class.inc.php +++ b/assets/snippets/ajaxSearch/classes/ajaxSearchLog.class.inc.php @@ -4,9 +4,9 @@ * ----------------------------------------------------------------------------- * @package AjaxSearchLog * -* @author Coroico - www.modx.wangba.fr -* @version 1.9.2 -* @date 05/12/2010 +* @author Coroico - www.evo.wangba.fr +* @version 1.9.3 +* @date 26/09/2012 * * Purpose: * The AjaxSearchLog class contains all functions used to Log AjaxSearch requests diff --git a/assets/snippets/ajaxSearch/classes/ajaxSearchOutput.class.inc.php b/assets/snippets/ajaxSearch/classes/ajaxSearchOutput.class.inc.php old mode 100644 new mode 100755 index 5366a8f22f..e6bec0b1b3 --- a/assets/snippets/ajaxSearch/classes/ajaxSearchOutput.class.inc.php +++ b/assets/snippets/ajaxSearch/classes/ajaxSearchOutput.class.inc.php @@ -4,9 +4,9 @@ * ----------------------------------------------------------------------------- * @package AjaxSearchOutput * -* @author Coroico - www.modx.wangba.fr -* @version 1.9.2 -* @date 05/12/2010 +* @author Coroico - www.evo.wangba.fr +* @version 1.9.3 +* @date 26/09/2012 * * Purpose: * The AjaxSearchOutput class contains all functions and data used to display output @@ -1087,4 +1087,4 @@ function _getJson($pairs) { return $json; } } -?> +?> \ No newline at end of file diff --git a/assets/snippets/ajaxSearch/classes/ajaxSearchRequest.class.inc.php b/assets/snippets/ajaxSearch/classes/ajaxSearchRequest.class.inc.php old mode 100644 new mode 100755 index a6fdf47ca7..2516000a66 --- a/assets/snippets/ajaxSearch/classes/ajaxSearchRequest.class.inc.php +++ b/assets/snippets/ajaxSearch/classes/ajaxSearchRequest.class.inc.php @@ -4,9 +4,9 @@ * ------------------------------------------------------------------------------ * @package AjaxSearchRequest * -* @author Coroico - www.modx.wangba.fr -* @version 1.9.2 -* @date 05/12/2010 +* @author Coroico - www.evo.wangba.fr +* @version 1.9.3 +* @date 26/09/2012 * * Purpose: * The AjaxSearchRequest class contains all functions and data used to manage the search SQL Request @@ -403,7 +403,7 @@ function _getHaving($searchString, $advSearch, $fClause) { if ($advSearch != NOWORDS) { if (isset($this->scJoined)) foreach ($this->scJoined as $joined) { $jpref = $joined['tb_alias']; - foreach ($joined['searchable'] as $searchable) $hvg[] = '(' . $jpref . '_' . $searchable . $like . ')'; + if (isset($joined['searchable'])) foreach ($joined['searchable'] as $searchable) $hvg[] = '(' . $jpref . '_' . $searchable . $like . ')'; } if (isset($this->scTvs['tvs'])) foreach ($this->scTvs['tvs'] as $scTv) { $jpref = $scTv['tb_alias']; @@ -413,7 +413,7 @@ function _getHaving($searchString, $advSearch, $fClause) { if (isset($this->scJoined)) foreach ($this->scJoined as $joined) { $jpref = $joined['tb_alias']; - foreach ($joined['searchable'] as $searchable) { + if (isset($joined['searchable'])) foreach ($joined['searchable'] as $searchable) { $hvg[] = '((' . $jpref . '_' . $searchable . $like . ') OR (' . $jpref . '_' . $searchable . ' IS NULL))'; } } @@ -455,8 +455,13 @@ function _getOrderBy() { if (isset($this->scCateg)) $orderFields[] = 'category ASC'; if ($this->cfg['order']) { $order = array_map('trim',explode(',', $this->cfg['order'])); - foreach ($order as $ord) $orderBy[] = $ord; - $orderFields[] = implode(',', $orderBy); + foreach ($order as $ord) { + $ordElt = explode(' ',$ord); + $ordby = '`' . $ordElt[0] . '`'; + if (isset($ordElt[1]) && ($ordElt[1] == 'ASC' || $ordElt[1] == 'DESC')) $ordby .= ' ' . $ordElt[1]; + $orderBy[] = $ordby; + } + $orderFields[] = implode(',', $orderBy); } if (count($orderFields) > 0) $orderByClause = implode(', ', $orderFields); else $orderByClause = '1'; @@ -498,10 +503,16 @@ function _getSubSelect($joined, $searchString, $advSearch) { $whl[] = implode(' AND ', $where); } - if (($joined['tb_alias'] != 'tv') && ($searchString)) { - $whl[] = '(' . $this->_getSearchTermsWhere($joined,$searchString,$advSearch). ')'; - $whereClause = '(' . implode(' AND ',$whl). ')'; - $subSelect = 'SELECT DISTINCT ' . $fieldsClause . ' FROM ' . $fromClause . ' WHERE ' . $whereClause; + if (($joined['tb_alias'] != 'tv')) { + if ($searchString) { + $stw = $this->_getSearchTermsWhere($joined,$searchString,$advSearch); + if (!empty($stw)) $whl[] = '(' . $stw . ')'; + } + if (count($whl)) { + $whereClause = '(' . implode(' AND ',$whl). ')'; + $subSelect = 'SELECT DISTINCT ' . $fieldsClause . ' FROM ' . $fromClause . ' WHERE ' . $whereClause; + } + else $subSelect = 'SELECT DISTINCT ' . $fieldsClause . ' FROM ' . $fromClause; } else { $subSelect = 'SELECT DISTINCT ' . $fieldsClause . ' FROM ' . $fromClause; @@ -544,24 +555,26 @@ function _getSubFilter($alias, $filter) { return $where; } function _getSearchTermsWhere($joined,$searchString,$advSearch){ - - $like = $this->_getWhereForm($advSearch); - $whereOper = $this->_getWhereOper($advSearch); - $type = ($advSearch == 'allwords') ? 'oneword' : $advSearch; - $whereStringOper = $this->_getWhereStringOper($type); - - if (isset($joined['searchable'])) - foreach($joined['searchable'] as $searchable) $whsc[] = '(' . $joined['tb_alias'] . '.' . $searchable . $like .')'; - if (count($whsc)) $whereSubClause = implode($whereOper,$whsc); - else $whereSubClause = ''; - - $search = array(); - if ($advSearch == 'exactphrase') $search[] = $searchString; - else $search = explode(' ',$searchString); - - foreach($search as $searchTerm) $where[]= preg_replace('/word/', preg_quote($searchTerm), $whereSubClause); - - $whereClause = implode($whereStringOper,$where); + $whereClause = ''; + if (!empty($joined['searchable'])) { + $like = $this->_getWhereForm($advSearch); + $whereOper = $this->_getWhereOper($advSearch); + $type = ($advSearch == 'allwords') ? 'oneword' : $advSearch; + $whereStringOper = $this->_getWhereStringOper($type); + + foreach($joined['searchable'] as $searchable) $whsc[] = '(' . $joined['tb_alias'] . '.' . $searchable . $like .')'; + if (count($whsc)) { + $whereSubClause = implode($whereOper,$whsc); + + $search = array(); + if ($advSearch == 'exactphrase') $search[] = $searchString; + else $search = explode(' ',$searchString); + + foreach($search as $searchTerm) $where[]= preg_replace('/word/', preg_quote($searchTerm), $whereSubClause); + + $whereClause = implode($whereStringOper,$where); + } + } return $whereClause; } function _getWhereForm($advSearch) { diff --git a/assets/snippets/ajaxSearch/classes/ajaxSearchResults.class.inc.php b/assets/snippets/ajaxSearch/classes/ajaxSearchResults.class.inc.php old mode 100644 new mode 100755 index bba8304d31..9e5e3f87a5 --- a/assets/snippets/ajaxSearch/classes/ajaxSearchResults.class.inc.php +++ b/assets/snippets/ajaxSearch/classes/ajaxSearchResults.class.inc.php @@ -4,9 +4,9 @@ * ----------------------------------------------------------------------------- * @package AjaxSearchResults * -* @author Coroico - www.modx.wangba.fr -* @version 1.9.2 -* @date 05/10/2010 +* @author Coroico - www.evo.wangba.fr +* @version 1.9.3 +* @date 26/09/2012 * * Purpose: * The AjaxSearchResults class contains all functions and data used to manage Results diff --git a/assets/snippets/ajaxSearch/classes/ajaxSearchUtil.class.inc.php b/assets/snippets/ajaxSearch/classes/ajaxSearchUtil.class.inc.php old mode 100644 new mode 100755 index 58133dd104..9ead73799b --- a/assets/snippets/ajaxSearch/classes/ajaxSearchUtil.class.inc.php +++ b/assets/snippets/ajaxSearch/classes/ajaxSearchUtil.class.inc.php @@ -4,9 +4,9 @@ * ----------------------------------------------------------------------------- * @package AjaxSearchUtil * -* @author Coroico - www.modx.wangba.fr -* @version 1.9.2 -* @date 05/12/2010 +* @author Coroico - www.evo.wangba.fr +* @version 1.9.3 +* @date 26/09/2012 * * Purpose: * The AjaxSearchUtil class contains some util methods diff --git a/assets/snippets/ajaxSearch/classes/asPhxParser.class.inc.php b/assets/snippets/ajaxSearch/classes/asPhxParser.class.inc.php old mode 100644 new mode 100755 index e0ddba660e..e01f3497c2 --- a/assets/snippets/ajaxSearch/classes/asPhxParser.class.inc.php +++ b/assets/snippets/ajaxSearch/classes/asPhxParser.class.inc.php @@ -242,16 +242,40 @@ function Filter($input, $modifiers) { ##### Special functions // img modifiers added by coroico - case "imgwidth": list($width, $height, $type, $attr) = getimagesize($output); $output = $width; break; - case "imgheight": list($width, $height, $type, $attr) = getimagesize($output); $output = $height; break; - case "imgattr": list($width, $height, $type, $attr) = getimagesize($output); $output = $attr; break; + case "imgwidth": + if (@file_exists($output)) { + list($width, $height, $type, $attr) = getimagesize($output); + $output = $width; + } + else $output = 0; + break; + case "imgheight": + if (@file_exists($output)) { + list($width, $height, $type, $attr) = getimagesize($output); + $output = $height; + } + else $output = 0; + break; + case "imgattr": + if (@file_exists($output)) { + list($width, $height, $type, $attr) = getimagesize($output); + $output = $attr; + } + else $output = ''; + break; case "imgmaxwidth": - list($width, $height, $type, $attr) = getimagesize($output); - $output = ($width < intval($modifier_value[$i])) ? $width : intval($modifier_value[$i]); + if (@file_exists($output)) { + list($width, $height, $type, $attr) = getimagesize($output); + $output = ($width < intval($modifier_value[$i])) ? $width : intval($modifier_value[$i]); + } + else $output = intval($modifier_value[$i]); break; case "imgmaxheight": - list($width, $height, $type, $attr) = getimagesize($output); - $output = ($height < intval($modifier_value[$i])) ? $height : intval($modifier_value[$i]); + if (@file_exists($output)) { + list($width, $height, $type, $attr) = getimagesize($output); + $output = ($height < intval($modifier_value[$i])) ? $height : intval($modifier_value[$i]); + } + else $output = intval($modifier_value[$i]); break; case "math": $filter = preg_replace("~([a-zA-Z\n\r\t\s])~","",$modifier_value[$i]); diff --git a/assets/snippets/ajaxSearch/configs/default.config.php b/assets/snippets/ajaxSearch/configs/default.config.php old mode 100644 new mode 100755 index 6aa88b15c5..062bd2a22c --- a/assets/snippets/ajaxSearch/configs/default.config.php +++ b/assets/snippets/ajaxSearch/configs/default.config.php @@ -1,9 +1,9 @@ V{a}Dv~An&+O}=mwr$(CZQJ(K?%LS3ZQHhc-;;a3-7hy8$(otT`U5kAOi@&v zj)|TXnr!qcp%|Ktkde^A*czIbmqFId-on+Ako~_#nL*sj*450JkU`wm$kj~L%*4Ue zjGrIc#nsu&$PU^w_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HRz79-^+H;F$9$tNN9B!2ntFL(Zm$FCUudhjcF8c%w^RDRXD zJiYxbWWV%)PY;-%1kax(?mtHN3*tWz{l6I&V@Cyr|8rpM?4IWSlOC_QgQ=Sxgb77P z{Qq)hvHZ^^keTV9Fdf~TZGSBuW~MA)TksPi7f24VLU5Xy@|rt1+ZjWqzOkdDt(B?q z(~9skCn1v;^3c`F)fO!HYiSa(b^W7YYxT6$@Y)*NTL{p2GMRzRjooZrY5tZ7|Gjzj z6in7X!wPyT89s?$^BMFY_#IMPs<`Ji1kT8_BP0hNCO1YK-3^B=YOH0_LTgz|GEeL_v8A%PwRgo zb#VThiT^K_PzV$eH&@Hwko*@D2GZ!CJK^63@c)B-8UhXSxzHMH>iRci|NZFw?`I{Q zpx{3;)6*Gj4giv}vjZS2)<0gPoE#i%9Hi!?f7G#aaRVVAVV_>4_J7ntGLnat^Y3*) zb}lZ^Z+ehAR(96k^dSAPa{N}u3gl+z`mK%wqQ>)E9Va_G2lsDv9IV{jzxT%tq4N6O zE(aSM2ZV>~Z{q;6fw=x{9Ne7$-j^RTh~j)ff(^51*~vCF~r zdpschf&N{OmGyT$c5YVC?|$K6XXE+3EhjrCC-66X++3`jzr~Ujf)2vz_S-nPA?xJ7 z)$wrthw<|K?iUUq*Y7zF{zMDaiq3XOn=; zA8~OWaS%|9T|z_x$jt*}7Xv|v;{^X}4Sj&1Ai%}d*xB{h#AgM8IJiLoDk=#jNx=UC DI;m>T diff --git a/assets/snippets/ajaxSearch/documentation/AjaxSearch193_v1.pdf b/assets/snippets/ajaxSearch/documentation/AjaxSearch193_v1.pdf new file mode 100755 index 0000000000000000000000000000000000000000..57d00a92417403c3978b8bfda46d4eefdfaeeecb GIT binary patch literal 122853 zcmaf)Q*15_u&!&{w(YLkw%xAct8I7Hwr$(CZQHhe{(Z8Ob9s_CnaP{X)nq1_$bi+}h9?APO+H zGXe1P!#FuR0t{_n+_SEIE*r@u;timH2ldh1pRg>%LC+9S&ItPXE-EfOvFp04m^r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D8BK>Hp;OZz}z-xcwW4|Ke%CQII_fGB-^B+yVIz zN&YWg|MwXEYuh)rhV1pu&zm}=W$yqn^T+4bbFIO@)KL7#9!34%_9z-ixcT$+K$gR^ z>r#twJ^MWX1Y`q3V!wa8JQV;y1tEiM4gVVorRP;dt;NE@4*BKKg6yq=&%ojt=syFO zXQ22DjQ@!PKer5@f!Q-)eg>dt!14@qpMldeVE%`uHsF5~@&36}K~ix9ER~ z`Q7@>^7qr(KnDF|tEYyvA^+Shj13+B?OFamnTv*x@9%T(0yZ{51dy--5Fr}>{em0_ zfJ`Te3CZ7ZtemVM$cxAGMPmIo95axa1qAqa8~{Sc{0AL?m4lOo;}1FrA7-{caLfP@ z0CLRWuQC9vAa)MsKX7a;K;VDi0GvSfKj=8vAuHn#92+x;^-rBaKo$_B=(y>6W|AAv>`%@QIPB!*G=~y{H9DnKuu>tT;y8xL1oPXMnm6M(IKXJ^! zKc5504B_~Pek|8=3Y|M~}`@=45Ko-a`n}1se%*-GT z_P_9R0P91J$AA%ecu1HO&E1S4K10H!U}NJz0#S}cfrLrY+Qf$Bc`sFfoV*bs(c}RF z*a1KxW_A#WjYW`!O^`)Y1SH1JCMqJt$ss5#%)$4+r_e@()P}Wp&<8vGc2tPpae_Dz LDJVqc#Ss4=mR;*j literal 0 HcmV?d00001 diff --git a/assets/snippets/ajaxSearch/documentation/migrationFrom185To190.txt b/assets/snippets/ajaxSearch/documentation/migrationFrom185To190.txt old mode 100644 new mode 100755 diff --git a/assets/snippets/ajaxSearch/documentation/readme.txt b/assets/snippets/ajaxSearch/documentation/readme.txt old mode 100644 new mode 100755 diff --git a/assets/snippets/ajaxSearch/documentation/someConfigsExamples/custom1.config.php b/assets/snippets/ajaxSearch/documentation/someConfigsExamples/custom1.config.php old mode 100644 new mode 100755 diff --git a/assets/snippets/ajaxSearch/documentation/someConfigsExamples/custom2.config.php b/assets/snippets/ajaxSearch/documentation/someConfigsExamples/custom2.config.php old mode 100644 new mode 100755 diff --git a/assets/snippets/ajaxSearch/documentation/someCssExamples/search.css b/assets/snippets/ajaxSearch/documentation/someCssExamples/search.css old mode 100644 new mode 100755 diff --git a/assets/snippets/ajaxSearch/documentation/someTemplatesExamples/imgAjaxResult.tpl.html b/assets/snippets/ajaxSearch/documentation/someTemplatesExamples/imgAjaxResult.tpl.html old mode 100644 new mode 100755 diff --git a/assets/snippets/ajaxSearch/documentation/someTemplatesExamples/imgResult.tpl.html b/assets/snippets/ajaxSearch/documentation/someTemplatesExamples/imgResult.tpl.html old mode 100644 new mode 100755 diff --git a/assets/snippets/ajaxSearch/documentation/someTemplatesExamples/rankResult.tpl.html b/assets/snippets/ajaxSearch/documentation/someTemplatesExamples/rankResult.tpl.html old mode 100644 new mode 100755 diff --git a/assets/snippets/ajaxSearch/images/asnext.png b/assets/snippets/ajaxSearch/images/asnext.png old mode 100644 new mode 100755 diff --git a/assets/snippets/ajaxSearch/images/asprev.png b/assets/snippets/ajaxSearch/images/asprev.png old mode 100644 new mode 100755 diff --git a/assets/snippets/ajaxSearch/images/close.png b/assets/snippets/ajaxSearch/images/close.png old mode 100644 new mode 100755 diff --git a/assets/snippets/ajaxSearch/images/cross.png b/assets/snippets/ajaxSearch/images/cross.png old mode 100644 new mode 100755 diff --git a/assets/snippets/ajaxSearch/images/indicator.black.gif b/assets/snippets/ajaxSearch/images/indicator.black.gif old mode 100644 new mode 100755 diff --git a/assets/snippets/ajaxSearch/images/indicator.white.gif b/assets/snippets/ajaxSearch/images/indicator.white.gif old mode 100644 new mode 100755 diff --git a/assets/snippets/ajaxSearch/images/readme.txt b/assets/snippets/ajaxSearch/images/readme.txt old mode 100644 new mode 100755 diff --git a/assets/snippets/ajaxSearch/js/ajaxSearch1/ajaxSearch-jquery.js b/assets/snippets/ajaxSearch/js/ajaxSearch1/ajaxSearch-jquery.js old mode 100644 new mode 100755 index bce39d4416..00d560e710 --- a/assets/snippets/ajaxSearch/js/ajaxSearch1/ajaxSearch-jquery.js +++ b/assets/snippets/ajaxSearch/js/ajaxSearch1/ajaxSearch-jquery.js @@ -1,6 +1,6 @@ /* - * AjaxSearch 1.9.2 - package AjaxSearch 1 - JQuery 1.4.2 - * author: Coroico - www.modx.wangba.fr - 05/12/2010 + * AjaxSearch 1.9.3 - package AjaxSearch 1 - JQuery 1.4.2 + * author: Coroico - www.evo.wangba.fr - 26/09/2012 * * Licensed under the GPL license: http://www.gnu.org/copyleft/gpl.html */ @@ -14,7 +14,7 @@ var _closeAlt='close search'; var _load=_base + 'images/indicator.white.gif'; // loading image var _loadAlt='loading'; -var _version='1.9.2';var _opacity=1.;var _liveSearch=0;var _minChars=3;var _init='none';var _pagingType=1;jQuery(function($){function activateSearch(){for(ias=0;ias').appendTo(sf).hide();as['sl']=$(''+_loadAlt+'').appendTo(sf).hide();as['sr']=$('#'+p+'ajaxSearch_output').hide().removeClass('init');as['si']=$('#'+p+'ajaxSearch_input');as['se']=$('#'+p+'ajaxSearch_select');if(!as['lvs'])as['ss']=$('#'+p+'ajaxSearch_form input:submit');as['sc'].click(function(){closeSearch(as);return false;});if(!as['lvs'])as['ss'].click(function(){doSearch(as);return false;});else as['si'].keyup(function(){doLiveSearch(as);});if(as['si'].length)as['si'].keypress(function(e){var keyCode=e.keyCode||e.which;if(keyCode==13){doSearch(as);return false;}});doSearch(as);} function doLiveSearch(as){if(as['lt']){window.clearTimeout(as['lt']);} diff --git a/assets/snippets/ajaxSearch/js/ajaxSearch1/ajaxSearch-mootools2.js b/assets/snippets/ajaxSearch/js/ajaxSearch1/ajaxSearch-mootools2.js old mode 100644 new mode 100755 index 0c157ff7b6..9740739283 --- a/assets/snippets/ajaxSearch/js/ajaxSearch1/ajaxSearch-mootools2.js +++ b/assets/snippets/ajaxSearch/js/ajaxSearch1/ajaxSearch-mootools2.js @@ -1,6 +1,6 @@ /* - * AjaxSearch 1.9.2 - package AjaxSearch 1 - Mootools 1.2.4 - * author: Coroico - www.modx.wangba.fr - 05/12/2010 + * AjaxSearch 1.9.3 - package AjaxSearch 1 - Mootools 1.2.4 + * author: Coroico - www.evo.wangba.fr - 26/09/2012 * * Licensed under the GPL license: http://www.gnu.org/copyleft/gpl.html */ @@ -14,7 +14,7 @@ var _closeAlt='close search'; var _load=_base + 'images/indicator.white.gif'; // loading image var _loadAlt='loading'; -var _version='1.9.2';var _opacity=1;var _liveSearch=0;var _minChars=3;var _init='none';var _pagingType=1;function activateSearch(){for(ias=0;ias - * @date 05/12/2010 + * @date 20/11/2012 * ----------------------------------------------------------------------------- */ /** @@ -71,7 +70,7 @@ MORE : See the ajaxSearch.readme.txt file for more informations. ----------------------------------------------------------------------------- */ // ajaxSearch version being executed -define('AS_VERSION', '1.9.2'); +define('AS_VERSION', '1.9.3'); // Path where ajaxSearch is installed define('AS_SPATH', 'assets/snippets/ajaxSearch/'); //include snippet file @@ -95,7 +94,7 @@ if (!isset($dcfg)) return "

AjaxSearch error: default configuration array not if ($dcfg['version'] != AS_VERSION) return "

AjaxSearch error: Version number mismatch. Check the content of the default configuration file!

"; // check the possible use of deprecated parameters (since 1.8.5) -$readme = "ajaxSearch_version_192.txt"; +$readme = "ajaxSearch_version_193.txt"; if (isset($searchWordList)) return "

AjaxSearch error: searchWordList is a deprecated parameter. Read " . $readme . " file.

"; if (isset($resultsPage)) return "

AjaxSearch error: resultsPage is a deprecated parameter. Read " . $readme . " file.

"; if (isset($AS_showForm)) return "

AjaxSearch error: AS_showForm parameter has been renamed showInputForm. Read " . $readme . " file.

"; @@ -134,6 +133,9 @@ $cfg['language'] = isset($language) ? $language : (isset($__language) ? $__langu // Use this to display the search results using ajax You must include the Mootools library in your template // Default: 1 - ajax mode selected $cfg['ajaxSearch'] = isset($ajaxSearch) ? $ajaxSearch : (isset($__ajaxSearch) ? $__ajaxSearch : $dcfg['ajaxSearch']); +// avoid the use of @FILE: prefix with ajax mode +if ((substr($cfg['config'], 0, 6) == "@FILE:") && $cfg['ajaxSearch']) + return "

AjaxSearch error: @FILE: prefix not allowed !
Check your config parameter or your config file name!

"; // &advSearch [ 'exactphrase' | 'allwords' | 'nowords' | 'oneword' ] // Advanced search: diff --git a/install/assets/plugins/searchhighlight.tpl b/install/assets/plugins/searchhighlight.tpl index cd4dd2cebd..eb447d76cb 100644 --- a/install/assets/plugins/searchhighlight.tpl +++ b/install/assets/plugins/searchhighlight.tpl @@ -34,7 +34,7 @@ Created By: Susan Ottwell (sottwell@sottwell.com) Kyle Jaebker (kjaebker@muddydogpaws.com) - Refactored by Coroico (www.modx.wangba.fr) and TS + Refactored by Coroico (www.evo.wangba.fr) and TS ------------------------------------------------------------------------ Based off the the code by Susan Ottwell (www.sottwell.com) http://modxcms.com/forums/index.php/topic,1237.0.html diff --git a/install/assets/snippets/ajaxSearch.tpl b/install/assets/snippets/ajaxSearch.tpl index 2b7aa6e13e..62d2e0a067 100755 --- a/install/assets/snippets/ajaxSearch.tpl +++ b/install/assets/snippets/ajaxSearch.tpl @@ -4,14 +4,14 @@ * Ajax and non-Ajax search that supports results highlighting * * @category snippet - * @version 1.9.2 + * @version 1.9.3b * @license http://www.gnu.org/copyleft/gpl.html GNU Public License (GPL) * @internal @properties * @internal @modx_category Search * @internal @installset base, sample * * @author Coroico - * @date 05/12/2010 + * @date 20/11/2012 * ----------------------------------------------------------------------------- */ /** @@ -66,12 +66,12 @@ What AjaxSearch don't : - search in dynamic content. AjaxSearch could retreive only data stored in database. It can't find something stored in a chunk or generated by a snippet. -MORE : See the ajaxSearch.readme.txt file for more informations. +MORE : See the ajaxSearch.readme.txt file for more informations. ----------------------------------------------------------------------------- */ // ajaxSearch version being executed -define('AS_VERSION', '1.9.2'); +define('AS_VERSION', '1.9.3'); // Path where ajaxSearch is installed define('AS_SPATH', 'assets/snippets/ajaxSearch/'); //include snippet file @@ -95,7 +95,7 @@ if (!isset($dcfg)) return "

AjaxSearch error: default configuration array not if ($dcfg['version'] != AS_VERSION) return "

AjaxSearch error: Version number mismatch. Check the content of the default configuration file!

"; // check the possible use of deprecated parameters (since 1.8.5) -$readme = "ajaxSearch_version_192.txt"; +$readme = "ajaxSearch_version_193.txt"; if (isset($searchWordList)) return "

AjaxSearch error: searchWordList is a deprecated parameter. Read " . $readme . " file.

"; if (isset($resultsPage)) return "

AjaxSearch error: resultsPage is a deprecated parameter. Read " . $readme . " file.

"; if (isset($AS_showForm)) return "

AjaxSearch error: AS_showForm parameter has been renamed showInputForm. Read " . $readme . " file.

"; @@ -134,6 +134,9 @@ $cfg['language'] = isset($language) ? $language : (isset($__language) ? $__langu // Use this to display the search results using ajax You must include the Mootools library in your template // Default: 1 - ajax mode selected $cfg['ajaxSearch'] = isset($ajaxSearch) ? $ajaxSearch : (isset($__ajaxSearch) ? $__ajaxSearch : $dcfg['ajaxSearch']); +// avoid the use of @FILE: prefix with ajax mode +if ((substr($cfg['config'], 0, 6) == "@FILE:") && $cfg['ajaxSearch']) + return "

AjaxSearch error: @FILE: prefix not allowed !
Check your config parameter or your config file name!

"; // &advSearch [ 'exactphrase' | 'allwords' | 'nowords' | 'oneword' ] // Advanced search: From 6195adca692ce9cc928f3af34b22153370161161 Mon Sep 17 00:00:00 2001 From: yama Date: Sun, 12 May 2013 02:48:19 +0900 Subject: [PATCH 015/530] Refactor #9891 Delete phpSniff http://tracker.modx.com/issues/9891 --- assets/snippets/jot/jot.class.inc.php | 7 +- manager/actions/mutate_settings.dynamic.php | 2 +- manager/actions/mutate_user.dynamic.php | 2 +- manager/actions/resource_selector.static.php | 6 +- manager/frames/1.php | 6 +- manager/includes/accesscontrol.inc.php | 2 - manager/includes/browsercheck.inc.php | 49 -- .../extenders/deprecated.functions.inc.php | 6 +- .../extenders/getUserData.extender.php | 57 +- manager/includes/sniff/index.html | 2 - manager/includes/sniff/phpSniff.class.php | 197 ------- manager/includes/sniff/phpSniff.core.php | 548 ------------------ manager/includes/tmplvars.format.inc.php | 7 +- 13 files changed, 18 insertions(+), 873 deletions(-) delete mode 100755 manager/includes/browsercheck.inc.php delete mode 100755 manager/includes/sniff/index.html delete mode 100755 manager/includes/sniff/phpSniff.class.php delete mode 100755 manager/includes/sniff/phpSniff.core.php diff --git a/assets/snippets/jot/jot.class.inc.php b/assets/snippets/jot/jot.class.inc.php index efc5cdc96b..d6f03bb4d3 100644 --- a/assets/snippets/jot/jot.class.inc.php +++ b/assets/snippets/jot/jot.class.inc.php @@ -32,7 +32,6 @@ function CJot() { $this->name = $this->config["snippet"]["name"] = "Jot"; $this->version = $this->config["snippet"]["version"] = "1.1.4"; // $this->config["snippet"]["versioncheck"] = "Unknown"; - $this->client = $modx->getUserData(); $this->_ctime = time(); $this->_check = 0; $this->provider = new CJotDataDb; @@ -107,9 +106,9 @@ function Run() { $this->config["user"]["usrid"] = intval($_SESSION['webInternalKey']); $this->config["user"]["id"] = ( $this->config["user"]["usrid"] > 0 ) ? (-$this->config["user"]["usrid"]) : $this->config["user"]["mgrid"]; - $this->config["user"]["host"] = $this->client['ip']; - $this->config["user"]["ip"] = $this->client['ip']; - $this->config["user"]["agent"] = $this->client['ua']; + $this->config["user"]["host"] = $_SERVER['REMOTE_ADDR']; + $this->config["user"]["ip"] = $_SERVER['REMOTE_ADDR']; + $this->config["user"]["agent"] = $_SERVER['HTTP_USER_AGENT']; $this->config["user"]["sechash"] = md5($this->config["user"]["id"].$this->config["user"]["host"].$this->config["user"]["ip"].$this->config["user"]["agent"]); // Automatic settings diff --git a/manager/actions/mutate_settings.dynamic.php b/manager/actions/mutate_settings.dynamic.php index 7e7aee37a7..ce252a825c 100644 --- a/manager/actions/mutate_settings.dynamic.php +++ b/manager/actions/mutate_settings.dynamic.php @@ -30,7 +30,7 @@ while ($row = mysql_fetch_assoc($rs)) $settings[$row['setting_name']] = $row['setting_value']; extract($settings, EXTR_OVERWRITE); -$displayStyle = ( ($_SESSION['browser']=='mz') || ($_SESSION['browser']=='op') || ($_SESSION['browser']=='sf') ) ? "table-row" : "block" ; +$displayStyle = ($_SESSION['browser']!=='ie') ? 'table-row' : 'block' ; // load languages and keys $lang_keys = array(); diff --git a/manager/actions/mutate_user.dynamic.php b/manager/actions/mutate_user.dynamic.php index e899e20433..1488f48cdc 100644 --- a/manager/actions/mutate_user.dynamic.php +++ b/manager/actions/mutate_user.dynamic.php @@ -114,7 +114,7 @@ function ConvertDate($date) { include_once "lang/country/".$manager_language."_country.inc.php"; } -$displayStyle = (($_SESSION['browser'] == 'mz') || ($_SESSION['browser'] == 'op') || ($_SESSION['browser'] == 'sf')) ? "table-row" : "block"; +$displayStyle = ($_SESSION['browser']!=='ie') ? 'table-row' : 'block' ; ?> - -

[*longtitle*]

[*#content*]
-
- -
- -
- -
- -
- - -
-
-
- - \ No newline at end of file + [(site_name)] | [*pagetitle*]

[*longtitle*]

[*#content*]

\ No newline at end of file diff --git a/index-ajax.php b/index-ajax.php index aa109967b3..18a56fbeaf 100644 --- a/index-ajax.php +++ b/index-ajax.php @@ -4,8 +4,9 @@ // Any PHP files in these directories can be executed by any user. $allowed_dirs = array('assets/snippets/ajaxSearch/'); +define("MGR_DIR", "manager"); // harden it -require_once('./manager/includes/protect.inc.php'); +require_once('./'.MGR_DIR.'/includes/protect.inc.php'); // initialize the variables prior to grabbing the config file $database_type = ""; @@ -19,7 +20,7 @@ // get the required includes if($database_user=='') { - if (!$rt = @include_once "manager/includes/config.inc.php") { + if (!$rt = @include_once MGR_DIR."/includes/config.inc.php") { exit('Could not load MODx configuration file!'); } } diff --git a/index.php b/index.php index ea46221a88..7167989e36 100644 --- a/index.php +++ b/index.php @@ -51,7 +51,7 @@ $mstart = memory_get_usage(); // harden it -require_once(dirname(__FILE__).'/manager/includes/protect.inc.php'); +require_once(dirname(__FILE__).'/'.MGR_DIR.'/includes/protect.inc.php'); // set some settings, and address some IE issues @ini_set('url_rewriter.tags', ''); @@ -88,7 +88,7 @@ // get the required includes if($database_user=="") { - $rt = @include_once(dirname(__FILE__).'/manager/includes/config.inc.php'); + $rt = @include_once(dirname(__FILE__).'/'.MGR_DIR.'/includes/config.inc.php'); // Be sure config.inc.php is there and that it contains some important values if(!$rt || !$database_type || !$database_server || !$database_user || !$dbase) { echo " diff --git a/manager/actions/files.dynamic.php b/manager/actions/files.dynamic.php index b4c88f297e..8ae1a6ced4 100644 --- a/manager/actions/files.dynamic.php +++ b/manager/actions/files.dynamic.php @@ -8,7 +8,7 @@ $newToken = makeToken(); // settings -$theme_image_path = $modx->config['site_url'] . 'manager/media/style/' . $modx->config['manager_theme'] . '/images/'; +$theme_image_path = $modx->config['site_manager_url'] . 'media/style/' . $modx->config['manager_theme'] . '/images/'; $excludes = array('.', '..', '.svn'); $alias_suffix = (!empty($friendly_url_suffix)) ? ','.ltrim($friendly_url_suffix,'.') : ''; $editablefiles = explode(',', 'txt,php,shtml,html,htm,xml,js,css,pageCache,htaccess'.$alias_suffix); @@ -612,7 +612,7 @@ function logFileChange($type, $filename) $log->initAndWriteLog($string, '', '', '', $type, $filename); // HACK: change the global action to prevent double logging - // @see manager/index.php @ 915 + // @see index.php @ 915 global $action; $action = 1; } diff --git a/manager/actions/logging.static.php b/manager/actions/logging.static.php index ec4f3650bd..c53ea2071d 100644 --- a/manager/actions/logging.static.php +++ b/manager/actions/logging.static.php @@ -289,7 +289,7 @@ function convertdate($date) { getFullTableName("site_metatags")." st ". "ORDER BY name"; $ds = mysql_query($sql); - include_once $base_path."manager/includes/controls/datagrid.class.php"; + include_once MODX_MANAGER_PATH."includes/controls/datagrid.class.php"; $grd = new DataGrid('',$ds,$number_of_results); // set page size to 0 t show all items $grd->noRecordMsg = $_lang["no_records_found"]; $grd->cssClass="grid"; diff --git a/manager/actions/modules.static.php b/manager/actions/modules.static.php index 1a19ab8aac..4c10821095 100644 --- a/manager/actions/modules.static.php +++ b/manager/actions/modules.static.php @@ -27,7 +27,7 @@ // context menu -include_once $base_path."manager/includes/controls/contextmenu.php"; +include_once MODX_MANAGER_PATH."includes/controls/contextmenu.php"; $cm = new ContextMenu("cntxm", 150); $cm->addItem($_lang["run_module"],"js:menuAction(1)",$_style['icons_save'],(!$modx->hasPermission('exec_module') ? 1:0)); $cm->addSeparator(); @@ -97,7 +97,7 @@ function menuAction(a) { (!empty($sqlQuery) ? " WHERE (name LIKE '%$sqlQuery%') OR (description LIKE '%$sqlQuery%')":"")." ". "ORDER BY name"; $ds = mysql_query($sql); - include_once $base_path."manager/includes/controls/datagrid.class.php"; + include_once MODX_MANAGER_PATH."includes/controls/datagrid.class.php"; $grd = new DataGrid('',$ds,$number_of_results); // set page size to 0 t show all items $grd->noRecordMsg = $_lang["no_records_found"]; $grd->cssClass="grid"; diff --git a/manager/actions/mutate_module.dynamic.php b/manager/actions/mutate_module.dynamic.php index 337dec344b..d456960a75 100644 --- a/manager/actions/mutate_module.dynamic.php +++ b/manager/actions/mutate_module.dynamic.php @@ -308,7 +308,7 @@ function OpenServerBrowser(url, width, height ) { function BrowseServer() { var w = screen.width * 0.7; var h = screen.height * 0.7; - OpenServerBrowser("manager/media/browser/mcpuk/browser.html?Type=images&Connector=manager/media/browser/mcpuk/connectors/php/connector.php&ServerPath=", w, h); + OpenServerBrowser("media/browser/mcpuk/browser.html?Type=images&Connector=media/browser/mcpuk/connectors/php/connector.php&ServerPath=", w, h); } function SetUrl(url, width, height, alt) { @@ -463,7 +463,7 @@ function SetUrl(url, width, height, alt) { if (!$ds) { echo "An error occured while loading module dependencies."; } else { - include_once $base_path."manager/includes/controls/datagrid.class.php"; + include_once MODX_MANAGER_PATH."includes/controls/datagrid.class.php"; $grd = new DataGrid('', $ds, 0); // set page size to 0 t show all items $grd->noRecordMsg = $_lang['no_records_found']; $grd->cssClass = 'grid'; diff --git a/manager/actions/mutate_module_resources.dynamic.php b/manager/actions/mutate_module_resources.dynamic.php index dbb15da656..4e3941c9be 100644 --- a/manager/actions/mutate_module_resources.dynamic.php +++ b/manager/actions/mutate_module_resources.dynamic.php @@ -104,7 +104,7 @@ if ($cp) $modx->dbQuery('UPDATE '.$tbl_site_plugins.' SET moduleguid=\'\' WHERE id IN ('.implode(',', $plids).') AND moduleguid=\''.$guid.'\''); if ($cs) $modx->dbQuery('UPDATE '.$tbl_site_snippets.' SET moduleguid=\'\' WHERE id IN ('.implode(',', $snids).') AND moduleguid=\''.$guid.'\''); // reset cache - include_once $base_path."/manager/processors/cache_sync.class.processor.php"; + include_once MODX_MANAGER_PATH."processors/cache_sync.class.processor.php"; $sync = new synccache(); $sync->setCachepath("../assets/cache/"); $sync->setReport(false); @@ -241,7 +241,7 @@ function openSelector(resource,mode,callback,w,h){ echo "An error occured while loading module dependencies."; } else { - include_once $base_path."manager/includes/controls/datagrid.class.php"; + include_once MODX_MANAGER_PATH."includes/controls/datagrid.class.php"; $grd = new DataGrid('',$ds,0); // set page size to 0 t show all items $grd->noRecordMsg = $_lang["no_records_found"]; $grd->cssClass="grid"; diff --git a/manager/actions/mutate_plugin_priority.dynamic.php b/manager/actions/mutate_plugin_priority.dynamic.php index 2be5c67976..9f66cf7d5e 100644 --- a/manager/actions/mutate_plugin_priority.dynamic.php +++ b/manager/actions/mutate_plugin_priority.dynamic.php @@ -34,7 +34,7 @@ } } // empty cache - include_once ($basePath.'manager/processors/cache_sync.class.processor.php'); + include_once (MODX_MANAGER_PATH.'processors/cache_sync.class.processor.php'); $sync = new synccache(); $sync->setCachepath($basePath.'/assets/cache/'); $sync->setReport(false); diff --git a/manager/actions/mutate_template_tv_rank.dynamic.php b/manager/actions/mutate_template_tv_rank.dynamic.php index bb4ff2b524..960572d9ae 100644 --- a/manager/actions/mutate_template_tv_rank.dynamic.php +++ b/manager/actions/mutate_template_tv_rank.dynamic.php @@ -38,7 +38,7 @@ } } // empty cache - include_once ($basePath.'manager/processors/cache_sync.class.processor.php'); + include_once (MODX_MANAGER_PATH.'processors/cache_sync.class.processor.php'); $sync = new synccache(); $sync->setCachepath($basePath.'/assets/cache/'); $sync->setReport(false); diff --git a/manager/actions/mutate_user.dynamic.php b/manager/actions/mutate_user.dynamic.php index 1488f48cdc..ef64e660d1 100644 --- a/manager/actions/mutate_user.dynamic.php +++ b/manager/actions/mutate_user.dynamic.php @@ -110,7 +110,7 @@ function ConvertDate($date) { // include the country list language file $_country_lang = array(); include_once "lang/country/english_country.inc.php"; -if($manager_language!="english" && file_exists($modx->config['base_path']."manager/includes/lang/country/".$manager_language."_country.inc.php")){ +if($manager_language!="english" && file_exists($modx->config['site_manager_path']."includes/lang/country/".$manager_language."_country.inc.php")){ include_once "lang/country/".$manager_language."_country.inc.php"; } @@ -765,7 +765,7 @@ function OpenServerBrowser(url, width, height ) { function BrowseServer() { var w = screen.width * 0.7; var h = screen.height * 0.7; - OpenServerBrowser("manager/media/browser/mcpuk/browser.html?Type=images&Connector=manager/media/browser/mcpuk/connectors/php/connector.php&ServerPath=", w, h); + OpenServerBrowser("media/browser/mcpuk/browser.html?Type=images&Connector=media/browser/mcpuk/connectors/php/connector.php&ServerPath=", w, h); } function SetUrl(url, width, height, alt){ document.userform.photo.value = url; diff --git a/manager/actions/mutate_web_user.dynamic.php b/manager/actions/mutate_web_user.dynamic.php index 40cbee74ba..63a6c59142 100644 --- a/manager/actions/mutate_web_user.dynamic.php +++ b/manager/actions/mutate_web_user.dynamic.php @@ -105,7 +105,7 @@ function ConvertDate($date) { // include the country list language file $_country_lang = array(); -if($manager_language!="english" && file_exists($modx->config['base_path']."manager/includes/lang/country/".$manager_language."_country.inc.php")){ +if($manager_language!="english" && file_exists($modx->config['site_manager_path']."includes/lang/country/".$manager_language."_country.inc.php")){ include_once "lang/country/".$manager_language."_country.inc.php"; } else { include_once "lang/country/english_country.inc.php"; @@ -233,10 +233,10 @@ function showHide(what, onoff){
  • " /> +
  • " />
  • @@ -492,7 +492,7 @@ function OpenServerBrowser(url, width, height ) { function BrowseServer() { var w = screen.width * 0.7; var h = screen.height * 0.7; - OpenServerBrowser("manager/media/browser/mcpuk/browser.html?Type=images&Connector=manager/media/browser/mcpuk/connectors/php/connector.php&ServerPath=", w, h); + OpenServerBrowser("media/browser/mcpuk/browser.html?Type=images&Connector=media/browser/mcpuk/connectors/php/connector.php&ServerPath=", w, h); } function SetUrl(url, width, height, alt){ document.userform.photo.value = url; diff --git a/manager/actions/resource_selector.static.php b/manager/actions/resource_selector.static.php index 876576fd0c..6ecb19de18 100644 --- a/manager/actions/resource_selector.static.php +++ b/manager/actions/resource_selector.static.php @@ -191,7 +191,7 @@ function setCheckbox(chk){ exit; } else { - include_once $base_path."manager/includes/controls/datagrid.class.php"; + include_once MODX_MANAGER_PATH."includes/controls/datagrid.class.php"; $grd = new DataGrid('',$ds,$number_of_results); // set page size to 0 t show all items $grd->noRecordMsg = $_lang["no_records_found"]; $grd->cssClass="grid"; diff --git a/manager/actions/user_management.static.php b/manager/actions/user_management.static.php index 7695252c3e..4fedd40ccf 100644 --- a/manager/actions/user_management.static.php +++ b/manager/actions/user_management.static.php @@ -27,7 +27,7 @@ // context menu -include_once $base_path."manager/includes/controls/contextmenu.php"; +include_once MODX_MANAGER_PATH."includes/controls/contextmenu.php"; $cm = new ContextMenu("cntxm", 150); $cm->addItem($_lang["edit"],"js:menuAction(1)","media/style/$manager_theme/images/icons/logging.gif",(!$modx->hasPermission('edit_user') ? 1:0)); $cm->addItem($_lang["delete"], "js:menuAction(2)","media/style/$manager_theme/images/icons/delete.gif",(!$modx->hasPermission('delete_user') ? 1:0)); @@ -133,7 +133,7 @@ function menuAction(a) { $sql .= "ORDER BY username"; $ds = mysql_query($sql); - include_once $base_path."manager/includes/controls/datagrid.class.php"; + include_once MODX_MANAGER_PATH."includes/controls/datagrid.class.php"; $grd = new DataGrid('',$ds,$number_of_results); // set page size to 0 t show all items $grd->noRecordMsg = $_lang["no_records_found"]; $grd->cssClass="grid"; diff --git a/manager/actions/web_user_management.static.php b/manager/actions/web_user_management.static.php index 23fe5b7d66..957d7707d0 100644 --- a/manager/actions/web_user_management.static.php +++ b/manager/actions/web_user_management.static.php @@ -26,7 +26,7 @@ // context menu -include_once $base_path."manager/includes/controls/contextmenu.php"; +include_once MODX_MANAGER_PATH."includes/controls/contextmenu.php"; $cm = new ContextMenu("cntxm", 150); $cm->addItem($_lang["edit"],"js:menuAction(1)","media/style/$manager_theme/images/icons/logging.gif",(!$modx->hasPermission('edit_user') ? 1:0)); $cm->addItem($_lang["delete"], "js:menuAction(2)","media/style/$manager_theme/images/icons/delete.gif",(!$modx->hasPermission('delete_user') ? 1:0)); @@ -115,7 +115,7 @@ function menuAction(a) { ($sqlQuery ? " WHERE (wu.username LIKE '$sqlQuery%') OR (wua.fullname LIKE '%$sqlQuery%') OR (wua.email LIKE '$sqlQuery%')":"")." ". "ORDER BY username"; $ds = mysql_query($sql); - include_once $base_path."manager/includes/controls/datagrid.class.php"; + include_once MODX_MANAGER_PATH."includes/controls/datagrid.class.php"; $grd = new DataGrid('',$ds,$number_of_results); // set page size to 0 t show all items $grd->noRecordMsg = $_lang["no_records_found"]; $grd->cssClass="grid"; diff --git a/manager/includes/extenders/dbapi.mysql.class.inc.php b/manager/includes/extenders/dbapi.mysql.class.inc.php index 38a2710ee3..b9db3f5ec2 100644 --- a/manager/includes/extenders/dbapi.mysql.class.inc.php +++ b/manager/includes/extenders/dbapi.mysql.class.inc.php @@ -462,7 +462,7 @@ function getHTMLGrid($dsq, $params) { if (!is_resource($dsq)) $dsq = $this->query($dsq); if ($dsq) { - include_once MODX_BASE_PATH . '/manager/includes/controls/datagrid.class.php'; + include_once MODX_MANAGER_PATH . 'includes/controls/datagrid.class.php'; $grd = new DataGrid('', $dsq); $grd->noRecordMsg = $params['noRecordMsg']; diff --git a/manager/includes/rss.inc.php b/manager/includes/rss.inc.php index 645240b745..9e9b6f9bee 100644 --- a/manager/includes/rss.inc.php +++ b/manager/includes/rss.inc.php @@ -28,7 +28,7 @@ // include MagPieRSS $basePath = $modx->config['base_path']; -require_once($basePath.'manager/media/rss/rss_fetch.inc'); +require_once(MODX_MANAGER_PATH.'media/rss/rss_fetch.inc'); $feedData = array(); diff --git a/manager/includes/sysalert.display.inc.php b/manager/includes/sysalert.display.inc.php index 15f69ba20e..6ca21f4b0b 100755 --- a/manager/includes/sysalert.display.inc.php +++ b/manager/includes/sysalert.display.inc.php @@ -24,7 +24,7 @@ ?> config['base_url'].'manager/media/style/'.$manager_theme.'/style.css'.'" />'; + echo ''; ?> + + diff --git a/install/changelog.txt b/install/changelog.txt index d634bae795..95a849e476 100755 --- a/install/changelog.txt +++ b/install/changelog.txt @@ -116,14 +116,14 @@ Bugfixes: * [#5807] manager.lockout not styled properly * [#6119] sendMailMessage in save_web_user.processor.php * [#7204] eForm in eFormParseTemplate $formats and $labels are declared as string but they are used as array -* [#7459] Deprecated function 'split' used in manager/includes/datefunctions.inc.php +* [#7459] Deprecated function 'split' used in includes/datefunctions.inc.php * [#9398] eForm & php 5.3 * [#9547] ManagerManager Tv-transfer options with multiple choice in a new tab * [#9548] cant modify the customTV(multiTv or other without type input) with ManagerManager * [#9549] page not index in yandex if use FirstChildRedirect * [#9550] Breadcrumbs not have crumbSeparator * [#9563] onManagerMainFrameHeaderHTMLBlock event issue -* [#9580] Bug in manager/processors/delete_content.processor.php on line 40 +* [#9580] Bug in processors/delete_content.processor.php on line 40 * [#9586] Quick Manager and system setting Automatic Template Assignment * [#9620] Set Manager language in Create/Edit User @@ -363,7 +363,7 @@ Bugfixes: * [#MODX-1106] Change help icons on TV create/edit screen * [#MODX-1103] Element Selector, part of the letters hides in search box * [#MODX-1566] Fix problem with Forgot Password confirmation link in WebLogin -* [#MODX-1659] Stay option for adding another manager/web user not working correctly +* [#MODX-1659] Stay option for adding another manager web user not working correctly * [#MODX-1164] Unable to set cssStyle when using getHTMLGrid * [#MODX-1176] Correct the permissions check when duplicating chunks and plugins * [#MODX-1753] Fix help page layout in manager diff --git a/install/index.php b/install/index.php index 06922eea9f..74ed0dee09 100755 --- a/install/index.php +++ b/install/index.php @@ -17,7 +17,7 @@ define("MGR_DIR", "manager"); require_once("lang.php"); -require_once('../manager/includes/version.inc.php'); +require_once('../'.MGR_DIR.'/includes/version.inc.php'); // start session session_start(); diff --git a/install/instprocessor.php b/install/instprocessor.php index 9088b29426..498dfec2dc 100755 --- a/install/instprocessor.php +++ b/install/instprocessor.php @@ -1,4 +1,5 @@ ".$_lang['ok']."

    "; } } - +$mgrdir = 'define(\'MGR_DIR\', \'manager\');'; // write the config.inc.php file if new installation echo "

    " . $_lang['writing_config_file']; $configString = ' 1) array_pop($a); - $url= implode("manager", $a); + $url= implode(MGR_DIR, $a); reset($a); - $a= explode("manager", str_replace("\\\\", "/", dirname(__FILE__))); + $a= explode(MGR_DIR, str_replace("\\\\", "/", dirname(__FILE__))); if (count($a) > 1) array_pop($a); - $pth= implode("manager", $a); + $pth= implode(MGR_DIR, $a); unset ($a); $base_url= $url . (substr($url, -1) != "/" ? "/" : ""); $base_path= $pth . (substr($pth, -1) != "/" && substr($pth, -1) != "\\\\" ? "/" : ""); @@ -246,15 +247,15 @@ function parseProperties($propertyString) { $site_url= ((isset ($_SERVER[\'HTTPS\']) && strtolower($_SERVER[\'HTTPS\']) == \'on\') || $_SERVER[\'SERVER_PORT\'] == $https_port) ? \'https://\' : \'http://\'; $site_url .= $_SERVER[\'HTTP_HOST\']; if ($_SERVER[\'SERVER_PORT\'] != 80) - $site_url= str_replace(\':\' . $_SERVER[\'SERVER_PORT\'], \'\', $site_url); // remove port from HTTP_HOST + $site_url= str_replace(\':\' . $_SERVER[\'SERVER_PORT\'], \'\', $site_url); // remove port from HTTP_HOST   $site_url .= ($_SERVER[\'SERVER_PORT\'] == 80 || (isset ($_SERVER[\'HTTPS\']) && strtolower($_SERVER[\'HTTPS\']) == \'on\') || $_SERVER[\'SERVER_PORT\'] == $https_port) ? \'\' : \':\' . $_SERVER[\'SERVER_PORT\']; $site_url .= $base_url; if (!defined(\'MODX_BASE_PATH\')) define(\'MODX_BASE_PATH\', $base_path); if (!defined(\'MODX_BASE_URL\')) define(\'MODX_BASE_URL\', $base_url); if (!defined(\'MODX_SITE_URL\')) define(\'MODX_SITE_URL\', $site_url); -if (!defined(\'MODX_MANAGER_PATH\')) define(\'MODX_MANAGER_PATH\', $base_path.\'manager/\'); -if (!defined(\'MODX_MANAGER_URL\')) define(\'MODX_MANAGER_URL\', $site_url.\'manager/\'); +if (!defined(\'MODX_MANAGER_PATH\')) define(\'MODX_MANAGER_PATH\', $base_path.MGR_DIR.\'/\'); +if (!defined(\'MODX_MANAGER_URL\')) define(\'MODX_MANAGER_URL\', $site_url.MGR_DIR.\'/\'); // start cms session if(!function_exists(\'startCMSSession\')) { @@ -279,7 +280,7 @@ function startCMSSession(){ } }'; $configString .= "\n?>"; -$filename = '../manager/includes/config.inc.php'; +$filename = '../'.MGR_DIR.'/includes/config.inc.php'; $configFileFailed = false; if (@ !$handle = fopen($filename, 'w')) { $configFileFailed = true; @@ -298,7 +299,7 @@ function startCMSSession(){ echo "" . $_lang['failed'] . "

    "; $errors += 1; ?> -

    manager/includes/config.inc.php

    +

    /includes/config.inc.php

    @@ -700,13 +701,14 @@ function startCMSSession(){ // Setup the MODx API -- needed for the cache processor define('MODX_API_MODE', true); define('MODX_BASE_PATH', $base_path); +if (!defined('MODX_MANAGER_PATH')) define('MODX_MANAGER_PATH', $base_path.MGR_DIR.'/'); $database_type = 'mysql'; // initiate a new document parser -include_once('../manager/includes/document.parser.class.inc.php'); +include_once('../'.MGR_DIR.'/includes/document.parser.class.inc.php'); $modx = new DocumentParser; $modx->db->connect(); // always empty cache after install -include_once "../manager/processors/cache_sync.class.processor.php"; +include_once "../".MGR_DIR."/processors/cache_sync.class.processor.php"; $sync = new synccache(); $sync->setCachepath("../assets/cache/"); $sync->setReport(false); diff --git a/install/lang/bulgarian.inc.php b/install/lang/bulgarian.inc.php index 97a3f841e5..37fdf55772 100644 --- a/install/lang/bulgarian.inc.php +++ b/install/lang/bulgarian.inc.php @@ -29,13 +29,13 @@ $_lang["btnclose_value"] = 'Затваряне'; $_lang["btnnext_value"] = 'Напред'; $_lang["cant_write_config_file"] = 'MODx не успя да запише конфигурационния файл. Моля, копирайте следното във файла '; -$_lang["cant_write_config_file_note"] = 'След като инсталацията завърши, можете да се логнете в Мениджъра на MODx, като напишете в браузера си YourSiteName.com/manager/.'; +$_lang["cant_write_config_file_note"] = 'След като инсталацията завърши, можете да се логнете в Мениджъра на MODx, като напишете в браузера си YourSiteName.com/'.MGR_DIR.'/.'; $_lang["checkbox_select_options"] = 'Опции:'; $_lang["checking_if_cache_exist"] = 'Проверка дали съществува директорията assets/cache : '; $_lang["checking_if_cache_file2_writable"] = 'Проверка дали може да се пише във файла assets/cache/sitePublishing.idx.php : '; $_lang["checking_if_cache_file_writable"] = 'Проверка дали може да се пише във файла assets/cache/siteCache.idx.php : '; $_lang["checking_if_cache_writable"] = 'Проверка дали в директорията assets/cache може да се пише: '; -$_lang["checking_if_config_exist_and_writable"] = 'Проверка дали manager/includes/config.inc.php съществува и може да се пише в него: '; +$_lang["checking_if_config_exist_and_writable"] = 'Проверка дали '.MGR_DIR.'/includes/config.inc.php съществува и може да се пише в него: '; $_lang["checking_if_export_exists"] = 'Проверка дали съществува директорията assets/export : '; $_lang["checking_if_export_writable"] = 'Проверка дали в директорията assets/export може да се пише: '; $_lang["checking_if_images_exist"] = 'Проверка дали съществува директорията assets/images : '; @@ -48,7 +48,7 @@ $_lang["checking_sessions"] = 'Проверка дали сесиите са правилно конфигурирани: '; $_lang["checking_table_prefix"] = 'Проверка на префикса на таблицата `'; $_lang["chunks"] = 'Чънкове'; -$_lang["config_permissions_note"] = 'За нови Linux/Unix инсталации, моля, създайте празен файл с име config.inc.php в директорията manager/includes/ и задайте права на файла 0666.'; +$_lang["config_permissions_note"] = 'За нови Linux/Unix инсталации, моля, създайте празен файл с име config.inc.php в директорията '.MGR_DIR.'/includes/ и задайте права на файла 0666.'; $_lang["connection_screen_collation"] = 'Колация:'; $_lang["connection_screen_connection_information"] = 'Информация за връзката'; $_lang["connection_screen_connection_method"] = 'Начин на свързване - метод:'; @@ -156,7 +156,7 @@ $_lang["table_prefix_not_exist"] = ' - Префиксът на таблицата не съществува в тази БД!'; $_lang["table_prefix_not_exist_note"] = 'Инсталаторът не може да инсталира в избраната БД, тъй като тя не съдържа таблици със зададения префикс, които да бъдат обновявени. Моля, изберете съществуващ префикс на таблица и стартирайте Инсталатора отново.'; $_lang["templates"] = 'Шаблони'; -$_lang["to_log_into_content_manager"] = 'За да се логнете в Мениджъра (manager/index.php) кликнете на бутона `Затваряне` .'; +$_lang["to_log_into_content_manager"] = 'За да се логнете в Мениджъра ('.MGR_DIR.'/index.php) кликнете на бутона `Затваряне` .'; $_lang["toggle"] = 'Включване'; $_lang["unable_install_chunk"] = 'Не успя да инсталира Чънк. Файл'; $_lang["unable_install_module"] = 'Не успя да инсталира Модул. Файл'; diff --git a/install/lang/czech.inc.php b/install/lang/czech.inc.php index a71d569849..d3f94c6be3 100644 --- a/install/lang/czech.inc.php +++ b/install/lang/czech.inc.php @@ -32,13 +32,13 @@ $_lang["btnclose_value"] = 'Zavřít'; $_lang["btnnext_value"] = 'Další'; $_lang["cant_write_config_file"] = 'MODx nemohl zapsat konfigurační soubor. Následující obsah vložte do souboru '; -$_lang["cant_write_config_file_note"] = 'Až bude tento obsah uložen v souboru, můžete se přihlásit do MODx správce obsahu na adrese AdresaVasichStranek.cz/manager/.'; +$_lang["cant_write_config_file_note"] = 'Až bude tento obsah uložen v souboru, můžete se přihlásit do MODx správce obsahu na adrese AdresaVasichStranek.cz/'.MGR_DIR.'/.'; $_lang["checkbox_select_options"] = 'Možnosti výběru zaškrtávacích polí:'; $_lang["checking_if_cache_exist"] = 'Kontrola existence adresářů /assets/cache a /assets/cache/rss: '; $_lang["checking_if_cache_file_writable"] = 'Kontrola zda lze zapisovat do souboru /assets/cache/siteCache.idx.php: '; $_lang["checking_if_cache_file2_writable"] = 'Kontrola zda lze zapisovat do souboru /assets/cache/sitePublishing.idx.php: '; $_lang["checking_if_cache_writable"] = 'Kontrola zda lze zapisovat do adresářů /assets/cache a /assets/cache/rss: '; -$_lang["checking_if_config_exist_and_writable"] = 'Kontrola zda existuje soubor /manager/includes/config.inc.php a lze do něj zapisovat: '; +$_lang["checking_if_config_exist_and_writable"] = 'Kontrola zda existuje soubor /'.MGR_DIR.'/includes/config.inc.php a lze do něj zapisovat: '; $_lang["checking_if_export_exists"] = 'Kontrola existence adresáře /assets/export: '; $_lang["checking_if_export_writable"] = 'Kontrola zda lze zapisovat do adresáře /assets/export: '; $_lang["checking_if_images_exist"] = 'Kontrola zda existují adresáře /assets/images, /assets/files, /assets/flash a /assets/media: '; @@ -51,7 +51,7 @@ $_lang["checking_sessions"] = 'Kontrola zda jsou správně nakonfigurovány session: '; $_lang["checking_table_prefix"] = 'Kontrola prefixů tabulek `'; $_lang["chunks"] = 'Chunky'; -$_lang["config_permissions_note"] = 'V nových instalacích Linux/Unix vytvořte prázdná soubor s názvem config.inc.php v adresáři /manager/includes/ s atributy 0666.'; +$_lang["config_permissions_note"] = 'V nových instalacích Linux/Unix vytvořte prázdná soubor s názvem config.inc.php v adresáři /'.MGR_DIR.'/includes/ s atributy 0666.'; $_lang["connection_screen_collation"] = 'Porovnání:'; $_lang["connection_screen_connection_method"] = 'Způsob připojení:'; $_lang["connection_screen_database_connection_information"] = 'Informace o databázi'; @@ -174,7 +174,7 @@ $_lang["table_prefix_not_exist"] = ' - Tabulky s daným prefixem v této databázi neexistují!'; $_lang["table_prefix_not_exist_note"] = 'Instalátor nemohl provést instalaci do vybrané databáze, neboť neobsahuje tabulky se zadaným prefixem. Vyberte existující prefix tabulek a spusťte instalátor znovu.'; $_lang["templates"] = 'Šablony'; -$_lang["to_log_into_content_manager"] = 'Pro přihlášení do správce obsahu (manager/index.php) klikněte na tlačítko "Zavřít".'; +$_lang["to_log_into_content_manager"] = 'Pro přihlášení do správce obsahu ('.MGR_DIR.'/index.php) klikněte na tlačítko "Zavřít".'; $_lang["toggle"] = 'Přepnutí'; $_lang['tvs'] = 'Template Variables'; $_lang["unable_install_chunk"] = 'Nepodařilo se nainstalovat chunk. Soubor'; diff --git a/install/lang/danish.inc.php b/install/lang/danish.inc.php index f71ec56a0a..8365350f12 100644 --- a/install/lang/danish.inc.php +++ b/install/lang/danish.inc.php @@ -31,13 +31,13 @@ $_lang["btnclose_value"] = 'Luk'; $_lang["btnnext_value"] = 'Næste'; $_lang["cant_write_config_file"] = 'MODx kunne ikke gemme konfigurationsfilen. Du skal kopiere nedenstående ind i filen '; -$_lang["cant_write_config_file_note"] = 'Når dette er gjort, kan du logge ind i MODx på adressen http://Ditdomænenavn.dk/manager/.'; +$_lang["cant_write_config_file_note"] = 'Når dette er gjort, kan du logge ind i MODx på adressen http://Ditdomænenavn.dk/'.MGR_DIR.'/.'; $_lang["checkbox_select_options"] = 'Valgmuligheder:'; $_lang["checking_if_cache_exist"] = 'Kontrollerer om /assets/cache og /assets/cache/rss mapperne er oprettet: '; $_lang["checking_if_cache_file_writable"] = 'Kontrollerer om /assets/cache/siteCache.idx.php filen er skrivbar: '; $_lang["checking_if_cache_file2_writable"] = 'Kontrollerer om /assets/cache/sitePublishing.idx.php filen er skrivbar: '; $_lang["checking_if_cache_writable"] = 'Kontrollerer om /assets/cache og /assets/cache/rss mapperne er skrivbare: '; -$_lang["checking_if_config_exist_and_writable"] = 'Kontrollerer om /manager/includes/config.inc.php er oprettet og er skrivbar: '; +$_lang["checking_if_config_exist_and_writable"] = 'Kontrollerer om /'.MGR_DIR.'/includes/config.inc.php er oprettet og er skrivbar: '; $_lang["checking_if_export_exists"] = 'Kontrollerer om /assets/export mappen er oprettet: '; $_lang["checking_if_export_writable"] = 'Kontrollerer om /assets/export mappen er skrivbar: '; $_lang["checking_if_images_exist"] = 'Kontrollerer om /assets/images, /assets/files, /assets/flash og /assets/media mapperne er oprettet: '; @@ -50,7 +50,7 @@ $_lang["checking_sessions"] = 'Kontrollerer om sessions er korrekt konfigureret: '; $_lang["checking_table_prefix"] = 'Kontrollerer database tabellernes præfiks `'; $_lang["chunks"] = 'Chunks'; -$_lang["config_permissions_note"] = 'Ved nyinstallation under Linux eller Unix, skal du oprette en tom fil, med navnet config.inc.php i /manager/includes/ mappen, med filrettighederne indstillet til 0666.'; +$_lang["config_permissions_note"] = 'Ved nyinstallation under Linux eller Unix, skal du oprette en tom fil, med navnet config.inc.php i /'.MGR_DIR.'/includes/ mappen, med filrettighederne indstillet til 0666.'; $_lang["connection_screen_collation"] = 'Collation:'; $_lang["connection_screen_connection_method"] = 'Connection\'s metode:'; $_lang["connection_screen_database_connection_information"] = 'Database information'; @@ -173,7 +173,7 @@ $_lang["table_prefix_not_exist"] = ' - Tabellens præfiks eksisterer ikke i denne database!'; $_lang["table_prefix_not_exist_note"] = 'Installationsprogrammet kunne ikke installere i den valgte database, da de eksisterende tabeller du har valgt der skal opdateres, ikke indeholder det præfiks du har indtastet. Indtast et eksisterende tabel præfiks og prøv at køre installationsprogrammet igen.'; $_lang["templates"] = 'Skabeloner'; -$_lang["to_log_into_content_manager"] = 'For at logge ind i CMS\'et (manager/index.php) skal du klikke på `Luk` knappen.'; +$_lang["to_log_into_content_manager"] = 'For at logge ind i CMS\'et ('.MGR_DIR.'/index.php) skal du klikke på `Luk` knappen.'; $_lang["toggle"] = 'Byt om på det valgte'; $_lang['tvs'] = 'Skabelon variabler'; $_lang["unable_install_chunk"] = 'Kunne ikke installere chunk. Fil'; diff --git a/install/lang/english.inc.php b/install/lang/english.inc.php index 2d483e8ab0..2c23809eda 100644 --- a/install/lang/english.inc.php +++ b/install/lang/english.inc.php @@ -30,13 +30,13 @@ $_lang["btnclose_value"] = 'Close'; $_lang["btnnext_value"] = 'Next'; $_lang["cant_write_config_file"] = 'MODX couldn\'t write the config file. Please copy the following into the file '; -$_lang["cant_write_config_file_note"] = 'Once that\'s been done, you can log into MODX Admin by pointing your browser at YourSiteName.com/manager/.'; +$_lang["cant_write_config_file_note"] = 'Once that\'s been done, you can log into MODX Admin by pointing your browser at YourSiteName.com/'.MGR_DIR.'/.'; $_lang["checkbox_select_options"] = 'Checkbox select options:'; $_lang["checking_if_cache_exist"] = 'Checking if /assets/cache and /assets/cache/rss directories exist: '; $_lang["checking_if_cache_file_writable"] = 'Checking if /assets/cache/siteCache.idx.php file is writable: '; $_lang["checking_if_cache_file2_writable"] = 'Checking if /assets/cache/sitePublishing.idx.php file is writable: '; $_lang["checking_if_cache_writable"] = 'Checking if /assets/cache and /assets/cache/rss directories are writable: '; -$_lang["checking_if_config_exist_and_writable"] = 'Checking if /manager/includes/config.inc.php exists and is writable: '; +$_lang["checking_if_config_exist_and_writable"] = 'Checking if /'.MGR_DIR.'/includes/config.inc.php exists and is writable: '; $_lang["checking_if_export_exists"] = 'Checking if /assets/export directory exists: '; $_lang["checking_if_export_writable"] = 'Checking if /assets/export directory is writable: '; $_lang["checking_if_images_exist"] = 'Checking if /assets/images, /assets/files, /assets/flash and /assets/media directories exists: '; @@ -49,7 +49,7 @@ $_lang["checking_sessions"] = 'Checking if sessions are properly configured: '; $_lang["checking_table_prefix"] = 'Checking table prefix `'; $_lang["chunks"] = 'Chunks'; -$_lang["config_permissions_note"] = 'For new Linux/Unix installs, please create a blank file named config.inc.php in the /manager/includes/ directory with file permissions set to 0666.'; +$_lang["config_permissions_note"] = 'For new Linux/Unix installs, please create a blank file named config.inc.php in the /'.MGR_DIR.'/includes/ directory with file permissions set to 0666.'; $_lang["connection_screen_collation"] = 'Collation:'; $_lang["connection_screen_connection_method"] = 'Connection method:'; $_lang["connection_screen_database_connection_information"] = 'Database information'; @@ -172,7 +172,7 @@ $_lang["table_prefix_not_exist"] = ' - Table prefix does not exist in this database!'; $_lang["table_prefix_not_exist_note"] = 'Setup couldn\'t install into the selected database, as it does not contain existing tables with the prefix you specified to be upgraded. Please choose an existing table prefix, and run Setup again.'; $_lang["templates"] = 'Templates'; -$_lang["to_log_into_content_manager"] = 'To log into the Content Manager (manager/index.php) you can click on the `Close` button.'; +$_lang["to_log_into_content_manager"] = 'To log into the Content Manager ('.MGR_DIR.'/index.php) you can click on the `Close` button.'; $_lang["toggle"] = 'Toggle'; $_lang['tvs'] = 'Template Variables'; $_lang["unable_install_chunk"] = 'Unable to install chunk. File'; diff --git a/install/lang/finnish-utf8.inc.php b/install/lang/finnish-utf8.inc.php index 244f5cd3d0..6e9f534410 100644 --- a/install/lang/finnish-utf8.inc.php +++ b/install/lang/finnish-utf8.inc.php @@ -30,13 +30,13 @@ $_lang["btnclose_value"] = 'Sulje'; $_lang["btnnext_value"] = 'Seuraava'; $_lang["cant_write_config_file"] = 'MODx ei voinut kirjoittaa asetukset tiedostoa. Ole hyvä ja kopioi seuraava asetustiedostoon '; -$_lang["cant_write_config_file_note"] = 'Kun tämä on tehty, voit kirjautua MODx hallintaan osoitteessa sinunosoite.fi/manager/.'; +$_lang["cant_write_config_file_note"] = 'Kun tämä on tehty, voit kirjautua MODx hallintaan osoitteessa sinunosoite.fi/'.MGR_DIR.'/.'; $_lang["checkbox_select_options"] = 'Valitse valintaruuduista:'; $_lang["checking_if_cache_exist"] = 'Tarkistetaan onko kansiot /assets/cache ja /assets/cache/rss olemassa: '; $_lang["checking_if_cache_file_writable"] = 'Tarkistetaan voiko tiedostoon /assets/cache/siteCache.idx.php kirjoittaa: '; $_lang["checking_if_cache_file2_writable"] = 'Tarkistetaan voiko tiedostoon /assets/cache/sitePublishing.idx.php kirjoittaa: '; $_lang["checking_if_cache_writable"] = 'Tarkistetaan voiko kansioihin /assets/cache ja /assets/cache/rss luoda uusia tiedostoja: '; -$_lang["checking_if_config_exist_and_writable"] = 'Tarkistetaan onko asetustiedosto manager/includes/config.inc.php olemassa ja voiko siihen kirjoittaa: '; +$_lang["checking_if_config_exist_and_writable"] = 'Tarkistetaan onko asetustiedosto '.MGR_DIR.'/includes/config.inc.php olemassa ja voiko siihen kirjoittaa: '; $_lang["checking_if_export_exists"] = 'Tarkistetaan onko kansio /assets/export olemassa: '; $_lang["checking_if_export_writable"] = 'Tarkistetaan voiko kansioon /assets/export luoda uusia tiedostoja: '; $_lang["checking_if_images_exist"] = 'Tarkistetaan onko kansiot /assets/images, /assets/files, /assets/flash ja /assets/media olemassa: '; @@ -49,7 +49,7 @@ $_lang["checking_sessions"] = 'Tarkistetaan onko palvelinistunnot asetettu toimimaan oikein: '; $_lang["checking_table_prefix"] = 'Tarkistetaan tietokannan taulujen etuliite `'; $_lang["chunks"] = 'HTML-palaset'; -$_lang["config_permissions_note"] = 'Jos olet asentamassa järjestelmää Linux / Unix palvelimeen, luo kansioon manager/includes/ tyhjä tiedosto nimeltä config.inc.php ja aseta tiedostoon 0666 oikeudet.'; +$_lang["config_permissions_note"] = 'Jos olet asentamassa järjestelmää Linux / Unix palvelimeen, luo kansioon '.MGR_DIR.'/includes/ tyhjä tiedosto nimeltä config.inc.php ja aseta tiedostoon 0666 oikeudet.'; $_lang["connection_screen_collation"] = 'Merkistö:'; $_lang["connection_screen_connection_method"] = 'Yhteystyyppi:'; $_lang["connection_screen_database_connection_information"] = 'Tietokannan yhteysasetukset'; @@ -166,7 +166,7 @@ $_lang["table_prefix_not_exist"] = ' - Tietokannan taulujen etuliitettä ei löydetty tästä tietokannasta!'; $_lang["table_prefix_not_exist_note"] = 'Asennusohjelma ei voinut asentaa valittuun tietokantaan, koska se ei sisällä tauluja asetetulla etuliitteellä, jotka asetit päivitystietoihin. Ole hyvä ja valitse uusi etuliite ja yritä uudelleen.'; $_lang["templates"] = 'Sivupohjat'; -$_lang["to_log_into_content_manager"] = 'Kirjautuaksesi sisällönhallintajärjestelmään (manager/index.php) napsauta `Sulje` painiketta.'; +$_lang["to_log_into_content_manager"] = 'Kirjautuaksesi sisällönhallintajärjestelmään ('.MGR_DIR.'/index.php) napsauta `Sulje` painiketta.'; $_lang["toggle"] = 'Vastakkaiset'; $_lang["unable_install_chunk"] = 'HTML-palasta ei voitu asentaa. Tiedosto'; $_lang["unable_install_module"] = 'Moduulia ei voitu asentaa. Tiedosto'; diff --git a/install/lang/francais-utf8.inc.php b/install/lang/francais-utf8.inc.php index c0378300c5..4962818df1 100644 --- a/install/lang/francais-utf8.inc.php +++ b/install/lang/francais-utf8.inc.php @@ -30,13 +30,13 @@ $_lang["btnclose_value"] = 'Fermer'; $_lang["btnnext_value"] = 'Suivant'; $_lang["cant_write_config_file"] = 'MODx n\'a pas pu écrire le fichier de configuration. Veuillez copier/coller ceci dans le fichier '; -$_lang["cant_write_config_file_note"] = 'Une fois l\'opération effectuée, vous pouvez vous connecter à l\'interface d\'administration de MODx en utilisant l\'adresse VotreSite.com/manager/.'; +$_lang["cant_write_config_file_note"] = 'Une fois l\'opération effectuée, vous pouvez vous connecter à l\'interface d\'administration de MODx en utilisant l\'adresse VotreSite.com/'.MGR_DIR.'/.'; $_lang["checkbox_select_options"] = 'Cochez pour sélectionner les options:'; $_lang["checking_if_cache_exist"] = 'Vérification de l\'existence du répertoire assets/cache: '; $_lang["checking_if_cache_file2_writable"] = 'Vérification des droits en écriture du fichier assets/cache/sitePublishing.idx.php: '; $_lang["checking_if_cache_file_writable"] = 'Vérification des droits en écriture du fichier assets/cache/siteCache.idx.php: '; $_lang["checking_if_cache_writable"] = 'Vérification des droits en écriture du répertoire assets/cache: '; -$_lang["checking_if_config_exist_and_writable"] = 'Vérification de l\'existence et des droits en écriture du fichier manager/includes/config.inc.php: '; +$_lang["checking_if_config_exist_and_writable"] = 'Vérification de l\'existence et des droits en écriture du fichier '.MGR_DIR.'/includes/config.inc.php: '; $_lang["checking_if_export_exists"] = 'Vérification de l\'existence du répertoire assets/export: '; $_lang["checking_if_export_writable"] = 'Vérification des droits en écriture du répertoire assets/export: '; $_lang["checking_if_images_exist"] = 'Vérification de l\'existence du répertoire assets/images: '; @@ -49,7 +49,7 @@ $_lang["checking_sessions"] = 'Vérifications des paramètres de sessions: '; $_lang["checking_table_prefix"] = 'Vérification du préfixe de table `'; $_lang["chunks"] = 'Chunks'; -$_lang["config_permissions_note"] = 'Lors des installations Linux/Unix, veuillez créer un nouveau fichier nommé config.inc.php dans le répertoire manager/includes/ avec les droits d\'accès 0666.'; +$_lang["config_permissions_note"] = 'Lors des installations Linux/Unix, veuillez créer un nouveau fichier nommé config.inc.php dans le répertoire '.MGR_DIR.'/includes/ avec les droits d\'accès 0666.'; $_lang["connection_screen_collation"] = 'Collation:'; $_lang["connection_screen_connection_method"] = 'Méthode de connexion:'; $_lang["connection_screen_database_connection_information"] = 'Informations base de données'; @@ -172,7 +172,7 @@ $_lang["table_prefix_not_exist"] = ' - Le préfixe de table n\'existe pas dans la base de données!'; $_lang["table_prefix_not_exist_note"] = 'Le programme d\'installation n\'a pas pu utiliser la base de données spécifiée parce qu\'elle ne contient pas de tables comportant le préfixe que vous avez choisi pour la mise à jour. Veuillez choisir un préfixe de table existant et recommencer l\'installation.'; $_lang["templates"] = 'Modèles'; -$_lang["to_log_into_content_manager"] = 'Pour vous connecter au Gestionnaire de Contenu (manager/index.php), cliquez sur le bouton «Fermer».'; +$_lang["to_log_into_content_manager"] = 'Pour vous connecter au Gestionnaire de Contenu ('.MGR_DIR.'/index.php), cliquez sur le bouton «Fermer».'; $_lang["toggle"] = 'Intervertir'; $_lang['tvs'] = 'Variables de Template'; $_lang["unable_install_chunk"] = 'Impossible d\'installer le Chunk. Fichier'; diff --git a/install/lang/german.inc.php b/install/lang/german.inc.php index f1024a3b01..5e101df38f 100644 --- a/install/lang/german.inc.php +++ b/install/lang/german.inc.php @@ -30,13 +30,13 @@ $_lang["btnclose_value"] = 'Schließen'; $_lang["btnnext_value"] = 'Weiter'; $_lang["cant_write_config_file"] = 'MODx konnte die Konfigurationsdatei nicht erstellen. Bitte fügen Sie folgendes in eine leere Datei ein:'; - $_lang["cant_write_config_file_note"] = 'Sobald dieser Vorgang beendet ist, können Sie sich im MODx-Manager anmelden unter http://ihredomain.de/manager/.'; + $_lang["cant_write_config_file_note"] = 'Sobald dieser Vorgang beendet ist, können Sie sich im MODx-Manager anmelden unter http://ihredomain.de/'.MGR_DIR.'/.'; $_lang["checkbox_select_options"] = 'Checkbox-Auswahlmöglichkeiten:'; $_lang["checking_if_cache_exist"] = 'Überprüfen ob Ordner assets/cache existiert: '; $_lang["checking_if_cache_file2_writable"] = 'Überprüfen ob die Datei assets/cache/sitePublishing.idx.php beschreibbar ist: '; $_lang["checking_if_cache_file_writable"] = 'Überprüfen ob die Datei assets/cache/siteCache.idx.php beschreibbar ist: '; $_lang["checking_if_cache_writable"] = 'Überprüfen ob der Ordner assets/cache beschreibbar ist: '; - $_lang["checking_if_config_exist_and_writable"] = 'Überprüfen ob die Datei manager/includes/config.inc.php existiert und beschreibbar ist: '; + $_lang["checking_if_config_exist_and_writable"] = 'Überprüfen ob die Datei '.MGR_DIR.'/includes/config.inc.php existiert und beschreibbar ist: '; $_lang["checking_if_export_exists"] = 'Überprüfen ob der Ordner assets/export existiert: '; $_lang["checking_if_export_writable"] = 'Überprüfen ob der Ordner assets/export beschreibbar ist: '; $_lang["checking_if_images_exist"] = 'Überprüfen ob der Ordner assets/images, assets/files, assets/flash, assets/media existiert: '; @@ -49,7 +49,7 @@ $_lang["checking_sessions"] = 'Überprüfe ob die Sessions sauber definiert sind: '; $_lang["checking_table_prefix"] = 'Überprüfe Tabellen-Präfixe `'; $_lang["chunks"] = 'Chunks'; - $_lang["config_permissions_note"] = 'Für neue Linux/Unix Installationen bitt eine leere Datei config.inc.php im Ordner manager/includes/ anlegen und die Dateirechte auf 0666 setzen.'; + $_lang["config_permissions_note"] = 'Für neue Linux/Unix Installationen bitt eine leere Datei config.inc.php im Ordner '.MGR_DIR.'/includes/ anlegen und die Dateirechte auf 0666 setzen.'; $_lang["connection_screen_collation"] = 'Kollation:'; $_lang["connection_screen_connection_method"] = 'Verbindungsmethode:'; $_lang["connection_screen_database_connection_information"] = 'Datenbankinformationen'; diff --git a/install/lang/hebrew.inc.php b/install/lang/hebrew.inc.php index 4c1613cba9..c5000fc981 100755 --- a/install/lang/hebrew.inc.php +++ b/install/lang/hebrew.inc.php @@ -31,13 +31,13 @@ $_lang["btnclose_value"] = 'סגור'; $_lang["btnnext_value"] = 'הבא'; $_lang["cant_write_config_file"] = 'MODx couldn\'t write the config file. Please copy the following into the file '; -$_lang["cant_write_config_file_note"] = 'Once that\'s been done, you can log into MODx Admin by pointing your browser at YourSiteName.com/manager/.'; +$_lang["cant_write_config_file_note"] = 'Once that\'s been done, you can log into MODx Admin by pointing your browser at YourSiteName.com/'.MGR_DIR.'/.'; $_lang["checkbox_select_options"] = 'אפשרויות שדה סימון:'; $_lang["checking_if_cache_exist"] = 'Checking if assets/cache directory exists: '; $_lang["checking_if_cache_file2_writable"] = 'Checking if assets/cache/sitePublishing.idx.php file is writable: '; $_lang["checking_if_cache_file_writable"] = 'Checking if assets/cache/siteCache.idx.php file is writable: '; $_lang["checking_if_cache_writable"] = 'Checking if assets/cache directory is writable: '; -$_lang["checking_if_config_exist_and_writable"] = 'Checking if manager/includes/config.inc.php exists and is writable: '; +$_lang["checking_if_config_exist_and_writable"] = 'Checking if '.MGR_DIR.'/includes/config.inc.php exists and is writable: '; $_lang["checking_if_export_exists"] = 'Checking if assets/export directory exists: '; $_lang["checking_if_export_writable"] = 'Checking if assets/export directory is writable: '; $_lang["checking_if_images_exist"] = 'Checking if assets/images directory exists: '; @@ -50,7 +50,7 @@ $_lang["checking_sessions"] = 'Checking if sessions are properly configured: '; $_lang["checking_table_prefix"] = 'Checking table prefix '; $_lang["chunks"] = 'מיני תבניות'; -$_lang["config_permissions_note"] = 'For new Linux/Unix installs, please create a blank file named config.inc.php in the manager/includes/ directory with file permissions set to 0666.'; +$_lang["config_permissions_note"] = 'For new Linux/Unix installs, please create a blank file named config.inc.php in the '.MGR_DIR.'/includes/ directory with file permissions set to 0666.'; $_lang["connection_screen_character_set"] = 'חיבור ערכת תווים:'; $_lang["connection_screen_collation"] = 'אוסף נתונים:'; $_lang["connection_screen_connection_information"] = 'מידע התחברות'; @@ -164,7 +164,7 @@ $_lang["table_prefix_not_exist_note"] = 'Setup couldn\'t install into the selected database, as it does not contain existing tables with the prefix you specified to be upgraded. Please choose an existing table prefix, and run Setup again.'; $_lang["templates"] = 'תבניות עיצוב'; $_lang["testing_connection"] = 'בודק חיבור...'; -$_lang["to_log_into_content_manager"] = 'על מנת להתחבר למערכת הניהול (manager/index.php) ניתן ללחוץ על כפתור `סגור`.'; +$_lang["to_log_into_content_manager"] = 'על מנת להתחבר למערכת הניהול ('.MGR_DIR.'/index.php) ניתן ללחוץ על כפתור `סגור`.'; $_lang["toggle"] = 'בחירה הפוכה'; $_lang["unable_install_chunk"] = 'Unable to install chunk. File'; $_lang["unable_install_module"] = 'Unable to install module. File'; diff --git a/install/lang/italian.inc.php b/install/lang/italian.inc.php index e77a2d278e..d60b743d0f 100644 --- a/install/lang/italian.inc.php +++ b/install/lang/italian.inc.php @@ -30,13 +30,13 @@ $_lang["btnclose_value"] = 'Chiudi'; $_lang["btnnext_value"] = 'Avanti'; $_lang["cant_write_config_file"] = 'MODx non ha potuto salvare il file di configurazione. Vi preghiamo di copiare il seguente testo nel file '; -$_lang["cant_write_config_file_note"] = 'Una volta completata l\'operazione, potete accedere a MODx inserendo nel browser l\'indirizzo vostrosito.it/manager/.'; +$_lang["cant_write_config_file_note"] = 'Una volta completata l\'operazione, potete accedere a MODx inserendo nel browser l\'indirizzo vostrosito.it/'.MGR_DIR.'/.'; $_lang["checkbox_select_options"] = 'Checkbox select options:'; $_lang["checking_if_cache_exist"] = 'Controllo se esistono le directories /assets/cache e /assets/cache/rss : '; $_lang["checking_if_cache_file_writable"] = 'Controllo i permessi di scrittura sul file /assets/cache/siteCache.idx.php : '; $_lang["checking_if_cache_file2_writable"] = 'Controllo i permessi di scrittura sul file /assets/cache/sitePublishing.idx.php : '; $_lang["checking_if_cache_writable"] = 'Controllo i permessi di scrittura sulle directories /assets/cache e /assets/cache/rss : '; -$_lang["checking_if_config_exist_and_writable"] = 'Controllo l\'esistenza e i permessi di scrittura di /manager/includes/config.inc.php : '; +$_lang["checking_if_config_exist_and_writable"] = 'Controllo l\'esistenza e i permessi di scrittura di /'.MGR_DIR.'/includes/config.inc.php : '; $_lang["checking_if_export_exists"] = 'Controllo se esiste la directory /assets/export : '; $_lang["checking_if_export_writable"] = 'Controllo i permessi di scrittura della directory /assets/export : '; $_lang["checking_if_images_exist"] = 'Controllo se esistono le directories /assets/images, /assets/files, /assets/flash e /assets/media : '; @@ -49,7 +49,7 @@ $_lang["checking_sessions"] = 'Controllo se le sessioni sono configurate correttamente: '; $_lang["checking_table_prefix"] = 'Controllo il prefisso per le tabelle `'; $_lang["chunks"] = 'Chunks'; -$_lang["config_permissions_note"] = 'Per nuove installazioni su Linux/Unix, vi preghiamo di creare un file vuoto config.inc.php nella directory /manager/includes/ con i permessi di scrittura a 0666.'; +$_lang["config_permissions_note"] = 'Per nuove installazioni su Linux/Unix, vi preghiamo di creare un file vuoto config.inc.php nella directory /'.MGR_DIR.'/includes/ con i permessi di scrittura a 0666.'; $_lang["connection_screen_collation"] = 'Collation:'; $_lang["connection_screen_connection_method"] = 'Tipo di connessione:'; $_lang["connection_screen_database_connection_information"] = 'Informazioni sul Database'; @@ -172,7 +172,7 @@ $_lang["table_prefix_not_exist"] = ' - Il prefisso selezionato per le tabelle non esiste in questo database!'; $_lang["table_prefix_not_exist_note"] = 'MODx non ha potuto proseguire con l\'installazione nel database selezionato poichè non contiene tabelle da aggiornare con il prefisso indicato. Vi preghiamo di scegliere un prefisso già esistente per le tabelle ed eseguire nuovamente il programma di installazione.'; $_lang["templates"] = 'Templates'; -$_lang["to_log_into_content_manager"] = 'Per accedere al Manager (manager/index.php) fate click sul bottone `Chiudi`.'; +$_lang["to_log_into_content_manager"] = 'Per accedere al Manager ('.MGR_DIR.'/index.php) fate click sul bottone `Chiudi`.'; $_lang["toggle"] = 'Inverti'; $_lang['tvs'] = 'Variabili di Template'; $_lang["unable_install_chunk"] = 'Impossibile installare il chunk. File'; diff --git a/install/lang/japanese-utf8.inc.php b/install/lang/japanese-utf8.inc.php index 7cf7770dbf..b44c57dd74 100755 --- a/install/lang/japanese-utf8.inc.php +++ b/install/lang/japanese-utf8.inc.php @@ -30,13 +30,13 @@ $_lang["btnclose_value"] = 'インストール終了'; $_lang["btnnext_value"] = '進む'; $_lang["cant_write_config_file"] = '設定ファイルを生成できませんでした。以下をコピーしてconfig.inc.phpに反映してください '; -$_lang["cant_write_config_file_note"] = '実行後は、サイト名/manager/ にアクセスすることで管理画面にログインできます。'; +$_lang["cant_write_config_file_note"] = '実行後は、サイト名/'.MGR_DIR.'/ にアクセスすることで管理画面にログインできます。'; $_lang["checkbox_select_options"] = '拡張機能の選択:'; $_lang["checking_if_cache_exist"] = '/assets/cacheディレクトリの存在チェック(なければ転送に失敗しています): '; $_lang["checking_if_cache_file_writable"] = 'ファイル/assets/cache/siteCache.idx.phpの書き込み属性(606などに設定): '; $_lang["checking_if_cache_file2_writable"] = 'ファイル/assets/cache/sitePublishing.idx.phpの書き込み属性(606などに設定): '; $_lang["checking_if_cache_writable"] = '/assets/cacheディレクトリの書き込み属性(707などに設定): '; -$_lang["checking_if_config_exist_and_writable"] = 'ファイル/manager/includes/config.inc.phpの存在と書き込み属性: '; +$_lang["checking_if_config_exist_and_writable"] = 'ファイル/'.MGR_DIR.'/includes/config.inc.phpの存在と書き込み属性: '; $_lang["checking_if_export_exists"] = '/assets/exportディレクトリの存在(なければ転送に失敗しています): '; $_lang["checking_if_export_writable"] = '/assets/exportディレクトリの書き込み属性(707などに設定): '; $_lang["checking_if_images_exist"] = '/assets/images,/assets/files,/assets/flash,/assets/mediaディレクトリの存在(なければ転送に失敗しています): '; @@ -49,7 +49,7 @@ $_lang["checking_sessions"] = 'セッション情報が正常に構成されるかどうか: '; $_lang["checking_table_prefix"] = 'Tableプリフィックスの設定 `'; $_lang["chunks"] = 'チャンク'; -$_lang["config_permissions_note"] = 'config.inc.phpという名前の空ファイルを作って/manager/includes/ディレクトリに転送するか、すでに転送済みのconfig.inc.php.blankをリネームするなどし、パーミッションを606などに設定してください。'; +$_lang["config_permissions_note"] = 'config.inc.phpという名前の空ファイルを作って/'.MGR_DIR.'/includes/ディレクトリに転送するか、すでに転送済みのconfig.inc.php.blankをリネームするなどし、パーミッションを606などに設定してください。'; $_lang["connection_screen_collation"] = '照合順序(エンコード指定含む):
    ※utf8_general_ciを
    おすすめします'; $_lang["connection_screen_connection_method"] = '接続時の文字セットの扱い:'; $_lang["connection_screen_database_connection_information"] = 'データベース設定'; @@ -102,7 +102,7 @@ $_lang["installation_upgrade_advanced"] = 'カスタムアップデート
    (データベース設定をアップデートできます)'; $_lang["installation_upgrade_advanced_note"] = 'データベース設定の変更を伴うアップデート(MySQL4→MySQL5など)が必要な場合はこちらを選んでください。config.inc.phpのデータベース接続情報一式を更新します。
    '; $_lang["installation_upgrade_existing"] = '通常アップデート'; -$_lang["installation_upgrade_existing_note"] = '通常のアップデートはこのオプションを。コアファイル・リソースファイルの両方とデータベースをアップデートします。
    【注意】データベースのバックアップはお済みですか?まだの場合は今からでもバックアップマネージャーでどうぞ。'; +$_lang["installation_upgrade_existing_note"] = '通常のアップデートはこのオプションを。コアファイル・リソースファイルの両方とデータベースをアップデートします。
    【注意】データベースのバックアップはお済みですか?まだの場合は今からでもバックアップマネージャーでどうぞ。'; $_lang["installed"] = 'インストールしました'; $_lang["installing_demo_site"] = 'サンプルサイトのインストール: '; $_lang["language_code"] = 'ja'; @@ -172,7 +172,7 @@ $_lang["table_prefix_not_exist"] = ' - 指定されたテーブルプレフィックスがデータベース内に存在していなかったため、インストールが完了しませんでした。正しいテーブルプリフィックスを指定し、再度実行してください。'; $_lang["table_prefix_not_exist_note"] = 'Setup couldn\'t install into the selected database, as it does not contain existing tables with the prefix you specified to be upgraded. Please choose an existing table prefix, and run Setup again.'; $_lang["templates"] = 'テンプレート'; -$_lang["to_log_into_content_manager"] = 'おつかれさまでした。「インストール終了」ボタンをクリックすると、管理画面のログインページ(manager/index.php)にアクセスします。'; +$_lang["to_log_into_content_manager"] = 'おつかれさまでした。「インストール終了」ボタンをクリックすると、管理画面のログインページ('.MGR_DIR.'/index.php)にアクセスします。'; $_lang["toggle"] = '選択状態を反転'; $_lang['tvs'] = 'テンプレート変数'; $_lang["unable_install_chunk"] = 'チャンクをインストールできません'; diff --git a/install/lang/norwegian.inc.php b/install/lang/norwegian.inc.php index 3d055a7aec..1683b17c86 100644 --- a/install/lang/norwegian.inc.php +++ b/install/lang/norwegian.inc.php @@ -32,13 +32,13 @@ $_lang["btnclose_value"] = 'Lukk'; $_lang["btnnext_value"] = 'Neste'; $_lang["cant_write_config_file"] = 'MODx kunne ikke skrive konfigurasjonsfilen. Kopier følgende til filen '; -$_lang["cant_write_config_file_note"] = 'Når det er klart kan du logge inn i MODx administrasjonskontoen ved å gå til adressen DittDomene.xx/manager/ i din nettleser.'; +$_lang["cant_write_config_file_note"] = 'Når det er klart kan du logge inn i MODx administrasjonskontoen ved å gå til adressen DittDomene.xx/'.MGR_DIR.'/ i din nettleser.'; $_lang["checkbox_select_options"] = 'Alternativ for kryssbokser:'; $_lang["checking_if_cache_exist"] = 'Kontrollerer at katalogen assets/cache eksisterer: '; $_lang["checking_if_cache_file2_writable"] = 'Kontrollerer at filen assets/cache/sitePublishing.idx.php er skrivbar: '; $_lang["checking_if_cache_file_writable"] = 'Kontrollerer at filen assets/cache/siteCache.idx.php er skrivbar: '; $_lang["checking_if_cache_writable"] = 'Kontrollerer at katalogen assets/cache er skrivbar: '; -$_lang["checking_if_config_exist_and_writable"] = 'Kontrollerer at filen manager/includes/config.inc.php eksisterer og er skrivbar: '; +$_lang["checking_if_config_exist_and_writable"] = 'Kontrollerer at filen '.MGR_DIR.'/includes/config.inc.php eksisterer og er skrivbar: '; $_lang["checking_if_export_exists"] = 'Kontrollerer at katalogen assets/export eksisterer: '; $_lang["checking_if_export_writable"] = 'Kontrollerer at katalogen assets/export er skrivbar: '; $_lang["checking_if_images_exist"] = 'Kontrollerer at katalogen assets/images eksisterer: '; @@ -51,7 +51,7 @@ $_lang["checking_sessions"] = 'Kontrollerer at sesjoner er korrekt konfigurert: '; $_lang["checking_table_prefix"] = 'Kontrollerer tabellprefixet `'; $_lang["chunks"] = 'Chunks'; -$_lang["config_permissions_note"] = 'For nye installasjoner i Linux/Unix-miljø må en tom fil med navnet config.inc.php opprettes i katalogen manager/includes/ med skriverrettighetene satt til 666.'; +$_lang["config_permissions_note"] = 'For nye installasjoner i Linux/Unix-miljø må en tom fil med navnet config.inc.php opprettes i katalogen '.MGR_DIR.'/includes/ med skriverrettighetene satt til 666.'; $_lang["connection_screen_collation"] = 'Kollasjonering:'; $_lang["connection_screen_connection_information"] = 'Tilkoblingsopplysninger'; $_lang["connection_screen_connection_method"] = 'Tilkoblingsmetode:'; @@ -160,7 +160,7 @@ $_lang["table_prefix_not_exist"] = ' - Tabellprefixet finnes ikke i denne databasen!'; $_lang["table_prefix_not_exist_note"] = 'Installasjonsprogrammet kunne ikke installere i den valgte databasen ettersom den ikke inneholder tabeller med det prefixet du oppga før oppgraderingen. Velg et eksisterende prefix og kjør installasjonsprogrammet på nytt.'; $_lang["templates"] = 'Maler'; -$_lang["to_log_into_content_manager"] = 'Du kan logge inn i inneholdshåndtereren (manager/index.php)ved å klikke på \"Lukk\"-knappen.'; +$_lang["to_log_into_content_manager"] = 'Du kan logge inn i inneholdshåndtereren ('.MGR_DIR.'/index.php)ved å klikke på \"Lukk\"-knappen.'; $_lang["toggle"] = 'Skift'; $_lang["unable_install_chunk"] = 'Kunne ikke installere chunk. Fil'; $_lang["unable_install_module"] = 'Kunne ikke installere modul. Fil'; diff --git a/install/lang/persian.inc.php b/install/lang/persian.inc.php index 7f71f7e69d..340f0783d9 100644 --- a/install/lang/persian.inc.php +++ b/install/lang/persian.inc.php @@ -31,13 +31,13 @@ $_lang["btnclose_value"] = 'ببند'; $_lang["btnnext_value"] = 'بعدی'; $_lang["cant_write_config_file"] = 'مد ایکس نتوانست فایل پیکر بندی (config) را بنویسد. لطفا این ها را در فایل پیکر بندی کپی کنید.'; -$_lang["cant_write_config_file_note"] = 'هنگامی که نصب با موفقیت یه اتمام رسید شما می توانید به قسمت مدیریت سایت خود به آدرس YourSiteName.com/manager/ بروید.'; +$_lang["cant_write_config_file_note"] = 'هنگامی که نصب با موفقیت یه اتمام رسید شما می توانید به قسمت مدیریت سایت خود به آدرس YourSiteName.com/'.MGR_DIR.'/ بروید.'; $_lang["checkbox_select_options"] = 'موارد را انتخاب کنید:'; $_lang["checking_if_cache_exist"] = 'مرور اینکه آیا assets/cache موجود است: '; $_lang["checking_if_cache_file2_writable"] = 'ررو اینکه آیا فایل assets/cache/sitePublishing.idx.php قابل نوشتن است: '; $_lang["checking_if_cache_file_writable"] = 'مرور اینکه آیا فایل assets/cache/siteCache.idx.php قابل نوشتن است: '; $_lang["checking_if_cache_writable"] = 'مرور اینکه آیا assets/cache قابل نوشتن است: '; -$_lang["checking_if_config_exist_and_writable"] = 'مرور اینکه آیا فایل manager/includes/config.inc.php موجود است و قابل نوشتن است: '; +$_lang["checking_if_config_exist_and_writable"] = 'مرور اینکه آیا فایل '.MGR_DIR.'/includes/config.inc.php موجود است و قابل نوشتن است: '; $_lang["checking_if_export_exists"] = 'مرور اینکه آیا assets/export موجود است: '; $_lang["checking_if_export_writable"] = 'مرور اینکه آیا assets/export قابل نوشتن است: '; $_lang["checking_if_images_exist"] = 'مرور اینکه آیا assets/images موجود است: '; @@ -50,7 +50,7 @@ $_lang["checking_sessions"] = 'بازخوانی sessions مطابق تنظیمات درست: '; $_lang["checking_table_prefix"] = 'مرور پیشوند جدول `'; $_lang["chunks"] = 'چانکها'; -$_lang["config_permissions_note"] = 'برای نصب جدید روی لینوکس/یونیکس, لطفا یک فایل خالی به نام config.inc.php در دایرکتوری manager/includes/ ایجاد کنید که سطح دسترسی به آن 0666 تنظیم شده باشد.'; +$_lang["config_permissions_note"] = 'برای نصب جدید روی لینوکس/یونیکس, لطفا یک فایل خالی به نام config.inc.php در دایرکتوری '.MGR_DIR.'/includes/ ایجاد کنید که سطح دسترسی به آن 0666 تنظیم شده باشد.'; $_lang["connection_screen_collation"] = 'تطبیق(Collation):'; $_lang["connection_screen_connection_information"] = 'جزییات اتصال به پایگاه داده »'; $_lang["connection_screen_database_connection_information"] = 'اطلاعات پایگاه داده'; @@ -158,7 +158,7 @@ $_lang["table_prefix_not_exist"] = ' - پیشوند جداول موجود نمی باشد'; $_lang["table_prefix_not_exist_note"] = 'صب و بروزرسانی با پیشوند جداولی که انتخاب کردید به علت موجود نبودن یشوند جداول با مشکل روبرو شد. لطف پیشوند جداول را بازرسی و دوباره امتحان کنید.'; $_lang["templates"] = 'قالب ها'; -$_lang["to_log_into_content_manager"] = 'برای ورود به قسمت مدیریت (manager/index.php) شما می توانید بر دکمه "ببند" کلیک کنید.'; +$_lang["to_log_into_content_manager"] = 'برای ورود به قسمت مدیریت ('.MGR_DIR.'/index.php) شما می توانید بر دکمه "ببند" کلیک کنید.'; $_lang["toggle"] = 'دستور'; $_lang["unable_install_chunk"] = 'نصب چانک با مشکل روبرو شد. فایل'; $_lang["unable_install_module"] = 'نصب ماژول با مشکل روبرو شد. فایل'; diff --git a/install/lang/polish-utf8.inc.php b/install/lang/polish-utf8.inc.php index a9edb3f82c..51a3ab1ed9 100644 --- a/install/lang/polish-utf8.inc.php +++ b/install/lang/polish-utf8.inc.php @@ -35,13 +35,13 @@ $_lang["btnclose_value"] = 'Zamknij'; $_lang["btnnext_value"] = 'Dalej'; $_lang["cant_write_config_file"] = 'Nie można zapisać pliku konfiguracyjnego. Skopiuj do pliku następującą treść: '; -$_lang["cant_write_config_file_note"] = 'Po zakończeniu instalacji będziesz mógł zalogować się do Menedżera MODxa znajdującego się pod adresem: TwojaNazwaDomeny.com/manager/'; +$_lang["cant_write_config_file_note"] = 'Po zakończeniu instalacji będziesz mógł zalogować się do Menedżera MODxa znajdującego się pod adresem: TwojaNazwaDomeny.com/'.MGR_DIR.'/'; $_lang["checkbox_select_options"] = 'Zaznacz wybrane opcje: '; $_lang["checking_if_cache_exist"] = 'Sprawdzanie, czy istnieją foldery /assets/cache oraz /assets/cache/rss: '; $_lang["checking_if_cache_file_writable"] = 'Sprawdzanie, czy plik /assets/cache/siteCache.idx.php jest zapisywalny: '; $_lang["checking_if_cache_file2_writable"] = 'Sprawdzanie, czy plik /assets/cache/sitePublishing.idx.php jest zapisywalny: '; $_lang["checking_if_cache_writable"] = 'Sprawdzanie, czy foldery /assets/cache oraz /assets/cache/rss są zapisywalne: '; -$_lang["checking_if_config_exist_and_writable"] = 'Sprawdzanie, czy plik /manager/includes/config.inc.php istnieje i jest zapisywalny: '; +$_lang["checking_if_config_exist_and_writable"] = 'Sprawdzanie, czy plik /'.MGR_DIR.'/includes/config.inc.php istnieje i jest zapisywalny: '; $_lang["checking_if_export_exists"] = 'Sprawdzanie, czy istnieje folder /assets/export: '; $_lang["checking_if_export_writable"] = 'Sprawdzanie, czy folder /assets/export jest zapisywalny: '; $_lang["checking_if_images_exist"] = 'Sprawdzanie, czy istnieją foldery /assets/images, /assets/files, /assets/flash oraz /assets/media: '; @@ -54,7 +54,7 @@ $_lang["checking_sessions"] = 'Sprawdzanie, czy obsługa sesji jest skonfigurowana poprawnie: '; $_lang["checking_table_prefix"] = 'Sprawdzanie prefiksu tabeli `'; $_lang["chunks"] = 'Chunki'; -$_lang["config_permissions_note"] = 'Dla nowych instalacji na systemach Linux/Unix utwórz pusty plik o nazwie config.inc.php w folderze /manager/includes/ i ustaw dla niego prawa dostępu na 0666.'; +$_lang["config_permissions_note"] = 'Dla nowych instalacji na systemach Linux/Unix utwórz pusty plik o nazwie config.inc.php w folderze /'.MGR_DIR.'/includes/ i ustaw dla niego prawa dostępu na 0666.'; $_lang["connection_screen_collation"] = 'System porównań (collation): '; $_lang["connection_screen_connection_method"] = 'Metoda połączenia: '; $_lang["connection_screen_database_connection_information"] = 'Informacje o bazie danych'; @@ -177,7 +177,7 @@ $_lang["table_prefix_not_exist"] = '- Tabele o tym prefiksie nie istnieją w wybranej bazie danych!'; $_lang["table_prefix_not_exist_note"] = 'Nie można zaktualizować MODxa w wybranej bazie danych, ponieważ nie zawiera ona tabel z określonym prefiksem. Wybierz prefiks, który został zastosowany dla istniejących już tabel i uruchom instalatora ponownie.'; $_lang["templates"] = 'Szablony'; -$_lang["to_log_into_content_manager"] = 'Po kliknięciu w przycisk `Zamknij` będziesz mógł zalogować się do Menedżera MODxa (manager/index.php).'; +$_lang["to_log_into_content_manager"] = 'Po kliknięciu w przycisk `Zamknij` będziesz mógł zalogować się do Menedżera MODxa ('.MGR_DIR.'/index.php).'; $_lang["toggle"] = 'Odwróć zaznaczenie'; $_lang['tvs'] = 'Zmienne Szablonów'; $_lang["unable_install_chunk"] = 'Nie można zainstalować chunków. Plik'; diff --git a/install/lang/portuguese-br.inc.php b/install/lang/portuguese-br.inc.php index b2dbd46625..47d599d26d 100755 --- a/install/lang/portuguese-br.inc.php +++ b/install/lang/portuguese-br.inc.php @@ -29,13 +29,13 @@ $_lang["btnclose_value"] = 'Fechar'; $_lang["btnnext_value"] = 'Prximo'; $_lang["cant_write_config_file"] = 'MODx no pode escrever o arquivo de configurao. Por favor copie no arquivo as seguintes informaes '; -$_lang["cant_write_config_file_note"] = 'Assim que isto for feito, voc pode acessar o MODx Admin por apontar seu navegador para NomeDoSeuSite.com/manager/.'; +$_lang["cant_write_config_file_note"] = 'Assim que isto for feito, voc pode acessar o MODx Admin por apontar seu navegador para NomeDoSeuSite.com/'.MGR_DIR.'/.'; $_lang["checkbox_select_options"] = 'Selecionar:'; $_lang["checking_if_cache_exist"] = 'Checando se o diretrio assets/cache existe: '; $_lang["checking_if_cache_file2_writable"] = 'Checando se o arquivo assets/cache/sitePublishing.idx.php est liberado pra escrita: '; $_lang["checking_if_cache_file_writable"] = 'Checando se o arquivo assets/cache/siteCache.idx.php est liberado pra escrita: '; $_lang["checking_if_cache_writable"] = 'Checando se o diretrio assets/cache est liberado pra escrita: '; -$_lang["checking_if_config_exist_and_writable"] = 'Checando se o arquivo manager/includes/config.inc.php existe e est liberado pra escrita: '; +$_lang["checking_if_config_exist_and_writable"] = 'Checando se o arquivo '.MGR_DIR.'/includes/config.inc.php existe e est liberado pra escrita: '; $_lang["checking_if_export_exists"] = 'Checando se o diretrio assets/export directory exists: '; $_lang["checking_if_export_writable"] = 'Checando se o diretrio assets/export est liberado pra escrita: '; $_lang["checking_if_images_exist"] = 'Checando se o diretrio assets/images existe: '; @@ -46,7 +46,7 @@ $_lang["checking_sessions"] = 'Checando se as sees esto configuradas apropiadamente: '; $_lang["checking_table_prefix"] = 'Verificando Prefixo de Tabela `'; $_lang["chunks"] = 'Chunks'; -$_lang["config_permissions_note"] = 'Para novas instalaes de Linux/Unix, crie um arquivo vazio chamado config.inc.php no diretrio manager/includes/ com as permisses de 0666.'; +$_lang["config_permissions_note"] = 'Para novas instalaes de Linux/Unix, crie um arquivo vazio chamado config.inc.php no diretrio '.MGR_DIR.'/includes/ com as permisses de 0666.'; $_lang["connection_screen_collation"] = 'Collation:'; $_lang["connection_screen_connection_information"] = 'Informao de Conexo'; $_lang["connection_screen_database_connection_information"] = 'Informao da Base de Dados.'; @@ -149,7 +149,7 @@ $_lang["table_prefix_not_exist"] = ' - Prefixo de Table no existe nesta Base de Dados!'; $_lang["table_prefix_not_exist_note"] = 'No foi possvel instalar na base de dados selecionada, como no h tabelas com o prefixo que voc inseriu. Por favor, escolha outro prefixo de tabela e re-comee a atualizao.'; $_lang["templates"] = 'Templates'; -$_lang["to_log_into_content_manager"] = 'Para logar no gerenciador de contedo (manager/index.php) voc pode clicar no boto Fechar.'; +$_lang["to_log_into_content_manager"] = 'Para logar no gerenciador de contedo ('.MGR_DIR.'/index.php) voc pode clicar no boto Fechar.'; $_lang["toggle"] = 'Detalhar'; $_lang["unable_install_chunk"] = 'No foi possivel instalar o chunk. Arquivo'; $_lang["unable_install_module"] = 'No foi possivel instalar o module. Arquivo'; diff --git a/install/lang/russian-UTF8.inc.php b/install/lang/russian-UTF8.inc.php index e8efcbdf17..34b0cad525 100644 --- a/install/lang/russian-UTF8.inc.php +++ b/install/lang/russian-UTF8.inc.php @@ -33,13 +33,13 @@ $_lang["btnclose_value"] = 'Закрыть'; $_lang["btnnext_value"] = 'Далее'; $_lang["cant_write_config_file"] = 'Программа установки не смогла записать файл конфигурации. Скопируйте вышеперечисленное в файл '; -$_lang["cant_write_config_file_note"] = 'Как только вы это сделаете, вы можете войти в панель управления, перейдя в браузере по адресу Адрес_Вашего_Сайта/manager/.'; +$_lang["cant_write_config_file_note"] = 'Как только вы это сделаете, вы можете войти в панель управления, перейдя в браузере по адресу Адрес_Вашего_Сайта/'.MGR_DIR.'/.'; $_lang["checkbox_select_options"] = 'Параметры выбора флажков:'; $_lang["checking_if_cache_exist"] = 'Проверка существования папок /assets/cache и /assets/cache/rss: '; $_lang["checking_if_cache_file_writable"] = 'Проверка возможности записи в файл /assets/cache/siteCache.idx.php: '; $_lang["checking_if_cache_file2_writable"] = 'Проверка возможности записи в файл /assets/cache/sitePublishing.idx.php: '; $_lang["checking_if_cache_writable"] = 'Проверка возможности записи в папки /assets/cache и /assets/cache/rss: '; -$_lang["checking_if_config_exist_and_writable"] = 'Проверка существования и возможности записи в файл /manager/includes/config.inc.php: '; +$_lang["checking_if_config_exist_and_writable"] = 'Проверка существования и возможности записи в файл /'.MGR_DIR.'/includes/config.inc.php: '; $_lang["checking_if_export_exists"] = 'Проверка существования папки /assets/export: '; $_lang["checking_if_export_writable"] = 'Проверка возможности записи в папку /assets/export: '; $_lang["checking_if_images_exist"] = 'Проверка существования папок /assets/images, /assets/files, /assets/flash и /assets/media: '; @@ -52,7 +52,7 @@ $_lang["checking_sessions"] = 'Проверка настроек сессий: '; $_lang["checking_table_prefix"] = 'Проверка префикса таблиц `'; $_lang["chunks"] = 'Чанки'; -$_lang["config_permissions_note"] = 'При новой Linux/Unix установке, создайте пустой файл config.inc.php в папке /manager/includes/ с правами 0666.'; +$_lang["config_permissions_note"] = 'При новой Linux/Unix установке, создайте пустой файл config.inc.php в папке /'.MGR_DIR.'/includes/ с правами 0666.'; $_lang["connection_screen_collation"] = 'Сопоставление:'; $_lang["connection_screen_connection_method"] = 'Метод сопоставления:'; $_lang["connection_screen_database_connection_information"] = 'Параметры базы данных'; @@ -175,7 +175,7 @@ $_lang["table_prefix_not_exist"] = ' - нет такого префикса таблиц в базе данных!'; $_lang["table_prefix_not_exist_note"] = 'Продолжение установки невозможно, так как нет таблиц с указанным префиксом, измените префикс таблиц и попробуйте снова.'; $_lang["templates"] = 'Шаблоны'; -$_lang["to_log_into_content_manager"] = 'Чтобы войти в панель управления (manager/index.php) нажмите на кнопку `Закрыть`.'; +$_lang["to_log_into_content_manager"] = 'Чтобы войти в панель управления ('.MGR_DIR.'/index.php) нажмите на кнопку `Закрыть`.'; $_lang["toggle"] = 'Переключить'; $_lang["tvs"] = 'Параметры (TV)'; $_lang["unable_install_chunk"] = 'Невозможно установить чанк. Файл'; diff --git a/install/lang/spanish-utf8.inc.php b/install/lang/spanish-utf8.inc.php index 02e211aef4..f43e86b579 100644 --- a/install/lang/spanish-utf8.inc.php +++ b/install/lang/spanish-utf8.inc.php @@ -30,13 +30,13 @@ $_lang["btnclose_value"] = 'Cerrar'; $_lang["btnnext_value"] = 'Siguiente'; $_lang["cant_write_config_file"] = 'MODx no pudo escribir al archivo de configuración. Por favor copia lo siguiente en el archivo. '; -$_lang["cant_write_config_file_note"] = 'Una vez que se ha hecho eso, puedes entrar al sistema administrativo de MODx al poner en tu navegador la dirección YourSiteName.com/manager/.'; +$_lang["cant_write_config_file_note"] = 'Una vez que se ha hecho eso, puedes entrar al sistema administrativo de MODx al poner en tu navegador la dirección YourSiteName.com/'.MGR_DIR.'/.'; $_lang["checkbox_select_options"] = 'Lista Múltiple:'; $_lang["checking_if_cache_exist"] = 'Comprobando si el directorio assets/cache existe: '; $_lang["checking_if_cache_file2_writable"] = 'Comprobando que el archivo assets/cache/sitePublishing.idx.php es escribible: '; $_lang["checking_if_cache_file_writable"] = 'Comprobando que el archivo assets/cache/siteCache.idx.php es escribible: '; $_lang["checking_if_cache_writable"] = 'Comprobando que el directorio assets/cache es escribible: '; -$_lang["checking_if_config_exist_and_writable"] = 'Comprobando que el archivo manager/includes/config.inc.php existe y es escribible: '; +$_lang["checking_if_config_exist_and_writable"] = 'Comprobando que el archivo '.MGR_DIR.'/includes/config.inc.php existe y es escribible: '; $_lang["checking_if_export_exists"] = 'Comprobando que el directorio assets/export existe: '; $_lang["checking_if_export_writable"] = 'Comprobando que el directorio assets/export es escribible: '; $_lang["checking_if_images_exist"] = 'Comprobando que los directorios assets/images, /assets/files, /assets/flash y /assets/media existan: '; @@ -49,7 +49,7 @@ $_lang["checking_sessions"] = 'Checando si las sesiones están apropiadamente configuradas: '; $_lang["checking_table_prefix"] = 'Checando el prefijo de las tablas `'; $_lang["chunks"] = 'Chunks'; -$_lang["config_permissions_note"] = 'Para instalaciones nuevas en servidores Linux/Unix, favpr de crear un archivo nuevo en blanco llamado config.inc.php en el directorio manager/includes/ con los permisos de archivo configurados a 0666.'; +$_lang["config_permissions_note"] = 'Para instalaciones nuevas en servidores Linux/Unix, favpr de crear un archivo nuevo en blanco llamado config.inc.php en el directorio '.MGR_DIR.'/includes/ con los permisos de archivo configurados a 0666.'; $_lang["connection_screen_collation"] = 'Compaginación:'; $_lang["connection_screen_connection_method"] = 'Método de Conexión:'; $_lang["connection_screen_database_connection_information"] = 'Información de la base de datos'; @@ -166,7 +166,7 @@ $_lang["table_prefix_not_exist"] = ' - ¡Este prefijo no existe en esta base de datos!'; $_lang["table_prefix_not_exist_note"] = 'El configurador no pudo instalar en la base de datos seleccionada, no contiene tablas existentes con el prefijo que especificaste para ser actualizadas. Por favor escoge un prefijo de tablas existente y corre el configurador otra vez.'; $_lang["templates"] = 'Templates'; -$_lang["to_log_into_content_manager"] = 'Para entrar al sistema de administración de MODx (manager/index.php) dando clic en el botón de `Cerrar`.'; +$_lang["to_log_into_content_manager"] = 'Para entrar al sistema de administración de MODx ('.MGR_DIR.'/index.php) dando clic en el botón de `Cerrar`.'; $_lang["toggle"] = 'Invertir'; $_lang['tvs'] = 'Template Variables'; $_lang["unable_install_chunk"] = 'No se pudo instalar el chunk. Archivo'; diff --git a/install/lang/svenska.inc.php b/install/lang/svenska.inc.php index 7cc735f73a..910097f5f3 100644 --- a/install/lang/svenska.inc.php +++ b/install/lang/svenska.inc.php @@ -35,13 +35,13 @@ $_lang["btnclose_value"] = 'Stäng'; $_lang["btnnext_value"] = 'Nästa'; $_lang["cant_write_config_file"] = 'MODx kunde inte skriva konfigurationsfilen. Kopiera följande till filen '; -$_lang["cant_write_config_file_note"] = 'När det är klart kan du logga in i MODx administrationsdel genom att ange adressen DinWebbplats.se/manager/ i din webbläsare.'; +$_lang["cant_write_config_file_note"] = 'När det är klart kan du logga in i MODx administrationsdel genom att ange adressen DinWebbplats.se/'.MGR_DIR.'/ i din webbläsare.'; $_lang["checkbox_select_options"] = 'Välj flera element:'; $_lang["checking_if_cache_exist"] = 'Kontrollerar att katalogerna /assets/cache och /assets/cache/rss existerar: '; $_lang["checking_if_cache_file_writable"] = 'Kontrollerar att filen /assets/cache/siteCache.idx.php är skrivbar: '; $_lang["checking_if_cache_file2_writable"] = 'Kontrollerar att filen /assets/cache/sitePublishing.idx.php är skrivbar: '; $_lang["checking_if_cache_writable"] = 'Kontrollerar att katalogerna /assets/cache och /assets/cache/rss är skrivbara: '; -$_lang["checking_if_config_exist_and_writable"] = 'Kontrollerar att filen /manager/includes/config.inc.php existerar och är skrivbar: '; +$_lang["checking_if_config_exist_and_writable"] = 'Kontrollerar att filen /'.MGR_DIR.'/includes/config.inc.php existerar och är skrivbar: '; $_lang["checking_if_export_exists"] = 'Kontrollerar att katalogen /assets/export existerar: '; $_lang["checking_if_export_writable"] = 'Kontrollerar att katalogen /assets/export är skrivbar: '; $_lang["checking_if_images_exist"] = 'Kontrollerar att katalogerna /assets/images, /assets/files, /assets/flash och /assets/media existerar: '; @@ -54,7 +54,7 @@ $_lang["checking_sessions"] = 'Kontrollerar att sessioner är korrekt konfigurerade: '; $_lang["checking_table_prefix"] = 'Kontrollerar tabellprefixet `'; $_lang["chunks"] = 'Chunks'; -$_lang["config_permissions_note"] = 'För nya installationer i Linux/Unix-miljö måste en tom fil med namnet config.inc.php skapas i katalogen /manager/includes/ med åtkomsträttigheterna satta till 0666.'; +$_lang["config_permissions_note"] = 'För nya installationer i Linux/Unix-miljö måste en tom fil med namnet config.inc.php skapas i katalogen /'.MGR_DIR.'/includes/ med åtkomsträttigheterna satta till 0666.'; $_lang["connection_screen_collation"] = 'Kollationering:'; $_lang["connection_screen_connection_method"] = 'Anslutningsmetod:'; $_lang["connection_screen_database_connection_information"] = 'Databasuppgifter'; @@ -177,7 +177,7 @@ $_lang["table_prefix_not_exist"] = ' - Tabellprefixet finns inte i den här databasen!'; $_lang["table_prefix_not_exist_note"] = 'Installationsprogrammet kunde inte installera i den valda databasen eftersom den inte innehåller tabeller med det prefix du angav för uppgradering. Välj ett existerande prefix och kör sedan installationsprogrammet igen.'; $_lang["templates"] = 'Mallar'; -$_lang["to_log_into_content_manager"] = 'Du kan logga in i innehållshanteraren (manager/index.php) genom att klicka på "Stäng"-knappen.'; +$_lang["to_log_into_content_manager"] = 'Du kan logga in i innehållshanteraren ('.MGR_DIR.'/index.php) genom att klicka på "Stäng"-knappen.'; $_lang["toggle"] = 'Växla'; $_lang['tvs'] = 'Mallvariabler'; $_lang["unable_install_chunk"] = 'Kunde inte installera chunk. Fil'; diff --git a/install/setup.data.sql b/install/setup.data.sql index 52b3c289f9..9b98082935 100644 --- a/install/setup.data.sql +++ b/install/setup.data.sql @@ -30,7 +30,7 @@ REPLACE INTO `{PREFIX}documentgroup_names` VALUES ('1','Site Admin Pages','0','0 # -REPLACE INTO `{PREFIX}site_content` VALUES (1, 'document', 'text/html', 'Home', 'Welcome to MODX', 'Introduction to MODX', 'index', '', 1, 0, 0, 0, 0, 'Create and do amazing things with MODX', '

    Install Successful!

    \r\n

    You have successfully installed and configured MODX. We hope you find this site an adequate starting configuration for many small business, organization or personal websites; just change the template and content, and you''ll be good to go! This site is preconfigured with a variety of options we hope are helpful, relevant and just plain cool for many marketing or personal sites:

    \r\n
      \r\n
    • Simple Blog. When logged into your site, you''ll be able to create new entries from the front end. This can also be turned into a News publishing or PR publishing system. View example blog
    • \r\n
    • Easy Comments. When logged into your site, your registered site users can comment on your posts. View example
    • \r\n
    • RSS Feeds. Your site visitors can stay up to date using your site feeds. View RSS feed
    • \r\n
    • Automatic User Registration. Those that wish to comment on blogs must first create an account. This comes pre-configured with a "Captcha" anti-robot registration feature. View registration form
    • \r\n
    • QuickEdit. When you''re logged into the manager, you can edit a page directly from the front end! More about CMS features
    • \r\n
    • Integrated Site Search. Allows visitors to search only the pages you wish them to search. Uses Ajax to display results without loading a new page.
    • \r\n
    • Powerful Navigation Builder. Duplicate or build virtually any navigation system with our dynamic menu builder code. The menu above, for example. More about menu features
    • \r\n
    • Mootools enabled. You''re on your way to Web 2.0 and AJAX goodness. More about Ajax features
    • \r\n
    • Custom "page not found (404)" page. Help visitors who go astray to find what they''re looking for. View 404 page
    • \r\n
    • Contact Us form. A highly configurable contact form you should customize to point to the right email address. Comes pre-configured to prevent mail-form-injection so your site does not become a source for spam. View form
    • \r\n
    • Newest documents list. Shows your visitor the most recently added pages (configurable).
    • \r\n
    • Customizable Content Manager. Preview uploaded images, hide or rename fields and lots more. See ManagerManager''s documentation for details and instructions. Quick start: ManagerManager by default will look for "rules" in a Chunk named "mm_rules". Simply copy or rename the Chunk named "mm_demo_rules" to "mm_rules" and try it out!
    • \r\n
    \r\n

    To log into the MODX Control Panel and start customizing this site, point your browser to [(site_url)]manager/.

    ', 1, 4, 1, 1, 1, 1, 1144904400, 1, 1160262629, 0, 0, 0, 0, 0, 'Home', 0, 0, 0, 0, 0, 0, 0); +REPLACE INTO `{PREFIX}site_content` VALUES (1, 'document', 'text/html', 'Home', 'Welcome to MODX', 'Introduction to MODX', 'index', '', 1, 0, 0, 0, 0, 'Create and do amazing things with MODX', '

    Install Successful!

    \r\n

    You have successfully installed and configured MODX. We hope you find this site an adequate starting configuration for many small business, organization or personal websites; just change the template and content, and you''ll be good to go! This site is preconfigured with a variety of options we hope are helpful, relevant and just plain cool for many marketing or personal sites:

    \r\n
      \r\n
    • Simple Blog. When logged into your site, you''ll be able to create new entries from the front end. This can also be turned into a News publishing or PR publishing system. View example blog
    • \r\n
    • Easy Comments. When logged into your site, your registered site users can comment on your posts. View example
    • \r\n
    • RSS Feeds. Your site visitors can stay up to date using your site feeds. View RSS feed
    • \r\n
    • Automatic User Registration. Those that wish to comment on blogs must first create an account. This comes pre-configured with a "Captcha" anti-robot registration feature. View registration form
    • \r\n
    • QuickEdit. When you''re logged into the manager, you can edit a page directly from the front end! More about CMS features
    • \r\n
    • Integrated Site Search. Allows visitors to search only the pages you wish them to search. Uses Ajax to display results without loading a new page.
    • \r\n
    • Powerful Navigation Builder. Duplicate or build virtually any navigation system with our dynamic menu builder code. The menu above, for example. More about menu features
    • \r\n
    • Mootools enabled. You''re on your way to Web 2.0 and AJAX goodness. More about Ajax features
    • \r\n
    • Custom "page not found (404)" page. Help visitors who go astray to find what they''re looking for. View 404 page
    • \r\n
    • Contact Us form. A highly configurable contact form you should customize to point to the right email address. Comes pre-configured to prevent mail-form-injection so your site does not become a source for spam. View form
    • \r\n
    • Newest documents list. Shows your visitor the most recently added pages (configurable).
    • \r\n
    • Customizable Content Manager. Preview uploaded images, hide or rename fields and lots more. See ManagerManager''s documentation for details and instructions. Quick start: ManagerManager by default will look for "rules" in a Chunk named "mm_rules". Simply copy or rename the Chunk named "mm_demo_rules" to "mm_rules" and try it out!
    • \r\n
    \r\n

    To log into the MODX Control Panel and start customizing this site, point your browser to [(site_manager_url)].

    ', 1, 4, 1, 1, 1, 1, 1144904400, 1, 1160262629, 0, 0, 0, 0, 0, 'Home', 0, 0, 0, 0, 0, 0, 0); REPLACE INTO `{PREFIX}site_content` VALUES (2, 'document', 'text/html', 'Blog', 'My Blog', '', 'blog', '', 1, 0, 0, 0, 1, '', '[[Ditto? &parents=`2` &display=`2` &removeChunk=`Comments` &tpl=`ditto_blog` &paginate=`1` &extenders=`summary,dateFilter` &paginateAlwaysShowLinks=`1` &tagData=`documentTags`]]\r\n\r\n

    Showing [+start+] - [+stop+] of [+total+] Articles

    \r\n\r\n
    [+previous+] [+pages+] [+next+]
    \r\n\r\n
     
    \r\n\r\n[[Reflect? &config=`wordpress` &dittoSnippetParameters=`parents:2` &id=`wp` &getDocuments=`1`]]', 1, 4, 2, 0, 0, 1, 1144904400, 1, 1159818696, 0, 0, 0, 0, 0, 'Blog', 0, 0, 0, 0, 0, 0, 0); @@ -51,7 +51,7 @@ REPLACE INTO `{PREFIX}site_content` VALUES (7, 'document', 'text/html', '404 - D REPLACE INTO `{PREFIX}site_content` VALUES (8, 'document', 'text/html', 'Search Results', 'Your Search Results', '', 'search-results', '', 1, 0, 0, 0, 0, '', '[!AjaxSearch? &showInputForm=`0` &ajaxSearch=`0`!]', 0, 4, 5, 0, 0, 1, 1144904400, 1, 1158613055, 0, 0, 0, 0, 0, '', 1, 0, 0, 0, 0, 0, 1); -REPLACE INTO `{PREFIX}site_content` VALUES (9, 'document', 'text/html', 'Mini-Blog HOWTO', 'How to Start Posting with MODX Mini-Blogs', '', 'article-1126081344', '', 1, 0, 0, 2, 1, '', '

    Setting up a mini-blog is relatively simple. Here''s what you need to do to get started with making new posts:

    \r\n
      \r\n
    1. Login to the MODX Control Panel.
    2. \r\n
    3. Press the plus-sign next to the Blog(2) container resource to see the blog entries posted there.
    4. \r\n
    5. To make a new Blog entry, simply right-click the Blog container document and choose the "Create Resource here" menu option. To edit an existing blog article, right click the entry and choose the "Edit Resource" menu option.
    6. \r\n \r\n
    7. Write or edit the content and press save, making sure the document is published.
    8. \r\n
    9. Everything else is automatic; you''re done!
    10. \r\n
    \r\n{{Comments}}', 1, 4, 0, 1, 1, -1, 1144904400, 1, 1160171764, 0, 0, 0, 0, 0, '', 0, 0, 0, 0, 0, 0, 1); +REPLACE INTO `{PREFIX}site_content` VALUES (9, 'document', 'text/html', 'Mini-Blog HOWTO', 'How to Start Posting with MODX Mini-Blogs', '', 'article-1126081344', '', 1, 0, 0, 2, 1, '', '

    Setting up a mini-blog is relatively simple. Here''s what you need to do to get started with making new posts:

    \r\n
      \r\n
    1. Login to the MODX Control Panel.
    2. \r\n
    3. Press the plus-sign next to the Blog(2) container resource to see the blog entries posted there.
    4. \r\n
    5. To make a new Blog entry, simply right-click the Blog container document and choose the "Create Resource here" menu option. To edit an existing blog article, right click the entry and choose the "Edit Resource" menu option.
    6. \r\n \r\n
    7. Write or edit the content and press save, making sure the document is published.
    8. \r\n
    9. Everything else is automatic; you''re done!
    10. \r\n
    \r\n{{Comments}}', 1, 4, 0, 1, 1, -1, 1144904400, 1, 1160171764, 0, 0, 0, 0, 0, '', 0, 0, 0, 0, 0, 0, 1); REPLACE INTO `{PREFIX}site_content` VALUES (11, 'document', 'text/xml', 'RSS Feed', '[(site_name)] RSS Feed', '', 'feed.rss', '', 1, 0, 0, 0, 0, '', '[[Ditto? &parents=`2` &format=`rss` &display=`20` &total=`20` &removeChunk=`Comments`]]', 0, 0, 6, 0, 0, 1, 1144904400, 1, 1160062859, 0, 0, 0, 0, 0, '', 0, 0, 0, 0, 0, 0, 1); @@ -92,7 +92,7 @@ REPLACE INTO `{PREFIX}site_content` VALUES (46, 'document', 'text/html', 'Thank # -REPLACE INTO `{PREFIX}site_htmlsnippets` VALUES (4, 'FormSignup', 'For the weblogin signup', 0, 2, 0, ' \r\n\r\n
    \r\n
    \r\n

    User Details

    \r\n

    Items marked by * are required

    \r\n \r\n \r\n \r\n
    \r\n \r\n
    \r\n

    Password

    \r\n \r\n \r\n
    \r\n \r\n
    \r\n

    Optional Account Profile Info

    \r\n \r\n \r\n
    \r\n \r\n
    \r\n

    Bot-Patrol

    \r\n

    Enter the word/number combination shown in the image below.

    \r\n

    \"If

    \r\n \r\n
    \r\n \r\n
    \r\n \r\n
    \r\n
    \r\n\r\n\r\n
    \r\n\r\n

    Signup completed successfully!
    \r\nYour account was created. A copy of your signup information was sent to your email address.

    \r\n', 0); +REPLACE INTO `{PREFIX}site_htmlsnippets` VALUES (4, 'FormSignup', 'For the weblogin signup', 0, 2, 0, ' \r\n\r\n
    \r\n
    \r\n

    User Details

    \r\n

    Items marked by * are required

    \r\n \r\n \r\n \r\n
    \r\n \r\n
    \r\n

    Password

    \r\n \r\n \r\n
    \r\n \r\n
    \r\n

    Optional Account Profile Info

    \r\n \r\n \r\n
    \r\n \r\n
    \r\n

    Bot-Patrol

    \r\n

    Enter the word/number combination shown in the image below.

    \r\n

    \"If

    \r\n \r\n
    \r\n \r\n
    \r\n \r\n
    \r\n
    \r\n\r\n\r\n
    \r\n\r\n

    Signup completed successfully!
    \r\nYour account was created. A copy of your signup information was sent to your email address.

    \r\n', 0); REPLACE INTO `{PREFIX}site_htmlsnippets` VALUES (6, 'nl_sidebar', 'Default Template TPL for Ditto', 0, 1, 0, '[+title+]
    \r\n[+longtitle+]

    ', 0); diff --git a/install/setup.info.php b/install/setup.info.php index d7a1288dec..f7ab6d6ba3 100755 --- a/install/setup.info.php +++ b/install/setup.info.php @@ -1,7 +1,9 @@ 真的. 请将您的 config文件(/manager/includes/config.inc.php) 设置为只读!'; +$_lang["configcheck_configinc_msg"] = '可能会有不怀好意的人通过它破坏网站. 真的. 请将您的 config文件(/'.MGR_DIR.'/includes/config.inc.php) 设置为只读!'; $_lang["configcheck_default_msg"] = '发生未知错误.'; $_lang["configcheck_errorpage_unpublished"] = 'The Error page defined in the site configuration settings is not published.'; $_lang["configcheck_errorpage_unpublished_msg"] = 'This means that your Error page is inaccessible to the general public, you should publish the page for it to work correctly.'; diff --git a/manager/includes/lang/czech.inc.php b/manager/includes/lang/czech.inc.php index 8f45fc8ffc..94d4528c37 100644 --- a/manager/includes/lang/czech.inc.php +++ b/manager/includes/lang/czech.inc.php @@ -116,7 +116,7 @@ $_lang["configcheck_cache"] = 'Adresář cache není nastavený pro zápis.'; $_lang["configcheck_cache_msg"] = 'MODx nemůže zapisovat do adresáře cache. Systém bude fungovat správně, ale nebude dostupná funkce zásobníku. Prosím nastavte povolení pro zápis do adresáře cache.'; $_lang["configcheck_configinc"] = 'Do konfiguračního souboru je stále možno zapisovat.'; -$_lang["configcheck_configinc_msg"] = 'Velmi neslušní lidé mohou potenciálně způsobit pěkný nepořádek na vašich stránkách a čemkoli spojeném s nimi. Opravdu. Prosím nastavte váš konfigurační soubor (/manager/includes/config.inc.php) jen pro čtení!'; +$_lang["configcheck_configinc_msg"] = 'Velmi neslušní lidé mohou potenciálně způsobit pěkný nepořádek na vašich stránkách a čemkoli spojeném s nimi. Opravdu. Prosím nastavte váš konfigurační soubor (/'.MGR_DIR.'/includes/config.inc.php) jen pro čtení!'; $_lang["configcheck_default_msg"] = 'Byla nalezena nespecifikovaná výstraha. Pro další postup použíjte křišťálovou kouli. :-)'; $_lang["configcheck_errorpage_unavailable"] = 'Vaše Chybová stránka (error 404) není dostupná.'; $_lang["configcheck_errorpage_unavailable_msg"] = 'To znamená, že vaše Chybová stránka není dostupná normálním internetovým uživatelům nebo neexistuje. To může vést k mnoha chybovým zápisům do logů. Ujistěte se zda žádná ze skupin návštěvníků nemá přístup k této stránce.'; diff --git a/manager/includes/lang/danish.inc.php b/manager/includes/lang/danish.inc.php index 6fd5a84e26..fc4d3b0bae 100644 --- a/manager/includes/lang/danish.inc.php +++ b/manager/includes/lang/danish.inc.php @@ -7,7 +7,7 @@ * @date 27/12/10 18.10 * @version 1.0.4 * - * Filename: /manager/includes/lang/danish.inc.php + * Filename: includes/lang/danish.inc.php * Language: Danish * Encoding: UTF-8 */ @@ -114,7 +114,7 @@ $_lang["configcheck_cache"] = 'Cache mappen er ikke skrivbar'; $_lang["configcheck_cache_msg"] = 'MODx Evolution kan ikke skrive til cache mappen. MODx Evolution vil dog stadig fungere men uden caching. For at rette dette, skal /_cache/ mappen gøres skrivbar.'; $_lang["configcheck_configinc"] = 'Konfigurationsfilen er stadigvæk skrivbar'; -$_lang["configcheck_configinc_msg"] = 'Det betyder at hackere kan ødelægge alt indholdet i websitet. Du skal ændre (/manager/includes/config.inc.php) så den kun er read-only!'; +$_lang["configcheck_configinc_msg"] = 'Det betyder at hackere kan ødelægge alt indholdet i websitet. Du skal ændre (/'.MGR_DIR.'/includes/config.inc.php) så den kun er read-only!'; $_lang["configcheck_default_msg"] = 'Der er opstået en uspecificeret fejl. Dette er så underligt at du bør informere en system administrator.'; $_lang["configcheck_errorpage_unavailable"] = 'Websitets fejlside er ikke til rådighed.'; $_lang["configcheck_errorpage_unavailable_msg"] = 'Det betyder at fejlsiden enten ikke eksisterer eller, at den ikke kan tilgås af normale besøgende. Det kan medføre, at systemet omstiller uden at stoppe, og vil samtidig resultere i, at websitets logfiler til sidst vil fylde for meget. Husk at kontrollere, at der ikke er nogle web bruger grupper, der er sammenkædet med siden.'; diff --git a/manager/includes/lang/english.inc.php b/manager/includes/lang/english.inc.php index f392f6fc86..42823f85f3 100755 --- a/manager/includes/lang/english.inc.php +++ b/manager/includes/lang/english.inc.php @@ -112,7 +112,7 @@ $_lang["configcheck_cache"] = 'cache directory not writable'; $_lang["configcheck_cache_msg"] = 'MODX cannot write to the cache directory. MODX will still function as expected, but no caching will take place. To solve this, make the /_cache/ directory writable.'; $_lang["configcheck_configinc"] = 'Config file still writable'; -$_lang["configcheck_configinc_msg"] = 'Very naughty people could potentially wreak some havoc on your site and everything associated with it. Really. Please make your config file (/manager/includes/config.inc.php) read only!'; +$_lang["configcheck_configinc_msg"] = 'Very naughty people could potentially wreak some havoc on your site and everything associated with it. Really. Please make your config file (/'.MGR_DIR.'/includes/config.inc.php) read only!'; $_lang["configcheck_default_msg"] = 'An unspecified warning was found. Which is strange.'; $_lang["configcheck_errorpage_unavailable"] = 'Your site\'s Error page is not available.'; $_lang["configcheck_errorpage_unavailable_msg"] = 'This means that your Error page is not accessible to normal web surfers or does not exist. This can lead to a recursive looping condition and many errors in your site logs. Make sure there are no Webuser Groups assigned to the page.'; @@ -1127,7 +1127,7 @@ $_lang['check_files_onlogin_message'] = 'By enabling this option, important system files will be checked for modification typical of scripted website attacks. While not a foolproof guarantee, it may alert you to a compromised MODX system file and website.'; $_lang['configcheck_sysfiles_mod'] = 'Important System Files have been modified.'; -$_lang['configcheck_sysfiles_mod_msg'] = 'You have enabled the setting to check important system files to detect possible website script attacks. This doesn\'t necessarily mean that your site has been compromised, however, you should review the changed files.(index.php, .htaccess, manager/index.php, manager/includes/config.inc.php)'; +$_lang['configcheck_sysfiles_mod_msg'] = 'You have enabled the setting to check important system files to detect possible website script attacks. This doesn\'t necessarily mean that your site has been compromised, however, you should review the changed files.(index.php, .htaccess, '.MGR_DIR.'/index.php, '.MGR_DIR.'/includes/config.inc.php)'; $_lang['setting_resource_tree_node_name'] = 'The node name of a resource tree'; $_lang['setting_resource_tree_node_name_desc'] = 'Specify the Resource field to use when rendering the nodes in the Resource Tree. Defaults to pagetitle, although any Resource field can be used, such as menutitle, alias.'; diff --git a/manager/includes/lang/finnish.inc.php b/manager/includes/lang/finnish.inc.php index 2178eb45d4..670435577f 100755 --- a/manager/includes/lang/finnish.inc.php +++ b/manager/includes/lang/finnish.inc.php @@ -110,7 +110,7 @@ $_lang["configcheck_cache"] = 'Välimuisti-kansioon (cache) ei voi kirjoittaa'; $_lang["configcheck_cache_msg"] = 'MODx ei voi kirjoittaa välimuistikansioon (cache). MODx toimii yhä kuten pitääkin, mutta mitään ei ladata välimuistiin. Ratkaise ongelma antamalla /_cache/ kansioon kirjoitusoikeudet.'; $_lang["configcheck_configinc"] = 'Asetustiedostoon voi yhä kirjoittaa'; -$_lang["configcheck_configinc_msg"] = 'Pahantahtoiset henkilöt voivat hyödyntää tätä murtautuakseen sivustollesi. Korjaa ongelma poistamalla tiedostosta (/manager/includes/config.inc.php) kirjoitusoikeudet!'; +$_lang["configcheck_configinc_msg"] = 'Pahantahtoiset henkilöt voivat hyödyntää tätä murtautuakseen sivustollesi. Korjaa ongelma poistamalla tiedostosta (/'.MGR_DIR.'/includes/config.inc.php) kirjoitusoikeudet!'; $_lang["configcheck_default_msg"] = 'Määrittelemätön varoitus on löytynyt. Outoa.'; $_lang["configcheck_errorpage_unavailable"] = 'Virhesivua ei ole saatavilla.'; $_lang["configcheck_errorpage_unavailable_msg"] = 'Virhesivulle ei ole käyttöoikeutta tai sitä ei ole olemassa. Tämä voi aiheuttaa ongelmia sivustolla. Varmista, ettei sivulle ole määritetty web-käyttäjäryhmää.'; diff --git a/manager/includes/lang/francais-utf8.inc.php b/manager/includes/lang/francais-utf8.inc.php index 25c0bda53f..c202ae1a98 100644 --- a/manager/includes/lang/francais-utf8.inc.php +++ b/manager/includes/lang/francais-utf8.inc.php @@ -112,7 +112,7 @@ $_lang["configcheck_cache"] = 'répertoire cache non modifiable'; $_lang["configcheck_cache_msg"] = 'MODx ne peut pas écrire dans le répertoire cache. MODx continuera à fonctionner normalement, mais le cache ne fonctionnera pas. Pour corriger ce problème, veuillez donnez les droits en écriture au répertoire /_cache/.'; $_lang["configcheck_configinc"] = 'Le fichier de configuration est encore accessible en écriture'; -$_lang["configcheck_configinc_msg"] = 'Des personnes mal intentionnées pourraient modifier la configuration de votre site. Modifiez immédiatement les permissions de votre fichier de configuration (/manager/includes/config.inc.php) pour qu\'il reste en lecture seule!'; +$_lang["configcheck_configinc_msg"] = 'Des personnes mal intentionnées pourraient modifier la configuration de votre site. Modifiez immédiatement les permissions de votre fichier de configuration (/'.MGR_DIR.'/includes/config.inc.php) pour qu\'il reste en lecture seule!'; $_lang["configcheck_default_msg"] = 'Une erreur inconnue est survenue. Étrange.'; $_lang["configcheck_errorpage_unavailable"] = 'La page d\'erreur de votre site n\'est pas définie.'; $_lang["configcheck_errorpage_unavailable_msg"] = 'Cela signifie que votre page d\'erreur n\'est pas accessible à vos visiteurs ou qu\'elle n\'existe pas. Cela peut provoquer une boucle infinie, générer des erreurs dans vos logs. Assurez vous qu\'aucun Groupe d\'Utilisateurs Web n\'est associé à cette page.'; diff --git a/manager/includes/lang/francais.inc.php b/manager/includes/lang/francais.inc.php index e0ad4fa966..ad1cedd439 100644 --- a/manager/includes/lang/francais.inc.php +++ b/manager/includes/lang/francais.inc.php @@ -112,7 +112,7 @@ $_lang["configcheck_cache"] = 'rpertoire cache non modifiable'; $_lang["configcheck_cache_msg"] = 'MODx ne peut pas crire dans le rpertoire cache. MODx continuera fonctionner normalement, mais le cache ne fonctionnera pas. Pour corriger ce problme, veuillez donnez les droits en criture au rpertoire /_cache/.'; $_lang["configcheck_configinc"] = 'Le fichier de configuration est encore accessible en criture'; -$_lang["configcheck_configinc_msg"] = 'Des personnes mal intentionnes pourraient modifier la configuration de votre site. Modifiez immdiatement les permissions de votre fichier de configuration (/manager/includes/config.inc.php) pour qu\'il reste en lecture seule!'; +$_lang["configcheck_configinc_msg"] = 'Des personnes mal intentionnes pourraient modifier la configuration de votre site. Modifiez immdiatement les permissions de votre fichier de configuration (/'.MGR_DIR.'/includes/config.inc.php) pour qu\'il reste en lecture seule!'; $_lang["configcheck_default_msg"] = 'Une erreur inconnue est survenue. trange.'; $_lang["configcheck_errorpage_unavailable"] = 'La page d\'erreur de votre site n\'est pas dfinie.'; $_lang["configcheck_errorpage_unavailable_msg"] = 'Cela signifie que votre page d\'erreur n\'est pas accessible vos visiteurs ou qu\'elle n\'existe pas. Cela peut provoquer une boucle infinie, gnrer des erreurs dans vos logs. Assurez vous qu\'aucun Groupe d\'Utilisateurs Web n\'est associ cette page.'; diff --git a/manager/includes/lang/german.inc.php b/manager/includes/lang/german.inc.php index d35336d1ea..a5afb85569 100644 --- a/manager/includes/lang/german.inc.php +++ b/manager/includes/lang/german.inc.php @@ -114,7 +114,7 @@ $_lang["configcheck_cache"] = 'Das Cache-Verzeichnis ist nicht beschreibbar'; $_lang["configcheck_cache_msg"] = 'MODx kann das Cache-Verzeichnis nicht beschreiben. MODx wird wie erwartet funktionieren, das Caching ist jedoch deaktiviert. Um das Problem zu beheben, machen Sie das Verzeichnis „cache“ im Verzeichnis „assets“ beschreibbar.'; $_lang["configcheck_configinc"] = 'Die Konfigurationsdatei ist weiterhin beschreibbar'; -$_lang["configcheck_configinc_msg"] = 'Böswillige Menschen könnten möglicherweise verheerende Schäden an Ihrer Website und allem was damit verbunden ist anrichten. Wichtig: Bitte ändern Sie die Zugriffsrechte der Konfigurationsdatei (/manager/includes/config.inc.php) auf nur-lesen!'; +$_lang["configcheck_configinc_msg"] = 'Böswillige Menschen könnten möglicherweise verheerende Schäden an Ihrer Website und allem was damit verbunden ist anrichten. Wichtig: Bitte ändern Sie die Zugriffsrechte der Konfigurationsdatei (/'.MGR_DIR.'/includes/config.inc.php) auf nur-lesen!'; $_lang["configcheck_default_msg"] = 'Eine nicht spezifizierte Warnung wurde ermittelt, was seltsam ist.'; $_lang["configcheck_errorpage_unavailable"] = 'Die Fehlerseite Ihres Webauftrittes ist nicht verfügbar.'; $_lang["configcheck_errorpage_unavailable_msg"] = 'Ihre Fehlerseite ist für normale Besucher nicht abrufbar oder existiert nicht. Dies kann zu einer Endlosschleife und vielen Fehlermeldungen in Ihren Webserver-Statistiken führen. Stellen Sie sicher, dass der Seite keine Benutzergruppen zugeordnet sind.'; diff --git a/manager/includes/lang/hebrew.inc.php b/manager/includes/lang/hebrew.inc.php index ee88a537be..bdd04c32a6 100755 --- a/manager/includes/lang/hebrew.inc.php +++ b/manager/includes/lang/hebrew.inc.php @@ -104,7 +104,7 @@ $_lang["configcheck_cache"] = 'תיקיית זיכרון המטמון לא ניתנת לכתיבה'; $_lang["configcheck_cache_msg"] = 'MODx לא יכול לכתוב לתיקיית זיכרון המטמון . MODx ימשיך לתפקד כמצופה, אך לא ניתן יהיה להשתמש בזיכרון מטמון. כדי לפתור את זה, יש לתת לתיקיית / _cache / הרשאות כתיבה.'; $_lang["configcheck_configinc"] = 'קובץ ההגדרות עדיין ניתן לכתיבה'; -$_lang["configcheck_configinc_msg"] = 'אנא הפוך את קובץ התצורה (/manager/includes/config.inc.php) לקריאה בלבד!'; +$_lang["configcheck_configinc_msg"] = 'אנא הפוך את קובץ התצורה (/'.MGR_DIR.'/includes/config.inc.php) לקריאה בלבד!'; $_lang["configcheck_default_msg"] = 'אזהרה לא מוגדרת נמצאה. הדבר מוזר.'; $_lang["configcheck_errorpage_unavailable"] = 'דף השגיאה של האתר לא זמין.'; $_lang["configcheck_errorpage_unavailable_msg"] = 'This means that your Error page is not accessible to normal web surfers or does not exist. This can lead to a recursive looping condition and many errors in your site logs. Make sure there are no webuser groups assigned to the page.'; diff --git a/manager/includes/lang/italian.inc.php b/manager/includes/lang/italian.inc.php index fc93da3ecb..313779c80e 100755 --- a/manager/includes/lang/italian.inc.php +++ b/manager/includes/lang/italian.inc.php @@ -111,8 +111,8 @@ $_lang["configcheck_admin"] = 'Vi preghiamo di contattare gli amministratori di sistema e avvisarli di questo messaggio!'; $_lang["configcheck_cache"] = 'cartella cache non scrivibile'; $_lang["configcheck_cache_msg"] = 'MODx non può scrivere nella cartella cache. MODx continuerà a funzionare come previsto, ma non avverrà alcuna operazione di caching. Per risolvere, rendete la cartella /_cache/ scrivibile.'; -$_lang["configcheck_configinc"] = 'Il file di configurazione (/manager/includes/config.inc.php) è ancora scrivibile'; -$_lang["configcheck_configinc_msg"] = 'Malintenzionati potrebbero combinare guai sul vostro sito e tutto ciò che è collegato ad esso. Sul serio. Impostate il file di configurazione (/manager/includes/config.inc.php) in sola lettura!'; +$_lang["configcheck_configinc"] = 'Il file di configurazione (/'.MGR_DIR.'/includes/config.inc.php) è ancora scrivibile'; +$_lang["configcheck_configinc_msg"] = 'Malintenzionati potrebbero combinare guai sul vostro sito e tutto ciò che è collegato ad esso. Sul serio. Impostate il file di configurazione (/'.MGR_DIR.'/includes/config.inc.php) in sola lettura!'; $_lang["configcheck_default_msg"] = 'E\' stato trovato un avviso non specificato. Che è sconosciuto.'; $_lang["configcheck_errorpage_unavailable"] = 'La pagina di Errore del vostro sito non è disponibile.'; $_lang["configcheck_errorpage_unavailable_msg"] = 'Ciò significa che la pagina di Errore non è accessibile da parte di normali visitatori web oppure non esiste. Questo fatto può portare ad una condizione di loop ricorsivo e generare numerosi errori nel log del vostro sito. Verificate che non ci siano Gruppi di Utenti Web assegnati a questa pagina.'; diff --git a/manager/includes/lang/japanese-utf8.inc.php b/manager/includes/lang/japanese-utf8.inc.php index 7f492c3af7..4c2391cbb6 100755 --- a/manager/includes/lang/japanese-utf8.inc.php +++ b/manager/includes/lang/japanese-utf8.inc.php @@ -114,7 +114,7 @@ $_lang["configcheck_cache"] = 'キャッシュディレクトリに書き込みできません'; $_lang["configcheck_cache_msg"] = 'キャッシュファイルを更新できません。MODXは動作しますが、キャッシュが利用できないためレスポンスが悪化します。/cache/ ディレクトリを書き込み可能にしてください。'; $_lang["configcheck_configinc"] = '設定ファイルがまだ書き込み可能になっています'; -$_lang["configcheck_configinc_msg"] = '設定ファイルが書き込み可能になっているため、悪意の第三者による操作がしやすい状態になっています。 /manager/includes/config.inc.php のパーミッションを404などに設定し、書込み不可にしてください。'; +$_lang["configcheck_configinc_msg"] = '設定ファイルが書き込み可能になっているため、悪意の第三者による操作がしやすい状態になっています。 /'.MGR_DIR.'/includes/config.inc.php のパーミッションを404などに設定し、書込み不可にしてください。'; $_lang["configcheck_default_msg"] = '原因不明のエラーが存在します。'; $_lang["configcheck_errorpage_unavailable"] = '設定した「エラーページ」は利用できません'; $_lang["configcheck_errorpage_unavailable_msg"] = '設定した「エラーページ」が一般的なエンドユーザーからアクセスできないページ(private)かあるいは存在しないことを意味しています。この場合、システムがループ状態に陥り、多くのエラーメッセージをエラーログに記録してしまいます。「エラーページ」には存在するページでかつ、公開ページ、かつ「public」なページを指定してください。'; diff --git a/manager/includes/lang/nederlands-utf8.inc.php b/manager/includes/lang/nederlands-utf8.inc.php index 0716af5aca..4b7160e6b8 100644 --- a/manager/includes/lang/nederlands-utf8.inc.php +++ b/manager/includes/lang/nederlands-utf8.inc.php @@ -114,7 +114,7 @@ $_lang["configcheck_cache"] = 'Kan niet schrijven in de cache Map'; $_lang["configcheck_cache_msg"] = 'MODx kan niet naar de cache Map schrijven. MODx blijft normaal functioneren, maar er zal geen caching plaatsvinden. Om dit probleem op te lossen dient u de /_cache/ Map schrijfrechten te geven.'; $_lang["configcheck_configinc"] = 'Configuratiebestand heeft nog schrijfrechten'; -$_lang["configcheck_configinc_msg"] = 'Slechtwillenden zouden mogelijk schade aan uw website kunnen toebrengen met alle gevolgen van dien. Echt waar. Zet a.u.b. uw configuratiebestand (/manager/includes/config.inc.php) op alleen-lezen!'; +$_lang["configcheck_configinc_msg"] = 'Slechtwillenden zouden mogelijk schade aan uw website kunnen toebrengen met alle gevolgen van dien. Echt waar. Zet a.u.b. uw configuratiebestand (/'.MGR_DIR.'/includes/config.inc.php) op alleen-lezen!'; $_lang["configcheck_default_msg"] = 'Er is een ongedefinieerde waarschuwing gevonden. Dit is zeer vreemd.'; $_lang["configcheck_errorpage_unavailable"] = 'Er is geen \'Fout\'-pagina voor uw website beschikbaar.'; $_lang["configcheck_errorpage_unavailable_msg"] = 'Dit houdt in dat uw \'Fout\'-pagina niet toegankelijk is voor normale Webgebruikers of niet bestaat. Dit kan leiden tot een oneindige lus en veel foutmeldingen in uw logbestand. Zorg ervoor dat de Pagina niet aan een Webgebruikersgroep is toegewezen.'; diff --git a/manager/includes/lang/nederlands.inc.php b/manager/includes/lang/nederlands.inc.php index fd872009ea..39751fc090 100644 --- a/manager/includes/lang/nederlands.inc.php +++ b/manager/includes/lang/nederlands.inc.php @@ -114,7 +114,7 @@ $_lang["configcheck_cache"] = 'Kan niet schrijven in de cache Map'; $_lang["configcheck_cache_msg"] = 'MODx kan niet naar de cache Map schrijven. MODx blijft normaal functioneren, maar er zal geen caching plaatsvinden. Om dit probleem op te lossen dient u de /_cache/ Map schrijfrechten te geven.'; $_lang["configcheck_configinc"] = 'Configuratiebestand heeft nog schrijfrechten'; -$_lang["configcheck_configinc_msg"] = 'Slechtwillenden zouden mogelijk schade aan uw website kunnen toebrengen met alle gevolgen van dien. Echt waar. Zet a.u.b. uw configuratiebestand (/manager/includes/config.inc.php) op alleen-lezen!'; +$_lang["configcheck_configinc_msg"] = 'Slechtwillenden zouden mogelijk schade aan uw website kunnen toebrengen met alle gevolgen van dien. Echt waar. Zet a.u.b. uw configuratiebestand (/'.MGR_DIR.'/includes/config.inc.php) op alleen-lezen!'; $_lang["configcheck_default_msg"] = 'Er is een ongedefinieerde waarschuwing gevonden. Dit is zeer vreemd.'; $_lang["configcheck_errorpage_unavailable"] = 'Er is geen \'Fout\'-pagina voor uw website beschikbaar.'; $_lang["configcheck_errorpage_unavailable_msg"] = 'Dit houdt in dat uw \'Fout\'-pagina niet toegankelijk is voor normale Webgebruikers of niet bestaat. Dit kan leiden tot een oneindige lus en veel foutmeldingen in uw logbestand. Zorg ervoor dat de Pagina niet aan een Webgebruikersgroep is toegewezen.'; diff --git a/manager/includes/lang/norsk.inc.php b/manager/includes/lang/norsk.inc.php index ca8f8a7e92..efb93e2934 100644 --- a/manager/includes/lang/norsk.inc.php +++ b/manager/includes/lang/norsk.inc.php @@ -93,7 +93,7 @@ $_lang["configcheck_cache"] = 'cache-mappen er ikke skrivbar'; $_lang["configcheck_cache_msg"] = 'MODx kan ikke skrive til cache-mappen. MODx kommer fortsatt til å virke som ventet, men ingen dokumenter vil caches. For å fikse dette, gjør /_cache/-mappen skrivbar.'; $_lang["configcheck_configinc"] = 'Konfigurasjonsfil er fortsatt skrivbar'; -$_lang["configcheck_configinc_msg"] = 'En angriper kan potensielt ødelegge siden din og alt som er relatert til den. Vennligst fjern skriverettigheter til konfigurasjonsfilen din (/manager/includes/config.inc.php) for å være sikker!'; +$_lang["configcheck_configinc_msg"] = 'En angriper kan potensielt ødelegge siden din og alt som er relatert til den. Vennligst fjern skriverettigheter til konfigurasjonsfilen din (/'.MGR_DIR.'/includes/config.inc.php) for å være sikker!'; $_lang["configcheck_default_msg"] = 'En uspesifisert advarsel ble funnet. Dette skal vanligvis ikke forekomme.'; $_lang["configcheck_images"] = 'Bildemappen er ikke skrivbar'; $_lang["configcheck_images_msg"] = 'Bildemappen er ikke skrivbar eller finnes ikke. Dette betyr at bildehånteringsfunksjonene i editoren ikke kommer til å fungere!'; diff --git a/manager/includes/lang/persian.inc.php b/manager/includes/lang/persian.inc.php index 188be62f31..1cf15680e1 100755 --- a/manager/includes/lang/persian.inc.php +++ b/manager/includes/lang/persian.inc.php @@ -98,7 +98,7 @@ $_lang["configcheck_cache"] = 'پوشه یا دایره ی دخیره یا کش قابل نگارش نیست'; $_lang["configcheck_cache_msg"] = 'سیستم امکان ایجاد نگارشی جدید در دایره ذخیره یا کش را ندارد. سیستم به فعالیت خود همچون گذشته ادامه میدهد, اما ذخیره ای صورت نمیگیرد. برای رفع این موضوع, لطفا پوشه ی /_cache/ را قابل نگارش نمایید.'; $_lang["configcheck_configinc"] = 'فایل کانفیگ همچنان قابل نگارش است'; -$_lang["configcheck_configinc_msg"] = 'انسانهای بی وجدان ممکن است از طریق این مسئله به وبگاه یا فایلهای مشترک با آن آسیب برسانند. حتما فایل کانفیگ خود را (/manager/includes/config.inc.php) تنها قابل بازخوانی کنید و از این حالت با قابلیت نگارش خارج کنید.'; +$_lang["configcheck_configinc_msg"] = 'انسانهای بی وجدان ممکن است از طریق این مسئله به وبگاه یا فایلهای مشترک با آن آسیب برسانند. حتما فایل کانفیگ خود را (/'.MGR_DIR.'/includes/config.inc.php) تنها قابل بازخوانی کنید و از این حالت با قابلیت نگارش خارج کنید.'; $_lang["configcheck_default_msg"] = 'به مشکلی برخوردید که توضیحی برای آن نداریم.'; $_lang["configcheck_errorpage_unavailable"] = 'صفحه ی ارور وبگاه شما در دسترس یا حاضر نیست.'; $_lang["configcheck_errorpage_unavailable_msg"] = 'به این معنی که صفحه ی ارور شما برای بازدیدکنندگان وبگاه شما قابل دسترس یا موجود نیست. این مسئله منجر به ارورهای دیگر و مشکلات عدیده ی دیگر در وبگاه شما خواهد شد. لطفا از این موضوع اطمینان حاصل کنید که هیچ گروه کاربری به این فایل دسترسی ندارد.'; diff --git a/manager/includes/lang/polish-utf8.inc.php b/manager/includes/lang/polish-utf8.inc.php index a24b8f8b37..ab6eea063c 100644 --- a/manager/includes/lang/polish-utf8.inc.php +++ b/manager/includes/lang/polish-utf8.inc.php @@ -121,7 +121,7 @@ $_lang["configcheck_cache"] = 'katalog cache\'u nie jest zapisywalny'; $_lang["configcheck_cache_msg"] = 'MODx nie może zapisać do katalogu cache\'u. MODx będzie wciąż działał poprawnie, ale strony nie będą cache\'owane. Aby rozwiązać ten problem, nadaj uprawnienia do zapisu dla katalogu /_cache/.'; $_lang["configcheck_configinc"] = 'Plik konfiguracyjny jest zapisywalny'; -$_lang["configcheck_configinc_msg"] = 'Dla większego bezpieczeństwa ustaw prawa dostępu do pliku konfiguracji (/manager/includes/config.inc.php) na tylko do odczytu.'; +$_lang["configcheck_configinc_msg"] = 'Dla większego bezpieczeństwa ustaw prawa dostępu do pliku konfiguracji (/'.MGR_DIR.'/includes/config.inc.php) na tylko do odczytu.'; $_lang["configcheck_default_msg"] = 'Wystąpił nieokreślony błąd.'; $_lang["configcheck_errorpage_unavailable"] = 'Strona błędu Twojego serwisu jest niedostępna'; $_lang["configcheck_errorpage_unavailable_msg"] = 'Oznacza to, że Twoja strona błędu jest niedostępna dla użytkowników albo nie istnieje. Może to powodować niestabilność i wiele błędnych wpisów w logach serwisu. Upewnij się, że żadna grupa użytkowników nie jest przypisana do strony.'; diff --git a/manager/includes/lang/polish.inc.php b/manager/includes/lang/polish.inc.php index 92e237416b..c46a5af181 100644 --- a/manager/includes/lang/polish.inc.php +++ b/manager/includes/lang/polish.inc.php @@ -121,7 +121,7 @@ $_lang["configcheck_cache"] = 'katalog cache\'u nie jest zapisywalny'; $_lang["configcheck_cache_msg"] = 'MODx nie moe zapisa do katalogu cache\'u. MODx bdzie wci dziaa poprawnie, ale strony nie bd cache\'owane. Aby rozwiza ten problem, nadaj uprawnienia do zapisu dla katalogu /_cache/.'; $_lang["configcheck_configinc"] = 'Plik konfiguracyjny jest zapisywalny'; -$_lang["configcheck_configinc_msg"] = 'Dla wikszego bezpieczestwa ustaw prawa dostpu do pliku konfiguracji (/manager/includes/config.inc.php) na tylko do odczytu.'; +$_lang["configcheck_configinc_msg"] = 'Dla wikszego bezpieczestwa ustaw prawa dostpu do pliku konfiguracji (/'.MGR_DIR.'/includes/config.inc.php) na tylko do odczytu.'; $_lang["configcheck_default_msg"] = 'Wystpi nieokrelony bd.'; $_lang["configcheck_errorpage_unavailable"] = 'Strona bdu Twojego serwisu jest niedostpna'; $_lang["configcheck_errorpage_unavailable_msg"] = 'Oznacza to, e Twoja strona bdu jest niedostpna dla uytkownikw albo nie istnieje. Moe to powodowa niestabilno i wiele bdnych wpisw w logach serwisu. Upewnij si, e adna grupa uytkownikw nie jest przypisana do strony.'; diff --git a/manager/includes/lang/portuguese-br.inc.php b/manager/includes/lang/portuguese-br.inc.php index 5569156879..cf0ba4382e 100755 --- a/manager/includes/lang/portuguese-br.inc.php +++ b/manager/includes/lang/portuguese-br.inc.php @@ -99,7 +99,7 @@ $_lang["configcheck_cache"] = 'O diretório do cache não tem permissão de escrita'; $_lang["configcheck_cache_msg"] = 'O sistema MODx não pode escrever o diretório de cache. O sistema MODx continuará a funcionar como esperado, mas a cache não estará activa. Para resolver isto, active a permissão de escrita no diretório do cache (/_cache/).'; $_lang["configcheck_configinc"] = 'Arquivo de configuração ainda editável'; -$_lang["configcheck_configinc_msg"] = 'Gente mal intencionada poderá eventualmente afetar seriamente o site e tudo o que lhe estiver associado. A sério. Por favor desligue as permissões de escrita no arquivo de configuração (/manager/includes/config.inc.php)!'; +$_lang["configcheck_configinc_msg"] = 'Gente mal intencionada poderá eventualmente afetar seriamente o site e tudo o que lhe estiver associado. A sério. Por favor desligue as permissões de escrita no arquivo de configuração (/'.MGR_DIR.'/includes/config.inc.php)!'; $_lang["configcheck_default_msg"] = 'Um erro não especificado foi encontrado. Contacte o suporte técnico.'; $_lang["configcheck_errorpage_unavailable"] = 'A página de erro do seu site não está disponível.'; $_lang["configcheck_errorpage_unavailable_msg"] = 'Isto significa que a Página de erro não está disponível a usuários normais da web ou não existe. Isto pode conduzir a um ciclo recursivo e a muitos erros nos registos do site. Certifique-se de que não existem grupos de webusers alocados a essa página.'; diff --git a/manager/includes/lang/portuguese.inc.php b/manager/includes/lang/portuguese.inc.php index 7f2b4693a5..82584c6a39 100644 --- a/manager/includes/lang/portuguese.inc.php +++ b/manager/includes/lang/portuguese.inc.php @@ -95,7 +95,7 @@ $_lang["configcheck_cache"] = 'O directório da cache não tem permissão de escrita'; $_lang["configcheck_cache_msg"] = 'O sistema MODx não pode escrever o directório de cache. O sistema MODx continuará a funcionar como esperado, mas a cache não estará activa. Para resolver isto, active a permissão de escrita no directório da cache (/_cache/).'; $_lang["configcheck_configinc"] = 'Ficheiro de configuração ainda editável'; -$_lang["configcheck_configinc_msg"] = 'Gente mal intencionada poderá eventualmente afectar seriamente o site e tudo o que lhe estiver associado. A sério. Por favor desligue as permissões de escrita no ficheiro de configuração (/manager/includes/config.inc.php)!'; +$_lang["configcheck_configinc_msg"] = 'Gente mal intencionada poderá eventualmente afectar seriamente o site e tudo o que lhe estiver associado. A sério. Por favor desligue as permissões de escrita no ficheiro de configuração (/'.MGR_DIR.'/includes/config.inc.php)!'; $_lang["configcheck_default_msg"] = 'Um erro não especificado foi encontrado. Contacte o suporte técnico.'; $_lang["configcheck_errorpage_unavailable"] = 'A página de erro do seu site não está disponível.'; $_lang["configcheck_errorpage_unavailable_msg"] = 'Isto significa que a Página de erro não está disponível a utilizadores normais da web ou não existe. Isto pode conduzir a um ciclo recursivo e a muitos erros nos registos do site. Certifique-se de que não existem grupos de webusers alocados a essa página.'; diff --git a/manager/includes/lang/russian-UTF8.inc.php b/manager/includes/lang/russian-UTF8.inc.php index a7e21c0bdd..0968910804 100755 --- a/manager/includes/lang/russian-UTF8.inc.php +++ b/manager/includes/lang/russian-UTF8.inc.php @@ -112,7 +112,7 @@ $_lang["configcheck_cache"] = 'невозможна запись в папку кэширования'; $_lang["configcheck_cache_msg"] = 'MODx не в состоянии записывать данные в папку кэширования. Система будет работать нормально, но кэширования происходить не будет. Для решения проблемы разрешите запись в папку /assets/cache.'; $_lang["configcheck_configinc"] = 'Файл конфигурации все еще доступен для записи'; -$_lang["configcheck_configinc_msg"] = 'Злоумышленники потенциально могут нанести вред вашему сайту. Серьёзно. Пожалуйста, установите права доступа к файлу конфигурации (/manager/includes/config.inc.php) в режим \'Только для чтения\''; +$_lang["configcheck_configinc_msg"] = 'Злоумышленники потенциально могут нанести вред вашему сайту. Серьёзно. Пожалуйста, установите права доступа к файлу конфигурации (/'.MGR_DIR.'/includes/config.inc.php) в режим \'Только для чтения\''; $_lang["configcheck_default_msg"] = 'Неопределенная ошибка.'; $_lang["configcheck_errorpage_unavailable"] = 'Страница сообщения об ошибке, указанная в конфигурации сайта, недоступна.'; $_lang["configcheck_errorpage_unavailable_msg"] = 'Это означает, что она не существует или недоступна обычным посетителям сайта. Это может привести к циклическому вызову функции \'сообщения об ошибке\' и большому количеству записей в журнале сайта. Убедитесь, что нет групп веб-пользователей, которым назначена эта страница.'; diff --git a/manager/includes/lang/russian.inc.php b/manager/includes/lang/russian.inc.php index 90d48cc340..052cb286dd 100755 --- a/manager/includes/lang/russian.inc.php +++ b/manager/includes/lang/russian.inc.php @@ -111,7 +111,7 @@ $_lang["configcheck_cache"] = ' '; $_lang["configcheck_cache_msg"] = 'MODx . , . /assets/cache.'; $_lang["configcheck_configinc"] = ' '; -$_lang["configcheck_configinc_msg"] = ' . . , (/manager/includes/config.inc.php) \' \''; +$_lang["configcheck_configinc_msg"] = ' . . , (/'.MGR_DIR.'/includes/config.inc.php) \' \''; $_lang["configcheck_default_msg"] = ' .'; $_lang["configcheck_errorpage_unavailable"] = ' , , .'; $_lang["configcheck_errorpage_unavailable_msg"] = ' , . \' \' . , -, .'; diff --git a/manager/includes/lang/spanish-utf8.inc.php b/manager/includes/lang/spanish-utf8.inc.php index bd3ec69578..e6cab8242b 100644 --- a/manager/includes/lang/spanish-utf8.inc.php +++ b/manager/includes/lang/spanish-utf8.inc.php @@ -107,7 +107,7 @@ $_lang["configcheck_cache"] = 'el directorio cache no es escribible'; $_lang["configcheck_cache_msg"] = 'MODx no puede escribir en el directorio cache. MODx continuará funcionando como es esperado, pero no realizará ningún cache. Para solucionar esto, haz el directorio /_cache/ escribible.'; $_lang["configcheck_configinc"] = 'El archivo de configuración todavía es escribible'; -$_lang["configcheck_configinc_msg"] = 'Personas muy malintencionadas podrían potencialmente probocar algunos problemas en tu sitio y todo lo asociado con él. En serio. Por favor ¡Haz tu archivo de configuración (/manager/includes/config.inc.php) de sólo lectura!'; +$_lang["configcheck_configinc_msg"] = 'Personas muy malintencionadas podrían potencialmente probocar algunos problemas en tu sitio y todo lo asociado con él. En serio. Por favor ¡Haz tu archivo de configuración (/'.MGR_DIR.'/includes/config.inc.php) de sólo lectura!'; $_lang["configcheck_default_msg"] = 'Una alerta no especificada ha sido encontrada. Lo cual es extraño.'; $_lang["configcheck_errorpage_unavailable"] = 'La página de error de tu sitio no está disponible.'; $_lang["configcheck_errorpage_unavailable_msg"] = 'Esto significa que tu página de Error no es accesible para navegantes normales de internet o que no existe. Esto puede provocar un estado de circulo cerrado y varios errores en la bitácora de tu sitio. Asegúrate de que nohaya grupos de usuarios asignados a la página.'; diff --git a/manager/includes/lang/spanish.inc.php b/manager/includes/lang/spanish.inc.php index fa20fc6b1a..159f62b74a 100755 --- a/manager/includes/lang/spanish.inc.php +++ b/manager/includes/lang/spanish.inc.php @@ -108,7 +108,7 @@ $_lang["configcheck_cache"] = 'el directorio cache no es escribible'; $_lang["configcheck_cache_msg"] = 'MODx no puede escribir en el directorio cache. MODx continuar funcionando como es esperado, pero no realizar ningn cache. Para solucionar esto, haz el directorio /_cache/ escribible.'; $_lang["configcheck_configinc"] = 'El archivo de configuracin todava es escribible'; -$_lang["configcheck_configinc_msg"] = 'Personas muy malintencionadas podran potencialmente probocar algunos problemas en tu sitio y todo lo asociado con l. En serio. Por favor Haz tu archivo de configuracin (/manager/includes/config.inc.php) de slo lectura!'; +$_lang["configcheck_configinc_msg"] = 'Personas muy malintencionadas podran potencialmente probocar algunos problemas en tu sitio y todo lo asociado con l. En serio. Por favor Haz tu archivo de configuracin (/'.MGR_DIR.'/includes/config.inc.php) de slo lectura!'; $_lang["configcheck_default_msg"] = 'Una alerta no especificada ha sido encontrada. Lo cual es extrao.'; $_lang["configcheck_errorpage_unavailable"] = 'La pgina de error de tu sitio no est disponible.'; $_lang["configcheck_errorpage_unavailable_msg"] = 'Esto significa que tu pgina de Error no es accesible para navegantes normales de internet o que no existe. Esto puede provocar un estado de circulo cerrado y varios errores en la bitcora de tu sitio. Asegrate de que nohaya grupos de usuarios asignados a la pgina.'; diff --git a/manager/includes/lang/svenska-utf8.inc.php b/manager/includes/lang/svenska-utf8.inc.php index e1354937a9..fc9576d6fd 100755 --- a/manager/includes/lang/svenska-utf8.inc.php +++ b/manager/includes/lang/svenska-utf8.inc.php @@ -112,7 +112,7 @@ $_lang["configcheck_cache"] = 'cache-katalogen är inte skrivbar'; $_lang["configcheck_cache_msg"] = 'MODx kan inte skriva till cache-katalogen. MODx kommer fortfarande att fungera som förväntat, men inga resurser kommer att cachas. För att rätta till det här, gör /_cache/-katalogen skrivbar.'; $_lang["configcheck_configinc"] = 'Konfigurationsfilen är fortfarande skrivbar'; -$_lang["configcheck_configinc_msg"] = 'Elaka människor kan orsaka stora skador på din webbplats och allt som hör till den. På riktigt. Se till att konfigurationsfilen (/manager/includes/config.inc.php) blir skrivskyddad!'; +$_lang["configcheck_configinc_msg"] = 'Elaka människor kan orsaka stora skador på din webbplats och allt som hör till den. På riktigt. Se till att konfigurationsfilen (/'.MGR_DIR.'/includes/config.inc.php) blir skrivskyddad!'; $_lang["configcheck_default_msg"] = 'En ospecificerad varning hittades, vilket är konstigt.'; $_lang["configcheck_errorpage_unavailable"] = 'Felsidan för din webbplats är inte tillgänglig.'; $_lang["configcheck_errorpage_unavailable_msg"] = 'Detta betyder att din felsida inte är tillgänglig för vanliga användare eller att den inte existerar. Det här kan leda till att ett tillstånd med upprepande loopar skapas och ger upphov till att många fel rapporteras i webbplatsens loggar. Kontrollera att inga webbanvändargrupper är anslutna till sidan.'; diff --git a/manager/includes/lang/svenska.inc.php b/manager/includes/lang/svenska.inc.php index 53f1f924b5..010d0f05c1 100755 --- a/manager/includes/lang/svenska.inc.php +++ b/manager/includes/lang/svenska.inc.php @@ -112,7 +112,7 @@ $_lang["configcheck_cache"] = 'cache-katalogen r inte skrivbar'; $_lang["configcheck_cache_msg"] = 'MODx kan inte skriva till cache-katalogen. MODx kommer fortfarande att fungera som frvntat, men inga resurser kommer att cachas. Fr att rtta till det hr, gr /_cache/-katalogen skrivbar.'; $_lang["configcheck_configinc"] = 'Konfigurationsfilen r fortfarande skrivbar'; -$_lang["configcheck_configinc_msg"] = 'Elaka mnniskor kan orsaka stora skador p din webbplats och allt som hr till den. P riktigt. Se till att konfigurationsfilen (/manager/includes/config.inc.php) blir skrivskyddad!'; +$_lang["configcheck_configinc_msg"] = 'Elaka mnniskor kan orsaka stora skador p din webbplats och allt som hr till den. P riktigt. Se till att konfigurationsfilen (/'.MGR_DIR.'/includes/config.inc.php) blir skrivskyddad!'; $_lang["configcheck_default_msg"] = 'En ospecificerad varning hittades, vilket r konstigt.'; $_lang["configcheck_errorpage_unavailable"] = 'Felsidan fr din webbplats r inte tillgnglig.'; $_lang["configcheck_errorpage_unavailable_msg"] = 'Detta betyder att din felsida inte r tillgnglig fr vanliga anvndare eller att den inte existerar. Det hr kan leda till att ett tillstnd med upprepande loopar skapas och ger upphov till att mnga fel rapporteras i webbplatsens loggar. Kontrollera att inga webbanvndargrupper r anslutna till sidan.'; From debbb689ca30bb9ad20556ec9493e1bb0db78178 Mon Sep 17 00:00:00 2001 From: Dmi3yy Date: Thu, 23 May 2013 00:36:25 +0300 Subject: [PATCH 034/530] Refactor #9884 MODX_MANAGER_PATH step5 --- assets/modules/docmanager/tv.ajax.php | 2 +- index-ajax.php | 3 ++- index.php | 4 ++-- install/action.connection.php | 4 ++++ install/action.mode.php | 6 ++++++ install/action.options.php | 8 +++++++- install/action.summary.php | 8 +++++++- install/index.php | 8 +++++++- install/instprocessor.php | 5 +++++ install/setup.info.php | 5 ++++- manager/index.php | 21 +++++++++++++++++++-- 11 files changed, 64 insertions(+), 10 deletions(-) diff --git a/assets/modules/docmanager/tv.ajax.php b/assets/modules/docmanager/tv.ajax.php index 43cb6d5dfc..6a80299cc4 100644 --- a/assets/modules/docmanager/tv.ajax.php +++ b/assets/modules/docmanager/tv.ajax.php @@ -3,7 +3,7 @@ * This file includes slightly modified code from the MODx core distribution. */ -define("MGR_DIR", "manager"); +include_once("../../cache/siteManager.php"); require_once '../../../'.MGR_DIR.'/includes/protect.inc.php'; include_once ('../../../'.MGR_DIR.'/includes/config.inc.php'); diff --git a/index-ajax.php b/index-ajax.php index 18a56fbeaf..512dfd6830 100644 --- a/index-ajax.php +++ b/index-ajax.php @@ -4,7 +4,8 @@ // Any PHP files in these directories can be executed by any user. $allowed_dirs = array('assets/snippets/ajaxSearch/'); -define("MGR_DIR", "manager"); +include_once(dirname(__FILE__)."/assets/cache/siteManager.php"); + // harden it require_once('./'.MGR_DIR.'/includes/protect.inc.php'); diff --git a/index.php b/index.php index 7167989e36..e9d0c70574 100644 --- a/index.php +++ b/index.php @@ -44,7 +44,7 @@ * Initialize Document Parsing * ----------------------------- */ -define("MGR_DIR", "manager"); +include_once(dirname(__FILE__)."/assets/cache/siteManager.php"); // get start time $mtime = microtime(); $mtime = explode(" ",$mtime); $mtime = $mtime[1] + $mtime[0]; $tstart = $mtime; @@ -111,7 +111,7 @@ startCMSSession(); // initiate a new document parser -include_once(MODX_MANAGER_PATH.'/includes/document.parser.class.inc.php'); +include_once(MODX_MANAGER_PATH.'includes/document.parser.class.inc.php'); $modx = new DocumentParser; $etomite = &$modx; // for backward compatibility diff --git a/install/action.connection.php b/install/action.connection.php index b37141531a..a59b1c4c2c 100644 --- a/install/action.connection.php +++ b/install/action.connection.php @@ -1,6 +1,10 @@ " . $_lang['preinstall_validation'] . "

    "; echo "

    " . $_lang['summary_setup_check'] . "

    "; diff --git a/install/index.php b/install/index.php index 74ed0dee09..7332cbb663 100755 --- a/install/index.php +++ b/install/index.php @@ -15,7 +15,13 @@ // set error reporting error_reporting(E_ALL & ~E_NOTICE); -define("MGR_DIR", "manager"); +if (file_exists(dirname(__FILE__)."/../assets/cache/siteManager.php")) { + include_once(dirname(__FILE__)."/../assets/cache/siteManager.php"); +}else{ + define('MGR_DIR', 'manager'); +} + + require_once("lang.php"); require_once('../'.MGR_DIR.'/includes/version.inc.php'); diff --git a/install/instprocessor.php b/install/instprocessor.php index 498dfec2dc..e7922d16ea 100755 --- a/install/instprocessor.php +++ b/install/instprocessor.php @@ -1,5 +1,10 @@ Date: Thu, 23 May 2013 01:26:03 +0300 Subject: [PATCH 035/530] small fix --- install/instprocessor.php | 7 +++++++ manager/actions/files.dynamic.php | 2 +- manager/actions/modules.static.php | 2 +- manager/actions/mutate_content.dynamic.php | 6 +++--- manager/actions/mutate_htmlsnippet.dynamic.php | 4 ++-- manager/actions/mutate_plugin.dynamic.php | 4 ++-- manager/actions/mutate_plugin_priority.dynamic.php | 2 +- manager/actions/mutate_snippet.dynamic.php | 6 +++--- manager/actions/mutate_templates.dynamic.php | 4 ++-- manager/actions/mutate_tmplvars.dynamic.php | 4 ++-- manager/actions/mutate_user.dynamic.php | 4 ++-- manager/actions/wait.static.php | 2 +- manager/frames/menu.php | 2 +- manager/includes/config_check.inc.php | 2 +- manager/includes/sysalert.display.inc.php | 2 +- manager/processors/delete_content.processor.php | 2 +- manager/processors/duplicate_content.processor.php | 2 +- manager/processors/login.processor.php | 3 ++- manager/processors/save_content.processor.php | 2 +- manager/processors/undelete_content.processor.php | 2 +- 20 files changed, 36 insertions(+), 28 deletions(-) diff --git a/install/instprocessor.php b/install/instprocessor.php index e7922d16ea..9ff747697d 100755 --- a/install/instprocessor.php +++ b/install/instprocessor.php @@ -203,7 +203,14 @@ function parseProperties($propertyString) { echo "".$_lang['ok']."

    "; } } + +// custom or not +if (file_exists(dirname(__FILE__)."/../../assets/cache/siteManager.php")) { + $mgrdir = 'include_once(dirname(__FILE__)."/../../assets/cache/siteManager.php");'; +}else{ $mgrdir = 'define(\'MGR_DIR\', \'manager\');'; +} + // write the config.inc.php file if new installation echo "

    " . $_lang['writing_config_file']; $configString = 'config['base_path'] . 'manager'; + $proteted_path[] = $modx->config['modx_manager_path']; $proteted_path[] = $modx->config['base_path'] . 'temp/backup'; $proteted_path[] = $modx->config['base_path'] . 'assets/backup'; diff --git a/manager/actions/modules.static.php b/manager/actions/modules.static.php index 4c10821095..0488fca532 100644 --- a/manager/actions/modules.static.php +++ b/manager/actions/modules.static.php @@ -85,7 +85,7 @@ function menuAction(a) {

    diff --git a/manager/actions/mutate_content.dynamic.php b/manager/actions/mutate_content.dynamic.php index 2c25ad1640..61d20a173c 100644 --- a/manager/actions/mutate_content.dynamic.php +++ b/manager/actions/mutate_content.dynamic.php @@ -526,10 +526,10 @@ function decode(s) { + " onmouseover="this.src='';" onmouseout="this.src='';" alt="" onclick="alert(this.alt);" style="cursor:help;" /> - diff --git a/manager/actions/mutate_htmlsnippet.dynamic.php b/manager/actions/mutate_htmlsnippet.dynamic.php index 708507a9d4..2e92041fb8 100644 --- a/manager/actions/mutate_htmlsnippet.dynamic.php +++ b/manager/actions/mutate_htmlsnippet.dynamic.php @@ -135,10 +135,10 @@ function deletedocument() { + + setCachepath($basePath.'/assets/cache/'); + $sync->setCachepath($basePath.'assets/cache/'); $sync->setReport(false); $sync->emptyCache(); // first empty the cache } diff --git a/manager/actions/mutate_snippet.dynamic.php b/manager/actions/mutate_snippet.dynamic.php index fb3bfe93b4..27444b776a 100644 --- a/manager/actions/mutate_snippet.dynamic.php +++ b/manager/actions/mutate_snippet.dynamic.php @@ -111,7 +111,7 @@ function showParameters(ctrl) { dp = (f.properties.value) ? f.properties.value.split("&"):""; if(!dp) tr.style.display='none'; else { - t='
    +   " onmouseover="this.src='';" onmouseout="this.src='';" alt="" onclick="alert(this.alt);" style="cursor:help;" />   onclick="changestate(document.mutate.hidemenu);" />  " onmouseover="this.src='';" onmouseout="this.src='';" alt="" onclick="alert(this.alt);" style="cursor:help;" />
    '; + t='
    '; for(p = 0; p < dp.length; p++) { dp[p]=(dp[p]+'').replace(/^\s|\s$/,""); // trim ar = dp[p].split("="); @@ -276,9 +276,9 @@ function decode(s){ + + " /> + + } -x=window.setTimeout('goHome()',2000); +x=window.setTimeout('goHome()',1000); diff --git a/manager/frames/menu.php b/manager/frames/menu.php index 6dce737aab..e58079bebf 100644 --- a/manager/frames/menu.php +++ b/manager/frames/menu.php @@ -136,7 +136,7 @@ function startrefresh(rFrame){ y=window.setTimeout('reloadtree()',500); } if(rFrame==10) { - window.top.location.href = "../manager"; + window.top.location.href = "../"; } } diff --git a/manager/includes/config_check.inc.php b/manager/includes/config_check.inc.php index 2dfa163f27..a48abc3811 100755 --- a/manager/includes/config_check.inc.php +++ b/manager/includes/config_check.inc.php @@ -134,7 +134,7 @@ function checkSiteCache() { } if (count($_lang)!=$length_eng_lang) { - $warningspresent = 1; + $warningspresent = 0; $warnings[] = array($_lang['configcheck_lang_difference']); } diff --git a/manager/includes/sysalert.display.inc.php b/manager/includes/sysalert.display.inc.php index 6ca21f4b0b..0b97e73b96 100755 --- a/manager/includes/sysalert.display.inc.php +++ b/manager/includes/sysalert.display.inc.php @@ -24,7 +24,7 @@ ?> config['site_manager_url'].'media/style/'.$manager_theme.'/style.css'.'" />'; + echo ''; ?> @si', - '@&#(\d+);@e', - '@\[\~(.*?)\~\]@si', - '@\[\((.*?)\)\]@si', - '@{{(.*?)}}@si', - '@\[\+(.*?)\+\]@si', - '@\[\*(.*?)\*\]@si', - '@\[\[(.*?)\]\]@si', - '@\[!(.*?)!\]@si' - )); + # sanitize the values with slashes stripped to avoid remote execution of Snippets + modx_sanitize_gpc($fields, array ( + '@]*?>.*?@si', + '@&#(\d+);@e', + '@\[\~(.*?)\~\]@si', + '@\[\((.*?)\)\]@si', + '@{{(.*?)}}@si', + '@\[\+(.*?)\+\]@si', + '@\[\*(.*?)\*\]@si', + '@\[\[(.*?)\]\]@si', + '@\[!(.*?)!\]@si' + )); # validate fields foreach($fields as $name => $value) { @@ -268,39 +265,39 @@ function eForm($modx,$params) { } } -// Changed in 1.4.4.5 - now expects 4 parameters - if ($eFormOnValidate) { - if( $isDebug && !function_exists($eFormOnValidate)) + // Changed in 1.4.4.5 - now expects 4 parameters + if ($eFormOnValidate) { + if( $isDebug && !function_exists($eFormOnValidate)) $fields['debug'] .= "eformOnValidate event: Could not find the function " . $eFormOnValidate; else if ($eFormOnValidate($fields,$vMsg,$rMsg,$rClass)===false) return; - } + } - if(count($vMsg)>0 || count($rMsg)>0){ + if(count($vMsg)>0 || count($rMsg)>0){ - //New in 1.4.2 - classes are set in labels and form elements for invalid fields - foreach($rClass as $n => $class){ - $fields[$n.'_class'] = $fields[$n.'_class']?$fields[$n.'_class'].' '. $class:$class; - $fields[$n.'_vClass'] = $fields[$n.'_vClass']?$fields[$n.'_vClass'].' '. $class:$class; - //work around for checkboxes - if( isset($formats[$n][6] )){ //have separate id's for check and option tags - set classes as well - foreach( explode(',',$formats[$n][6]) as $id) - $fields[$id.'_vClass'] = $fields[$id.'_vClass'] ? $fields[$id.'_vClass'].' '. $class : $class; + //New in 1.4.2 - classes are set in labels and form elements for invalid fields + foreach($rClass as $n => $class){ + $fields[$n.'_class'] = $fields[$n.'_class']?$fields[$n.'_class'].' '. $class:$class; + $fields[$n.'_vClass'] = $fields[$n.'_vClass']?$fields[$n.'_vClass'].' '. $class:$class; + //work around for checkboxes + if( isset($formats[$n][6] )){ //have separate id's for check and option tags - set classes as well + foreach( explode(',',$formats[$n][6]) as $id) + $fields[$id.'_vClass'] = $fields[$id.'_vClass'] ? $fields[$id.'_vClass'].' '. $class : $class; + } } - } - //add debugging info to fields array - if($isDebug){ - ksort($fields); - if($isDebug>1){ - $debugText .= "
    Formats array:
    ". var_export($formats,true).'
    '; - $debugText .= "
    Fields array:
    ". var_export($fields,true).'
    '; - $debugText .= "
    Classes parsed :
    " . var_export($rClass,true) ."
    "; + //add debugging info to fields array + if($isDebug){ + ksort($fields); + if($isDebug>1){ + $debugText .= "
    Formats array:
    ". var_export($formats,true).'
    '; + $debugText .= "
    Fields array:
    ". var_export($fields,true).'
    '; + $debugText .= "
    Classes parsed :
    " . var_export($rClass,true) ."
    "; + } + $debugText .= "
    eForm configuration:
    \n". var_export($params,true).'
    '; + $fields['debug']=$debugText; } - $debugText .= "
    eForm configuration:
    \n". var_export($params,true).'
    '; - $fields['debug']=$debugText; - } #set validation message $tmp = (count($rMsg)>0)?str_replace("{fields}", implode(", ",$rMsg),$_lang['ef_required_message']):""; @@ -309,7 +306,7 @@ function eForm($modx,$params) { $modx->setPlaceholder('validationmessage',str_replace('[+ef_wrapper+]', $tmp, $_lang['ef_validation_message'])); else $fields['validationmessage'] .= str_replace('[+ef_wrapper+]', $tmp, $_lang['ef_validation_message']); - } else { + } else { # format report fields foreach($fields as $name => $value) { @@ -325,7 +322,7 @@ function eForm($modx,$params) { $localeInfo = localeconv(); $th_sep = empty($_lang['ef_thousands_separator'])?$localeInfo['thousands_sep']:$_lang['ef_thousands_separator']; $dec_point= $localeInfo['decimal_point']; -$debugText .= 'Locale
    '.var_export($localeInfo,true).'
    '; + $debugText .= 'Locale
    '.var_export($localeInfo,true).'
    '; $value = number_format((float) $value, 2, $dec_point, $th_sep); //EM~ break; case "date": @@ -549,10 +546,10 @@ function eForm($modx,$params) { if($isDebug){ $debugText .="Mail Headers:
    From: $from ($fromname)
    Reply-to:$replyto
    To: $to
    Subject: $subject
    CC: $cc
    BCC:$bcc
    "; - if($isDebug>1){ - $debugText .= "
    Formats array:
    ". var_export($formats,true).'
    '; - $debugText .= "
    Fields array:
    ". var_export($fields,true).'
    '; - } + if($isDebug>1){ + $debugText .= "
    Formats array:
    ". var_export($formats,true).'
    '; + $debugText .= "
    Fields array:
    ". var_export($fields,true).'
    '; + } $fields['debug'] = $debugText; } @@ -636,7 +633,7 @@ function formMerge($docText, $docFields, $vClasses='') { list($listName,$listValue) = explode(":",$name); $value = isset($docFields[$listName])? $docFields[$listName]:''; -// support for multi checkbox, radio and select - Djamoer + // support for multi checkbox, radio and select - Djamoer if(is_array($value)) $value=implode(', ', $value); $fld = $formats[$name]; @@ -706,23 +703,23 @@ function AttachFilesToMailer(&$mail,&$attachFiles) { function eFormParseTemplate($tpl, $isDebug=false ){ global $modx,$formats,$optionsName,$_lang,$debugText,$fields,$validFormId; global $efPostBack; - - $formats = array(); //clear formats so values don't persist through multiple snippet calls - $labels = array(); + + $formats = array(); //clear formats so values don't persist through multiple snippet calls + $labels = array(); $regExpr = "#(]*?>)(.*?)#si";; preg_match_all($regExpr,$tpl,$matches); foreach($matches[1] as $key => $fld){ $attr = attr2array($fld); if(isset($attr['for'])){ - $name = substr($attr['for'],1,-1); - //add class to fields array - $fields[$name."_vClass"] = isset($attr['class'])?substr($attr['class'],1,-1):''; - $labels[$name] = strip_tags($matches[2][$key]); - //create placeholder for class - $attr['class'] = '"[+'.$name.'_vClass+]"'; - $newTag = buildTagPlaceholder('label',$attr,$name); - $tpl = str_replace($fld,$newTag,$tpl); + $name = substr($attr['for'],1,-1); + //add class to fields array + $fields[$name."_vClass"] = isset($attr['class'])?substr($attr['class'],1,-1):''; + $labels[$name] = strip_tags($matches[2][$key]); + //create placeholder for class + $attr['class'] = '"[+'.$name.'_vClass+]"'; + $newTag = buildTagPlaceholder('label',$attr,$name); + $tpl = str_replace($fld,$newTag,$tpl); } } @@ -796,7 +793,7 @@ function eFormParseTemplate($tpl, $isDebug=false ){ $validValues = array(); foreach($matches[1] as $option){ $attr = attr2array($option); -//* debug */ print __LINE__.':
    '.print_r($attr,true) .'

    '; + //* debug */ print __LINE__.':
    '.print_r($attr,true) .'

    '; $value = substr($attr['value'],1,-1); //strip outer quotes if( trim($value)!='' ) $validValues[] = $value; $newTag = buildTagPlaceholder('option',$attr,$name); @@ -961,7 +958,7 @@ function validateField($value,$fld,&$vMsg,$isDebug=false){ case "#LIST": // List of comma separated values (not case sensitive) //added in 1.4 - file upload filetype test -//FS#960 - removed trimming of $param - values with leading or trailing spaces would always fail validation + //FS#960 - removed trimming of $param - values with leading or trailing spaces would always fail validation if($fld[2]=='file')$value = substr($value,strrpos($value,'.')+1); //file extension if(!isset($vlist)){ $vlist = explode(',',strtolower($param)); //cached @@ -1075,23 +1072,23 @@ function filterEformValue($value,$param){ return $value; } - function efLoadTemplate($key){ - global $modx; - if( strlen($key)>50 ) return $key; - $tpl = false; - if( is_numeric($key) ) { //get from document id - //try unpublished docs first - $tpl = ( $doc=$modx->getDocument($key,'content',0) )? $doc['content'] :false; - if(!$tpl ) - $tpl = ( $doc=$modx->getDocument($key,'content',1) )? $doc['content'] : false; - - }elseif( $key ){ - $tpl = ( $doc=$modx->getChunk($key) )? $doc : false; - //try snippet if chunk is not found - if(!$tpl) $tpl = ( $doc=$modx->runSnippet($key) )? $doc : false; - } - return $tpl; +function efLoadTemplate($key){ + global $modx; + if( strlen($key)>50 ) return $key; + $tpl = false; + if( is_numeric($key) ) { //get from document id + //try unpublished docs first + $tpl = ( $doc=$modx->getDocument($key,'content',0) )? $doc['content'] :false; + if(!$tpl ) + $tpl = ( $doc=$modx->getDocument($key,'content',1) )? $doc['content'] : false; + + }elseif( $key ){ + $tpl = ( $doc=$modx->getChunk($key) )? $doc : false; + //try snippet if chunk is not found + if(!$tpl) $tpl = ( $doc=$modx->runSnippet($key) )? $doc : false; } + return $tpl; +} # registers css and/or javascript to modx class From 69ff6107c0f1da61e65ec9ccba56372af2ac1caa Mon Sep 17 00:00:00 2001 From: Thomas Jakobi Date: Thu, 23 May 2013 10:26:35 +0200 Subject: [PATCH 038/530] Corrected typo --- assets/snippets/eform/docs/eform.htm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/snippets/eform/docs/eform.htm b/assets/snippets/eform/docs/eform.htm index 0399039e71..0ab2628ca7 100755 --- a/assets/snippets/eform/docs/eform.htm +++ b/assets/snippets/eform/docs/eform.htm @@ -226,7 +226,7 @@

    Installation

  • &gotoid (Optional)
    document id to load after sending message. See also &thankyou
  • &category (Optional)
    Category ID or name used to categorize eForms. - If category is not found a new category will beb created + If category is not found a new category will be created. This will appear in the subject of the email sent to the user
  • &keywords (Optional)
    Comma delimited keywords or [+formfields+] used when searching databank E.g. [+firstname+], [+lastname+], [+email+]
  • From 18a5873f716fee82cc1057612a06b960efd38a3e Mon Sep 17 00:00:00 2001 From: Thomas Jakobi Date: Thu, 23 May 2013 10:37:27 +0200 Subject: [PATCH 039/530] Bug #9938: Send sendirect, ccsender and autotext mails only to the first mail address of the comma separated list. --- assets/snippets/eform/docs/eform.htm | 2 +- assets/snippets/eform/docs/eform_history.htm | 2 +- assets/snippets/eform/eform.inc.php | 20 ++++++++++---------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/assets/snippets/eform/docs/eform.htm b/assets/snippets/eform/docs/eform.htm index 0399039e71..f6cd0102ff 100755 --- a/assets/snippets/eform/docs/eform.htm +++ b/assets/snippets/eform/docs/eform.htm @@ -155,7 +155,7 @@

    Version 1.4.4.1 - 1.4.4.8

  • Work around for setting required class on check & radio labels
  • bugfix: If eform attibute is set on multiple check boxes only the last value is set in values list
  • Security fix: Additional sanitization applied after stripslashes is used on fields
  • -
  • Security fix: Send ccsender and autotext mails only to the first mail address of the comma separated list.
  • +
  • Security fix: Send sendirect, ccsender and autotext mails only to the first mail address of the comma separated list.

  • You can see a more extensive version history here.

    diff --git a/assets/snippets/eform/docs/eform_history.htm b/assets/snippets/eform/docs/eform_history.htm index 1596d56639..7071f1f574 100755 --- a/assets/snippets/eform/docs/eform_history.htm +++ b/assets/snippets/eform/docs/eform_history.htm @@ -146,7 +146,7 @@

    Version 1.4.4.1 - 1.4.4.8

  • Work around for setting required class on check & radio labels
  • bugfix: If eform attibute is set on multiple check boxes only the last value is set in values list
  • Security fix: Additional sanitization applied after stripslashes is used on fields
  • -
  • Security fix: Send ccsender and autotext mails only to the first mail address of the comma separated list.
  • +
  • Security fix: Send sendirect, ccsender and autotext mails only to the first mail address of the comma separated list.
  • Version 1.4.4

      diff --git a/assets/snippets/eform/eform.inc.php b/assets/snippets/eform/eform.inc.php index 0bf94c62c1..4090d6b4b0 100644 --- a/assets/snippets/eform/eform.inc.php +++ b/assets/snippets/eform/eform.inc.php @@ -457,8 +457,15 @@ function eForm($modx,$params) { //defaults to html so only test sendasText $isHtml = ($sendAsText==1 || strstr($sendAsText,'report'))?false:true; + # added in 1.4.4.8 - Send sendirect, ccsender and autotext mails only to the first mail address of the comma separated list. + if ($fields['email']) { + $firstEmail = array_shift(explode(',', $fields['email'])); + } else { + $firstEmail = ''; + } + if(!$noemail) { - if($sendirect) $to = $fields['email']; + if($sendirect) $to = $firstEmail; $mail = new PHPMailer(); $mail->IsMail(); $mail->CharSet = $modx->config['modx_charset']; @@ -475,15 +482,8 @@ function eForm($modx,$params) { if(!$mail->send()) return 'Main mail: ' . $_lang['ef_mail_error'] . $mail->ErrorInfo; } - # added in 1.4.4.8 - Send ccsender and autotext mails only to the first mail address of the comma separated list. - if ($fields['email']) { - $firstEmail = array_shift(explode(',', $fields['email'])); - } else { - $firstEmail = FALSE; - } - # send user a copy of the report - if($ccsender && $firstEmail) { + if($ccsender && $firstEmail != '') { $mail = new PHPMailer(); $mail->IsMail(); $mail->CharSet = $modx->config['modx_charset']; @@ -500,7 +500,7 @@ function eForm($modx,$params) { # send auto-respond email //defaults to html so only test sendasText $isHtml = ($sendAsText==1 || strstr($sendAsText,'autotext'))?false:true; - if ($autotext && $firstEmail) { + if ($autotext && $firstEmail != '') { $autotext = formMerge($autotext,$fields); $mail = new PHPMailer(); $mail->IsMail(); From acecf346093202886474b7717551c78dcbf3c697 Mon Sep 17 00:00:00 2001 From: Dmi3yy Date: Thu, 23 May 2013 12:37:00 +0300 Subject: [PATCH 040/530] small fix --- manager/actions/document_data.static.php | 2 +- manager/actions/mutate_module.dynamic.php | 10 +++++----- manager/includes/accesscontrol.inc.php | 1 + manager/includes/lang/russian-UTF8.inc.php | 14 +++++--------- 4 files changed, 12 insertions(+), 15 deletions(-) diff --git a/manager/actions/document_data.static.php b/manager/actions/document_data.static.php index f3d1039cb8..ee94f32e52 100644 --- a/manager/actions/document_data.static.php +++ b/manager/actions/document_data.static.php @@ -154,7 +154,7 @@ 'status' => $_lang['page_data_status'], 'edit' => $_lang['mgrlog_action'], ); - $tbWidth = array('5%', '60%', '10%', '25%'); + $tbWidth = array('2%', '', '10%', '10%', '90', '150'); $childsTable->setColumnWidths($tbWidth); $limitClause = $childsTable->handlePaging(); diff --git a/manager/actions/mutate_module.dynamic.php b/manager/actions/mutate_module.dynamic.php index d456960a75..d3d52aad76 100644 --- a/manager/actions/mutate_module.dynamic.php +++ b/manager/actions/mutate_module.dynamic.php @@ -145,7 +145,7 @@ function showParameters(ctrl) { dp = (f.properties.value) ? f.properties.value.split("&"):""; if(!dp) tr.style.display='none'; else { - t='
    '; + t='
    '; for(p = 0; p < dp.length; p++) { dp[p]=(dp[p]+'').replace(/^\s|\s$/,""); // trim ar = dp[p].split("="); @@ -213,7 +213,7 @@ function showParameters(ctrl) { break; } - t +=''; + t +=''; }; } t+='
    '+desc+''+c+'
    '+desc+''+c+'
    '; @@ -338,10 +338,10 @@ function SetUrl(url, width, height, alt) { + :    class="inputBox" onclick="documentDirty=true;" /> : -    +    value="on" class="inputBox" /> '.$_lang['module_disabled'].'' : $_lang['module_disabled']?> class="inputBox" /> diff --git a/manager/includes/accesscontrol.inc.php b/manager/includes/accesscontrol.inc.php index 4f9f0c6a35..49dedc889d 100755 --- a/manager/includes/accesscontrol.inc.php +++ b/manager/includes/accesscontrol.inc.php @@ -72,6 +72,7 @@ $modx->setPlaceholder('OnManagerLoginFormPrerender',$html); $modx->setPlaceholder('site_name',$site_name); + $modx->setPlaceholder('manager_path',MGR_DIR); $modx->setPlaceholder('logo_slogan',$_lang["logo_slogan"]); $modx->setPlaceholder('login_message',$_lang["login_message"]); $modx->setPlaceholder('manager_theme_url',MODX_MANAGER_URL . 'media/style/' . $modx->config['manager_theme'] . '/'); diff --git a/manager/includes/lang/russian-UTF8.inc.php b/manager/includes/lang/russian-UTF8.inc.php index 0968910804..9770e4096f 100755 --- a/manager/includes/lang/russian-UTF8.inc.php +++ b/manager/includes/lang/russian-UTF8.inc.php @@ -3,17 +3,17 @@ * Filename: includes/lang/russian-UTF8.inc.php * Function: Russian language file. * Encoding: UTF8 - * Author: Russian MODx community, gabdullin, Jaroslav Sidorkin, Safronovich Victor, MARDEN + * Author: Russian MODX community, gabdullin, Jaroslav Sidorkin, Safronovich Victor, MARDEN * Date: 30 December 2010 * Version: 2.0.5 - * MODx version: Evolution 1.0.5 + * MODX version: Evolution 1.0.10 */ $modx_lang_attribute = 'ru'; // Manager HTML/XML Language Attribute see http://en.wikipedia.org/wiki/ISO_639-1 $modx_manager_charset = 'UTF-8'; setlocale (LC_ALL, 'ru_RU.UTF-8'); -$_lang["about_msg"] = 'MODx - это PHP Application Framework и Content Management System, распространяемая по лицензии GNU GPL.'; -$_lang["about_title"] = 'О MODx'; +$_lang["about_msg"] = 'MODX - это PHP Application Framework и Content Management System, распространяемая по лицензии GNU GPL.'; +$_lang["about_title"] = 'О MODX'; $_lang["access_permission_denied"] = 'У вас недостаточно прав для просмотра данного ресурса.'; $_lang["access_permission_parent_denied"] = 'У вас недостаточно прав для создания ресурса в данном разделе'; $_lang["access_permissions"] = 'Права доступа'; @@ -951,7 +951,7 @@ $_lang["tmplvars_default"] = 'Значение по умолчанию'; $_lang["tmplvars_description"] = 'Описание'; $_lang["tmplvars_elements"] = 'Возможные значения'; -$_lang["tmplvars_management_msg"] = 'Параметры (TV) - это динамические элементы шаблона, которые получают своё значение из некоего источника данных. Существуют также параметры, предопределённые для каждого конкретного ресурса (например, предопределённый параметр [*pagetitle*] содержит заголовок страницы). Параметры могут иметь различный тип данных и разное значение на различных страницах сайта.

    Использование: вставьте где-либо в шаблоне или в области контента выражение [*tvName*]

    Вызов через MODx API: $modx->documentObject[\'variable-name\']


    Выберите параметр для редактирования или создайте новый.'; +$_lang["tmplvars_management_msg"] = 'Параметры (TV) - это динамические элементы шаблона, которые получают своё значение из некоего источника данных. Существуют также параметры, предопределённые для каждого конкретного ресурса (например, предопределённый параметр [*pagetitle*] содержит заголовок страницы). Параметры могут иметь различный тип данных и разное значение на различных страницах сайта.

    Использование: вставьте где-либо в шаблоне или в области контента выражение [*tvName*]

    Вызов через MODX API: $modx->documentObject[\'variable-name\']


    Выберите параметр для редактирования или создайте новый.'; $_lang["tmplvars_msg"] = 'Здесь вы можете создать / отредактировать параметр (TV).
    Помните, параметры должны быть доступны для выбранных шаблонов, чтобы их можно было использовать.

    '; $_lang["tmplvars_name"] = 'Имя параметра'; $_lang["tmplvars_novars"] = 'Параметров (TV) не найдено'; @@ -1104,10 +1104,6 @@ $_lang["bkmgr_snapshot_list_title"] = 'Список бекапов'; $_lang["bkmgr_restore_submit"] = 'Восстановить эти данные'; $_lang["bkmgr_snapshot_nothing"] = 'Нет бекапов'; -$_lang["bkmgr_snapshot_submit"] = 'Создать бекап'; -$_lang["bkmgr_snapshot_list_title"] = 'Список бекапов'; -$_lang["bkmgr_restore_submit"] = 'Восстановить эти данные'; -$_lang["bkmgr_snapshot_nothing"] = 'Нет бекапов'; $_lang['not_readable_dir'] = 'Директория недоступна для записи'; $_lang['files.dynamic.php1'] = 'Создать PHP-файл'; From fa45948ff8482a43dc9e715883385a118d307b55 Mon Sep 17 00:00:00 2001 From: Thomas Jakobi Date: Thu, 23 May 2013 11:39:45 +0200 Subject: [PATCH 041/530] Refactor #9939: multiple event functions separated by comma --- assets/snippets/eform/eform.inc.php | 111 ++++++++++++++++++---------- 1 file changed, 74 insertions(+), 37 deletions(-) diff --git a/assets/snippets/eform/eform.inc.php b/assets/snippets/eform/eform.inc.php index e4cc88c26a..80a835e6f8 100644 --- a/assets/snippets/eform/eform.inc.php +++ b/assets/snippets/eform/eform.inc.php @@ -130,15 +130,21 @@ function eForm($modx,$params) { } # invoke onBeforeFormParse event set by another script + // Changed in 1.4.4.8 - Multiple event functions separated by comma. if ($eFormOnBeforeFormParse) { - if( $isDebug && !function_exists($eFormOnBeforeFormParse)) - $fields['debug'] .= "eFormOnBeforeFormParse event: Could not find the function " . $eFormOnBeforeFormParse; - else{ - $templates = array('tpl'=>$tpl,'report'=>$report,'thankyou'=>$thankyou,'autotext'=>$autotext); - if( $eFormOnBeforeFormParse($fields,$templates)===false ) - return ""; - elseif(is_array($templates)) - extract($templates); // extract back into original variables + $eFormOnBeforeFormParse = explode(',', $eFormOnBeforeFormParse); + foreach ($eFormOnBeforeFormParse as $beforeFormParse) { + $beforeFormParse = trim($beforeFormParse); + if ($isDebug && !function_exists($beforeFormParse)) { + $fields['debug'] .= 'eFormOnBeforeFormParse event: Could not find the function ' . $beforeFormParse; + } else { + $templates = array('tpl' => $tpl, 'report' => $report, 'thankyou' => $thankyou, 'autotext' => $autotext); + if ($beforeFormParse($fields, $templates) === false) { + return ''; + } elseif (is_array($templates)) { + extract($templates); // extract back into original variables + } + } } } @@ -265,12 +271,20 @@ function eForm($modx,$params) { } } - // Changed in 1.4.4.5 - now expects 4 parameters + // Changed in 1.4.4.5 - now expects 4 parameters + // Changed in 1.4.4.8 - Multiple event functions separated by comma. if ($eFormOnValidate) { - if( $isDebug && !function_exists($eFormOnValidate)) - $fields['debug'] .= "eformOnValidate event: Could not find the function " . $eFormOnValidate; - else - if ($eFormOnValidate($fields,$vMsg,$rMsg,$rClass)===false) return; + $eFormOnValidate = explode(',', $eFormOnValidate); + foreach ($eFormOnValidate as $onValidate) { + $onValidate = trim($onValidate); + if ($isDebug && !function_exists($onValidate)) { + $fields['debug'] .= 'eformOnValidate event: Could not find the function ' . $onValidate; + } else { + if ($onValidate($fields, $vMsg, $rMsg, $rClass) === false) { + return; + } + } + } } @@ -389,17 +403,24 @@ function eForm($modx,$params) { } # invoke OnBeforeMailSent event set by another script + // Changed in 1.4.4.8 - Multiple event functions separated by comma. if ($eFormOnBeforeMailSent) { - if( $isDebug && !function_exists($eFormOnBeforeMailSent)) - $fields['debug'] .= "eFormOnBeforeMailSent event: Could not find the function " . $eFormOnBeforeMailSent; - elseif ($eFormOnBeforeMailSent($fields)===false) { - if( isset($fields['validationmessage']) && !empty($fields['validationmessage']) ){ - //register css and/or javascript - if( isset($startupSource) ) efRegisterStartupBlock($startupSource); - return formMerge($tpl,$fields); + $eFormOnBeforeMailSent = explode(',', $eFormOnBeforeMailSent); + foreach ($eFormOnBeforeMailSent as $beforeMailSent) { + $beforeMailSent = trim($beforeMailSent); + if ($isDebug && !function_exists($beforeMailSent)) { + $fields['debug'] .= 'eFormOnBeforeMailSent event: Could not find the function ' . $beforeMailSent; + } elseif ($beforeMailSent($fields) === false) { + if (isset($fields['validationmessage']) && !empty($fields['validationmessage'])) { + //register css and/or javascript + if (isset($startupSource)) { + efRegisterStartupBlock($startupSource); + } + return formMerge($tpl, $fields); + } else { + return; + } } - else - return; } } @@ -529,19 +550,27 @@ function eForm($modx,$params) { } }//end test nomail - # added in 1.4.2 - Protection against multiple submit with same form data - if($protectSubmit) $_SESSION[$formid.'_hash'] = $hash; //hash is set earlier - - # added in 1.4.2 - Limit the time between form submissions - if($submitLimit>0) $_SESSION[$formid.'_limit'] = time(); + # added in 1.4.2 - Protection against multiple submit with same form data + if($protectSubmit) $_SESSION[$formid.'_hash'] = $hash; //hash is set earlier - # invoke OnMailSent event set by another script - if ($eFormOnMailSent) { - if( $isDebug && !function_exists($eFormOnMailSent) ) - $fields['debug'] .= "eFormOnMailSent event: Could not find the function" . $eFormOnMailSent; - else - if ($eFormOnMailSent($fields)===false) return; + # added in 1.4.2 - Limit the time between form submissions + if($submitLimit>0) $_SESSION[$formid.'_limit'] = time(); + + # invoke OnMailSent event set by another script + // Changed in 1.4.4.8 - Multiple event functions separated by comma. + if ($eFormOnMailSent) { + $eFormOnMailSent = explode(',', $eFormOnMailSent); + foreach ($eFormOnMailSent as $mailSent) { + $mailSent = trim($mailSent); + if ($isDebug && !function_exists($mailSent)) { + $fields['debug'] .= 'eFormOnMailSent event: Could not find the function' . $mailSent; + } else { + if ($mailSent($fields) === false) { + return; + } + } } + } if($isDebug){ @@ -606,11 +635,19 @@ function eForm($modx,$params) { } # invoke OnBeforeFormMerge event set by another script + // Changed in 1.4.4.8 - Multiple event functions separated by comma. if ($eFormOnBeforeFormMerge) { - if( $isDebug && !function_exists($eFormOnBeforeFormMerge)) - $fields['debug'] .= "eFormOnBeforeFormMerge event: Could not find the function " . $eFormOnBeforeFormMerge; - else - if ($eFormOnBeforeFormMerge($fields)===false) return; + $eFormOnBeforeFormMerge = explode(',', $eFormOnBeforeFormMerge); + foreach ($eFormOnBeforeFormMerge as $beforeFormMerge) { + $beforeFormMerge = trim($beforeFormMerge); + if ($isDebug && !function_exists($beforeFormMerge)) { + $fields['debug'] .= 'eFormOnBeforeFormMerge event: Could not find the function ' . $beforeFormMerge; + } else { + if ($beforeFormMerge($fields) === false) { + return; + } + } + } } # build form From 6f53c3b63cf5cf71fd7244a12520c1af80aa3fb1 Mon Sep 17 00:00:00 2001 From: Dmi3yy Date: Thu, 23 May 2013 13:03:39 +0300 Subject: [PATCH 042/530] #9940 refactor exec mergeSettingsContent --- manager/includes/document.parser.class.inc.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/manager/includes/document.parser.class.inc.php b/manager/includes/document.parser.class.inc.php index f08e8fe370..d05c124d0d 100755 --- a/manager/includes/document.parser.class.inc.php +++ b/manager/includes/document.parser.class.inc.php @@ -48,6 +48,7 @@ class DocumentParser { var $documentMap; var $forwards= 3; var $error_reporting; + var $aliasListing; private $version=array(); /** @@ -787,7 +788,12 @@ function getTagsFromContent($content,$left='[+',$right='+]') { return $matches; } - // mod by Raymond + /** + * Merge content fields and TVs + * + * @param string $template + * @return string + */ function mergeDocumentContent($content) { $replace= array (); $matches = $this->getTagsFromContent($content,'[*','*]'); @@ -861,6 +867,7 @@ function mergeChunkContent($content) { } } $content= str_replace($matches[0], $replace, $content); + $content=$this->mergeSettingsContent($content); } return $content; } @@ -873,6 +880,7 @@ function mergeChunkContent($content) { */ function mergePlaceholderContent($content) { $replace= array (); + $content=$this->mergeSettingsContent($content); $matches = $this->getTagsFromContent($content,'[+','+]'); if($matches) { $cnt= count($matches[1]); @@ -1304,7 +1312,9 @@ function parseDocumentSource($source) { $this->documentOutput= $source; // store source code so plugins can $this->invokeEvent("OnParseDocument"); // work on it via $modx->documentOutput $source= $this->documentOutput; - + + $source = $this->mergeSettingsContent($source); + // combine template and document variables $source= $this->mergeDocumentContent($source); // replace settings referenced in document @@ -1319,6 +1329,9 @@ function parseDocumentSource($source) { $source= $this->evalSnippets($source); // find and replace Placeholders (must be parsed last) - Added by Raymond $source= $this->mergePlaceholderContent($source); + + $source = $this->mergeSettingsContent($source); + if ($this->dumpSnippets == 1) { echo "
    "; } From c08989b4a97fb305544fece9e2b7676df60cdfe3 Mon Sep 17 00:00:00 2001 From: Dmi3yy Date: Thu, 23 May 2013 13:52:14 +0300 Subject: [PATCH 043/530] small fix --- assets/snippets/ditto/classes/filter.class.inc.php | 4 ++-- assets/snippets/ditto/classes/template.class.inc.php | 2 +- assets/snippets/ditto/debug/modxDebugConsole.class.php | 2 +- assets/snippets/eform/eform.inc.php | 3 +-- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/assets/snippets/ditto/classes/filter.class.inc.php b/assets/snippets/ditto/classes/filter.class.inc.php index 62759807fd..30cc65e69e 100644 --- a/assets/snippets/ditto/classes/filter.class.inc.php +++ b/assets/snippets/ditto/classes/filter.class.inc.php @@ -67,12 +67,12 @@ function basicFilter ($value) { break; case "<=" : case 5 : - if (!($value[$this->array_key] < $this->filterValue)) + if (!($value[$this->array_key] <= $this->filterValue)) $unset = 0; break; case ">=" : case 6 : - if (!($value[$this->array_key] > $this->filterValue)) + if (!($value[$this->array_key] >= $this->filterValue)) $unset = 0; break; diff --git a/assets/snippets/ditto/classes/template.class.inc.php b/assets/snippets/ditto/classes/template.class.inc.php index 354952a8d1..5a9679a219 100644 --- a/assets/snippets/ditto/classes/template.class.inc.php +++ b/assets/snippets/ditto/classes/template.class.inc.php @@ -200,7 +200,7 @@ function fetch($tpl){ if ($modx->getChunk($tpl) != "") { $template = $modx->getChunk($tpl); } else if(substr($tpl, 0, 6) == "@FILE:") { - $template = $this->get_file_contents(substr($tpl, 6)); + $template = $this->get_file_contents(MODX_BASE_PATH.substr($tpl, 6)); } else if(substr($tpl, 0, 6) == "@CODE:") { $template = substr($tpl, 6); } else if(substr($tpl, 0, 5) == "@FILE") { diff --git a/assets/snippets/ditto/debug/modxDebugConsole.class.php b/assets/snippets/ditto/debug/modxDebugConsole.class.php index 4896e85e47..1bf3093726 100644 --- a/assets/snippets/ditto/debug/modxDebugConsole.class.php +++ b/assets/snippets/ditto/debug/modxDebugConsole.class.php @@ -27,7 +27,7 @@ function render($cTabs,$title,$base_path) { } $placeholders = array( "[+ditto_base_url+]" => $base_path, - "[+base_url+]" => $modx->config["site_url"]."manager", + "[+base_url+]" => MODX_MANAGER_URL, "[+theme+]" => $modx->config["manager_theme"], "[+title+]" => $title, "[+content+]" => $content, diff --git a/assets/snippets/eform/eform.inc.php b/assets/snippets/eform/eform.inc.php index 7dfaf105bc..87e1f5a4bf 100644 --- a/assets/snippets/eform/eform.inc.php +++ b/assets/snippets/eform/eform.inc.php @@ -619,8 +619,7 @@ function eForm($modx,$params) { # Form Merge function formMerge($docText, $docFields, $vClasses='') { - global $formats; - $lastitems; + global $formats, $lastitems; if(!$docText) return ''; preg_match_all('~\[\+(.*?)\+\]~', $docText, $matches); From ef43e82facb3dab65c878f66aff18606637b3503 Mon Sep 17 00:00:00 2001 From: Dmi3yy Date: Thu, 23 May 2013 14:19:03 +0300 Subject: [PATCH 044/530] small fix --- install/setup.data.sql | 10 +++++----- install/setup.sql | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/install/setup.data.sql b/install/setup.data.sql index 9b98082935..94c4f5bfe8 100644 --- a/install/setup.data.sql +++ b/install/setup.data.sql @@ -107,16 +107,16 @@ REPLACE INTO `{PREFIX}site_htmlsnippets` VALUES (9, 'footer', 'Site Template Foo REPLACE INTO `{PREFIX}site_htmlsnippets` VALUES (10, 'meta', 'Site Template Meta', 0, 1, 0, '

    Valid XHTML

    Valid css

    MODx

    ', 0); -REPLACE INTO `{PREFIX}site_htmlsnippets` VALUES (11, 'mh.InnerRowTpl', 'Inner row template for ModxHost top menu', 0, 1, 0, '[+wf.linktext+][+wf.wrapper+]', 0); +REPLACE INTO `{PREFIX}site_htmlsnippets` VALUES (11, 'mh.InnerRowTpl', 'Inner row template for MODXHost top menu', 0, 1, 0, '[+wf.linktext+][+wf.wrapper+]', 0); -REPLACE INTO `{PREFIX}site_htmlsnippets` VALUES (12, 'mh.InnerTpl', 'Inner nesting template for ModxHost top menu', 0, 1, 0, '
      \r\n [+wf.wrapper+]\r\n
    ', 0); +REPLACE INTO `{PREFIX}site_htmlsnippets` VALUES (12, 'mh.InnerTpl', 'Inner nesting template for MODXHost top menu', 0, 1, 0, '
      \r\n [+wf.wrapper+]\r\n
    ', 0); -REPLACE INTO `{PREFIX}site_htmlsnippets` VALUES (13, 'mh.OuterTpl', 'Outer nesting template for ModxHost top menu', 0, 1, 0, '
      \r\n [+wf.wrapper+]\r\n
    ', 0); +REPLACE INTO `{PREFIX}site_htmlsnippets` VALUES (13, 'mh.OuterTpl', 'Outer nesting template for MODXHost top menu', 0, 1, 0, '
      \r\n [+wf.wrapper+]\r\n
    ', 0); -REPLACE INTO `{PREFIX}site_htmlsnippets` VALUES (14, 'mh.RowTpl', 'Row template for ModxHost top menu', 0, 1, 0, '
  • [+wf.linktext+][+wf.wrapper+]
  • ', 0); +REPLACE INTO `{PREFIX}site_htmlsnippets` VALUES (14, 'mh.RowTpl', 'Row template for MODXHost top menu', 0, 1, 0, '
  • [+wf.linktext+][+wf.wrapper+]
  • ', 0); REPLACE INTO `{PREFIX}site_htmlsnippets` VALUES (15, 'Comments', 'Comments (Jot) showing beneath a blog entry.', 0, 1, 0, '
    \r\n[!Jot? &customfields=`name,email` &subscribe=`1` &pagination=`4` &badwords=`dotNet` &canmoderate=`Site Admins` !]\r\n
    ', 0); @@ -153,7 +153,7 @@ REPLACE INTO `{PREFIX}site_keywords` VALUES ('4','login'); # -# Dumping data for table `modx2352_site_tmplvar_contentvalues` +# Dumping data for table `MODX2352_site_tmplvar_contentvalues` # diff --git a/install/setup.sql b/install/setup.sql index 9415926197..230ceccb81 100755 --- a/install/setup.sql +++ b/install/setup.sql @@ -1141,4 +1141,4 @@ UPDATE `{PREFIX}user_settings` SET REPLACE INTO `{PREFIX}system_settings` (setting_name, setting_value) VALUES ('manager_theme','MODxCarbon'); -UPDATE `{PREFIX}system_settings` set setting_value = if(setting_value REGEXP 'application/json',setting_value,concat_ws(",",setting_value,"application/json")) WHERE setting_name='custom_contenttype' \ No newline at end of file +UPDATE `{PREFIX}system_settings` set setting_value = if(setting_value REGEXP 'application/json',setting_value,concat_ws(",",setting_value,"application/json")) WHERE setting_name='custom_contenttype'; \ No newline at end of file From d4c275fe83faaa647c806e4222b1902f98323ec5 Mon Sep 17 00:00:00 2001 From: Dmi3yy Date: Thu, 23 May 2013 14:45:58 +0300 Subject: [PATCH 045/530] fix trouble with display 2 tv with type date --- manager/actions/mutate_content.dynamic.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manager/actions/mutate_content.dynamic.php b/manager/actions/mutate_content.dynamic.php index 61d20a173c..5a912c7b5e 100644 --- a/manager/actions/mutate_content.dynamic.php +++ b/manager/actions/mutate_content.dynamic.php @@ -778,10 +778,10 @@ function decode(s) { $tvDescription = (!empty($row['description'])) ? '
    ' . $row['description'] . '
    ' : ''; $tvInherited = (substr($tvPBV, 0, 8) == '@INHERIT') ? '
    (' . $_lang['tmplvars_inherited'] . ')
    ' : ''; - $zindex = $row['type'] == 'date' ? '100' : '500'; + echo "\t\t",'',$row['caption'],"\n", "\t\t\t",$tvDescription,$tvInherited,"\n", - "\t\t\t",'',"\n", + "\t\t\t",'',"\n", "\t\t\t",renderFormElement($row['type'], $row['id'], $row['default_text'], $row['elements'], $tvPBV, '', $row),"\n", "\t\t\n"; } From 304a0c25713b55f99b289b5ed31773a551835d51 Mon Sep 17 00:00:00 2001 From: yama Date: Thu, 23 May 2013 21:25:22 +0900 Subject: [PATCH 046/530] Refactor #9884 MODX_MANAGER_PATH step6 --- assets/modules/docmanager/tv.ajax.php | 8 ++++---- assets/plugins/tinymce/functions.php | 4 ++-- manager/actions/mutate_module.dynamic.php | 2 +- manager/actions/mutate_user.dynamic.php | 2 +- manager/actions/mutate_web_user.dynamic.php | 2 +- manager/includes/tmplvars.inc.php | 8 ++++---- manager/media/browser/mcpuk/browser.php | 1 + manager/media/browser/mcpuk/frmresourceslist.html | 2 +- manager/media/browser/mcpuk/js/common.js | 2 +- 9 files changed, 16 insertions(+), 15 deletions(-) diff --git a/assets/modules/docmanager/tv.ajax.php b/assets/modules/docmanager/tv.ajax.php index 6a80299cc4..cbbc4d5fb7 100644 --- a/assets/modules/docmanager/tv.ajax.php +++ b/assets/modules/docmanager/tv.ajax.php @@ -182,14 +182,14 @@ function BrowseServer(ctrl) { lastImageCtrl = ctrl; var w = screen.width * 0.7; var h = screen.height * 0.7; - OpenServerBrowser('".$base_url.MGR_DIR."/media/browser/mcpuk/browser.html?Type=images&Connector=".$base_url.MGR_DIR."/media/browser/mcpuk/connectors/php/connector.php&ServerPath=".$base_url."', w, h); + OpenServerBrowser('".MODX_MANAGER_URL."media/browser/mcpuk/browser.html?Type=images&Connector=".$base_url.MGR_DIR."/media/browser/mcpuk/connectors/php/connector.php&manager_url=".MODX_MANAGER_URL."', w, h); } function BrowseFileServer(ctrl) { lastFileCtrl = ctrl; var w = screen.width * 0.7; var h = screen.height * 0.7; - OpenServerBrowser('".$base_url.MGR_DIR."/media/browser/mcpuk/browser.html?Type=files&Connector=".$base_url.MGR_DIR."/media/browser/mcpuk/connectors/php/connector.php&ServerPath=".$base_url."', w, h); + OpenServerBrowser('".$base_url.MGR_DIR."/media/browser/mcpuk/browser.html?Type=files&Connector=".$base_url.MGR_DIR."/media/browser/mcpuk/connectors/php/connector.php&manager_url=".MODX_MANAGER_URL."', w, h); } function SetUrl(url, width, height, alt){ @@ -237,14 +237,14 @@ function BrowseServer(ctrl) { lastImageCtrl = ctrl; var w = screen.width * 0.7; var h = screen.height * 0.7; - OpenServerBrowser('".$base_url.MGR_DIR."/media/browser/mcpuk/browser.html?Type=images&Connector=".$base_url.MGR_DIR."/media/browser/mcpuk/connectors/php/connector.php&ServerPath=".$base_url."', w, h); + OpenServerBrowser('".$base_url.MGR_DIR."/media/browser/mcpuk/browser.html?Type=images&Connector=".$base_url.MGR_DIR."/media/browser/mcpuk/connectors/php/connector.php&manager_url=".MODX_MANAGER_URL."', w, h); } function BrowseFileServer(ctrl) { lastFileCtrl = ctrl; var w = screen.width * 0.7; var h = screen.height * 0.7; - OpenServerBrowser('".$base_url.MGR_DIR."/media/browser/mcpuk/browser.html?Type=files&Connector=".$base_url.MGR_DIR."/media/browser/mcpuk/connectors/php/connector.php&ServerPath=".$base_url."', w, h); + OpenServerBrowser('".$base_url.MGR_DIR."/media/browser/mcpuk/browser.html?Type=files&Connector=".$base_url.MGR_DIR."/media/browser/mcpuk/connectors/php/connector.php&manager_url=".MODX_MANAGER_URL."', w, h); } function SetUrl(url, width, height, alt){ diff --git a/assets/plugins/tinymce/functions.php b/assets/plugins/tinymce/functions.php index e2567af93e..19ee658ca5 100644 --- a/assets/plugins/tinymce/functions.php +++ b/assets/plugins/tinymce/functions.php @@ -409,8 +409,8 @@ function build_mce_init($params,$plugins,$buttons1,$buttons2,$buttons3,$buttons4 function build_tiny_callback($params) { $ph['cmsurl'] = MODX_MANAGER_URL . 'media/browser/mcpuk/browser.php?Connector='; - $ph['cmsurl'] .= MODX_MANAGER_URL . 'media/browser/mcpuk/connectors/php/connector.php&ServerPath='; - $ph['cmsurl'] .= MODX_BASE_URL . '&editor=tinymce&editorpath=' . $params['mce_url']; + $ph['cmsurl'] .= MODX_MANAGER_URL . 'media/browser/mcpuk/connectors/php/connector.php&manager_url='; + $ph['cmsurl'] .= MODX_MANAGER_URL . '&editor=tinymce&editorpath=' . $params['mce_url']; $modx_fb = file_get_contents($params['mce_path'] . 'js/modx_fb.js.inc'); foreach($ph as $name => $value) diff --git a/manager/actions/mutate_module.dynamic.php b/manager/actions/mutate_module.dynamic.php index d456960a75..f6f2e36051 100644 --- a/manager/actions/mutate_module.dynamic.php +++ b/manager/actions/mutate_module.dynamic.php @@ -308,7 +308,7 @@ function OpenServerBrowser(url, width, height ) { function BrowseServer() { var w = screen.width * 0.7; var h = screen.height * 0.7; - OpenServerBrowser("media/browser/mcpuk/browser.html?Type=images&Connector=media/browser/mcpuk/connectors/php/connector.php&ServerPath=", w, h); + OpenServerBrowser("media/browser/mcpuk/browser.html?Type=images&Connector=media/browser/mcpuk/connectors/php/connector.php&manager_url=", w, h); } function SetUrl(url, width, height, alt) { diff --git a/manager/actions/mutate_user.dynamic.php b/manager/actions/mutate_user.dynamic.php index 74f9d99fc4..67bad7b2a5 100644 --- a/manager/actions/mutate_user.dynamic.php +++ b/manager/actions/mutate_user.dynamic.php @@ -765,7 +765,7 @@ function OpenServerBrowser(url, width, height ) { function BrowseServer() { var w = screen.width * 0.7; var h = screen.height * 0.7; - OpenServerBrowser("media/browser/mcpuk/browser.html?Type=images&Connector=media/browser/mcpuk/connectors/php/connector.php&ServerPath=", w, h); + OpenServerBrowser("media/browser/mcpuk/browser.html?Type=images&Connector=media/browser/mcpuk/connectors/php/connector.php&manager_url=", w, h); } function SetUrl(url, width, height, alt){ document.userform.photo.value = url; diff --git a/manager/actions/mutate_web_user.dynamic.php b/manager/actions/mutate_web_user.dynamic.php index 63a6c59142..82bc38b10d 100644 --- a/manager/actions/mutate_web_user.dynamic.php +++ b/manager/actions/mutate_web_user.dynamic.php @@ -492,7 +492,7 @@ function OpenServerBrowser(url, width, height ) { function BrowseServer() { var w = screen.width * 0.7; var h = screen.height * 0.7; - OpenServerBrowser("media/browser/mcpuk/browser.html?Type=images&Connector=media/browser/mcpuk/connectors/php/connector.php&ServerPath=", w, h); + OpenServerBrowser("media/browser/mcpuk/browser.html?Type=images&Connector=media/browser/mcpuk/connectors/php/connector.php&manager_url=", w, h); } function SetUrl(url, width, height, alt){ document.userform.photo.value = url; diff --git a/manager/includes/tmplvars.inc.php b/manager/includes/tmplvars.inc.php index 94873f7d10..35c8c8fc3f 100755 --- a/manager/includes/tmplvars.inc.php +++ b/manager/includes/tmplvars.inc.php @@ -135,14 +135,14 @@ function BrowseServer(ctrl) { lastImageCtrl = ctrl; var w = screen.width * 0.7; var h = screen.height * 0.7; - OpenServerBrowser('".$base_url.MGR_DIR."/media/browser/mcpuk/browser.html?Type=images&Connector=".$base_url.MGR_DIR."/media/browser/mcpuk/connectors/php/connector.php&ServerPath=".$base_url."', w, h); + OpenServerBrowser('".MODX_MANAGER_URL."media/browser/mcpuk/browser.html?Type=images&Connector=".MODX_MANAGER_URL."media/browser/mcpuk/connectors/php/connector.php&manager_url=".MODX_MANAGER_URL."', w, h); } function BrowseFileServer(ctrl) { lastFileCtrl = ctrl; var w = screen.width * 0.7; var h = screen.height * 0.7; - OpenServerBrowser('".$base_url.MGR_DIR."/media/browser/mcpuk/browser.html?Type=files&Connector=".$base_url.MGR_DIR."/media/browser/mcpuk/connectors/php/connector.php&ServerPath=".$base_url."', w, h); + OpenServerBrowser('".MODX_MANAGER_URL."media/browser/mcpuk/browser.html?Type=files&Connector=".MODX_MANAGER_URL."media/browser/mcpuk/connectors/php/connector.php&manager_url=".MODX_MANAGER_URL."', w, h); } function SetUrl(url, width, height, alt){ @@ -191,14 +191,14 @@ function BrowseServer(ctrl) { lastImageCtrl = ctrl; var w = screen.width * 0.7; var h = screen.height * 0.7; - OpenServerBrowser('".$base_url.MGR_DIR."/media/browser/mcpuk/browser.html?Type=images&Connector=".$base_url.MGR_DIR."/media/browser/mcpuk/connectors/php/connector.php&ServerPath=".$base_url."', w, h); + OpenServerBrowser('".MODX_MANAGER_URL."media/browser/mcpuk/browser.html?Type=images&Connector=".MODX_MANAGER_URL."media/browser/mcpuk/connectors/php/connector.php&manager_url=".MODX_MANAGER_URL."', w, h); } function BrowseFileServer(ctrl) { lastFileCtrl = ctrl; var w = screen.width * 0.7; var h = screen.height * 0.7; - OpenServerBrowser('".$base_url.MGR_DIR."/media/browser/mcpuk/browser.html?Type=files&Connector=".$base_url.MGR_DIR."/media/browser/mcpuk/connectors/php/connector.php&ServerPath=".$base_url."', w, h); + OpenServerBrowser('".MODX_MANAGER_URL."media/browser/mcpuk/browser.html?Type=files&Connector=".MODX_MANAGER_URL."media/browser/mcpuk/connectors/php/connector.php&manager_url=".MODX_MANAGER_URL."', w, h); } function SetUrl(url, width, height, alt){ diff --git a/manager/media/browser/mcpuk/browser.php b/manager/media/browser/mcpuk/browser.php index cff3bd9aa3..4f074cc69b 100644 --- a/manager/media/browser/mcpuk/browser.php +++ b/manager/media/browser/mcpuk/browser.php @@ -1,4 +1,5 @@ Edit image' ; + oCell.innerHTML = oCell.innerHTML + 'Edit image' ; } /* diff --git a/manager/media/browser/mcpuk/js/common.js b/manager/media/browser/mcpuk/js/common.js index b21150bf54..9851d5ee84 100644 --- a/manager/media/browser/mcpuk/js/common.js +++ b/manager/media/browser/mcpuk/js/common.js @@ -55,7 +55,7 @@ oConnector.CurrentFolder = '/' ; oConnector.UploadHandler = GetUrlParam( 'UploadHandler' ); oConnector.ConnectorUrl = GetUrlParam( 'Connector' ) ; oConnector.ResourceType = GetUrlParam( 'Type' ) ; -oConnector.ServerPath = GetUrlParam( 'ServerPath' ) ; +oConnector.manager_url = GetUrlParam( 'manager_url' ) ; oConnector.ExtraParams = GetUrlParam( 'ExtraParams' ) ; oConnector.Editor = GetUrlParam( 'editor' ) ; From 57b20a542b0895e41fcc61f6869b3107705a6265 Mon Sep 17 00:00:00 2001 From: Thomas Jakobi Date: Fri, 24 May 2013 16:33:45 +0200 Subject: [PATCH 047/530] Refactor #9939: multiple event functions separated by comma Updated documentation --- assets/snippets/eform/docs/eform.htm | 41 +++++++++++--------- assets/snippets/eform/docs/eform_history.htm | 1 + 2 files changed, 24 insertions(+), 18 deletions(-) diff --git a/assets/snippets/eform/docs/eform.htm b/assets/snippets/eform/docs/eform.htm index e070753f5e..2aca6f9c7f 100755 --- a/assets/snippets/eform/docs/eform.htm +++ b/assets/snippets/eform/docs/eform.htm @@ -156,6 +156,7 @@

    Version 1.4.4.1 - 1.4.4.8

  • bugfix: If eform attibute is set on multiple check boxes only the last value is set in values list
  • Security fix: Additional sanitization applied after stripslashes is used on fields
  • Security fix: Send sendirect, ccsender and autotext mails only to the first mail address of the comma separated list.
  • +
  • Added: Multiple event functions separated by comma.

  • You can see a more extensive version history here.

    @@ -294,26 +295,30 @@

    Installation

    PHP Event Functions:

    The eForm event functions are now incorporated into the parameters. They are:

      -
    • &eFormOnBeforeMailSent (optional)
      Expects a function name. This function will be called after the form has been validated and before the report and thankyou templates have been parsed and any emails have been sent out. - See this example on how to use the events.
    • -
    • &eFormOnMailSent (optional)
      Expects a function name. This function is called after all templates have been parsed and any emails were sent.
    • -
    • &eformOnBeforeFormParse (optional)
      - Expects a function name. The function is called after the templates are loaded and the formid is found valid. The function should accomodate the following parameter: &$templates - (as reference) an associative array of loaded templates with indexes 'tpl', 'report','thankyou' & 'autotext'. Be aware that the latter three will only have a value if the form has been posted! -
    • -
    • &eFormOnBeforeFormMerge (optional)
      Expects a function name. This function will only be - called whenever the form is displayed and just before all placeholders - are merged. The function should accomodate the following parameter: &$fields - - (as reference) an associative array of field and placeholder values.
    • -
    • &eFormOnValidate (optional)
      Expects a function name. This function will be called directly after - the form validation has taken place. You can use this event to add - your own extra validation logic. The function should accomodate the - following parameters +
    • &eFormOnBeforeMailSent (optional)
      Expects a list of comma separated function names. These functions will be called after the form has been validated and before the report and thankyou templates have been parsed and any emails have been sent out. + See this example on how to use the events.
        -
      • &$fields - (as reference) an associative array of field and placeholder - values.
      • +
      • &$fields - (as reference) an associative array of field and placeholder values.
      • +
    • +
    • &eFormOnMailSent (optional)
      Expects a list of comma separated function names. These functions are called after all templates have been parsed and any emails were sent. +
        +
      • &$fields - (as reference) an associative array of field and placeholder values.
      • +
    • +
    • &eformOnBeforeFormParse (optional)
      Expects a list of comma separated function names. These functions are called after the templates are loaded and the formid is found valid. The function should accomodate the following parameter: +
        +
      • &$fields - (as reference) an associative array of field and placeholder values.
      • +
      • &$templates - (as reference) an associative array of loaded templates with indexes 'tpl', 'report','thankyou' & 'autotext'. Be aware that the latter three will only have a value if the form has been posted!
      • +
    • +
    • &eFormOnBeforeFormMerge (optional)
      Expects a list of comma separated function names. These functions will only be called whenever the form is displayed and just before all placeholders are merged. The function should accomodate the following parameter: +
        +
      • &$fields - (as reference) an associative array of field and placeholder values.
      • +
    • +
    • &eFormOnValidate (optional)
      Expects a function name. This function will be called directly after the form validation has taken place. You can use this event to add your own extra validation logic. The function should accomodate the following parameters +
        +
      • &$fields - (as reference) an associative array of field and placeholder values.
      • &$vMsg - (as reference) a numeric array of validation error messages.
      • -
      • &$rMsg - (as Reference) a numeric array of missing required - fields.
      • +
      • &$rMsg - (as Reference) a numeric array of missing required fields.
      • +
      • &$rClass - (as Reference) an associative array of fieldnames and classes assigned.

    Examples:

    diff --git a/assets/snippets/eform/docs/eform_history.htm b/assets/snippets/eform/docs/eform_history.htm index 7071f1f574..82a3471081 100755 --- a/assets/snippets/eform/docs/eform_history.htm +++ b/assets/snippets/eform/docs/eform_history.htm @@ -147,6 +147,7 @@

    Version 1.4.4.1 - 1.4.4.8

  • bugfix: If eform attibute is set on multiple check boxes only the last value is set in values list
  • Security fix: Additional sanitization applied after stripslashes is used on fields
  • Security fix: Send sendirect, ccsender and autotext mails only to the first mail address of the comma separated list.
  • +
  • Added: Multiple event functions separated by comma.
  • Version 1.4.4

    +
    @@ -40,3 +41,4 @@
    +
    From ee953115b7bfc50a881d383182f3756edab1b4c7 Mon Sep 17 00:00:00 2001 From: Dmi3yy Date: Sat, 10 Aug 2013 16:02:52 +0300 Subject: [PATCH 215/530] fix html in refresh_site --- manager/actions/refresh_site.dynamic.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/manager/actions/refresh_site.dynamic.php b/manager/actions/refresh_site.dynamic.php index 9e6d36e3fd..0e34ace4e1 100644 --- a/manager/actions/refresh_site.dynamic.php +++ b/manager/actions/refresh_site.dynamic.php @@ -17,7 +17,7 @@ ?>

    - +
    ".$_lang["refresh_published"]."

    ", $num_rows_pub) ?> ".$_lang["refresh_unpublished"]."

    ", $num_rows_unpub) ?> @@ -33,3 +33,4 @@ ?>
    +
    From ff452cd4a7ddfd4e1a86bdf03c2a5b2db9c95b4e Mon Sep 17 00:00:00 2001 From: Dmi3yy Date: Sat, 10 Aug 2013 16:04:04 +0300 Subject: [PATCH 216/530] fix html in rele_management --- manager/actions/role_management.static.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/manager/actions/role_management.static.php b/manager/actions/role_management.static.php index b6b78ce1d5..cd943b2165 100644 --- a/manager/actions/role_management.static.php +++ b/manager/actions/role_management.static.php @@ -14,7 +14,7 @@

    - +

    @@ -49,3 +49,4 @@ ?>
    +
    From 4efe26731dc457535282b07c28b721df616829f5 Mon Sep 17 00:00:00 2001 From: Dmi3yy Date: Sat, 10 Aug 2013 16:05:30 +0300 Subject: [PATCH 217/530] fix html in sysinfo --- manager/actions/sysinfo.static.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/manager/actions/sysinfo.static.php b/manager/actions/sysinfo.static.php index bda447f8be..1c2db1a0a6 100644 --- a/manager/actions/sysinfo.static.php +++ b/manager/actions/sysinfo.static.php @@ -125,6 +125,7 @@ function viewPHPInfo() { +

    @@ -162,9 +163,10 @@ function viewPHPInfo() {

    - +
    +

    @@ -250,9 +252,10 @@ function nicesize($size) { if($totaloverhead>0) { ?>

    - + +
    -
    +
    From d356741a4fa751e1da5754646d01c0e3f3da5aac Mon Sep 17 00:00:00 2001 From: Dmi3yy Date: Sat, 10 Aug 2013 16:06:40 +0300 Subject: [PATCH 218/530] fix html in user_management --- manager/actions/user_management.static.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manager/actions/user_management.static.php b/manager/actions/user_management.static.php index ebb76e7d60..0d61a02bb8 100644 --- a/manager/actions/user_management.static.php +++ b/manager/actions/user_management.static.php @@ -88,7 +88,7 @@ function menuAction(a) {

    - +

    -
    +
    From 1619f31ec0ccb5317e8ae7b9a75b9170de20baa6 Mon Sep 17 00:00:00 2001 From: Dmi3yy Date: Sat, 10 Aug 2013 16:07:29 +0300 Subject: [PATCH 219/530] fix html in web_user_management --- manager/actions/web_user_management.static.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manager/actions/web_user_management.static.php b/manager/actions/web_user_management.static.php index 64d0ef3431..8671d6d2fe 100644 --- a/manager/actions/web_user_management.static.php +++ b/manager/actions/web_user_management.static.php @@ -87,7 +87,7 @@ function menuAction(a) {

    - +

    -
    +
    From 7932001483c6609918bd3ba67827d73b0a5af641 Mon Sep 17 00:00:00 2001 From: Dmi3yy Date: Sun, 11 Aug 2013 08:46:40 +0300 Subject: [PATCH 220/530] refactor plugin FMP for smaller cache file --- .../plugin.forgotmanagerlogin.php | 185 ++++++++++++++++++ .../assets/plugins/ForgotManagerPassword.tpl | 184 +---------------- 2 files changed, 186 insertions(+), 183 deletions(-) create mode 100644 assets/plugins/forgotmanagerlogin/plugin.forgotmanagerlogin.php diff --git a/assets/plugins/forgotmanagerlogin/plugin.forgotmanagerlogin.php b/assets/plugins/forgotmanagerlogin/plugin.forgotmanagerlogin.php new file mode 100644 index 0000000000..ffd407ffe9 --- /dev/null +++ b/assets/plugins/forgotmanagerlogin/plugin.forgotmanagerlogin.php @@ -0,0 +1,185 @@ +errors = array(); + $this->checkLang(); + } + + function getLink() { + global $_lang; + + $link = <<{$_lang['forgot_your_password']} +EOD; + + return $link; + } + + function getForm() { + global $_lang; + + $form = <<{$_lang['account_email']}: + + +EOD; + + return $form; + } + + /* Get user info including a hash unique to this user, password, and day */ + function getUser($user_id=false, $username='', $email='', $hash='') { + global $modx, $_lang; + + $user_id = $user_id == false ? false : $modx->db->escape($user_id); + $username = $modx->db->escape($username); + $email = $modx->db->escape($email); + $hash = $modx->db->escape($hash); + + $pre = $modx->db->config['table_prefix']; + $site_id = $modx->config['site_id']; + $today = date('Yz'); // Year and day of the year + $wheres = array(); + $where = ''; + $user = null; + + if($user_id !== false) { $wheres[] = "usr.id = '{$user_id}'"; } + if(!empty($username)) { $wheres[] = "usr.username = '{$username}'"; } + if(!empty($email)) { $wheres[] = "attr.email = '{$email}'"; } + if(!empty($hash)) { $wheres[] = "MD5(CONCAT(usr.username,usr.password,'{$site_id}','{$today}')) = '{$hash}'"; } + + if($wheres) { + $where = ' WHERE '.implode(' AND ',$wheres); + $sql = "SELECT usr.id, usr.username, attr.email, MD5(CONCAT(usr.username,usr.password,'{$site_id}','{$today}')) AS hash + FROM `{$pre}manager_users` usr + INNER JOIN `{$pre}user_attributes` attr ON usr.id = attr.internalKey + {$where} + LIMIT 1;"; + + if($result = $modx->db->query($sql)){ + if($modx->db->getRecordCount($result)==1) { + $user = $modx->db->getRow($result); + } + } + } + + if($user == null) { $this->errors[] = $_lang['could_not_find_user']; } + + return $user; + } + + + + /* Send an email with a link to login */ + function sendEmail($to) { + global $modx, $_lang; + + $subject = $_lang['password_change_request']; + $headers = "MIME-Version: 1.0\r\n". + "Content-type: text/html; charset=\"{$modx->config['modx_charset']}\"\r\n". + "From: MODx <{$modx->config['emailsender']}>\r\n". + "Reply-To: no-reply@{$_SERVER['HTTP_HOST']}\r\n". + "X-Mailer: PHP/".phpversion(); + + $user = $this->getUser(0, '', $to); + + if($user['username']) { + $body = <<{$_lang['forgot_password_email_intro']} {$_lang['forgot_password_email_link']}

    +

    {$_lang['forgot_password_email_instructions']}

    +

    {$_lang['forgot_password_email_fine_print']}

    +EOD; + + $mail = mail($to, $subject, $body, $headers); + if(!$mail) { $this->errors[] = $_lang['error_sending_email']; } + + return $mail; + } + } + + function unblockUser($user_id) { + global $modx, $_lang; + + $pre = $modx->db->config['table_prefix']; + $modx->db->update(array('blocked' => 0, 'blockeduntil' => 0, 'failedlogincount' => 0), "`{$pre}user_attributes`", "internalKey = '{$user_id}'"); + + if(!$modx->db->getAffectedRows()) { $this->errors[] = $_lang['user_doesnt_exist']; return; } + + return true; + } + + function checkLang() { + global $_lang; + + $eng = array(); + $eng['forgot_your_password'] = 'Forgot your password?'; + $eng['account_email'] = 'Account email'; + $eng['send'] = 'Send'; + $eng['password_change_request'] = 'Password change request'; + $eng['forgot_password_email_intro'] = 'A request has been made to change the password on your account.'; + $eng['forgot_password_email_link'] = 'Click here to complete the process.'; + $eng['forgot_password_email_instructions'] = 'From there you will be able to change your password from the My Account menu.'; + $eng['forgot_password_email_fine_print'] = '* The URL above will expire once you change your password or after today.'; + $eng['error_sending_email'] = 'Error sending email'; + $eng['could_not_find_user'] = 'Could not find user'; + $eng['user_doesnt_exist'] = 'User does not exist'; + $eng['email_sent'] = 'Email sent'; + + foreach($eng as $key=>$value) { + if(empty($_lang[$key])) { $_lang[$key] = $value; } + } + } + + function getErrorOutput() { + $output = ''; + + if($this->errors) { + $output = ''.implode('', $this->errors).''; + } + + return $output; + } + } +} + +global $_lang; + +$output = ''; +$event_name = $modx->Event->name; +$action = (empty($_GET['action']) ? '' : (is_string($_GET['action']) ? $_GET['action'] : '')); +$username = (empty($_GET['username']) ? false : (is_string($_GET['username']) ? $_GET['username'] : '')); +$to = (empty($_GET['email']) ? '' : (is_string($_GET['email']) ? $_GET['email'] : '')); +$hash = (empty($_GET['hash']) ? false : (is_string($_GET['hash']) ? $_GET['hash'] : '')); +$forgot = new ForgotManagerPassword(); + +if($event_name == 'OnManagerLoginFormRender') { + switch($action) { + case 'show_form': + $output = $forgot->getForm(); + break; + case 'send_email': + if($forgot->sendEmail($to)) { $output = $_lang['email_sent']; } + break; + default: + $output = $forgot->getLink(); + break; + } + + if($forgot->errors) { $output = $forgot->getErrorOutput() . $forgot->getLink(); } +} + +if($event_name == 'OnBeforeManagerLogin' && $hash && $username) { + $user = $forgot->getUser(false, $username, '', $hash); + if($user && is_array($user) && !$forgot->errors) { + $forgot->unblockUser($user['id']); + } +} + +if($event_name == 'OnManagerAuthentication' && $hash && $username) { + $user = $forgot->getUser(false, $username, '', $hash); + $output = ($user !== null && count($forgot->errors) == 0) ? true : false; +} + +$modx->Event->output($output); diff --git a/install/assets/plugins/ForgotManagerPassword.tpl b/install/assets/plugins/ForgotManagerPassword.tpl index 53ebfdeb93..f3730e82b2 100644 --- a/install/assets/plugins/ForgotManagerPassword.tpl +++ b/install/assets/plugins/ForgotManagerPassword.tpl @@ -12,186 +12,4 @@ * @internal @installset base */ -if(!class_exists('ForgotManagerPassword')) { - class ForgotManagerPassword{ - function ForgotManagerPassword(){ - $this->errors = array(); - $this->checkLang(); - } - - function getLink() { - global $_lang; - - $link = <<{$_lang['forgot_your_password']} -EOD; - - return $link; - } - - function getForm() { - global $_lang; - - $form = <<{$_lang['account_email']}: - - -EOD; - - return $form; - } - - /* Get user info including a hash unique to this user, password, and day */ - function getUser($user_id=false, $username='', $email='', $hash='') { - global $modx, $_lang; - - $user_id = $user_id == false ? false : $modx->db->escape($user_id); - $username = $modx->db->escape($username); - $email = $modx->db->escape($email); - $hash = $modx->db->escape($hash); - - $pre = $modx->db->config['table_prefix']; - $site_id = $modx->config['site_id']; - $today = date('Yz'); // Year and day of the year - $wheres = array(); - $where = ''; - $user = null; - - if($user_id !== false) { $wheres[] = "usr.id = '{$user_id}'"; } - if(!empty($username)) { $wheres[] = "usr.username = '{$username}'"; } - if(!empty($email)) { $wheres[] = "attr.email = '{$email}'"; } - if(!empty($hash)) { $wheres[] = "MD5(CONCAT(usr.username,usr.password,'{$site_id}','{$today}')) = '{$hash}'"; } - - if($wheres) { - $where = ' WHERE '.implode(' AND ',$wheres); - $sql = "SELECT usr.id, usr.username, attr.email, MD5(CONCAT(usr.username,usr.password,'{$site_id}','{$today}')) AS hash - FROM `{$pre}manager_users` usr - INNER JOIN `{$pre}user_attributes` attr ON usr.id = attr.internalKey - {$where} - LIMIT 1;"; - - if($result = $modx->db->query($sql)){ - if($modx->db->getRecordCount($result)==1) { - $user = $modx->db->getRow($result); - } - } - } - - if($user == null) { $this->errors[] = $_lang['could_not_find_user']; } - - return $user; - } - - - - /* Send an email with a link to login */ - function sendEmail($to) { - global $modx, $_lang; - - $subject = $_lang['password_change_request']; - $headers = "MIME-Version: 1.0\r\n". - "Content-type: text/html; charset=\"{$modx->config['modx_charset']}\"\r\n". - "From: MODx <{$modx->config['emailsender']}>\r\n". - "Reply-To: no-reply@{$_SERVER['HTTP_HOST']}\r\n". - "X-Mailer: PHP/".phpversion(); - - $user = $this->getUser(0, '', $to); - - if($user['username']) { - $body = <<{$_lang['forgot_password_email_intro']} {$_lang['forgot_password_email_link']}

    -

    {$_lang['forgot_password_email_instructions']}

    -

    {$_lang['forgot_password_email_fine_print']}

    -EOD; - - $mail = mail($to, $subject, $body, $headers); - if(!$mail) { $this->errors[] = $_lang['error_sending_email']; } - - return $mail; - } - } - - function unblockUser($user_id) { - global $modx, $_lang; - - $pre = $modx->db->config['table_prefix']; - $modx->db->update(array('blocked' => 0, 'blockeduntil' => 0, 'failedlogincount' => 0), "`{$pre}user_attributes`", "internalKey = '{$user_id}'"); - - if(!$modx->db->getAffectedRows()) { $this->errors[] = $_lang['user_doesnt_exist']; return; } - - return true; - } - - function checkLang() { - global $_lang; - - $eng = array(); - $eng['forgot_your_password'] = 'Forgot your password?'; - $eng['account_email'] = 'Account email'; - $eng['send'] = 'Send'; - $eng['password_change_request'] = 'Password change request'; - $eng['forgot_password_email_intro'] = 'A request has been made to change the password on your account.'; - $eng['forgot_password_email_link'] = 'Click here to complete the process.'; - $eng['forgot_password_email_instructions'] = 'From there you will be able to change your password from the My Account menu.'; - $eng['forgot_password_email_fine_print'] = '* The URL above will expire once you change your password or after today.'; - $eng['error_sending_email'] = 'Error sending email'; - $eng['could_not_find_user'] = 'Could not find user'; - $eng['user_doesnt_exist'] = 'User does not exist'; - $eng['email_sent'] = 'Email sent'; - - foreach($eng as $key=>$value) { - if(empty($_lang[$key])) { $_lang[$key] = $value; } - } - } - - function getErrorOutput() { - $output = ''; - - if($this->errors) { - $output = ''.implode('', $this->errors).''; - } - - return $output; - } - } -} - -global $_lang; - -$output = ''; -$event_name = $modx->Event->name; -$action = (empty($_GET['action']) ? '' : (is_string($_GET['action']) ? $_GET['action'] : '')); -$username = (empty($_GET['username']) ? false : (is_string($_GET['username']) ? $_GET['username'] : '')); -$to = (empty($_GET['email']) ? '' : (is_string($_GET['email']) ? $_GET['email'] : '')); -$hash = (empty($_GET['hash']) ? false : (is_string($_GET['hash']) ? $_GET['hash'] : '')); -$forgot = new ForgotManagerPassword(); - -if($event_name == 'OnManagerLoginFormRender') { - switch($action) { - case 'show_form': - $output = $forgot->getForm(); - break; - case 'send_email': - if($forgot->sendEmail($to)) { $output = $_lang['email_sent']; } - break; - default: - $output = $forgot->getLink(); - break; - } - - if($forgot->errors) { $output = $forgot->getErrorOutput() . $forgot->getLink(); } -} - -if($event_name == 'OnBeforeManagerLogin' && $hash && $username) { - $user = $forgot->getUser(false, $username, '', $hash); - if($user && is_array($user) && !$forgot->errors) { - $forgot->unblockUser($user['id']); - } -} - -if($event_name == 'OnManagerAuthentication' && $hash && $username) { - $user = $forgot->getUser(false, $username, '', $hash); - $output = ($user !== null && count($forgot->errors) == 0) ? true : false; -} - -$modx->Event->output($output); +require MODX_BASE_PATH.'assets/plugins/forgotmanagerlogin/plugin.forgotmanagerlogin.php'; \ No newline at end of file From 115313723dce0616a6bc4f31581713145658699f Mon Sep 17 00:00:00 2001 From: Dmi3yy Date: Sun, 11 Aug 2013 08:51:24 +0300 Subject: [PATCH 221/530] refactor transallias to smaller cache file --- .../plugins/transalias/plugin.transalias.php | 45 +++++++++++++++++++ install/assets/plugins/transalias.tpl | 43 +----------------- 2 files changed, 46 insertions(+), 42 deletions(-) create mode 100644 assets/plugins/transalias/plugin.transalias.php diff --git a/assets/plugins/transalias/plugin.transalias.php b/assets/plugins/transalias/plugin.transalias.php new file mode 100644 index 0000000000..a417e03140 --- /dev/null +++ b/assets/plugins/transalias/plugin.transalias.php @@ -0,0 +1,45 @@ +config['base_path'].'assets/plugins/'.$plugin_dir; } +if (!isset ($table_name)) { $table_name = 'common'; } +if (!isset ($char_restrict)) { $char_restrict = 'lowercase alphanumeric'; } +if (!isset ($remove_periods)) { $remove_periods = 'No'; } +if (!isset ($word_separator)) { $word_separator = 'dash'; } +if (!isset ($override_tv)) { $override_tv = ''; } + +if (!class_exists('TransAlias')) { + require_once $plugin_path.'/transalias.class.php'; +} +$trans = new TransAlias($modx); + +/* + * see if TV overrides the table name + */ +if(!empty($override_tv)) { + $tvval = $trans->getTVValue($override_tv); + if(!empty($tvval)) { + $table_name = $tvval; + } +} + +/* + * Handle events + */ +$e =& $modx->event; +switch ($e->name ) { + case 'OnStripAlias': + if ($trans->loadTable($table_name, $remove_periods)) { + $output = $trans->stripAlias($alias,$char_restrict,$word_separator); + $e->output($output); + $e->stopPropagation(); + } + break ; + default: + return ; +} \ No newline at end of file diff --git a/install/assets/plugins/transalias.tpl b/install/assets/plugins/transalias.tpl index ad66e8e8aa..be4710ec1a 100644 --- a/install/assets/plugins/transalias.tpl +++ b/install/assets/plugins/transalias.tpl @@ -16,45 +16,4 @@ * @internal @installset base, sample */ -/* - * Initialize parameters - */ -if (!isset ($alias)) { return ; } -if (!isset ($plugin_dir) ) { $plugin_dir = 'transalias'; } -if (!isset ($plugin_path) ) { $plugin_path = $modx->config['base_path'].'assets/plugins/'.$plugin_dir; } -if (!isset ($table_name)) { $table_name = 'common'; } -if (!isset ($char_restrict)) { $char_restrict = 'lowercase alphanumeric'; } -if (!isset ($remove_periods)) { $remove_periods = 'No'; } -if (!isset ($word_separator)) { $word_separator = 'dash'; } -if (!isset ($override_tv)) { $override_tv = ''; } - -if (!class_exists('TransAlias')) { - require_once $plugin_path.'/transalias.class.php'; -} -$trans = new TransAlias($modx); - -/* - * see if TV overrides the table name - */ -if(!empty($override_tv)) { - $tvval = $trans->getTVValue($override_tv); - if(!empty($tvval)) { - $table_name = $tvval; - } -} - -/* - * Handle events - */ -$e =& $modx->event; -switch ($e->name ) { - case 'OnStripAlias': - if ($trans->loadTable($table_name, $remove_periods)) { - $output = $trans->stripAlias($alias,$char_restrict,$word_separator); - $e->output($output); - $e->stopPropagation(); - } - break ; - default: - return ; -} \ No newline at end of file +require MODX_BASE_PATH.'assets/plugins/transalias/plugin.transalias.php'; \ No newline at end of file From b2c17dad1b0f24909810cc2240cc78ee88766b93 Mon Sep 17 00:00:00 2001 From: Dmi3yy Date: Sun, 11 Aug 2013 08:58:57 +0300 Subject: [PATCH 222/530] small fix and add fileSource plugin --- .../plugins/filesource/plugin.filesource.php | 139 ++++++++++++++++++ .../plugin.forgotmanagerlogin.php | 1 + .../plugins/transalias/plugin.transalias.php | 17 +-- install/assets/plugins/filesource.tpl | 16 ++ 4 files changed, 160 insertions(+), 13 deletions(-) create mode 100644 assets/plugins/filesource/plugin.filesource.php create mode 100644 install/assets/plugins/filesource.tpl diff --git a/assets/plugins/filesource/plugin.filesource.php b/assets/plugins/filesource/plugin.filesource.php new file mode 100644 index 0000000000..13ff25eb64 --- /dev/null +++ b/assets/plugins/filesource/plugin.filesource.php @@ -0,0 +1,139 @@ +Event; + +$output = ''; + +/** + * Подготовка информации перед рендером формы редактирования сниппета + */ +$name=$e->name; +$dir='snippets'; +$vals='snippet'; +$include='return require'; +$count=47; + if ($name=='OnPluginFormPrerender' ||$name=='OnPluginFormRender' ||$name=='OnBeforePluginFormSave') {$dir='plugins';$vals='plugincode';$count=39;$include='require';} + + + +switch ($e->name) { + case 'OnPluginFormPrerender': + case 'OnSnipFormPrerender': + + global $content; + if(substr(trim($content[$vals]),0,$count) == $include.' MODX_BASE_PATH.\'assets/'.$dir.'/'){ + $content['file_binding'] = str_replace(array(';','\''),'',trim(substr(trim($content[$vals]),$count,250))); + $snippetPath = MODX_BASE_PATH . 'assets/'.$dir.'/' . $content['file_binding']; + $content[$vals] = file_get_contents($snippetPath); + if ( $vals=='snippet'){ + if ( strncmp($content[$vals], "' ) $content[$vals] = substr($content[$vals], 0, -2); + + } else { + $content['file_binding'] = ''; + } + } + + if ( $vals=='plugincode'){ + if ( strncmp($content[$vals], "' ) $content[$vals] = substr($content[$vals], 0, -2); + + } +} + $_SESSION['itemname']=$content['name']; + } elseif (substr(trim($content[$vals]),0,7) == '//@FILE'){ // Added by Carw + $content['file_binding'] = str_replace(';','',trim(substr(trim($content[$vals]),7,250))); + $snippetPath = MODX_BASE_PATH . 'assets/'.$dir.'/' . $content['file_binding']; + $content[$vals] = file_get_contents($snippetPath); + if ( strncmp($content[$vals], "' ) $content[$vals] = substr($content[$vals], 0, -2); + } else { + $content['file_binding'] = ''; + } + $_SESSION['itemname']=$content['name']; + } else { + $_SESSION['itemname']="New snippet"; + } + break; + case 'OnSnipFormRender': + case 'OnPluginFormRender': + global $content; + + $output = ' + + '; + break; + case 'OnBeforeSnipFormSave': + if(!empty($_POST['filebinding'])) { + global $snippet; + $pathsnippet = trim($modx->db->escape($_POST['filebinding'])); + $fullpathsnippet = MODX_BASE_PATH . 'assets/'.$dir.'/' . $pathsnippet; + + if($fl = @fopen($fullpathsnippet,'w')) { + fwrite($fl, $_POST['post']); + fclose($fl); + $snippet = $modx->db->escape($include.' MODX_BASE_PATH.\'assets/'.$dir.'/' . $pathsnippet . '\';'); + } + } + break; + case 'OnBeforePluginFormSave': + + + if(!empty($_POST['filebinding'])) { + global $plugincode; + $pathsnippet = trim($modx->db->escape($_POST['filebinding'])); + $fullpathsnippet = MODX_BASE_PATH . 'assets/'.$dir.'/' . $pathsnippet; + + + $code=''; + + if($fl = @fopen($fullpathsnippet,'w')) { + fwrite($fl, $code); + fclose($fl); + $plugincode = $modx->db->escape($include.' MODX_BASE_PATH.\'assets/'.$dir.'/' . $pathsnippet . '\';'); + } + + } + break; +} + +if($output != '') { + $e->output($output); +} +?> \ No newline at end of file diff --git a/assets/plugins/forgotmanagerlogin/plugin.forgotmanagerlogin.php b/assets/plugins/forgotmanagerlogin/plugin.forgotmanagerlogin.php index ffd407ffe9..1a073e9058 100644 --- a/assets/plugins/forgotmanagerlogin/plugin.forgotmanagerlogin.php +++ b/assets/plugins/forgotmanagerlogin/plugin.forgotmanagerlogin.php @@ -183,3 +183,4 @@ function getErrorOutput() { } $modx->Event->output($output); +?> \ No newline at end of file diff --git a/assets/plugins/transalias/plugin.transalias.php b/assets/plugins/transalias/plugin.transalias.php index a417e03140..6bcfddfd15 100644 --- a/assets/plugins/transalias/plugin.transalias.php +++ b/assets/plugins/transalias/plugin.transalias.php @@ -1,9 +1,6 @@ config['base_path'].'assets/plugins/'.$plugin_dir; } @@ -12,25 +9,18 @@ if (!isset ($remove_periods)) { $remove_periods = 'No'; } if (!isset ($word_separator)) { $word_separator = 'dash'; } if (!isset ($override_tv)) { $override_tv = ''; } - if (!class_exists('TransAlias')) { require_once $plugin_path.'/transalias.class.php'; } $trans = new TransAlias($modx); - -/* - * see if TV overrides the table name - */ +//see if TV overrides the table name if(!empty($override_tv)) { $tvval = $trans->getTVValue($override_tv); if(!empty($tvval)) { $table_name = $tvval; } } - -/* - * Handle events - */ +//Handle events $e =& $modx->event; switch ($e->name ) { case 'OnStripAlias': @@ -42,4 +32,5 @@ break ; default: return ; -} \ No newline at end of file +} +?> \ No newline at end of file diff --git a/install/assets/plugins/filesource.tpl b/install/assets/plugins/filesource.tpl new file mode 100644 index 0000000000..5f30861bf0 --- /dev/null +++ b/install/assets/plugins/filesource.tpl @@ -0,0 +1,16 @@ +// Date: Sun, 11 Aug 2013 09:05:08 +0300 Subject: [PATCH 223/530] qm+ install disabled --- install/assets/plugins/ForgotManagerPassword.tpl | 3 ++- install/assets/plugins/qm.tpl | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/install/assets/plugins/ForgotManagerPassword.tpl b/install/assets/plugins/ForgotManagerPassword.tpl index f3730e82b2..0548a7a2fd 100644 --- a/install/assets/plugins/ForgotManagerPassword.tpl +++ b/install/assets/plugins/ForgotManagerPassword.tpl @@ -10,6 +10,7 @@ * @internal @events OnBeforeManagerLogin,OnManagerAuthentication,OnManagerLoginFormRender * @internal @modx_category Manager and Admin * @internal @installset base + * @author opengeek + * @author Agel_Nash */ - require MODX_BASE_PATH.'assets/plugins/forgotmanagerlogin/plugin.forgotmanagerlogin.php'; \ No newline at end of file diff --git a/install/assets/plugins/qm.tpl b/install/assets/plugins/qm.tpl index 8739e802f5..b1dc1970f0 100644 --- a/install/assets/plugins/qm.tpl +++ b/install/assets/plugins/qm.tpl @@ -12,6 +12,7 @@ * @internal @modx_category Manager and Admin * @internal @legacy_names QM+,QuickEdit * @internal @installset base, sample + * @internal @disabled 1 */ From 3f853e8382647c24010361910de7c2fbc5b7de78 Mon Sep 17 00:00:00 2001 From: Dmi3yy Date: Sun, 11 Aug 2013 09:09:31 +0300 Subject: [PATCH 224/530] Refactor #10071 ajaxSearch --- .../ajaxSearch/snippet.ajaxSearch.php | 416 ++++++++++++++++ install/assets/plugins/searchhighlight.tpl | 1 + install/assets/snippets/ajaxSearch.tpl | 471 +----------------- 3 files changed, 419 insertions(+), 469 deletions(-) create mode 100755 assets/snippets/ajaxSearch/snippet.ajaxSearch.php diff --git a/assets/snippets/ajaxSearch/snippet.ajaxSearch.php b/assets/snippets/ajaxSearch/snippet.ajaxSearch.php new file mode 100755 index 0000000000..e0aae2385f --- /dev/null +++ b/assets/snippets/ajaxSearch/snippet.ajaxSearch.php @@ -0,0 +1,416 @@ +getMicroTime(); + +$cfg = array(); // current configuration +$cfg['version'] = AS_VERSION; + +// Load the default configuration $dcfg to get the default values +$default = AS_PATH . 'configs/default.config.php'; +if (file_exists($default)) include $default; +else return "

    AjaxSearch error: $default not found !
    Check the existing of this file!

    "; +if (!isset($dcfg)) return "

    AjaxSearch error: default configuration array not defined in $default!
    Check the content of this file!

    "; + +if ($dcfg['version'] != AS_VERSION) return "

    AjaxSearch error: Version number mismatch. Check the content of the default configuration file!

    "; + +// check the possible use of deprecated parameters (since 1.8.5) +$readme = "ajaxSearch_version_193.txt"; +if (isset($searchWordList)) return "

    AjaxSearch error: searchWordList is a deprecated parameter. Read " . $readme . " file.

    "; +if (isset($resultsPage)) return "

    AjaxSearch error: resultsPage is a deprecated parameter. Read " . $readme . " file.

    "; +if (isset($AS_showForm)) return "

    AjaxSearch error: AS_showForm parameter has been renamed showInputForm. Read " . $readme . " file.

    "; +if (isset($AS_landing)) return "

    AjaxSearch error: AS_landing parameter has been renamed landingPage. Read " . $readme . " file.

    "; +if (isset($AS_showResults)) return "

    AjaxSearch error: AS_showResults parameter has been renamed showResults. Read " . $readme . " file.

    "; + +// Load a custom configuration file if required +// config_name - Other config installed in the configs folder or in any folder within the MODx base path via @FILE +// Configuration files should be named in the form: .config.php +// Default: '' - no custom config +$cfg['config'] = isset($config) ? $config : $dcfg['config']; +if ($cfg['config']) { + $config = $cfg['config']; + $lconfig = (substr($config, 0, 6) != "@FILE:") ? AS_PATH . "configs/$config.config.php" : $modx->config['base_path'] . trim(substr($config, 6, strlen($config)-6)); + if (file_exists($lconfig)) include $lconfig; + else return "

    AjaxSearch error: " . $lconfig . " not found !
    Check your config parameter or your config file name!

    "; +} + +// &debug = [ 0 | 1 | 2 | 3 ] +// 1,2,3 : File mode - Output logged into a file named ajaxSearch_log.txt in ajaxSearch/debug/ directory. +// this directory should be writable. +// Default: 0 - no logs +$cfg['debug'] = isset($debug) ? $debug : (isset($__debug) ? $__debug : $dcfg['debug']); + +// &timeLimit = [ int | 60 ] +// Max execution time in seconds for the AjaxSearch script +// 0 - If set to zero, no time limit is imposed +// Default: 60 - 1 minute. +$cfg['timeLimit'] = isset($timeLimit) ? $timeLimit : (isset($__timeLimit) ? $__timeLimit : $dcfg['timeLimit']); + +// &language [ language_name | manager_language ] (optional) +// Default: $modx->config['manager_language'] - manager language used +$cfg['language'] = isset($language) ? $language : (isset($__language) ? $__language : $dcfg['language']); + +// &ajaxSearch [1 | 0] (as passed in snippet variable ONLY) +// Use this to display the search results using ajax You must include the Mootools library in your template +// Default: 1 - ajax mode selected +$cfg['ajaxSearch'] = isset($ajaxSearch) ? $ajaxSearch : (isset($__ajaxSearch) ? $__ajaxSearch : $dcfg['ajaxSearch']); +// avoid the use of @FILE: prefix with ajax mode +if ((substr($cfg['config'], 0, 6) == "@FILE:") && $cfg['ajaxSearch']) + return "

    AjaxSearch error: @FILE: prefix not allowed !
    Check your config parameter or your config file name!

    "; + +// &advSearch [ 'exactphrase' | 'allwords' | 'nowords' | 'oneword' ] +// Advanced search: +// - exactphrase : provides the documents which contain the exact phrase +// - allwords : provides the documents which contain all the words +// - nowords : provides the documents which do not contain the words +// - oneword : provides the document which contain at least one word +// Default: 'oneword' +$cfg['advSearch'] = isset($advSearch) ? $advSearch : (isset($__advSearch) ? $__advSearch : $dcfg['advSearch']); + +// &asId - Unique id for AjaxSearch instance +// this allows to distinguish several Ajaxsearch instances on the same page +// Any combination of characters a-z, underscores, and numbers 0-9 +// This is case sensitive. Default = empty string +// With ajax mode, the first snippet call of the page shouldn't use the asId parameter +$cfg['asId'] = isset($asId) ? $asId : (isset($__asId) ? $__asId : $dcfg['asId']); + +// &whereSearch +// Define where should occur the search +// a separated list of keywords describing the tables where to search +// keywords allowed : +// "content" for site_content, "tv" for site_tmplvar_contentvalues, "jot" for jot_content, "maxigallery" for maxigallery +// you could add your own keywords. But the keyword should be a user function which describes the tables to use +// all the text fields are searchable but you could specify the fields like this: +// whereSearch=`content:pagetitle,introtext,content|tv:tv_value|maxigallery:gal_title` +// Default: 'content|tv' +$cfg['whereSearch'] = isset($whereSearch) ? $whereSearch : (isset($__whereSearch) ? $__whereSearch : $dcfg['whereSearch']); + +// &sites : [comma separated list of sites] +// sites allow to define sites where to do the search +$cfg['sites'] = isset($sites) ? $sites : (isset($__sites) ? $__sites : $dcfg['sites']); + +// &subSearch [comma separated list of subsites] +// subSearch allow to define sub-domains or subsites where to do the search +$cfg['subSearch'] = isset($subSearch) ? $subSearch : (isset($__subSearch) ? $__subSearch : $dcfg['subSearch']); + +// &category [ tv_name ] +// Any combination of characters a-z, underscores, and numbers 0-9 +// This is case sensitive. Default = empty string +// Name of a TV. The category of a MODx document is provided by this TV content +$cfg['category'] = isset($category) ? $category : (isset($__category) ? $__category : $dcfg['category']); + +// &display [ 'mixed' | 'unmixed' ] +// When results comes from differents sites, subsites or categories, you could choose to display the results mixed or unmixed. +// Default: unmixed +// Unmixed mode display the results grouped by site, subsite or category. Each group of results could be paginated. +// Mixed mode mixe all the results coming from the differents area. +// With unmixed mode, results are ordered by the field provided by the first field of the order parameter +$cfg['display'] = isset($display) ? $display : (isset($__display) ? $__display : $dcfg['display']); + +// &init [ 'none' | 'all' ] +// init defines if the search display all the results or none when the search term is an empty string +// Default: none +$cfg['init'] = isset($init) ? $init : (isset($__init) ? $__init : $dcfg['init']); + +// &withTvs - Define which Tvs are used for the search in Tvs +// a comma separated list of TV names +// Default: '' - all TVs are used (empty list) +$cfg['withTvs'] = isset($withTvs) ? $withTvs : (isset($__withTvs) ? $__withTvs : $dcfg['withTvs']); + +// &order - Define the sort order of results +// Comma separated list of fields defined as searchable in the table definition +// to suppress the sorting, use &order=`` +// Default: 'pub_date,pagetitle' +$cfg['order'] = isset($order) ? $order : (isset($__order) ? $__order : $dcfg['order']); + +// &rank - Define the rank of search results. Results are sorted by rank value +// Comma separated list of fields with optionally user defined weight +// Default: 'pagetitle:100,extract' +// to suppress the rank sorting, use &rank=``; +// &rank sort occurs after the &order sort +$cfg['rank'] = isset($rank) ? $rank : (isset($__rank) ? $__rank : $dcfg['rank']); + +// &maxWords [ 1 < int < 10 ] +// Maximum number of words for searching +// Default: 5 +$cfg['maxWords'] = isset($maxWords) ? intval($maxWords) : (isset($__maxWords) ? intval($__maxWords) : $dcfg['maxWords']); + +// &minChars [ 2 < int < 100 ] +// Minimum number of characters to require for a word to be valid for searching. +// length of each word with $advSearch = 'allwords', 'oneword' or 'nowords' +// length of the search string with possible spaces with $advSearch = 'exactphrase' +// Default: 3 +$cfg['minChars'] = isset($minChars) ? intval($minChars) : (isset($__minChars) ? intval($__minChars) : $dcfg['minChars']); + +// &showInputForm [0 | 1] +// If you would like to turn off the search form when showing results you can set this to false.(1=true, 0=false) +// Default: 1 +$cfg['showInputForm'] = isset($showInputForm) ? $showInputForm : (isset($__showInputForm) ? $__showInputForm : $dcfg['showInputForm']); + +// &showIntro [0 | 1] +// If you would like to turn off the intro message beyond the input form you can set this to false.(1=true, 0=false) +// Default: 1 +$cfg['showIntro'] = isset($showIntro) ? $showIntro : (isset($__showIntro) ? $__showIntro : $dcfg['showIntro']); + +// &grabMax [ int ] +// Set to the max number of records you would like on each page. Set to 0 if unlimited. +// Default: 10 +$cfg['grabMax'] = isset($grabMax) ? intval($grabMax) : (isset($__grabMax) ? intval($__grabMax) : $dcfg['grabMax']); + +// &extract [ n:searchable fields list | 1:content,description,introtext,tv_content] +// show the search terms highlighted in a little extract +// n : maximum number of extracts displayed +// ordered searchable fields list : separated list of fields define as searchable in the table definition +// Default: '1:content,description,introtext,tv_value' - One extract from content then description,introtext,tv_value +$cfg['extract'] = isset($extract) ? $extract : (isset($__extract) ? $__extract : $dcfg['extract']); + +// &extractLength [ 50 < int < 800] +// Length of extract around the search words found - between 50 and 800 characters +// Default: 200 +$cfg['extractLength'] = isset($extractLength) ? intval($extractLength) : (isset($__extractLength) ? intval($__extractLength) : $dcfg['extractLength']); + +// &extractEllips [ string ] +// Ellipside to mark the star and the end of an extract when the sentence is cutting +// Default: '...' +$cfg['extractEllips'] = isset($extractEllips) ? $extractEllips : (isset($__extractEllips) ? $__extractEllips : $dcfg['extractEllips']); + +// &extractSeparator [ string ] +// Any html tag to mark the separation between extracts +// Default: '
    ' - but you could also choose for instance '
    ' +$cfg['extractSeparator'] = isset($extractSeparator) ? $extractSeparator : (isset($__extractSeparator) ? $__extractSeparator : $dcfg['extractSeparator']); + +// &formatDate [ string ] +// The format of outputted dates. See http://www.php.net/manual/en/function.date.php +// Default: 'd/m/y : H:i:s' - e.g: 21/01/08 : 23:09:22 +$cfg['formatDate'] = isset($formatDate) ? $formatDate : (isset($__formatDate) ? $__formatDate : $dcfg['formatDate']); + +// &highlightResult [1 | 0] +// create links so that search terms will be highlighted when linked page clicked +// Default: 1 - Results highlighted +$cfg['highlightResult'] = isset($highlightResult) ? $highlightResult : (isset($__highlightResult) ? $__highlightResult : $dcfg['highlightResult']); + +// &pagingType[ 0 | 1 | 2 ] +// Determine the pagination type used - Default 1 : Previous - X-Y/Z - Next +$cfg['pagingType'] = isset($pagingType) ? $pagingType : (isset($__pagingType) ? $__pagingType : $dcfg['pagingType']); + +// &pageLinkSeparator [ string ] +// What you want, if anything, between your page link numbers +// Default: ' | ' +$cfg['pageLinkSeparator'] = isset($pageLinkSeparator) ? $pageLinkSeparator : (isset($__pageLinkSeparator) ? $__pageLinkSeparator : $dcfg['pageLinkSeparator']); + +// &showPagingAlways[1 | 0] +// Determine whether or not to always show paging +$cfg['showPagingAlways'] = isset($showPagingAlways) ? $showPagingAlways : (isset($__showPagingAlways) ? $__showPagingAlways : $dcfg['showPagingAlways']); + +// &landingPage [int] set the page to show the results page (non Ajax search) +// Default: false +$cfg['landingPage'] = isset($landingPage) ? $landingPage : (isset($__landingPage) ? $__landingPage : $dcfg['landingPage']); + +// &showResults [1 | 0] establish whether to show the results or not +// Default: 1 +$cfg['showResults'] = isset($showResults) ? $showResults : (isset($__showResults) ? $__showResults : $dcfg['showResults']); + +// &parents [ [ in | not in ] : comma separated list of Ids | '' ] +// Ids of documents to retrieve their children to &depth depth where to do the search in or not in +// Default: '' - empty list +$cfg['parents'] = isset($parents) ? $parents : (isset($__parents) ? $__parents : $dcfg['parents']); + +// &documents [ [ in | not in ] : comma separated list of Ids | '' ] +// Ids of documents where to do the search in or not in +// Default: '' - empty list +$cfg['documents'] = isset($documents) ? $documents : (isset($__documents) ? $__documents : $dcfg['documents']); + +// &depth [ 0 < int ] Number of levels deep to retrieve documents +// Default: 10 +$cfg['depth'] = isset($depth) ? intval($depth) : (isset($__depth) ? intval($__depth) : $dcfg['depth']); + +// &hideMenu [0 | 1| 2] Search in hidden documents from menu. +// 0 - search only in documents visible from menu +// 1 - search only in documents hidden from menu +// 2 - search in hidden or visible documents from menu +// Default: 2 +$cfg['hideMenu'] = isset($hideMenu) ? $hideMenu : (isset($__hideMenu) ? $__hideMenu : $dcfg['hideMenu']); + +// &hideLink [0 | 1 ] Search in content of type reference (link) +// 0 - search in content of type document AND reference +// 1 - search only in content of type document +// Default: 1 +$cfg['hideLink'] = isset($hideLink) ? $hideLink : (isset($__hideLink) ? $__hideLink : $dcfg['hideLink']); + +// &filter - Basic filtering : remove unwanted documents that meets the criteria of the filter +// See Ditto 2 Basic filtering and the ajaxSearch demo site for more information +// Default: '' - empty list +$cfg['filter'] = isset($filter) ? $filter : (isset($__filter) ? $__filter : $dcfg['filter']); + +// &output [0 | 1 ]Custom layout +// Default: 0 - Results are listed just under the input form +// 1 - custom layout. put [+as.inputForm+] and [+as.results+] where you want to define the layout +$cfg['output'] = isset($output) ? $output : (isset($__output) ? $__output : $dcfg['output']); + +// &tplInput - Chunk to style the ajaxSearch input form +// Default: '@FILE:' . AS_SPATH . 'templates/input.tpl.html' +$cfg['tplInput'] = isset($tplInput) ? $tplInput : (isset($__tplInput) ? $__tplInput : $dcfg['tplInput']); + +// &tplResults - Chunk to style the non-ajax output results outer +// Default: '@FILE:' . AS_SPATH . 'templates/results.tpl.html' +$cfg['tplResults'] = isset($tplResults) ? $tplResults : (isset($__tplResults) ? $__tplResults : $dcfg['tplResults']); + +// &tplGrpResult - Chunk to style the non-ajax output group result outer +// Default: '@FILE:' . AS_SPATH . 'templates/grpResult.tpl.html' +$cfg['tplGrpResult'] = isset($tplGrpResult) ? $tplGrpResult : (isset($__tplGrpResult) ? $__tplGrpResult : $dcfg['tplGrpResult']); + +// &tplResult - Chunk to style each output result +// Default: "@FILE:" . AS_SPATH . 'templates/result.tpl.html' +$cfg['tplResult'] = isset($tplResult) ? $tplResult : (isset($__tplResult) ? $__tplResult : $dcfg['tplResult']); + +// &tplComment - Chunk to style the comment form (Also used with the ajax mode) +// Default: '@FILE:' . AS_SPATH . 'templates/comment.tpl.html' +$cfg['tplComment'] = isset($tplComment) ? $tplComment : (isset($__tplComment) ? $__tplComment : $dcfg['tplComment']); + +// &tplPaging0 - Chunk to style the paging links - type 0 +// Default: '@FILE:' . AS_SPATH . 'templates/paging0.tpl.html' +$cfg['tplPaging0'] = isset($tplPaging0) ? $tplPaging0 : (isset($__tplPaging0) ? $__tplPaging0 : $dcfg['tplPaging0']); + +// &tplPaging1 - Chunk to style the paging links - type 1 +// Default: '@FILE:' . AS_SPATH . 'templates/paging1.tpl.html' +$cfg['tplPaging1'] = isset($tplPaging1) ? $tplPaging1 : (isset($__tplPaging1) ? $__tplPaging1 : $dcfg['tplPaging1']); + +// &tplPaging2 - Chunk to style the paging links - type 2 +// Default: '@FILE:' . AS_SPATH . 'templates/paging2.tpl.html' +$cfg['tplPaging2'] = isset($tplPaging2) ? $tplPaging2 : (isset($__tplPaging2) ? $__tplPaging2 : $dcfg['tplPaging2']); + +// &stripInput - stripInput user function name +// Default: 'defaultStripInput' +$cfg['stripInput'] = isset($stripInput) ? $stripInput : (isset($__stripInput) ? $__stripInput : $dcfg['stripInput']); + +// &stripOutput - stripOutput user function name +// Default: 'defaultStripOutput' +$cfg['stripOutput'] = isset($stripOutput) ? $stripOutput : (isset($__stripOutput) ? $__stripOutput : $dcfg['stripOutput']); + +// &breadcrumbs +// 0 : disallow the breadcrumbs link +// Name of the breadcrumbs function : allow the breadcrumbs link +// The function name could be followed by some parameter initialization +// e.g: &breadcrumbs=`Breadcrumbs,showHomeCrumb:0,showCrumbsAtHome:1` +// Default: '' - empty string +$cfg['breadcrumbs'] = isset($breadcrumbs) ? $breadcrumbs : (isset($__breadcrumbs) ? $__breadcrumbs : $dcfg['breadcrumbs']); + +// &tvPhx - display and set placeHolders for TV (template variables) +// 0 : disallow the feature +// 1 : allow the display of all Modx TVs of the document found (default) +// 'tb_alias:display_function_name[,[tb_alias:display_function_name]*]' : set up placeholders for custom joined tables +// Default: 1 - tvPhx allowed for TV only +$cfg['tvPhx'] = isset($tvPhx) ? $tvPhx : (isset($__tvPhx) ? $__tvPhx : $dcfg['tvPhx']); + +// &clearDefault - Clearing default text +// Set this to 1 if you would like to include the clear default js function +// add the class "cleardefault" to your input text form and set this parameter +// Default: 0 +$cfg['clearDefault'] = isset($clearDefault) ? $clearDefault : (isset($__clearDefault) ? $__clearDefault : $dcfg['clearDefault']); + +// &jsClearDefault - Location of the js library +// Default: AS_SPATH . 'js/clearDefault.js' +$cfg['jsClearDefault'] = $dcfg['jsClearDefault']; + +// &mbstring - php_mbstring extension available [0 | 1] +// Default: 1 - extension available +$cfg['mbstring'] = isset($mbstring) ? $mbstring : (isset($__mbstring) ? $__mbstring : $dcfg['mbstring']); + +// &asLog - ajaxSearch log [ level [: comment [: purge]]] +// level: +// 0 : disallow the ajaxSearch log (Default) +// 1 : failed search requests are logged +// 2 : all ajaxSearch requests are logged +// comment: +// 0 : user comment not allowed (Default) +// 1 : user comment allowed +// purge: number of logs allowed before to do an automatic purge of the table +// Default: 200 +$cfg['asLog'] = isset($asLog) ? $asLog : (isset($__asLog) ? $__asLog : $dcfg['asLog']); + + +//------------------------------------------------------------------------------ +// Configuration - Simple Ajax mode +//------------------------------------------------------------------------------ + +if ($cfg['ajaxSearch']) { + + // $liveSearch [1 | 0] (as passed in snippet variable ONLY) + // Set this to 1 if you would like to use the live search (i.e. results as you type) + // Default: 0 - livesearch mode inactivated + $cfg['liveSearch'] = isset($liveSearch) ? $liveSearch : (isset($__liveSearch) ? $__liveSearch : $dcfg['liveSearch']); + + // &ajaxMax [int] - The maximum number of results to show for the ajaxsearch + // Default: 6 + $cfg['ajaxMax'] = isset($ajaxMax) ? $ajaxMax : (isset($__ajaxMax) ? $__ajaxMax : $dcfg['ajaxMax']); + + // &moreResultsPage [int] + // The document id of the page you want the more results link to point to + // Default: 0 + $cfg['moreResultsPage'] = isset($moreResultsPage) ? $moreResultsPage : (isset($__moreResultsPage) ? $__moreResultsPage : $dcfg['moreResultsPage']); + + // &opacity - set the opacity of the div ajaxSearch_output + // Should be a float value: [ 0. < float <= 1. ] + // Default: 1. + $cfg['opacity'] = isset($opacity) ? $opacity : (isset($__opacity) ? $__opacity : $dcfg['opacity']); + + // &tplAjaxResults - Chunk to style the ajax output results outer + // Default: '' - empty string + $cfg['tplAjaxResults'] = isset($tplAjaxResults) ? $tplAjaxResults : (isset($__tplAjaxResults) ? $__tplAjaxResults : $dcfg['tplAjaxResults']); + + // &tplAjaxGrpResult - Chunk to style each ajax output group result outer + // Default: '' - empty string + $cfg['tplAjaxGrpResult'] = isset($tplAjaxGrpResult) ? $tplAjaxGrpResult : (isset($__tplAjaxGrpResult) ? $__tplAjaxGrpResult : $dcfg['tplAjaxGrpResult']); + + // &tplAjaxResult - Chunk to style each ajax output result + // Default: '' - empty string + $cfg['tplAjaxResult'] = isset($tplAjaxResult) ? $tplAjaxResult : (isset($__tplAjaxResult) ? $__tplAjaxResult : $dcfg['tplAjaxResult']); + + // &jscript ['jquery'|'mootools2'|'mootools'] + // Set this to jquery if you would like use the jquery library + // set mootools2 to use the version 1.2 of mootools (limited to JS functions used by AS) + // Default: 'mootools' - use the version 1.11 of mootools provided with MODx + $cfg['jscript'] = isset($jscript) ? $jscript : (isset($__jscript) ? $__jscript : $dcfg['jscript']); + + // &addJscript [1 | 0] + // Set this to 1 if you would like to include or not the mootool/jquery library in the header of your pages automatically + // Default: 1 + $cfg['addJscript'] = isset($addJscript) ? $addJscript : (isset($__addJscript) ? $__addJscript : $dcfg['addJscript']); + + // &jsMooTools - Location of the mootools javascript library (current version of MODx) + // Default: MGR_DIR.'media/script/mootools/mootools.js' + $cfg['jsMooTools'] = isset($jsMooTools) ? $jsMooTools : (isset($__jsMooTools) ? $__jsMooTools : $dcfg['jsMooTools']); + + // &jsMooTools2 - Location of an alternative mootools javascript library + // Default: AS_SPATH . 'js/mootools1.2/mootools.js' - contains only the required functions for AS + // to use an another library, use this parameter and change the ajaxSearch/js/ajaxSearch1/ajaxSearch-mootools2.js file + $cfg['jsMooTools2'] = isset($jsMooTools2) ? $jsMooTools2 : (isset($__jsMooTools2) ? $__jsMooTools2 : $dcfg['jsMooTools2']); + + // &jsQuery - Location of the jquery javascript library + // Default: AS_SPATH . 'js/jquery/jquery.js' + $cfg['jsJquery'] = isset($jsJquery) ? $jsJquery : (isset($__jsJquery) ? $__jsJquery : $dcfg['jsJquery']); +} + +// ========================================================== End of config +include_once AS_PATH . "classes/ajaxSearch.class.inc.php"; +if (class_exists('AjaxSearch')) { + $as = new AjaxSearch(); + $output = $as->run($tstart, $dcfg, $cfg); +} else { + $output = "

    error: AjaxSearch class not found

    "; +} +$elapsedTime = $modx->getMicroTime() - $tstart; +$etime = sprintf("%.4fs",$elapsedTime); +//$f=fopen('test.txt','a+');fwrite($f,"etime=".$etime."\n\n"); +return $output; \ No newline at end of file diff --git a/install/assets/plugins/searchhighlight.tpl b/install/assets/plugins/searchhighlight.tpl index eb447d76cb..19e7dd9b30 100644 --- a/install/assets/plugins/searchhighlight.tpl +++ b/install/assets/plugins/searchhighlight.tpl @@ -11,6 +11,7 @@ * @internal @modx_category Search * @internal @legacy_names Search Highlighting * @internal @installset base, sample + * @internal @disabled 1 */ /* diff --git a/install/assets/snippets/ajaxSearch.tpl b/install/assets/snippets/ajaxSearch.tpl index 13bb38b6ad..5f4411e81e 100755 --- a/install/assets/snippets/ajaxSearch.tpl +++ b/install/assets/snippets/ajaxSearch.tpl @@ -14,472 +14,5 @@ * @date 20/11/2012 * ----------------------------------------------------------------------------- */ -/** --------------------------------------------------------------------------------- -:: Preamble --------------------------------------------------------------------------------- -The release 1.9 looks like the previous release, but it is a completely -refactored development. - -It is partially based on the previous releases of AjaxSearch written by the -following authors: - - Coroico - Jason Coward - Kyle Jaebker - Ryan Thrash - --------------------------------------------------------------------------------- -:: Description --------------------------------------------------------------------------------- - - Ajax and non-Ajax search that supports results highlighting. - -This snippet adds AJAX functionality on top of the robust content searching. - -What AjaxSearch do: -- search in fields of the content an TV MODx tables -- several customizable input forms available -- search in a subset of documents -- highlighting of searchword in the results returned -- allow a filtering of search results -- displaying of search results customizable thru templates -- group the search results by categories -- filter features (allow to set up specific search forms) - -It could works in two modes: - -ajax mode : -- search results displayed in current page through AJAX request -- multiple search options including live search -- available link to view all results in a new page when only a subset is returned -- customize the number of results returned -- offer two types for paginating the results -- uses the MooTools or JQuery js library for AJAX and visual effects - -non-ajax mode : -- search results displayed in a new page or below on the same page -- offer two types for paginating the results -- works without JS enabled - -What AjaxSearch don't : -- search in dynamic content. AjaxSearch could retreive only data stored in -database. It can't find something stored in a chunk or generated by a snippet. - -MORE : See the ajaxSearch.readme.txt file for more informations. - ------------------------------------------------------------------------------ */ - -// ajaxSearch version being executed -define('AS_VERSION', '1.9.3'); -// Path where ajaxSearch is installed -define('AS_SPATH', 'assets/snippets/ajaxSearch/'); -//include snippet file -define('AS_PATH', MODX_BASE_PATH . AS_SPATH); - -//------------------------------------------------------------------------------ -// Configuration - general AjaxSearch snippet setup options -//------------------------------------------------------------------------------ -global $modx; -$tstart = $modx->getMicroTime(); - -$cfg = array(); // current configuration -$cfg['version'] = AS_VERSION; - -// Load the default configuration $dcfg to get the default values -$default = AS_PATH . 'configs/default.config.php'; -if (file_exists($default)) include $default; -else return "

    AjaxSearch error: $default not found !
    Check the existing of this file!

    "; -if (!isset($dcfg)) return "

    AjaxSearch error: default configuration array not defined in $default!
    Check the content of this file!

    "; - -if ($dcfg['version'] != AS_VERSION) return "

    AjaxSearch error: Version number mismatch. Check the content of the default configuration file!

    "; - -// check the possible use of deprecated parameters (since 1.8.5) -$readme = "ajaxSearch_version_193.txt"; -if (isset($searchWordList)) return "

    AjaxSearch error: searchWordList is a deprecated parameter. Read " . $readme . " file.

    "; -if (isset($resultsPage)) return "

    AjaxSearch error: resultsPage is a deprecated parameter. Read " . $readme . " file.

    "; -if (isset($AS_showForm)) return "

    AjaxSearch error: AS_showForm parameter has been renamed showInputForm. Read " . $readme . " file.

    "; -if (isset($AS_landing)) return "

    AjaxSearch error: AS_landing parameter has been renamed landingPage. Read " . $readme . " file.

    "; -if (isset($AS_showResults)) return "

    AjaxSearch error: AS_showResults parameter has been renamed showResults. Read " . $readme . " file.

    "; - -// Load a custom configuration file if required -// config_name - Other config installed in the configs folder or in any folder within the MODx base path via @FILE -// Configuration files should be named in the form: .config.php -// Default: '' - no custom config -$cfg['config'] = isset($config) ? $config : $dcfg['config']; -if ($cfg['config']) { - $config = $cfg['config']; - $lconfig = (substr($config, 0, 6) != "@FILE:") ? AS_PATH . "configs/$config.config.php" : $modx->config['base_path'] . trim(substr($config, 6, strlen($config)-6)); - if (file_exists($lconfig)) include $lconfig; - else return "

    AjaxSearch error: " . $lconfig . " not found !
    Check your config parameter or your config file name!

    "; -} - -// &debug = [ 0 | 1 | 2 | 3 ] -// 1,2,3 : File mode - Output logged into a file named ajaxSearch_log.txt in ajaxSearch/debug/ directory. -// this directory should be writable. -// Default: 0 - no logs -$cfg['debug'] = isset($debug) ? $debug : (isset($__debug) ? $__debug : $dcfg['debug']); - -// &timeLimit = [ int | 60 ] -// Max execution time in seconds for the AjaxSearch script -// 0 - If set to zero, no time limit is imposed -// Default: 60 - 1 minute. -$cfg['timeLimit'] = isset($timeLimit) ? $timeLimit : (isset($__timeLimit) ? $__timeLimit : $dcfg['timeLimit']); - -// &language [ language_name | manager_language ] (optional) -// Default: $modx->config['manager_language'] - manager language used -$cfg['language'] = isset($language) ? $language : (isset($__language) ? $__language : $dcfg['language']); - -// &ajaxSearch [1 | 0] (as passed in snippet variable ONLY) -// Use this to display the search results using ajax You must include the Mootools library in your template -// Default: 1 - ajax mode selected -$cfg['ajaxSearch'] = isset($ajaxSearch) ? $ajaxSearch : (isset($__ajaxSearch) ? $__ajaxSearch : $dcfg['ajaxSearch']); -// avoid the use of @FILE: prefix with ajax mode -if ((substr($cfg['config'], 0, 6) == "@FILE:") && $cfg['ajaxSearch']) - return "

    AjaxSearch error: @FILE: prefix not allowed !
    Check your config parameter or your config file name!

    "; - -// &advSearch [ 'exactphrase' | 'allwords' | 'nowords' | 'oneword' ] -// Advanced search: -// - exactphrase : provides the documents which contain the exact phrase -// - allwords : provides the documents which contain all the words -// - nowords : provides the documents which do not contain the words -// - oneword : provides the document which contain at least one word -// Default: 'oneword' -$cfg['advSearch'] = isset($advSearch) ? $advSearch : (isset($__advSearch) ? $__advSearch : $dcfg['advSearch']); - -// &asId - Unique id for AjaxSearch instance -// this allows to distinguish several Ajaxsearch instances on the same page -// Any combination of characters a-z, underscores, and numbers 0-9 -// This is case sensitive. Default = empty string -// With ajax mode, the first snippet call of the page shouldn't use the asId parameter -$cfg['asId'] = isset($asId) ? $asId : (isset($__asId) ? $__asId : $dcfg['asId']); - -// &whereSearch -// Define where should occur the search -// a separated list of keywords describing the tables where to search -// keywords allowed : -// "content" for site_content, "tv" for site_tmplvar_contentvalues, "jot" for jot_content, "maxigallery" for maxigallery -// you could add your own keywords. But the keyword should be a user function which describes the tables to use -// all the text fields are searchable but you could specify the fields like this: -// whereSearch=`content:pagetitle,introtext,content|tv:tv_value|maxigallery:gal_title` -// Default: 'content|tv' -$cfg['whereSearch'] = isset($whereSearch) ? $whereSearch : (isset($__whereSearch) ? $__whereSearch : $dcfg['whereSearch']); - -// &sites : [comma separated list of sites] -// sites allow to define sites where to do the search -$cfg['sites'] = isset($sites) ? $sites : (isset($__sites) ? $__sites : $dcfg['sites']); - -// &subSearch [comma separated list of subsites] -// subSearch allow to define sub-domains or subsites where to do the search -$cfg['subSearch'] = isset($subSearch) ? $subSearch : (isset($__subSearch) ? $__subSearch : $dcfg['subSearch']); - -// &category [ tv_name ] -// Any combination of characters a-z, underscores, and numbers 0-9 -// This is case sensitive. Default = empty string -// Name of a TV. The category of a MODx document is provided by this TV content -$cfg['category'] = isset($category) ? $category : (isset($__category) ? $__category : $dcfg['category']); - -// &display [ 'mixed' | 'unmixed' ] -// When results comes from differents sites, subsites or categories, you could choose to display the results mixed or unmixed. -// Default: unmixed -// Unmixed mode display the results grouped by site, subsite or category. Each group of results could be paginated. -// Mixed mode mixe all the results coming from the differents area. -// With unmixed mode, results are ordered by the field provided by the first field of the order parameter -$cfg['display'] = isset($display) ? $display : (isset($__display) ? $__display : $dcfg['display']); - -// &init [ 'none' | 'all' ] -// init defines if the search display all the results or none when the search term is an empty string -// Default: none -$cfg['init'] = isset($init) ? $init : (isset($__init) ? $__init : $dcfg['init']); - -// &withTvs - Define which Tvs are used for the search in Tvs -// a comma separated list of TV names -// Default: '' - all TVs are used (empty list) -$cfg['withTvs'] = isset($withTvs) ? $withTvs : (isset($__withTvs) ? $__withTvs : $dcfg['withTvs']); - -// &order - Define the sort order of results -// Comma separated list of fields defined as searchable in the table definition -// to suppress the sorting, use &order=`` -// Default: 'pub_date,pagetitle' -$cfg['order'] = isset($order) ? $order : (isset($__order) ? $__order : $dcfg['order']); - -// &rank - Define the rank of search results. Results are sorted by rank value -// Comma separated list of fields with optionally user defined weight -// Default: 'pagetitle:100,extract' -// to suppress the rank sorting, use &rank=``; -// &rank sort occurs after the &order sort -$cfg['rank'] = isset($rank) ? $rank : (isset($__rank) ? $__rank : $dcfg['rank']); - -// &maxWords [ 1 < int < 10 ] -// Maximum number of words for searching -// Default: 5 -$cfg['maxWords'] = isset($maxWords) ? intval($maxWords) : (isset($__maxWords) ? intval($__maxWords) : $dcfg['maxWords']); - -// &minChars [ 2 < int < 100 ] -// Minimum number of characters to require for a word to be valid for searching. -// length of each word with $advSearch = 'allwords', 'oneword' or 'nowords' -// length of the search string with possible spaces with $advSearch = 'exactphrase' -// Default: 3 -$cfg['minChars'] = isset($minChars) ? intval($minChars) : (isset($__minChars) ? intval($__minChars) : $dcfg['minChars']); - -// &showInputForm [0 | 1] -// If you would like to turn off the search form when showing results you can set this to false.(1=true, 0=false) -// Default: 1 -$cfg['showInputForm'] = isset($showInputForm) ? $showInputForm : (isset($__showInputForm) ? $__showInputForm : $dcfg['showInputForm']); - -// &showIntro [0 | 1] -// If you would like to turn off the intro message beyond the input form you can set this to false.(1=true, 0=false) -// Default: 1 -$cfg['showIntro'] = isset($showIntro) ? $showIntro : (isset($__showIntro) ? $__showIntro : $dcfg['showIntro']); - -// &grabMax [ int ] -// Set to the max number of records you would like on each page. Set to 0 if unlimited. -// Default: 10 -$cfg['grabMax'] = isset($grabMax) ? intval($grabMax) : (isset($__grabMax) ? intval($__grabMax) : $dcfg['grabMax']); - -// &extract [ n:searchable fields list | 1:content,description,introtext,tv_content] -// show the search terms highlighted in a little extract -// n : maximum number of extracts displayed -// ordered searchable fields list : separated list of fields define as searchable in the table definition -// Default: '1:content,description,introtext,tv_value' - One extract from content then description,introtext,tv_value -$cfg['extract'] = isset($extract) ? $extract : (isset($__extract) ? $__extract : $dcfg['extract']); - -// &extractLength [ 50 < int < 800] -// Length of extract around the search words found - between 50 and 800 characters -// Default: 200 -$cfg['extractLength'] = isset($extractLength) ? intval($extractLength) : (isset($__extractLength) ? intval($__extractLength) : $dcfg['extractLength']); - -// &extractEllips [ string ] -// Ellipside to mark the star and the end of an extract when the sentence is cutting -// Default: '...' -$cfg['extractEllips'] = isset($extractEllips) ? $extractEllips : (isset($__extractEllips) ? $__extractEllips : $dcfg['extractEllips']); - -// &extractSeparator [ string ] -// Any html tag to mark the separation between extracts -// Default: '
    ' - but you could also choose for instance '
    ' -$cfg['extractSeparator'] = isset($extractSeparator) ? $extractSeparator : (isset($__extractSeparator) ? $__extractSeparator : $dcfg['extractSeparator']); - -// &formatDate [ string ] -// The format of outputted dates. See http://www.php.net/manual/en/function.date.php -// Default: 'd/m/y : H:i:s' - e.g: 21/01/08 : 23:09:22 -$cfg['formatDate'] = isset($formatDate) ? $formatDate : (isset($__formatDate) ? $__formatDate : $dcfg['formatDate']); - -// &highlightResult [1 | 0] -// create links so that search terms will be highlighted when linked page clicked -// Default: 1 - Results highlighted -$cfg['highlightResult'] = isset($highlightResult) ? $highlightResult : (isset($__highlightResult) ? $__highlightResult : $dcfg['highlightResult']); - -// &pagingType[ 0 | 1 | 2 ] -// Determine the pagination type used - Default 1 : Previous - X-Y/Z - Next -$cfg['pagingType'] = isset($pagingType) ? $pagingType : (isset($__pagingType) ? $__pagingType : $dcfg['pagingType']); - -// &pageLinkSeparator [ string ] -// What you want, if anything, between your page link numbers -// Default: ' | ' -$cfg['pageLinkSeparator'] = isset($pageLinkSeparator) ? $pageLinkSeparator : (isset($__pageLinkSeparator) ? $__pageLinkSeparator : $dcfg['pageLinkSeparator']); - -// &showPagingAlways[1 | 0] -// Determine whether or not to always show paging -$cfg['showPagingAlways'] = isset($showPagingAlways) ? $showPagingAlways : (isset($__showPagingAlways) ? $__showPagingAlways : $dcfg['showPagingAlways']); - -// &landingPage [int] set the page to show the results page (non Ajax search) -// Default: false -$cfg['landingPage'] = isset($landingPage) ? $landingPage : (isset($__landingPage) ? $__landingPage : $dcfg['landingPage']); - -// &showResults [1 | 0] establish whether to show the results or not -// Default: 1 -$cfg['showResults'] = isset($showResults) ? $showResults : (isset($__showResults) ? $__showResults : $dcfg['showResults']); - -// &parents [ [ in | not in ] : comma separated list of Ids | '' ] -// Ids of documents to retrieve their children to &depth depth where to do the search in or not in -// Default: '' - empty list -$cfg['parents'] = isset($parents) ? $parents : (isset($__parents) ? $__parents : $dcfg['parents']); - -// &documents [ [ in | not in ] : comma separated list of Ids | '' ] -// Ids of documents where to do the search in or not in -// Default: '' - empty list -$cfg['documents'] = isset($documents) ? $documents : (isset($__documents) ? $__documents : $dcfg['documents']); - -// &depth [ 0 < int ] Number of levels deep to retrieve documents -// Default: 10 -$cfg['depth'] = isset($depth) ? intval($depth) : (isset($__depth) ? intval($__depth) : $dcfg['depth']); - -// &hideMenu [0 | 1| 2] Search in hidden documents from menu. -// 0 - search only in documents visible from menu -// 1 - search only in documents hidden from menu -// 2 - search in hidden or visible documents from menu -// Default: 2 -$cfg['hideMenu'] = isset($hideMenu) ? $hideMenu : (isset($__hideMenu) ? $__hideMenu : $dcfg['hideMenu']); - -// &hideLink [0 | 1 ] Search in content of type reference (link) -// 0 - search in content of type document AND reference -// 1 - search only in content of type document -// Default: 1 -$cfg['hideLink'] = isset($hideLink) ? $hideLink : (isset($__hideLink) ? $__hideLink : $dcfg['hideLink']); - -// &filter - Basic filtering : remove unwanted documents that meets the criteria of the filter -// See Ditto 2 Basic filtering and the ajaxSearch demo site for more information -// Default: '' - empty list -$cfg['filter'] = isset($filter) ? $filter : (isset($__filter) ? $__filter : $dcfg['filter']); - -// &output [0 | 1 ]Custom layout -// Default: 0 - Results are listed just under the input form -// 1 - custom layout. put [+as.inputForm+] and [+as.results+] where you want to define the layout -$cfg['output'] = isset($output) ? $output : (isset($__output) ? $__output : $dcfg['output']); - -// &tplInput - Chunk to style the ajaxSearch input form -// Default: '@FILE:' . AS_SPATH . 'templates/input.tpl.html' -$cfg['tplInput'] = isset($tplInput) ? $tplInput : (isset($__tplInput) ? $__tplInput : $dcfg['tplInput']); - -// &tplResults - Chunk to style the non-ajax output results outer -// Default: '@FILE:' . AS_SPATH . 'templates/results.tpl.html' -$cfg['tplResults'] = isset($tplResults) ? $tplResults : (isset($__tplResults) ? $__tplResults : $dcfg['tplResults']); - -// &tplGrpResult - Chunk to style the non-ajax output group result outer -// Default: '@FILE:' . AS_SPATH . 'templates/grpResult.tpl.html' -$cfg['tplGrpResult'] = isset($tplGrpResult) ? $tplGrpResult : (isset($__tplGrpResult) ? $__tplGrpResult : $dcfg['tplGrpResult']); - -// &tplResult - Chunk to style each output result -// Default: "@FILE:" . AS_SPATH . 'templates/result.tpl.html' -$cfg['tplResult'] = isset($tplResult) ? $tplResult : (isset($__tplResult) ? $__tplResult : $dcfg['tplResult']); - -// &tplComment - Chunk to style the comment form (Also used with the ajax mode) -// Default: '@FILE:' . AS_SPATH . 'templates/comment.tpl.html' -$cfg['tplComment'] = isset($tplComment) ? $tplComment : (isset($__tplComment) ? $__tplComment : $dcfg['tplComment']); - -// &tplPaging0 - Chunk to style the paging links - type 0 -// Default: '@FILE:' . AS_SPATH . 'templates/paging0.tpl.html' -$cfg['tplPaging0'] = isset($tplPaging0) ? $tplPaging0 : (isset($__tplPaging0) ? $__tplPaging0 : $dcfg['tplPaging0']); - -// &tplPaging1 - Chunk to style the paging links - type 1 -// Default: '@FILE:' . AS_SPATH . 'templates/paging1.tpl.html' -$cfg['tplPaging1'] = isset($tplPaging1) ? $tplPaging1 : (isset($__tplPaging1) ? $__tplPaging1 : $dcfg['tplPaging1']); - -// &tplPaging2 - Chunk to style the paging links - type 2 -// Default: '@FILE:' . AS_SPATH . 'templates/paging2.tpl.html' -$cfg['tplPaging2'] = isset($tplPaging2) ? $tplPaging2 : (isset($__tplPaging2) ? $__tplPaging2 : $dcfg['tplPaging2']); - -// &stripInput - stripInput user function name -// Default: 'defaultStripInput' -$cfg['stripInput'] = isset($stripInput) ? $stripInput : (isset($__stripInput) ? $__stripInput : $dcfg['stripInput']); - -// &stripOutput - stripOutput user function name -// Default: 'defaultStripOutput' -$cfg['stripOutput'] = isset($stripOutput) ? $stripOutput : (isset($__stripOutput) ? $__stripOutput : $dcfg['stripOutput']); - -// &breadcrumbs -// 0 : disallow the breadcrumbs link -// Name of the breadcrumbs function : allow the breadcrumbs link -// The function name could be followed by some parameter initialization -// e.g: &breadcrumbs=`Breadcrumbs,showHomeCrumb:0,showCrumbsAtHome:1` -// Default: '' - empty string -$cfg['breadcrumbs'] = isset($breadcrumbs) ? $breadcrumbs : (isset($__breadcrumbs) ? $__breadcrumbs : $dcfg['breadcrumbs']); - -// &tvPhx - display and set placeHolders for TV (template variables) -// 0 : disallow the feature -// 1 : allow the display of all Modx TVs of the document found (default) -// 'tb_alias:display_function_name[,[tb_alias:display_function_name]*]' : set up placeholders for custom joined tables -// Default: 1 - tvPhx allowed for TV only -$cfg['tvPhx'] = isset($tvPhx) ? $tvPhx : (isset($__tvPhx) ? $__tvPhx : $dcfg['tvPhx']); - -// &clearDefault - Clearing default text -// Set this to 1 if you would like to include the clear default js function -// add the class "cleardefault" to your input text form and set this parameter -// Default: 0 -$cfg['clearDefault'] = isset($clearDefault) ? $clearDefault : (isset($__clearDefault) ? $__clearDefault : $dcfg['clearDefault']); - -// &jsClearDefault - Location of the js library -// Default: AS_SPATH . 'js/clearDefault.js' -$cfg['jsClearDefault'] = $dcfg['jsClearDefault']; - -// &mbstring - php_mbstring extension available [0 | 1] -// Default: 1 - extension available -$cfg['mbstring'] = isset($mbstring) ? $mbstring : (isset($__mbstring) ? $__mbstring : $dcfg['mbstring']); - -// &asLog - ajaxSearch log [ level [: comment [: purge]]] -// level: -// 0 : disallow the ajaxSearch log (Default) -// 1 : failed search requests are logged -// 2 : all ajaxSearch requests are logged -// comment: -// 0 : user comment not allowed (Default) -// 1 : user comment allowed -// purge: number of logs allowed before to do an automatic purge of the table -// Default: 200 -$cfg['asLog'] = isset($asLog) ? $asLog : (isset($__asLog) ? $__asLog : $dcfg['asLog']); - - -//------------------------------------------------------------------------------ -// Configuration - Simple Ajax mode -//------------------------------------------------------------------------------ - -if ($cfg['ajaxSearch']) { - - // $liveSearch [1 | 0] (as passed in snippet variable ONLY) - // Set this to 1 if you would like to use the live search (i.e. results as you type) - // Default: 0 - livesearch mode inactivated - $cfg['liveSearch'] = isset($liveSearch) ? $liveSearch : (isset($__liveSearch) ? $__liveSearch : $dcfg['liveSearch']); - - // &ajaxMax [int] - The maximum number of results to show for the ajaxsearch - // Default: 6 - $cfg['ajaxMax'] = isset($ajaxMax) ? $ajaxMax : (isset($__ajaxMax) ? $__ajaxMax : $dcfg['ajaxMax']); - - // &moreResultsPage [int] - // The document id of the page you want the more results link to point to - // Default: 0 - $cfg['moreResultsPage'] = isset($moreResultsPage) ? $moreResultsPage : (isset($__moreResultsPage) ? $__moreResultsPage : $dcfg['moreResultsPage']); - - // &opacity - set the opacity of the div ajaxSearch_output - // Should be a float value: [ 0. < float <= 1. ] - // Default: 1. - $cfg['opacity'] = isset($opacity) ? $opacity : (isset($__opacity) ? $__opacity : $dcfg['opacity']); - - // &tplAjaxResults - Chunk to style the ajax output results outer - // Default: '' - empty string - $cfg['tplAjaxResults'] = isset($tplAjaxResults) ? $tplAjaxResults : (isset($__tplAjaxResults) ? $__tplAjaxResults : $dcfg['tplAjaxResults']); - - // &tplAjaxGrpResult - Chunk to style each ajax output group result outer - // Default: '' - empty string - $cfg['tplAjaxGrpResult'] = isset($tplAjaxGrpResult) ? $tplAjaxGrpResult : (isset($__tplAjaxGrpResult) ? $__tplAjaxGrpResult : $dcfg['tplAjaxGrpResult']); - - // &tplAjaxResult - Chunk to style each ajax output result - // Default: '' - empty string - $cfg['tplAjaxResult'] = isset($tplAjaxResult) ? $tplAjaxResult : (isset($__tplAjaxResult) ? $__tplAjaxResult : $dcfg['tplAjaxResult']); - - // &jscript ['jquery'|'mootools2'|'mootools'] - // Set this to jquery if you would like use the jquery library - // set mootools2 to use the version 1.2 of mootools (limited to JS functions used by AS) - // Default: 'mootools' - use the version 1.11 of mootools provided with MODx - $cfg['jscript'] = isset($jscript) ? $jscript : (isset($__jscript) ? $__jscript : $dcfg['jscript']); - - // &addJscript [1 | 0] - // Set this to 1 if you would like to include or not the mootool/jquery library in the header of your pages automatically - // Default: 1 - $cfg['addJscript'] = isset($addJscript) ? $addJscript : (isset($__addJscript) ? $__addJscript : $dcfg['addJscript']); - - // &jsMooTools - Location of the mootools javascript library (current version of MODx) - // Default: MGR_DIR.'media/script/mootools/mootools.js' - $cfg['jsMooTools'] = isset($jsMooTools) ? $jsMooTools : (isset($__jsMooTools) ? $__jsMooTools : $dcfg['jsMooTools']); - - // &jsMooTools2 - Location of an alternative mootools javascript library - // Default: AS_SPATH . 'js/mootools1.2/mootools.js' - contains only the required functions for AS - // to use an another library, use this parameter and change the ajaxSearch/js/ajaxSearch1/ajaxSearch-mootools2.js file - $cfg['jsMooTools2'] = isset($jsMooTools2) ? $jsMooTools2 : (isset($__jsMooTools2) ? $__jsMooTools2 : $dcfg['jsMooTools2']); - - // &jsQuery - Location of the jquery javascript library - // Default: AS_SPATH . 'js/jquery/jquery.js' - $cfg['jsJquery'] = isset($jsJquery) ? $jsJquery : (isset($__jsJquery) ? $__jsJquery : $dcfg['jsJquery']); -} - -// ========================================================== End of config -include_once AS_PATH . "classes/ajaxSearch.class.inc.php"; -if (class_exists('AjaxSearch')) { - $as = new AjaxSearch(); - $output = $as->run($tstart, $dcfg, $cfg); -} else { - $output = "

    error: AjaxSearch class not found

    "; -} -$elapsedTime = $modx->getMicroTime() - $tstart; -$etime = sprintf("%.4fs",$elapsedTime); -//$f=fopen('test.txt','a+');fwrite($f,"etime=".$etime."\n\n"); -return $output; \ No newline at end of file + +return require MODX_BASE_PATH.'assets/snippets/ajaxSearch/snippet.ajaxSearch.php'; \ No newline at end of file From a8604ef8f6f2b1822729245382021f54cdf963ac Mon Sep 17 00:00:00 2001 From: Dmi3yy Date: Sun, 11 Aug 2013 09:12:59 +0300 Subject: [PATCH 225/530] Refactor #10071 breadcrumbs --- .../breadcrumbs/snippet.breadcrumbs.php | 302 +++++++++++ install/assets/snippets/breadcrumbs.tpl | 477 +----------------- 2 files changed, 303 insertions(+), 476 deletions(-) create mode 100644 assets/snippets/breadcrumbs/snippet.breadcrumbs.php diff --git a/assets/snippets/breadcrumbs/snippet.breadcrumbs.php b/assets/snippets/breadcrumbs/snippet.breadcrumbs.php new file mode 100644 index 0000000000..0a2046d1dc --- /dev/null +++ b/assets/snippets/breadcrumbs/snippet.breadcrumbs.php @@ -0,0 +1,302 @@ +config['site_start']; +( isset($homeCrumbTitle) ) ? $homeCrumbTitle : $homeCrumbTitle = ''; +( isset($homeCrumbDescription) ) ? $homeCrumbDescription : $homeCrumbDescription = ''; +( isset($showCrumbsAtHome) ) ? $showCrumbsAtHome : $showCrumbsAtHome = 0; +( isset($hideOn) ) ? $hideOn : $hideOn = ''; +( isset($hideUnder) ) ? $hideUnder : $hideUnder = ''; +( isset($stopIds) ) ? $stopIds : $stopIds = ''; +( isset($ignoreIds) ) ? $ignoreids : $ignoreids = ''; +( isset($crumbSeparator) ) ? $separator = $crumbSeparator : $separator = ' » '; +( isset($separator) ) ? $separator : $separator = ' » '; +$templates = array( + 'defaultString' => array( + 'crumb' => '[+crumb+]', + 'separator' => ' '.$separator.' ', + 'crumbContainer' => '[+crumbs+]', + 'lastCrumbWrapper' => '[+lastCrumbSpanA+]', + 'firstCrumbWrapper' => '[+firstCrumbSpanA+]' + ), + 'defaultList' => array( + 'crumb' => '
  • [+crumb+]
  • ', + 'separator' => '', + 'crumbContainer' => '
      [+crumbs+]
    ', + 'lastCrumbWrapper' => '[+lastCrumbSpanA+]', + 'firstCrumbWrapper' => '[+firstCrumbSpanA+]' + ), +); +// Return blank if necessary: on home page +if ( !$showCrumbsAtHome && $homeId == $modx->documentObject['id'] ) +{ + return ''; +} +// Return blank if necessary: specified pages +if ( $hideOn || $hideUnder ) +{ + // Create array of hide pages + $hideOn = str_replace(' ','',$hideOn); + $hideOn = explode(',',$hideOn); + + // Get more hide pages based on parents if needed + if ( $hideUnder ) + { + $hiddenKids = array(); + // Get child pages to hide + $hideKidsQuery = $modx->db->select('id',$modx->getFullTableName("site_content"),"parent IN ($hideUnder)"); + while ( $hideKid = $modx->db->getRow($hideKidsQuery) ) + { + $hiddenKids[] = $hideKid['id']; + } + // Merge with hideOn pages + $hideOn = array_merge($hideOn,$hiddenKids); + } + + if ( in_array($modx->documentObject['id'],$hideOn) ) + { + return ''; + } + +} +// Initialize ------------------------------------------------------------------ +// Put certain parameters in arrays +$stopIds = str_replace(' ','',$stopIds); +$stopIds = explode(',',$stopIds); +$linkTextField = str_replace(' ','',$linkTextField); +$linkTextField = explode(',',$linkTextField); +$linkDescField = str_replace(' ','',$linkDescField); +$linkDescField = explode(',',$linkDescField); +$ignoreIds = str_replace(' ','',$ignoreIds); +$ignoreIds = explode(',',$ignoreIds); + +/* $crumbs + * Crumb elements are: id, parent, pagetitle, longtitle, menutitle, description, + * published, hidemenu + */ +$crumbs = array(); +$parent = $modx->documentObject['parent']; +$output = ''; +$maxCrumbs += ($showCurrentCrumb) ? 1 : 0; + +// Replace || in snippet parameters that accept them with = +$crumbGap = str_replace('||','=',$crumbGap); + +// Curent crumb ---------------------------------------------------------------- + +// Decide if current page is to be a crumb +if ( $showCurrentCrumb ) +{ + $crumbs[] = array( + 'id' => $modx->documentObject['id'], + 'parent' => $modx->documentObject['parent'], + 'pagetitle' => $modx->documentObject['pagetitle'], + 'longtitle' => $modx->documentObject['longtitle'], + 'menutitle' => $modx->documentObject['menutitle'], + 'description' => $modx->documentObject['description']); +} + +// Intermediate crumbs --------------------------------------------------------- + + +// Iterate through parents till we hit root or a reason to stop +$loopSafety = 0; +while ( $parent && $parent!=$modx->config['site_start'] && $loopSafety < 1000 ) +{ + // Get next crumb + $tempCrumb = $modx->getPageInfo($parent,0,"id,parent,pagetitle,longtitle,menutitle,description,published,hidemenu"); + + // Check for include conditions & add to crumbs + if ( + $tempCrumb['published'] && + ( !$tempCrumb['hidemenu'] || !$respectHidemenu ) && + !in_array($tempCrumb['id'],$ignoreIds) + ) + { + // Add crumb + $crumbs[] = array( + 'id' => $tempCrumb['id'], + 'parent' => $tempCrumb['parent'], + 'pagetitle' => $tempCrumb['pagetitle'], + 'longtitle' => $tempCrumb['longtitle'], + 'menutitle' => $tempCrumb['menutitle'], + 'description' => $tempCrumb['description']); + } + + // Check stop conditions + if ( + in_array($tempCrumb['id'],$stopIds) || // Is one of the stop IDs + !$tempCrumb['parent'] || // At root + ( !$tempCrumb['published'] && !$pathThruUnPub ) // Unpublished + ) + { + // Halt making crumbs + break; + } + + // Reset parent + $parent = $tempCrumb['parent']; + + // Increment loop safety + $loopSafety++; +} + +// Home crumb ------------------------------------------------------------------ + +if ( $showHomeCrumb && $homeId != $modx->documentObject['id'] && $homeCrumb = $modx->getPageInfo($homeId,0,"id,parent,pagetitle,longtitle,menutitle,description,published,hidemenu") ) +{ + $crumbs[] = array( + 'id' => $homeCrumb['id'], + 'parent' => $homeCrumb['parent'], + 'pagetitle' => $homeCrumb['pagetitle'], + 'longtitle' => $homeCrumb['longtitle'], + 'menutitle' => $homeCrumb['menutitle'], + 'description' => $homeCrumb['description']); +} + + +// Process each crumb ---------------------------------------------------------- +$pretemplateCrumbs = array(); + +foreach ( $crumbs as $c ) +{ + + // Skip if we've exceeded our crumb limit but we're waiting to get to home + if ( count($pretemplateCrumbs) > $maxCrumbs && $c['id'] != $homeId ) + { + continue; + } + + $text = ''; + $title = ''; + $pretemplateCrumb = ''; + + // Determine appropriate span/link text: home link specified + if ( $c['id'] == $homeId && $homeCrumbTitle ) + { + $text = $homeCrumbTitle; + } + else + // Determine appropriate span/link text: home link not specified + { + for ($i = 0; !$text && $i < count($linkTextField); $i++) + { + if ( $c[$linkTextField[$i]] ) + { + $text = $c[$linkTextField[$i]]; + } + } + } + + // Determine link/span class(es) + if ( $c['id'] == $homeId ) + { + $crumbClass = $stylePrefix.'homeCrumb'; + } + else if ( $modx->documentObject['id'] == $c['id'] ) + { + $crumbClass = $stylePrefix.'currentCrumb'; + } + else + { + $crumbClass = $stylePrefix.'crumb'; + } + + // Make link + if ( + ( $c['id'] != $modx->documentObject['id'] && $showCrumbsAsLinks ) || + ( $c['id'] == $modx->documentObject['id'] && $currentAsLink ) + ) + { + // Determine appropriate title for link: home link specified + if ( $c['id'] == $homeId && $homeCrumbDescription ) + { + $title = htmlspecialchars($homeCrumbDescription); + } + else + // Determine appropriate title for link: home link not specified + { + for ($i = 0; !$title && $i < count($linkDescField); $i++) + { + if ( $c[$linkDescField[$i]] ) + { + $title = htmlspecialchars($c[$linkDescField[$i]]); + } + } + } + + + $pretemplateCrumb .= ''.$text.''; + } + else + // Make a span instead of a link + { + $pretemplateCrumb .= ''.$text.''; + } + + // Add crumb to pretemplate crumb array + $pretemplateCrumbs[] = $pretemplateCrumb; + + // If we have hit the crumb limit + if ( count($pretemplateCrumbs) == $maxCrumbs ) + { + if ( count($crumbs) > ($maxCrumbs + (($showHomeCrumb) ? 1 : 0)) ) + { + // Add gap + $pretemplateCrumbs[] = ''.$crumbGap.''; + } + + // Stop here if we're not looking for the home crumb + if ( !$showHomeCrumb ) + { + break; + } + } +} + +// Put in correct order for output +$pretemplateCrumbs = array_reverse($pretemplateCrumbs); + +// Wrap first/last spans +$pretemplateCrumbs[0] = str_replace( + array('[+firstCrumbClass+]','[+firstCrumbSpanA+]'), + array($stylePrefix.'firstCrumb',$pretemplateCrumbs[0]), + $templates[$templateSet]['firstCrumbWrapper'] +); +$pretemplateCrumbs[(count($pretemplateCrumbs)-1)] = str_replace( + array('[+lastCrumbClass+]','[+lastCrumbSpanA+]'), + array($stylePrefix.'lastCrumb',$pretemplateCrumbs[(count($pretemplateCrumbs)-1)]), + $templates[$templateSet]['lastCrumbWrapper'] +); + +// Insert crumbs into crumb template +$processedCrumbs = array(); +foreach ( $pretemplateCrumbs as $pc ) +{ + $processedCrumbs[] = str_replace('[+crumb+]',$pc,$templates[$templateSet]['crumb']); +} + +// Combine crumbs together into one string with separator +$processedCrumbs = implode($templates[$templateSet]['separator'],$processedCrumbs); + +// Put crumbs into crumb container template +$container = str_replace( + array('[+crumbBoxClass+]','[+crumbs+]'), + array($stylePrefix.'crumbBox',$processedCrumbs), + $templates[$templateSet]['crumbContainer'] + ); + +// Return crumbs +return $container; +?> \ No newline at end of file diff --git a/install/assets/snippets/breadcrumbs.tpl b/install/assets/snippets/breadcrumbs.tpl index 4c7478842a..db388e402f 100644 --- a/install/assets/snippets/breadcrumbs.tpl +++ b/install/assets/snippets/breadcrumbs.tpl @@ -12,479 +12,4 @@ * @internal @installset base, sample */ -/* - * This snippet shows the path through the various levels of site structure. It - * is NOT necessarily the path the user took to arrive at a given page. - */ - -/* ----------------------------------------------------------------------------- - * CONFIGURATION - * ----------------------------------------------------------------------------- - * This section contains brief explanations of the available parameters. - */ - -/* General setup - * ----------------------------------------------------------------------------- - */ - -/* $maxCrumbs [ integer ] - * Max number of elemetns to have in a breadcrumb path. The default 100 is an - * arbitrarily high number that will essentially include everything. If you were - * to set it to 2, and you were 5 levels deep, it would appear like: - * HOME > ... > Level 3 > Level 4 > CURRENT PAGE - * It should be noted that the "home" link, and the current page do not count as - * they are managed by their own configuration settings. - */ -( isset($maxCrumbs) ) ? $maxCrumbs : $maxCrumbs = 100; - -/* $pathThruUnPub [ 1 | 0 ] - * When your path includes an unpublished folder, setting this to 1 (true) will - * show all documents in path EXCEPT the unpublished. When set to 0 (false), the - * path will not go "through" that unpublished folder and will stop there. - */ -( isset($pathThruUnPub) ) ? $pathThruUnPub : $pathThruUnPub = 1; - -/* $respectHidemenu [ 0 | 1 ] - * Setting this to 1 (true) will respect the hidemenu setting of the document - * and not include it in trail. - */ -( isset($respectHidemenu) ) ? (int)$respectHidemenu : $respectHidemenu = 1; - -/* $showCurrentCrumb [ 1 | 0 ] - * Include the current page at the end of the trail. On by default. - */ -( isset($showCurrentCrumb) ) ? $showCurrentCrumb : $showCurrentCrumb = 1; - -/* $currentAsLink [ 1 | 0 ] - * If the current page is included, this parameter will show it as a link (1) or - * just plain text (0). - */ -( $currentAsLink ) ? $currentAsLink : $currentAsLink = 0; - -/* $linkTextField [ string ] - * Prioritized list of fields to use as link text. Options are: pagetitle, - * longtitle, description, menutitle. The first of these fields that has a value - * will be the title. - */ -( isset($linkTextField) ) ? $linkTextField : $linkTextField = 'menutitle,pagetitle,longtitle'; - -/* $linkDescField [ string ] - * Prioritized list of fields to use as link title text. Options are: pagetitle, - * longtitle, description, menutitle. The first of these fields that has a value - * will be the title. - */ -( isset($linkDescField) ) ? $linkDescField : $linkDescField = 'description,longtitle,pagetitle,menutitle'; - -/* $showCrumbsAsLinks [ 1 | 0 ] - * If for some reason you want breadcrumbs to be text and not links, set to 0 - * (false). - */ -( isset($showCrumbsAsLinks) ) ? $showCrumbsAsLinks : $showCrumbsAsLinks = 1; - -/* $templateSet [ string ] - * The set of templates you'd like to use. (Templates are defined below.) It - * will default to defaultString which replicates the output of previous - * versions. - */ -( isset($templateSet) ) ? $templateSet : $templateSet = 'defaultString'; - -/* $crumbGap [ string ] - * String to be shown to represent gap if there are more crumbs in trail than - * can be shown. Note: if you would like to use an image, the entire image tag - * must be provided. When making a snippet call, you cannot use "=", so use "||" - * instead and it will be converted for you. - */ -( isset($crumbGap) ) ? $crumbGap : $crumbGap = '...'; - -/* $stylePrefix [ string ] - * Breadcrumbs will add style classes to various parts of the trail. To avoid - * class name conflicts, you can determine your own prefix. The following - * classes will be attached: - * crumbBox: Span that surrounds all crumb output - * hideCrumb: Span that surrounds the "..." if there are more crumbs than will - * be shown - * currentCrumb: Span or A tag surrounding the current crumb - * firstCrumb: Span that will be applied to first crumb, whether it is "home" or - * not - * lastCrumb: Span surrounding last crumb, whether it is the current page or - * not - * crumb: Class given to each A tag surrounding the intermediate crumbs (not - * "home", "current", or "hide") - * homeCrumb: Class given to the home crumb - */ -( isset($stylePrefix) ) ? $stylePrefix : $stylePrefix = 'B_'; - - - -/* Home link parameters - * ----------------------------------------------------------------------------- - * The home link is unique. It is a link that can be placed at the head of the - * breadcrumb trail, even if it is not truly in the hierarchy. - */ - -/* $showHomeCrumb [ 1 | 0 ] - * This toggles the "home" crumb to be added to the beginning of your trail. - */ -( isset($showHomeCrumb) ) ? $showHomeCrumb : $showHomeCrumb = 1; - -/* $homeId [ integer ] - * Usually the page designated as "site start" in MODx configuration is - * considered the home page. But if you would like to use some other document, - * you may explicitly define it. - */ -( isset($homeId) ) ? (int)$homeId : $homeId = $modx->config['site_start']; - -/* $homeCrumbTitle [ string ] - * If you'd like to use something other than the menutitle (or pagetitle) for - * the home link. - */ -( isset($homeCrumbTitle) ) ? $homeCrumbTitle : $homeCrumbTitle = ''; - -/* $homeCrumbDescription [ string ] - * If you'd like to use a custom description (link title) on the home link. If - * left blank, the title will follow the title order set in $titleField. - */ -( isset($homeCrumbDescription) ) ? $homeCrumbDescription : $homeCrumbDescription = ''; - - -/* Custom behaviors - * ----------------------------------------------------------------------------- - * The following parameters will alter the behavior of the Breadcrumbs based on - * the page it is on. - */ - -/* $showCrumbsAtHome [ 1 | 0 ] - * You can turn off Breadcrumbs all together on the home page by setting this to - * 1 (true); - */ -( isset($showCrumbsAtHome) ) ? $showCrumbsAtHome : $showCrumbsAtHome = 0; - -/* $hideOn [ string ] - * Comma separated list of documents you don't want Breadcrumbs on at all. If - * you have a LOT of pages like this, you might try $hideUnder or use another - * template. This parameter is best for those rare odd balls - otherwise it will - * become a pain to manage. - */ -( isset($hideOn) ) ? $hideOn : $hideOn = ''; - -/* $hideUnder [ string ] - * Comma separated list of parent documents, whose CHILDREN you don't want - * Breadcrumbs to appear on at all. This enables you to hide Breadcrumbs on a - * whole folders worth of documents by specifying the parent only. The PARENT - * will not have Breadcrumbs hidden however. If you wanted to hide the parent - * and the children, put the parent ID in hideUnder AND hideOn. - */ -( isset($hideUnder) ) ? $hideUnder : $hideUnder = ''; - -/* $stopIds [ string ] - * Comma separated list of document IDs that when reached, stops Breadcrumbs - * from going any further. This is useful in situations like where you have - * language branches, and you don't want the Breadcrumbs going past the "home" - * of the language you're in. - */ -( isset($stopIds) ) ? $stopIds : $stopIds = ''; - -/* $ignoreIds [ string ] - * Comma separated list of document IDs to explicitly ignore. - */ -( isset($ignoreIds) ) ? $ignoreids : $ignoreids = ''; - -/* $crumbSeparator [ string ] - * The set of templates you'd like to use for crumbSeparator. - */ -( isset($crumbSeparator) ) ? $crumbSeparator : $crumbSeparator = '»'; - -/* Templates - * ----------------------------------------------------------------------------- - * In an effort to keep the MODx chunks manager from getting mired down in lots - * of templates, Breadcrumbs templates are included here. Two sets are provided - * prefixed with defaultString, and defaultList. You can create as many more as - * you like, each set with it's own prefix - */ -$templates = array( - 'defaultString' => array( - 'crumb' => '[+crumb+]', - 'separator' => ' '.$crumbSeparator.' ', - 'crumbContainer' => '[+crumbs+]', - 'lastCrumbWrapper' => '[+lastCrumbSpanA+]', - 'firstCrumbWrapper' => '[+firstCrumbSpanA+]' - ), - 'defaultList' => array( - 'crumb' => '
  • [+crumb+]
  • ', - 'separator' => '', - 'crumbContainer' => '
      [+crumbs+]
    ', - 'lastCrumbWrapper' => '[+lastCrumbSpanA+]', - 'firstCrumbWrapper' => '[+firstCrumbSpanA+]' - ), -); - - -/* ----------------------------------------------------------------------------- - * END CONFIGURATION - * ----------------------------------------------------------------------------- - */ - -// Return blank if necessary: on home page -if ( !$showCrumbsAtHome && $homeId == $modx->documentObject['id'] ) -{ - return ''; -} -// Return blank if necessary: specified pages -if ( $hideOn || $hideUnder ) -{ - // Create array of hide pages - $hideOn = str_replace(' ','',$hideOn); - $hideOn = explode(',',$hideOn); - - // Get more hide pages based on parents if needed - if ( $hideUnder ) - { - $hiddenKids = array(); - // Get child pages to hide - $hideKidsQuery = $modx->db->select('id',$modx->getFullTableName("site_content"),"parent IN ($hideUnder)"); - while ( $hideKid = $modx->db->getRow($hideKidsQuery) ) - { - $hiddenKids[] = $hideKid['id']; - } - // Merge with hideOn pages - $hideOn = array_merge($hideOn,$hiddenKids); - } - - if ( in_array($modx->documentObject['id'],$hideOn) ) - { - return ''; - } - -} - - -// Initialize ------------------------------------------------------------------ - -// Put certain parameters in arrays -$stopIds = str_replace(' ','',$stopIds); -$stopIds = explode(',',$stopIds); -$linkTextField = str_replace(' ','',$linkTextField); -$linkTextField = explode(',',$linkTextField); -$linkDescField = str_replace(' ','',$linkDescField); -$linkDescField = explode(',',$linkDescField); -$ignoreIds = str_replace(' ','',$ignoreIds); -$ignoreIds = explode(',',$ignoreIds); - -/* $crumbs - * Crumb elements are: id, parent, pagetitle, longtitle, menutitle, description, - * published, hidemenu - */ -$crumbs = array(); -$parent = $modx->documentObject['parent']; -$output = ''; -$maxCrumbs += ($showCurrentCrumb) ? 1 : 0; - -// Replace || in snippet parameters that accept them with = -$crumbGap = str_replace('||','=',$crumbGap); - -// Curent crumb ---------------------------------------------------------------- - -// Decide if current page is to be a crumb -if ( $showCurrentCrumb ) -{ - $crumbs[] = array( - 'id' => $modx->documentObject['id'], - 'parent' => $modx->documentObject['parent'], - 'pagetitle' => $modx->documentObject['pagetitle'], - 'longtitle' => $modx->documentObject['longtitle'], - 'menutitle' => $modx->documentObject['menutitle'], - 'description' => $modx->documentObject['description']); -} - -// Intermediate crumbs --------------------------------------------------------- - - -// Iterate through parents till we hit root or a reason to stop -$loopSafety = 0; -while ( $parent && $parent!=$modx->config['site_start'] && $loopSafety < 1000 ) -{ - // Get next crumb - $tempCrumb = $modx->getPageInfo($parent,0,"id,parent,pagetitle,longtitle,menutitle,description,published,hidemenu"); - - // Check for include conditions & add to crumbs - if ( - $tempCrumb['published'] && - ( !$tempCrumb['hidemenu'] || !$respectHidemenu ) && - !in_array($tempCrumb['id'],$ignoreIds) - ) - { - // Add crumb - $crumbs[] = array( - 'id' => $tempCrumb['id'], - 'parent' => $tempCrumb['parent'], - 'pagetitle' => $tempCrumb['pagetitle'], - 'longtitle' => $tempCrumb['longtitle'], - 'menutitle' => $tempCrumb['menutitle'], - 'description' => $tempCrumb['description']); - } - - // Check stop conditions - if ( - in_array($tempCrumb['id'],$stopIds) || // Is one of the stop IDs - !$tempCrumb['parent'] || // At root - ( !$tempCrumb['published'] && !$pathThruUnPub ) // Unpublished - ) - { - // Halt making crumbs - break; - } - - // Reset parent - $parent = $tempCrumb['parent']; - - // Increment loop safety - $loopSafety++; -} - -// Home crumb ------------------------------------------------------------------ - -if ( $showHomeCrumb && $homeId != $modx->documentObject['id'] && $homeCrumb = $modx->getPageInfo($homeId,0,"id,parent,pagetitle,longtitle,menutitle,description,published,hidemenu") ) -{ - $crumbs[] = array( - 'id' => $homeCrumb['id'], - 'parent' => $homeCrumb['parent'], - 'pagetitle' => $homeCrumb['pagetitle'], - 'longtitle' => $homeCrumb['longtitle'], - 'menutitle' => $homeCrumb['menutitle'], - 'description' => $homeCrumb['description']); -} - - -// Process each crumb ---------------------------------------------------------- -$pretemplateCrumbs = array(); - -foreach ( $crumbs as $c ) -{ - - // Skip if we've exceeded our crumb limit but we're waiting to get to home - if ( count($pretemplateCrumbs) > $maxCrumbs && $c['id'] != $homeId ) - { - continue; - } - - $text = ''; - $title = ''; - $pretemplateCrumb = ''; - - // Determine appropriate span/link text: home link specified - if ( $c['id'] == $homeId && $homeCrumbTitle ) - { - $text = $homeCrumbTitle; - } - else - // Determine appropriate span/link text: home link not specified - { - for ($i = 0; !$text && $i < count($linkTextField); $i++) - { - if ( $c[$linkTextField[$i]] ) - { - $text = $c[$linkTextField[$i]]; - } - } - } - - // Determine link/span class(es) - if ( $c['id'] == $homeId ) - { - $crumbClass = $stylePrefix.'homeCrumb'; - } - else if ( $modx->documentObject['id'] == $c['id'] ) - { - $crumbClass = $stylePrefix.'currentCrumb'; - } - else - { - $crumbClass = $stylePrefix.'crumb'; - } - - // Make link - if ( - ( $c['id'] != $modx->documentObject['id'] && $showCrumbsAsLinks ) || - ( $c['id'] == $modx->documentObject['id'] && $currentAsLink ) - ) - { - // Determine appropriate title for link: home link specified - if ( $c['id'] == $homeId && $homeCrumbDescription ) - { - $title = htmlspecialchars($homeCrumbDescription); - } - else - // Determine appropriate title for link: home link not specified - { - for ($i = 0; !$title && $i < count($linkDescField); $i++) - { - if ( $c[$linkDescField[$i]] ) - { - $title = htmlspecialchars($c[$linkDescField[$i]]); - } - } - } - - - $pretemplateCrumb .= ''.$text.''; - } - else - // Make a span instead of a link - { - $pretemplateCrumb .= ''.$text.''; - } - - // Add crumb to pretemplate crumb array - $pretemplateCrumbs[] = $pretemplateCrumb; - - // If we have hit the crumb limit - if ( count($pretemplateCrumbs) == $maxCrumbs ) - { - if ( count($crumbs) > ($maxCrumbs + (($showHomeCrumb) ? 1 : 0)) ) - { - // Add gap - $pretemplateCrumbs[] = ''.$crumbGap.''; - } - - // Stop here if we're not looking for the home crumb - if ( !$showHomeCrumb ) - { - break; - } - } -} - -// Put in correct order for output -$pretemplateCrumbs = array_reverse($pretemplateCrumbs); - -// Wrap first/last spans -$pretemplateCrumbs[0] = str_replace( - array('[+firstCrumbClass+]','[+firstCrumbSpanA+]'), - array($stylePrefix.'firstCrumb',$pretemplateCrumbs[0]), - $templates[$templateSet]['firstCrumbWrapper'] -); -$pretemplateCrumbs[(count($pretemplateCrumbs)-1)] = str_replace( - array('[+lastCrumbClass+]','[+lastCrumbSpanA+]'), - array($stylePrefix.'lastCrumb',$pretemplateCrumbs[(count($pretemplateCrumbs)-1)]), - $templates[$templateSet]['lastCrumbWrapper'] -); - -// Insert crumbs into crumb template -$processedCrumbs = array(); -foreach ( $pretemplateCrumbs as $pc ) -{ - $processedCrumbs[] = str_replace('[+crumb+]',$pc,$templates[$templateSet]['crumb']); -} - -// Combine crumbs together into one string with separator -$processedCrumbs = implode($templates[$templateSet]['separator'],$processedCrumbs); - -// Put crumbs into crumb container template -$container = str_replace( - array('[+crumbBoxClass+]','[+crumbs+]'), - array($stylePrefix.'crumbBox',$processedCrumbs), - $templates[$templateSet]['crumbContainer'] - ); - -// Return crumbs -return $container; \ No newline at end of file +return require MODX_BASE_PATH.'assets/snippets/breadcrumbs/snippet.breadcrumbs.php'; \ No newline at end of file From e27106662d35796ce96d21aac55ba9f608b72fef Mon Sep 17 00:00:00 2001 From: Dmi3yy Date: Sun, 11 Aug 2013 09:18:02 +0300 Subject: [PATCH 226/530] Refactor #10071 Ditto --- assets/snippets/ditto/snippet.ditto.php | 1091 +++++++++++++++++++++++ install/assets/snippets/ditto.tpl | 1090 +--------------------- 2 files changed, 1097 insertions(+), 1084 deletions(-) create mode 100644 assets/snippets/ditto/snippet.ditto.php diff --git a/assets/snippets/ditto/snippet.ditto.php b/assets/snippets/ditto/snippet.ditto.php new file mode 100644 index 0000000000..728a5c44bb --- /dev/null +++ b/assets/snippets/ditto/snippet.ditto.php @@ -0,0 +1,1091 @@ +config['base_path'].$ditto_base : $modx->config['base_path']."assets/snippets/ditto/"; +/* + Param: ditto_base + + Purpose: + Location of Ditto files + + Options: + Any valid folder location containing the Ditto source code with a trailing slash + + Default: + [(base_path)]assets/snippets/ditto/ +*/ +$dittoID = (!isset($id)) ? "" : $id."_"; +$GLOBALS["dittoID"] = $dittoID; +/* + Param: id + + Purpose: + Unique ID for this Ditto instance for connection with other scripts (like Reflect) and unique URL parameters + + Options: + Any combination of characters a-z, underscores, and numbers 0-9 + + Note: + This is case sensitive + + Default: + "" - blank +*/ +$language = (isset($language))? $language : $modx->config['manager_language']; +if (!file_exists($ditto_base."lang/".$language.".inc.php")) { + $language ="english"; +} +/* + Param: language + + Purpose: + language for defaults, debug, and error messages + + Options: + Any language name with a corresponding file in the &ditto_base/lang folder + + Default: + "english" +*/ +$format = (isset($format)) ? strtolower($format) : "html" ; +/* + Param: format + + Purpose: + Output format to use + + Options: + - "html" + - "json" + - "xml" + - "atom" + - "rss" + + Default: + "html" +*/ +$config = (isset($config)) ? $config : "default"; +/* + Param: config + + Purpose: + Load a custom configuration + + Options: + "default" - default blank config file + CONFIG_NAME - Other configs installed in the configs folder or in any folder within the MODx base path via @FILE + + Default: + "default" + + Related: + - +*/ +$debug = isset($debug)? $debug : 0; +/* + Param: debug + + Purpose: + Output debugging information + + Options: + 0 - off + 1 - on + + Default: + 0 - off + + Related: + - +*/ +$phx = (isset($phx))? $phx : 1; +/* + Param: phx + + Purpose: + Use PHx formatting + + Options: + 0 - off + 1 - on + + Default: + 1 - on +*/ +$extenders = isset($extenders) ? explode(",",$extenders) : array(); +/* + Param: extenders + + Purpose: + Load an extender which adds functionality to Ditto + + Options: + Any extender in the extenders folder or in any folder within the MODx base path via @FILE + + Default: + [NULL] + + Related: + - +*/ + // Variable: extenders + // Array that can be added to by configs or formats to load that extender + +$placeholders = array(); + // Variable: placeholders + // Initialize custom placeholders array for configs or extenders to add to + +$filters = array("custom"=>array(),"parsed"=>array()); + // Variable: filters + // Holds both the custom filters array for configs or extenders to add to + // and the parsed filters array. To add to this array, use the following format + // (code) + // $filters["parsed"][] = array("name" => array("source"=>$source,"value"=>$value,"mode"=>$mode)); + // $filters["custom"][] = array("source","callback_function"); + +$orderBy = array('parsed'=>array(),'custom'=>array(),'unparsed'=>$orderBy); + // Variable: orderBy + // An array that holds all criteria to sort the result set by. + // Note that using a custom sort will disable all other sorting. + // (code) + // $orderBy["parsed"][] = array("sortBy","sortDir"); + // $orderBy["custom"][] = array("sortBy","callback_function"); + +//---Includes-------------------------------------------------------- // + +$files = array ( + "base_language" => $ditto_base."lang/english.inc.php", + "language" => $ditto_base."lang/$language.inc.php", + "main_class" => $ditto_base."classes/ditto.class.inc.php", + "template_class" => $ditto_base."classes/template.class.inc.php", + "filter_class" => $ditto_base."classes/filter.class.inc.php", + "format" => $ditto_base."formats/$format.format.inc.php", + "config" => $ditto_base."configs/default.config.php", + "user_config" => (substr($config, 0, 5) != "@FILE") ? $ditto_base."configs/$config.config.php" : $modx->config['base_path'].trim(substr($config, 5)) +); + +if ($phx == 1) { + $files["prePHx_class"] = $ditto_base."classes/phx.pre.class.inc.php"; +} +if (isset($randomize)) { + $files["randomize_class"] = $ditto_base."classes/random.class.inc.php"; +} +if ($debug == 1) { + $files["modx_debug_class"] = $ditto_base."debug/modxDebugConsole.class.php"; + $files["debug_class"] = $ditto_base."classes/debug.class.inc.php"; + $files["debug_templates"] = $ditto_base."debug/debug.templates.php"; +} + +$files = array_unique($files); +foreach ($files as $filename => $filevalue) { + if (file_exists($filevalue) && strpos($filename,"class")) { + include_once($filevalue); + } else if (file_exists($filevalue)) { + include($filevalue); + } else if ($filename == "language") { + $modx->logEvent(1, 3, "Language file does not exist Please check: " . $filevalue, "Ditto " . $ditto_version); + return "Language file does not exist Please check: " . $filevalue; + } else { + $modx->logEvent(1, 3, $filevalue . " " . $_lang['file_does_not_exist'], "Ditto " . $ditto_version); + return $filevalue . " " . $_lang['file_does_not_exist']; + } +} + +//---Initiate Class-------------------------------------------------- // +if (class_exists('ditto')) { + $ditto = new ditto($dittoID,$format,$_lang,$dbg_templates); + // create a new Ditto instance in the specified format and language with the requested debug level +} else { + $modx->logEvent(1,3,$_lang['invalid_class'],"Ditto ".$ditto_version); + return $_lang['invalid_class']; +} + +//---Initiate Extenders---------------------------------------------- // +if (isset($tagData)) { + $extenders[] = "tagging"; +} +if(count($extenders) > 0) { + $extenders = array_unique($extenders); + foreach ($extenders as $extender) { + if(substr($extender, 0, 5) != "@FILE") { + $extender_path = $ditto_base."extenders/".$extender.".extender.inc.php"; + } else { + $extender_path = $modx->config['base_path'].trim(substr($extender, 5)); + } + + if (file_exists($extender_path)){ + include($extender_path); + } else { + $modx->logEvent(1, 3, $extender . " " . $_lang['extender_does_not_exist'], "Ditto ".$ditto_version); + return $extender . " " . $_lang['extender_does_not_exist']; + } + } +} + +//---Parameters------------------------------------------------------- /* +if (isset($startID)) {$parents = $startID;} +if (isset($summarize)) {$display = $summarize;} +if (isset($limit)) {$queryLimit = $limit;} +if (isset($sortBy) || isset($sortDir) || is_null($orderBy['unparsed'])) { + $sortDir = isset($sortDir) ? strtoupper($sortDir) : 'DESC'; + $sortBy = isset($sortBy) ? $sortBy : "createdon"; + $orderBy['parsed'][]=array($sortBy,$sortDir); +} + // Allow backwards compatibility + +$idType = isset($documents) ? "documents" : "parents"; + // Variable: idType + // type of IDs provided; can be either parents or documents + +$parents = isset($parents) ? $ditto->cleanIDs($parents) : $modx->documentIdentifier; + +/* + Param: parents + + Purpose: + IDs of containers for Ditto to retrieve their children to &depth depth + + Options: + Any valid MODx document marked as a container + + Default: + Current MODx Document + + Related: + - + - +*/ +$documents = isset($documents) ? $ditto->cleanIDs($documents) : false; +/* + Param: documents + + Purpose: + IDs of documents for Ditto to retrieve + + Options: + Any valid MODx document marked as a container + + Default: + None + + Related: + - +*/ + +$IDs = ($idType == "parents") ? $parents : $documents; + // Variable: IDs + // Internal variable which holds the set of IDs for Ditto to fetch + +$depth = isset($depth) ? $depth : 1; +/* + Param: depth + + Purpose: + Number of levels deep to retrieve documents + + Options: + Any number greater than or equal to 1 + 0 - infinite depth + + Default: + 1 + + Related: + - +*/ +$paginate = isset($paginate)? $paginate : 0; +/* + Param: paginate + + Purpose: + Paginate the results set into pages of &display length. + Use &total to limit the number of documents retreived. + + Options: + 0 - off + 1 - on + + Default: + 0 - off + + Related: + - + - + - +*/ +$dateSource = isset($dateSource) ? $dateSource : "createdon"; +/* + Param: dateSource + + Purpose: + Source of the [+date+] placeholder + + Options: + # - Any UNIX timestamp from MODx fields or TVs such as createdon, pub_date, or editedon + + Default: + "createdon" + + Related: + - +*/ +$dateFormat = isset($dateFormat)? $dateFormat : $_lang["dateFormat"]; +/* + Param: dateFormat + + Purpose: + Format the [+date+] placeholder in human readable form + + Options: + Any PHP valid strftime option + + Default: + [LANG] + + Related: + - +*/ +$display = isset($display) ? $display : "all"; +/* + Param: display + + Purpose: + Number of documents to display in the results + + Options: + # - Any number + "all" - All documents found + + Default: + "all" + + Related: + - + - +*/ +$total = isset($total) ? $total : "all"; +/* + Param: total + + Purpose: + Number of documents to retrieve + + Options: + # - Any number + "all" - All documents found + + Default: + "all" - All documents found + + Related: + - + - +*/ +$showPublishedOnly = isset($showPublishedOnly) ? $showPublishedOnly : 1; +/* + Param: showPublishedOnly + + Purpose: + Show only published documents + + Options: + 0 - show only unpublished documents + 1 - show both published and unpublished documents + + Default: + 1 - show both published and unpublished documents + + Related: + - + - + - + - +*/ +$showInMenuOnly = isset($showInMenuOnly) ? $showInMenuOnly : 0; +/* + Param: showInMenuOnly + + Purpose: + Show only documents visible in the menu + + Options: + 0 - show all documents + 1 - show only documents with the show in menu flag checked + + Default: + 0 - show all documents + + Related: + - + - + - +*/ +$hideFolders = isset($hideFolders)? $hideFolders : 0; +/* + Param: hideFolders + + Purpose: + Don't show folders in the returned results + + Options: + 0 - keep folders + 1 - remove folders + + Default: + 0 - keep folders + + Related: + - + - + - +*/ +$hidePrivate = isset($hidePrivate)? $hidePrivate : 1; +/* + Param: hidePrivate + + Purpose: + Don't show documents the guest or user does not have permission to see + + Options: + 0 - show private documents + 1 - hide private documents + + Default: + 1 - hide private documents + + Related: + - + - + - +*/ +$seeThruUnpub = (isset($seeThruUnpub))? $seeThruUnpub : 1 ; +/* + Param: seeThruUnpub + + Purpose: + See through unpublished folders to retrive their children + Used when depth is greater than 1 + + Options: + 0 - off + 1 - on + + Default: + 0 - off + + Related: + - + - + - +*/ +$queryLimit = (isset($queryLimit))? $queryLimit : 0; +/* + Param: queryLimit + + Purpose: + Number of documents to retrieve from the database, same as MySQL LIMIT + + Options: + # - Any number + 0 - automatic + + Default: + 0 - automatic + + Related: + - +*/ +$where = (isset($where))? $where : ""; +/* + Param: where + + Purpose: + Custom MySQL WHERE statement + + Options: + A valid MySQL WHERE statement using only document object items (no TVs) + + Default: + [NULL] + + Related: + - +*/ +$noResults = isset($noResults)? $ditto->getParam($noResults,"no_documents") : $_lang['no_documents']; +/* + Param: noResults + + Purpose: + Text or chunk to display when there are no results + + Options: + Any valid chunk name or text + + Default: + [LANG] +*/ +$removeChunk = isset($removeChunk) ? explode(",",$removeChunk) : false; +/* + Param: removeChunk + + Purpose: + Name of chunks to be stripped from content separated by commas + - Commonly used to remove comments + + Options: + Any valid chunkname that appears in the output + + Default: + [NULL] +*/ +$hiddenFields = isset($hiddenFields) ? explode(",",$hiddenFields) : false; +/* + Param: hiddenFields + + Purpose: + Allow Ditto to retrieve fields its template parser cannot handle such as nested placeholders and [*fields*] + + Options: + Any valid MODx fieldnames or TVs comma separated + + Default: + [NULL] +*/ +$offset = isset($start) ? $start : 0; +$start = (isset($_GET[$dittoID.'start'])) ? intval($_GET[$dittoID.'start']) : 0; +/* + Param: start + + Purpose: + Number of documents to skip in the results + + Options: + Any number + + Default: + 0 +*/ +$globalFilterDelimiter = isset($globalFilterDelimiter) ? $globalFilterDelimiter : "|"; +/* + Param: globalFilterDelimiter + + Purpose: + Filter delimiter used to separate filters in the filter string + + Options: + Any character not used in the filters + + Default: + "|" + + Related: + - + - + - +*/ + +$localFilterDelimiter = isset($localFilterDelimiter) ? $localFilterDelimiter : ","; +/* + Param: localFilterDelimiter + + Purpose: + Delimiter used to separate individual parameters within each filter string + + Options: + Any character not used in the filter itself + + Default: + "," + + Related: + - + - + - +*/ +$filters["custom"] = isset($cFilters) ? array_merge($filters["custom"],$cFilters) : $filters["custom"]; +$filters["parsed"] = isset($parsedFilters) ? array_merge($filters["parsed"],$parsedFilters) : $filters["parsed"]; + // handle 2.0.0 compatibility +$filter = (isset($filter) || ($filters["custom"] != false) || ($filters["parsed"] != false)) ? $ditto->parseFilters($filter,$filters["custom"],$filters["parsed"],$globalFilterDelimiter,$localFilterDelimiter) : false; +/* + Param: filter + + Purpose: + Removes items not meeting a critera. Thus, if pagetitle == joe then it will be removed. + Use in the format field,criteria,mode with the comma being the local delimiter + + *Mode* *Meaning* + + 1 - != + 2 - == + 3 - < + 4 - > + 5 - <= + 6 - >= + 7 - Text not in field value + 8 - Text in field value + 9 - case insenstive version of #7 + 10 - case insenstive version of #8 + 11 - checks leading character of the field + + @EVAL: + @EVAL in filters works the same as it does in MODx exect it can only be used + with basic filtering, not custom filtering (tagging, etc). Make sure that + you return the value you wish Ditto to filter by and that the code is valid PHP. + + Default: + [NULL] + + Related: + - + - + - +*/ +$keywords = (isset($keywords))? $keywords : 0; +/* + Param: keywords + + Purpose: + Enable fetching of associated keywords for each document + Can be used as [+keywords+] or as a tagData source + + Options: + 0 - off + 1 - on + + Default: + 0 - off +*/ + +$randomize = (isset($randomize))? $randomize : 0; +/* + Param: randomize + + Purpose: + Randomize the order of the output + + Options: + 0 - off + 1 - on + Any MODx field or TV for weighted random + + Default: + 0 - off +*/ +$save = (isset($save))? $save : 0; +/* + Param: save + + Purpose: + Saves the ditto object and results set to placeholders + for use by other snippets + + Options: + 0 - off; returns output + 1 - remaining; returns output + 2 - all; + 3 - all; returns ph only + + Default: + 0 - off; returns output +*/ +$templates = array( + "default" => "@CODE".$_lang['default_template'], + "base" => $tpl, + "alt" => $tplAlt, + "first" => $tplFirst, + "last" => $tplLast, + "current" => $tplCurrentDocument +); +/* + Param: tpl + + Purpose: + User defined chunk to format the documents + + Options: + - Any valid chunk name + - Code via @CODE + - File via @FILE + + Default: + [LANG] +*/ +/* + Param: tplAlt + + Purpose: + User defined chunk to format every other document + + Options: + - Any valid chunk name + - Code via @CODE + - File via @FILE + + Default: + &tpl +*/ +/* + Param: tplFirst + + Purpose: + User defined chunk to format the first document + + Options: + - Any valid chunk name + - Code via @CODE + - File via @FILE + + Default: + &tpl +*/ +/* + Param: tplLast + + Purpose: + User defined chunk to format the last document + + Options: + - Any valid chunk name + - Code via @CODE + - File via @FILE + + Default: + &tpl +*/ +/* + Param: tplCurrentDocument + + Purpose: + User defined chunk to format the current document + + Options: + - Any valid chunk name + - Code via @CODE + - File via @FILE + + Default: + &tpl +*/ +$orderBy = $ditto->parseOrderBy($orderBy,$randomize); +/* + Param: orderBy + + Purpose: + Sort the result set + + Options: + Any valid MySQL style orderBy statement + + Default: + createdon DESC +*/ +//-------------------------------------------------------------------- */ +$templates = $ditto->template->process($templates); + // parse the templates for TV's and store them for later use + +$ditto->setDisplayFields($ditto->template->fields,$hiddenFields); + // parse hidden fields + +$ditto->parseFields($placeholders,$seeThruUnpub,$dateSource,$randomize); + // parse the fields into the field array + +$documentIDs = $ditto->determineIDs($IDs, $idType, $ditto->fields["backend"]["tv"], $orderBy, $depth, $showPublishedOnly, $seeThruUnpub, $hideFolders, $hidePrivate, $showInMenuOnly, $where, $keywords, $dateSource, $queryLimit, $display, $filter,$paginate, $randomize); + // retrieves a list of document IDs that meet the criteria and populates the $resources array with them +$count = count($documentIDs); + // count the number of documents to be retrieved +$count = $count-$offset; + // handle the offset + +if ($count > 0) { + // if documents are returned continue with execution + + $total = ($total == "all") ? $count : min($total,$count); + // set total equal to count if all documents are to be included + + $display = ($display == "all") ? min($count,$total) : min($display,$total); + // allow show to use all option + + $stop = ($save != "1") ? min($total-$start,$display) : min($count,$total); + // set initial stop count + + if($paginate == 1) { + $paginateAlwaysShowLinks = isset($paginateAlwaysShowLinks)? $paginateAlwaysShowLinks : 0; + /* + Param: paginateAlwaysShowLinks + + Purpose: + Determine whether or not to always show previous next links + + Options: + 0 - off + 1 - on + + Default: + 0 - off + + Related: + - + - + */ + $paginateSplitterCharacter = isset($paginateSplitterCharacter)? $paginateSplitterCharacter : $_lang['button_splitter']; + /* + Param: paginateSplitterCharacter + + Purpose: + Splitter to use if always show is disabled + + Options: + Any valid character + + Default: + [LANG] + + Related: + - + - + */ + $tplPaginatePrevious = isset($tplPaginatePrevious)? $ditto->template->fetch($tplPaginatePrevious) : "[+lang:previous+]"; + /* + Param: tplPaginatePrevious + + Purpose: + Template for the previous link + + Options: + - Any valid chunk name + - Code via @CODE + - File via @FILE + + Placeholders: + url - URL for the previous link + lang:previous - value of 'prev' from the language file + + Related: + - + - + */ + $tplPaginateNext = isset($tplPaginateNext)? $ditto->template->fetch($tplPaginateNext) : "[+lang:next+]"; + /* + Param: tplPaginateNext + + Purpose: + Template for the next link + + Options: + - Any valid chunk name + - Code via @CODE + - File via @FILE + + Placeholders: + url - URL for the next link + lang:next - value of 'next' from the language file + + Related: + - + - + */ + $tplPaginateNextOff = isset($tplPaginateNextOff)? $ditto->template->fetch($tplPaginateNextOff) : "[+lang:next+]"; + /* + Param: tplPaginateNextOff + + Purpose: + Template for the inside of the next link + + Options: + - Any valid chunk name + - Code via @CODE + - File via @FILE + + Placeholders: + lang:next - value of 'next' from the language file + + Related: + - + - + */ + $tplPaginatePreviousOff = isset($tplPaginatePreviousOff)? $ditto->template->fetch($tplPaginatePreviousOff) : "[+lang:previous+]"; + /* + Param: tplPaginatePreviousOff + + Purpose: + Template for the previous link when it is off + + Options: + - Any valid chunk name + - Code via @CODE + - File via @FILE + + Placeholders: + lang:previous - value of 'prev' from the language file + + Related: + - + - + */ + $tplPaginatePage = isset($tplPaginatePage)? $ditto->template->fetch($tplPaginatePage) : "[+page+]"; + /* + Param: tplPaginatePage + + Purpose: + Template for the page link + + Options: + - Any valid chunk name + - Code via @CODE + - File via @FILE + + Placeholders: + url - url for the page + page - number of the page + + Related: + - + - + */ + $tplPaginateCurrentPage = isset($tplPaginateCurrentPage)? $ditto->template->fetch($tplPaginateCurrentPage) : "[+page+]"; + /* + Param: tplPaginateCurrentPage + + Purpose: + Template for the current page link + + Options: + - Any valid chunk name + - Code via @CODE + - File via @FILE + + Placeholders: + page - number of the page + + Related: + - + - + */ + + $ditto->paginate($start, $stop, $total, $display, $tplPaginateNext, $tplPaginatePrevious, $tplPaginateNextOff, $tplPaginatePreviousOff, $tplPaginatePage, $tplPaginateCurrentPage, $paginateAlwaysShowLinks, $paginateSplitterCharacter); + // generate the pagination placeholders + } + + $dbFields = $ditto->fields["display"]["db"]; + // get the database fields + $TVs = $ditto->fields["display"]["tv"]; + // get the TVs + + switch($orderBy['parsed'][0][1]) { + case "DESC": + $stop = ($ditto->prefetch === false) ? $stop + $start + $offset : $stop + $offset; + $start += $offset; + break; + case "ASC": + $start += $offset; + $stop += $start; + break; + } + + if ($ditto->prefetch !== false) { + $documentIDs = array_slice($documentIDs,$start,$stop); + // set the document IDs equal to the trimmed array + $dbFields = array_diff($dbFields,$ditto->prefetch["fields"]["db"]); + // calculate the difference between the database fields and those already prefetched + $dbFields[] = "id"; + // append id to the db fields array + $TVs = array_diff($TVs,$ditto->prefetch["fields"]["tv"]); + // calculate the difference between the tv fields and those already prefetched + $start = 0; + $stop = min($display,($queryLimit != 0) ? $queryLimit : $display,count($documentIDs)); + } else { + $queryLimit = ($queryLimit == 0) ? "" : $queryLimit; + } + + $resource = $ditto->getDocuments($documentIDs, $dbFields, $TVs, $orderBy, $showPublishedOnly, 0, $hidePrivate, $where, $queryLimit, $keywords, $randomize, $dateSource); + // retrieves documents + $output = $header; + // initialize the output variable and send the header + + if ($resource) { + if ($randomize != "0" && $randomize != "1") { + $resource = $ditto->weightedRandom($resource,$randomize,$stop); + // randomize the documents + } + + $resource = array_values($resource); + + for ($x=$start;$x<$stop;$x++) { + $template = $ditto->template->determine($templates,$x,0,$stop,$resource[$x]["id"]); + // choose the template to use and set the code of that template to the template variable + $renderedOutput = $ditto->render($resource[$x], $template, $removeChunk, $dateSource, $dateFormat, $placeholders,$phx,abs($start-$x),$stop); + // render the output using the correct template, in the correct format and language + $modx->setPlaceholder($dittoID."item[".abs($start-$x)."]",$renderedOutput); + /* + Placeholder: item[x] + + Content: + Individual items rendered output + */ + $output .= $renderedOutput; + // send the rendered output to the buffer + } + } else { + $output .= $ditto->noResults($noResults,$paginate); + // if no documents are found return a no documents found string + } + $output .= $footer; + // send the footer + + // --------------------------------------------------- + // Save Object + // --------------------------------------------------- + + if($save) { + $modx->setPlaceholder($dittoID."ditto_object", $ditto); + $modx->setPlaceholder($dittoID."ditto_resource", ($save == "1") ? array_slice($resource,$display) : $resource); + } +} else { + $output = $header.$ditto->noResults($noResults,$paginate).$footer; +} +// --------------------------------------------------- +// Handle Debugging +// --------------------------------------------------- + +if ($debug == 1) { + $ditto_params =& $modx->event_params; + if (!isset($_GET["ditto_".$dittoID."debug"])) { + $_SESSION["ditto_debug_$dittoID"] = $ditto->debug->render_popup($ditto, $ditto_base, $ditto_version, $ditto_params, $documentIDs, array("db"=>$dbFields,"tv"=>$TVs), $display, $templates, $orderBy, $start, $stop, $total,$filter,$resource); + } + if (isset($_GET["ditto_".$dittoID."debug"])) { + switch ($_GET["ditto_".$dittoID."debug"]) { + case "open" : + exit($_SESSION["ditto_debug_$dittoID"]); + break; + case "save" : + $ditto->debug->save($_SESSION["ditto_debug_$dittoID"],"ditto".strtolower($ditto_version)."_debug_doc".$modx->documentIdentifier.".html"); + break; + } + } else { + $output = $ditto->debug->render_link($dittoID,$ditto_base).$output; + } +} +//outerTpl by Dmi3yy +if ($outerTpl && $resource) { + if ($modx->getChunk($outerTpl) != "") { + $outerTpl = $modx->getChunk($outerTpl); + } else if(substr($outerTpl, 0, 5) == "@CODE") { + $outerTpl = trim(substr($outerTpl, 6)); + } + $output = str_replace('[+ditto+]',$output,$outerTpl); +} + +return ($save != 3) ? $output : "";?> \ No newline at end of file diff --git a/install/assets/snippets/ditto.tpl b/install/assets/snippets/ditto.tpl index 1cf45d2325..3348751f5b 100755 --- a/install/assets/snippets/ditto.tpl +++ b/install/assets/snippets/ditto.tpl @@ -4,1090 +4,12 @@ * * Summarizes and lists pages to create blogs, catalogs, PR archives, bio listings and more * - * @category snippet - * @version 2.1.0 - * @license http://www.gnu.org/copyleft/gpl.html GNU Public License (GPL) - * @internal @properties - * @internal @modx_category Content + * @category snippet + * @version 2.1.0 + * @license http://www.gnu.org/copyleft/gpl.html GNU Public License (GPL) + * @internal @properties + * @internal @modx_category Content * @internal @installset base, sample */ -/* Description: - * Aggregates documents to create blogs, article/news - * collections, and more,with full support for templating. - * - * Author: - * Mark Kaplan for MODx CMF -*/ - -//---Core Settings---------------------------------------------------- // - -$ditto_version = "2.1.0"; - // Ditto version being executed - -$ditto_base = isset($ditto_base) ? $modx->config['base_path'].$ditto_base : $modx->config['base_path']."assets/snippets/ditto/"; -/* - Param: ditto_base - - Purpose: - Location of Ditto files - - Options: - Any valid folder location containing the Ditto source code with a trailing slash - - Default: - [(base_path)]assets/snippets/ditto/ -*/ -$dittoID = (!isset($id)) ? "" : $id."_"; -$GLOBALS["dittoID"] = $dittoID; -/* - Param: id - - Purpose: - Unique ID for this Ditto instance for connection with other scripts (like Reflect) and unique URL parameters - - Options: - Any combination of characters a-z, underscores, and numbers 0-9 - - Note: - This is case sensitive - - Default: - "" - blank -*/ -$language = (isset($language))? $language : $modx->config['manager_language']; -if (!file_exists($ditto_base."lang/".$language.".inc.php")) { - $language ="english"; -} -/* - Param: language - - Purpose: - language for defaults, debug, and error messages - - Options: - Any language name with a corresponding file in the &ditto_base/lang folder - - Default: - "english" -*/ -$format = (isset($format)) ? strtolower($format) : "html" ; -/* - Param: format - - Purpose: - Output format to use - - Options: - - "html" - - "json" - - "xml" - - "atom" - - "rss" - - Default: - "html" -*/ -$config = (isset($config)) ? $config : "default"; -/* - Param: config - - Purpose: - Load a custom configuration - - Options: - "default" - default blank config file - CONFIG_NAME - Other configs installed in the configs folder or in any folder within the MODx base path via @FILE - - Default: - "default" - - Related: - - -*/ -$debug = isset($debug)? $debug : 0; -/* - Param: debug - - Purpose: - Output debugging information - - Options: - 0 - off - 1 - on - - Default: - 0 - off - - Related: - - -*/ -$phx = (isset($phx))? $phx : 1; -/* - Param: phx - - Purpose: - Use PHx formatting - - Options: - 0 - off - 1 - on - - Default: - 1 - on -*/ -$extenders = isset($extenders) ? explode(",",$extenders) : array(); -/* - Param: extenders - - Purpose: - Load an extender which adds functionality to Ditto - - Options: - Any extender in the extenders folder or in any folder within the MODx base path via @FILE - - Default: - [NULL] - - Related: - - -*/ - // Variable: extenders - // Array that can be added to by configs or formats to load that extender - -$placeholders = array(); - // Variable: placeholders - // Initialize custom placeholders array for configs or extenders to add to - -$filters = array("custom"=>array(),"parsed"=>array()); - // Variable: filters - // Holds both the custom filters array for configs or extenders to add to - // and the parsed filters array. To add to this array, use the following format - // (code) - // $filters["parsed"][] = array("name" => array("source"=>$source,"value"=>$value,"mode"=>$mode)); - // $filters["custom"][] = array("source","callback_function"); - -$orderBy = array('parsed'=>array(),'custom'=>array(),'unparsed'=>$orderBy); - // Variable: orderBy - // An array that holds all criteria to sort the result set by. - // Note that using a custom sort will disable all other sorting. - // (code) - // $orderBy["parsed"][] = array("sortBy","sortDir"); - // $orderBy["custom"][] = array("sortBy","callback_function"); - -//---Includes-------------------------------------------------------- // - -$files = array ( - "base_language" => $ditto_base."lang/english.inc.php", - "language" => $ditto_base."lang/$language.inc.php", - "main_class" => $ditto_base."classes/ditto.class.inc.php", - "template_class" => $ditto_base."classes/template.class.inc.php", - "filter_class" => $ditto_base."classes/filter.class.inc.php", - "format" => $ditto_base."formats/$format.format.inc.php", - "config" => $ditto_base."configs/default.config.php", - "user_config" => (substr($config, 0, 5) != "@FILE") ? $ditto_base."configs/$config.config.php" : $modx->config['base_path'].trim(substr($config, 5)) -); - -if ($phx == 1) { - $files["prePHx_class"] = $ditto_base."classes/phx.pre.class.inc.php"; -} -if (isset($randomize)) { - $files["randomize_class"] = $ditto_base."classes/random.class.inc.php"; -} -if ($debug == 1) { - $files["modx_debug_class"] = $ditto_base."debug/modxDebugConsole.class.php"; - $files["debug_class"] = $ditto_base."classes/debug.class.inc.php"; - $files["debug_templates"] = $ditto_base."debug/debug.templates.php"; -} - -$files = array_unique($files); -foreach ($files as $filename => $filevalue) { - if (file_exists($filevalue) && strpos($filename,"class")) { - include_once($filevalue); - } else if (file_exists($filevalue)) { - include($filevalue); - } else if ($filename == "language") { - $modx->logEvent(1, 3, "Language file does not exist Please check: " . $filevalue, "Ditto " . $ditto_version); - return "Language file does not exist Please check: " . $filevalue; - } else { - $modx->logEvent(1, 3, $filevalue . " " . $_lang['file_does_not_exist'], "Ditto " . $ditto_version); - return $filevalue . " " . $_lang['file_does_not_exist']; - } -} - -//---Initiate Class-------------------------------------------------- // -if (class_exists('ditto')) { - $ditto = new ditto($dittoID,$format,$_lang,$dbg_templates); - // create a new Ditto instance in the specified format and language with the requested debug level -} else { - $modx->logEvent(1,3,$_lang['invalid_class'],"Ditto ".$ditto_version); - return $_lang['invalid_class']; -} - -//---Initiate Extenders---------------------------------------------- // -if (isset($tagData)) { - $extenders[] = "tagging"; -} -if(count($extenders) > 0) { - $extenders = array_unique($extenders); - foreach ($extenders as $extender) { - if(substr($extender, 0, 5) != "@FILE") { - $extender_path = $ditto_base."extenders/".$extender.".extender.inc.php"; - } else { - $extender_path = $modx->config['base_path'].trim(substr($extender, 5)); - } - - if (file_exists($extender_path)){ - include($extender_path); - } else { - $modx->logEvent(1, 3, $extender . " " . $_lang['extender_does_not_exist'], "Ditto ".$ditto_version); - return $extender . " " . $_lang['extender_does_not_exist']; - } - } -} - -//---Parameters------------------------------------------------------- /* -if (isset($startID)) {$parents = $startID;} -if (isset($summarize)) {$display = $summarize;} -if (isset($limit)) {$queryLimit = $limit;} -if (isset($sortBy) || isset($sortDir) || is_null($orderBy['unparsed'])) { - $sortDir = isset($sortDir) ? strtoupper($sortDir) : 'DESC'; - $sortBy = isset($sortBy) ? $sortBy : "createdon"; - $orderBy['parsed'][]=array($sortBy,$sortDir); -} - // Allow backwards compatibility - -$idType = isset($documents) ? "documents" : "parents"; - // Variable: idType - // type of IDs provided; can be either parents or documents - -$parents = isset($parents) ? $ditto->cleanIDs($parents) : $modx->documentIdentifier; - -/* - Param: parents - - Purpose: - IDs of containers for Ditto to retrieve their children to &depth depth - - Options: - Any valid MODx document marked as a container - - Default: - Current MODx Document - - Related: - - - - -*/ -$documents = isset($documents) ? $ditto->cleanIDs($documents) : false; -/* - Param: documents - - Purpose: - IDs of documents for Ditto to retrieve - - Options: - Any valid MODx document marked as a container - - Default: - None - - Related: - - -*/ - -$IDs = ($idType == "parents") ? $parents : $documents; - // Variable: IDs - // Internal variable which holds the set of IDs for Ditto to fetch - -$depth = isset($depth) ? $depth : 1; -/* - Param: depth - - Purpose: - Number of levels deep to retrieve documents - - Options: - Any number greater than or equal to 1 - 0 - infinite depth - - Default: - 1 - - Related: - - -*/ -$paginate = isset($paginate)? $paginate : 0; -/* - Param: paginate - - Purpose: - Paginate the results set into pages of &display length. - Use &total to limit the number of documents retreived. - - Options: - 0 - off - 1 - on - - Default: - 0 - off - - Related: - - - - - - -*/ -$dateSource = isset($dateSource) ? $dateSource : "createdon"; -/* - Param: dateSource - - Purpose: - Source of the [+date+] placeholder - - Options: - # - Any UNIX timestamp from MODx fields or TVs such as createdon, pub_date, or editedon - - Default: - "createdon" - - Related: - - -*/ -$dateFormat = isset($dateFormat)? $dateFormat : $_lang["dateFormat"]; -/* - Param: dateFormat - - Purpose: - Format the [+date+] placeholder in human readable form - - Options: - Any PHP valid strftime option - - Default: - [LANG] - - Related: - - -*/ -$display = isset($display) ? $display : "all"; -/* - Param: display - - Purpose: - Number of documents to display in the results - - Options: - # - Any number - "all" - All documents found - - Default: - "all" - - Related: - - - - -*/ -$total = isset($total) ? $total : "all"; -/* - Param: total - - Purpose: - Number of documents to retrieve - - Options: - # - Any number - "all" - All documents found - - Default: - "all" - All documents found - - Related: - - - - -*/ -$showPublishedOnly = isset($showPublishedOnly) ? $showPublishedOnly : 1; -/* - Param: showPublishedOnly - - Purpose: - Show only published documents - - Options: - 0 - show only unpublished documents - 1 - show both published and unpublished documents - - Default: - 1 - show both published and unpublished documents - - Related: - - - - - - - - -*/ -$showInMenuOnly = isset($showInMenuOnly) ? $showInMenuOnly : 0; -/* - Param: showInMenuOnly - - Purpose: - Show only documents visible in the menu - - Options: - 0 - show all documents - 1 - show only documents with the show in menu flag checked - - Default: - 0 - show all documents - - Related: - - - - - - -*/ -$hideFolders = isset($hideFolders)? $hideFolders : 0; -/* - Param: hideFolders - - Purpose: - Don't show folders in the returned results - - Options: - 0 - keep folders - 1 - remove folders - - Default: - 0 - keep folders - - Related: - - - - - - -*/ -$hidePrivate = isset($hidePrivate)? $hidePrivate : 1; -/* - Param: hidePrivate - - Purpose: - Don't show documents the guest or user does not have permission to see - - Options: - 0 - show private documents - 1 - hide private documents - - Default: - 1 - hide private documents - - Related: - - - - - - -*/ -$seeThruUnpub = (isset($seeThruUnpub))? $seeThruUnpub : 1 ; -/* - Param: seeThruUnpub - - Purpose: - See through unpublished folders to retrive their children - Used when depth is greater than 1 - - Options: - 0 - off - 1 - on - - Default: - 0 - off - - Related: - - - - - - -*/ -$queryLimit = (isset($queryLimit))? $queryLimit : 0; -/* - Param: queryLimit - - Purpose: - Number of documents to retrieve from the database, same as MySQL LIMIT - - Options: - # - Any number - 0 - automatic - - Default: - 0 - automatic - - Related: - - -*/ -$where = (isset($where))? $where : ""; -/* - Param: where - - Purpose: - Custom MySQL WHERE statement - - Options: - A valid MySQL WHERE statement using only document object items (no TVs) - - Default: - [NULL] - - Related: - - -*/ -$noResults = isset($noResults)? $ditto->getParam($noResults,"no_documents") : $_lang['no_documents']; -/* - Param: noResults - - Purpose: - Text or chunk to display when there are no results - - Options: - Any valid chunk name or text - - Default: - [LANG] -*/ -$removeChunk = isset($removeChunk) ? explode(",",$removeChunk) : false; -/* - Param: removeChunk - - Purpose: - Name of chunks to be stripped from content separated by commas - - Commonly used to remove comments - - Options: - Any valid chunkname that appears in the output - - Default: - [NULL] -*/ -$hiddenFields = isset($hiddenFields) ? explode(",",$hiddenFields) : false; -/* - Param: hiddenFields - - Purpose: - Allow Ditto to retrieve fields its template parser cannot handle such as nested placeholders and [*fields*] - - Options: - Any valid MODx fieldnames or TVs comma separated - - Default: - [NULL] -*/ -$offset = isset($start) ? $start : 0; -$start = (isset($_GET[$dittoID.'start'])) ? intval($_GET[$dittoID.'start']) : 0; -/* - Param: start - - Purpose: - Number of documents to skip in the results - - Options: - Any number - - Default: - 0 -*/ -$globalFilterDelimiter = isset($globalFilterDelimiter) ? $globalFilterDelimiter : "|"; -/* - Param: globalFilterDelimiter - - Purpose: - Filter delimiter used to separate filters in the filter string - - Options: - Any character not used in the filters - - Default: - "|" - - Related: - - - - - - -*/ - -$localFilterDelimiter = isset($localFilterDelimiter) ? $localFilterDelimiter : ","; -/* - Param: localFilterDelimiter - - Purpose: - Delimiter used to separate individual parameters within each filter string - - Options: - Any character not used in the filter itself - - Default: - "," - - Related: - - - - - - -*/ -$filters["custom"] = isset($cFilters) ? array_merge($filters["custom"],$cFilters) : $filters["custom"]; -$filters["parsed"] = isset($parsedFilters) ? array_merge($filters["parsed"],$parsedFilters) : $filters["parsed"]; - // handle 2.0.0 compatibility -$filter = (isset($filter) || ($filters["custom"] != false) || ($filters["parsed"] != false)) ? $ditto->parseFilters($filter,$filters["custom"],$filters["parsed"],$globalFilterDelimiter,$localFilterDelimiter) : false; -/* - Param: filter - - Purpose: - Removes items not meeting a critera. Thus, if pagetitle == joe then it will be removed. - Use in the format field,criteria,mode with the comma being the local delimiter - - *Mode* *Meaning* - - 1 - != - 2 - == - 3 - < - 4 - > - 5 - <= - 6 - >= - 7 - Text not in field value - 8 - Text in field value - 9 - case insenstive version of #7 - 10 - case insenstive version of #8 - 11 - checks leading character of the field - - @EVAL: - @EVAL in filters works the same as it does in MODx exect it can only be used - with basic filtering, not custom filtering (tagging, etc). Make sure that - you return the value you wish Ditto to filter by and that the code is valid PHP. - - Default: - [NULL] - - Related: - - - - - - -*/ -$keywords = (isset($keywords))? $keywords : 0; -/* - Param: keywords - - Purpose: - Enable fetching of associated keywords for each document - Can be used as [+keywords+] or as a tagData source - - Options: - 0 - off - 1 - on - - Default: - 0 - off -*/ - -$randomize = (isset($randomize))? $randomize : 0; -/* - Param: randomize - - Purpose: - Randomize the order of the output - - Options: - 0 - off - 1 - on - Any MODx field or TV for weighted random - - Default: - 0 - off -*/ -$save = (isset($save))? $save : 0; -/* - Param: save - - Purpose: - Saves the ditto object and results set to placeholders - for use by other snippets - - Options: - 0 - off; returns output - 1 - remaining; returns output - 2 - all; - 3 - all; returns ph only - - Default: - 0 - off; returns output -*/ -$templates = array( - "default" => "@CODE".$_lang['default_template'], - "base" => $tpl, - "alt" => $tplAlt, - "first" => $tplFirst, - "last" => $tplLast, - "current" => $tplCurrentDocument -); -/* - Param: tpl - - Purpose: - User defined chunk to format the documents - - Options: - - Any valid chunk name - - Code via @CODE - - File via @FILE - - Default: - [LANG] -*/ -/* - Param: tplAlt - - Purpose: - User defined chunk to format every other document - - Options: - - Any valid chunk name - - Code via @CODE - - File via @FILE - - Default: - &tpl -*/ -/* - Param: tplFirst - - Purpose: - User defined chunk to format the first document - - Options: - - Any valid chunk name - - Code via @CODE - - File via @FILE - - Default: - &tpl -*/ -/* - Param: tplLast - - Purpose: - User defined chunk to format the last document - - Options: - - Any valid chunk name - - Code via @CODE - - File via @FILE - - Default: - &tpl -*/ -/* - Param: tplCurrentDocument - - Purpose: - User defined chunk to format the current document - - Options: - - Any valid chunk name - - Code via @CODE - - File via @FILE - - Default: - &tpl -*/ -$orderBy = $ditto->parseOrderBy($orderBy,$randomize); -/* - Param: orderBy - - Purpose: - Sort the result set - - Options: - Any valid MySQL style orderBy statement - - Default: - createdon DESC -*/ -//-------------------------------------------------------------------- */ -$templates = $ditto->template->process($templates); - // parse the templates for TV's and store them for later use - -$ditto->setDisplayFields($ditto->template->fields,$hiddenFields); - // parse hidden fields - -$ditto->parseFields($placeholders,$seeThruUnpub,$dateSource,$randomize); - // parse the fields into the field array - -$documentIDs = $ditto->determineIDs($IDs, $idType, $ditto->fields["backend"]["tv"], $orderBy, $depth, $showPublishedOnly, $seeThruUnpub, $hideFolders, $hidePrivate, $showInMenuOnly, $where, $keywords, $dateSource, $queryLimit, $display, $filter,$paginate, $randomize); - // retrieves a list of document IDs that meet the criteria and populates the $resources array with them -$count = count($documentIDs); - // count the number of documents to be retrieved -$count = $count-$offset; - // handle the offset - -if ($count > 0) { - // if documents are returned continue with execution - - $total = ($total == "all") ? $count : min($total,$count); - // set total equal to count if all documents are to be included - - $display = ($display == "all") ? min($count,$total) : min($display,$total); - // allow show to use all option - - $stop = ($save != "1") ? min($total-$start,$display) : min($count,$total); - // set initial stop count - - if($paginate == 1) { - $paginateAlwaysShowLinks = isset($paginateAlwaysShowLinks)? $paginateAlwaysShowLinks : 0; - /* - Param: paginateAlwaysShowLinks - - Purpose: - Determine whether or not to always show previous next links - - Options: - 0 - off - 1 - on - - Default: - 0 - off - - Related: - - - - - */ - $paginateSplitterCharacter = isset($paginateSplitterCharacter)? $paginateSplitterCharacter : $_lang['button_splitter']; - /* - Param: paginateSplitterCharacter - - Purpose: - Splitter to use if always show is disabled - - Options: - Any valid character - - Default: - [LANG] - - Related: - - - - - */ - $tplPaginatePrevious = isset($tplPaginatePrevious)? $ditto->template->fetch($tplPaginatePrevious) : "[+lang:previous+]"; - /* - Param: tplPaginatePrevious - - Purpose: - Template for the previous link - - Options: - - Any valid chunk name - - Code via @CODE - - File via @FILE - - Placeholders: - url - URL for the previous link - lang:previous - value of 'prev' from the language file - - Related: - - - - - */ - $tplPaginateNext = isset($tplPaginateNext)? $ditto->template->fetch($tplPaginateNext) : "[+lang:next+]"; - /* - Param: tplPaginateNext - - Purpose: - Template for the next link - - Options: - - Any valid chunk name - - Code via @CODE - - File via @FILE - - Placeholders: - url - URL for the next link - lang:next - value of 'next' from the language file - - Related: - - - - - */ - $tplPaginateNextOff = isset($tplPaginateNextOff)? $ditto->template->fetch($tplPaginateNextOff) : "[+lang:next+]"; - /* - Param: tplPaginateNextOff - - Purpose: - Template for the inside of the next link - - Options: - - Any valid chunk name - - Code via @CODE - - File via @FILE - - Placeholders: - lang:next - value of 'next' from the language file - - Related: - - - - - */ - $tplPaginatePreviousOff = isset($tplPaginatePreviousOff)? $ditto->template->fetch($tplPaginatePreviousOff) : "[+lang:previous+]"; - /* - Param: tplPaginatePreviousOff - - Purpose: - Template for the previous link when it is off - - Options: - - Any valid chunk name - - Code via @CODE - - File via @FILE - - Placeholders: - lang:previous - value of 'prev' from the language file - - Related: - - - - - */ - $tplPaginatePage = isset($tplPaginatePage)? $ditto->template->fetch($tplPaginatePage) : "[+page+]"; - /* - Param: tplPaginatePage - - Purpose: - Template for the page link - - Options: - - Any valid chunk name - - Code via @CODE - - File via @FILE - - Placeholders: - url - url for the page - page - number of the page - - Related: - - - - - */ - $tplPaginateCurrentPage = isset($tplPaginateCurrentPage)? $ditto->template->fetch($tplPaginateCurrentPage) : "[+page+]"; - /* - Param: tplPaginateCurrentPage - - Purpose: - Template for the current page link - - Options: - - Any valid chunk name - - Code via @CODE - - File via @FILE - - Placeholders: - page - number of the page - - Related: - - - - - */ - - $ditto->paginate($start, $stop, $total, $display, $tplPaginateNext, $tplPaginatePrevious, $tplPaginateNextOff, $tplPaginatePreviousOff, $tplPaginatePage, $tplPaginateCurrentPage, $paginateAlwaysShowLinks, $paginateSplitterCharacter); - // generate the pagination placeholders - } - - $dbFields = $ditto->fields["display"]["db"]; - // get the database fields - $TVs = $ditto->fields["display"]["tv"]; - // get the TVs - - switch($orderBy['parsed'][0][1]) { - case "DESC": - $stop = ($ditto->prefetch === false) ? $stop + $start + $offset : $stop + $offset; - $start += $offset; - break; - case "ASC": - $start += $offset; - $stop += $start; - break; - } - - if ($ditto->prefetch !== false) { - $documentIDs = array_slice($documentIDs,$start,$stop); - // set the document IDs equal to the trimmed array - $dbFields = array_diff($dbFields,$ditto->prefetch["fields"]["db"]); - // calculate the difference between the database fields and those already prefetched - $dbFields[] = "id"; - // append id to the db fields array - $TVs = array_diff($TVs,$ditto->prefetch["fields"]["tv"]); - // calculate the difference between the tv fields and those already prefetched - $start = 0; - $stop = min($display,($queryLimit != 0) ? $queryLimit : $display,count($documentIDs)); - } else { - $queryLimit = ($queryLimit == 0) ? "" : $queryLimit; - } - - $resource = $ditto->getDocuments($documentIDs, $dbFields, $TVs, $orderBy, $showPublishedOnly, 0, $hidePrivate, $where, $queryLimit, $keywords, $randomize, $dateSource); - // retrieves documents - $output = $header; - // initialize the output variable and send the header - - if ($resource) { - if ($randomize != "0" && $randomize != "1") { - $resource = $ditto->weightedRandom($resource,$randomize,$stop); - // randomize the documents - } - - $resource = array_values($resource); - - for ($x=$start;$x<$stop;$x++) { - $template = $ditto->template->determine($templates,$x,0,$stop,$resource[$x]["id"]); - // choose the template to use and set the code of that template to the template variable - $renderedOutput = $ditto->render($resource[$x], $template, $removeChunk, $dateSource, $dateFormat, $placeholders,$phx,abs($start-$x)); - // render the output using the correct template, in the correct format and language - $modx->setPlaceholder($dittoID."item[".abs($start-$x)."]",$renderedOutput); - /* - Placeholder: item[x] - - Content: - Individual items rendered output - */ - $output .= $renderedOutput; - // send the rendered output to the buffer - } - } else { - $output .= $ditto->noResults($noResults,$paginate); - // if no documents are found return a no documents found string - } - $output .= $footer; - // send the footer - - // --------------------------------------------------- - // Save Object - // --------------------------------------------------- - - if($save) { - $modx->setPlaceholder($dittoID."ditto_object", $ditto); - $modx->setPlaceholder($dittoID."ditto_resource", ($save == "1") ? array_slice($resource,$display) : $resource); - } -} else { - $output = $header.$ditto->noResults($noResults,$paginate).$footer; -} -// --------------------------------------------------- -// Handle Debugging -// --------------------------------------------------- - -if ($debug == 1) { - $ditto_params =& $modx->event_params; - if (!isset($_GET["ditto_".$dittoID."debug"])) { - $_SESSION["ditto_debug_$dittoID"] = $ditto->debug->render_popup($ditto, $ditto_base, $ditto_version, $ditto_params, $documentIDs, array("db"=>$dbFields,"tv"=>$TVs), $display, $templates, $orderBy, $start, $stop, $total,$filter,$resource); - } - if (isset($_GET["ditto_".$dittoID."debug"])) { - switch ($_GET["ditto_".$dittoID."debug"]) { - case "open" : - exit($_SESSION["ditto_debug_$dittoID"]); - break; - case "save" : - $ditto->debug->save($_SESSION["ditto_debug_$dittoID"],"ditto".strtolower($ditto_version)."_debug_doc".$modx->documentIdentifier.".html"); - break; - } - } else { - $output = $ditto->debug->render_link($dittoID,$ditto_base).$output; - } -} - -return ($save != 3) ? $output : ""; \ No newline at end of file +return require MODX_BASE_PATH.'assets/snippets/ditto/snippet.ditto.php'; \ No newline at end of file From 1fc9a9b4fd2439e5c79ddd4d55c0492e953e51d1 Mon Sep 17 00:00:00 2001 From: Dmi3yy Date: Sun, 11 Aug 2013 09:29:28 +0300 Subject: [PATCH 227/530] upadate ditto to 2.1.1and Refactor #10071 Eform --- .../ditto/classes/ditto.class.inc.php | 95 ++++++++------- assets/snippets/ditto/snippet.ditto.php | 9 +- assets/snippets/eform/snippet.eform.php | 109 +++++++++++++++++ install/assets/snippets/ditto.tpl | 2 +- install/assets/snippets/eform.tpl | 110 +----------------- 5 files changed, 169 insertions(+), 156 deletions(-) create mode 100644 assets/snippets/eform/snippet.eform.php diff --git a/assets/snippets/ditto/classes/ditto.class.inc.php b/assets/snippets/ditto/classes/ditto.class.inc.php index 3155257057..d12d461d0f 100644 --- a/assets/snippets/ditto/classes/ditto.class.inc.php +++ b/assets/snippets/ditto/classes/ditto.class.inc.php @@ -256,7 +256,7 @@ function parseFilters($filter=false,$cFilters=false,$pFilters = false,$globalDel // Render the document output // --------------------------------------------------- - function render($resource, $template, $removeChunk,$dateSource,$dateFormat,$ph=array(),$phx=1,$x=0) { + function render($resource, $template, $removeChunk,$dateSource,$dateFormat,$ph=array(),$phx=1,$x=0,$stop) { global $modx,$ditto_lang; if (!is_array($resource)) { @@ -789,7 +789,7 @@ function appendTV($tvname="",$docIDs){ $tot = $modx->db->getRecordCount($rs); $resourceArray = array(); for($i=0;$i<$tot;$i++) { - $row = @$modx->fetchRow($rs); + $row = @$modx->db->getRow($rs); $resourceArray["#".$row['contentid']][$row['name']] = getTVDisplayFormat($row['name'], $row['value'], $row['display'], $row['display_params'], $row['type'],$row['contentid']); $resourceArray["#".$row['contentid']]["tv".$row['name']] = $resourceArray["#".$row['contentid']][$row['name']]; } @@ -798,7 +798,7 @@ function appendTV($tvname="",$docIDs){ $query .= " FROM $tb2"; $query .= " WHERE name='".$tvname."' LIMIT 1"; $rs = $modx->db->query($query); - $row = @$modx->fetchRow($rs); + $row = @$modx->db->getRow($rs); if (strtoupper($row['default_text']) == '@INHERIT') { foreach ($docIDs as $id) { $defaultOutput = getTVDisplayFormat($row['name'], $row['default_text'], $row['display'], $row['display_params'], $row['type'], $id); @@ -856,7 +856,7 @@ function fetchKeywords($resource) { // --------------------------------------------------- // Function: getChildIDs // Get the IDs ready to be processed - // Similar to the modx version by the same name but much faster + // --------------------------------------------------- function getChildIDs($IDs, $depth) { @@ -864,45 +864,11 @@ function getChildIDs($IDs, $depth) { $depth = intval($depth); $kids = array(); $docIDs = array(); - - if ($depth == 0 && $IDs[0] == 0 && count($IDs) == 1) { - foreach ($modx->documentMap as $null => $document) { - foreach ($document as $parent => $id) { - $kids[] = $id; - } - } - return $kids; - } else if ($depth == 0) { - $depth = 10000; - // Impliment unlimited depth... - } - - foreach ($modx->documentMap as $null => $document) { - foreach ($document as $parent => $id) { - $kids[$parent][] = $id; - } - } - - foreach ($IDs AS $seed) { - if (!empty($kids[intval($seed)])) { - $docIDs = array_merge($docIDs,$kids[intval($seed)]); - unset($kids[intval($seed)]); - } + // RedCat + foreach($IDs as $id) { + $kids = $modx->getChildIds($id,$depth); + $docIDs = array_merge($docIDs,$kids); } - $depth--; - - while($depth != 0) { - $valid = $docIDs; - foreach ($docIDs as $child=>$id) { - if (!empty($kids[intval($id)])) { - $docIDs = array_merge($docIDs,$kids[intval($id)]); - unset($kids[intval($id)]); - } - } - $depth--; - if ($valid == $docIDs) $depth = 0; - } - return array_unique($docIDs); } @@ -921,6 +887,7 @@ function getDocuments($ids= array (), $fields, $TVs, $orderBy, $published= 1, $d $limit= ($limit != "") ? "LIMIT $limit" : ""; // LIMIT capabilities - rad14701 $tblsc= $modx->getFullTableName("site_content"); $tbldg= $modx->getFullTableName("document_groups"); + $tbltvc = $modx->getFullTableName("site_tmplvar_contentvalues"); // modify field names to use sc. table reference $fields= "sc.".implode(",sc.",$fields); if ($randomize != 0) { @@ -928,7 +895,16 @@ function getDocuments($ids= array (), $fields, $TVs, $orderBy, $published= 1, $d } else { $sort= $orderBy['sql']; } + + //Added by Andchir (http://modx-shopkeeper.ru/) + if(substr($where, 0, 5)=="@SQL:"){ + $where = ($where == "") ? "" : substr(str_replace('@eq','=',$where), 5); + $left_join_tvc = "LEFT JOIN $tbltvc tvc ON sc.id = tvc.contentid"; + }else{ $where= ($where == "") ? "" : 'AND sc.' . implode('AND sc.', preg_replace("/^\s/i", "", explode('AND', $where))); + $left_join_tvc = ''; + } + if ($public) { // get document groups for current user if ($docgrp= $modx->getUserDocGroups()) @@ -939,7 +915,8 @@ function getDocuments($ids= array (), $fields, $TVs, $orderBy, $published= 1, $d $published = ($published) ? "AND sc.published=1" : ""; - $sql = "SELECT DISTINCT $fields FROM $tblsc sc + //$sql = "SELECT DISTINCT $fields FROM $tblsc sc + $sql = "SELECT DISTINCT $fields FROM $tblsc sc $left_join_tvc LEFT JOIN $tbldg dg on dg.document = sc.id WHERE sc.id IN (" . join($ids, ",") . ") $published AND sc.deleted=$deleted $where ".($public ? 'AND ('.$access.')' : '')." GROUP BY sc.id" . @@ -952,7 +929,7 @@ function getDocuments($ids= array (), $fields, $TVs, $orderBy, $published= 1, $d $TVIDs = array(); if ($cnt) { for ($i= 0; $i < $cnt; $i++) { - $resource = $modx->fetchRow($result); + $resource = $modx->db->getRow($result); if ($modx->config["server_offset_time"] != 0 && $dateSource !== false) { $dateValue = (is_int($resource[$dateSource]) !== true) ? $resource[$dateSource] : strtotime($resource[$dateSource]); $resource[$dateSource] = $dateValue + $modx->config["server_offset_time"]; @@ -1057,18 +1034,26 @@ public static function buildURL($args,$id=false,$dittoIdentifier=false) { $query = array(); foreach ($_GET as $param=>$value) { if ($param != 'id' && $param != 'q') { - $query[htmlspecialchars($param, ENT_QUOTES)] = htmlspecialchars($value, ENT_QUOTES); + $clean_param = htmlspecialchars($param, ENT_QUOTES, $modx->config['modx_charset']); + if(is_array($value)) { + //$query[$param] = $value; + foreach($value as $key => $val) { + $query[$clean_param][htmlspecialchars($key, ENT_QUOTES)] = htmlspecialchars($val, ENT_QUOTES, $modx->config['modx_charset']); + } + }else{ + $query[$clean_param] = htmlspecialchars($value, ENT_QUOTES, $modx->config['modx_charset']); + } } } if (!is_array($args)) { $args = explode("&",$args); foreach ($args as $arg) { $arg = explode("=",$arg); - $query[$dittoID.$arg[0]] = urlencode(trim($arg[1])); + $query[$dittoID.$arg[0]] = rawurlencode(trim($arg[1])); } } else { foreach ($args as $name=>$value) { - $query[$dittoID.$name] = urlencode(trim($value)); + $query[$dittoID.$name] = rawurlencode(trim($value)); } } $queryString = ""; @@ -1112,7 +1097,7 @@ function getParam($param,$langString){ // Paginate the documents // --------------------------------------------------- - function paginate($start, $stop, $total, $summarize, $tplPaginateNext, $tplPaginatePrevious, $tplPaginateNextOff, $tplPaginatePreviousOff, $tplPaginatePage, $tplPaginateCurrentPage, $paginateAlwaysShowLinks, $paginateSplitterCharacter) { + function paginate($start, $stop, $total, $summarize, $tplPaginateNext, $tplPaginatePrevious, $tplPaginateNextOff, $tplPaginatePreviousOff, $tplPaginatePage, $tplPaginateCurrentPage, $paginateAlwaysShowLinks, $paginateSplitterCharacter, $max_paginate, $max_previous) { global $modx, $dittoID,$ditto_lang; if ($stop == 0 || $total == 0 || $summarize==0) { @@ -1146,9 +1131,23 @@ function paginate($start, $stop, $total, $summarize, $tplPaginateNext, $tplPagin } $totalpages = ceil($total / $summarize); + $cur_x = floor($start / $summarize); + $min_x = $cur_x - $max_previous; + + if ($min_x < 0) $min_x = 0; + + $max_x = $min_x + $max_paginate - 1; + if ($max_x > $totalpages - 1) { + $max_x = $totalpages - 1; + $min_x = $max_x - $max_paginate + 1; + } + for ($x = 0; $x <= $totalpages -1; $x++) { $inc = $x * $summarize; $display = $x +1; + + if (($x < $min_x) || ($x > $max_x)) continue; + if ($inc != $start) { $pages .= $this->template->replace(array('url'=>$this->buildURL("start=$inc"),'page'=>$display),$tplPaginatePage); } else { diff --git a/assets/snippets/ditto/snippet.ditto.php b/assets/snippets/ditto/snippet.ditto.php index 728a5c44bb..79caa5fcf7 100644 --- a/assets/snippets/ditto/snippet.ditto.php +++ b/assets/snippets/ditto/snippet.ditto.php @@ -11,7 +11,7 @@ //---Core Settings---------------------------------------------------- // -$ditto_version = "2.1.0"; +$ditto_version = "2.1.1"; // Ditto version being executed $ditto_base = isset($ditto_base) ? $modx->config['base_path'].$ditto_base : $modx->config['base_path']."assets/snippets/ditto/"; @@ -822,6 +822,8 @@ // set initial stop count if($paginate == 1) { + $max_paginate = isset($max_paginate)? $max_paginate : 50; + $max_previous = isset($max_previous)? $max_previous : 25; $paginateAlwaysShowLinks = isset($paginateAlwaysShowLinks)? $paginateAlwaysShowLinks : 0; /* Param: paginateAlwaysShowLinks @@ -975,7 +977,7 @@ - */ - $ditto->paginate($start, $stop, $total, $display, $tplPaginateNext, $tplPaginatePrevious, $tplPaginateNextOff, $tplPaginatePreviousOff, $tplPaginatePage, $tplPaginateCurrentPage, $paginateAlwaysShowLinks, $paginateSplitterCharacter); + $ditto->paginate($start, $stop, $total, $display, $tplPaginateNext, $tplPaginatePrevious, $tplPaginateNextOff, $tplPaginatePreviousOff, $tplPaginatePage, $tplPaginateCurrentPage, $paginateAlwaysShowLinks, $paginateSplitterCharacter, $max_paginate, $max_previous); // generate the pagination placeholders } @@ -1088,4 +1090,5 @@ $output = str_replace('[+ditto+]',$output,$outerTpl); } -return ($save != 3) ? $output : "";?> \ No newline at end of file +return ($save != 3) ? $output : ""; +?> \ No newline at end of file diff --git a/assets/snippets/eform/snippet.eform.php b/assets/snippets/eform/snippet.eform.php new file mode 100644 index 0000000000..ff9b568494 --- /dev/null +++ b/assets/snippets/eform/snippet.eform.php @@ -0,0 +1,109 @@ +config["base_path"].'assets/snippets/'.$snipFolder.'/'; + + +# check if inside manager +if ($modx->isBackend()) { +return ''; # don't go any further when inside manager +} + +//tidying up some casing errors in parameters +if(isset($eformOnValidate)) $eFormOnValidate = $eformOnValidate; +if(isset($eformOnBeforeMailSent)) $eFormOnBeforeMailSent = $eformOnBeforeMailSent; +if(isset($eformOnMailSent)) $eFormOnMailSent = $eformOnMailSent; +if(isset($eformOnValidate)) $eFormOnValidate = $eformOnValidate; +if(isset($eformOnBeforeFormMerge)) $eFormOnBeforeFormMerge = $eformOnBeforeFormMerge; +if(isset($eformOnBeforeFormParse)) $eFormOnBeforeFormParse = $eformOnBeforeFormParse; +//for sottwell :) +if(isset($eFormCSS)) $cssStyle = $eFormCSS; + +# Snippet customize settings +$params = array ( + // Snippet Path + 'snipPath' => $snipPath, //includes $snipFolder + 'snipFolder' => $snipFolder, + +// eForm Params + 'vericode' => isset($vericode)? $vericode:"", + 'formid' => isset($formid)? $formid:"", + 'from' => isset($from)? $from:$modx->config['emailsender'], + + 'smtp' => isset($smtp)? $smtp:$modx->config['email_method'], + 'smtpfrom' => isset($smtpfrom)? $smtpfrom:$modx->config['email_smtp_sender'], + 'smtphost' => isset($smtphost)? $smtphost:$modx->config['email_host'], + 'smtppass' => isset($smtppass)? $smtppass:$modx->config['email_pass'], + 'smtpport' => isset($smtpport)? $smtpport:$modx->config['email_port'], + + 'fromname' => isset($fromname)? $fromname:$modx->config['site_name'], + 'to' => isset($to)? $to:$modx->config['emailsender'], + 'cc' => isset($cc)? $cc:"", + 'bcc' => isset($bcc)? $bcc:"", + 'subject' => isset($subject)? $subject:"", + 'ccsender' => isset($ccsender)?$ccsender:0, + 'sendirect' => isset($sendirect)? $sendirect:0, + 'mselector' => isset($mailselector)? $mailselector:0, + 'mobile' => isset($mobile)? $mobile:'', + 'mobiletext' => isset($mobiletext)? $mobiletext:'', + 'autosender' => isset($autosender)? $autosender:$from, + 'autotext' => isset($automessage)? $automessage:"", + 'category' => isset($category)? $category:0, + 'keywords' => isset($keywords)? $keywords:"", + 'gid' => isset($gotoid)? $gotoid:$modx->documentIdentifier, + 'noemail' => isset($noemail)? ($noemail):false, + 'saveform' => isset($saveform)? ($saveform? true:false):true, + 'tpl' => isset($tpl)? $tpl:"", + 'report' => isset($report)? $report:"", + 'allowhtml' => isset($allowhtml)? $allowhtml:0, + //Added by JJ + 'replyto' => isset($replyto)? $replyto:"", + 'language' => isset($language)? $language:$modx->config['manager_language'], + 'thankyou' => isset($thankyou)? $thankyou:"", + 'isDebug' => isset($debug)? $debug:0, + 'reportAbuse' => isset($reportAbuse)? $reportAbuse:false, + 'disclaimer' => isset($disclaimer)?$disclaimer:'', + 'sendAsHtml' => isset($sendAsHtml)?$sendAsHtml:false, + 'sendAsText' => isset($sendAsText)?$sendAsText:false, + 'sessionVars' => isset($sessionVars)?$sessionVars:false, + 'postOverides' => isset($postOverides)?$postOverides:0, + 'eFormOnBeforeMailSent' => isset($eFormOnBeforeMailSent)?$eFormOnBeforeMailSent:'', + 'eFormOnMailSent' => isset($eFormOnMailSent)?$eFormOnMailSent:'', + 'eFormOnValidate' => isset($eFormOnValidate)?$eFormOnValidate:'', + 'eFormOnBeforeFormMerge' => isset($eFormOnBeforeFormMerge)?$eFormOnBeforeFormMerge:'', + 'eFormOnBeforeFormParse' => isset($eFormOnBeforeFormParse)?$eFormOnBeforeFormParse:'', + 'cssStyle' => isset($cssStyle)?$cssStyle:'', + 'jScript' => isset($jScript)?$jScript:'', + 'submitLimit' => (isset($submitLimit) && is_numeric($submitLimit))?$submitLimit*60:0, + 'protectSubmit' => isset($protectSubmit)?$protectSubmit:1, + 'requiredClass' => isset($requiredClass)?$requiredClass:"required", + 'invalidClass' => isset($invalidClass)?$invalidClass:"invalid", + 'runSnippet' => ( isset($runSnippet) && !is_numeric($runSnippet) )?$runSnippet:'', + 'autoSenderName' => isset($autoSenderName)?$autoSenderName:'', + 'version' => '1.4.4' +); + +// pixelchutes PHx workaround +foreach( $params as $key=>$val ) $params[ $key ] = str_replace( array('((','))'), array('[+','+]'), $val ); + +# Start processing + +include_once ($snipPath."eform.inc.php"); + +$output = eForm($modx,$params); + +# Return +return $output; +?> \ No newline at end of file diff --git a/install/assets/snippets/ditto.tpl b/install/assets/snippets/ditto.tpl index 3348751f5b..078931a36d 100755 --- a/install/assets/snippets/ditto.tpl +++ b/install/assets/snippets/ditto.tpl @@ -5,7 +5,7 @@ * Summarizes and lists pages to create blogs, catalogs, PR archives, bio listings and more * * @category snippet - * @version 2.1.0 + * @version 2.1.1 * @license http://www.gnu.org/copyleft/gpl.html GNU Public License (GPL) * @internal @properties * @internal @modx_category Content diff --git a/install/assets/snippets/eform.tpl b/install/assets/snippets/eform.tpl index 4d64b5b95e..8ad330eb6c 100755 --- a/install/assets/snippets/eform.tpl +++ b/install/assets/snippets/eform.tpl @@ -4,110 +4,12 @@ * * Robust form parser/processor with validation, multiple sending options, chunk/page support for forms and reports, and file uploads * - * @category snippet - * @version 1.4.4.7 - * @license http://www.gnu.org/copyleft/gpl.html GNU Public License (GPL) - * @internal @properties - * @internal @modx_category Forms + * @category snippet + * @version 1.4.4.7 + * @license http://www.gnu.org/copyleft/gpl.html GNU Public License (GPL) + * @internal @properties + * @internal @modx_category Forms * @internal @installset base, sample */ -# eForm 1.4.4.7 - Electronic Form Snippet -# Original created by Raymond Irving 15-Dec-2004. -# Version 1.3+ extended by Jelle Jager (TobyL) September 2006 -# ----------------------------------------------------- -# Captcha image support - thanks to Djamoer -# Multi checkbox, radio, select support - thanks to Djamoer -# Form Parser and extened validation - by Jelle Jager -# -# see eform/docs/eform.htm for history, usage and examples -# - -# Set Snippet Paths -$snipFolder = isset($snipFolder)?$snipFolder:'eform'; -$snipPath = $modx->config["base_path"].'assets/snippets/'.$snipFolder.'/'; - - -# check if inside manager -if ($modx->isBackend()) { -return ''; # don't go any further when inside manager -} - -//tidying up some casing errors in parameters -if(isset($eformOnValidate)) $eFormOnValidate = $eformOnValidate; -if(isset($eformOnBeforeMailSent)) $eFormOnBeforeMailSent = $eformOnBeforeMailSent; -if(isset($eformOnMailSent)) $eFormOnMailSent = $eformOnMailSent; -if(isset($eformOnValidate)) $eFormOnValidate = $eformOnValidate; -if(isset($eformOnBeforeFormMerge)) $eFormOnBeforeFormMerge = $eformOnBeforeFormMerge; -if(isset($eformOnBeforeFormParse)) $eFormOnBeforeFormParse = $eformOnBeforeFormParse; -//for sottwell :) -if(isset($eFormCSS)) $cssStyle = $eFormCSS; - -# Snippet customize settings -$params = array ( - // Snippet Path - 'snipPath' => $snipPath, //includes $snipFolder - 'snipFolder' => $snipFolder, - -// eForm Params - 'vericode' => isset($vericode)? $vericode:"", - 'formid' => isset($formid)? $formid:"", - 'from' => isset($from)? $from:$modx->config['emailsender'], - 'fromname' => isset($fromname)? $fromname:$modx->config['site_name'], - 'to' => isset($to)? $to:$modx->config['emailsender'], - 'cc' => isset($cc)? $cc:"", - 'bcc' => isset($bcc)? $bcc:"", - 'subject' => isset($subject)? $subject:"", - 'ccsender' => isset($ccsender)?$ccsender:0, - 'sendirect' => isset($sendirect)? $sendirect:0, - 'mselector' => isset($mailselector)? $mailselector:0, - 'mobile' => isset($mobile)? $mobile:'', - 'mobiletext' => isset($mobiletext)? $mobiletext:'', - 'autosender' => isset($autosender)? $autosender:$from, - 'autotext' => isset($automessage)? $automessage:"", - 'category' => isset($category)? $category:0, - 'keywords' => isset($keywords)? $keywords:"", - 'gid' => isset($gotoid)? $gotoid:$modx->documentIdentifier, - 'noemail' => isset($noemail)? ($noemail):false, - 'saveform' => isset($saveform)? ($saveform? true:false):true, - 'tpl' => isset($tpl)? $tpl:"", - 'report' => isset($report)? $report:"", - 'allowhtml' => isset($allowhtml)? $allowhtml:0, - //Added by JJ - 'replyto' => isset($replyto)? $replyto:"", - 'language' => isset($language)? $language:$modx->config['manager_language'], - 'thankyou' => isset($thankyou)? $thankyou:"", - 'isDebug' => isset($debug)? $debug:0, - 'reportAbuse' => isset($reportAbuse)? $reportAbuse:false, - 'disclaimer' => isset($disclaimer)?$disclaimer:'', - 'sendAsHtml' => isset($sendAsHtml)?$sendAsHtml:false, - 'sendAsText' => isset($sendAsText)?$sendAsText:false, - 'sessionVars' => isset($sessionVars)?$sessionVars:false, - 'postOverides' => isset($postOverides)?$postOverides:0, - 'eFormOnBeforeMailSent' => isset($eFormOnBeforeMailSent)?$eFormOnBeforeMailSent:'', - 'eFormOnMailSent' => isset($eFormOnMailSent)?$eFormOnMailSent:'', - 'eFormOnValidate' => isset($eFormOnValidate)?$eFormOnValidate:'', - 'eFormOnBeforeFormMerge' => isset($eFormOnBeforeFormMerge)?$eFormOnBeforeFormMerge:'', - 'eFormOnBeforeFormParse' => isset($eFormOnBeforeFormParse)?$eFormOnBeforeFormParse:'', - 'cssStyle' => isset($cssStyle)?$cssStyle:'', - 'jScript' => isset($jScript)?$jScript:'', - 'submitLimit' => (isset($submitLimit) && is_numeric($submitLimit))?$submitLimit*60:0, - 'protectSubmit' => isset($protectSubmit)?$protectSubmit:1, - 'requiredClass' => isset($requiredClass)?$requiredClass:"required", - 'invalidClass' => isset($invalidClass)?$invalidClass:"invalid", - 'runSnippet' => ( isset($runSnippet) && !is_numeric($runSnippet) )?$runSnippet:'', - 'autoSenderName' => isset($autoSenderName)?$autoSenderName:'', - 'version' => '1.4.4' -); - -// pixelchutes PHx workaround -foreach( $params as $key=>$val ) $params[ $key ] = str_replace( array('((','))'), array('[+','+]'), $val ); - -# Start processing - -include_once ($snipPath."eform.inc.php"); - -$output = eForm($modx,$params); - -# Return -return $output; \ No newline at end of file +return require MODX_BASE_PATH.'assets/snippets/eform/snippet.eform.php'; \ No newline at end of file From bc5405335d8f553820590a4d752b4dc32d9ae5be Mon Sep 17 00:00:00 2001 From: Dmi3yy Date: Sun, 11 Aug 2013 09:31:00 +0300 Subject: [PATCH 228/530] small fix --- assets/snippets/eform/eform.inc.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/assets/snippets/eform/eform.inc.php b/assets/snippets/eform/eform.inc.php index 5fb7542046..5e0377fb1a 100644 --- a/assets/snippets/eform/eform.inc.php +++ b/assets/snippets/eform/eform.inc.php @@ -49,6 +49,9 @@ function eForm($modx,$params) { $fields = array(); //reset fields array - needed in case of multiple forms +// define some variables used as array index +$_dfnMaxlength = 6; + extract($params,EXTR_SKIP); // extract params into variables $fileVersion = '1.4.4'; From 2da2d887a560191fd3551d7daa5459fbc11aaa7f Mon Sep 17 00:00:00 2001 From: Dmi3yy Date: Sun, 11 Aug 2013 09:36:07 +0300 Subject: [PATCH 229/530] Refactor #10071 firstchildredirect --- .../snippet.firstchildredirect.php | 34 +++++++++++++++++++ install/assets/snippets/firstchild.tpl | 32 +---------------- 2 files changed, 35 insertions(+), 31 deletions(-) create mode 100644 assets/snippets/firstchildredirect/snippet.firstchildredirect.php diff --git a/assets/snippets/firstchildredirect/snippet.firstchildredirect.php b/assets/snippets/firstchildredirect/snippet.firstchildredirect.php new file mode 100644 index 0000000000..f7c8e4e5a3 --- /dev/null +++ b/assets/snippets/firstchildredirect/snippet.firstchildredirect.php @@ -0,0 +1,34 @@ + + * @modified-by Ryan Thrash + * @license Public Domain + * @version 1.0 + * + * This snippet redirects to the first child document of a folder in which this + * snippet is included within the content (e.g. [!FirstChildRedirect!]). This + * allows MODx folders to emulate the behavior of real folders since MODx + * usually treats folders as actual documents with their own content. + * + * Modified to make Doc ID a required parameter... now defaults to the current + * Page/Folder you call the snippet from. + * + * &docid=`12` + * Use the docid parameter to have this snippet redirect to the + * first child document of the specified document. + */ + +$docid = (isset($docid))? $docid: $modx->documentIdentifier; + +$children= $modx->getActiveChildren($docid, 'menuindex', 'ASC'); +if (!$children === false) { + $firstChild= $children[0]; + $firstChildUrl= $modx->makeUrl($firstChild['id']); +} else { + $firstChildUrl= $modx->makeUrl($modx->config['site_start']); +} +// return $modx->sendRedirect($firstChildUrl); +return $modx->sendRedirect($firstChildUrl,0,'REDIRECT_HEADER','HTTP/1.1 301 Moved Permanently'); +?> \ No newline at end of file diff --git a/install/assets/snippets/firstchild.tpl b/install/assets/snippets/firstchild.tpl index 1022b9a3b3..d2c417764e 100644 --- a/install/assets/snippets/firstchild.tpl +++ b/install/assets/snippets/firstchild.tpl @@ -12,34 +12,4 @@ * @internal @installset base */ - -/* - * @name FirstChildRedirect - * @author Jason Coward - * @modified-by Ryan Thrash - * @license Public Domain - * @version 1.0 - * - * This snippet redirects to the first child document of a folder in which this - * snippet is included within the content (e.g. [!FirstChildRedirect!]). This - * allows MODx folders to emulate the behavior of real folders since MODx - * usually treats folders as actual documents with their own content. - * - * Modified to make Doc ID a required parameter... now defaults to the current - * Page/Folder you call the snippet from. - * - * &docid=`12` - * Use the docid parameter to have this snippet redirect to the - * first child document of the specified document. - */ - -$docid = (isset($docid))? $docid: $modx->documentIdentifier; - -$children= $modx->getActiveChildren($docid, 'menuindex', 'ASC'); -if (!$children === false) { - $firstChild= $children[0]; - $firstChildUrl= $modx->makeUrl($firstChild['id']); -} else { - $firstChildUrl= $modx->makeUrl($modx->config['site_start']); -} -return $modx->sendRedirect($firstChildUrl,0,'REDIRECT_HEADER','HTTP/1.1 301 Moved Permanently'); +return require MODX_BASE_PATH.'assets/snippets/firstchildredirect/snippet.firstchildredirect.php'; \ No newline at end of file From 54ea39d6ae6354d7f237f069f76aab89ec6ae265 Mon Sep 17 00:00:00 2001 From: Dmi3yy Date: Sun, 11 Aug 2013 09:47:14 +0300 Subject: [PATCH 230/530] Refactor #10071 --- assets/snippets/if/snippet.if.php | 176 +++++++ .../listindexer/snippet.listindexer.php | 487 +++++++++++++++++ .../membercheck/snippet.membercheck.php | 137 +++++ .../personalize/snippet.personalize.php | 163 ++++++ .../ultimateparent/snippet.ultimateparent.php | 49 ++ install/assets/snippets/if.tpl | 175 +------ install/assets/snippets/listindexer.tpl | 495 +----------------- install/assets/snippets/membercheck.tpl | 135 +---- install/assets/snippets/personalize.tpl | 179 +------ install/assets/snippets/ultparent.tpl | 58 +- 10 files changed, 1036 insertions(+), 1018 deletions(-) create mode 100644 assets/snippets/if/snippet.if.php create mode 100644 assets/snippets/listindexer/snippet.listindexer.php create mode 100644 assets/snippets/membercheck/snippet.membercheck.php create mode 100644 assets/snippets/personalize/snippet.personalize.php create mode 100644 assets/snippets/ultimateparent/snippet.ultimateparent.php diff --git a/assets/snippets/if/snippet.if.php b/assets/snippets/if/snippet.if.php new file mode 100644 index 0000000000..5d160cd540 --- /dev/null +++ b/assets/snippets/if/snippet.if.php @@ -0,0 +1,176 @@ + 300 <= 700 +* [[if? &is=`[*price*]:gt:300:and:[*price*]:lte:700` &then=`@TPL:chunk-name`]] +* +* Sample №6 +* Output in the multiplicity of records Ditto 3 +* [[if? &is=`[+ditto_iteration+]:%:3` &then=`true` &else=`false`]] +* +* Sample №7 +* Output in the multiplicity of records Ditto 3 but by multiplying the +* [[if? &is=`[+ditto_iteration+]*2:%:3` &then=`true` &else=`false` &math=`on`]] +* +* Sample №8 +* Print the value of the mathematical expression +* [[if? &is=`[+ditto_iteration+]*2` &math=`on`]] +* +* Operator: +* (is,=) , (not,!=) , (>,gt) , (<,lt) , (>=,gte) , (lte,<=) , (isempty,empty) , (not_empty,!empty) +* (null, is_null) , (in_array, inarray, in) , (not_in,!in) +* +* More samples +* [[if? &is=`eval('global $iteration;$iteration++;echo $iteration;')` &math=`on`]] // iteration in Ditto,Wayfinder and others +* [[if? &is=`:is:` &then=`@eval: echo str_replace('
    ','','[*pagetitle*]');`]] // 'our
    works' -> 'our works' +* [[if? &is=`:is:` &then=`@eval: echo number_format('[*price*]', 2, ',', ' ');`]] // '1000000,89' -> '1 000 000,89' +* +* RussAndRussky.org.ua +**/ +$s=empty($separator)?':':$separator; +$opers=explode($s,$is); +$subject=$opers[0]; +$eq=true; +$and=false; +for ($i=1;$i': + case 'gt':$output = ($subject > $operand) ? true : false;$i++; + break; + case '<=': + case 'lte':$output = ($subject <= $operand) ? true : false;$i++; + break; + case '>=': + case 'gte':$output = ($subject >= $operand) ? true : false;$i++; + break; + case 'isempty': + case 'empty':$output = empty($subject) ? true : false; + break; + case '!empty': + case 'notempty': + case 'isnotempty':$output = empty($subject) || $subject == '' ? false : true; + break; + case 'isnull': + case 'null':$output = $subject == null || strtolower($subject) == 'null' ? true : false; + break; + case 'inarray': + case 'in_array': + case 'in': + $operand = explode(',',$operand); + $output = in_array($subject,$operand) ? true : false; + $i++; + break; + case 'not_in': + case '!in': + case '!inarray': + $operand = explode(',',$operand); + $output = in_array($subject,$operand) ? false : true; + $i++; + break; + + case '==': + case '=': + case 'eq': + case 'is': + default: + $output = ((string)$subject == (string)$operand) ? true : false; + $i++; + break; + } + + $eq=$output?$eq:false; + + } + } +} +if ($lp==1){ + if ($left_part) { + if (!empty($part_eq)){ + if ($part_eq||$eq){$output=$then;} + } else { + $output=$eq?$then:$else; + } + } + else + { + $output=$else; + } +} else { + if (!empty($part_eq)){ + if ($part_eq||$eq){ + $output=$then; + } + } else {$output=$eq?$then:$else;} +} +if (strpos($output,'@TPL:')!==FALSE){$output='{{'.(str_replace('@TPL:','',$output)).'}}';} + +if (substr($output,0,6) == "@eval:") { + ob_start(); + eval(substr($output,6)); + $output = ob_get_contents(); + ob_end_clean(); +} +if (empty($then)&&empty($else)) { + if ($math=='on') {eval('$subject='.$subject.';');} + return $subject; +} + +return $output; +?> \ No newline at end of file diff --git a/assets/snippets/listindexer/snippet.listindexer.php b/assets/snippets/listindexer/snippet.listindexer.php new file mode 100644 index 0000000000..b8e75177d7 --- /dev/null +++ b/assets/snippets/listindexer/snippet.listindexer.php @@ -0,0 +1,487 @@ +s on new lines. Generally, if you + // are displaying then inline (horizontal, you do not want new + // lines, but standard vertical block styling you do. This is + // for IE, real browsers don't care. + $newLinesForLists = true; + +// Styles +// +// The following are the styles included in this snippet. It is up +// to you to include these styles in your stylesheet to get them to +// look the way you want. + + // div.LIn_title {} List title div + // ul.LIn_fullMode {} UL class + // ul.LIn_shortMode {} UL class + // span.LIn_date {} Span surrounding pub/created date + // span.LIn_desc {} Span surrounding description + // div.LIn_pagination Div surrounding pagination links + // span.LIn_currentPage {} Span surrounding current page of + // pagination (which wouldn't be css-able + // by virtue of its tag) + + +// ********************************************************************** +// END CONFIG SETTINGS +// THE REST SHOULD TAKE CARE OF ITSELF +// ********************************************************************** + +// Take care of IE list issue +$ie = ($newLinesForLists)? "\n" : '' ; + +// Use snippet call defined variables if set +$activeTitle = (isset($LIn_title))? $LIn_title : $defaultTitle ; +$mode = (isset($LIn_mode))? $LIn_mode : $mode ; +$descendentDepth = (isset($LIn_depth))? $LIn_depth : $descendentDepth ; +$seeThruUnpub = (isset($LIn_seeThru))? $LIn_seeThru : $seeThruUnpub ; +$seeShowInMenu = (isset($LIn_seeShowInMenu))? $LIn_seeShowInMenu : $seeShowInMenu ; +$hidePrivate = (isset($LIn_hidePrivate))? $LIn_hidePrivate : $hidePrivate; +$linkToIndex = (isset($LIn_link))? $LIn_link : $linkToIndex ; +$rootFolder = (isset($LIn_root))? $LIn_root : $rootFolder ; +$shortQty = (isset($LIn_sQty))? $LIn_sQty : $shortQty ; +$fullQty = (isset($LIn_fQty))? $LIn_fQty : $fullQty ; +$showCreationDate = (isset($LIn_showDate))? $LIn_showDate : $showCreationDate ; +$indexText = (isset($LIn_indexText))? $LIn_indexText : $indexText ; +$useFastUrls = (isset($LIn_fast))? $LIn_fast : $useFastUrls ; +$sortBy = (isset($LIn_sort))? $LIn_sort : $sortBy; +$shortDesc = (isset($LIn_sDesc))? $LIn_sDesc : $shortDesc ; +$fullDesc = (isset($LIn_fDesc))? $LIn_fDesc : $fullDesc ; +$sortDir = (isset($LIn_dir))? $LIn_dir : $sortDir ; +if ($sortDir == '') $sortDir = ($sortBy == 'date')? 'DESC' : 'ASC' ; + + +// Make useful variable shortcut for the content table +//$tbl = $modx->dbConfig['dbase'] . "." . $modx->dbConfig['table_prefix'] . "site_content"; +$tblsc = $modx->getFullTableName("site_content"); +$tbldg = $modx->getFullTableName("document_groups"); + +// Initialize output +$output = ''; + +// --------------------------------------------------- +// --------------------------------------------------- +// Query db for parent folders, or not. First check to +// see if a querystring cheat has been provided- this +// should speed things up considerably when using this +// in full mode. (a.k.a. fastUrls) +// --------------------------------------------------- +// --------------------------------------------------- +$inFolder= isset($_GET['LIn_f'])? $_GET['LIn_f']: 0; +if ((!$inFolder && $useFastUrls) || !$useFastUrls ){ + // Only run all the database queries if we don't already + // know the folders AND fastUrls are desired. + + // --------------------------------------------------- + // Seed list of viable parents + // --------------------------------------------------- + + if ($rootFolder == NULL){ + $rootFolder = $modx->documentIdentifier; + } + // Set root level parent array + $seedArray = explode(',',$rootFolder); + $parentsArray = array(); + foreach($seedArray AS $seed){ + $parentsArray['level_0'][] = $seed; + } + + // --------------------------------------------------- + // Make array of all allowed parents + // --------------------------------------------------- + + // Process valid parents + $levelCounter = 1; + + while (((count($parentsArray) < $descendentDepth) || ($descendentDepth == 0)) && ($levelCounter <= count($parentsArray)) && ($levelCounter < 10)){ + + // Find all decendant parents for this level + $pLevel = 'level_'.($levelCounter - 1); + $tempLevelArray = $parentsArray[$pLevel]; + + foreach($tempLevelArray AS $p){ + + // Get children who are parents (isfolder = 1) + $validParentSql = ""; + $validParentSql .= "SELECT id FROM $tblsc sc WHERE "; + $validParentSql .= "isfolder = 1 AND parent = $p "; + $validParentSql .= "AND sc.deleted=0 "; + $validParentSql .= ($seeThruUnpub)? ";" : "AND sc.published = 1;"; + + // Run statement + $rsTempParents = $modx->dbQuery($validParentSql); + // Get number of results + $countTempParents = $modx->recordCount($rsTempParents); + + // If there are results, put them in an array + $tempValidArray = false; + if ($countTempParents){ + for ($i=0;$i<$countTempParents;$i++){ + $tempId = $modx->fetchRow($rsTempParents); + $tempValidArray[] = $tempId['id']; + } // end while + } // end if + + // populate next level of array + if ($tempValidArray){ + foreach($tempValidArray AS $kid){ + $kidLevel = 'level_'.$levelCounter; + $parentsArray[$kidLevel][] = $kid; + } // end foreach + + } // end if + } // end foreach + + // Do next level + $levelCounter++; + + } // end while + + // Finalize list of parents + $validParents = ''; + foreach ($parentsArray AS $level){ + foreach ($level AS $validP){ + $validParents .= $validP . ','; + } + } + + // Remove trailing comma + $validParents = substr($validParents,0,strlen($validParents)-1); + +} else { + $validParents = $_GET['LIn_f']; +} + +// --------------------------------------------------- +// Make appropriate SQL statement to pull recent items +// --------------------------------------------------- + +// get document groups for current user +if($docgrp = $modx->getUserDocGroups()) $docgrp = implode(",",$docgrp); + +$access = " (".($modx->isFrontend() ? "sc.privateweb=0":"1='".$_SESSION['mgrRole']."' OR sc.privatemgr=0"). + (!$docgrp ? "":" OR dg.document_group IN ($docgrp)").") AND "; + +// Initialize +$recentSql = ""; +$recentSql .= "SELECT sc.id, pagetitle, description"; +// Include pub_date or createdon date if date is desired +$recentSql .= ($showCreationDate)? ", IF(pub_date > 0, pub_date, createdon) AS pubDate ": " " ; +$recentSql .= "FROM $tblsc sc LEFT JOIN $tbldg dg on dg.document = sc.id "; +$recentSql .= "WHERE "; +$recentSql .= ($hidePrivate)? $access:""; +// Look everywhere, or just under valid parents +$recentSql .= (($rootFolder == 0) && $seeThruUnpub && ($descendentDepth == 0))? "" : "parent IN ($validParents) AND " ; +// Published +$recentSql .= "sc.published = 1 "; +// Show In Menu +$recentSql .= ($seeShowInMenu)? " " : " AND sc.hidemenu=0 " ; +// Not deleted +$recentSql .= "AND sc.deleted=0 "; +// Choose sort method +switch ($sortBy){ + case 'alpha': + $recentSql .= "ORDER BY pagetitle "; + break; + case 'menuindex': + $recentSql .= "ORDER BY menuindex "; + break; + default: + $recentSql .= "ORDER BY IF(pub_date>0, pub_date, createdon) "; + break; +} +// Provide a sort direction +$recentSql .= $sortDir; + +// If this is a short list, just pull a limited number +$recentSql .= ($mode == 'short')? " LIMIT $shortQty;" : ";" ; + +// Run statement +$rsRecent = $modx->dbQuery($recentSql); +// Count records +$recentLimit = $modx->recordCount($rsRecent); + +// --------------------------------------------------- +// Generate pagination string if needed +// --------------------------------------------------- +$offsetParam = isset($_GET['LIn_o'])? $_GET['LIn_o']: 0; +$offset = ($offsetParam && ($mode == 'full'))? $offsetParam : 0 ; +$pagination = ''; + +// Don't bother unless there are enough records to justify it +if ( ($mode == 'full') && ($recentLimit > $fullQty) && ($fullQty) ){ + $fullUrl = $_SERVER['REQUEST_URI']; + $urlPieces = parse_url($fullUrl); + $urlPath = $urlPieces['path']; + $otherQs = ''; + + if ($urlPieces['query']){ + foreach($_GET AS $qsKey=>$qsValue){ + if (($qsKey != 'LIn_o') && ($qsKey != 'LIn_f')){ + $otherQs .= '&'.$qsKey.'='.$qsValue; + } + } + } + + $fastUrl = $urlPath.'?LIn_f='.$validParents.$otherQs; + + // Determine number of pages needed to show results + $totalPages = ceil($recentLimit/$fullQty); + + // Make links + for ($j = 0 ; $j < $totalPages; $j++){ + // only include links to OTHER pages, not current page + if($offset == $j*$fullQty){ + $pagination .= ''.($j+1) .''; + } else { + $pagination .= ''.($j+1) .''; + } + if ($j < $totalPages-1){ + $pagination .= $pageSeparator; + } + } + + // Make final pagination link set in it's own div + $pagination = '
    '."\n".$pagination."\n
    \n"; + +} + + +// --------------------------------------------------- +// Create title if wanted +// --------------------------------------------------- + +if ($activeTitle){ + $output .= '
    '.$activeTitle.'
    '."\n"; +} + +// --------------------------------------------------- +// Create list of recent items +// --------------------------------------------------- + +// Include pagination +$output .= ($pgPosition == 'top' || $pgPosition == 'both')? $pagination : '' ; + +$output .= '
      ' . $ie; + +$recentCounter = $offset; +if ($mode == 'short') { + $recentCounterLimit = min($shortQty,$recentLimit); +} else { + $recentCounterLimit = ($fullQty)? min(($fullQty+$offset),$recentLimit) : $recentLimit ; +} + +while (($recentCounter < $recentCounterLimit) && $rsRecent && ($recentLimit > 0)){ + mysql_data_seek($rsRecent,$recentCounter); + $recentRecord = $modx->fetchRow($rsRecent); + $output .= '
    • '; + // Link to page + $output .= ''.$recentRecord['pagetitle'].' '; + // Date if desired + if ($showCreationDate){ + $output .= ''.date($dateFormat,$recentRecord['pubDate']).' '; + } + // Description if desired + if ((($mode == 'short') && ($shortDesc)) || (($mode == 'full') && ($fullDesc))){ + $output .= ''.$recentRecord['description'].''; + } + // wrap it up + $output .= '
    • ' . $ie; + $recentCounter ++; +} + +$output .= '
    ' . $ie; + +$output .= ($pgPosition == 'bottom' || $pgPosition == 'both')? $pagination : '' ; + +// --------------------------------------------------- +// Link to index +// --------------------------------------------------- + +if ($linkToIndex) { + + $output .= '
    '; + $output .= ''.$indexText.''; + $output .= '
    '; + +} + +// --------------------------------------------------- +// Send to browser +// --------------------------------------------------- + +return $output; +?> \ No newline at end of file diff --git a/assets/snippets/membercheck/snippet.membercheck.php b/assets/snippets/membercheck/snippet.membercheck.php new file mode 100644 index 0000000000..12d1b924dc --- /dev/null +++ b/assets/snippets/membercheck/snippet.membercheck.php @@ -0,0 +1,137 @@ +insideManager()) { + return ''; # don't go any further when inside manager +} + +if (!isset ($groups)) { + return $debug ? '

    Error: No Group Specified

    ' : ''; +} + +if (!isset ($chunk)) { + return $debug ? '

    Error: No Chunk Specified

    ' : ''; +} + +# turn comma-delimited list of groups into an array +$groups = explode(',', $groups); + +if (!class_exists('MemberCheck')) { + class MemberCheck { + var $allGroups = NULL; + var $debug; + + function getInstance($debug) { + static $instance; + if (!isset ($instance)) { + $instance = new MemberCheck($debug); + } + return $instance; + } + + function MemberCheck($debug = false) { + global $modx; + + $this->debug = $debug; + if ($debug) { + $this->allGroups = array (); + $tableName = $modx->getFullTableName('webgroup_names'); + $sql = "SELECT name FROM $tableName"; + if ($rs = $modx->db->query($sql)) { + while ($row = $modx->db->getRow($rs)) { + array_push($this->allGroups, stripslashes($row['name'])); + } + } + } + } + + function isValidGroup($groupName) { + $isValid = !(array_search($groupName, $this->allGroups) === false); + return $isValid; + } + + function getMemberChunk(& $groups, $chunk) { + global $modx; + $o = ''; + if (is_array($groups)) { + for ($i = 0; $i < count($groups); $i++) { + $groups[$i] = trim($groups[$i]); + if ($this->debug) { + if (!$this->isValidGroup($groups[$i])) { + return "

    The group " . $groups[$i] . " could not be found...

    "; + } + } + } + + $check = $modx->isMemberOfWebGroup($groups); + + $chunkcheck = $modx->getChunk($chunk); + + $o .= ($check && $chunkcheck) ? $chunkcheck : ''; + if (!$chunkcheck) + $o .= $this->debug ? "

    The chunk $chunk not found...

    " : ''; + } else { + $o .= "

    No valid group names were specified!

    "; + } + + return $o; + } + } +} + +$memberCheck = MemberCheck :: getInstance($debug); + +if (!isset ($ph)) { + return $memberCheck->getMemberChunk($groups, $chunk); +} else { + $modx->setPlaceholder($ph, $memberCheck->getMemberChunk($groups, $chunk)); + return ''; +} +?> \ No newline at end of file diff --git a/assets/snippets/personalize/snippet.personalize.php b/assets/snippets/personalize/snippet.personalize.php new file mode 100644 index 0000000000..d15def9681 --- /dev/null +++ b/assets/snippets/personalize/snippet.personalize.php @@ -0,0 +1,163 @@ +isFrontend() && isset ($_SESSION['webValidated'])) $current_context = 'web'; +elseif ($this->isBackend() && isset ($_SESSION['mgrValidated'])) $current_context = 'mgr'; + +$output = ''; +$yesChunk = (isset($yesChunk))? $yesChunk : ''; +$noChunk = (isset($noChunk)) ? $noChunk : ''; +$ph = (isset($ph)) ? $ph : 'username'; +$context = (isset($context)) ? $context : $current_context; +$yesTV = (isset($yesTV)) ? $yesTV : ''; +$noTV = (isset($noTV)) ? $noTV : ''; + +/* +$referer = htmlspecialchars($_SERVER['HTTP_REFERER'], ENT_QUOTES); +$ua = htmlspecialchars($_SERVER['HTTP_USER_AGENT'], ENT_QUOTES); +$ip = htmlspecialchars($_SERVER['REMOTE_ADDR'], ENT_QUOTES); +$host = htmlspecialchars($_SERVER['REMOTE_HOST'], ENT_QUOTES); + +$ua_strtolower = strtolower($_SERVER['HTTP_USER_AGENT']); +if (strpos($ua_strtolower, 'firefox') !== false) $browser = 'firefox'; +elseif(strpos($ua_strtolower, 'trident/4.0') !== false) $browser = 'internet explorer 8'; +elseif(strpos($ua_strtolower, 'msie') !== false) $browser = 'internet explorer'; +elseif(strpos($ua_strtolower, 'chrome') !== false) $browser = 'chrome'; +elseif(strpos($ua_strtolower, 'safari') !== false) $browser = 'safari'; +elseif(strpos($ua_strtolower, 'opera') !== false) $browser = 'opera'; +else $browser = 'other'; + +$modx->setPlaceholder('referer', $referer); +$modx->setPlaceholder('ua', $ua); +$modx->setPlaceholder('browser', $browser); +$modx->setPlaceholder('ip', $ip); +$modx->setPlaceholder('host', $host); +*/ + +switch($context) +{ + case 'web': + $short_name = $_SESSION['webShortname']; + $full_name = $_SESSION['webFullname']; + $email = $_SESSION['webEmail']; + $last_login = $_SESSION['webLastlogin']; + break; + case 'mgr': + case 'manager': + $short_name = $_SESSION['mgrShortname']; + $full_name = $_SESSION['mgrFullname']; + $email = $_SESSION['mgrEmail']; + $last_login = $_SESSION['mgrLastlogin']; + break; + default: + $short_name = ''; +} +if (!empty($context)) +{ + if($yesTV !== '') + { + $pre_output = $modx->documentObject[$yesTV]; + if(is_array($pre_output)) + { + $output = $pre_output[1]; + } + else + { + $output = $pre_output; + } + } + elseif($yesChunk !== '') + { + $output = $modx->getChunk($yesChunk); + } + else + { + $output = 'username : ' . $short_name; + } + + if(empty($last_login)) $last_login_text = 'first login'; + else $last_login_text = $modx->toDateFormat($last_login); + + $modx->setPlaceholder($ph,$short_name); + $modx->setPlaceholder('short_name', $short_name); + $modx->setPlaceholder('full_name', $full_name); + $modx->setPlaceholder('email', $email); + $modx->setPlaceholder('last_login', $last_login_text); +} +else +{ + if($noTV !== '') + { + $pre_output = $modx->documentObject[$noTV]; + if(is_array($pre_output)) + { + $output = $pre_output[1]; + } + else + { + $output = $pre_output; + } + } + elseif($noChunk!=='') + { + $output = $modx->getChunk($noChunk); + } + else + { + $output = 'guest'; + } +} +return $output; +?> \ No newline at end of file diff --git a/assets/snippets/ultimateparent/snippet.ultimateparent.php b/assets/snippets/ultimateparent/snippet.ultimateparent.php new file mode 100644 index 0000000000..5d7d8ca246 --- /dev/null +++ b/assets/snippets/ultimateparent/snippet.ultimateparent.php @@ -0,0 +1,49 @@ + + * + * @param &id The id of the document whose parent you want to find. + * @param &top The top node for the search. + * @param &topLevel The top level node for the search (root = level 1) + * + * @license Public Domain, use as you like. + * + * @example [[UltimateParent? &id=`45` &top=`6`]] + * Will find the ultimate parent of document 45 if it is a child of document 6; + * otherwise it will return 45. + * + * @example [[UltimateParent? &topLevel=`2`]] + * Will find the ultimate parent of the current document at a depth of 2 levels + * in the document hierarchy, with the root level being level 1. + * + * This snippet travels up the document tree from a specified document and + * returns the "ultimate" parent. Version 2.0 was rewritten to use the new + * getParentIds function features available only in MODx 0.9.5 or later. + * + * Based on the original UltimateParent 1.x snippet by Susan Ottwell + * . The topLevel parameter was introduced by staed and + * adopted here. + */ +$top= isset ($top) && intval($top) ? $top : 0; +$id= isset ($id) && intval($id) ? intval($id) : $modx->documentIdentifier; +$topLevel= isset ($topLevel) && intval($topLevel) ? intval($topLevel) : 0; +if ($id && $id != $top) { + $pid= $id; + if (!$topLevel || count($modx->getParentIds($id)) >= $topLevel) { + while ($parentIds= $modx->getParentIds($id, 1)) { + $pid= array_pop($parentIds); + if ($pid == $top) { + break; + } + $id= $pid; + if ($topLevel && count($modx->getParentIds($id)) < $topLevel) { + break; + } + } + } +} +return $id; +?> \ No newline at end of file diff --git a/install/assets/snippets/if.tpl b/install/assets/snippets/if.tpl index 15a11a32a0..2aebfee969 100644 --- a/install/assets/snippets/if.tpl +++ b/install/assets/snippets/if.tpl @@ -13,177 +13,4 @@ * @author Created By Bumkaka (bumkaka@yandex.ru) */ -/** -* if snippet -* Date: Jan 03, 2013 -* -* [[if? &is=`[*id*]:is:4:or:[*parent*]:in:5,6,5,7,8,9` &then=`[[if? &is=`0||is||0` &then=`true` &else=`false` &separator=`||`]]` &else=`@TPL:else`]] -* [[if? &is=`[*id*]:is:1:or:[*id*]:is:2:and:[*parent*]:is:5:or:[*parent*]:in:2,3,4` &then=`true` &else=`false`]] -* -* All expressions are logically (....:or:is:.... ) :and: (...:!empty:.....) -* expression and divides the condition into 2 parts, which in the end compared to the true -* -* Sample №1 -* Output action is necessary only in the parent ID = 5 -* [[if? &is=`[*parent*]:is:5` &then=`@TPL:chunk-name`]] -* -* Sample №2 -* Output action is necessary only in the parent ID = 5 or template IDs in (7,8,9) -* [[if? &is=`[*parent*]:is:5:or:[*template*]:in:7,8,9` &then=`@TPL:chunk-name`]] -* -* Sample №3 -* Output action is necessary only in the parent ID = 5 and only the resource with the template ID = 7 -* [[if? &is=`[*parent*]:is:5:and:[*template*]:is:7` &then=`@TPL:chunk-name`]] -* -* Sample №4 -* Output action is necessary only in the parent ID = 5 and (only in the template ID = 7 or in other templates but with TV `new` = 1 -* [[if? &is=`[*parent*]:is:5:and:[*template*]:is:7:or:[*new*]:is:1` &then=`@TPL:chunk-name`]] -* -* Sample №5 -* Output share for the goods with a price in the range of > 300 <= 700 -* [[if? &is=`[*price*]:gt:300:and:[*price*]:lte:700` &then=`@TPL:chunk-name`]] -* -* Sample №6 -* Output in the multiplicity of records Ditto 3 -* [[if? &is=`[+ditto_iteration+]:%:3` &then=`true` &else=`false`]] -* -* Sample №7 -* Output in the multiplicity of records Ditto 3 but by multiplying the -* [[if? &is=`[+ditto_iteration+]*2:%:3` &then=`true` &else=`false` &math=`on`]] -* -* Sample №8 -* Print the value of the mathematical expression -* [[if? &is=`[+ditto_iteration+]*2` &math=`on`]] -* -* Operator: -* (is,=) , (not,!=) , (>,gt) , (<,lt) , (>=,gte) , (lte,<=) , (isempty,empty) , (not_empty,!empty) -* (null, is_null) , (in_array, inarray, in) , (not_in,!in) -* -* More samples -* [[if? &is=`eval('global $iteration;$iteration++;echo $iteration;')` &math=`on`]] // iteration in Ditto,Wayfinder and others -* [[if? &is=`:is:` &then=`@eval: echo str_replace('
    ','','[*pagetitle*]');`]] // 'our
    works' -> 'our works' -* [[if? &is=`:is:` &then=`@eval: echo number_format('[*price*]', 2, ',', ' ');`]] // '1000000,89' -> '1 000 000,89' -* -* RussAndRussky.org.ua -**/ - -$s=empty($separator)?':':$separator; -$opers=explode($s,$is); -$subject=$opers[0]; -$eq=true; -$and=false; -for ($i=1;$i': - case 'gt':$output = ($subject > $operand) ? true : false;$i++; - break; - case '<=': - case 'lte':$output = ($subject <= $operand) ? true : false;$i++; - break; - case '>=': - case 'gte':$output = ($subject >= $operand) ? true : false;$i++; - break; - case 'isempty': - case 'empty':$output = empty($subject) ? true : false; - break; - case '!empty': - case 'notempty': - case 'isnotempty':$output = empty($subject) || $subject == '' ? false : true; - break; - case 'isnull': - case 'null':$output = $subject == null || strtolower($subject) == 'null' ? true : false; - break; - case 'inarray': - case 'in_array': - case 'in': - $operand = explode(',',$operand); - $output = in_array($subject,$operand) ? true : false; - $i++; - break; - case 'not_in': - case '!in': - case '!inarray': - $operand = explode(',',$operand); - $output = in_array($subject,$operand) ? false : true; - $i++; - break; - - case '==': - case '=': - case 'eq': - case 'is': - default: - $output = ((string)$subject == (string)$operand) ? true : false; - $i++; - break; - } - - $eq=$output?$eq:false; - - } - } -} -if ($lp==1){ - if ($left_part) { - if (!empty($part_eq)){ - if ($part_eq||$eq){$output=$then;} - } else { - $output=$eq?$then:$else; - } - } - else - { - $output=$else; - } -} else { - if (!empty($part_eq)){ - if ($part_eq||$eq){ - $output=$then; - } - } else {$output=$eq?$then:$else;} -} -if (strpos($output,'@TPL:')!==FALSE){$output='{{'.(str_replace('@TPL:','',$output)).'}}';} - -if (substr($output,0,6) == "@eval:") { - ob_start(); - eval(substr($output,6)); - $output = ob_get_contents(); - ob_end_clean(); -} -if (empty($then)&&empty($else)) { - if ($math=='on') {eval('$subject='.$subject.';');} - return $subject; -} - -return $output; \ No newline at end of file +return require MODX_BASE_PATH.'assets/snippets/if/snippet.if.php'; \ No newline at end of file diff --git a/install/assets/snippets/listindexer.tpl b/install/assets/snippets/listindexer.tpl index 214c41497b..9994794fa8 100644 --- a/install/assets/snippets/listindexer.tpl +++ b/install/assets/snippets/listindexer.tpl @@ -4,495 +4,12 @@ * * A flexible way to show the most recent Resources and other Resource lists * - * @category snippet - * @version 1.0.1 - * @license http://www.gnu.org/copyleft/gpl.html GNU Public License (GPL) - * @internal @properties - * @internal @modx_category Navigation + * @category snippet + * @version 1.0.1 + * @license http://www.gnu.org/copyleft/gpl.html GNU Public License (GPL) + * @internal @properties + * @internal @modx_category Navigation * @internal @installset base */ -// added in 1.0.1: hidePrivate (hide items from unauthorized users) -// -// Derived from ListIndex 0.6j by jaredc@honeydewdesign.com -// Now supports Show In Menu -// -// This snippet was designed to be a VERY flexible way -// of showing what has been recently added. You can use -// this snippet to show news from one folder, or what has -// been recently added site wide. You can even show what's -// new in a 'section' (everything under a defined folder)! - -// Configuration Settings - - // Set the following snippet defaults the way you would normally - // use this snippet, then use snippet variables in other situations - // to override the default behaviors. - - // GENERAL OPTIONS - - // $rootFolder [ NULL | string (comma separated page id's) ] - // Decide which folder to pull recent documents from. - // If you want to specify a few folders, comma separate them. - // The default NULL will set current page as root. Using 0 - // would search site wide. Can be set with snippet parameter - // $LIn_root like: - // [[ListIndexer?LIn_root=3,6,88]] - $rootFolder = NULL; - - // $descendentDepth [ int ] - // How many levels below the root folder(s) do you want to - // include? Can be overridden in snippet call with LIn_depth: - // [[ListIndexer?LIn_depth=2]] - // Uncomment one of these common two or create your own: - // $descendentDepth = 1; // just children of root folder(s) - $descendentDepth = 0; // all decendents of root folder(s) - - // $seeThruUnpub [ true | false ] - // When using descendents, do you want to consider files below - // an unpublished (hidden) folder? Usually no. But you decide. - // Snippet parameter: LIn_seeThru - // [[ListIndexer?LIn_seeThru=1]] - $seeThruUnpub = false; - - // $seeShowInMenu [ true | false ] - // When using descendents, do you want to consider files flagged - // to be hidden from the menus? Usually no. But you decide. - // Snippet parameter: LIn_seeShowInMenu - // [[ListIndexer?LIn_seeShowInMenu=1]] - $seeShowInMenu = false; - - // $hidePrivate [ true | false ] - // Hide items from users that don't have appropriate - // rights to view. Usually true. But you decide. - // Snippet parameter: LIn_hidePrivate - // [[ListIndexer?LIn_hidePrivate=0]] - $hidePrivate = true; - - // $mode [ 'short' | 'full' ] - // Defines whether this list should be a full, paged - // list of all documents, or a short list of the most - // recent few (how many will be defined next). Can be - // overridden in snippet call with $LIn_mode: - // [[ListIndexer?LIn_mode=full]] - $mode = 'short'; - - // $sortBy [ 'alpha' | 'date' | 'menuindex' ] - // The default date will sort by most recent items first, but - // by using the 'alpha' option, and using full mode, you could - // use this to create an index, or directory. - // Settable with snippet call $LIn_sort: - // [[ListIndexer?LIn_sort=alpha]] - $sortBy = 'date'; - - // $sortDir [ 'ASC' | 'DESC' ] - // Sort direction ascending or descending. Is applied to whatever $sortBy - // field you have chosen above. If left blank, menuindex and alpha will sort - // ASC and date DESC. - // $LIn_dir in snippet call: - // [[ListIndexer?LIn_dir=ASC&LIn_sortBy=menuindex]] - $sortDir = ''; - - // WHAT TO DISPLAY - - // $defaultTitle [ string ] - // If you want a default title for your list - // you can declare it here. Or use an empty - // string to leave this off. This can be overridden - // in the snippet call with the variable $LIn_title: - // [[ListIndexer?LIn_title=Some new title]] - $defaultTitle = ''; - - // $shortDesc [ true | false ] - // Show the description on the short list, or not. Snippet - // parameter $LIn_sDesc: - // [[ListIndexer?LIn_sDesc=0]] - $shortDesc = true; - - // $fullDesc [ true | false ] - // Show the description on the full list, or not. Snippet - // parameter $LIn_fDesc: - // [[ListIndexer?LIn_fDesc=0]] - $fullDesc = true; - - // $linkToIndex [ int ] - // If you have a page set up as an 'index' for all the - // documents in this list, you can link to it by specifying - // its id- can also be set in snippet call with LIn_link: - // [[ListIndexer?LIn_link=8]] - // The default 0 will eliminate this link - $linkToIndex = 0; - - // $indexText [ string ] - // If you want a link to an index (probably a page running this - // snippet in "full" mode), you can declare what you want that - // link to say here. Or in the snippet call with LIn_indexText: - // [[ListIndexer?LIn_indexText=Financial News Index]] - $indexText = 'Index'; - - // $showCreationDate [ true | false ] - // Decide to include date of creation in output or not. From - // snippet call $LIn_showDate use 1 (true) or 0 (false) - // [[ListIndexer?LIn_showDate=1]] - $showCreationDate = true; - - // $dateFormat [ string ] - // Used to define how date will be displayed (if using date) - // Y = 4 digit year y = 2 digit year - // M = Jan - Dec m = 01 - 12 - // D = Sun - Sat d = 01 -31 - // Other standard PHP characters may be used - $dateFormat = 'Y.m.d'; - - // $shortQty [ int ] - // Number of entries to list in the short list. Can be - // overridden in snippet call with $LIn_sQty: - //[[ListIndexer?LIn_sQty=3]] - $shortQty = 3; - - // PAGING - - // $fullQty [ int ] - // Number of entries PER PAGE to list in the full list - // Can be overridden in snippet call with $LIn_fQty: - // [[ListIndexer?LIn_fQty=20]] - // To show all set to 0 here or in snippet call - $fullQty = 10; - - // $pageSeparator [ string ] - // What you want your page number links to be separated by. - // You NEED to include spaces if you want them. They are NOT - // created automatically to facilitate styling ability. - // For instance, " | " will render links like: - // 1 | 2 | 3 | 4 - $pageSeparator = " | "; - - // $pgPosition [ 'top' | 'bottom' | 'both'] - // Pick where you want your pagination links to appear. - $pgPosition = 'both'; - - // PERFORMANCE - - // $useFastUrls [ true | false ] - // IMPORTANT- using fast urls will reduce database queries - // and improve performance WHEN IN FULL MODE ONLY and - // should NOT be used when multiple instances of this snippet - // appear on the same page. With snippet call LIn_fast use 1 - // (true) or 0 (false) - // [[ListIndexer?LIn_fast=0]] - $useFastUrls = false; - - // $newLinesForLists [ true | false ] - // Depending on how you want to style your list, you may - // or may not want your
  • '.$_lang['cancel'].'
  • - +
    '.$_lang['plugin_priority'].'

    '.$_lang['plugin_priority_instructions'].'

    @@ -180,5 +180,6 @@ function save() { echo '
    +
    '; ?> \ No newline at end of file From 55e709d205f441ce7dc774deddca2f7fb2c97277 Mon Sep 17 00:00:00 2001 From: yama Date: Mon, 26 Aug 2013 02:23:08 +0900 Subject: [PATCH 310/530] Fix --- manager/actions/mutate_plugin.dynamic.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manager/actions/mutate_plugin.dynamic.php b/manager/actions/mutate_plugin.dynamic.php index e11c3e8b5a..584be80334 100644 --- a/manager/actions/mutate_plugin.dynamic.php +++ b/manager/actions/mutate_plugin.dynamic.php @@ -419,7 +419,7 @@ function decode(s){ echo "
    "; echo "".$row['groupname'].""; } - $evtnames[] = ''."\n"; + $evtnames[] = ''."\n"; if(count($evtnames)==2) echoEventRows($evtnames); } if(count($evtnames)>0) echoEventRows($evtnames); From 251ee2ff74549eb27da7cac1affca8568fc1f756 Mon Sep 17 00:00:00 2001 From: yama Date: Mon, 26 Aug 2013 02:25:06 +0900 Subject: [PATCH 311/530] Bug #10119 Fix - Table structure upgrade sql http://tracker.modx.com/issues/10119 --- install/setup.sql | 329 ++++++++++++++++++---------------------------- 1 file changed, 126 insertions(+), 203 deletions(-) diff --git a/install/setup.sql b/install/setup.sql index 00c4618d29..5b384dd305 100755 --- a/install/setup.sql +++ b/install/setup.sql @@ -533,252 +533,169 @@ CREATE TABLE IF NOT EXISTS `{PREFIX}web_user_settings` ( # For backward compatibilty with early versions #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::: - -ALTER TABLE `{PREFIX}web_users` ADD COLUMN `cachepwd` varchar(100) NOT NULL default '' COMMENT 'Store new unconfirmed password' AFTER `password`; - - -ALTER TABLE `{PREFIX}site_tmplvars` ADD COLUMN `editor_type` integer NOT NULL DEFAULT '0' COMMENT '0-plain text,1-rich text,2-code editor' AFTER `description`, - ADD COLUMN `category` integer NOT NULL DEFAULT '0' COMMENT 'category id' AFTER `editor_type`; - - -ALTER TABLE `{PREFIX}site_tmplvars` MODIFY COLUMN `name` varchar(50) NOT NULL default ''; - - -ALTER TABLE `{PREFIX}site_tmplvars` ADD INDEX `indx_rank`(`rank`); - - -ALTER TABLE `{PREFIX}site_content` ADD INDEX `aliasidx` (alias); - - -ALTER TABLE `{PREFIX}site_content` ADD COLUMN `introtext` text COMMENT 'Used to provide quick summary of the document' AFTER `isfolder`; - - -ALTER TABLE `{PREFIX}site_content` ADD COLUMN `menutitle` varchar(255) NOT NULL default '' COMMENT 'Menu title' AFTER `deletedby`, - ADD COLUMN `donthit` tinyint(1) NOT NULL default '0' COMMENT 'Disable page hit count' AFTER `menutitle`, - ADD COLUMN `haskeywords` tinyint(1) NOT NULL default '0' COMMENT 'has links to keywords' AFTER `donthit`, - ADD COLUMN `hasmetatags` tinyint(1) NOT NULL default '0' COMMENT 'has links to meta tags' AFTER `haskeywords`, - ADD COLUMN `privateweb` tinyint(1) NOT NULL default '0' COMMENT 'Private web document' AFTER `hasmetatags`, - ADD COLUMN `privatemgr` tinyint(1) NOT NULL default '0' COMMENT 'Private manager document' AFTER `privateweb`; - - -ALTER TABLE `{PREFIX}site_content` ADD COLUMN `content_dispo` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0-inline, 1-attachment' AFTER `privatemgr`; - - -ALTER TABLE `{PREFIX}site_content` ADD COLUMN `hidemenu` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Hide document from menu' AFTER `content_dispo`; - +# 090-091 ALTER TABLE `{PREFIX}site_content` ADD COLUMN `publishedon` int(20) NOT NULL DEFAULT '0' COMMENT 'Date the document was published' AFTER `deletedby`; - ALTER TABLE `{PREFIX}site_content` ADD COLUMN `publishedby` int(10) NOT NULL DEFAULT '0' COMMENT 'ID of user who published the document' AFTER `publishedon`; +ALTER TABLE `{PREFIX}site_plugins` MODIFY COLUMN `properties` text COMMENT 'Default Properties'; -ALTER TABLE `{PREFIX}site_plugins` ADD COLUMN `editor_type` integer NOT NULL DEFAULT '0' COMMENT '0-plain text,1-rich text,2-code editor' AFTER `description`, - ADD COLUMN `category` integer NOT NULL DEFAULT '0' COMMENT 'category id' AFTER `editor_type`, - ADD COLUMN `cache_type` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'cache option' AFTER `category`; - - -ALTER TABLE `{PREFIX}site_plugins` ADD COLUMN `disabled` tinyint NOT NULL DEFAULT '0' COMMENT 'Disables the plugin' AFTER `properties`; - - -ALTER TABLE `{PREFIX}site_plugins` ADD COLUMN `moduleguid` varchar(32) NOT NULL DEFAULT '' COMMENT 'GUID of module from which to import shared parameters' AFTER `disabled`; - - -ALTER TABLE `{PREFIX}site_htmlsnippets` ADD COLUMN `editor_type` integer NOT NULL DEFAULT '0' COMMENT '0-plain text,1-rich text,2-code editor' AFTER `description`, - ADD COLUMN `category` integer NOT NULL DEFAULT '0' COMMENT 'category id' AFTER `editor_type`, - ADD COLUMN `cache_type` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'cache option' AFTER `category`; - - -ALTER TABLE `{PREFIX}site_snippets` ADD COLUMN `editor_type` integer NOT NULL DEFAULT '0' COMMENT '0-plain text,1-rich text,2-code editor' AFTER `description`, - ADD COLUMN `category` integer NOT NULL DEFAULT '0' COMMENT 'category id' AFTER `editor_type`, - ADD COLUMN `cache_type` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'cache option' AFTER `category`; - - -ALTER TABLE `{PREFIX}site_snippets` ADD COLUMN `properties` varchar(255) NOT NULL default '' COMMENT 'Default Properties' AFTER `locked`; - - -ALTER TABLE `{PREFIX}site_snippets` ADD COLUMN `moduleguid` varchar(32) NOT NULL default '' COMMENT 'GUID of module from which to import shared parameters' AFTER `properties`; +ALTER TABLE `{PREFIX}site_snippets` MODIFY COLUMN `properties` text COMMENT 'Default Properties'; +ALTER TABLE `{PREFIX}site_tmplvar_templates` + DROP INDEX `idx_tmplvarid`, + DROP INDEX `idx_templateid`, + ADD PRIMARY KEY (`tmplvarid`, `templateid`); -ALTER TABLE `{PREFIX}site_templates` ADD COLUMN `editor_type` integer NOT NULL DEFAULT '0' COMMENT '0-plain text,1-rich text,2-code editor' AFTER `description`, - ADD COLUMN `category` integer NOT NULL DEFAULT '0' COMMENT 'category id' AFTER `editor_type`, - ADD COLUMN `icon` varchar(255) NOT NULL default '' COMMENT 'url to icon file' AFTER `category`, - ADD COLUMN `template_type` integer NOT NULL DEFAULT '0' COMMENT '0-page,1-content' AFTER `icon`; +ALTER TABLE `{PREFIX}user_roles` ADD COLUMN `view_unpublished` int(1) NOT NULL DEFAULT '0' AFTER `web_access_permissions`; +#091-092 -ALTER TABLE `{PREFIX}document_groups` DROP INDEX `indx_doc_groups`; +#092-095 +ALTER TABLE `{PREFIX}categories` MODIFY COLUMN `category` varchar(45) NOT NULL DEFAULT ''; -ALTER TABLE `{PREFIX}document_groups` ADD INDEX `document` (`document`); +ALTER TABLE `{PREFIX}categories` MODIFY COLUMN `category` varchar(45) NOT NULL DEFAULT ''; +ALTER TABLE `{PREFIX}event_log` MODIFY COLUMN `source` varchar(50) NOT NULL DEFAULT ''; -ALTER TABLE `{PREFIX}document_groups` ADD INDEX `document_group` (`document_group`); +ALTER TABLE `{PREFIX}event_log` MODIFY COLUMN `description` text; +ALTER TABLE `{PREFIX}manager_users` MODIFY COLUMN `username` varchar(100) NOT NULL DEFAULT ''; -ALTER TABLE `{PREFIX}system_settings` MODIFY COLUMN `setting_value` text; +ALTER TABLE `{PREFIX}site_content` + MODIFY COLUMN `pagetitle` varchar(255) NOT NULL default '', + MODIFY COLUMN `alias` varchar(255) default '', + MODIFY COLUMN `introtext` text COMMENT 'Used to provide quick summary of the document', + MODIFY COLUMN `content` mediumtext, + MODIFY COLUMN `menutitle` varchar(255) NOT NULL DEFAULT '' COMMENT 'Menu title'; +ALTER TABLE `{PREFIX}site_content` ADD COLUMN `link_attributes` varchar(255) NOT NULL DEFAULT '' COMMENT 'Link attriubtes' AFTER `alias`; -ALTER TABLE `{PREFIX}site_plugins` MODIFY COLUMN `properties` text; +ALTER TABLE `{PREFIX}site_htmlsnippets` MODIFY COLUMN `snippet` mediumtext; +ALTER TABLE `{PREFIX}site_modules` + MODIFY COLUMN `name` varchar(50) NOT NULL DEFAULT '', + MODIFY COLUMN `disabled` tinyint(4) NOT NULL DEFAULT '0', + MODIFY COLUMN `icon` varchar(255) NOT NULL DEFAULT '' COMMENT 'url to module icon', + MODIFY COLUMN `resourcefile` varchar(255) NOT NULL DEFAULT '' COMMENT 'a physical link to a resource file', + MODIFY COLUMN `createdon` int(11) NOT NULL DEFAULT '0', + MODIFY COLUMN `editedon` int(11) NOT NULL DEFAULT '0', + MODIFY COLUMN `guid` varchar(32) NOT NULL DEFAULT '' COMMENT 'globally unique identifier', + MODIFY COLUMN `properties` text, + MODIFY COLUMN `modulecode` mediumtext COMMENT 'module boot up code'; -ALTER TABLE `{PREFIX}site_snippets` MODIFY COLUMN `properties` text; +ALTER TABLE `{PREFIX}site_module_access` + MODIFY COLUMN `module` int(11) NOT NULL DEFAULT '0', + MODIFY COLUMN `usergroup` int(11) NOT NULL DEFAULT '0'; +ALTER TABLE `{PREFIX}site_module_depobj` + MODIFY COLUMN `module` int(11) NOT NULL DEFAULT '0', + MODIFY COLUMN `resource` int(11) NOT NULL DEFAULT '0'; -ALTER TABLE `{PREFIX}system_eventnames` ADD COLUMN `groupname` varchar(20) NOT NULL default '' AFTER `service`; +ALTER TABLE `{PREFIX}site_plugins` + MODIFY COLUMN `plugincode` mediumtext, + MODIFY COLUMN `moduleguid` varchar(32) NOT NULL DEFAULT '' COMMENT 'GUID of module from which to import shared parameters'; +ALTER TABLE `{PREFIX}site_plugin_events` + MODIFY COLUMN `evtid` int(10) NOT NULL DEFAULT '0'; -ALTER TABLE `{PREFIX}documentgroup_names` - ADD COLUMN `private_memgroup` tinyint DEFAULT '0' COMMENT 'determine whether the document group is private to manager users' AFTER `name`, - ADD COLUMN `private_webgroup` tinyint DEFAULT '0' COMMENT 'determines whether the document is private to web users' AFTER `private_memgroup`; +ALTER TABLE `{PREFIX}site_plugin_events` ADD COLUMN `priority` INT(10) NOT NULL default '0' COMMENT 'determines the run order of the plugin' AFTER `evtid`; +ALTER TABLE `{PREFIX}site_snippets` + MODIFY COLUMN `snippet` mediumtext, + MODIFY COLUMN `moduleguid` varchar(32) NOT NULL DEFAULT '' COMMENT 'GUID of module from which to import shared parameters'; -ALTER TABLE `{PREFIX}user_roles` - ADD COLUMN `bk_manager` int(1) NOT NULL DEFAULT '0' AFTER `access_permissions`; +ALTER TABLE `{PREFIX}site_templates` + MODIFY COLUMN `icon` varchar(255) NOT NULL default '' COMMENT 'url to icon file', + MODIFY COLUMN `content` mediumtext; +ALTER TABLE `{PREFIX}site_tmplvars` + MODIFY COLUMN `name` varchar(50) NOT NULL default '', + MODIFY COLUMN `elements` text, + MODIFY COLUMN `display` varchar(20) NOT NULL DEFAULT '' COMMENT 'Display Control', + MODIFY COLUMN `display_params` text COMMENT 'Display Control Properties', + MODIFY COLUMN `default_text` text; -ALTER TABLE `{PREFIX}user_roles` - ADD COLUMN `new_plugin` int(1) NOT NULL DEFAULT '0' AFTER `bk_manager`, - ADD COLUMN `edit_plugin` int(1) NOT NULL DEFAULT '0' AFTER `new_plugin`, - ADD COLUMN `save_plugin` int(1) NOT NULL DEFAULT '0' AFTER `edit_plugin`, - ADD COLUMN `delete_plugin` int(1) NOT NULL DEFAULT '0' AFTER `save_plugin`; +ALTER TABLE `{PREFIX}site_tmplvar_contentvalues` + MODIFY COLUMN `tmplvarid` int(10) NOT NULL DEFAULT '0' COMMENT 'Template Variable id', + MODIFY COLUMN `value` text; +ALTER TABLE `{PREFIX}site_tmplvar_templates` MODIFY COLUMN `tmplvarid` int(10) NOT NULL DEFAULT '0' COMMENT 'Template Variable id'; -ALTER TABLE `{PREFIX}user_roles` - ADD COLUMN `new_module` int(1) NOT NULL DEFAULT '0' AFTER `delete_plugin`, - ADD COLUMN `edit_module` int(1) NOT NULL DEFAULT '0' AFTER `new_module`, - ADD COLUMN `save_module` int(1) NOT NULL DEFAULT '0' AFTER `edit_module`, - ADD COLUMN `delete_module` int(1) NOT NULL DEFAULT '0' AFTER `save_module`, - ADD COLUMN `exec_module` int(1) NOT NULL DEFAULT '0' AFTER `delete_module`; +ALTER TABLE `{PREFIX}site_tmplvar_templates` ADD COLUMN `rank` integer(11) NOT NULL DEFAULT '0' AFTER `templateid`; +ALTER TABLE `{PREFIX}system_eventnames` + MODIFY COLUMN `name` varchar(50) NOT NULL DEFAULT '', + MODIFY COLUMN `service` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'System Service number'; -ALTER TABLE `{PREFIX}user_roles` - ADD COLUMN `view_eventlog` int(1) NOT NULL DEFAULT '0' AFTER `exec_module`, - ADD COLUMN `delete_eventlog` int(1) NOT NULL DEFAULT '0' AFTER `view_eventlog`, - ADD COLUMN `manage_metatags` int(1) NOT NULL DEFAULT '0' AFTER `delete_eventlog`, - ADD COLUMN `edit_doc_metatags` int(1) NOT NULL DEFAULT '0' AFTER `manage_metatags`; +ALTER TABLE `{PREFIX}system_settings` MODIFY COLUMN `setting_value` text; +ALTER TABLE `{PREFIX}user_attributes` + MODIFY COLUMN `country` varchar(5) NOT NULL DEFAULT '', + MODIFY COLUMN `state` varchar(25) NOT NULL DEFAULT '', + MODIFY COLUMN `zip` varchar(25) NOT NULL DEFAULT '', + MODIFY COLUMN `fax` varchar(100) NOT NULL DEFAULT '', + MODIFY COLUMN `photo` varchar(255) NOT NULL DEFAULT '' COMMENT 'link to photo', + MODIFY COLUMN `comment` varchar(255) NOT NULL DEFAULT '' COMMENT 'short comment'; -ALTER TABLE `{PREFIX}user_roles` - ADD COLUMN `new_web_user` int(1) NOT NULL DEFAULT '0' AFTER `edit_doc_metatags`, - ADD COLUMN `edit_web_user` int(1) NOT NULL DEFAULT '0' AFTER `new_web_user`, - ADD COLUMN `save_web_user` int(1) NOT NULL DEFAULT '0' AFTER `edit_web_user`, - ADD COLUMN `delete_web_user` int(1) NOT NULL DEFAULT '0' AFTER `save_web_user`; +ALTER TABLE `{PREFIX}user_settings` MODIFY COLUMN `setting_value` text; +ALTER TABLE `{PREFIX}user_messages` MODIFY COLUMN `message` text; -ALTER TABLE `{PREFIX}user_roles` - ADD COLUMN `web_access_permissions` int(1) NOT NULL DEFAULT '0' AFTER `delete_web_user`, - ADD COLUMN `view_unpublished` int(1) NOT NULL DEFAULT '0'AFTER `web_access_permissions`; +ALTER TABLE `{PREFIX}user_roles` ADD COLUMN `publish_document` int(1) NOT NULL DEFAULT '0' AFTER `save_document`; -ALTER TABLE `{PREFIX}user_roles` - ADD COLUMN `publish_document` int(1) NOT NULL DEFAULT '0' AFTER `save_document`; +ALTER TABLE `{PREFIX}web_users` + MODIFY COLUMN `username` varchar(100) NOT NULL DEFAULT '', + MODIFY COLUMN `cachepwd` varchar(100) NOT NULL DEFAULT '' COMMENT 'Store new unconfirmed password' AFTER `password`; +ALTER TABLE `{PREFIX}web_user_attributes` + MODIFY COLUMN `country` varchar(25) NOT NULL DEFAULT '', + MODIFY COLUMN `zip` varchar(25) NOT NULL DEFAULT '', + MODIFY COLUMN `fax` varchar(100) NOT NULL DEFAULT '', + MODIFY COLUMN `photo` varchar(255) NOT NULL DEFAULT '' COMMENT 'link to photo'; -ALTER TABLE `{PREFIX}user_roles` - ADD COLUMN `new_chunk` int(1) NOT NULL DEFAULT '0' AFTER `delete_snippet`, - ADD COLUMN `edit_chunk` int(1) NOT NULL DEFAULT '0' AFTER `new_chunk`, - ADD COLUMN `save_chunk` int(1) NOT NULL DEFAULT '0' AFTER `edit_chunk`, - ADD COLUMN `delete_chunk` int(1) NOT NULL DEFAULT '0' AFTER `save_chunk`; +ALTER TABLE `{PREFIX}web_user_settings` MODIFY COLUMN `setting_value` text; +#095-096 ALTER TABLE `{PREFIX}user_roles` + ADD COLUMN `edit_chunk` int(1) NOT NULL DEFAULT '0' AFTER `delete_snippet`, + ADD COLUMN `new_chunk` int(1) NOT NULL DEFAULT '0' AFTER `edit_chunk`, + ADD COLUMN `save_chunk` int(1) NOT NULL DEFAULT '0' AFTER `new_chunk`, + ADD COLUMN `delete_chunk` int(1) NOT NULL DEFAULT '0' AFTER `save_chunk`, ADD COLUMN `import_static` int(1) NOT NULL DEFAULT '0' AFTER `view_unpublished`, ADD COLUMN `export_static` int(1) NOT NULL DEFAULT '0' AFTER `import_static`; - -ALTER TABLE `{PREFIX}user_roles` - ADD COLUMN `empty_trash` int(1) NOT NULL DEFAULT '0' AFTER `delete_document`; - - -ALTER TABLE `{PREFIX}user_attributes` ADD COLUMN `dob` integer(10) NOT NULL DEFAULT 0 AFTER `sessionid`, - ADD COLUMN `gender` integer(1) NOT NULL DEFAULT 0 COMMENT '0 - unknown, 1 - Male 2 - female' AFTER `dob`, - ADD COLUMN `country` varchar(5) NOT NULL DEFAULT '' AFTER `gender`, - ADD COLUMN `state` varchar(5) NOT NULL DEFAULT '' AFTER `country`, - ADD COLUMN `zip` varchar(5) NOT NULL DEFAULT '' AFTER `state`, - ADD COLUMN `fax` varchar(100) NOT NULL DEFAULT '' AFTER `zip`, - ADD COLUMN `blockedafter` integer(11) NOT NULL DEFAULT 0 AFTER `blockeduntil`, - ADD COLUMN `photo` varchar(255) NOT NULL DEFAULT '' COMMENT 'link to photo' AFTER `fax`, - ADD COLUMN `comment` varchar(255) NOT NULL DEFAULT '' COMMENT 'short comment' AFTER `photo`; - - -ALTER TABLE `{PREFIX}web_users` - MODIFY COLUMN `username` varchar(100) NOT NULL DEFAULT ''; - - -ALTER TABLE `{PREFIX}web_user_attributes` ADD COLUMN `dob` integer(10) NOT NULL DEFAULT 0 AFTER `sessionid`, - ADD COLUMN `gender` integer(1) NOT NULL DEFAULT 0 COMMENT '0 - unknown, 1 - Male 2 - female' AFTER `dob`, - ADD COLUMN `country` varchar(5) NOT NULL DEFAULT '' AFTER `gender`, - ADD COLUMN `state` varchar(5) NOT NULL DEFAULT '' AFTER `country`, - ADD COLUMN `zip` varchar(5) NOT NULL DEFAULT '' AFTER `state`, - ADD COLUMN `fax` varchar(100) NOT NULL DEFAULT '' AFTER `zip`, - ADD COLUMN `blockedafter` integer(11) NOT NULL DEFAULT 0 AFTER `blockeduntil`, - ADD COLUMN `photo` varchar(255) NOT NULL DEFAULT '' COMMENT 'link to photo' AFTER `fax`, - ADD COLUMN `comment` varchar(255) NOT NULL DEFAULT '' COMMENT 'short comment' AFTER `photo`, +ALTER TABLE `{PREFIX}web_user_attributes` MODIFY COLUMN `state` varchar(25) NOT NULL DEFAULT '', MODIFY COLUMN `zip` varchar(25) NOT NULL DEFAULT ''; +#096-0961 -ALTER TABLE `{PREFIX}user_roles` ADD COLUMN `view_unpublished` int(1) NOT NULL DEFAULT '0' AFTER `web_access_permissions`; - -ALTER TABLE `{PREFIX}site_tmplvar_templates` DROP INDEX `idx_tmplvarid`, - DROP INDEX `idx_templateid`, - ADD PRIMARY KEY ( `tmplvarid` , `templateid` ); - - -ALTER TABLE `{PREFIX}site_content` - MODIFY COLUMN `pagetitle` varchar(255) NOT NULL default '', - MODIFY COLUMN `alias` varchar(255) default '', - MODIFY COLUMN `menutitle` varchar(255) NOT NULL DEFAULT '' COMMENT 'Menu title'; - - -ALTER TABLE `{PREFIX}site_content` ADD COLUMN `link_attributes` varchar(255) NOT NULL DEFAULT '' COMMENT 'Link attriubtes' AFTER `alias`; - - -ALTER TABLE `{PREFIX}site_plugin_events` ADD COLUMN `priority` INT(10) NOT NULL default 0 COMMENT 'determines the run order of the plugin' AFTER `evtid`; - - -ALTER TABLE `{PREFIX}site_tmplvar_templates` ADD COLUMN `rank` integer(11) NOT NULL DEFAULT '0' AFTER `templateid`; - - -ALTER TABLE `{PREFIX}manager_users` MODIFY COLUMN `username` varchar(100) NOT NULL DEFAULT ''; - - -ALTER TABLE `{PREFIX}user_settings` MODIFY COLUMN `setting_value` text; - - -ALTER TABLE `{PREFIX}web_user_settings` MODIFY COLUMN `setting_value` text; - +#0961-0963 -ALTER TABLE `{PREFIX}user_attributes` - MODIFY COLUMN `state` varchar(25) NOT NULL default '', - MODIFY COLUMN `zip` varchar(25) NOT NULL default '', - MODIFY COLUMN `comment` text; +ALTER TABLE `{PREFIX}user_roles` ADD COLUMN `empty_trash` int(1) NOT NULL DEFAULT '0' AFTER `delete_document`; +#0963-1.0.0 -ALTER TABLE `{PREFIX}site_metatags` - MODIFY COLUMN `name` varchar(50) NOT NULL DEFAULT '', - MODIFY COLUMN `tag` varchar(50) NOT NULL DEFAULT '' COMMENT 'tag name', - MODIFY COLUMN `tagvalue` varchar(255) NOT NULL DEFAULT ''; +#1.0.3-1.0.4 +ALTER TABLE `{PREFIX}user_roles` ADD COLUMN `remove_locks` int(1) NOT NULL DEFAULT '0'; -ALTER TABLE `{PREFIX}web_user_attributes` - MODIFY COLUMN `state` varchar(25) NOT NULL default '', - MODIFY COLUMN `zip` varchar(25) NOT NULL default '', - MODIFY COLUMN `comment` text; - +#1.0.4-1.0.5 -ALTER TABLE `{PREFIX}user_roles` - ADD COLUMN `remove_locks` int(1) NOT NULL DEFAULT '0'; +ALTER TABLE `{PREFIX}member_groups` ADD UNIQUE INDEX `ix_group_member` (`user_group`,`member`); +ALTER TABLE `{PREFIX}user_attributes` MODIFY COLUMN `comment` text; -ALTER TABLE `{PREFIX}member_groups` - ADD UNIQUE INDEX `ix_group_member` (`user_group`,`member`); - - -ALTER TABLE `{PREFIX}web_groups` - ADD UNIQUE INDEX `ix_group_user` (`webgroup`,`webuser`); +ALTER TABLE `{PREFIX}web_groups` ADD UNIQUE INDEX `ix_group_user` (`webgroup`,`webuser`); +ALTER TABLE `{PREFIX}web_user_attributes` MODIFY COLUMN `comment` text; # Set the private manager group flag + UPDATE {PREFIX}documentgroup_names AS dgn LEFT JOIN {PREFIX}membergroup_access AS mga ON mga.documentgroup = dgn.id LEFT JOIN {PREFIX}webgroup_access AS wga ON wga.documentgroup = dgn.id @@ -788,45 +705,51 @@ UPDATE {PREFIX}documentgroup_names AS dgn UPDATE `{PREFIX}site_plugins` SET `disabled` = '1' WHERE `name` IN ('Bottom Button Bar'); - UPDATE `{PREFIX}site_plugins` SET `disabled` = '1' WHERE `name` IN ('Inherit Parent Template'); - UPDATE `{PREFIX}system_settings` SET `setting_value` = '' WHERE `setting_name` = 'settings_version'; - UPDATE `{PREFIX}system_settings` SET `setting_value` = '0' WHERE `setting_name` = 'validate_referer' AND `setting_value` = '00'; - # start related to #MODX-1321 - UPDATE `{PREFIX}site_content` SET `type`='reference', `contentType`='text/html' WHERE `type`='' AND `content` REGEXP '^https?://([-\w\.]+)+(:\d+)?/?'; - UPDATE `{PREFIX}site_content` SET `type`='document', `contentType`='text/xml' WHERE `type`='' AND `alias` REGEXP '[.period.](rss|xml)$'; - UPDATE `{PREFIX}site_content` SET `type`='document', `contentType`='text/javascript' WHERE `type`='' AND `alias` REGEXP '[.period.]js$'; - UPDATE `{PREFIX}site_content` SET `type`='document', `contentType`='text/css' WHERE `type`='' AND `alias` REGEXP '[.period.]css$'; - UPDATE `{PREFIX}site_content` SET `type`='document', `contentType`='text/html' WHERE `type`=''; +#1.0.5-1.0.6 -ALTER TABLE `{PREFIX}user_attributes` - ADD COLUMN `street` varchar(255) NOT NULL DEFAULT '' AFTER `country`, - ADD COLUMN `city` varchar(255) NOT NULL DEFAULT '' AFTER `street`; +ALTER TABLE `{PREFIX}site_content` MODIFY COLUMN `template` int(10) NOT NULL default '0'; +ALTER TABLE `{PREFIX}site_content` ADD INDEX `typeidx` (`type`); -ALTER TABLE `{PREFIX}web_user_attributes` - ADD COLUMN `street` varchar(255) NOT NULL DEFAULT '' AFTER `country`, - ADD COLUMN `city` varchar(255) NOT NULL DEFAULT '' AFTER `street`; +ALTER TABLE `{PREFIX}system_settings` DROP PRIMARY KEY; + +ALTER TABLE `{PREFIX}system_settings` DROP INDEX `setting_name`; + +ALTER TABLE `{PREFIX}system_settings` ADD PRIMARY KEY (`setting_name`); + +ALTER TABLE `{PREFIX}user_settings` DROP PRIMARY KEY; + +ALTER TABLE `{PREFIX}user_settings` ADD PRIMARY KEY (`user`, `setting_name`); + +ALTER TABLE `{PREFIX}web_user_settings` DROP PRIMARY KEY; + +ALTER TABLE `{PREFIX}web_user_settings` ADD PRIMARY KEY (`webuser`, `setting_name`); + +ALTER TABLE `{PREFIX}site_plugin_events` DROP PRIMARY KEY; + +ALTER TABLE `{PREFIX}site_plugin_events` ADD PRIMARY KEY (`pluginid`, `evtid`); +ALTER TABLE `{PREFIX}active_users` MODIFY COLUMN `ip` varchar(50) NOT NULL DEFAULT ''; -# end related to #MODX-1321 +ALTER TABLE `{PREFIX}site_tmplvar_contentvalues` ADD FULLTEXT `value_ft_idx` (`value`); # ]]upgrade-able @@ -849,7 +772,7 @@ REPLACE INTO `{PREFIX}site_templates` # Default Site Documents -REPLACE INTO `{PREFIX}site_content` VALUES (1,'document','text/html','MODX CMS Install Success','Welcome to the MODX Content Management System','','minimal-base','',1,0,0,0,0,'','

    Install Successful!

    \r\n

    You have successfully installed MODX.

    \r\n\r\n

    Getting Help

    \r\n

    The MODX Community provides a great starting point to learn all things MODX, or you can also see some great learning resources (books, tutorials, blogs and screencasts).

    \r\n

    Welcome to MODX!

    \r\n',1,3,0,1,1,1,1130304721,1,1130304927,0,0,0,1130304721,1,'Base Install',0,0,0,0,0,0,0); +REPLACE INTO `{PREFIX}site_content` VALUES (1,'document','text/html','MODX CMS Install Success','Welcome to the MODX Content Management System','','minimal-base','',1,0,0,0,0,'','

    Install Successful!

    \r\n

    You have successfully installed MODX.

    \r\n\r\n

    Getting Help

    \r\n

    The MODX Community provides a great starting point to learn all things MODX, or you can also see some great learning resources (books, tutorials, blogs and screencasts).

    \r\n

    Welcome to MODX!

    \r\n',1,3,0,1,1,1,1130304721,1,1130304927,0,0,0,1130304721,1,'Base Install',0,0,0,0,0,0,0); REPLACE INTO `{PREFIX}manager_users` From 0537df13c34af0ba23ef64cb27fe1fa91c75da76 Mon Sep 17 00:00:00 2001 From: yama Date: Mon, 26 Aug 2013 02:52:35 +0900 Subject: [PATCH 312/530] Fix --- manager/actions/help.static.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manager/actions/help.static.php b/manager/actions/help.static.php index bd5c5ea3ce..2f2f625c4b 100644 --- a/manager/actions/help.static.php +++ b/manager/actions/help.static.php @@ -36,7 +36,7 @@ echo '
    '; echo '

    '.$helpname.'

    '; echo ''; - include_once(MODX_BASE_PATH . "assets/templates/help/{$v}"; + include_once(MODX_BASE_PATH . "assets/templates/help/{$v}"); echo '
    '; } ?> From 68517ce8b76efb667d8684e5e7e27fe2dcf431d6 Mon Sep 17 00:00:00 2001 From: yama Date: Mon, 26 Aug 2013 02:52:43 +0900 Subject: [PATCH 313/530] Small fix --- manager/actions/document_data.static.php | 1 - 1 file changed, 1 deletion(-) diff --git a/manager/actions/document_data.static.php b/manager/actions/document_data.static.php index 7fc1267708..859115961a 100644 --- a/manager/actions/document_data.static.php +++ b/manager/actions/document_data.static.php @@ -273,7 +273,6 @@ function movedocument() { -
  • s on new lines. Generally, if you - // are displaying then inline (horizontal, you do not want new - // lines, but standard vertical block styling you do. This is - // for IE, real browsers don't care. - $newLinesForLists = true; - -// Styles -// -// The following are the styles included in this snippet. It is up -// to you to include these styles in your stylesheet to get them to -// look the way you want. - - // div.LIn_title {} List title div - // ul.LIn_fullMode {} UL class - // ul.LIn_shortMode {} UL class - // span.LIn_date {} Span surrounding pub/created date - // span.LIn_desc {} Span surrounding description - // div.LIn_pagination Div surrounding pagination links - // span.LIn_currentPage {} Span surrounding current page of - // pagination (which wouldn't be css-able - // by virtue of its tag) - - -// ********************************************************************** -// END CONFIG SETTINGS -// THE REST SHOULD TAKE CARE OF ITSELF -// ********************************************************************** - -// Take care of IE list issue -$ie = ($newLinesForLists)? "\n" : '' ; - -// Use snippet call defined variables if set -$activeTitle = (isset($LIn_title))? $LIn_title : $defaultTitle ; -$mode = (isset($LIn_mode))? $LIn_mode : $mode ; -$descendentDepth = (isset($LIn_depth))? $LIn_depth : $descendentDepth ; -$seeThruUnpub = (isset($LIn_seeThru))? $LIn_seeThru : $seeThruUnpub ; -$seeShowInMenu = (isset($LIn_seeShowInMenu))? $LIn_seeShowInMenu : $seeShowInMenu ; -$hidePrivate = (isset($LIn_hidePrivate))? $LIn_hidePrivate : $hidePrivate; -$linkToIndex = (isset($LIn_link))? $LIn_link : $linkToIndex ; -$rootFolder = (isset($LIn_root))? $LIn_root : $rootFolder ; -$shortQty = (isset($LIn_sQty))? $LIn_sQty : $shortQty ; -$fullQty = (isset($LIn_fQty))? $LIn_fQty : $fullQty ; -$showCreationDate = (isset($LIn_showDate))? $LIn_showDate : $showCreationDate ; -$indexText = (isset($LIn_indexText))? $LIn_indexText : $indexText ; -$useFastUrls = (isset($LIn_fast))? $LIn_fast : $useFastUrls ; -$sortBy = (isset($LIn_sort))? $LIn_sort : $sortBy; -$shortDesc = (isset($LIn_sDesc))? $LIn_sDesc : $shortDesc ; -$fullDesc = (isset($LIn_fDesc))? $LIn_fDesc : $fullDesc ; -$sortDir = (isset($LIn_dir))? $LIn_dir : $sortDir ; -if ($sortDir == '') $sortDir = ($sortBy == 'date')? 'DESC' : 'ASC' ; - - -// Make useful variable shortcut for the content table -//$tbl = $modx->dbConfig['dbase'] . "." . $modx->dbConfig['table_prefix'] . "site_content"; -$tblsc = $modx->getFullTableName("site_content"); -$tbldg = $modx->getFullTableName("document_groups"); - -// Initialize output -$output = ''; - -// --------------------------------------------------- -// --------------------------------------------------- -// Query db for parent folders, or not. First check to -// see if a querystring cheat has been provided- this -// should speed things up considerably when using this -// in full mode. (a.k.a. fastUrls) -// --------------------------------------------------- -// --------------------------------------------------- -$inFolder= isset($_GET['LIn_f'])? $_GET['LIn_f']: 0; -if ((!$inFolder && $useFastUrls) || !$useFastUrls ){ - // Only run all the database queries if we don't already - // know the folders AND fastUrls are desired. - - // --------------------------------------------------- - // Seed list of viable parents - // --------------------------------------------------- - - if ($rootFolder == NULL){ - $rootFolder = $modx->documentIdentifier; - } - // Set root level parent array - $seedArray = explode(',',$rootFolder); - $parentsArray = array(); - foreach($seedArray AS $seed){ - $parentsArray['level_0'][] = $seed; - } - - // --------------------------------------------------- - // Make array of all allowed parents - // --------------------------------------------------- - - // Process valid parents - $levelCounter = 1; - - while (((count($parentsArray) < $descendentDepth) || ($descendentDepth == 0)) && ($levelCounter <= count($parentsArray)) && ($levelCounter < 10)){ - - // Find all decendant parents for this level - $pLevel = 'level_'.($levelCounter - 1); - $tempLevelArray = $parentsArray[$pLevel]; - - foreach($tempLevelArray AS $p){ - - // Get children who are parents (isfolder = 1) - $validParentSql = ""; - $validParentSql .= "SELECT id FROM $tblsc sc WHERE "; - $validParentSql .= "isfolder = 1 AND parent = $p "; - $validParentSql .= "AND sc.deleted=0 "; - $validParentSql .= ($seeThruUnpub)? ";" : "AND sc.published = 1;"; - - // Run statement - $rsTempParents = $modx->dbQuery($validParentSql); - // Get number of results - $countTempParents = $modx->recordCount($rsTempParents); - - // If there are results, put them in an array - $tempValidArray = false; - if ($countTempParents){ - for ($i=0;$i<$countTempParents;$i++){ - $tempId = $modx->fetchRow($rsTempParents); - $tempValidArray[] = $tempId['id']; - } // end while - } // end if - - // populate next level of array - if ($tempValidArray){ - foreach($tempValidArray AS $kid){ - $kidLevel = 'level_'.$levelCounter; - $parentsArray[$kidLevel][] = $kid; - } // end foreach - - } // end if - } // end foreach - - // Do next level - $levelCounter++; - - } // end while - - // Finalize list of parents - $validParents = ''; - foreach ($parentsArray AS $level){ - foreach ($level AS $validP){ - $validParents .= $validP . ','; - } - } - - // Remove trailing comma - $validParents = substr($validParents,0,strlen($validParents)-1); - -} else { - $validParents = $_GET['LIn_f']; -} - -// --------------------------------------------------- -// Make appropriate SQL statement to pull recent items -// --------------------------------------------------- - -// get document groups for current user -if($docgrp = $modx->getUserDocGroups()) $docgrp = implode(",",$docgrp); - -$access = " (".($modx->isFrontend() ? "sc.privateweb=0":"1='".$_SESSION['mgrRole']."' OR sc.privatemgr=0"). - (!$docgrp ? "":" OR dg.document_group IN ($docgrp)").") AND "; - -// Initialize -$recentSql = ""; -$recentSql .= "SELECT sc.id, pagetitle, description"; -// Include pub_date or createdon date if date is desired -$recentSql .= ($showCreationDate)? ", IF(pub_date > 0, pub_date, createdon) AS pubDate ": " " ; -$recentSql .= "FROM $tblsc sc LEFT JOIN $tbldg dg on dg.document = sc.id "; -$recentSql .= "WHERE "; -$recentSql .= ($hidePrivate)? $access:""; -// Look everywhere, or just under valid parents -$recentSql .= (($rootFolder == 0) && $seeThruUnpub && ($descendentDepth == 0))? "" : "parent IN ($validParents) AND " ; -// Published -$recentSql .= "sc.published = 1 "; -// Show In Menu -$recentSql .= ($seeShowInMenu)? " " : " AND sc.hidemenu=0 " ; -// Not deleted -$recentSql .= "AND sc.deleted=0 "; -// Choose sort method -switch ($sortBy){ - case 'alpha': - $recentSql .= "ORDER BY pagetitle "; - break; - case 'menuindex': - $recentSql .= "ORDER BY menuindex "; - break; - default: - $recentSql .= "ORDER BY IF(pub_date>0, pub_date, createdon) "; - break; -} -// Provide a sort direction -$recentSql .= $sortDir; - -// If this is a short list, just pull a limited number -$recentSql .= ($mode == 'short')? " LIMIT $shortQty;" : ";" ; - -// Run statement -$rsRecent = $modx->dbQuery($recentSql); -// Count records -$recentLimit = $modx->recordCount($rsRecent); - -// --------------------------------------------------- -// Generate pagination string if needed -// --------------------------------------------------- -$offsetParam = isset($_GET['LIn_o'])? $_GET['LIn_o']: 0; -$offset = ($offsetParam && ($mode == 'full'))? $offsetParam : 0 ; -$pagination = ''; - -// Don't bother unless there are enough records to justify it -if ( ($mode == 'full') && ($recentLimit > $fullQty) && ($fullQty) ){ - $fullUrl = $_SERVER['REQUEST_URI']; - $urlPieces = parse_url($fullUrl); - $urlPath = $urlPieces['path']; - $otherQs = ''; - - if ($urlPieces['query']){ - foreach($_GET AS $qsKey=>$qsValue){ - if (($qsKey != 'LIn_o') && ($qsKey != 'LIn_f')){ - $otherQs .= '&'.$qsKey.'='.$qsValue; - } - } - } - - $fastUrl = $urlPath.'?LIn_f='.$validParents.$otherQs; - - // Determine number of pages needed to show results - $totalPages = ceil($recentLimit/$fullQty); - - // Make links - for ($j = 0 ; $j < $totalPages; $j++){ - // only include links to OTHER pages, not current page - if($offset == $j*$fullQty){ - $pagination .= ''.($j+1) .''; - } else { - $pagination .= ''.($j+1) .''; - } - if ($j < $totalPages-1){ - $pagination .= $pageSeparator; - } - } - - // Make final pagination link set in it's own div - $pagination = '
    '."\n".$pagination."\n
    \n"; - -} - - -// --------------------------------------------------- -// Create title if wanted -// --------------------------------------------------- - -if ($activeTitle){ - $output .= '
    '.$activeTitle.'
    '."\n"; -} - -// --------------------------------------------------- -// Create list of recent items -// --------------------------------------------------- - -// Include pagination -$output .= ($pgPosition == 'top' || $pgPosition == 'both')? $pagination : '' ; - -$output .= '
      ' . $ie; - -$recentCounter = $offset; -if ($mode == 'short') { - $recentCounterLimit = min($shortQty,$recentLimit); -} else { - $recentCounterLimit = ($fullQty)? min(($fullQty+$offset),$recentLimit) : $recentLimit ; -} - -while (($recentCounter < $recentCounterLimit) && $rsRecent && ($recentLimit > 0)){ - mysql_data_seek($rsRecent,$recentCounter); - $recentRecord = $modx->fetchRow($rsRecent); - $output .= '
    • '; - // Link to page - $output .= ''.$recentRecord['pagetitle'].' '; - // Date if desired - if ($showCreationDate){ - $output .= ''.date($dateFormat,$recentRecord['pubDate']).' '; - } - // Description if desired - if ((($mode == 'short') && ($shortDesc)) || (($mode == 'full') && ($fullDesc))){ - $output .= ''.$recentRecord['description'].''; - } - // wrap it up - $output .= '
    • ' . $ie; - $recentCounter ++; -} - -$output .= '
    ' . $ie; - -$output .= ($pgPosition == 'bottom' || $pgPosition == 'both')? $pagination : '' ; - -// --------------------------------------------------- -// Link to index -// --------------------------------------------------- - -if ($linkToIndex) { - - $output .= '
    '; - $output .= ''.$indexText.''; - $output .= '
    '; - -} - -// --------------------------------------------------- -// Send to browser -// --------------------------------------------------- - -return $output; \ No newline at end of file +return require MODX_BASE_PATH.'assets/snippets/listindexer/snippet.listindexer.php'; \ No newline at end of file diff --git a/install/assets/snippets/membercheck.tpl b/install/assets/snippets/membercheck.tpl index f4fb930a5f..4789ac51b6 100644 --- a/install/assets/snippets/membercheck.tpl +++ b/install/assets/snippets/membercheck.tpl @@ -12,137 +12,4 @@ * @internal @installset base */ -#:::::::::::::::::::::::::::::::::::::::: -# Version: 1.0 -# Created By Ryan Thrash (vertexworks.com) -# Sanitized By Jason Coward (opengeek.com) -# -# Date: November 29, 2005 -# -# Changelog: -# Nov 29, 05 -- initial release -# Jul 13, 06 -- adjusted Singleton to work under PHP4, added placeholder code (by: garryn) -# -#:::::::::::::::::::::::::::::::::::::::: -# Description: -# Checks to see if users belong to a certain group and -# displays the specified chunk if they do. Performs several -# sanity checks and allows to be used multiple times on a page. -# -# Params: -# &groups [array] (REQUIRED) -# array of webuser group-names to check against -# -# &chunk [string] (REQUIRED) -# name of the chunk to use if passes the check -# -# &ph [string] (optional) -# name of the placeholder to set instead of directly retuning chunk -# -# &debug [boolean] (optional | false) -# turn on debug mode for extra troubleshooting -# -# Example Usage: -# -# [[MemberCheck? &groups=`siteadmin, registered users` &chunk=`privateSiteNav` &ph=`MemberMenu` &debug=`true`]] -# -# This would place the 'members-only' navigation store in the chunk 'privateSiteNav' -# into a placeholder (called 'MemberMenu'). It will only do this as long as the user -# is logged in as a webuser and is a member of the 'siteadmin' or the 'registered users' -# groups. The optional debug parameter can be used to display informative error messages -# when configuring this snippet for your site. For example, if the developer had -# mistakenly typed 'siteowners' for the first group, and none existed with debug mode on, -# it would have returned the error message: The group siteowners could not be found.... -# -#:::::::::::::::::::::::::::::::::::::::: - -# debug parameter -$debug = isset ($debug) ? $debug : false; - -# check if inside manager -if ($m = $modx->insideManager()) { - return ''; # don't go any further when inside manager -} - -if (!isset ($groups)) { - return $debug ? '

    Error: No Group Specified

    ' : ''; -} - -if (!isset ($chunk)) { - return $debug ? '

    Error: No Chunk Specified

    ' : ''; -} - -# turn comma-delimited list of groups into an array -$groups = explode(',', $groups); - -if (!class_exists('MemberCheck')) { - class MemberCheck { - var $allGroups = NULL; - var $debug; - - function getInstance($debug) { - static $instance; - if (!isset ($instance)) { - $instance = new MemberCheck($debug); - } - return $instance; - } - - function MemberCheck($debug = false) { - global $modx; - - $this->debug = $debug; - if ($debug) { - $this->allGroups = array (); - $tableName = $modx->getFullTableName('webgroup_names'); - $sql = "SELECT name FROM $tableName"; - if ($rs = $modx->db->query($sql)) { - while ($row = $modx->db->getRow($rs)) { - array_push($this->allGroups, stripslashes($row['name'])); - } - } - } - } - - function isValidGroup($groupName) { - $isValid = !(array_search($groupName, $this->allGroups) === false); - return $isValid; - } - - function getMemberChunk(& $groups, $chunk) { - global $modx; - $o = ''; - if (is_array($groups)) { - for ($i = 0; $i < count($groups); $i++) { - $groups[$i] = trim($groups[$i]); - if ($this->debug) { - if (!$this->isValidGroup($groups[$i])) { - return "

    The group " . $groups[$i] . " could not be found...

    "; - } - } - } - - $check = $modx->isMemberOfWebGroup($groups); - - $chunkcheck = $modx->getChunk($chunk); - - $o .= ($check && $chunkcheck) ? $chunkcheck : ''; - if (!$chunkcheck) - $o .= $this->debug ? "

    The chunk $chunk not found...

    " : ''; - } else { - $o .= "

    No valid group names were specified!

    "; - } - - return $o; - } - } -} - -$memberCheck = MemberCheck :: getInstance($debug); - -if (!isset ($ph)) { - return $memberCheck->getMemberChunk($groups, $chunk); -} else { - $modx->setPlaceholder($ph, $memberCheck->getMemberChunk($groups, $chunk)); - return ''; -} \ No newline at end of file +return require MODX_BASE_PATH.'assets/snippets/membercheck/snippet.membercheck.php'; \ No newline at end of file diff --git a/install/assets/snippets/personalize.tpl b/install/assets/snippets/personalize.tpl index be52ec875c..850ecb5e30 100644 --- a/install/assets/snippets/personalize.tpl +++ b/install/assets/snippets/personalize.tpl @@ -4,174 +4,15 @@ * * Personalize snippet * - * @category snippet - * @version 2.1 - * @license http://www.gnu.org/copyleft/gpl.html GNU Public License (GPL) - * @internal @properties - * @internal @modx_category Login - * @internal @installset base - * @author Created By Ryan Thrash (modx@vertexworks.com) - * @author powered up by kudo (kudo@kudolink.com) - * @author powered up by yama(yamamoto@kyms.ne.jp) + * @category snippet + * @version 2.1 + * @license http://www.gnu.org/copyleft/gpl.html GNU Public License (GPL) + * @internal @properties + * @internal @modx_category Login + * @internal @installset base + * @author Created By Ryan Thrash (modx@vertexworks.com) + * @author powered up by kudo (kudo@kudolink.com) + * @author powered up by yama(yamamoto@kyms.ne.jp) */ -#:::::::::::::::::::::::::::::::::::::::: -# Created By:Ryan Thrash (modx@vertexworks.com), -# and then powered up by kudo (kudo@kudolink.com) -# -# Date: Aug 03, 2006 -# -# Changelog: -# Dec 01, 05 -- initial release -# Jun 19, 06 -- updated description -# Jul 19, 06 -- hacked by kudo to output chunks -# Aug 03, 06 -- added placeholder for username -# Aug 27, 10 -- powered up all code -# -#:::::::::::::::::::::::::::::::::::::::: -# Description: -# Checks to see if webusers are logged in and displays yesChunk if the user -# is logged or noChunk if user is not logged. Insert only the chunk name as -# param, without {{}}. Can use a placeholder to output the username. -# TESTED: can be used more than once per page. -# TESTED: chunks can contain snippets. -# -# -# Params: -# &yesChunk [string] (optional) -# Output for LOGGED users -# -# &noChunk [string] (optional) -# Output for NOT logged users -# -# &ph [string] (optional) -# Placeholder for placing the username -# ATTENTION!: place this ph only in yesChunk! -# -# &context [string] (optional) -# web|mgr -# -# &yesTV [string] (optional) -# Output for LOGGED users -# -# &noTV [string] (optional) -# Output for NOT logged users -# -# Example Usage: -# -# [[Personalize? &yesChunk=`Link` &noChunk=`Register` &ph=`name`]] -# -# Having Chunks named {{Link}} and another {{Register}}, the first will be -# published to registered user, the second to non-registered users. -# -#:::::::::::::::::::::::::::::::::::::::: - -# prepare params and variables - -if ($this->isFrontend() && isset ($_SESSION['webValidated'])) $current_context = 'web'; -elseif ($this->isBackend() && isset ($_SESSION['mgrValidated'])) $current_context = 'mgr'; - -$output = ''; -$yesChunk = (isset($yesChunk))? $yesChunk : ''; -$noChunk = (isset($noChunk)) ? $noChunk : ''; -$ph = (isset($ph)) ? $ph : 'username'; -$context = (isset($context)) ? $context : $current_context; -$yesTV = (isset($yesTV)) ? $yesTV : ''; -$noTV = (isset($noTV)) ? $noTV : ''; - -/* -$referer = htmlspecialchars($_SERVER['HTTP_REFERER'], ENT_QUOTES); -$ua = htmlspecialchars($_SERVER['HTTP_USER_AGENT'], ENT_QUOTES); -$ip = htmlspecialchars($_SERVER['REMOTE_ADDR'], ENT_QUOTES); -$host = htmlspecialchars($_SERVER['REMOTE_HOST'], ENT_QUOTES); - -$ua_strtolower = strtolower($_SERVER['HTTP_USER_AGENT']); -if (strpos($ua_strtolower, 'firefox') !== false) $browser = 'firefox'; -elseif(strpos($ua_strtolower, 'trident/4.0') !== false) $browser = 'internet explorer 8'; -elseif(strpos($ua_strtolower, 'msie') !== false) $browser = 'internet explorer'; -elseif(strpos($ua_strtolower, 'chrome') !== false) $browser = 'chrome'; -elseif(strpos($ua_strtolower, 'safari') !== false) $browser = 'safari'; -elseif(strpos($ua_strtolower, 'opera') !== false) $browser = 'opera'; -else $browser = 'other'; - -$modx->setPlaceholder('referer', $referer); -$modx->setPlaceholder('ua', $ua); -$modx->setPlaceholder('browser', $browser); -$modx->setPlaceholder('ip', $ip); -$modx->setPlaceholder('host', $host); -*/ - -switch($context) -{ - case 'web': - $short_name = $_SESSION['webShortname']; - $full_name = $_SESSION['webFullname']; - $email = $_SESSION['webEmail']; - $last_login = $_SESSION['webLastlogin']; - break; - case 'mgr': - case 'manager': - $short_name = $_SESSION['mgrShortname']; - $full_name = $_SESSION['mgrFullname']; - $email = $_SESSION['mgrEmail']; - $last_login = $_SESSION['mgrLastlogin']; - break; - default: - $short_name = ''; -} -if (!empty($context)) -{ - if($yesTV !== '') - { - $pre_output = $modx->documentObject[$yesTV]; - if(is_array($pre_output)) - { - $output = $pre_output[1]; - } - else - { - $output = $pre_output; - } - } - elseif($yesChunk !== '') - { - $output = $modx->getChunk($yesChunk); - } - else - { - $output = 'username : ' . $short_name; - } - - if(empty($last_login)) $last_login_text = 'first login'; - else $last_login_text = $modx->toDateFormat($last_login); - - $modx->setPlaceholder($ph,$short_name); - $modx->setPlaceholder('short_name', $short_name); - $modx->setPlaceholder('full_name', $full_name); - $modx->setPlaceholder('email', $email); - $modx->setPlaceholder('last_login', $last_login_text); -} -else -{ - if($noTV !== '') - { - $pre_output = $modx->documentObject[$noTV]; - if(is_array($pre_output)) - { - $output = $pre_output[1]; - } - else - { - $output = $pre_output; - } - } - elseif($noChunk!=='') - { - $output = $modx->getChunk($noChunk); - } - else - { - $output = 'guest'; - } -} -return $output; \ No newline at end of file +return require MODX_BASE_PATH.'assets/snippets/personalize/snippet.personalize.php'; \ No newline at end of file diff --git a/install/assets/snippets/ultparent.tpl b/install/assets/snippets/ultparent.tpl index 45d4dabb27..5919a0010f 100644 --- a/install/assets/snippets/ultparent.tpl +++ b/install/assets/snippets/ultparent.tpl @@ -4,58 +4,12 @@ * * Travels up the document tree from a specified document and returns its "ultimate" non-root parent * - * @category snippet - * @version 2.0 - * @license http://www.gnu.org/copyleft/gpl.html GNU Public License (GPL) - * @internal @properties - * @internal @modx_category Navigation + * @category snippet + * @version 2.0 + * @license http://www.gnu.org/copyleft/gpl.html GNU Public License (GPL) + * @internal @properties + * @internal @modx_category Navigation * @internal @installset base */ - -/* - * @name UltimateParent - * @version 2.0 beta (requires MODx 0.9.5+) - * @author Jason Coward - * - * @param &id The id of the document whose parent you want to find. - * @param &top The top node for the search. - * @param &topLevel The top level node for the search (root = level 1) - * - * @license Public Domain, use as you like. - * - * @example [[UltimateParent? &id=`45` &top=`6`]] - * Will find the ultimate parent of document 45 if it is a child of document 6; - * otherwise it will return 45. - * - * @example [[UltimateParent? &topLevel=`2`]] - * Will find the ultimate parent of the current document at a depth of 2 levels - * in the document hierarchy, with the root level being level 1. - * - * This snippet travels up the document tree from a specified document and - * returns the "ultimate" parent. Version 2.0 was rewritten to use the new - * getParentIds function features available only in MODx 0.9.5 or later. - * - * Based on the original UltimateParent 1.x snippet by Susan Ottwell - * . The topLevel parameter was introduced by staed and - * adopted here. - */ -$top= isset ($top) && intval($top) ? $top : 0; -$id= isset ($id) && intval($id) ? intval($id) : $modx->documentIdentifier; -$topLevel= isset ($topLevel) && intval($topLevel) ? intval($topLevel) : 0; -if ($id && $id != $top) { - $pid= $id; - if (!$topLevel || count($modx->getParentIds($id)) >= $topLevel) { - while ($parentIds= $modx->getParentIds($id, 1)) { - $pid= array_pop($parentIds); - if ($pid == $top) { - break; - } - $id= $pid; - if ($topLevel && count($modx->getParentIds($id)) < $topLevel) { - break; - } - } - } -} -return $id; \ No newline at end of file +return require MODX_BASE_PATH.'assets/snippets/ultimateparent/snippet.ultimateparent.php'; \ No newline at end of file From 538b7922d46cb9be46a2113e496280b1a146718e Mon Sep 17 00:00:00 2001 From: Dmi3yy Date: Sun, 11 Aug 2013 09:48:12 +0300 Subject: [PATCH 231/530] fix phpthumb --- install/assets/snippets/phpthumb.tpl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/install/assets/snippets/phpthumb.tpl b/install/assets/snippets/phpthumb.tpl index f8c55e2068..0c5e687739 100644 --- a/install/assets/snippets/phpthumb.tpl +++ b/install/assets/snippets/phpthumb.tpl @@ -9,8 +9,7 @@ * @internal @properties * @internal @modx_category add * @internal @installset base, sample - * @author Boomka + * @author Bumkaka */ -// [[phpthumb? &input=`[+image+]` &options=`w=150,h=76,far=C,bg=FFFFFF`]] return require MODX_BASE_PATH.'assets/snippets/phpthumb/snippet.phpthumb.php'; From 1c4e804a97a18ff12665397365c4f43f34f17013 Mon Sep 17 00:00:00 2001 From: Dmi3yy Date: Sun, 11 Aug 2013 09:52:40 +0300 Subject: [PATCH 232/530] Refactor #10071 done --- .../snippets/wayfinder/snippet.wayfinder.php | 107 ++++++++++++++++++ install/assets/snippets/phpthumb.tpl | 1 + install/assets/snippets/wayfinder.tpl | 106 +---------------- 3 files changed, 109 insertions(+), 105 deletions(-) create mode 100644 assets/snippets/wayfinder/snippet.wayfinder.php diff --git a/assets/snippets/wayfinder/snippet.wayfinder.php b/assets/snippets/wayfinder/snippet.wayfinder.php new file mode 100644 index 0000000000..12bc812727 --- /dev/null +++ b/assets/snippets/wayfinder/snippet.wayfinder.php @@ -0,0 +1,107 @@ +config['base_path']."assets/snippets/wayfinder/"; + +//Include a custom config file if specified +$config = (isset($config)) ? "{$wayfinder_base}configs/{$config}.config.php" : "{$wayfinder_base}configs/default.config.php"; +if (file_exists($config)) { + include("$config"); +} + +include_once("{$wayfinder_base}wayfinder.inc.php"); + +if (class_exists('Wayfinder')) { + $wf = new Wayfinder(); +} else { + return 'error: Wayfinder class not found'; +} + +$wf->_config = array( + 'id' => isset($startId) ? $startId : $modx->documentIdentifier, + 'level' => isset($level) ? $level : 0, + 'includeDocs' => isset($includeDocs) ? $includeDocs : 0, + 'excludeDocs' => isset($excludeDocs) ? $excludeDocs : 0, + 'ph' => isset($ph) ? $ph : FALSE, + 'debug' => isset($debug) ? TRUE : FALSE, + 'ignoreHidden' => isset($ignoreHidden) ? $ignoreHidden : FALSE, + 'hideSubMenus' => isset($hideSubMenus) ? $hideSubMenus : FALSE, + 'useWeblinkUrl' => isset($useWeblinkUrl) ? $useWeblinkUrl : TRUE, + 'fullLink' => isset($fullLink) ? $fullLink : FALSE, + 'nl' => isset($removeNewLines) ? '' : "\n", + 'sortOrder' => isset($sortOrder) ? strtoupper($sortOrder) : 'ASC', + 'sortBy' => isset($sortBy) ? $sortBy : 'menuindex', + 'limit' => isset($limit) ? $limit : 0, + 'cssTpl' => isset($cssTpl) ? $cssTpl : FALSE, + 'jsTpl' => isset($jsTpl) ? $jsTpl : FALSE, + 'rowIdPrefix' => isset($rowIdPrefix) ? $rowIdPrefix : FALSE, + 'textOfLinks' => isset($textOfLinks) ? $textOfLinks : 'menutitle', + 'titleOfLinks' => isset($titleOfLinks) ? $titleOfLinks : 'pagetitle', + 'displayStart' => isset($displayStart) ? $displayStart : FALSE, + 'entityEncode' => isset($entityEncode) ? $entityEncode : TRUE, +); + +//get user class definitions +$wf->_css = array( + 'first' => isset($firstClass) ? $firstClass : '', + 'last' => isset($lastClass) ? $lastClass : 'last', + 'here' => isset($hereClass) ? $hereClass : 'active', + 'parent' => isset($parentClass) ? $parentClass : '', + 'row' => isset($rowClass) ? $rowClass : '', + 'outer' => isset($outerClass) ? $outerClass : '', + 'inner' => isset($innerClass) ? $innerClass : '', + 'level' => isset($levelClass) ? $levelClass: '', + 'self' => isset($selfClass) ? $selfClass : '', + 'weblink' => isset($webLinkClass) ? $webLinkClass : '', +); + +//get user templates +$wf->_templates = array( + 'outerTpl' => isset($outerTpl) ? $outerTpl : '', + 'rowTpl' => isset($rowTpl) ? $rowTpl : '', + 'parentRowTpl' => isset($parentRowTpl) ? $parentRowTpl : '', + 'parentRowHereTpl' => isset($parentRowHereTpl) ? $parentRowHereTpl : '', + 'hereTpl' => isset($hereTpl) ? $hereTpl : '', + 'innerTpl' => isset($innerTpl) ? $innerTpl : '', + 'innerRowTpl' => isset($innerRowTpl) ? $innerRowTpl : '', + 'innerHereTpl' => isset($innerHereTpl) ? $innerHereTpl : '', + 'activeParentRowTpl' => isset($activeParentRowTpl) ? $activeParentRowTpl : '', + 'categoryFoldersTpl' => isset($categoryFoldersTpl) ? $categoryFoldersTpl : '', + 'startItemTpl' => isset($startItemTpl) ? $startItemTpl : '', +); + +//Process Wayfinder +$output = $wf->run(); + +if ($wf->_config['debug']) { + $output .= $wf->renderDebugOutput(); +} + +//Ouput Results +if ($wf->_config['ph']) { + $modx->setPlaceholder($wf->_config['ph'],$output); + return; +} else { + return $output; +}?> \ No newline at end of file diff --git a/install/assets/snippets/phpthumb.tpl b/install/assets/snippets/phpthumb.tpl index 0c5e687739..e4bade1492 100644 --- a/install/assets/snippets/phpthumb.tpl +++ b/install/assets/snippets/phpthumb.tpl @@ -1,3 +1,4 @@ +//config['base_path']."assets/snippets/wayfinder/"; - -//Include a custom config file if specified -$config = (isset($config)) ? "{$wayfinder_base}configs/{$config}.config.php" : "{$wayfinder_base}configs/default.config.php"; -if (file_exists($config)) { - include("$config"); -} - -include_once("{$wayfinder_base}wayfinder.inc.php"); - -if (class_exists('Wayfinder')) { - $wf = new Wayfinder(); -} else { - return 'error: Wayfinder class not found'; -} - -$wf->_config = array( - 'id' => isset($startId) ? $startId : $modx->documentIdentifier, - 'level' => isset($level) ? $level : 0, - 'includeDocs' => isset($includeDocs) ? $includeDocs : 0, - 'excludeDocs' => isset($excludeDocs) ? $excludeDocs : 0, - 'ph' => isset($ph) ? $ph : FALSE, - 'debug' => isset($debug) ? TRUE : FALSE, - 'ignoreHidden' => isset($ignoreHidden) ? $ignoreHidden : FALSE, - 'hideSubMenus' => isset($hideSubMenus) ? $hideSubMenus : FALSE, - 'useWeblinkUrl' => isset($useWeblinkUrl) ? $useWeblinkUrl : TRUE, - 'fullLink' => isset($fullLink) ? $fullLink : FALSE, - 'nl' => isset($removeNewLines) ? '' : "\n", - 'sortOrder' => isset($sortOrder) ? strtoupper($sortOrder) : 'ASC', - 'sortBy' => isset($sortBy) ? $sortBy : 'menuindex', - 'limit' => isset($limit) ? $limit : 0, - 'cssTpl' => isset($cssTpl) ? $cssTpl : FALSE, - 'jsTpl' => isset($jsTpl) ? $jsTpl : FALSE, - 'rowIdPrefix' => isset($rowIdPrefix) ? $rowIdPrefix : FALSE, - 'textOfLinks' => isset($textOfLinks) ? $textOfLinks : 'menutitle', - 'titleOfLinks' => isset($titleOfLinks) ? $titleOfLinks : 'pagetitle', - 'displayStart' => isset($displayStart) ? $displayStart : FALSE, - 'entityEncode' => isset($entityEncode) ? $entityEncode : TRUE, -); - -//get user class definitions -$wf->_css = array( - 'first' => isset($firstClass) ? $firstClass : '', - 'last' => isset($lastClass) ? $lastClass : 'last', - 'here' => isset($hereClass) ? $hereClass : 'active', - 'parent' => isset($parentClass) ? $parentClass : '', - 'row' => isset($rowClass) ? $rowClass : '', - 'outer' => isset($outerClass) ? $outerClass : '', - 'inner' => isset($innerClass) ? $innerClass : '', - 'level' => isset($levelClass) ? $levelClass: '', - 'self' => isset($selfClass) ? $selfClass : '', - 'weblink' => isset($webLinkClass) ? $webLinkClass : '', -); - -//get user templates -$wf->_templates = array( - 'outerTpl' => isset($outerTpl) ? $outerTpl : '', - 'rowTpl' => isset($rowTpl) ? $rowTpl : '', - 'parentRowTpl' => isset($parentRowTpl) ? $parentRowTpl : '', - 'parentRowHereTpl' => isset($parentRowHereTpl) ? $parentRowHereTpl : '', - 'hereTpl' => isset($hereTpl) ? $hereTpl : '', - 'innerTpl' => isset($innerTpl) ? $innerTpl : '', - 'innerRowTpl' => isset($innerRowTpl) ? $innerRowTpl : '', - 'innerHereTpl' => isset($innerHereTpl) ? $innerHereTpl : '', - 'activeParentRowTpl' => isset($activeParentRowTpl) ? $activeParentRowTpl : '', - 'categoryFoldersTpl' => isset($categoryFoldersTpl) ? $categoryFoldersTpl : '', - 'startItemTpl' => isset($startItemTpl) ? $startItemTpl : '', -); - -//Process Wayfinder -$output = $wf->run(); - -if ($wf->_config['debug']) { - $output .= $wf->renderDebugOutput(); -} - -//Ouput Results -if ($wf->_config['ph']) { - $modx->setPlaceholder($wf->_config['ph'],$output); -} else { - return $output; -} \ No newline at end of file +return require MODX_BASE_PATH.'assets/snippets/wayfinder/snippet.wayfinder.php'; \ No newline at end of file From e04ead5d727661f8a4d069bd5c5a788e199647fc Mon Sep 17 00:00:00 2001 From: Dmi3yy Date: Mon, 12 Aug 2013 09:20:51 +0300 Subject: [PATCH 233/530] fix some html and fix KCFinder drag and drop --- assets/snippets/wayfinder/snippet.wayfinder.php | 3 ++- manager/actions/mutate_plugin.dynamic.php | 2 ++ manager/actions/mutate_snippet.dynamic.php | 2 ++ manager/actions/mutate_templates.dynamic.php | 2 ++ manager/media/browser/mcpuk/js/browser/dropUpload.js | 10 ++++++++-- 5 files changed, 16 insertions(+), 3 deletions(-) diff --git a/assets/snippets/wayfinder/snippet.wayfinder.php b/assets/snippets/wayfinder/snippet.wayfinder.php index 12bc812727..2a2b27c53c 100644 --- a/assets/snippets/wayfinder/snippet.wayfinder.php +++ b/assets/snippets/wayfinder/snippet.wayfinder.php @@ -104,4 +104,5 @@ return; } else { return $output; -}?> \ No newline at end of file +} +?> \ No newline at end of file diff --git a/manager/actions/mutate_plugin.dynamic.php b/manager/actions/mutate_plugin.dynamic.php index 8af6e6eadc..ba9920b66f 100644 --- a/manager/actions/mutate_plugin.dynamic.php +++ b/manager/actions/mutate_plugin.dynamic.php @@ -319,6 +319,7 @@ function decode(s){ +
      class="inputBox" onclick="setTextWrap(document.mutate.post,this.checked)" /> @@ -326,6 +327,7 @@ function decode(s){
    +
    diff --git a/manager/actions/mutate_snippet.dynamic.php b/manager/actions/mutate_snippet.dynamic.php index 560398195c..6661fc59a4 100644 --- a/manager/actions/mutate_snippet.dynamic.php +++ b/manager/actions/mutate_snippet.dynamic.php @@ -321,6 +321,7 @@ function decode(s){ +
    class="inputBox" onclick="setTextWrap(document.mutate.post,this.checked)" /> @@ -328,6 +329,7 @@ function decode(s){
    +
    diff --git a/manager/actions/mutate_templates.dynamic.php b/manager/actions/mutate_templates.dynamic.php index 3ecae2257a..6b78737fdd 100644 --- a/manager/actions/mutate_templates.dynamic.php +++ b/manager/actions/mutate_templates.dynamic.php @@ -175,12 +175,14 @@ function deletedocument() { +
    +
    diff --git a/manager/media/browser/mcpuk/js/browser/dropUpload.js b/manager/media/browser/mcpuk/js/browser/dropUpload.js index 284f9dc387..0246503ed2 100644 --- a/manager/media/browser/mcpuk/js/browser/dropUpload.js +++ b/manager/media/browser/mcpuk/js/browser/dropUpload.js @@ -11,8 +11,12 @@ * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 * @link http://kcfinder.sunhater.com */?> - +var already = false; browser.initDropUpload = function() { + if (already){ + return; + } + already = true; if ((typeof(XMLHttpRequest) == 'undefined') || (typeof(document.addEventListener) == 'undefined') || (typeof(File) == 'undefined') || @@ -64,7 +68,7 @@ browser.initDropUpload = function() { browser.alert("Cannot write to upload folder."); return false; } - filesCount += e.dataTransfer.files.length + filesCount += e.dataTransfer.files.length; for (var i = 0; i < e.dataTransfer.files.length; i++) { var file = e.dataTransfer.files[i]; file.thisTargetDir = browser.dir; @@ -193,6 +197,7 @@ browser.initDropUpload = function() { if (browser.dir == reader.thisTargetDir) browser.fadeFiles(); uploadInProgress = false; + already = true; processUploadQueue(); if (xhr.responseText.substr(0, 1) != '/') errors[errors.length] = xhr.responseText; @@ -204,6 +209,7 @@ browser.initDropUpload = function() { reader.onerror = function(evt) { $('#loading').css('display', 'none'); uploadInProgress = false; + already = true; processUploadQueue(); errors[errors.length] = browser.label("Failed to upload {filename}!", { filename: evt.target.thisFileName From d1a6dbd48b4e0135cdfe0f3ef9e780ced4581ef9 Mon Sep 17 00:00:00 2001 From: Dmi3yy Date: Mon, 12 Aug 2013 14:38:39 +0300 Subject: [PATCH 234/530] fix sendmail in forgotmananagerlogin --- .../plugin.forgotmanagerlogin.php | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/assets/plugins/forgotmanagerlogin/plugin.forgotmanagerlogin.php b/assets/plugins/forgotmanagerlogin/plugin.forgotmanagerlogin.php index 1a073e9058..09d62a0d24 100644 --- a/assets/plugins/forgotmanagerlogin/plugin.forgotmanagerlogin.php +++ b/assets/plugins/forgotmanagerlogin/plugin.forgotmanagerlogin.php @@ -76,13 +76,6 @@ function getUser($user_id=false, $username='', $email='', $hash='') { function sendEmail($to) { global $modx, $_lang; - $subject = $_lang['password_change_request']; - $headers = "MIME-Version: 1.0\r\n". - "Content-type: text/html; charset=\"{$modx->config['modx_charset']}\"\r\n". - "From: MODx <{$modx->config['emailsender']}>\r\n". - "Reply-To: no-reply@{$_SERVER['HTTP_HOST']}\r\n". - "X-Mailer: PHP/".phpversion(); - $user = $this->getUser(0, '', $to); if($user['username']) { @@ -92,10 +85,17 @@ function sendEmail($to) {

    {$_lang['forgot_password_email_fine_print']}

    EOD; - $mail = mail($to, $subject, $body, $headers); - if(!$mail) { $this->errors[] = $_lang['error_sending_email']; } + $modx->loadExtension('MODxMailer'); + $modx->mail->From = $modx->config['emailsender']; + $modx->mail->FromName = $modx->config['site_name']; + $modx->mail->AddAddress($to,$user['username']); + $modx->mail->Subject = $_lang['password_change_request']; + $modx->mail->Body = $body; + $rs = $modx->mail->send(); //ignore mail errors in this case + + if(!$rs) $modx->errors[] = $_lang['error_sending_email']; - return $mail; + return $rs; } } From 84fd6dad451aa630a39c771bcba072baef4d8a65 Mon Sep 17 00:00:00 2001 From: Dmi3yy Date: Tue, 13 Aug 2013 09:52:39 +0300 Subject: [PATCH 235/530] fix KCfinder tinyMCE --- assets/plugins/tinymce/js/fbconfig.js | 2 +- manager/media/browser/mcpuk/config.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/plugins/tinymce/js/fbconfig.js b/assets/plugins/tinymce/js/fbconfig.js index d704e1fc37..42b93b3d84 100644 --- a/assets/plugins/tinymce/js/fbconfig.js +++ b/assets/plugins/tinymce/js/fbconfig.js @@ -1,4 +1,4 @@ -document.write(''); +document.write(''); var FileBrowserDialogue = { init : function () { diff --git a/manager/media/browser/mcpuk/config.php b/manager/media/browser/mcpuk/config.php index e77f78c65f..4d2a924cbf 100644 --- a/manager/media/browser/mcpuk/config.php +++ b/manager/media/browser/mcpuk/config.php @@ -92,7 +92,7 @@ // THE FOLLOWING SETTINGS CANNOT BE OVERRIDED WITH SESSION CONFIGURATION '_check4htaccess' => false, - '_tinyMCEPath' => MODX_BASE_URL . "assets/plugins/tinymce/jscripts/tiny_mce", + '_tinyMCEPath' => MODX_BASE_URL . "assets/plugins/tinymce/tiny_mce", '_sessionVar' => &$_SESSION['KCFINDER'], //'_sessionLifetime' => 30, From c584f9710e568848693d1bd7c8f7cc6d0d9d53f9 Mon Sep 17 00:00:00 2001 From: Dmi3yy Date: Wed, 14 Aug 2013 08:37:29 +0300 Subject: [PATCH 236/530] security fix #10018 from Agel_Nash https://github.com/AgelxNash/evolution/commit/e69762d1f1861a68dcc89be4e2 fe63e8198a5a35 --- manager/actions/messages.static.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manager/actions/messages.static.php b/manager/actions/messages.static.php index 3662112ac4..1c2d2ac1b6 100644 --- a/manager/actions/messages.static.php +++ b/manager/actions/messages.static.php @@ -10,7 +10,7 @@
    db->query($sql); $limit = $modx->db->getRecordCount($rs); if($limit!=1) { @@ -109,7 +109,7 @@ if( !isset( $_REQUEST['int_cur_position'] ) || $_REQUEST['int_cur_position'] == 0 ){ $int_cur_position = 0; } else { - $int_cur_position = $_REQUEST['int_cur_position']; + $int_cur_position = (int)$_REQUEST['int_cur_position']; } // Number of result to display on the page, will be in the LIMIT of the sql query also From 151d927be07052f1d5d7993cd917746cafd45370 Mon Sep 17 00:00:00 2001 From: Dmi3yy Date: Wed, 14 Aug 2013 08:39:16 +0300 Subject: [PATCH 237/530] Undefined variable: usemm fixed by Agel_Nash --- assets/plugins/qm/qm.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/plugins/qm/qm.inc.php b/assets/plugins/qm/qm.inc.php index be16b6c376..4064e72b1c 100755 --- a/assets/plugins/qm/qm.inc.php +++ b/assets/plugins/qm/qm.inc.php @@ -24,7 +24,7 @@ function Qm(&$modx, $jqpath='', $loadmanagerjq='', $loadfrontendjq='', $noconfli $this->loadtb = $loadtb; $this->tbwidth = $tbwidth; $this->tbheight = $tbheight; - $this->usemm = $usemm; + $this->usemm = null; $this->hidefields = $hidefields; $this->hidetabs = $hidetabs; $this->hidesections = $hidesections; From ffe6ffb2bb8761ac4ac483bb085afe5e4f59257e Mon Sep 17 00:00:00 2001 From: Dmi3yy Date: Wed, 14 Aug 2013 08:42:05 +0300 Subject: [PATCH 238/530] #10074 by Agel_Nash https://github.com/AgelxNash/evolution/commit/b029959fc449b01420fd29896d f3124684bb5c7e --- manager/includes/document.parser.class.inc.php | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/manager/includes/document.parser.class.inc.php b/manager/includes/document.parser.class.inc.php index 1f7bad742f..308842c0b8 100755 --- a/manager/includes/document.parser.class.inc.php +++ b/manager/includes/document.parser.class.inc.php @@ -3222,15 +3222,14 @@ function parseProperties($propertyString) { $parameter= array (); if (!empty ($propertyString)) { $tmpParams= explode("&", $propertyString); - for ($x= 0; $x < count($tmpParams); $x++) { + $count = count($tmpParams); + for ($x= 0; $x < $count; $x++) { if (strpos($tmpParams[$x], '=', 0)) { - $pTmp= explode("=", $tmpParams[$x]); - $pvTmp= explode(";", trim($pTmp[1])); - if ($pvTmp[1] == 'list' && $pvTmp[3] != "") - $parameter[trim($pTmp[0])]= $pvTmp[3]; //list default - else - if ($pvTmp[1] != 'list' && $pvTmp[2] != "") - $parameter[trim($pTmp[0])]= $pvTmp[2]; + $pTmp= explode("=", $tmpParams[$x], 2); + $pvTmp= explode(";", trim($pTmp[1]), 3); + $pvTmp[2] = isset($pvTvm[2]) ? $pvTmp[2] : null; + $pvTmp[3] = isset($pvTmp[3]) ? $pvTmp[3] : null; + $parameter[trim($pTmp[0])] = ($pvTmp[1] == 'list') ? $pvTmp[3] : $pvTmp[2]; } } } From 6df016a3e416dbb1adc9c2226cdecf3741f48222 Mon Sep 17 00:00:00 2001 From: Dmi3yy Date: Wed, 14 Aug 2013 08:42:59 +0300 Subject: [PATCH 239/530] #10073 by Agel_Nash https://github.com/AgelxNash/evolution/commit/8f1b932a2b892e8bc76b221929 d10ba5d90d86d4 --- manager/includes/document.parser.class.inc.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/manager/includes/document.parser.class.inc.php b/manager/includes/document.parser.class.inc.php index 308842c0b8..3739a198b4 100755 --- a/manager/includes/document.parser.class.inc.php +++ b/manager/includes/document.parser.class.inc.php @@ -4,6 +4,9 @@ * Function: This class contains the main document parsing functions * */ +if (!defined('E_DEPRECATED')) define('E_DEPRECATED', 8192); +if (!defined('E_USER_DEPRECATED')) define('E_USER_DEPRECATED', 16384); + class DocumentParser { var $db; // db object var $event, $Event; // event object From 4d0e64869d8e3e25bfa2a39026522ac0211b2a9b Mon Sep 17 00:00:00 2001 From: Dmi3yy Date: Wed, 14 Aug 2013 08:59:56 +0300 Subject: [PATCH 240/530] #10075 by Agel_Nash https://github.com/AgelxNash/evolution/commit/01a165a3d9805e9b0d126cc41e 40af39fd0190b8 --- manager/frames/1.php | 2 +- manager/frames/menu.php | 1 + manager/frames/nodes.php | 14 +++++++------- manager/frames/tree.php | 8 ++++---- manager/includes/controls/contextmenu.php | 4 ++-- manager/includes/controls/datagrid.class.php | 14 ++++++++------ manager/includes/header.inc.php | 1 + manager/includes/log.class.inc.php | 4 ++-- manager/includes/paginate.inc.php | 2 +- manager/index.php | 2 +- 10 files changed, 28 insertions(+), 24 deletions(-) diff --git a/manager/frames/1.php b/manager/frames/1.php index 2073c4822f..ecd498aef3 100755 --- a/manager/frames/1.php +++ b/manager/frames/1.php @@ -7,7 +7,7 @@ $modx->invokeEvent('OnManagerPreFrameLoader',array('action'=>$action)); ?> -> +> <?php echo $site_name?> - (MODX CMS Manager) diff --git a/manager/frames/menu.php b/manager/frames/menu.php index e58079bebf..afb114af4f 100644 --- a/manager/frames/menu.php +++ b/manager/frames/menu.php @@ -3,6 +3,7 @@ if (!array_key_exists('mail_check_timeperiod', $modx->config) || !is_numeric($modx->config['mail_check_timeperiod'])) { $modx->config['mail_check_timeperiod'] = 5; } +$modx_textdir = isset($modx_textdir) ? $modx_textdir : null; if ($manager_theme) $manager_theme .= '/'; $mxla = $modx_lang_attribute ? $modx_lang_attribute : 'en'; ?> diff --git a/manager/frames/nodes.php b/manager/frames/nodes.php index 101821ceca..3bd58ce659 100644 --- a/manager/frames/nodes.php +++ b/manager/frames/nodes.php @@ -39,9 +39,9 @@ 'text/plain' => $_style["tree_page"], 'text/xml' => $_style["tree_page_xml"], 'text/javascript' => $_style["tree_page_js"], - 'image/gif' => $_style["tree_page_gif"], - 'image/jpg' => $_style["tree_page_jpg"], - 'image/png' => $_style["tree_page_png"] + 'image/gif' => isset($_style["tree_page_gif"]) ? $_style["tree_page_gif"] : $_style["tree_page"], + 'image/jpg' => isset($_style["tree_page_jpg"]) ? $_style["tree_page_jpg"] : $_style["tree_page"], + 'image/png' => isset($_style["tree_page_png"]) ? $_style["tree_page_png"] : $_style["tree_page"] ); $iconsPrivate = array( 'application/rss+xml' => $_style["tree_page_rss_secure"], @@ -53,9 +53,9 @@ 'text/plain' => $_style["tree_page_secure"], 'text/xml' => $_style["tree_page_xml_secure"], 'text/javascript' => $_style["tree_page_js_secure"], - 'image/gif' => $_style["tree_page_gif_secure"], - 'image/jpg' => $_style["tree_page_jpg_secure"], - 'image/png' => $_style["tree_page_png_secure"] + 'image/gif' => isset($_style["tree_page_gif_secure"]) ? $_style["tree_page_gif_secure"] : $_style["tree_page_secure"], + 'image/jpg' => isset($_style["tree_page_jpg_secure"]) ? $_style["tree_page_jpg_secure"] : $_style["tree_page_secure"], + 'image/png' => isset($_style["tree_page_png_secure"]) ? $_style["tree_page_png_secure"] : $_style["tree_page_secure"] ); if (isset($_SESSION['openedArray'])) { @@ -105,7 +105,7 @@ function makeHTML($indent,$parent,$expandAll,$theme) { $tbldg = $dbase.".`".$table_prefix."document_groups`"; $tbldgn = $dbase.".`".$table_prefix."documentgroup_names`"; // get document groups for current user - if($_SESSION['mgrDocgroups']) $docgrp = implode(",",$_SESSION['mgrDocgroups']); + $docgrp = (isset($_SESSION['mgrDocgroups']) && is_array($_SESSION['mgrDocgroups'])) ? implode(",",$_SESSION['mgrDocgroups']) : ''; $showProtected= false; if (isset ($modx->config['tree_show_protected'])) { $showProtected= (boolean) $modx->config['tree_show_protected']; diff --git a/manager/frames/tree.php b/manager/frames/tree.php index 2854e759ba..87ff1a362f 100755 --- a/manager/frames/tree.php +++ b/manager/frames/tree.php @@ -1,7 +1,7 @@ INCLUDE_ORDERING_ERROR

    Please use the MODx Content Manager instead of accessing this file directly."); $theme = $manager_theme ? "$manager_theme/":""; - + $modx_textdir = isset($modx_textdir) ? $modx_textdir : null; function constructLink($action, $img, $text, $allowed) { if($allowed==1) { ?>
    From 8699e22bacf0bd564a1e0dd9bedf960ccffb9f7f Mon Sep 17 00:00:00 2001 From: yama Date: Sat, 24 Aug 2013 14:26:25 +0900 Subject: [PATCH 265/530] small fix --- manager/actions/mutate_tmplvars.dynamic.php | 123 +++++++++----------- 1 file changed, 58 insertions(+), 65 deletions(-) diff --git a/manager/actions/mutate_tmplvars.dynamic.php b/manager/actions/mutate_tmplvars.dynamic.php index e3b6fffd4e..124eff6e69 100644 --- a/manager/actions/mutate_tmplvars.dynamic.php +++ b/manager/actions/mutate_tmplvars.dynamic.php @@ -9,35 +9,31 @@ $e->dumpError(); } - - -if(isset($_REQUEST['id'])) { - $id = $_REQUEST['id']; -} else { - $id=0; -} - +if(isset($_REQUEST['id'])) $id = (int) $_REQUEST['id']; +else $id = 0; // check to see the variable editor isn't locked -$sql = "SELECT internalKey, username FROM $dbase.`".$table_prefix."active_users` WHERE action=301 AND id=$id"; -$rs = $modx->db->query($sql); -$limit = $modx->db->getRecordCount($rs); -if($limit>1) { - for ($i=0;$i<$limit;$i++) { - $lock = $modx->db->getRow($rs); - if($lock['internalKey']!=$modx->getLoginUserID()) { - $msg = sprintf($_lang["lock_msg"],$lock['username']," template variable"); - $e->setError(5, $msg); - $e->dumpError(); - } - } +$tbl_active_users = $modx->getFullTableName('active_users'); +$rs = $modx->db->select('internalKey, username',$tbl_active_users,"action=301 AND id='{$id}'"); +$total = $modx->db->getRecordCount($rs); +if($total>1) +{ + while($row = $modx->db->getRow($rs)) + { + if($row['internalKey']!=$modx->getLoginUserID()) + { + $msg = sprintf($_lang['lock_msg'], $row['username'], ' template variable'); + $e->setError(5, $msg); + $e->dumpError(); + } + } } // end check for lock - // make sure the id's a number -if(!is_numeric($id)) { - echo "Passed ID is NaN!"; +if(!is_numeric($id)) +{ + echo 'Passed ID is NaN!'; exit; } @@ -63,9 +59,9 @@ } // get available RichText Editors -$RTEditors = ""; -$evtOut = $modx->invokeEvent("OnRichTextEditorRegister",array('forfrontend' => 1)); -if(is_array($evtOut)) $RTEditors = implode(",",$evtOut); +$RTEditors = ''; +$evtOut = $modx->invokeEvent('OnRichTextEditorRegister',array('forfrontend' => 1)); +if(is_array($evtOut)) $RTEditors = implode(',',$evtOut); ?> -
    + invokeEvent("OnTVFormPrerender",array("id" => $id)); + $evtOut = $modx->invokeEvent('OnTVFormPrerender',array('id' => $id)); if(is_array($evtOut)) echo implode("",$evtOut); ?> + @@ -355,7 +352,7 @@ function decode(s){ - +
    <?php echo $_lang['tmplvars_reset_params']; ?>
      @@ -370,14 +367,12 @@ function decode(s){
    -
    +

    db->query($sql); + $from = '[+prefix+]site_templates as tpl LEFT JOIN [+prefix+]site_tmplvar_templates as stt ON stt.templateid=tpl.id AND stt.tmplvarid='.$id; + $rs = $modx->db->select('id,templatename,tmplvarid',$from); ?>
    @@ -395,7 +390,6 @@ function decode(s){
    - hasPermission('access_permissions')) { ?>
    - +

    - db->query($sql); +db->select('name, id','[+prefix+]documentgroup_names'); $limit = $modx->db->getRecordCount($rs); if(empty($groupsarray) && is_array($_POST['docgroups']) && empty($_POST['id'])) { $groupsarray = $_POST['docgroups']; @@ -493,8 +486,8 @@ function makePublic(b){ invokeEvent("OnTVFormRender",array("id" => $id)); - if(is_array($evtOut)) echo implode("",$evtOut); + $evtOut = $modx->invokeEvent('OnTVFormRender',array('id' => $id)); + if(is_array($evtOut)) echo implode('',$evtOut); ?> From eaa40f60771c76a38e1c113f9806691b92c0daea Mon Sep 17 00:00:00 2001 From: yama Date: Sat, 24 Aug 2013 14:27:38 +0900 Subject: [PATCH 266/530] small fix --- manager/actions/mutate_tmplvars.dynamic.php | 45 ++++++++++++--------- 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/manager/actions/mutate_tmplvars.dynamic.php b/manager/actions/mutate_tmplvars.dynamic.php index 124eff6e69..72cee3a961 100644 --- a/manager/actions/mutate_tmplvars.dynamic.php +++ b/manager/actions/mutate_tmplvars.dynamic.php @@ -37,25 +37,32 @@ exit; } -if(isset($_GET['id'])) { - $sql = "SELECT * FROM $dbase.`".$table_prefix."site_tmplvars` WHERE id = $id;"; - $rs = $modx->db->query($sql); - $limit = $modx->db->getRecordCount($rs); - if($limit>1) { - echo "Oops, Multiple variables sharing same unique id. Not good.

    "; - exit; - } - if($limit<1) { - header("Location: /index.php?id=".$site_start); - } - $content = $modx->db->getRow($rs); - $_SESSION['itemname']=$content['caption']; - if($content['locked']==1 && $_SESSION['mgrRole']!=1) { - $e->setError(3); - $e->dumpError(); - } -} else { - $_SESSION['itemname']="New Template Variable"; +global $content; +$content = array(); +if(isset($_GET['id'])) +{ + $rs = $modx->db->select('*','[+prefix+]site_tmplvars',"id={$id}"); + $total = $modx->db->getRecordCount($rs); + if($total>1) + { + echo 'Oops, Multiple variables sharing same unique id. Not good.'; + exit; + } + if($total<1) + { + header("Location: /index.php?id={$site_start}"); + } + $content = $modx->db->getRow($rs); + $_SESSION['itemname'] = $content['caption']; + if($content['locked']==1 && $modx->hasPermission('save_role')!=1) + { + $e->setError(3); + $e->dumpError(); + } +} +else +{ + $_SESSION['itemname']="New Template Variable"; } // get available RichText Editors From dd94e6f66c5eb07a29a0d2b97d7c19d204fb6dc3 Mon Sep 17 00:00:00 2001 From: yama Date: Sat, 24 Aug 2013 14:28:01 +0900 Subject: [PATCH 267/530] Semicolon bug --- manager/actions/mutate_tmplvars.dynamic.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manager/actions/mutate_tmplvars.dynamic.php b/manager/actions/mutate_tmplvars.dynamic.php index 72cee3a961..16b84f5e8e 100644 --- a/manager/actions/mutate_tmplvars.dynamic.php +++ b/manager/actions/mutate_tmplvars.dynamic.php @@ -142,7 +142,7 @@ function showParameters(ctrl) { for(p = 0; p < dp.length; p++) { dp[p]=(dp[p]+'').replace(/^\s|\s$/,""); // trim ar = dp[p].split("="); - key = ar[0] // param + key = ar[0]; // param ar = (ar[1]+'').split(";"); desc = ar[0]; // description dt = ar[1]; // data type From 791224524e2d0c2376f89b3e3db835ce0338c1f4 Mon Sep 17 00:00:00 2001 From: yama Date: Sat, 24 Aug 2013 14:30:29 +0900 Subject: [PATCH 268/530] Refactor #10106 Add tab pane to template var edit http://tracker.modx.com/issues/10106 --- manager/actions/mutate_tmplvars.dynamic.php | 26 +++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/manager/actions/mutate_tmplvars.dynamic.php b/manager/actions/mutate_tmplvars.dynamic.php index 16b84f5e8e..35cd81c593 100644 --- a/manager/actions/mutate_tmplvars.dynamic.php +++ b/manager/actions/mutate_tmplvars.dynamic.php @@ -282,9 +282,17 @@ function decode(s){

    +
    +
    + +
    +

    +

    - +
    @@ -367,15 +375,21 @@ function decode(s){ - +
    : [**]    
    class="inputBox" />
    +
    +

    +

    + hasPermission('access_permissions')) { if($checked) $notPublic = true; - $chks.= "".$row['name']."
    "; + $chks.= ""; } else { if($checked) echo ""; } } if($modx->hasPermission('access_permissions')) { - $chks = "".$_lang['all_doc_groups']."
    ".$chks; + $chks = "".$chks; } echo $chks; ?> @@ -488,6 +502,8 @@ function makePublic(b){
    +
    + @@ -496,5 +512,7 @@ function makePublic(b){ $evtOut = $modx->invokeEvent('OnTVFormRender',array('id' => $id)); if(is_array($evtOut)) echo implode('',$evtOut); ?> +
    +
    From 70c565a65ddb297b2996eb1e92b754bee65b52be Mon Sep 17 00:00:00 2001 From: yama Date: Sat, 24 Aug 2013 14:32:52 +0900 Subject: [PATCH 269/530] Refactor #10107 Set default template at new template var http://tracker.modx.com/issues/10107 --- manager/actions/mutate_tmplvars.dynamic.php | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/manager/actions/mutate_tmplvars.dynamic.php b/manager/actions/mutate_tmplvars.dynamic.php index 35cd81c593..00c61aa179 100644 --- a/manager/actions/mutate_tmplvars.dynamic.php +++ b/manager/actions/mutate_tmplvars.dynamic.php @@ -398,13 +398,26 @@ function decode(s){ db->getRow($rs)) { - if($id == 0 && is_array($_POST['template'])) { + while ($row = $modx->db->getRow($rs)) + { + if($_REQUEST['a']=='300' && $modx->config['default_template']==$row['id']) + { + $checked = true; + } + elseif(isset($_GET['tpl']) && $_GET['tpl'] == $row['id']) + { + $checked = true; + } + elseif($id == 0 && is_array($_POST['template'])) + { $checked = in_array($row['id'], $_POST['template']); - } else { + } + else + { $checked = $row['tmplvarid']; } - echo "".$row['templatename']."
    "; + $checked = $checked ? ' checked="checked"':''; + echo ''; } ?> From df4565143c7a05952745ce80642f6abd9632f273 Mon Sep 17 00:00:00 2001 From: yama Date: Sat, 24 Aug 2013 14:34:08 +0900 Subject: [PATCH 270/530] Small fix --- manager/actions/mutate_plugin.dynamic.php | 68 +++++++++++++---------- 1 file changed, 40 insertions(+), 28 deletions(-) diff --git a/manager/actions/mutate_plugin.dynamic.php b/manager/actions/mutate_plugin.dynamic.php index cab746fb60..3982302291 100644 --- a/manager/actions/mutate_plugin.dynamic.php +++ b/manager/actions/mutate_plugin.dynamic.php @@ -25,11 +25,13 @@ // check to see the plugin editor isn't locked $rs = $modx->db->select('internalKey, username','[+prefix+]active_users',"action='102' AND id='{$id}'"); $limit = $modx->db->getRecordCount($rs); -if($limit>1) { - for ($i=0;$i<$limit;$i++) { - $lock = $modx->db->getRow($rs); - if($lock['internalKey']!=$modx->getLoginUserID()) { - $msg = sprintf($_lang["lock_msg"],$lock['username'],"plugin"); +if($limit>1) +{ + while($lock = $modx->db->getRow) + { + if($lock['internalKey']!=$modx->getLoginUserID()) + { + $msg = sprintf($_lang["lock_msg"],$lock['username'],$_lang['plugin']); $e->setError(5, $msg); $e->dumpError(); } @@ -37,25 +39,30 @@ } // end check for lock - -if(isset($_GET['id'])) { +if(isset($_GET['id'])) +{ $rs = $modx->db->select('*','[+prefix+]site_plugins',"id='{$id}'"); $limit = $modx->db->getRecordCount($rs); - if($limit>1) { + if($limit>1) + { echo "Multiple plugins sharing same unique id. Not good.

    "; exit; } - if($limit<1) { - header("Location: /index.php?id=".$site_start); + if($limit<1) + { + header("Location: {$modx->config['site_url']}"); } $content = $modx->db->getRow($rs); $_SESSION['itemname']=$content['name']; - if($content['locked']==1 && $_SESSION['mgrRole']!=1) { + if($content['locked']==1 && $modx->hasPermission('save_role')!=1) + { $e->setError(3); $e->dumpError(); } -} else { - $_SESSION['itemname']="New Plugin"; +} +else +{ + $_SESSION['itemname']='New Plugin'; } ?> -

    + invokeEvent("OnPluginFormPrerender",array("id" => $id)); @@ -302,7 +309,7 @@ function decode(s){ - + @@ -335,7 +342,7 @@ function decode(s){
    ::  
    - + - + - + - + - - + + @@ -398,15 +406,19 @@ function decode(s){ if(is_numeric($id) && $id > 0) { $evts = array(); $rs = $modx->db->select('*','[+prefix+]site_plugin_events',"pluginid='{$id}'"); - $limit = $modx->db->getRecordCount($rs); - for ($i=0; $i<$limit; $i++) { - $row = $modx->db->getRow($rs); - $evts[] = $row['evtid']; + while($row = $modx->db->getRow($rs)) + { + $evts[] = $row['evtid']; } - } else { - if(isset($content['sysevents']) && is_array($content['sysevents'])) { + } + else + { + if(isset($content['sysevents']) && is_array($content['sysevents'])) + { $evts = $content['sysevents']; - } else { + } + else + { $evts = array(); } } From fab58c1fdccc0d6addf4c590fc4f1646b4b750e8 Mon Sep 17 00:00:00 2001 From: yama Date: Sun, 25 Aug 2013 17:40:19 +0900 Subject: [PATCH 271/530] Fix TinyMCE --- assets/plugins/tinymce/functions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/plugins/tinymce/functions.php b/assets/plugins/tinymce/functions.php index 1b7742d8b4..b49f47335f 100644 --- a/assets/plugins/tinymce/functions.php +++ b/assets/plugins/tinymce/functions.php @@ -4,9 +4,9 @@ class TinyMCE { var $mce_path; - function TinyMCE() + function TinyMCE($params) { - $this->mce_path = $$modx->event->params['mce_path']; + $this->mce_path = $params['mce_path']; } function get_lang($lang) From 842eccdfa454577124eb80fa4ec4a7dda1b03e3a Mon Sep 17 00:00:00 2001 From: Dmi3yy Date: Sun, 25 Aug 2013 17:26:05 +0300 Subject: [PATCH 272/530] small fix kcfinder --- manager/media/browser/mcpuk/themes/oxygen/style.css | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/manager/media/browser/mcpuk/themes/oxygen/style.css b/manager/media/browser/mcpuk/themes/oxygen/style.css index d5c74de70c..ce2af715f0 100644 --- a/manager/media/browser/mcpuk/themes/oxygen/style.css +++ b/manager/media/browser/mcpuk/themes/oxygen/style.css @@ -63,7 +63,7 @@ input[type="button"]:focus, input[type="submit"]:focus, input[type="reset"]:focu } fieldset { - margin: 0 5px 5px 0px; + margin: 0 5px 5px 0; padding: 5px; border: 1px solid #afadaa; border-radius: 4px; @@ -227,6 +227,7 @@ tr.selected:hover > td { border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px; + position:relative; } #toolbar a { From c6a3f6ec5df80b1a85ef2dd35967256cedab42db Mon Sep 17 00:00:00 2001 From: Dmi3yy Date: Sun, 25 Aug 2013 18:02:33 +0300 Subject: [PATCH 273/530] fix russian lang --- manager/includes/lang/russian-UTF8.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manager/includes/lang/russian-UTF8.inc.php b/manager/includes/lang/russian-UTF8.inc.php index 3c6ef9341f..85c56f9b18 100755 --- a/manager/includes/lang/russian-UTF8.inc.php +++ b/manager/includes/lang/russian-UTF8.inc.php @@ -1166,7 +1166,7 @@ $_lang["configcheck_sysfiles_mod_msg"] = 'You have enabled the setting to check important system files to detect possible website script attacks. This doesn\'t necessarily mean that your site has been compromised, however, you should review the changed files.(index.php, .htaccess, [+MGR_DIR+]/index.php, [+MGR_DIR+]/includes/config.inc.php)'; $_lang['email_method_title'] = 'Метод отправки писем'; -$_lang['email_method_mail'] = 'MAIL - ообщения отправляются с помощью функции mail().'; +$_lang['email_method_mail'] = 'MAIL - cообщения отправляются с помощью функции mail().'; $_lang['email_method_smtp'] = 'Адрес SMTP-сервера'; $_lang['smtp_auth_title'] = 'SMTP авторизация'; $_lang['smtp_host_title'] = 'Адрес SMTP-сервера'; From 2d0157f71825b9cb6e651694cb84ae94b7b2ec7e Mon Sep 17 00:00:00 2001 From: Dmi3yy Date: Sun, 25 Aug 2013 18:03:12 +0300 Subject: [PATCH 274/530] fix docmanager theme html --- assets/modules/docmanager/templates/documents.tpl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/assets/modules/docmanager/templates/documents.tpl b/assets/modules/docmanager/templates/documents.tpl index 5a2ce96531..1d7d385db2 100644 --- a/assets/modules/docmanager/templates/documents.tpl +++ b/assets/modules/docmanager/templates/documents.tpl @@ -1,4 +1,5 @@
    +
    [+lang.DM_range_title+]
    @@ -17,5 +18,6 @@
    [+lang.DM_select_range_text+] -
    +
    +
    \ No newline at end of file From 074f4cc9f411a4cec1577d613161470a8e3d9beb Mon Sep 17 00:00:00 2001 From: Dmi3yy Date: Sun, 25 Aug 2013 18:04:00 +0300 Subject: [PATCH 275/530] tv delimited list - now can with & n b s p ; --- manager/includes/tmplvars.format.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manager/includes/tmplvars.format.inc.php b/manager/includes/tmplvars.format.inc.php index e4fa3b9493..5d26248b93 100755 --- a/manager/includes/tmplvars.format.inc.php +++ b/manager/includes/tmplvars.format.inc.php @@ -58,7 +58,7 @@ function getTVDisplayFormat($name,$value,$format,$paramstring="",$tvtype="",$doc case "delim": // display as delimitted list $value = parseInput($value,"||"); - $p = $params['format'] ? $params['format']:","; + $p = $params['format'] ? $params['format']:" "; if ($p=="\\n") $p = "\n"; $o = str_replace("||",$p,$value); break; From aa514ae215a4b7b555dbbcc03ebf5c485784f5ae Mon Sep 17 00:00:00 2001 From: Dmi3yy Date: Sun, 25 Aug 2013 18:09:18 +0300 Subject: [PATCH 276/530] fix theme html in messages --- manager/actions/messages.static.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/manager/actions/messages.static.php b/manager/actions/messages.static.php index 1c2d2ac1b6..4608e530b7 100644 --- a/manager/actions/messages.static.php +++ b/manager/actions/messages.static.php @@ -8,6 +8,7 @@

    +
    +
    From e09aed0d09579b5776477e1dc37b40f41260c71f Mon Sep 17 00:00:00 2001 From: Dmi3yy Date: Sun, 25 Aug 2013 18:20:15 +0300 Subject: [PATCH 277/530] fix html for themes in templates --- manager/actions/mutate_templates.dynamic.php | 6 ++++++ manager/media/style/MODxRE/style.css | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/manager/actions/mutate_templates.dynamic.php b/manager/actions/mutate_templates.dynamic.php index 6b78737fdd..668cbaf77c 100644 --- a/manager/actions/mutate_templates.dynamic.php +++ b/manager/actions/mutate_templates.dynamic.php @@ -124,6 +124,9 @@ function deletedocument() { + +
    +
    @@ -228,3 +231,6 @@ function deletedocument() { ?>
    + +
    + diff --git a/manager/media/style/MODxRE/style.css b/manager/media/style/MODxRE/style.css index d503c81a4d..ad6f310493 100644 --- a/manager/media/style/MODxRE/style.css +++ b/manager/media/style/MODxRE/style.css @@ -511,8 +511,8 @@ input.submit { margin: 5px 15px 15px; display: block; } - .tab-page .sectionBody, .tab-page .section .sectionBody { - background: none repeat scroll 0 0 #F7F7F7; + .tab-page .sectionBody, .tab-page .section .sectionBody, .sectionBody .sectionBody { + background: none repeat scroll 0 0 #F7F7F7!important; border: 1px solid #CCCCCC; margin: 0 3px 15px; padding: 7px; From bd1058c755737fb045cc77fc470b047759d14aae Mon Sep 17 00:00:00 2001 From: Dmi3yy Date: Sun, 25 Aug 2013 18:24:25 +0300 Subject: [PATCH 278/530] fix html for themes in chunks --- manager/actions/mutate_htmlsnippet.dynamic.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/manager/actions/mutate_htmlsnippet.dynamic.php b/manager/actions/mutate_htmlsnippet.dynamic.php index 28c6cbd89c..d2920021eb 100644 --- a/manager/actions/mutate_htmlsnippet.dynamic.php +++ b/manager/actions/mutate_htmlsnippet.dynamic.php @@ -151,7 +151,7 @@ function deletedocument() {
  • " />
  • - +

    :  :  
    ::
    :  :  
     


    :
    : +
     
    @@ -183,7 +183,7 @@ function deletedocument() {
    -
    +
    @@ -213,6 +213,7 @@ function deletedocument() { ?> + Date: Sun, 25 Aug 2013 18:26:44 +0300 Subject: [PATCH 279/530] fix html for themes im user-dynamic --- manager/actions/mutate_user.dynamic.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/manager/actions/mutate_user.dynamic.php b/manager/actions/mutate_user.dynamic.php index 1c04e43274..da54991674 100644 --- a/manager/actions/mutate_user.dynamic.php +++ b/manager/actions/mutate_user.dynamic.php @@ -824,7 +824,7 @@ function SetUrl(url, width, height, alt){ $groupsarray[] = $v; } ?> - +
    +
    Date: Sun, 25 Aug 2013 18:37:30 +0300 Subject: [PATCH 280/530] fix html for themes i save user --- manager/processors/save_user.processor.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/manager/processors/save_user.processor.php b/manager/processors/save_user.processor.php index 242842b5fd..991b098ccf 100755 --- a/manager/processors/save_user.processor.php +++ b/manager/processors/save_user.processor.php @@ -232,7 +232,7 @@ function generate_password($length = 10) {
  • " />
  • - +
    @@ -241,6 +241,7 @@ function generate_password($length = 10) {

    +
    " /> getLoginUserID()) ? $_lang['logout'] : $_lang['close']; ?> - +
    @@ -434,6 +435,7 @@ function generate_password($length = 10) {

    +
    Date: Sun, 25 Aug 2013 18:40:33 +0300 Subject: [PATCH 281/530] fix html for themes i save user --- manager/processors/save_web_user.processor.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/manager/processors/save_web_user.processor.php b/manager/processors/save_web_user.processor.php index f81ac634c2..825e2c7f49 100755 --- a/manager/processors/save_web_user.processor.php +++ b/manager/processors/save_web_user.processor.php @@ -199,7 +199,7 @@
  • " />
  • - +
    @@ -208,6 +208,7 @@

    +
    " /> - +

    +
    Date: Mon, 26 Aug 2013 00:43:46 +0900 Subject: [PATCH 282/530] Fix - TinyMCE --- assets/plugins/tinymce/functions.php | 129 ++++++++++++++++++---- assets/plugins/tinymce/plugin.tinymce.php | 90 +-------------- 2 files changed, 112 insertions(+), 107 deletions(-) diff --git a/assets/plugins/tinymce/functions.php b/assets/plugins/tinymce/functions.php index b49f47335f..eade440fb1 100644 --- a/assets/plugins/tinymce/functions.php +++ b/assets/plugins/tinymce/functions.php @@ -2,11 +2,14 @@ class TinyMCE { - var $mce_path; + var $params; - function TinyMCE($params) + function TinyMCE() { - $this->mce_path = $params['mce_path']; + global $modx; + $this->params = $modx->event->params; + $this->params['mce_path'] = MODX_BASE_PATH . 'assets/plugins/tinymce/'; + $this->params['mce_url'] = MODX_BASE_URL . 'assets/plugins/tinymce/'; } function get_lang($lang) @@ -48,9 +51,10 @@ function get_lang($lang) function get_skin_names() { global $modx,$_lang; - $params = $modx->event->params; + $params = $this->params; + $mce_path = $params['mce_path']; - $skin_dir = $this->mce_path . 'tiny_mce/themes/advanced/skins/'; + $skin_dir = "{$mce_path}tiny_mce/themes/advanced/skins/"; switch($modx->manager->action) { case '11': @@ -105,15 +109,51 @@ function checked($cond = false) function get_mce_settings() { global $modx, $_lang; - $params = $modx->event->params; + $params = $this->params; + $mce_path = $params['mce_path']; + + switch ($modx->manager->action) + { + case 11: + $mce_settings = array(); + break; + case 12: + case 119: + $mce_settings = $usersettings; + if(!empty($usersettings['tinymce_editor_theme'])) + { + $usersettings['tinymce_editor_theme'] = $settings['tinymce_editor_theme']; + } + break; + case 17: + $mce_settings = $settings; + break; + default: + $mce_settings = $settings; + break; + } + + $params['theme'] = $mce_settings['tinymce_editor_theme']; + $params['mce_editor_skin'] = $mce_settings['mce_editor_skin']; + $params['mce_entermode'] = $mce_settings['mce_entermode']; + $params['mce_element_format'] = $mce_settings['mce_element_format']; + $params['mce_schema'] = $mce_settings['mce_schema']; + $params['css_selectors'] = $mce_settings['tinymce_css_selectors']; + $params['custom_plugins'] = $mce_settings['tinymce_custom_plugins']; + $params['custom_buttons1'] = $mce_settings['tinymce_custom_buttons1']; + $params['custom_buttons2'] = $mce_settings['tinymce_custom_buttons2']; + $params['custom_buttons3'] = $mce_settings['tinymce_custom_buttons3']; + $params['custom_buttons4'] = $mce_settings['tinymce_custom_buttons4']; + $params['mce_template_docs'] = $mce_settings['mce_template_docs']; + $params['mce_template_chunks']= $mce_settings['mce_template_chunks']; // language settings - if (! @include_once($params['mce_path'] .'lang/'.$modx->config['manager_language'].'.inc.php')) + if (! @include_once("{$mce_path}lang/".$modx->config['manager_language'].'.inc.php')) { - include_once($params['mce_path'] .'lang/english.inc.php'); + include_once("{$mce_path}lang/english.inc.php"); } - include_once $params['mce_path'] . 'settings/default_params.php'; + include_once("{$mce_path}settings/default_params.php"); $ph += $_lang; switch($modx->manager->action) @@ -179,7 +219,7 @@ function get_mce_settings() break; } - $gsettings = file_get_contents($params['mce_path'] . 'inc/gsettings.html.inc'); + $gsettings = file_get_contents("{$mce_path}inc/gsettings.html.inc"); foreach($ph as $name => $value) { @@ -192,7 +232,46 @@ function get_mce_settings() function get_mce_script() { global $modx, $_lang; - $params = $modx->event->params; + $params = $this->params; + $mce_path = $params['mce_path']; + $mce_url = $params['mce_url']; + + $params['css_selectors'] = $modx->config['tinymce_css_selectors']; + $params['use_browser'] = $modx->config['use_browser']; + $params['editor_css_path'] = $modx->config['editor_css_path']; + + if($modx->isBackend() || (intval($_GET['quickmanagertv']) == 1 && isset($_SESSION['mgrValidated']))) + { + $params['theme'] = $modx->config['tinymce_editor_theme']; + $params['mce_editor_skin'] = $modx->config['mce_editor_skin']; + $params['mce_entermode'] = $modx->config['mce_entermode']; + $params['language'] = $this->get_lang($modx->config['manager_language']); + $params['frontend'] = false; + $params['custom_plugins'] = $modx->config['tinymce_custom_plugins']; + $params['custom_buttons1'] = $modx->config['tinymce_custom_buttons1']; + $params['custom_buttons2'] = $modx->config['tinymce_custom_buttons2']; + $params['custom_buttons3'] = $modx->config['tinymce_custom_buttons3']; + $params['custom_buttons4'] = $modx->config['tinymce_custom_buttons4']; + $params['toolbar_align'] = $modx->config['manager_direction']; + $params['webuser'] = null; + } + else + { + $frontend_language = isset($modx->config['fe_editor_lang']) ? $modx->config['fe_editor_lang']:''; + $webuser = (isset($modx->config['rb_webuser']) ? $modx->config['rb_webuser'] : null); + + $params['theme'] = $webtheme; + $params['webuser'] = $webuser; + $params['language'] = $this->get_lang($frontend_language); + $params['frontend'] = true; + $params['custom_plugins'] = $webPlugins; + $params['custom_buttons1'] = $webButtons1; + $params['custom_buttons2'] = $webButtons2; + $params['custom_buttons3'] = $webButtons3; + $params['custom_buttons4'] = $webButtons4; + $params['toolbar_align'] = $webAlign; + + } $str = ''; @@ -281,7 +360,7 @@ function get_mce_script() $str .= $this->build_tiny_callback(); if($params['link_list']=='enabled') { - $str .= '' . "\n"; + $str .= '' . "\n"; } @@ -291,11 +370,13 @@ function get_mce_script() function build_mce_init($plugins,$buttons1,$buttons2,$buttons3,$buttons4) { global $modx; - $params = $modx->event->params; + $params = $this->params; + $mce_path = $params['mce_path']; + $mce_url = $params['mce_url']; - $ph['refresh_seed'] = filesize("{$this->mce_path}tiny_mce/tiny_mce.js"); - $ph['mce_url'] = $params['mce_url']; - $ph['elmList'] = implode(",", $params['elements']); + $ph['refresh_seed'] = filesize("{$mce_path}tiny_mce/tiny_mce.js"); + $ph['mce_url'] = $mce_url; + $ph['elmList'] = implode(',', $params['elements']); $ph['width'] = (!empty($params['width'])) ? $params['width'] : '100%'; $ph['height'] = (!empty($params['height'])) ? $params['height'] : '300'; $ph['language'] = (empty($params['language'])) ? 'en' : $params['language']; @@ -383,7 +464,7 @@ function build_mce_init($plugins,$buttons1,$buttons2,$buttons3,$buttons4) $ph['onchange_callback'] = ($params['frontend']!==false)? "'myCustomOnChangeHandler'" : 'false'; $ph['terminate'] = (!empty($params['customparams'])) ? ',' : ''; $ph['customparams'] = rtrim($params['customparams'], ','); - $content_css[] = $params['mce_url'] . 'style/content.css'; + $content_css[] = "{$mce_url}style/content.css"; if (preg_match('@^/@', $params['editor_css_path'])) { $content_css[] = $params['editor_css_path']; @@ -397,11 +478,11 @@ function build_mce_init($plugins,$buttons1,$buttons2,$buttons3,$buttons4) $content_css[] = MODX_SITE_URL . $params['editor_css_path']; } $ph['content_css'] = join(',', $content_css); - $ph['link_list'] = ($params['link_list']=='enabled') ? "'{$params['mce_url']}js/tinymce.linklist.php'" : 'false'; + $ph['link_list'] = ($params['link_list']=='enabled') ? "'{$mce_url}js/tinymce.linklist.php'" : 'false'; - $ph['tpl_list'] = $params['mce_url'] . 'js/get_template.php'; + $ph['tpl_list'] = "{$mce_url}js/get_template.php"; - $mce_init = file_get_contents($params['mce_path'] . 'js/mce_init.js.inc'); + $mce_init = file_get_contents("{$mce_path}js/mce_init.js.inc"); foreach($ph as $name => $value) { @@ -414,12 +495,14 @@ function build_mce_init($plugins,$buttons1,$buttons2,$buttons3,$buttons4) function build_tiny_callback() { global $modx; - $params = $modx->event->params; + $params = $this->params; + $mce_path = $params['mce_path']; + $mce_url = $params['mce_url']; $ph['cmsurl'] = MODX_MANAGER_URL . 'media/browser/mcpuk/browser.php?Connector='; $ph['cmsurl'] .= MODX_MANAGER_URL . 'media/browser/mcpuk/connectors/php/connector.php&manager_url='; - $ph['cmsurl'] .= MODX_MANAGER_URL . '&editor=tinymce&editorpath=' . $params['mce_url']; - $modx_fb = file_get_contents($params['mce_path'] . 'js/modx_fb.js.inc'); + $ph['cmsurl'] .= MODX_MANAGER_URL . "&editor=tinymce&editorpath={$mce_url}"; + $modx_fb = file_get_contents("{$mce_path}js/modx_fb.js.inc"); foreach($ph as $name => $value) { diff --git a/assets/plugins/tinymce/plugin.tinymce.php b/assets/plugins/tinymce/plugin.tinymce.php index 8576fba2e1..5de8c116c6 100644 --- a/assets/plugins/tinymce/plugin.tinymce.php +++ b/assets/plugins/tinymce/plugin.tinymce.php @@ -1,21 +1,16 @@ event->params; + $params['mce_path'] = $mce_path; $params['mce_url'] = $mce_url; -include_once $mce_path . 'functions.php'; +$plugin_dir = 'tinymce'; +include_once("{$mce_path}functions.php"); $mce = new TinyMCE(); @@ -24,90 +19,17 @@ switch ($e->name) { case "OnRichTextEditorRegister": // register only for backend - $e->output("TinyMCE"); + $e->output('TinyMCE'); break; case "OnRichTextEditorInit": - if($editor!=="TinyMCE") return; - - $params['css_selectors'] = $modx->config['tinymce_css_selectors']; - $params['use_browser'] = $modx->config['use_browser']; - $params['editor_css_path'] = $modx->config['editor_css_path']; + if($editor!=='TinyMCE') return; - if($modx->isBackend() || (intval($_GET['quickmanagertv']) == 1 && isset($_SESSION['mgrValidated']))) - { - $params['theme'] = $modx->config['tinymce_editor_theme']; - $params['mce_editor_skin'] = $modx->config['mce_editor_skin']; - $params['mce_entermode'] = $modx->config['mce_entermode']; - $params['language'] = $mce->get_lang($modx->config['manager_language']); - $params['frontend'] = false; - $params['custom_plugins'] = $modx->config['tinymce_custom_plugins']; - $params['custom_buttons1'] = $modx->config['tinymce_custom_buttons1']; - $params['custom_buttons2'] = $modx->config['tinymce_custom_buttons2']; - $params['custom_buttons3'] = $modx->config['tinymce_custom_buttons3']; - $params['custom_buttons4'] = $modx->config['tinymce_custom_buttons4']; - $params['toolbar_align'] = $modx->config['manager_direction']; - $params['webuser'] = null; - - $html = $mce->get_mce_script(); - } - else - { - $frontend_language = isset($modx->config['fe_editor_lang']) ? $modx->config['fe_editor_lang']:''; - $webuser = (isset($modx->config['rb_webuser']) ? $modx->config['rb_webuser'] : null); - - $params['theme'] = $webtheme; - $params['webuser'] = $webuser; - $params['language'] = $mce->get_lang($frontend_language); - $params['frontend'] = true; - $params['custom_plugins'] = $webPlugins; - $params['custom_buttons1'] = $webButtons1; - $params['custom_buttons2'] = $webButtons2; - $params['custom_buttons3'] = $webButtons3; - $params['custom_buttons4'] = $webButtons4; - $params['toolbar_align'] = $webAlign; - - $html = $mce->get_mce_script(); - } + $html = $mce->get_mce_script(); $e->output($html); break; case "OnInterfaceSettingsRender": - switch ($modx->manager->action) - { - case 11: - $mce_settings = array(); - break; - case 12: - case 119: - $mce_settings = $usersettings; - if(!empty($usersettings['tinymce_editor_theme'])) - { - $usersettings['tinymce_editor_theme'] = $settings['tinymce_editor_theme']; - } - break; - case 17: - $mce_settings = $settings; - break; - default: - $mce_settings = $settings; - break; - } - - $params['theme'] = $mce_settings['tinymce_editor_theme']; - $params['mce_editor_skin'] = $mce_settings['mce_editor_skin']; - $params['mce_entermode'] = $mce_settings['mce_entermode']; - $params['mce_element_format'] = $mce_settings['mce_element_format']; - $params['mce_schema'] = $mce_settings['mce_schema']; - $params['css_selectors'] = $mce_settings['tinymce_css_selectors']; - $params['custom_plugins'] = $mce_settings['tinymce_custom_plugins']; - $params['custom_buttons1'] = $mce_settings['tinymce_custom_buttons1']; - $params['custom_buttons2'] = $mce_settings['tinymce_custom_buttons2']; - $params['custom_buttons3'] = $mce_settings['tinymce_custom_buttons3']; - $params['custom_buttons4'] = $mce_settings['tinymce_custom_buttons4']; - $params['mce_template_docs'] = $mce_settings['mce_template_docs']; - $params['mce_template_chunks']= $mce_settings['mce_template_chunks']; - $html = $mce->get_mce_settings(); $e->output($html); break; From 2a204828cd51a70f4d8f3ab0b9b17af38ca5d45c Mon Sep 17 00:00:00 2001 From: yama Date: Mon, 26 Aug 2013 00:48:36 +0900 Subject: [PATCH 283/530] Refactor #10108 TinyMCE - Separation toolbar settings from functions.php http://tracker.modx.com/issues/10108 --- assets/plugins/tinymce/functions.php | 133 +++++++----------- .../tinymce/settings/toolbar.settings.inc.php | 41 ++++++ 2 files changed, 95 insertions(+), 79 deletions(-) create mode 100644 assets/plugins/tinymce/settings/toolbar.settings.inc.php diff --git a/assets/plugins/tinymce/functions.php b/assets/plugins/tinymce/functions.php index eade440fb1..b1a9bac067 100644 --- a/assets/plugins/tinymce/functions.php +++ b/assets/plugins/tinymce/functions.php @@ -275,86 +275,61 @@ function get_mce_script() $str = ''; - switch($params['theme']) + $theme = $params['theme']; + switch($theme) { - case 'simple': - $plugins = 'autolink,inlinepopups,save,emotions,advimage,advlink,paste,contextmenu'; - $buttons1 = 'undo,redo,|,bold,strikethrough,|,justifyleft,justifycenter,justifyright,|,link,unlink,image,emotions,|,hr,|,help'; - $buttons2 = ''; - break; - case 'creative': - $plugins = 'autolink,inlinepopups,autosave,advlist,layer,style,fullscreen,advimage,advhr,paste,advlink,media,contextmenu,table'; - $buttons1 = 'undo,undo,redo,|,bold,forecolor,backcolor,strikethrough,formatselect,styleselect,fontsizeselect,code'; - $buttons2 = 'image,media,link,unlink,anchor,|,bullist,numlist,|,blockquote,outdent,indent,|,justifyleft,justifycenter,justifyright,|,advhr,|,styleprops,removeformat,|,pastetext,pasteword'; - $buttons3 = 'insertlayer,absolute,moveforward,movebackward,|,tablecontrols,|,fullscreen,help'; - break; - case 'logic': - $plugins = 'autolink,inlinepopups,autosave,advlist,xhtmlxtras,style,fullscreen,advimage,paste,advlink,media,contextmenu,table'; - $buttons1 = 'undo,redo,|,bold,forecolor,backcolor,strikethrough,formatselect,styleselect,fontsizeselect,code,|,fullscreen,help'; - $buttons2 = 'image,media,link,unlink,anchor,|,bullist,numlist,|,blockquote,outdent,indent,|,justifyleft,justifycenter,justifyright,|,table,|,hr,|,styleprops,removeformat,|,pastetext,pasteword'; - $buttons3 = 'charmap,sup,sub,|,cite,ins,del,abbr,acronym,attribs'; - break; - case 'legacy': - $plugins = 'autosave,advlist,style,advimage,advlink,searchreplace,print,contextmenu,paste,fullscreen,nonbreaking,xhtmlxtras,visualchars,media'; - $buttons1 = 'undo,redo,selectall,|,pastetext,pasteword,|,search,replace,|,nonbreaking,hr,charmap,|,image,link,unlink,anchor,media,|,cleanup,removeformat,|,fullscreen,print,code,help'; - $buttons2 = 'bold,italic,underline,strikethrough,sub,sup,|,blockquote,|,bullist,numlist,outdent,indent,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,|,styleprops'; - $buttons3 = ''; - break; - case 'advanced': - $plugins = ''; - $buttons1 = 'bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect'; - $buttons2 = 'bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code'; - $buttons3 = 'hr,removeformat,visualaid,|,sub,sup,|,charmap'; - break; - case 'full': - $plugins = 'autolink,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave'; - $buttons1 = 'save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect'; - $buttons2 = 'cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor'; - $buttons3 = 'tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen'; - $buttons4 = 'insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft'; - break; - case 'custom': - $plugins = $params['custom_plugins']; - $buttons1 = $params['custom_buttons1']; - $buttons2 = $params['custom_buttons2']; - $buttons3 = $params['custom_buttons3']; - $buttons4 = $params['custom_buttons4']; - break; - case 'default': - case 'editor': - default: - $plugins = 'template,visualblocks,autolink,inlinepopups,autosave,save,advlist,style,fullscreen,advimage,paste,advlink,media,contextmenu,table'; - $buttons1 = 'undo,redo,|,bold,forecolor,backcolor,strikethrough,formatselect,fontsizeselect,pastetext,pasteword,code,template,|,fullscreen,help'; - $buttons2 = 'image,media,link,unlink,anchor,|,justifyleft,justifycenter,justifyright,|,bullist,numlist,|,blockquote,outdent,indent,|,table,hr,|,visualblocks,styleprops,removeformat'; - $buttons3 = ''; - $buttons4 = ''; - if(is_dir($params['mce_path'] . 'tiny_mce/plugins/quickupload')) - { - $plugins = 'quickupload,'. $plugins; - $buttons2 = 'quickupload,'. $buttons2; - } - switch($modx->manager->action) - { - case '4': - case '27': - global $content; - if($content['template']==='0') - { - $plugins = str_replace('autosave', '', $plugins); - $plugins .= ',fullpage'; - $buttons2 = 'fullpage,' . $buttons2; - } - if(empty($modx->config['mce_template_docs']) && empty($modx->config['mce_template_chunks'])) - { - $plugins = str_replace('template', '', $plugins); - $plugins = str_replace(',,', ',', $plugins); - $buttons1 = str_replace(',template', '', $buttons1); - $buttons2 = str_replace(',template', '', $buttons2); - $buttons3 = str_replace(',template', '', $buttons3); - $buttons4 = str_replace(',template', '', $buttons4); - } - } - } + case 'custom': + $plugins = $params['custom_plugins']; + $buttons1 = $params['custom_buttons1']; + $buttons2 = $params['custom_buttons2']; + $buttons3 = $params['custom_buttons3']; + $buttons4 = $params['custom_buttons4']; + break; + case 'simple': + case 'creative': + case 'logic': + case 'legacy': + case 'advanced': + case 'full': + case 'default': + case 'editor': + default: + include_once("{$mce_path}settings/toolbar.settings.inc.php"); + if(empty($theme) || $theme==='editor') $theme = 'default'; + $plugins = $set[$theme]['p']; + $buttons1 = $set[$theme]['b1']; + $buttons2 = $set[$theme]['b2']; + $buttons3 = $set[$theme]['b3']; + $buttons4 = $set[$theme]['b4']; + if(is_dir("{$mce_path}tiny_mce/plugins/quickupload")) + { + $plugins = 'quickupload,'. $plugins; + $buttons2 = 'quickupload,'. $buttons2; + } + if($modx->manager->action=='4' || $modx->manager->action=='27') + { + global $content; + if($content['template']==='0') + { + $plugins = str_replace('autosave', '', $plugins); + if(strpos($plugins,'fullpage')===false) $plugins .= ',fullpage'; + if(strpos($buttons1.$buttons2.$buttons3.$buttons4, 'fullpage')===false) + { + if(!empty($buttons2)) $buttons2 = 'fullpage,' . $buttons2; + else $buttons1 .= ',fullpage'; + } + } + if(empty($modx->config['mce_template_docs']) && empty($modx->config['mce_template_chunks'])) + { + $plugins = str_replace('template', '', $plugins); + $plugins = str_replace(',,', ',', $plugins); + $buttons1 = str_replace(',template', '', $buttons1); + $buttons2 = str_replace(',template', '', $buttons2); + $buttons3 = str_replace(',template', '', $buttons3); + $buttons4 = str_replace(',template', '', $buttons4); + } + } + } $str .= $this->build_mce_init($plugins,$buttons1,$buttons2,$buttons3,$buttons4) . "\n"; $str .= $this->build_tiny_callback(); diff --git a/assets/plugins/tinymce/settings/toolbar.settings.inc.php b/assets/plugins/tinymce/settings/toolbar.settings.inc.php new file mode 100644 index 0000000000..4a835034b9 --- /dev/null +++ b/assets/plugins/tinymce/settings/toolbar.settings.inc.php @@ -0,0 +1,41 @@ + Date: Mon, 26 Aug 2013 00:52:36 +0900 Subject: [PATCH 284/530] Fix Tab pane ID Fix Tab pane ID http://tracker.modx.com/issues/10109 --- manager/actions/access_permissions.dynamic.php | 4 ++-- manager/actions/help.static.php | 6 +++--- manager/actions/web_access_permissions.dynamic.php | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/manager/actions/access_permissions.dynamic.php b/manager/actions/access_permissions.dynamic.php index cfc25c0489..50a3b4364b 100644 --- a/manager/actions/access_permissions.dynamic.php +++ b/manager/actions/access_permissions.dynamic.php @@ -47,8 +47,8 @@

    '.$_lang['access_permissions_off'].'

    ' : ''?> -
    - +
    +
    diff --git a/manager/actions/help.static.php b/manager/actions/help.static.php index bf7ab5fdbf..247390ec4d 100644 --- a/manager/actions/help.static.php +++ b/manager/actions/help.static.php @@ -6,9 +6,9 @@

    -
    +
    '; echo '

    '.$helpname.'

    '; - echo ''; + echo ''; include "../assets/templates/help/$v"; echo '
    '; } diff --git a/manager/actions/web_access_permissions.dynamic.php b/manager/actions/web_access_permissions.dynamic.php index 683769eaaf..43f0c68d25 100644 --- a/manager/actions/web_access_permissions.dynamic.php +++ b/manager/actions/web_access_permissions.dynamic.php @@ -38,8 +38,8 @@

    '.$_lang['access_permissions_off'].'

    ' : '' ;?> -
    - +
    +
    From 8ea2dcdb008d14db2196e6554279a349a7508192 Mon Sep 17 00:00:00 2001 From: yama Date: Mon, 26 Aug 2013 00:53:19 +0900 Subject: [PATCH 285/530] Small fix --- manager/actions/mutate_module.dynamic.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/manager/actions/mutate_module.dynamic.php b/manager/actions/mutate_module.dynamic.php index 73557821d1..b14fd7cea3 100644 --- a/manager/actions/mutate_module.dynamic.php +++ b/manager/actions/mutate_module.dynamic.php @@ -363,13 +363,13 @@ function SetUrl(url, width, height, alt) {

    - +
    @@ -416,7 +416,7 @@ function SetUrl(url, width, height, alt) {

    - +
    :
    @@ -434,7 +434,7 @@ function SetUrl(url, width, height, alt) {

    - +
    :



    From d39ca177f3f89bea5c5bbcdff39455b2044729d6 Mon Sep 17 00:00:00 2001 From: yama Date: Mon, 26 Aug 2013 00:53:39 +0900 Subject: [PATCH 286/530] Small fix - MODxRE theme --- manager/media/style/MODxRE/style.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manager/media/style/MODxRE/style.css b/manager/media/style/MODxRE/style.css index d503c81a4d..1a5bce3b75 100644 --- a/manager/media/style/MODxRE/style.css +++ b/manager/media/style/MODxRE/style.css @@ -1285,7 +1285,7 @@ a.hometblink, a.hometblink img { vertical-align: middle; } .sectionBody .tab-page { - padding: 30px 15px 20px !important; + padding: 20px 15px 15px !important; } /* -------------------------[ New sortable table class ]--- */ .sortabletable { From d0a716fb34f259c0421b5eb97b842f78677e5a73 Mon Sep 17 00:00:00 2001 From: yama Date: Mon, 26 Aug 2013 00:55:25 +0900 Subject: [PATCH 287/530] Refactor #10110 Add actionButtons class to elements list http://tracker.modx.com/issues/10110 --- manager/actions/resources.static.php | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/manager/actions/resources.static.php b/manager/actions/resources.static.php index 7af9c34e98..abe6034615 100644 --- a/manager/actions/resources.static.php +++ b/manager/actions/resources.static.php @@ -75,10 +75,9 @@ function createResourceList($resourceTable,$action,$tablePre,$nameField = 'name'

    -
      +
      -
      @@ -93,10 +92,9 @@ function createResourceList($resourceTable,$action,$tablePre,$nameField = 'name' Added by Apodigm 09-06-2004- DocVars - web@apodigm.com -->

      -
        +
        -
        @@ -108,10 +106,9 @@ function createResourceList($resourceTable,$action,$tablePre,$nameField = 'name'

        -
          +
          -
          @@ -123,10 +120,9 @@ function createResourceList($resourceTable,$action,$tablePre,$nameField = 'name'

          -
            +
            -
            @@ -138,11 +134,10 @@ function createResourceList($resourceTable,$action,$tablePre,$nameField = 'name'

            -
              +
              • hasPermission('save_plugin')) { ?>
              -
              From b32585264da842b447dcab7a8027d163719894c9 Mon Sep 17 00:00:00 2001 From: yama Date: Mon, 26 Aug 2013 01:00:16 +0900 Subject: [PATCH 288/530] Fix section block html --- assets/modules/docmanager/templates/documents.tpl | 2 ++ assets/modules/docmanager/templates/main.tpl | 3 +-- assets/modules/docmanager/templates/sort_list.tpl | 6 ++++-- manager/actions/move_document.dynamic.php | 3 ++- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/assets/modules/docmanager/templates/documents.tpl b/assets/modules/docmanager/templates/documents.tpl index 5a2ce96531..eaa017b165 100644 --- a/assets/modules/docmanager/templates/documents.tpl +++ b/assets/modules/docmanager/templates/documents.tpl @@ -1,4 +1,5 @@
              +
              [+lang.DM_range_title+]
              @@ -18,4 +19,5 @@
              [+lang.DM_select_range_text+]
              +
              \ No newline at end of file diff --git a/assets/modules/docmanager/templates/main.tpl b/assets/modules/docmanager/templates/main.tpl index 58e6736a95..150307ade6 100644 --- a/assets/modules/docmanager/templates/main.tpl +++ b/assets/modules/docmanager/templates/main.tpl @@ -69,8 +69,7 @@
            • [+lang.DM_close+]
            -
            [+lang.DM_action_title+]
            -
            +
            '; - include "../assets/templates/help/$v"; + include_once(MODX_BASE_PATH . "assets/templates/help/{$v}"; echo '
            '; } ?> From 9352a72d139a0d39a94656a1ea6b9428dadb125a Mon Sep 17 00:00:00 2001 From: yama Date: Mon, 26 Aug 2013 01:18:56 +0900 Subject: [PATCH 295/530] Refactor #10111 Add primary button class http://tracker.modx.com/issues/10111 --- manager/actions/mutate_content.dynamic.php | 2 +- manager/media/style/MODxRE/style.css | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/manager/actions/mutate_content.dynamic.php b/manager/actions/mutate_content.dynamic.php index 3399198721..9dd4500be9 100644 --- a/manager/actions/mutate_content.dynamic.php +++ b/manager/actions/mutate_content.dynamic.php @@ -543,7 +543,7 @@ function decode(s) {
            • - + icons_save" /> + - - - - - - - - - +
              :{{}} 
              :    
              :     -
              :  
              class="inputBox" value="on" /> -
              + +
              {{ }} 
              -
              +
              @@ -202,6 +190,43 @@ function deletedocument() { ?>
              + + +
              +

              + +
              + + + + + + + + + + + + + + +
              +
              class="inputBox" value="on" /> +
              +
              +
              + - +
            +
            db->getRow($rs); if ($lock['internalKey'] != $modx->getLoginUserID()) { - $msg = sprintf($_lang['lock_msg'], $lock['username'], 'module'); + $msg = sprintf($_lang['lock_msg'], $lock['username'], $_lang['module']); $e->setError(5, $msg); $e->dumpError(); } @@ -373,33 +373,7 @@ function SetUrl(url, width, height, alt) { - - - - - - - - - - - - - +
            :    
            :    
            (32x32):    
            :     -
            :  
            class="inputBox" onclick="documentDirty=true;" /> :  
            value="on" class="inputBox" /> - '.$_lang['module_disabled'].'' : $_lang['module_disabled']?>
            class="inputBox" /> -
              
            @@ -420,17 +394,17 @@ function SetUrl(url, width, height, alt) { - + - + - +
            :  



            class="inputBox" onclick="documentDirty=true;" /> :  



            :  
               
            - +

            @@ -458,7 +432,7 @@ function SetUrl(url, width, height, alt) { 'LEFT JOIN '.$tbl_site_templates.' AS st ON st.id = smd.resource AND smd.type = 50 '. 'LEFT JOIN '.$tbl_site_tmplvars.' AS sv ON sv.id = smd.resource AND smd.type = 60 '. 'WHERE smd.module=\''.$id.'\' ORDER BY smd.type,name'; -$ds = $modx->dbQuery($sql); +$ds = $modx->db->query($sql); if (!$ds) { echo "An error occured while loading module dependencies."; } else { @@ -476,12 +450,46 @@ function SetUrl(url, width, height, alt) {
    - - + + + +
    +

    + +
    + + + + + + + + + + + + + +
    value="on" class="inputBox" /> + '.$_lang['module_disabled'].'' : $_lang['module_disabled']?>
    :  
    :   +
    :
    (32x32):  
    class="inputBox" onclick="documentDirty=true;" /> :
    class="inputBox" /> +
    + +
    - + + + tp.addTabPage( document.getElementById( "tabPlugin" ) ); - + - - - - - - - - - -
    ::  
    :  
    ":$_lang['plugin_disabled']; ?>
    value="on" class="inputBox">
    @@ -340,31 +330,13 @@ function decode(s){

    - - - - - +
    :   -
    - - - - - + - + - - + + @@ -406,19 +377,15 @@ function decode(s){ if(is_numeric($id) && $id > 0) { $evts = array(); $rs = $modx->db->select('*','[+prefix+]site_plugin_events',"pluginid='{$id}'"); - while($row = $modx->db->getRow($rs)) - { - $evts[] = $row['evtid']; + $limit = $modx->db->getRecordCount($rs); + for ($i=0; $i<$limit; $i++) { + $row = $modx->db->getRow($rs); + $evts[] = $row['evtid']; } - } - else - { - if(isset($content['sysevents']) && is_array($content['sysevents'])) - { + } else { + if(isset($content['sysevents']) && is_array($content['sysevents'])) { $evts = $content['sysevents']; - } - else - { + } else { $evts = array(); } } @@ -452,7 +419,7 @@ function decode(s){ echo ""; echo ""; } - $evtnames[] = ''."\n"; + $evtnames[] = ''."\n"; if(count($evtnames)==2) echoEventRows($evtnames); } if(count($evtnames)>0) echoEventRows($evtnames); @@ -462,8 +429,48 @@ function echoEventRows(&$evtnames) { $evtnames = array(); } ?> +
    :
    :  :  
     


    : -
    :
     
    ".$row['groupname']."
    + + + +
    + + +
    +

    + + + + + + + + + + + + + + + + + + + +
    ":$_lang['plugin_disabled']; ?>
    :  
    :   +
    :
    value="on" class="inputBox">
    +
    @@ -477,12 +484,6 @@ function echoEventRows(&$evtnames) { setTimeout('showParameters()',10); db->getRow($rs); if($lock['internalKey']!=$modx->getLoginUserID()) { - $msg = sprintf($_lang['lock_msg'],$lock['username'],"snippet"); + $msg = sprintf($_lang['lock_msg'],$lock['username'],$_lang['snippet']); $e->setError(5, $msg); $e->dumpError(); } @@ -310,14 +310,7 @@ function decode(s){ - - - - - - - - +
    :[[]] 
    :    
    class="inputBox"> [[  ]] 
    @@ -337,10 +330,17 @@ function decode(s){

    - +
    + + + + + + + - - + - + - - + - + diff --git a/manager/actions/mutate_templates.dynamic.php b/manager/actions/mutate_templates.dynamic.php index 018535dc0a..37c4e5eb4c 100644 --- a/manager/actions/mutate_templates.dynamic.php +++ b/manager/actions/mutate_templates.dynamic.php @@ -119,58 +119,22 @@ function deletedocument() { - - -
    - -
    -

    - - + - -
    class="inputBox">
    :    
    :  
    :    
    :  
     
    +' . $_lang['template_msg'] . ''; ?> +
    - - - - - + - - - - - - - - - - - - - - -
     
    :  :
    :  
    :     -
    :  
    class="inputBox">
    @@ -184,7 +148,7 @@ function deletedocument() { -getFullTableName('site_tmplvar_templates')." tr INNER JOIN ".$modx->getFullTableName('site_tmplvars')." tv ON tv.id = tr.tmplvarid @@ -198,7 +162,7 @@ function deletedocument() {

    - +

    0) echo $_lang['template_tv_msg']; ?>

    hasPermission('save_template') && $limit > 1) { ?>

    - - +
    +

    + + + + + + + + + + + + + + + + + +
    :
    : +
    :
    class="inputBox">
    invokeEvent("OnTempFormRender",array("id" => $id)); diff --git a/manager/actions/mutate_tmplvars.dynamic.php b/manager/actions/mutate_tmplvars.dynamic.php index 00c61aa179..d1b55a75c5 100644 --- a/manager/actions/mutate_tmplvars.dynamic.php +++ b/manager/actions/mutate_tmplvars.dynamic.php @@ -295,21 +295,16 @@ function decode(s){ - + - - - - - - - + + - - + - + - - - - - +
    :[**]  [* *]   
    :    
    :    :
    :    
    :   " onmouseover="this.src='';" onmouseout="this.src='';" alt="" onclick="alert(this.alt);" style="cursor:help" />" onmouseover="this.src='';" onmouseout="this.src='';" alt="" onclick="alert(this.alt);" style="cursor:help" />
    :    " onmouseover="this.src='';" onmouseout="this.src='';" alt="" onclick="alert(this.alt);" style="cursor:help" />" onmouseover="this.src='';" onmouseout="this.src='';" alt="" onclick="alert(this.alt);" style="cursor:help" />
    :     +
    :    
    - +

    -
    +
    + + + + + + + + + + + + + + + + +
    :
    : +
    :
    +
    + +

    + + + + + +

    -
    -
    ->
    -
    -
    -
    -
    -
    -
    ->
    ->
    +
    - - +

    -
    ->
    ->
    ->
    ->
    ->
    ->
    ->
    -
    ->
    +
    +
    + + + + + + + +

    ->
    ->
    ->
    ->
    +
    - +

    ->
    ->
    ->
    ->
    +
    - +

    ->
    ->
    ->
    ->
    +
    - +

    ->
    ->
    ->
    ->
    +
    +

    ->
    ->
    ->
    ->
    ->
    -
    - -
    -

    ->
    ->
    +
    + + + + + + + +

    ->
    ->
    ->
    ->
    +
    - +

    ->
    ->
    ->
    ->
    +
    - +

    ->
    ->
    +
    - +

    ->
    ->
    ->
    ->
    +
    +
    + + + + + +
    +
    +

    + +
    +

    ->
    ->
    ->
    ->
    ->
    ->
    ->
    ->
    +
    +
    -
    +
    + + + + + + + [+label+] + + +EOT; + $checked = ($roledata[$name]==1) ? 'checked' : ''; + $value = ($roledata[$name]==1) ? 1 : 0; + if($status=='disabled') + { + $checked = 'checked'; + $value = 1; + $set = 'fix'; + } + else $set = 'set'; + + $output = $tpl; + $output = str_replace('[+name+]', $name, $output); + $output = str_replace('[+checked+]', $checked, $output); + $output = str_replace('[+status+]', $status, $output); + $output = str_replace('[+value+]', $value, $output); + $output = str_replace('[+label+]', $label, $output); + $output = str_replace('[+set+]', $set, $output); + return $output; +} From c7429799100ad578e227fc292b39341afbe632c8 Mon Sep 17 00:00:00 2001 From: yama Date: Mon, 26 Aug 2013 01:46:03 +0900 Subject: [PATCH 304/530] Bug #10115 Fix table structure at the new install http://tracker.modx.com/issues/10115 --- install/setup.sql | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/install/setup.sql b/install/setup.sql index cbe2750a83..0c45950315 100755 --- a/install/setup.sql +++ b/install/setup.sql @@ -10,7 +10,7 @@ CREATE TABLE IF NOT EXISTS `{PREFIX}active_users` ( `lasthit` int(20) NOT NULL default '0', `id` int(10) default NULL, `action` varchar(10) NOT NULL default '', - `ip` varchar(20) NOT NULL default '', + `ip` varchar(50) NOT NULL default '', PRIMARY KEY (`internalKey`) ) ENGINE=MyISAM COMMENT='Contains data about active users.'; @@ -299,7 +299,8 @@ CREATE TABLE IF NOT EXISTS `{PREFIX}site_tmplvar_contentvalues` ( `value` text, PRIMARY KEY (id), KEY idx_tmplvarid (tmplvarid), - KEY idx_id (contentid) + KEY idx_id (contentid), + FULLTEXT KEY `value_ft_idx` (`value`) ) ENGINE=MyISAM COMMENT='Site Template Variables Content Values Link Table'; CREATE TABLE IF NOT EXISTS `{PREFIX}site_tmplvar_templates` ( @@ -352,7 +353,7 @@ CREATE TABLE IF NOT EXISTS `{PREFIX}user_attributes` ( `zip` varchar(25) NOT NULL default '', `fax` varchar(100) NOT NULL default '', `photo` varchar(255) NOT NULL default '' COMMENT 'link to photo', - `comment` varchar(255) NOT NULL default '' COMMENT 'short comment', + `comment` text, PRIMARY KEY (`id`), KEY `userid` (`internalKey`) ) ENGINE=MyISAM COMMENT='Contains information about the backend users.'; @@ -493,14 +494,14 @@ CREATE TABLE IF NOT EXISTS `{PREFIX}web_user_attributes` ( `sessionid` varchar(100) NOT NULL default '', `dob` int(10) NOT NULL DEFAULT '0', `gender` int(1) NOT NULL DEFAULT '0' COMMENT '0 - unknown, 1 - Male 2 - female', - `country` varchar(5) NOT NULL default '', + `country` varchar(25) NOT NULL default '', `street` varchar(255) NOT NULL DEFAULT '', `city` varchar(255) NOT NULL DEFAULT '', `state` varchar(25) NOT NULL default '', `zip` varchar(25) NOT NULL default '', `fax` varchar(100) NOT NULL default '', `photo` varchar(255) NOT NULL default '' COMMENT 'link to photo', - `comment` varchar(255) NOT NULL default '' COMMENT 'short comment', + `comment` text, PRIMARY KEY (`id`), KEY `userid` (`internalKey`) ) ENGINE=MyISAM COMMENT='Contains information for web users.'; From f427d07110248ee7f7a1b5740a2d8e10ef4a37b9 Mon Sep 17 00:00:00 2001 From: yama Date: Mon, 26 Aug 2013 01:50:25 +0900 Subject: [PATCH 305/530] Refactor #10116 Add primary key to tables http://tracker.modx.com/issues/10116 --- install/setup.sql | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/install/setup.sql b/install/setup.sql index 0c45950315..ad627bbd4f 100755 --- a/install/setup.sql +++ b/install/setup.sql @@ -241,7 +241,8 @@ CREATE TABLE IF NOT EXISTS `{PREFIX}site_plugins` ( CREATE TABLE IF NOT EXISTS `{PREFIX}site_plugin_events` ( `pluginid` INT(10) NOT NULL, `evtid` INT(10) NOT NULL default 0, - `priority` INT(10) NOT NULL default 0 COMMENT 'determines plugin run order' + `priority` INT(10) NOT NULL default 0 COMMENT 'determines plugin run order', + PRIMARY KEY ( `pluginid` , `evtid` ) ) ENGINE=MyISAM COMMENT='Links to system events'; CREATE TABLE IF NOT EXISTS `{PREFIX}site_snippets` ( @@ -282,7 +283,7 @@ CREATE TABLE IF NOT EXISTS `{PREFIX}system_eventnames` ( CREATE TABLE IF NOT EXISTS `{PREFIX}system_settings` ( `setting_name` varchar(50) NOT NULL default '', `setting_value` text, - UNIQUE KEY `setting_name` (`setting_name`) + PRIMARY KEY (`setting_name`) ) ENGINE=MyISAM COMMENT='Contains Content Manager settings.'; CREATE TABLE IF NOT EXISTS `{PREFIX}site_tmplvar_access` ( @@ -450,6 +451,7 @@ CREATE TABLE IF NOT EXISTS `{PREFIX}user_settings` ( `user` integer NOT NULL, `setting_name` varchar(50) NOT NULL default '', `setting_value` text, + PRIMARY KEY ( `user` , `setting_name` ), KEY `setting_name` (`setting_name`), KEY `user` (`user`) ) ENGINE=MyISAM COMMENT='Contains backend user settings.'; @@ -519,6 +521,7 @@ CREATE TABLE IF NOT EXISTS `{PREFIX}web_user_settings` ( `webuser` integer NOT NULL, `setting_name` varchar(50) NOT NULL default '', `setting_value` text, + PRIMARY KEY ( `webuser` , `setting_name` ), KEY `setting_name` (`setting_name`), KEY `webuserid` (`webuser`) ) ENGINE=MyISAM COMMENT='Contains web user settings.'; From b81109696eb242fd838c17f0c5167bacedd14469 Mon Sep 17 00:00:00 2001 From: yama Date: Mon, 26 Aug 2013 01:52:38 +0900 Subject: [PATCH 306/530] Bug #10117 Set "0" default template ID http://tracker.modx.com/issues/10117 --- install/setup.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/setup.sql b/install/setup.sql index ad627bbd4f..68df8b85d3 100755 --- a/install/setup.sql +++ b/install/setup.sql @@ -119,7 +119,7 @@ CREATE TABLE IF NOT EXISTS `{PREFIX}site_content` ( `introtext` text COMMENT 'Used to provide quick summary of the document', `content` mediumtext, `richtext` tinyint(1) NOT NULL default '1', - `template` int(10) NOT NULL default '1', + `template` int(10) NOT NULL default '0', `menuindex` int(10) NOT NULL default '0', `searchable` int(1) NOT NULL default '1', `cacheable` int(1) NOT NULL default '1', From ee63ca1142b6f3ab5d71922886730036f0ff1115 Mon Sep 17 00:00:00 2001 From: yama Date: Mon, 26 Aug 2013 01:55:04 +0900 Subject: [PATCH 307/530] Refactor #10118 Add index key to site_content table http://tracker.modx.com/issues/10118 --- install/setup.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/install/setup.sql b/install/setup.sql index 68df8b85d3..00c4618d29 100755 --- a/install/setup.sql +++ b/install/setup.sql @@ -144,6 +144,7 @@ CREATE TABLE IF NOT EXISTS `{PREFIX}site_content` ( KEY `id` (`id`), KEY `parent` (`parent`), KEY aliasidx (`alias`), + KEY typeidx (`type`), FULLTEXT KEY `content_ft_idx` (`pagetitle`,`description`,`content`) ) ENGINE=MyISAM COMMENT='Contains the site document tree.'; From 88c1739d12ffae2517cd8be0071630916450b02a Mon Sep 17 00:00:00 2001 From: yama Date: Mon, 26 Aug 2013 01:59:33 +0900 Subject: [PATCH 308/530] Fix --- manager/actions/mutate_role.dynamic.php | 1 + 1 file changed, 1 insertion(+) diff --git a/manager/actions/mutate_role.dynamic.php b/manager/actions/mutate_role.dynamic.php index 6b9d348511..77f6ff741c 100644 --- a/manager/actions/mutate_role.dynamic.php +++ b/manager/actions/mutate_role.dynamic.php @@ -287,6 +287,7 @@ function deletedocument() { echo render_form('manage_metatags', $_lang['role_manage_metatags']); echo render_form('import_static', $_lang['role_import_static']); echo render_form('export_static', $_lang['role_export_static']); + echo render_form('remove_locks', $_lang['role_remove_locks']); ?> From 7342d01447d856f95a93e3cdc346ace2dac64c21 Mon Sep 17 00:00:00 2001 From: Dmi3yy Date: Sun, 25 Aug 2013 20:11:41 +0300 Subject: [PATCH 309/530] fix html --- manager/actions/mutate_plugin_priority.dynamic.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/manager/actions/mutate_plugin_priority.dynamic.php b/manager/actions/mutate_plugin_priority.dynamic.php index d1f356857c..74e8df8f5b 100644 --- a/manager/actions/mutate_plugin_priority.dynamic.php +++ b/manager/actions/mutate_plugin_priority.dynamic.php @@ -77,7 +77,7 @@ - MODx + MODX @@ -159,7 +159,7 @@ function save() {
  • From dba757864de9b8e94a746708b9b40bc5be8bbffe Mon Sep 17 00:00:00 2001 From: yama Date: Mon, 26 Aug 2013 02:58:44 +0900 Subject: [PATCH 314/530] Fix --- manager/actions/mutate_plugin_priority.dynamic.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/manager/actions/mutate_plugin_priority.dynamic.php b/manager/actions/mutate_plugin_priority.dynamic.php index e205613fe7..c868b63345 100644 --- a/manager/actions/mutate_plugin_priority.dynamic.php +++ b/manager/actions/mutate_plugin_priority.dynamic.php @@ -159,10 +159,7 @@ function save() {
  • '.$_lang['cancel'].'
  • -<<<<<<< HEAD -======= ->>>>>>> cf3d3ab0e53c4edea388e4abdda4e86b5c7c2fa5
    '.$_lang['plugin_priority'].'
    From 25dd2649d18dcf66445fdb6d625140303d21a09f Mon Sep 17 00:00:00 2001 From: yama Date: Mon, 26 Aug 2013 03:33:55 +0900 Subject: [PATCH 315/530] Fix - style --- manager/actions/user_management.static.php | 1 - manager/actions/web_user_management.static.php | 1 - manager/media/style/MODxCarbon/style.css | 1 + manager/media/style/MODxRE/style.css | 2 -- 4 files changed, 1 insertion(+), 4 deletions(-) diff --git a/manager/actions/user_management.static.php b/manager/actions/user_management.static.php index ad0075f116..0118dcd9ab 100644 --- a/manager/actions/user_management.static.php +++ b/manager/actions/user_management.static.php @@ -106,7 +106,6 @@ function menuAction(a) {
    -
    -
    Date: Mon, 26 Aug 2013 03:44:59 +0900 Subject: [PATCH 316/530] Refactor #10120 01-01-1970 01:00:00 when "0" http://tracker.modx.com/issues/10120 --- manager/includes/document.parser.class.inc.php | 1 + 1 file changed, 1 insertion(+) diff --git a/manager/includes/document.parser.class.inc.php b/manager/includes/document.parser.class.inc.php index cdc5f41b7f..97ff2935e7 100755 --- a/manager/includes/document.parser.class.inc.php +++ b/manager/includes/document.parser.class.inc.php @@ -2316,6 +2316,7 @@ function parseChunk($chunkName, $chunkArr, $prefix= "{", $suffix= "}") { */ function toDateFormat($timestamp = 0, $mode = '') { $timestamp = trim($timestamp); + if($mode !== 'formatOnly' && empty($timestamp)) return '-'; $timestamp = intval($timestamp); switch($this->config['datetime_format']) { From 368d47a7b4d1c43a1352f473e8b6ed41e82b32ce Mon Sep 17 00:00:00 2001 From: yama Date: Mon, 26 Aug 2013 14:38:56 +0900 Subject: [PATCH 317/530] Fix - QuickManager cancel button --- assets/plugins/qm/qm.inc.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/assets/plugins/qm/qm.inc.php b/assets/plugins/qm/qm.inc.php index 22a671daaf..ef58a22972 100755 --- a/assets/plugins/qm/qm.inc.php +++ b/assets/plugins/qm/qm.inc.php @@ -719,7 +719,8 @@ function getCookie(cookieName) else $jq_mode = '$'; // Add action buttons - $mc->addLine('var controls = "";'); + $url = $this->modx->makeUrl($doc_id,'','','full'); + $mc->addLine('var controls = "";'); // Modify head $mc->head = ''; From 11a87dd861691d444835b0cda433686c978ce421 Mon Sep 17 00:00:00 2001 From: Dmi3yy Date: Mon, 26 Aug 2013 08:42:02 +0300 Subject: [PATCH 318/530] fix russian lang --- manager/includes/lang/russian-UTF8.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manager/includes/lang/russian-UTF8.inc.php b/manager/includes/lang/russian-UTF8.inc.php index 81801b1b0f..cb3e6071fc 100755 --- a/manager/includes/lang/russian-UTF8.inc.php +++ b/manager/includes/lang/russian-UTF8.inc.php @@ -1167,7 +1167,7 @@ $_lang['email_method_title'] = 'Метод отправки писем'; $_lang['email_method_mail'] = 'MAIL - cообщения отправляются с помощью функции mail().'; -$_lang['email_method_smtp'] = 'Адрес SMTP-сервера'; +$_lang['email_method_smtp'] = 'Через SMTP-сервер'; $_lang['smtp_auth_title'] = 'SMTP авторизация'; $_lang['smtp_host_title'] = 'Адрес SMTP-сервера'; $_lang['smtp_username_title'] = 'SMTP почта'; From a1d22c45a13895ad2f2673ccfe46ba92dd8c051c Mon Sep 17 00:00:00 2001 From: Dmi3yy Date: Mon, 26 Aug 2013 08:47:17 +0300 Subject: [PATCH 319/530] Bug #9989 Cannot change email address for an exisiting web user --- manager/processors/save_web_user.processor.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/manager/processors/save_web_user.processor.php b/manager/processors/save_web_user.processor.php index 825e2c7f49..9e32e1f76b 100755 --- a/manager/processors/save_web_user.processor.php +++ b/manager/processors/save_web_user.processor.php @@ -255,12 +255,14 @@ } // check if the email address already exists - $rs = $modx->db->select('internalKey', '[+prefix+]web_user_attributes', "email='{$esc_email}'"); - $limit = $modx->db->getRecordCount($rs); - if (!$limit) { - webAlert("An error occurred while attempting to retrieve all users with email {$email}."); - exit; - } + // check if the email address already exists + if (!$rs = $modx->db->select('internalKey','[+prefix+]web_user_attributes', "email='{$esc_email}'")) { + webAlert("An error occurred while attempting to retrieve all users with email {$email}."); + exit; + } + $limit = $modx->db->getRecordCount($rs); + + if ($limit > 0) { $row = $modx->db->getRow($rs); if ($row['internalKey'] != $id) { From b54aac7be693ba06702ce609af5a1ed966350cd0 Mon Sep 17 00:00:00 2001 From: Dmi3yy Date: Mon, 26 Aug 2013 09:04:05 +0300 Subject: [PATCH 320/530] add youtube in tinyMCE --- .../tinymce/settings/toolbar.settings.inc.php | 20 ++-- .../plugins/youtubeIframe/css/style.css | 84 ++++++++++++++++ .../plugins/youtubeIframe/editor_plugin.js | 1 + .../youtubeIframe/editor_plugin_src.js | 90 ++++++++++++++++++ .../plugins/youtubeIframe/img/youtube.png | Bin 0 -> 1833 bytes .../tiny_mce/plugins/youtubeIframe/index.html | 86 +++++++++++++++++ .../plugins/youtubeIframe/js/scripts.js | 1 + .../plugins/youtubeIframe/js/scripts_src.js | 81 ++++++++++++++++ .../plugins/youtubeIframe/langs/en.js | 3 + .../plugins/youtubeIframe/langs/en_dlg.js | 12 +++ .../plugins/youtubeIframe/langs/ru.js | 3 + .../plugins/youtubeIframe/langs/ru_dlg.js | 12 +++ 12 files changed, 383 insertions(+), 10 deletions(-) create mode 100644 assets/plugins/tinymce/tiny_mce/plugins/youtubeIframe/css/style.css create mode 100644 assets/plugins/tinymce/tiny_mce/plugins/youtubeIframe/editor_plugin.js create mode 100644 assets/plugins/tinymce/tiny_mce/plugins/youtubeIframe/editor_plugin_src.js create mode 100644 assets/plugins/tinymce/tiny_mce/plugins/youtubeIframe/img/youtube.png create mode 100644 assets/plugins/tinymce/tiny_mce/plugins/youtubeIframe/index.html create mode 100644 assets/plugins/tinymce/tiny_mce/plugins/youtubeIframe/js/scripts.js create mode 100644 assets/plugins/tinymce/tiny_mce/plugins/youtubeIframe/js/scripts_src.js create mode 100644 assets/plugins/tinymce/tiny_mce/plugins/youtubeIframe/langs/en.js create mode 100644 assets/plugins/tinymce/tiny_mce/plugins/youtubeIframe/langs/en_dlg.js create mode 100644 assets/plugins/tinymce/tiny_mce/plugins/youtubeIframe/langs/ru.js create mode 100644 assets/plugins/tinymce/tiny_mce/plugins/youtubeIframe/langs/ru_dlg.js diff --git a/assets/plugins/tinymce/settings/toolbar.settings.inc.php b/assets/plugins/tinymce/settings/toolbar.settings.inc.php index 4a835034b9..cf62c9f172 100644 --- a/assets/plugins/tinymce/settings/toolbar.settings.inc.php +++ b/assets/plugins/tinymce/settings/toolbar.settings.inc.php @@ -5,19 +5,19 @@ $set['simple']['b4'] = ''; $set['simple']['b4'] = ''; -$set['creative']['p'] = 'autolink,inlinepopups,autosave,advlist,layer,style,fullscreen,advimage,advhr,paste,advlink,media,contextmenu,table'; +$set['creative']['p'] = 'autolink,inlinepopups,autosave,advlist,layer,style,fullscreen,advimage,advhr,paste,advlink,media,contextmenu,table,youtubeIframe'; $set['creative']['b1'] = 'undo,undo,redo,|,bold,forecolor,backcolor,strikethrough,formatselect,styleselect,fontsizeselect,code'; -$set['creative']['b2'] = 'image,media,link,unlink,anchor,|,bullist,numlist,|,blockquote,outdent,indent,|,justifyleft,justifycenter,justifyright,|,advhr,|,styleprops,removeformat,|,pastetext,pasteword'; +$set['creative']['b2'] = 'image,media,youtubeIframe,link,unlink,anchor,|,bullist,numlist,|,blockquote,outdent,indent,|,justifyleft,justifycenter,justifyright,|,advhr,|,styleprops,removeformat,|,pastetext,pasteword'; $set['creative']['b3'] = 'insertlayer,absolute,moveforward,movebackward,|,tablecontrols,|,fullscreen,help'; $set['creative']['b4'] = ''; -$set['logic']['p'] = 'autolink,inlinepopups,autosave,advlist,xhtmlxtras,style,fullscreen,advimage,paste,advlink,media,contextmenu,table'; +$set['logic']['p'] = 'autolink,inlinepopups,autosave,advlist,xhtmlxtras,style,fullscreen,advimage,paste,advlink,media,contextmenu,table,youtubeIframe'; $set['logic']['b1'] = 'undo,redo,|,bold,forecolor,backcolor,strikethrough,formatselect,styleselect,fontsizeselect,code,|,fullscreen,help'; -$set['logic']['b2'] = 'image,media,link,unlink,anchor,|,bullist,numlist,|,blockquote,outdent,indent,|,justifyleft,justifycenter,justifyright,|,table,|,hr,|,styleprops,removeformat,|,pastetext,pasteword'; +$set['logic']['b2'] = 'image,media,youtubeIframe,link,unlink,anchor,|,bullist,numlist,|,blockquote,outdent,indent,|,justifyleft,justifycenter,justifyright,|,table,|,hr,|,styleprops,removeformat,|,pastetext,pasteword'; $set['logic']['b3'] = 'charmap,sup,sub,|,cite,ins,del,abbr,acronym,attribs'; -$set['legacy']['p'] = 'autosave,advlist,style,advimage,advlink,searchreplace,print,contextmenu,paste,fullscreen,nonbreaking,xhtmlxtras,visualchars,media'; -$set['legacy']['b1'] = 'undo,redo,selectall,|,pastetext,pasteword,|,search,replace,|,nonbreaking,hr,charmap,|,image,link,unlink,anchor,media,|,cleanup,removeformat,|,fullscreen,print,code,help'; +$set['legacy']['p'] = 'autosave,advlist,style,advimage,advlink,searchreplace,print,contextmenu,paste,fullscreen,nonbreaking,xhtmlxtras,visualchars,media,youtubeIframe'; +$set['legacy']['b1'] = 'undo,redo,selectall,|,pastetext,pasteword,|,search,replace,|,nonbreaking,hr,charmap,|,image,link,unlink,anchor,media,youtubeIframe,|,cleanup,removeformat,|,fullscreen,print,code,help'; $set['legacy']['b2'] = 'bold,italic,underline,strikethrough,sub,sup,|,blockquote,|,bullist,numlist,outdent,indent,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,|,styleprops'; $set['legacy']['b3'] = ''; $set['legacy']['b4'] = ''; @@ -28,14 +28,14 @@ $set['advanced']['b3'] = 'hr,removeformat,visualaid,|,sub,sup,|,charmap'; $set['advanced']['b4'] = ''; -$set['full']['p'] = 'autolink,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave'; +$set['full']['p'] = 'autolink,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave,youtubeIframe'; $set['full']['b1'] = 'save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect'; -$set['full']['b2'] = 'cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor'; +$set['full']['b2'] = 'cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,youtubeIframe,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor'; $set['full']['b3'] = 'tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen'; $set['full']['b4'] = 'insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft'; -$set['default']['p'] = 'template,visualblocks,autolink,inlinepopups,autosave,save,advlist,style,fullscreen,advimage,paste,advlink,media,contextmenu,table'; +$set['default']['p'] = 'template,visualblocks,autolink,inlinepopups,autosave,save,advlist,style,fullscreen,advimage,paste,advlink,media,contextmenu,table,youtubeIframe'; $set['default']['b1'] = 'undo,redo,|,bold,forecolor,backcolor,strikethrough,formatselect,fontsizeselect,pastetext,pasteword,code,template,|,fullscreen,help'; -$set['default']['b2'] = 'image,media,link,unlink,anchor,|,justifyleft,justifycenter,justifyright,|,bullist,numlist,|,blockquote,outdent,indent,|,table,hr,|,visualblocks,styleprops,removeformat'; +$set['default']['b2'] = 'image,media,youtubeIframe,link,unlink,anchor,|,justifyleft,justifycenter,justifyright,|,bullist,numlist,|,blockquote,outdent,indent,|,table,hr,|,visualblocks,styleprops,removeformat'; $set['default']['b3'] = ''; $set['default']['b4'] = ''; diff --git a/assets/plugins/tinymce/tiny_mce/plugins/youtubeIframe/css/style.css b/assets/plugins/tinymce/tiny_mce/plugins/youtubeIframe/css/style.css new file mode 100644 index 0000000000..3b972392bf --- /dev/null +++ b/assets/plugins/tinymce/tiny_mce/plugins/youtubeIframe/css/style.css @@ -0,0 +1,84 @@ +li {list-style: none;} +li:hover, li.selected{background: #DDDDDD} +input[type=radio]:checked{} +.clear{display: block; clear: both; height: 10px;} +.share-embed-size-list { + margin: 0; + padding: 0; + min-width: 500px; + overflow: visible; + clear: both; +} +.share-embed-size { + border: 1px solid #FFFFFF; + cursor: pointer; + float: left; + margin: 4px; + padding: 4px; +} +.share-embed-size > label { + display: block; + text-align: center; +} + +label { + cursor: pointer; +} +.share-embed-size-radio { + display: none; +} + +body, button, input, textarea { + font: 12px arial,sans-serif; +} +.share-embed-size .share-embed-size-name { + color: #666666; + display: block; + white-space: nowrap; +} +.share-embed-size .share-embed-size-box { + background: none repeat scroll 0 0 #DDDDDD; + border: 1px solid #999999; + display: block; + margin: auto 0; + padding: 1px; +} +.share-embed-size.default .share-embed-size-box { + height: 32px; + margin-left: 4px; + width: 42px; +} +.share-embed-size.default.wide .share-embed-size-box { + height: 27px; + width: 49px; +} +.share-embed-size.medium.wide .share-embed-size-box { + height: 31px; + width: 56px; +} +.share-embed-size.large.wide .share-embed-size-box { + height: 35px; + width: 64px; +} +.share-embed-size.hd720.wide .share-embed-size-box { + height: 42px; + width: 75px; +} + + +.share-embed-size.custom { + text-align: right; +} +.share-embed-size { + border: 1px solid #FFFFFF; + cursor: pointer; + float: left; + margin: 4px; + padding: 4px; +} +.share-embed-customize { + padding: 0.5em; +} +.share-embed-size.custom .share-embed-customize li { + margin: 0.25em; +} \ No newline at end of file diff --git a/assets/plugins/tinymce/tiny_mce/plugins/youtubeIframe/editor_plugin.js b/assets/plugins/tinymce/tiny_mce/plugins/youtubeIframe/editor_plugin.js new file mode 100644 index 0000000000..bb72b26cd6 --- /dev/null +++ b/assets/plugins/tinymce/tiny_mce/plugins/youtubeIframe/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.PluginManager.requireLangPack("youtubeIframe");tinymce.create("tinymce.plugins.YoutubeIframePlugin",{init:function(a,b){a.addCommand("mceYoutubeIframe",function(){a.windowManager.open({file:b+"/index.html",width:650,height:350,inline:1},{plugin_url:b,some_custom_arg:"custom arg"})});a.addButton("youtubeIframe",{title:"youtubeIframe.desc",cmd:"mceYoutubeIframe",image:b+"/img/youtube.png"});a.onNodeChange.add(function(a,b,c){var d=false;if(c.nodeName=="IMG"){try{var e=c.attributes["src"].value;var f=c.attributes["alt"].value;var g=e.match("vi/([^&#]*)/0.jpg");d=g[1]===f}catch(h){}}b.setActive("youtubeIframe",d)})},createControl:function(a,b){return null},getInfo:function(){return{longname:"Youtube Iframe PlugIn",author:"Darius Matulionis",authorurl:"http://matulionis.lt",infourl:"darius@matulionis.lt",version:"1.1"}}});tinymce.PluginManager.add("youtubeIframe",tinymce.plugins.YoutubeIframePlugin)})() \ No newline at end of file diff --git a/assets/plugins/tinymce/tiny_mce/plugins/youtubeIframe/editor_plugin_src.js b/assets/plugins/tinymce/tiny_mce/plugins/youtubeIframe/editor_plugin_src.js new file mode 100644 index 0000000000..d98405499c --- /dev/null +++ b/assets/plugins/tinymce/tiny_mce/plugins/youtubeIframe/editor_plugin_src.js @@ -0,0 +1,90 @@ +/** + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + * + * @name editor_plugin_src + * @author Darius Matulionis + */ + +(function () { + // Load plugin specific language pack + tinymce.PluginManager.requireLangPack('youtubeIframe'); + + tinymce.create('tinymce.plugins.YoutubeIframePlugin', { + /** + * Initializes the plugin, this will be executed after the plugin has been created. + * This call is done before the editor instance has finished it's initialization so use the onInit event + * of the editor instance to intercept that event. + * + * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in. + * @param {string} url Absolute URL to where the plugin is located. + */ + init: function (ed, url) { + // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample'); + ed.addCommand('mceYoutubeIframe', function () { + + ed.windowManager.open({ + file: url + '/index.html', + width: 650, + height: 350, + inline: 1 + }, { + plugin_url: url, // Plugin absolute URL + some_custom_arg: 'custom arg' // Custom argument + }); + }); + + // Register example button + ed.addButton('youtubeIframe', { + title: 'youtubeIframe.desc', + cmd: 'mceYoutubeIframe', + image: url + '/img/youtube.png' + }); + + // Add a node change handler, selects the button in the UI when a image is selected + ed.onNodeChange.add(function (ed, cm, n) { + var active = false; + if (n.nodeName == 'IMG') { + try { + var src = n.attributes["src"].value; + var alt = n.attributes["alt"].value; + var regexRes = src.match("vi/([^&#]*)/0.jpg"); + active = regexRes[1] === alt; + } + catch (err) { + } + } + cm.setActive('youtubeIframe', active); + }); + }, + + /** + * Creates control instances based in the incomming name. This method is normally not + * needed since the addButton method of the tinymce.Editor class is a more easy way of adding buttons + * but you sometimes need to create more complex controls like listboxes, split buttons etc then this + * method can be used to create those. + * + * @param {String} n Name of the control to create. + * @param {tinymce.ControlManager} cm Control manager to use inorder to create new control. + * @return {tinymce.ui.Control} New control instance or null if no control was created. + */ + createControl: function (n, cm) { + return null; + }, + + getInfo: function () { + return { + longname: 'Youtube Iframe PlugIn', + author: 'Darius Matulionis', + authorurl: 'http://matulionis.lt', + infourl: 'darius@matulionis.lt', + version: "1.1" + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('youtubeIframe', tinymce.plugins.YoutubeIframePlugin); +})(); \ No newline at end of file diff --git a/assets/plugins/tinymce/tiny_mce/plugins/youtubeIframe/img/youtube.png b/assets/plugins/tinymce/tiny_mce/plugins/youtubeIframe/img/youtube.png new file mode 100644 index 0000000000000000000000000000000000000000..a157f17b33e0d38d4ac775be70a347bbea494a49 GIT binary patch literal 1833 zcmeHIOKTHR6dnv>scrEEVmFRc!3s_0(I!oX#@J*gHsXYuN1Kh0>CA01r1Nm*)+F87 zcBfXTf{W@#L_u9BC|0RTK?Ao(rI93*=KUuJ^*6XacNV)_VXRQN=Wf0Z}d- zc?{Yx%&}cbq+m+e$4a{D5^Wz>UNsOJ!`cFQLzJ=r;yoa(Xnx}Jy-5OBWIxgE7AV08 zfsE2IV1oESG$9RSC7(9PH+tuupD4NDS9v9u>_IT(foS|rjq)_)b=@!=QVVPEZxe+LuDfhB5F1#EI?fgUr zLW3pATrTIzHM?{(P0~J}&*oqlC-QJw1r3UMr)D*j7&u@_reZ)v*KnIr?9uz7pFo)| z9YHn9w3@YCCR8voFB&B6qUn%=12`gynRpUj-U0VdXM5OjX3%Vo(hfnFFSB6v$yy zSMkL|vr6S$xQcwsSh->@JYNw@qGU+>YX7+Ek_qX@UY3Q6Hf8Ap4e8xP!XDqf_9A*O zSm(Y3j~+*HE9%K&AXz+=EFMc1f6Nz=v51D1wo-xryaI);SN4CV8pfh=r1_!`c)v_cPJP=rGad4#XY0Suy!a5h z+x7F7d}b&b&o-{#_UWKn^K8vSNA=+4vqPKr4sN(Ky0Cie+SIvp-8j>JwYfh;rINFc s9JlXZIDci~ + + + + {#youtube_dlg.title} + + + + + + + +
    +

    + + +

    + + + {#youtube_dlg.choose_size}: + +
    + Choose type: + {#youtube_dlg.iframe} + {#youtube_dlg.embed} +
    +
    + + +
    +
    + + + diff --git a/assets/plugins/tinymce/tiny_mce/plugins/youtubeIframe/js/scripts.js b/assets/plugins/tinymce/tiny_mce/plugins/youtubeIframe/js/scripts.js new file mode 100644 index 0000000000..c248284c7f --- /dev/null +++ b/assets/plugins/tinymce/tiny_mce/plugins/youtubeIframe/js/scripts.js @@ -0,0 +1 @@ +tinyMCEPopup.requireLangPack();var YoutubeDialog={init:function(){var a=document.forms[0];a.youtubeURL.value=tinyMCEPopup.editor.selection.getContent({format:"text"});$(".share-embed-size-list li.share-embed-size").each(function(){$(this).click(function(){$("li.share-embed-size").removeClass("selected");$(this).addClass("selected")})})},insert:function(){var a=$("#youtubeURL").val();if(a===null){tinyMCEPopup.close();return}var b,c,d,e,f;c=a.match("[\\?&]v=([^&#]*)");b=$.trim(c===null?a:c[1]);if(b===""){tinyMCEPopup.close();return}d=$("li.selected label input").attr("data-width");e=$("li.selected label input").attr("data-height");if(d==-1&&e==-1){d=$("input.share-embed-size-custom-width").val();e=$("input.share-embed-size-custom-height").val()}if(d==""||d=="undefined"||e==""||e=="undefined"){alert("Error: No size selected");tinyMCEPopup.close();return}f=$("input[name='yType']:checked").val();if(f==""||f=="undefined"){alert("Error: No type selected");tinyMCEPopup.close();return}var g='';var h='\n \n\n \n\n \n\n \n\n \n\n \n\n ';if(f=="iframe"){tinyMCEPopup.editor.execCommand("mceInsertContent",false,g)}else{tinyMCEPopup.editor.execCommand("mceInsertContent",false,h)}tinyMCEPopup.close()}};tinyMCEPopup.onInit.add(YoutubeDialog.init,YoutubeDialog) \ No newline at end of file diff --git a/assets/plugins/tinymce/tiny_mce/plugins/youtubeIframe/js/scripts_src.js b/assets/plugins/tinymce/tiny_mce/plugins/youtubeIframe/js/scripts_src.js new file mode 100644 index 0000000000..8cd179096d --- /dev/null +++ b/assets/plugins/tinymce/tiny_mce/plugins/youtubeIframe/js/scripts_src.js @@ -0,0 +1,81 @@ +// @name scripts +// @author Darius Matulionis + +tinyMCEPopup.requireLangPack(); + +var YoutubeDialog = { + init: function () { + var f = document.forms[0]; + // Get the selected contents as text and place it in the input + f.youtubeURL.value = tinyMCEPopup.editor.selection.getContent({format: 'text'}); + + //Add click event form selection + $(".share-embed-size-list li.share-embed-size").each(function(){ + $(this).click(function(){ + $("li.share-embed-size").removeClass("selected"); + $(this).addClass("selected"); + }); + }); + }, + // Insert the contents from the input into the document + insert: function () { + + //Get Code from URL + var url = $("#youtubeURL").val(); + if (url === null) {tinyMCEPopup.close();return;} + + var code, regexRes, width, height, type; + regexRes = url.match("[\\?&]v=([^&#]*)"); + code = $.trim( (regexRes === null) ? url : regexRes[1] ); + if (code === "") {tinyMCEPopup.close();return;} + + //Get Size + width = $("li.selected label input").attr("data-width"); + height = $("li.selected label input").attr("data-height"); + + //Get Custom size + if(width == -1 && height == -1){ + width = $("input.share-embed-size-custom-width").val(); + height = $("input.share-embed-size-custom-height").val(); + } + + //No size or Some Error Accured + if(width == "" || width == "undefined" || height == "" || height == "undefined"){ + alert("Error: No size selected");tinyMCEPopup.close();return; + } + + //Get insert type + type = $("input[name='yType']:checked").val(); + + //No type or Some Error Accured + if(type == "" || type == "undefined"){ + alert("Error: No type selected");tinyMCEPopup.close();return; + } + + //Codes + var iFrame = ''; + var embeded = '\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + '; + + //Isert to edditor + if(type == "iframe"){ + tinyMCEPopup.editor.execCommand('mceInsertContent', false, iFrame); + }else{ + tinyMCEPopup.editor.execCommand('mceInsertContent', false, embeded); + } + + //Close + tinyMCEPopup.close(); + + + } +}; +tinyMCEPopup.onInit.add(YoutubeDialog.init, YoutubeDialog); + + diff --git a/assets/plugins/tinymce/tiny_mce/plugins/youtubeIframe/langs/en.js b/assets/plugins/tinymce/tiny_mce/plugins/youtubeIframe/langs/en.js new file mode 100644 index 0000000000..b7dc7fa989 --- /dev/null +++ b/assets/plugins/tinymce/tiny_mce/plugins/youtubeIframe/langs/en.js @@ -0,0 +1,3 @@ +tinyMCE.addI18n('en.youtube',{ + desc : 'Insert youtube video' +}); diff --git a/assets/plugins/tinymce/tiny_mce/plugins/youtubeIframe/langs/en_dlg.js b/assets/plugins/tinymce/tiny_mce/plugins/youtubeIframe/langs/en_dlg.js new file mode 100644 index 0000000000..491185da0b --- /dev/null +++ b/assets/plugins/tinymce/tiny_mce/plugins/youtubeIframe/langs/en_dlg.js @@ -0,0 +1,12 @@ +tinyMCE.addI18n('en.youtube_dlg',{ + title: 'Insert/edit youtube videos', + url_field: 'YouTube video url or code:', + url_example1: 'URL Example', + url_example2: 'Code Example', + choose_size: 'Choose size', + custom: 'Custom', + Width: 'Width', + Height: 'Height', + iframe: 'New iFrame style', + embed: 'Old Embeded Style' +}); diff --git a/assets/plugins/tinymce/tiny_mce/plugins/youtubeIframe/langs/ru.js b/assets/plugins/tinymce/tiny_mce/plugins/youtubeIframe/langs/ru.js new file mode 100644 index 0000000000..094cdfa388 --- /dev/null +++ b/assets/plugins/tinymce/tiny_mce/plugins/youtubeIframe/langs/ru.js @@ -0,0 +1,3 @@ +tinyMCE.addI18n('ru.youtube',{ + desc : 'Добавить Youtube видео' +}); diff --git a/assets/plugins/tinymce/tiny_mce/plugins/youtubeIframe/langs/ru_dlg.js b/assets/plugins/tinymce/tiny_mce/plugins/youtubeIframe/langs/ru_dlg.js new file mode 100644 index 0000000000..c0e2a5c11c --- /dev/null +++ b/assets/plugins/tinymce/tiny_mce/plugins/youtubeIframe/langs/ru_dlg.js @@ -0,0 +1,12 @@ +tinyMCE.addI18n('ru.youtube_dlg',{ + title: 'Вставить/редактировать youtube видео', + url_field: 'YouTube ссылка или код:', + url_example1: 'пример URL', + url_example2: 'пример Code', + choose_size: 'выберите размер', + custom: 'Задать размер', + Width: 'Ширина', + Height: 'Высота', + iframe: 'iFrame - новый', + embed: 'Embeded - старый' +}); From d9853c5e9e566eafa881c02272c99df7d445e6ff Mon Sep 17 00:00:00 2001 From: Dmi3yy Date: Mon, 26 Aug 2013 11:04:06 +0300 Subject: [PATCH 321/530] small fix in ditto --- assets/snippets/ditto/classes/ditto.class.inc.php | 4 ++-- assets/snippets/ditto/lang/russian-UTF8.inc.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/assets/snippets/ditto/classes/ditto.class.inc.php b/assets/snippets/ditto/classes/ditto.class.inc.php index 4fdfec26e8..f4446031e2 100644 --- a/assets/snippets/ditto/classes/ditto.class.inc.php +++ b/assets/snippets/ditto/classes/ditto.class.inc.php @@ -1157,12 +1157,12 @@ function paginate($start, $stop, $total, $summarize, $tplPaginateNext, $tplPagin } $modx->setPlaceholder($dittoID."next", $nextplaceholder); $modx->setPlaceholder($dittoID."previous", $previousplaceholder); + $modx->setPlaceholder($dittoID."pages", $pages); $modx->setPlaceholder($dittoID."splitter", $split); $modx->setPlaceholder($dittoID."start", $start +1); $modx->setPlaceholder($dittoID."urlStart", $start); $modx->setPlaceholder($dittoID."stop", $limiter); - $modx->setPlaceholder($dittoID."total", $total); - $modx->setPlaceholder($dittoID."pages", $pages); + $modx->setPlaceholder($dittoID."total", $total); $modx->setPlaceholder($dittoID."perPage", $summarize); $modx->setPlaceholder($dittoID."totalPages", $totalpages); $modx->setPlaceholder($dittoID."ditto_pagination_set", true); diff --git a/assets/snippets/ditto/lang/russian-UTF8.inc.php b/assets/snippets/ditto/lang/russian-UTF8.inc.php index eef3169d86..2a02b5d5a4 100755 --- a/assets/snippets/ditto/lang/russian-UTF8.inc.php +++ b/assets/snippets/ditto/lang/russian-UTF8.inc.php @@ -4,7 +4,7 @@ * Filename: assets/snippets/ditto/lang/russian-UTF8.inc.php * Language: Russian * Encoding: UTF8 - * Translated by: Russian MODx community, Jaroslav Sidorkin, based on translation by modx.ru + * Translated by: Russian MODX community, Jaroslav Sidorkin, based on translation by modx.ru * Date: 9 May 2010 * Version: 2.1.0 */ From 6ce7c0fefe8377c5430c16bc22cc646b1f45285e Mon Sep 17 00:00:00 2001 From: Dmi3yy Date: Mon, 26 Aug 2013 11:06:05 +0300 Subject: [PATCH 322/530] fix index.html in eform lang --- assets/snippets/eform/lang/index.html | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 assets/snippets/eform/lang/index.html diff --git a/assets/snippets/eform/lang/index.html b/assets/snippets/eform/lang/index.html new file mode 100644 index 0000000000..fdd3791786 --- /dev/null +++ b/assets/snippets/eform/lang/index.html @@ -0,0 +1,2 @@ +

    Unauthorized access

    +You're not allowed to access file folder \ No newline at end of file From 8f4aca9da5a43a97f4a572f391f29ee1421e424e Mon Sep 17 00:00:00 2001 From: Dmi3yy Date: Mon, 26 Aug 2013 11:13:53 +0300 Subject: [PATCH 323/530] set phpmailer default charset to utf-8 --- manager/includes/controls/phpmailer/class.phpmailer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manager/includes/controls/phpmailer/class.phpmailer.php b/manager/includes/controls/phpmailer/class.phpmailer.php index 44a0169fc2..ff877c4d12 100644 --- a/manager/includes/controls/phpmailer/class.phpmailer.php +++ b/manager/includes/controls/phpmailer/class.phpmailer.php @@ -57,7 +57,7 @@ class PHPMailer { * Sets the CharSet of the message. * @var string */ - public $CharSet = 'iso-8859-1'; + public $CharSet = 'utf-8'; /** * Sets the Content-type of the message. From 4b60d628df61fb92d70631a0fb9e630ba4590e65 Mon Sep 17 00:00:00 2001 From: Dmi3yy Date: Mon, 26 Aug 2013 11:41:13 +0300 Subject: [PATCH 324/530] fix version date --- manager/includes/version.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manager/includes/version.inc.php b/manager/includes/version.inc.php index 45b93ea01c..f53547359c 100755 --- a/manager/includes/version.inc.php +++ b/manager/includes/version.inc.php @@ -1,5 +1,5 @@ Date: Mon, 26 Aug 2013 18:10:52 +0900 Subject: [PATCH 325/530] Fix html --- manager/actions/manage_metatags.dynamic.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/manager/actions/manage_metatags.dynamic.php b/manager/actions/manage_metatags.dynamic.php index 94b8f06efb..69938895a5 100644 --- a/manager/actions/manage_metatags.dynamic.php +++ b/manager/actions/manage_metatags.dynamic.php @@ -102,6 +102,7 @@ function deleteTag() {
    +


    @@ -192,8 +193,10 @@ function deleteTag() {
    +
    +


    +
    From fc4d4a21b4b67164e2c5aa72e40b1ec33a00590c Mon Sep 17 00:00:00 2001 From: Dmi3yy Date: Mon, 26 Aug 2013 12:12:46 +0300 Subject: [PATCH 326/530] update mm to 0.3.11 step1 --- .../plugins/managermanager/docs/changelog.htm | 51 ++- assets/plugins/managermanager/docs/css/mm.css | 204 +++++++-- .../managermanager/docs/field-names.htm | 6 +- assets/plugins/managermanager/docs/fields.htm | 6 +- .../managermanager/docs/getting-started.htm | 6 +- assets/plugins/managermanager/docs/index.htm | 21 +- .../plugins/managermanager/docs/install.htm | 7 +- .../plugins/managermanager/docs/sections.htm | 6 +- assets/plugins/managermanager/docs/tabs.htm | 6 +- .../plugins/managermanager/docs/widgets.htm | 405 ++++++++++++++++-- 10 files changed, 620 insertions(+), 98 deletions(-) diff --git a/assets/plugins/managermanager/docs/changelog.htm b/assets/plugins/managermanager/docs/changelog.htm index 4e72576b3e..6aec6701c9 100644 --- a/assets/plugins/managermanager/docs/changelog.htm +++ b/assets/plugins/managermanager/docs/changelog.htm @@ -9,9 +9,7 @@ - +
    @@ -29,8 +27,53 @@
    -
    +

    Changelog

    +

    0.3.11 (2012.02.15) by DivanDesign

    +
      +
    • Bugfix: ManagerManager plugin settings last tab (functions/tabs.inc.php: line 132)
    • +
    • New: mm_ddAutoFolders widget - Automatically move documents (OnBeforeDocFormSave event) based on their date (publication date; any date in tv) into folders of year and month (like 2012/02/).
    • +
    • mm_ddSetFieldValue update to 1.0.2 +
        +
      • Bugfix: Date format (widgets/ddsetfieldvalue/ddsetfieldvalue.php: line 34, 37)
      • +
      +
    • +
    • mm_ddGMap update to 1.0.2 +
        +
      • New: Multilingual map (widgets/ddgmap/ddgmap.php: line 14, 103)
      • +
      +
    • +
    • Added documentation for new widgets: mm_ddGMap, mm_ddYMap, mm_ddSetFieldValue, mm_ddMaxLength, mm_ddAutoFolders (docs/widgets.htm)
    • +
    • Change style of documentation (docs/css/mm.css & minor changes of all html files in docs/) like you see =)
    • +
    +

    0.3.10 (2012.01.16) by DivanDesign

    +
      +
    • Bugfix: Fix jQ selector for rules mm_moveFieldsToTab (functions/fields.inc.php: line 274)
    • +
    • New: mm_default now support all fields (for TV like tv99, where 12 - id of TV) (functions/fieldvalues.inc.php: line 170)
    • +
    • New: ManagerManager now support OnBeforeDocFormSave event: +
        +
      • Initialization on mm.inc.php: line 450-452
      • +
      • Added validating event on functions/fields.inc.php: line 17, 81, 161, 213, 318
      • +
      • Added validating event on functions/fieldvalues.inc.php: line 25, 199, 298
      • +
      • Added validating event on functions/sections.inc.php: line 16
      • +
      • Added validating event on functions/tabs.inc.php: line 15, 65, 132
      • +
      • Added validating event on functions/templates.inc.php: line 17
      • +
      • Added validating event on widgets/!template/!template.php: line 12. Moved the output to the browser into if on widgets/!template.php: line 59
      • +
      • Added validating event on widgets/accessdenied/accessdenied.php: line 16. Moved the output to the browser into if on widgets/!template.php: line 34
      • +
      • Added validating event on widgets/colors/colors.php: line 12
      • +
      • Added validating event on widgets/showimagetvs/showimagetvs.php: line 15
      • +
      • Added validating event on widgets/tags/tags.php: line 12. Moved the output to the browser into if on widgets/tags/tags.php: line 98
      • +
      +
    • +
    • New: mm_ddGMap widget - integrate the Google Maps
    • +
    • New: mm_ddYMap widget - integrate the Yandex Maps
    • +
    • New: mm_ddSetFieldValue widget - sets a value for a field (always!)
    • +
    • New: mm_ddMaxLength widget - limit the number of characters in the TV (like the Twitter)
    • +
    • jQuery update to 1.7.1 (plugin.txt: line 33, 34)
    • +
    • New event (OnBeforeDocFormSave) in installation instuctions (docs/install.htm)
    • +
    • Credits in docs/index.htm =)
    • +
    +

    0.3.9

    • Bugfix: PHP error with versions < 5.2.3 (thanks mamalovesyou)
    • diff --git a/assets/plugins/managermanager/docs/css/mm.css b/assets/plugins/managermanager/docs/css/mm.css index 61423e5c10..3e1672267a 100644 --- a/assets/plugins/managermanager/docs/css/mm.css +++ b/assets/plugins/managermanager/docs/css/mm.css @@ -1,56 +1,186 @@ -#nav { - background: #45A826; - float: left; - width: 200px; - font-size: 1.2em; - color: #FFF; +/** + * reset.css + * @version: 1.0.1 (2012-02-02) + * + * @copyright 2012, DivanDesign + * http://www.DivanDesign.ru + */ +@charset "utf-8"; + +html, body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, form, fieldset, input, p, blockquote, th, td {margin:0; padding:0;} +img, body, html {border:0;} +html, body {width: 100%; height: 100%;} + +address, caption, cite, code, dfn, em, th, var {font-style: normal; font-weight: normal;} +*:focus, a, a:hover {outline: none;} +caption, th {text-align: left;} +td {vertical-align: top;} +q:before, q:after {content:'';} +blockquote, q {quotes: none;} +blockquote:before, blockquote:after, q:before, q:after {content: ''; content: none;} +table {border-collapse: collapse; border-spacing: 0;} + +/* html5*/ +article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section {display: block;} + +.clear, .clearfix:after {clear: both; float: none !important;} +.clearfix:after { + display: block; + height: 0; + overflow: hidden; + visibility: hidden; + content: ' '; } -#content { - margin-left: 220px; + +.none {display: none;} +.hidden {visibility: hidden;} +.left {float: left;} +.right {float: right;} +.nolist { + padding: 0; + margin: 0; + list-style: none; } +.nobr {white-space: nowrap;} +/*_/reset.css*/ + +/** + * base.css + * @version: 1.0.6 (2012-02-02) + * + * @copyright 2012, DivanDesign + * http://www.DivanDesign.ru + */ body { - font: 82.5%/1.2 Tahoma, Geneva, sans-serif; + background-color: #fff; + position: relative; + font: 13px/1.615em Verdana, Tahoma, Arial, sans-serif; + color: #464646; + overflow-y: scroll; } -#banner { - background: url(../images/banner.png) no-repeat left top; - height: 57px; - margin-bottom: 20px; +*::selection { + background: #007cc3; + color:#fff; +} + +*::-moz-selection { + background: #007cc3; + color:#fff; +} + +a, a.strl span { + border-bottom-width: 1px; + text-decoration: none; +} + +a { + border-bottom-style: solid; + border-color: #bfd7e9; + color: #007cc3; + -webkit-transition: color 0.3s ease-out, border-color 0.3s ease-out; + -moz-transition: color 0.3s ease-out, border-color 0.3s ease-out; + -ms-transition: color 0.3s ease-out, border-color 0.3s ease-out; + -o-transition: color 0.3s ease-out, border-color 0.3s ease-out; + transition: color 0.3s ease-out, border-color 0.3s ease-out; +} + +a.strl span { + border-style: inherit; + border-color: inherit; +} + +a.false {border-bottom-style: dotted;} + +a:hover { + color: #f9720c; + border-color: #f9720c; } -#nav a { - color: #FFC; + +a:active, a.active, a.strl, a.strl:active span {border-bottom-width: 0;} + +h1, h2, h3, h4, h5, h6 { + padding-top: 0.64em; + padding-bottom: 0.444em; + font-family: Georgia, serif; + font-weight: normal; + line-height: 1.2em; } -h1 { - font-size: 1.6em; - color: #00670A; + +h1 {font-size: 50px;} +h2 {font-size: 24px;} +h3 {font-size: 18px;} + +h4 { + font-size: 16px; + line-height: 1.625em; } -h2 { - font-size: 1em; - color: #FFF; - background: #219910; + +.content p, .content ul, .content ol, .content table {margin-bottom: 1em;} +/* .content */ul, /* .content */ol {padding-left: 30px;} + +/* .content */ul li {padding-bottom: 0.24em;} + +.content table { + border-collapse: collapse; + margin-left: -6px; +} + +.content table td, .content table th { + border: 1px solid #cccccc; padding: 2px 5px; - margin-top: 2em; } -h3 { - font-size: 0.9em; - color: #43A82B; + +.content table th { + font-weight: bold; } -#nav ul li { - margin: 0px; - padding: 0px; - list-style: none; +/*_/base.css*/ + +#nav { + padding: 50px 0 0 10px; + float: left; + font-size: 1.2em; + line-height: 1.615em; } -.remove { text-decoration: line-through; +.content { + padding: 0 30px 30px 0; + margin-left: 220px; +} + +#banner { + padding: 0 0 0 40px; + background: #00b4ff; + background: -moz-linear-gradient(top, #00b4ff 0%, #00a7f0 24%, #007fc0 74%, #0070af 100%); + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#00b4ff), color-stop(24%,#00a7f0), color-stop(74%,#007fc0), color-stop(100%,#0070af)); + background: -webkit-linear-gradient(top, #00b4ff 0%,#00a7f0 24%,#007fc0 74%,#0070af 100%); + background: -o-linear-gradient(top, #00b4ff 0%,#00a7f0 24%,#007fc0 74%,#0070af 100%); + background: -ms-linear-gradient(top, #00b4ff 0%,#00a7f0 24%,#007fc0 74%,#0070af 100%); + background: linear-gradient(top, #00b4ff 0%,#00a7f0 24%,#007fc0 74%,#0070af 100%); + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00b4ff', endColorstr='#0070af',GradientType=0 ); + box-shadow: 0 0 6px rgba(0, 0, 0, 0.5); + font-size: 16px; + line-height: 3.2em; + color: #FFFFFF; + text-shadow: 0 -1px 0 #0070AF; + height: 57px; } + +#nav ul li {list-style: none;} + +.remove {text-decoration: line-through;} code { display: block; - margin: 5px; - background-color: #CCCCCC; - padding: 3px; -} -th, td { - padding: 2px 5px; + padding: 3px 5px; + margin: 5px 5px 5px -5px; + background-color: #E6E6E6; + font-family: Consolas, monospace; } + .warning { font-weight: bold; color: #F00; } + +em { + font-style: normal; + color: #007cc3; +} diff --git a/assets/plugins/managermanager/docs/field-names.htm b/assets/plugins/managermanager/docs/field-names.htm index 3443723494..d1b3a733f8 100644 --- a/assets/plugins/managermanager/docs/field-names.htm +++ b/assets/plugins/managermanager/docs/field-names.htm @@ -10,9 +10,7 @@ - +
      @@ -30,7 +28,7 @@
    -
    +

    Naming

    Fields

    diff --git a/assets/plugins/managermanager/docs/fields.htm b/assets/plugins/managermanager/docs/fields.htm index 98c8f68a37..fc479f32e5 100644 --- a/assets/plugins/managermanager/docs/fields.htm +++ b/assets/plugins/managermanager/docs/fields.htm @@ -10,9 +10,7 @@ - +
    @@ -30,7 +28,7 @@
    -
    +

    Function reference: Fields

    mm_renameField($field, $newlabel, $roles, $templates, $newhelp)

    diff --git a/assets/plugins/managermanager/docs/getting-started.htm b/assets/plugins/managermanager/docs/getting-started.htm index 0b45262041..fa01962deb 100644 --- a/assets/plugins/managermanager/docs/getting-started.htm +++ b/assets/plugins/managermanager/docs/getting-started.htm @@ -10,9 +10,7 @@ - +
    @@ -30,7 +28,7 @@
    -
    +

    How it works

    MM works by creating a series of actions (or "rules"), which can be applied to particular fields. Each rule can be applied to certain roles, certain templates or any combination or either.

    For example, to rename a field for all templates and all users, you might use:

    diff --git a/assets/plugins/managermanager/docs/index.htm b/assets/plugins/managermanager/docs/index.htm index 50339763f4..b0406c2bb9 100644 --- a/assets/plugins/managermanager/docs/index.htm +++ b/assets/plugins/managermanager/docs/index.htm @@ -10,9 +10,7 @@ - +
    @@ -30,15 +28,22 @@
    -
    +

    Introduction

    -

    ManagerManager lets you customise your ModX manager interface. You can rename, hide, and move fields and tabs. And do it just for certain users or templates. Absolute power!

    +

    ManagerManager lets you customise your ModX manager interface. You can rename, hide, move fields and tabs and doing many others intresting actions. And do it just for certain users or templates. Absolute power!

    +

    Credits

    -

    Nick Crossland - www.rckt.co.uk
    +

    Nick Crossland — www.rckt.co.uk
    Inspired by HideEditor plugin by Timon Reinhard and Gildas andHideManagerFields by Brett @ The Man Can!

    +

    DivanDesign — www.DivanDesign.biz: v0.3.10, 0.3.11.

    +

    License

    -

    Released under the GNU General Public License: http://creativecommons.org/licenses/GPL/2.0/
    -Code and documentation © 2007-9 Rocket Science Solutions Ltd

    +

    Released under the GNU General Public License: http://creativecommons.org/licenses/GPL/2.0/

    +

    Code and documentation © 2007-9 Rocket Science Solutions Ltd

    +

    Code and documentation © 2012 DivanDesign studio

    + +

    Feedback

    +

    Write us if you need help or have a great idea.

    diff --git a/assets/plugins/managermanager/docs/install.htm b/assets/plugins/managermanager/docs/install.htm index c7f652d327..7b98eb23f4 100644 --- a/assets/plugins/managermanager/docs/install.htm +++ b/assets/plugins/managermanager/docs/install.htm @@ -10,9 +10,7 @@ - +
    @@ -30,7 +28,7 @@
    -
    +

    Installation

    Compatibility

    If you are running ModX 0.9.6.x, this version will not work. You should download previous version 0.3.2 of ManagerManager.

    @@ -44,6 +42,7 @@

    New install

    • OnDocFormRender
    • OnDocFormPrerender
    • +
    • OnBeforeDocFormSave
    • OnPluginFormRender
    • OnTVFormRender
    diff --git a/assets/plugins/managermanager/docs/sections.htm b/assets/plugins/managermanager/docs/sections.htm index e45d2fa569..2ef08e1b7d 100644 --- a/assets/plugins/managermanager/docs/sections.htm +++ b/assets/plugins/managermanager/docs/sections.htm @@ -10,9 +10,7 @@ - +
    @@ -30,7 +28,7 @@
    -
    +

    Function reference: Sections

    "Sections" are the areas of a document edit tab, e.g. Resource content and Template Variable.

    mm_renameSection($section, $newlabel, $roles, $templates)

    diff --git a/assets/plugins/managermanager/docs/tabs.htm b/assets/plugins/managermanager/docs/tabs.htm index 4b7e7e8ce6..1cbf3b42ab 100644 --- a/assets/plugins/managermanager/docs/tabs.htm +++ b/assets/plugins/managermanager/docs/tabs.htm @@ -10,9 +10,7 @@ - +
    @@ -30,7 +28,7 @@
    -
    +

    Function reference: Tabs

    mm_renameTab($tab, $newlabel, $roles, $templates)

    Renames one of the default tabs within the manager.

    diff --git a/assets/plugins/managermanager/docs/widgets.htm b/assets/plugins/managermanager/docs/widgets.htm index 2b0820dfc4..1776d3993e 100644 --- a/assets/plugins/managermanager/docs/widgets.htm +++ b/assets/plugins/managermanager/docs/widgets.htm @@ -10,9 +10,7 @@ - +
    @@ -30,50 +28,407 @@
    -
    +

    Function reference: Widgets

    +

    mm_widget_tags($fields, $delimiter, $source, $display_count, $roles, $templates)

    Tags demo

    Changes the manager widget for this text field to tag-friendly format - e.g. it will display a clickable list of all other tags which have been used for this field.

    -

    $fields: The name(s) of the template variables this should apply to. Can accept multiple field separated by a comma. [Required]
    - $delimiter: Which character separates individual tags within this field [Optional - default is comma)
    - $source: The names(s) of the template variables the list of tags should come from. This allows the list of tags to come from a different field that the widget. By default it uses all the TVs listed in $fields [Optional - default is same as $fields]
    - $display_count: Display the number of documents using each tag (in brackets after it) [Optional - boolean - default is false]
    - $roles: comma separated list of role IDs this should be applied to. Leave empty (or omit) for all roles [Optional - default is all]
    - $templates: comma separated list of template IDs this should be applied to. Leave empty (or omit) for all templates [Optional - default is all]

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeDesctiptionDefault
    $fieldsstring; comma separated stringThe name(s) of the template variables this should apply to.Required
    $delimiterstringWhich character separates individual tags within this fieldOptional: Default: ','
    $sourcestring; comma separated stringThe names(s) of the template variables the list of tags should come from. This allows the list of tags to come from a different field that the widget. By default it uses all the TVs listed in $fieldsOptional; Default: = $fields
    $display_count0; 1Display the number of documents using each tag (in brackets after it).Optional; Default: 0
    $rolesstring; comma separated stringList of role IDs this should be applied to. Leave empty (or omit) for all roles.Optional; Default: ''
    $templatesstring; comma separated stringList of template IDs this should be applied to. Leave empty (or omit) for all templates.Optional; Default: ''.
    +

    mm_widget_tags('docTags'); // Adds the tag editing widget to the docTags template variable wherever it appearsmm_widget_tags('docTags,blogTags'); // Adds the tag editing widget to the docTags and blogTags template variables wherever they appear - making all previous values from both template variables available in both tagsmm_widget_tags('docTags', ',', '', '1', '', '2'); // Adds the tag editing widget to the docTags template variables in template 2, and shows the number of times each tag has been used

    Note: TV(s) must be a text input field

    +

    mm_widget_showimagetvs($fields, $w, $h, $thumbnailerUrl, $roles, $templates)

    Show Image preview

    Emulates the ShowImageTVs plugin - shows a preview of images chosen in image TVs.

    -

    $fields: The name(s) of the template variables this should apply to. Can accept multiple field separated by a comma. [Optional - default is to use all image TVs]
    - $w: Preferred maximum width of the preview [Optional - default is 300]
    - $h: Preferred maximum height of the preview [Optional - default is 100]
    - $thumbnailerUrl: If you have PHPThumb installed (for example through Maxigallery or phpthumb plugins/snippets), use this to make thumbnails rather than resizing the image previews via CSS. Particularly useful if you are using very large pictures, which would take a long time to download. [Optional - url]
    - $roles: comma separated list of role IDs this should be applied to. Leave empty (or omit) for all roles [Optional - default is all]
    - $templates: comma separated list of template IDs this should be applied to. Leave empty (or omit) for all templates [Optional - default is all]

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeDesctiptionDefault
    $fieldsstring; comma separated stringThe name(s) of the template variables this should apply to.Optional; Default: '' (is to use all image TVs)
    $wintegerPreferred maximum width of the preview.Optional; Default: 300
    $hintegerPreferred maximum height of the preview.Optional; Default: 300
    $thumbnailerUrlurl stringIf you have PHPThumb installed (for example through Maxigallery or phpthumb plugins/snippets), use this to make thumbnails rather than resizing the image previews via CSS. Particularly useful if you are using very large pictures, which would take a long time to download.Optional
    $rolesstring; comma separated stringList of role IDs this should be applied to. Leave empty (or omit) for all roles.Optional; Default: ''
    $templatesstring; comma separated stringList of template IDs this should be applied to. Leave empty (or omit) for all templates.Optional; Default: ''
    +

    mm_widget_showimagetvs(); // Adds an image preview to every Image-type template variablemm_widget_showimagetvs('', 150, 150); // Adds a 150x150px image preview to every Image-type template variablemm_widget_showimagetvs('mypic', '300', '200', '/assets/snippets/phpthumb/phpThumb.php', '', '2'); // Adds an image preview to the mypic template variables in template 2, resized to 300x200px using phpthumb at the URL supplied

    Note: TV(s) must be an image input field

    +

    mm_widget_colors($fields, $default, $roles, $templates)

    Color picker

    Turns a text field into a color picker - storing the chosen hex value in the field.

    -

    $fields: The name(s) of the template variables this should apply to. Can accept multiple field separated by a comma. [Required]
    - $default: Which color should be selected by default in new documents. This is only used in situations where the TV does not have a default value specified in the TV definition [Optional - default is white)
    - $roles: comma separated list of role IDs this should be applied to. Leave empty (or omit) for all roles [Optional - default is all]
    - $templates: comma separated list of template IDs this should be applied to. Leave empty (or omit) for all templates [Optional - default is all]

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeDesctiptionDefault
    $fieldsstring; comma separated stringThe name(s) of the template variables this should apply to.Required
    $defaultcolor stringWhich color should be selected by default in new documents. This is only used in situations where the TV does not have a default value specified in the TV definition.Optional; Default: '#ffffff'
    $rolesstring; comma separated stringList of role IDs this should be applied to. Leave empty (or omit) for all roles.Default: ''
    $templatesstring; comma separated stringList of template IDs this should be applied to. Leave empty (or omit) for all templates.Default: ''
    +

    mm_widget_colors('bgcolor'); // Adds the color picker widget to the bgcolor template variable wherever it appearsmm_widget_colors('bgcolor,foreground'); // Adds the color picker widget to the bgcolor and foreground template variables wherever they appearmm_widget_colors('bgcolor', '#000000', '1', '2'); // Adds the color picker widget to the bgcolor template variable, with a default value of black for new documents, only for role 1 and documents using template 2

    Note: TV(s) must be a text input field

    -

     

    +

    mm_widget_accessdenied($ids, $message, $roles)

    Denies access to specific documents (by ID) without inheritance.

    For example, if the parent document has some Ditto call (which you do not want a user to edit) but want to allow them to create child documents.

    Use this plugin with caution, as while it offers a basic level of protection, it does not prevent access to documents in the same way as ModX's permissions system. It would be possible for a user with technical knowledge to override it. Think of it as a "No entry" sign for an unlocked door, rather than a lock.

    Originally contributed by Metaller

    -

    $ids: comma separated list of documents ID to prevent access. [Required]
    - $message: HTML formatted message [Optional - default is "Access denied - Access to current document closed for security reasons.")
    - $roles: comma separated list of role IDs this should be applied to. Leave empty (or omit) for all roles [Optional - default is all]
    -

    + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeDesctiptionDefault
    $idsstring; comma separated stringList of documents ID to prevent access.Required
    $messagehtml stringHTML formatted messageOptional; Default: '"Access denied - Access to current document closed for security reasons."'
    $rolesstring; comma separated stringList of role IDs this should be applied to. Leave empty (or omit) for all roles.Optional; Default: ''
    +

    mm_widget_accessdenied('1,15'); // Prevents all users from accessing documents 1 and 15 (displaying default message)mm_widget_accessdenied('1,15', 'Please select another document to edit' '2'); // Prevents users with role 2 from accessing documents 1 and 15 (displaying custom message)

    + +

    mm_ddGMap($tvs, $roles, $templates, $w, $h)

    +

    Integrate the Google Maps in MODx documents.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeDesctiptionDefault
    $tvsstring; comma separated stringThe name(s) of the template variables this should apply to.Required
    $rolesstring; comma separated stringList of role IDs this should be applied to. Leave empty (or omit) for all roles.Optional; Default: ''
    $templatesstring; comma separated stringList of template IDs this should be applied to. Leave empty (or omit) for all templates.Optional; Default: ''
    $wstring; integerWidth of container map.Optional; Default: 'auto'
    $hintegerHeight of container map.Optional; Default: 400
    +

    Created by DivanDesign.

    + +

    mm_ddYMap($tvs, $roles, $templates, $key, $w, $h)

    +

    Integrate the Yandex Maps in MODx documents.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeDesctiptionDefault
    $tvsstring; comma separated stringThe name(s) of the template variables this should apply to.Required
    $rolesstring; comma separated stringList of role IDs this should be applied to. Leave empty (or omit) for all roles.Optional; Default: ''
    $templatesstring; comma separated stringList of template IDs this should be applied to. Leave empty (or omit) for all templates.Optional; Default: ''
    $keystringYandex-map key for your domain.Required
    $wstring; integerWidth of container map.Optional; Default: 'auto'
    $hintegerHeight of container map.Optional; Default: 400
    +

    Created by DivanDesign.

    + +

    mm_ddSetFieldValue($field, $value, $roles, $templates)

    +

    Sets a value for a field (always!).

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeDesctiptionDefault
    $fieldstringThe name of the document field or template varible this should apply to.Required
    $valuestringThe value for the field specified.Optional; Default: ''
    $rolescomma separated stringList of role IDs this should be applied to. Leave empty (or omit) for all roles.Optional; Default: ''
    $templatescomma separated stringList of template IDs this should be applied to. Leave empty (or omit) for all templates.Optional; Default: ''
    +

    Created by DivanDesign.

    + +

    mm_ddMaxLength($tvs, $roles, $templates, $length)

    +

    Limit the number of characters in the TV (like the Twitter).

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeDesctiptionDefault
    $tvscomma separated stringThe name(s) of the template variables this should apply to.Required
    $rolescomma separated stringList of role IDs this should be applied to. Leave empty (or omit) for all roles.Optional; Default: ''
    $templatescomma separated stringList of template IDs this should be applied to. Leave empty (or omit) for all templates.Optional; Default: ''
    $lengthintegerCount of characters to limit.Optional; Default: 150
    +

    Created by DivanDesign.

    + +

    mm_ddAutoFolders($ddRoles, $ddTemplates, $ddParent, $ddDateSource, $ddYearTpl, $ddMonthTpl, $ddYearPub, $ddMonthPub)

    +

    Automatically move documents (OnBeforeDocFormSave event) based on their date (publication date; any date in tv) into folders of year and month (like 2012/02/).

    +

    If folders (documents) of year and month doesn`t exist they are created automatically OnBeforeDocFormSave event.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeDesctiptionDefault
    $ddRolescomma separated stringList of role IDs this should be applied to. Leave empty (or omit) for all roles.Optional; Default: ''
    $ddTemplatescomma separated stringList of template IDs this should be applied to. Leave empty (or omit) for all templates.Optional; Default: ''
    $ddParentintegerUltimate parent ID (parent of the years).Required
    $ddDateSourcestringName of template variable which contains the date.Optional; Default: 'pub_date'
    $ddYearTplintegerTemplate ID for documents of year.Optional; Default: 0
    $ddMonthTplintegerTemplate ID for documents of month.Optional; Default: 0
    $ddYearPub0; 1Would the documents of year published?Optional; Default: 0
    $ddMonthPub0; 1Would the documents of month published?Optional; Default: 0
    +

    Created by DivanDesign.

    From 33a6c5118e74f4d47c372b9ee4054ff34affead7 Mon Sep 17 00:00:00 2001 From: Dmi3yy Date: Mon, 26 Aug 2013 12:17:00 +0300 Subject: [PATCH 327/530] update mm step2 --- .../managermanager/functions/fields.inc.php | 27 ++++------- .../functions/fieldvalues.inc.php | 8 ++-- .../managermanager/functions/sections.inc.php | 2 +- .../managermanager/functions/tabs.inc.php | 6 +-- .../functions/templates.inc.php | 2 +- assets/plugins/managermanager/mm.inc.php | 46 ++++++++++--------- .../plugins/managermanager/mm_rules.inc.php | 38 +++++++++++++++ .../widgets/!template/!template.php | 5 +- .../widgets/accessdenied/accessdenied.php | 5 +- .../managermanager/widgets/colors/colors.php | 2 +- .../managermanager/widgets/tags/tags.php | 4 +- 11 files changed, 86 insertions(+), 59 deletions(-) create mode 100755 assets/plugins/managermanager/mm_rules.inc.php diff --git a/assets/plugins/managermanager/functions/fields.inc.php b/assets/plugins/managermanager/functions/fields.inc.php index 94a48ba2e0..51f42ca31c 100644 --- a/assets/plugins/managermanager/functions/fields.inc.php +++ b/assets/plugins/managermanager/functions/fields.inc.php @@ -18,26 +18,24 @@ function mm_renameField($field, $newlabel, $roles='', $templates='', $newhelp='' $output = " // ----------- Rename field -------------- \n"; - $output .= '$j("select[id$=_prefix]").each( function() { $j(this).parents("tr:first").addClass("urltv"); } ); '; - switch ($field) { // Exceptions case 'keywords': - $output .= '$j("select[name*=keywords]").siblings("span.warning").html("'.jsSafe($newlabel).'");'; + $output .= '$j("select[name*=keywords]").siblings("span.warning").empty().prepend("'.jsSafe($newlabel).'");'; break; case 'metatags': - $output .= '$j("select[name*=metatags]").siblings("span.warning").html("'.jsSafe($newlabel).'");'; + $output .= '$j("select[name*=metatags]").siblings("span.warning").empty().prepend("'.jsSafe($newlabel).'");'; break; case 'hidemenu': case 'show_in_menu': - $output .= '$j("input[name=hidemenucheck]").siblings("span.warning").html("'.jsSafe($newlabel).'");'; + $output .= '$j("input[name=hidemenucheck]").siblings("span.warning").empty().prepend("'.jsSafe($newlabel).'");'; break; case 'which_editor': - $output .= '$j("#which_editor").prev("span.warning").html("'.jsSafe($newlabel).'");'; + $output .= '$j("#which_editor").prev("span.warning").empty().prepend("'.jsSafe($newlabel).'");'; break; // Ones that follow the regular pattern @@ -46,7 +44,7 @@ function mm_renameField($field, $newlabel, $roles='', $templates='', $newhelp='' if (isset($mm_fields[$field])) { $fieldtype = $mm_fields[$field]['fieldtype']; $fieldname = $mm_fields[$field]['fieldname']; - $output .= '$j(":input[name='.$fieldname.']").parents("tr:not(.urltv)").children("td:first").children("span.warning").html("'.jsSafe($newlabel).'");'; + $output .= '$j("'.$fieldtype.'[name='.$fieldname.']").parents("td").prev("td").children("span.warning").empty().prepend("'.jsSafe($newlabel).'");'; } break; @@ -88,8 +86,6 @@ function mm_hideFields($fields, $roles='', $templates='') { $output = ''; - $output .= '$j("select[id$=_prefix]").each( function() { $j(this).parents("tr:first").addClass("urltv"); } ); '; - switch ($field) { // Exceptions @@ -134,7 +130,7 @@ function mm_hideFields($fields, $roles='', $templates='') { // Ones that follow the regular pattern default: if (isset($mm_fields[$field])) { // Check the fields exist, so we're not writing JS for elements that don't exist - $output .= '$j(":input[name='.$mm_fields[$field]['fieldname'].']").parents("tr:not(.urltv)").hide().next("tr").find("td[colspan=2]").parent("tr").hide(); '; + $output .= '$j("'.$mm_fields[$field]['fieldtype'].'[name='.$mm_fields[$field]['fieldname'].']").parents("tr").hide().next("tr").find("td[colspan=2]").parent("tr").hide(); '; } break; } // end switch @@ -172,25 +168,18 @@ function mm_changeFieldHelp($field, $helptext='', $roles='', $templates='') { // Ones that follow the regular pattern default: - $output .= '$j("select[id$=_prefix]").each( function() { $j(this).parents("tr:first").addClass("urltv"); } ); ' . "\n"; - // What type is this field? if (isset($mm_fields[$field])) { $fieldtype = $mm_fields[$field]['fieldtype']; $fieldname = $mm_fields[$field]['fieldname']; // Give the help button an ID, and modify the alt/title text - $output .= 'if ($j(":input[name=' . $fieldname . ']").siblings("img[style:contains(\'cursor:help\')]").length) {' . "\n"; - $output .= '$j(":input[name=' . $fieldname . ']").siblings("img[style:contains(\'cursor:help\')]").attr("id", "' . $fieldname . '-help").attr("alt", "'.jsSafe($helptext).'").attr("title", "'.jsSafe($helptext).'"); ' . "\n"; - $output .= '} else {' . "\n"; - $output .= 'var help' . $fieldname . ' = $j("").attr("id", "' . $fieldname . '-help").addClass("tooltip").css("cursor", "help").attr("src", "media/style/' . $modx->config['manager_theme'] . '/images/icons/b02_trans.gif").attr("alt", "'.jsSafe($helptext).'").attr("title", "'.jsSafe($helptext).'");' . "\n"; - $output .= '$j(":input[name=' . $fieldname . ']").closest("tr").children("td:last").append(help' . $fieldname . ');' . "\n"; - $output .= '}' . "\n"; + $output .= '$j("'.$fieldtype.'[name='.$fieldname.']").siblings("img[style:contains(\'cursor:help\')]").attr("id", "'.$fieldname.'-help").attr("alt", "'.jsSafe($helptext).'").attr("title", "'.jsSafe($helptext).'"); '; } else { break; } - //alt="NEW pagetitle help" + break; } // end switch diff --git a/assets/plugins/managermanager/functions/fieldvalues.inc.php b/assets/plugins/managermanager/functions/fieldvalues.inc.php index 7ca6f3bc76..3d3bf3ac89 100644 --- a/assets/plugins/managermanager/functions/fieldvalues.inc.php +++ b/assets/plugins/managermanager/functions/fieldvalues.inc.php @@ -22,7 +22,7 @@ function mm_default($field, $value='', $roles='', $templates='', $eval=false) { return; } - if (useThisRule($roles, $templates)) { + if ($e->name == 'OnDocFormRender' && useThisRule($roles, $templates)) { // What's the new value, and does it include PHP? $new_value = ($eval) ? eval($value) : $value; @@ -167,7 +167,7 @@ function mm_default($field, $value='', $roles='', $templates='', $eval=false) { default: - return; + $output .= '$j("*[name='.$field.']").val("'.$new_value.'");' . "\n"; //return; break; } $e->output($output . "\n"); @@ -196,7 +196,7 @@ function mm_inherit($fields, $roles='', $templates='') { } // Are we using this rule? - if (useThisRule($roles, $templates)) { + if ($e->name == 'OnDocFormRender' && useThisRule($roles, $templates)) { // Get the parent info if (isset($_REQUEST['pid'])){ @@ -296,7 +296,7 @@ function mm_synch_fields($fields, $roles='', $templates='') { } // if the current page is being edited by someone in the list of roles, and uses a template in the list of templates - if (useThisRule($roles, $templates)) { + if ($e->name == 'OnDocFormRender' && useThisRule($roles, $templates)) { $output = " // ----------- Synch fields -------------- \n"; diff --git a/assets/plugins/managermanager/functions/sections.inc.php b/assets/plugins/managermanager/functions/sections.inc.php index 8e954125a7..fd40d8800b 100644 --- a/assets/plugins/managermanager/functions/sections.inc.php +++ b/assets/plugins/managermanager/functions/sections.inc.php @@ -13,7 +13,7 @@ function mm_renameSection($section, $newname, $roles='', $templates='') { $e = &$modx->Event; // if the current page is being edited by someone in the list of roles, and uses a template in the list of templates - if (useThisRule($roles, $templates)) { + if ($e->name == 'OnDocFormRender' && useThisRule($roles, $templates)) { $output = " // ----------- Rename section -------------- \n"; diff --git a/assets/plugins/managermanager/functions/tabs.inc.php b/assets/plugins/managermanager/functions/tabs.inc.php index 5bb9c463ba..4f4c27d83f 100644 --- a/assets/plugins/managermanager/functions/tabs.inc.php +++ b/assets/plugins/managermanager/functions/tabs.inc.php @@ -12,7 +12,7 @@ function mm_renameTab($tab, $newname, $roles='', $templates='') { $e = &$modx->Event; // if the current page is being edited by someone in the list of roles, and uses a template in the list of templates - if (useThisRule($roles, $templates)) { + if ($e->name == 'OnDocFormRender' && useThisRule($roles, $templates)){ $output = " // ----------- Rename tab -------------- \n"; @@ -62,7 +62,7 @@ function mm_hideTabs($tabs, $roles='', $templates='') { $tabs = makeArray($tabs); // if the current page is being edited by someone in the list of roles, and uses a template in the list of templates - if (useThisRule($roles, $templates)) { + if ($e->name == 'OnDocFormRender' && useThisRule($roles, $templates)){ $output = " // ----------- Hide tabs -------------- \n"; @@ -129,7 +129,7 @@ function mm_createTab($name, $id, $roles='', $templates='', $intro='', $width='6 $e = &$modx->Event; // if the current page is being edited by someone in the list of roles, and uses a template in the list of templates - if (useThisRule($roles, $templates)) { + if ((($e->name == 'OnDocFormRender') || ($e->name == 'OnPluginFormRender')) && useThisRule($roles, $templates)){ // Plugin page tabs use a differen name for the tab object $js_tab_object = ($e->name == 'OnPluginFormRender') ? 'tpSnippet' : 'tpSettings'; diff --git a/assets/plugins/managermanager/functions/templates.inc.php b/assets/plugins/managermanager/functions/templates.inc.php index 97c281f3a2..1e0b283c97 100644 --- a/assets/plugins/managermanager/functions/templates.inc.php +++ b/assets/plugins/managermanager/functions/templates.inc.php @@ -14,7 +14,7 @@ function mm_hideTemplates($tplIds, $roles='', $templates='') { $tplIds = makeArray($tplIds); - if (useThisRule($roles, $templates)) { + if ($e->name == 'OnDocFormRender' && useThisRule($roles, $templates)) { $output = " // ----------- Hide templates -------------- \n"; diff --git a/assets/plugins/managermanager/mm.inc.php b/assets/plugins/managermanager/mm.inc.php index 09f7e85559..ea069f66af 100644 --- a/assets/plugins/managermanager/mm.inc.php +++ b/assets/plugins/managermanager/mm.inc.php @@ -1,28 +1,22 @@ Здесь вы можете отредактировать всё, что касается поисковой оптимизации.

    "); +mm_moveFieldsToTab("longtitle,description,ddkeywords,sitemap_changefreq,sitemap_priority", "seoTab", "!$editorsRole"); +//Для редакторов +mm_hideFields("longtitle,description", "$editorsRole"); + +?> \ No newline at end of file diff --git a/assets/plugins/managermanager/widgets/!template/!template.php b/assets/plugins/managermanager/widgets/!template/!template.php index 3c817a3182..3ba9e3095d 100644 --- a/assets/plugins/managermanager/widgets/!template/!template.php +++ b/assets/plugins/managermanager/widgets/!template/!template.php @@ -9,7 +9,7 @@ function mm_widget_template($fields, $other_param='defaultValue', $roles='', $te global $modx, $content, $mm_fields; $e = &$modx->Event; - if (useThisRule($roles, $templates)) { + if ($e->name == 'OnDocFormRender' && useThisRule($roles, $templates)) { // Your output should be stored in a string, which is outputted at the end // It will be inserted as a Javascript block (with jQuery), which is executed on document ready @@ -56,10 +56,9 @@ function mm_widget_template($fields, $other_param='defaultValue', $roles='', $te } + $e->output($output . "\n"); // Send the output to the browser } // end if - $e->output($output . "\n"); // Send the output to the browser - } ?> \ No newline at end of file diff --git a/assets/plugins/managermanager/widgets/accessdenied/accessdenied.php b/assets/plugins/managermanager/widgets/accessdenied/accessdenied.php index e668026edb..0c56bea8d0 100644 --- a/assets/plugins/managermanager/widgets/accessdenied/accessdenied.php +++ b/assets/plugins/managermanager/widgets/accessdenied/accessdenied.php @@ -13,7 +13,7 @@ function mm_widget_accessdenied($ids='', $message='', $roles='') { if (empty($message)) $message='Access deniedAccess to current document closed for security reasons.'; - if (useThisRule($roles)) { + if ($e->name == 'OnDocFormRender' && useThisRule($roles)) { $docid = (int)$_GET[id]; @@ -31,10 +31,9 @@ function mm_widget_accessdenied($ids='', $message='', $roles='') { $j("#aback").css({height: $j("body").height()} );'; } + $e->output($output . "\n"); // Send the output to the browser } // end if - $e->output($output . "\n"); // Send the output to the browser - } ?> diff --git a/assets/plugins/managermanager/widgets/colors/colors.php b/assets/plugins/managermanager/widgets/colors/colors.php index 3a2b0e942c..b66cef3b12 100644 --- a/assets/plugins/managermanager/widgets/colors/colors.php +++ b/assets/plugins/managermanager/widgets/colors/colors.php @@ -9,7 +9,7 @@ function mm_widget_colors($fields, $default='#ffffff', $roles='', $templates='') global $modx, $content, $mm_fields; $e = &$modx->Event; - if (useThisRule($roles, $templates)) { + if ($e->name == 'OnDocFormRender' && useThisRule($roles, $templates)) { $output = ''; diff --git a/assets/plugins/managermanager/widgets/tags/tags.php b/assets/plugins/managermanager/widgets/tags/tags.php index 3ce96e13f8..689d31229c 100644 --- a/assets/plugins/managermanager/widgets/tags/tags.php +++ b/assets/plugins/managermanager/widgets/tags/tags.php @@ -9,7 +9,7 @@ function mm_widget_tags($fields, $delimiter=',', $source='', $display_count=fals global $modx, $content, $mm_fields; $e = &$modx->Event; - if (useThisRule($roles, $templates)) { + if ($e->name == 'OnDocFormRender' && useThisRule($roles, $templates)){ $output = ''; @@ -95,7 +95,7 @@ function mm_widget_tags($fields, $delimiter=',', $source='', $display_count=fals $output .= 'var '.$tv_id.'_tags = new TagCompleter("'.$tv_id.'", "'.$tv_id.'_tagList", "'.$delimiter.'"); '; } + $e->output($output . "\n"); } - $e->output($output . "\n"); } ?> \ No newline at end of file From c56a4ef61e901e413da25d1a5ca46011dfeddda1 Mon Sep 17 00:00:00 2001 From: Dmi3yy Date: Mon, 26 Aug 2013 12:18:17 +0300 Subject: [PATCH 328/530] update mm step 3 --- .../widgets/ddautofolders/ddautofolders.php | 177 ++++++++++++++++ .../widgets/ddautofolders/index.html | 2 + .../ddautofolders/modx.ddtools.class.php | 154 ++++++++++++++ .../managermanager/widgets/ddgmap/ddgmap.php | 112 ++++++++++ .../managermanager/widgets/ddgmap/index.html | 2 + .../widgets/ddmaxlength/ddmaxlength.css | 13 ++ .../widgets/ddmaxlength/ddmaxlength.php | 95 +++++++++ .../widgets/ddmaxlength/index.html | 2 + .../ddmaxlength/jquery.ddmaxlength-1.0.min.js | 5 + .../ddsetfieldvalue/ddsetfieldvalue.php | 192 ++++++++++++++++++ .../widgets/ddsetfieldvalue/index.html | 2 + .../managermanager/widgets/ddymap/ddymap.php | 107 ++++++++++ .../managermanager/widgets/ddymap/index.html | 2 + 13 files changed, 865 insertions(+) create mode 100755 assets/plugins/managermanager/widgets/ddautofolders/ddautofolders.php create mode 100755 assets/plugins/managermanager/widgets/ddautofolders/index.html create mode 100755 assets/plugins/managermanager/widgets/ddautofolders/modx.ddtools.class.php create mode 100755 assets/plugins/managermanager/widgets/ddgmap/ddgmap.php create mode 100755 assets/plugins/managermanager/widgets/ddgmap/index.html create mode 100755 assets/plugins/managermanager/widgets/ddmaxlength/ddmaxlength.css create mode 100755 assets/plugins/managermanager/widgets/ddmaxlength/ddmaxlength.php create mode 100755 assets/plugins/managermanager/widgets/ddmaxlength/index.html create mode 100755 assets/plugins/managermanager/widgets/ddmaxlength/jquery.ddmaxlength-1.0.min.js create mode 100755 assets/plugins/managermanager/widgets/ddsetfieldvalue/ddsetfieldvalue.php create mode 100755 assets/plugins/managermanager/widgets/ddsetfieldvalue/index.html create mode 100755 assets/plugins/managermanager/widgets/ddymap/ddymap.php create mode 100755 assets/plugins/managermanager/widgets/ddymap/index.html diff --git a/assets/plugins/managermanager/widgets/ddautofolders/ddautofolders.php b/assets/plugins/managermanager/widgets/ddautofolders/ddautofolders.php new file mode 100755 index 0000000000..32478fff1d --- /dev/null +++ b/assets/plugins/managermanager/widgets/ddautofolders/ddautofolders.php @@ -0,0 +1,177 @@ +Event; + + //$ddParent is required + if (is_numeric($ddParent) && $e->name == 'OnBeforeDocFormSave' && useThisRule($ddRoles, $ddTemplates)){ + $base_path = $modx->config['base_path']; + $widgetDir = $base_path.'assets/plugins/managermanager/widgets/ddautofolders/'; + + //Подключаем библиотеку ddTools + require_once $widgetDir.'modx.ddtools.class.php'; + + //Текущее правило + $rule = array(); + + //Дата + $ddDate = array(); + + //Если задано, откуда брать дату и это не дата публикации, пытаемся найти в tv`шках + if ($ddDateSource && $ddDateSource != 'pub_date'){ + //Получаем tv с датой для данного шаблона + $dateTv = tplUseTvs($template, $ddDateSource); + + //Если tv удалось получить, такая tv есть и есть её значение + if ($dateTv && $dateTv[0]['id'] && $tmplvars[$dateTv[0]['id']] && $tmplvars[$dateTv[0]['id']][1]){ + //Если дата в юникс-времени + if (is_numeric($tmplvars[$dateTv[0]['id']][1])){ + $ddDate['date'] = $tmplvars[$dateTv[0]['id']][1]; + }else{ + //Пытаемся преобразовать в unix-время + $ddDate['date'] = strtotime($tmplvars[$dateTv[0]['id']][1]); + } + //Пытаемся преобразовать в unix-время + if (!is_numeric($tmplvars[$dateTv[0]['id']][1])) $ddDate['date'] = strtotime($tmplvars[$dateTv[0]['id']][1]); + } + }else{ + $ddDate['date'] = $pub_date; + } + + //Если не задана дата, выбрасываем + if (!$ddDate['date']) return; + + //Псевдонимы родителей (какие должны быть) + //Год в формате 4 цифры + $ddDate['y'] = date('Y', $ddDate['date']); + //Название месяца на английском + $ddDate['m'] = strtolower(date('F', $ddDate['date'])); + //Порядковый номер месяца + $ddDate['n'] = date('n', $ddDate['date']); + + //Если язык админки — русский + if (strtolower($modx_lang_attribute) == 'ru'){ + //Все месяцы на русском + $ruMonthes = array('Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь', 'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь', 'Декабрь'); + + //Название месяца на русском + $ddDate['mTitle'] = $ruMonthes[$ddDate['n'] - 1]; + }else{ + //Просто запишем на английском + $ddDate['mTitle'] = date('F', $ddDate['date']); + } + + //Получаем список групп документов, к которым принадлежит текущий документ (пригодится при создании годов и месяцев) + $docGroups = preg_replace('/,\d*/', '', $document_groups); + + //Получаем псевдоним корневого родителя + $ultimateAlias = ''; + //Если корневой родитель не в корне, допишем путь к нему + if ($modx->aliasListing[$ddParent]['path'] != '') $ultimateAlias .= $modx->aliasListing[$ddParent]['path'].'/'; + $ultimateAlias .= $modx->aliasListing[$ddParent]['alias']; + + //Получаем годы (непосредственных детей корневого родителя) + $years = $modx->getChildIds($ddParent, 1); + + //Получаем id нужного нам года + $yearId = $years[$ultimateAlias.'/'.$ddDate['y']]; + + //Если нужный год существует + if ($yearId){ + //Проставим году нужные параметры + ddTools::udateDocument($yearId, array( + 'isfolder' => 1, + 'template' => $ddYearTpl, + 'published' => $ddYearPub + )); + //Получаем месяцы (непосредственных детей текущего года) + $months = $modx->getChildIds($yearId, 1); + //Получаем id нужного нам месяца + $monthId = $months[$ultimateAlias.'/'.$ddDate['y'].'/'.$ddDate['m']]; + //Если нужный год не существует + }else{ + //Создадим его + $yearId = ddTools::createDocument(array( + 'pagetitle' => $ddDate['y'], + 'alias' => $ddDate['y'], + 'parent' => $ddParent, + 'isfolder' => 1, + 'template' => $ddYearTpl, + //Года запихиваем тупо в самый конец +// 'menuindex' => count($years), + //Да пусть будут тупо по году, сортироваться нормально зато будут + 'menuindex' => $ddDate['y'] - 2000, + 'published' => $ddYearPub + ), $docGroups); + } + +// if (!$monthId && $yearId){ + //Если нужный месяц существует + if ($monthId){ + //Проставим месяцу нужные параметры + ddTools::udateDocument($monthId, array( + 'isfolder' => 1, + 'template' => $ddMonthTpl, + 'published' => $ddMonthPub + )); + //Если нужный месяц не существует (на всякий случай проверим ещё и год) + }else if($yearId){ + $monthId = ddTools::createDocument(array( + 'pagetitle' => $ddDate['mTitle'], + 'alias' => $ddDate['m'], + 'parent' => $yearId, + 'isfolder' => 1, + 'template' => $ddMonthTpl, + //Для месяца выставляем menuindex в соответствии с его порядковым номером + 'menuindex' => $ddDate['n'] - 1, + 'published' => $ddMonthPub + ), $docGroups); + } + + //Ещё раз на всякий случай проверим, что с месяцем всё хорошо + if ($monthId && $monthId != $parent) $parent = $monthId; + } +} +?> \ No newline at end of file diff --git a/assets/plugins/managermanager/widgets/ddautofolders/index.html b/assets/plugins/managermanager/widgets/ddautofolders/index.html new file mode 100755 index 0000000000..cfb7d0fe18 --- /dev/null +++ b/assets/plugins/managermanager/widgets/ddautofolders/index.html @@ -0,0 +1,2 @@ +

    Unauthorized access

    +You're not allowed to access file folder \ No newline at end of file diff --git a/assets/plugins/managermanager/widgets/ddautofolders/modx.ddtools.class.php b/assets/plugins/managermanager/widgets/ddautofolders/modx.ddtools.class.php new file mode 100755 index 0000000000..c6b3e3798b --- /dev/null +++ b/assets/plugins/managermanager/widgets/ddautofolders/modx.ddtools.class.php @@ -0,0 +1,154 @@ +db->insert($fields, $modx->getFullTableName('site_content')); + + //Если заданы группы (и на всякий проверим ID) + if ($groups && $id){ + //Перебираем все группы + foreach ($groups as $gr){ + $modx->db->insert(array('document_group' => $gr, 'document' => $id), $modx->getFullTableName('document_groups')); + } + } + + return $id; + } + + /** + * udateDocument + * @version 1.0 (2012-02-13) + * + * Обновляет информацию по документу. + * + * @desc $id и/или $where должны быть переданы + * + * @param $id {integer} - ID документа, который необхоидмо отредактировать. + * @param $update {array} - Ассоциативный массив значений полей документа (в таблице `site_content`). + * @param $where {string} - SQL условие WHERE. + * + * @return {mixed} - ID отредактированного документа или false, если что-то не так. + */ + public static function udateDocument($id = 0, $update = array(), $where = ''){ + global $modx; + + //Формируем WHERE для SQL + $where = (($id != 0) ? "`id`='$id'" : "") . (($id != 0 && $where != '') ? " OR " : "") . $where; + + //Обновляем информацию по документу, получаем id, если что-то пошло не так, выкидываем + return $modx->db->update($update, $modx->getFullTableName('site_content'), $where); + } + + /** + * generateString + * @version 1.0 (2012-02-13) + * + * Генерация строки заданного размера. + * + * @param $length {integer} - Размер строки на выходе. + * @param $chars {string} - Символы для генерации. + * + * @return {string} + */ + public static function generateString($length = 8, $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ123456789'){ + $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ123456789'; + $numChars = strlen($chars); + $string = ''; + for ($i = 0; $i < $length; $i++){ + $string .= substr($chars, rand(1, $numChars) - 1, 1); + } + + return $string; + } + + /** + * parseText + * @version 1.0 (2012-02-13) + * + * Аналог модексовского parseChunk, только принимает текст. + * + * @param $chunk {string} - Строка, которую нужно парсить. + * @param $chunkArr {array} - Ассоциативный массив значений. + * @param $prefix {string} - Префикс плэйсхолдеров. + * @param $suffix {string} - Суффикс плэйсхолдеров. + * + * @return {string} + */ + public static function parseText($chunk, $chunkArr, $prefix= '[+', $suffix= '+]'){ + global $modx; + + //Если значения для парсинга не переданы, ничего не делаем + if (!is_array($chunkArr)){ + return $chunk; + } + + //TODO: Возможно, стоит убрать в одельный параметр + $chunk = $modx->mergeDocumentContent($chunk); + $chunk = $modx->mergeSettingsContent($chunk); + $chunk = $modx->mergeChunkContent($chunk); + + foreach ($chunkArr as $key => $value) { + $chunk = str_replace($prefix.$key.$suffix, $value, $chunk); + } + + return $chunk; + } + + /** + * parseSourse + * @version 1.0 (2012-02-13) + * + * Парсит ресурс. + * + * @param $sourse {string} + * + * @return {string} + */ + public static function parseSourse($sourse){ + global $modx; + + return $modx->rewriteUrls($modx->parseDocumentSource($sourse)); + } +} +} + +?> \ No newline at end of file diff --git a/assets/plugins/managermanager/widgets/ddgmap/ddgmap.php b/assets/plugins/managermanager/widgets/ddgmap/ddgmap.php new file mode 100755 index 0000000000..28355a9b8e --- /dev/null +++ b/assets/plugins/managermanager/widgets/ddgmap/ddgmap.php @@ -0,0 +1,112 @@ +Event; + + if ($e->name == 'OnDocFormRender' && useThisRule($roles, $templates)){ + + // Your output should be stored in a string, which is outputted at the end + // It will be inserted as a Javascript block (with jQuery), which is executed on document ready + $output = ''; + + // if we've been supplied with a string, convert it into an array + $tvs = makeArray($tvs); + + // You might want to check whether the current page's template uses the TVs that have been + // supplied, to save processing page which don't contain them + + // Which template is this page using? + if (isset($content['template'])) { + $page_template = $content['template']; + } else { + // If no content is set, it's likely we're adding a new page at top level. + // So use the site default template. This may need some work as it might interfere with a default template set by MM? + $page_template = $modx->config['default_template']; + } + + $tvs = tplUseTvs($content['template'], $tvs); + if ($tvs == false) { + return; + } + + + $style = 'width: '.$w.'px; height: '.$h.'px; position: relative; border: 1px solid #c3c3c3;'; + // We always put a JS comment, which makes debugging much easier + $output .= "// -------------- mm_ddGMap :: Begin ------------- \n"; + + // We have functions to include JS or CSS external files you might need + // The standard ModX API methods don't work here + //$output .= includeJs('http://maps.google.com/maps/api/js?sensor=false'); + + // Do something for each of the fields supplied + foreach ($tvs as $tv) { + // If it's a TV, we may need to map the field name, to what it's ID is. + // This can be obtained from the mm_fields array + $tv_id = 'tv'.$tv['id']; + $output .= ' +var coordinatesField = $j("#'.$tv_id.'");//TV с координатами +var ddLatLng = coordinatesField.val();//Координаты +//Скрываем поле, запоминаем название поля +var sectionName = coordinatesField.parents("tr:first").hide().find(".warning").text(); +coordinatesField.parents("tr:first").prev("tr").hide(); +//Контейнер для карты +var sectionConteiner = $j("
    "+sectionName+"
    "); +//Добавляем контейнер +coordinatesField.parents(".tab-page:first").append(sectionConteiner); +//Если координаты не заданны, то задаём дефолт +if(ddLatLng == "") ddLatLng = "55.19396010947335,61.3670539855957"; +ddLatLng = ddLatLng.split(","); + +//Callback функция для GM +window.ddgminitialize = function(){ + var GM = google.maps; + var myOptions = { + zoom: 15, + center: new GM.LatLng(ddLatLng[0],ddLatLng[1]), + mapTypeId: GM.MapTypeId.ROADMAP, + streetViewControl: false, + scrollwheel: false + }; + var map = new GM.Map(sectionConteiner.find(".ddGMap").get(0), myOptions); + //Добавляем маркер на карту + var GMMarker = new GM.Marker({ + position: new GM.LatLng(ddLatLng[0],ddLatLng[1]), + map: map, + draggable: true + }); + //При перетаскивании маркера + GM.event.addListener(GMMarker, "drag", function(event){ + var position = event.latLng;//Координаты + coordinatesField.val(position.lat() + "," + position.lng());//Сохраняем значение в поле + }); + //При клике на карте + GM.event.addListener(map, "click", function(event){ + var position = event.latLng;//Новые координаты + GMMarker.setPosition(position);//Меняем позицию маркера + map.setCenter(position);//Центрируем карту на маркере + coordinatesField.val(position.lat() + "," + position.lng());//Сохраняем значение в поле + }); +}; +//Подключаем карту, вызываем callback функцию +$j(window).on("load.ddEvents", function(){ + $j("body").append(" diff --git a/manager/actions/import_site.static.php b/manager/actions/import_site.static.php index 0df088c681..8162f4bcdc 100644 --- a/manager/actions/import_site.static.php +++ b/manager/actions/import_site.static.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR


    Please use the MODx Content Manager instead of accessing this file directly."); +if(IN_MANAGER_MODE!="true") die("INCLUDE_ORDERING_ERROR

    Please use the MODX Content Manager instead of accessing this file directly."); if(!$modx->hasPermission('import_static')) { $e->setError(3); $e->dumpError(); diff --git a/manager/actions/logging.static.php b/manager/actions/logging.static.php index bdcdd1385f..ca015550b2 100644 --- a/manager/actions/logging.static.php +++ b/manager/actions/logging.static.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR


    Please use the MODx Content Manager instead of accessing this file directly."); +if(IN_MANAGER_MODE!="true") die("INCLUDE_ORDERING_ERROR

    Please use the MODX Content Manager instead of accessing this file directly."); if(!$modx->hasPermission('logs')) { $e->setError(3); $e->dumpError(); diff --git a/manager/actions/manage_metatags.dynamic.php b/manager/actions/manage_metatags.dynamic.php index 94b8f06efb..82801948c4 100644 --- a/manager/actions/manage_metatags.dynamic.php +++ b/manager/actions/manage_metatags.dynamic.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the MODx Content Manager instead of accessing this file directly."); +if(IN_MANAGER_MODE!="true") die("INCLUDE_ORDERING_ERROR

    Please use the MODX Content Manager instead of accessing this file directly."); if(!$modx->hasPermission('manage_metatags')) { $e->setError(3); $e->dumpError(); diff --git a/manager/actions/messages.static.php b/manager/actions/messages.static.php index 4608e530b7..4ba221852f 100644 --- a/manager/actions/messages.static.php +++ b/manager/actions/messages.static.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the MODx Content Manager instead of accessing this file directly."); +if(IN_MANAGER_MODE!="true") die("INCLUDE_ORDERING_ERROR

    Please use the MODX Content Manager instead of accessing this file directly."); if(!$modx->hasPermission('messages')) { $e->setError(3); $e->dumpError(); diff --git a/manager/actions/modules.static.php b/manager/actions/modules.static.php index d0ca3a1ace..f487e75345 100644 --- a/manager/actions/modules.static.php +++ b/manager/actions/modules.static.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the MODx Content Manager instead of accessing this file directly."); +if(IN_MANAGER_MODE!="true") die("INCLUDE_ORDERING_ERROR

    Please use the MODX Content Manager instead of accessing this file directly."); if(!($modx->hasPermission('new_module')||$modx->hasPermission('edit_module')||$modx->hasPermission('exec_module'))) { $e->setError(3); diff --git a/manager/actions/move_document.dynamic.php b/manager/actions/move_document.dynamic.php index 30a7ed11b3..71eeb5d16d 100644 --- a/manager/actions/move_document.dynamic.php +++ b/manager/actions/move_document.dynamic.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the MODx Content Manager instead of accessing this file directly."); +if(IN_MANAGER_MODE!="true") die("INCLUDE_ORDERING_ERROR

    Please use the MODX Content Manager instead of accessing this file directly."); if(!$modx->hasPermission('save_document')) { $e->setError(3); $e->dumpError(); diff --git a/manager/actions/mutate_content.dynamic.php b/manager/actions/mutate_content.dynamic.php index 9dd4500be9..808370af13 100644 --- a/manager/actions/mutate_content.dynamic.php +++ b/manager/actions/mutate_content.dynamic.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the MODx Content Manager instead of accessing this file directly.'); +if (IN_MANAGER_MODE != 'true') die('INCLUDE_ORDERING_ERROR

    Please use the MODX Content Manager instead of accessing this file directly.'); /********************/ $sd=isset($_REQUEST['dir'])?'&dir='.$_REQUEST['dir']:'&dir=DESC'; diff --git a/manager/actions/mutate_htmlsnippet.dynamic.php b/manager/actions/mutate_htmlsnippet.dynamic.php index 98bdd019ec..23dc1f1388 100644 --- a/manager/actions/mutate_htmlsnippet.dynamic.php +++ b/manager/actions/mutate_htmlsnippet.dynamic.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the MODx Content Manager instead of accessing this file directly."); +if (IN_MANAGER_MODE != 'true') die("INCLUDE_ORDERING_ERROR

    Please use the MODX Content Manager instead of accessing this file directly."); switch ((int) $_REQUEST['a']) { case 78: diff --git a/manager/actions/mutate_module.dynamic.php b/manager/actions/mutate_module.dynamic.php index a61107019a..9a52e6909e 100644 --- a/manager/actions/mutate_module.dynamic.php +++ b/manager/actions/mutate_module.dynamic.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the MODx Content Manager instead of accessing this file directly.'); +if(IN_MANAGER_MODE!='true') die('INCLUDE_ORDERING_ERROR

    Please use the MODX Content Manager instead of accessing this file directly.'); switch ((int) $_REQUEST['a']) { case 107: diff --git a/manager/actions/mutate_module_resources.dynamic.php b/manager/actions/mutate_module_resources.dynamic.php index f1cabeffcb..3f04d30dca 100644 --- a/manager/actions/mutate_module_resources.dynamic.php +++ b/manager/actions/mutate_module_resources.dynamic.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the MODx Content Manager instead of accessing this file directly."); +if (IN_MANAGER_MODE != 'true') die("INCLUDE_ORDERING_ERROR

    Please use the MODX Content Manager instead of accessing this file directly."); if (!$modx->hasPermission('edit_module')) { $e->setError(3); diff --git a/manager/actions/mutate_password.dynamic.php b/manager/actions/mutate_password.dynamic.php index ed98092bb5..f5f762e54f 100644 --- a/manager/actions/mutate_password.dynamic.php +++ b/manager/actions/mutate_password.dynamic.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the MODx Content Manager instead of accessing this file directly."); +if(IN_MANAGER_MODE != 'true') die("INCLUDE_ORDERING_ERROR

    Please use the MODX Content Manager instead of accessing this file directly."); if(!$modx->hasPermission('change_password')) { $e->setError(3); diff --git a/manager/actions/mutate_plugin.dynamic.php b/manager/actions/mutate_plugin.dynamic.php index 584be80334..cf4bbc10ca 100644 --- a/manager/actions/mutate_plugin.dynamic.php +++ b/manager/actions/mutate_plugin.dynamic.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the MODx Content Manager instead of accessing this file directly."); +if(IN_MANAGER_MODE!="true") die("INCLUDE_ORDERING_ERROR

    Please use the MODX Content Manager instead of accessing this file directly."); switch((int) $_REQUEST['a']) { case 102: diff --git a/manager/actions/mutate_plugin_priority.dynamic.php b/manager/actions/mutate_plugin_priority.dynamic.php index c868b63345..31266a58d8 100644 --- a/manager/actions/mutate_plugin_priority.dynamic.php +++ b/manager/actions/mutate_plugin_priority.dynamic.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the MODx Content Manager instead of accessing this file directly."); +if(IN_MANAGER_MODE!="true") die("INCLUDE_ORDERING_ERROR

    Please use the MODX Content Manager instead of accessing this file directly."); if(!$modx->hasPermission('save_plugin')) { $e->setError(3); $e->dumpError(); diff --git a/manager/actions/mutate_role.dynamic.php b/manager/actions/mutate_role.dynamic.php index 77f6ff741c..6f385cc424 100644 --- a/manager/actions/mutate_role.dynamic.php +++ b/manager/actions/mutate_role.dynamic.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the MODx Content Manager instead of accessing this file directly."); +if(IN_MANAGER_MODE!="true") die("INCLUDE_ORDERING_ERROR

    Please use the MODX Content Manager instead of accessing this file directly."); switch((int) $_REQUEST['a']) { diff --git a/manager/actions/mutate_settings.dynamic.php b/manager/actions/mutate_settings.dynamic.php index 03b314c13b..6f4103aee7 100644 --- a/manager/actions/mutate_settings.dynamic.php +++ b/manager/actions/mutate_settings.dynamic.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the MODx Content Manager instead of accessing this file directly."); +if(IN_MANAGER_MODE!="true") die("INCLUDE_ORDERING_ERROR

    Please use the MODX Content Manager instead of accessing this file directly."); if(!$modx->hasPermission('settings')) { $e->setError(3); $e->dumpError(); From e6f01265121b97dde080ddf6d6b42a74f9df9742 Mon Sep 17 00:00:00 2001 From: yama Date: Mon, 26 Aug 2013 19:04:44 +0900 Subject: [PATCH 344/530] Use new mail function (send webuser password) --- .../processors/save_web_user.processor.php | 26 +++++++------------ 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/manager/processors/save_web_user.processor.php b/manager/processors/save_web_user.processor.php index 825e2c7f49..31f267cd8b 100755 --- a/manager/processors/save_web_user.processor.php +++ b/manager/processors/save_web_user.processor.php @@ -405,7 +405,7 @@ function save_user_quoted_printable($string) { // Send an email to the user function sendMailMessage($email, $uid, $pwd, $ufn) { - global $websignupemail_message; + global $modx,$_lang,$websignupemail_message; global $emailsubject, $emailsender; global $site_name, $site_start, $site_url; $message = sprintf($websignupemail_message, $uid, $pwd); // use old method @@ -418,22 +418,14 @@ function sendMailMessage($email, $uid, $pwd, $ufn) { $message = str_replace("[+semail+]", $emailsender, $message); $message = str_replace("[+surl+]", $site_url, $message); - $headers = "From: " . $emailsender . "\r\n"; - $headers .= "X-Mailer: Content Manager - PHP/" . phpversion(); - $headers .= "\r\n"; - $headers .= "MIME-Version: 1.0\r\n"; - $headers .= "Content-Type: text/plain; charset=utf-8\r\n"; - $headers .= "Content-Transfer-Encoding: quoted-printable\r\n"; - $subject = "=?UTF-8?Q?".$emailsubject."?="; - $message = save_user_quoted_printable($message); - - if (ini_get('safe_mode') == FALSE) { - if (!mail($email, $subject, $message, $headers, "-f $emailsender")) { - webAlert("$email - {$_lang['error_sending_email']}"); - exit; - } - } elseif (!mail($email, $subject, $message, $headers)) { - webAlert("$email - {$_lang['error_sending_email']}"); + $param = array(); + $param['from'] = "{$site_name}<{$emailsender}>"; + $param['subject'] = $emailsubject; + $param['body'] = $message; + $param['to'] = $email; + $rs = $modx->sendmail($param); + if (!$rs) { + webAlert("{$email} - {$_lang['error_sending_email']}"); exit; } } From fa02b6e927f744b13620a92e26f56bfc5bf53013 Mon Sep 17 00:00:00 2001 From: Dmi3yy Date: Mon, 26 Aug 2013 13:10:28 +0300 Subject: [PATCH 345/530] fix html --- manager/actions/eventlog.dynamic.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/manager/actions/eventlog.dynamic.php b/manager/actions/eventlog.dynamic.php index c7adf6052c..864e484674 100644 --- a/manager/actions/eventlog.dynamic.php +++ b/manager/actions/eventlog.dynamic.php @@ -98,7 +98,7 @@ function menuAction(a) {

    -
    Date: Mon, 26 Aug 2013 13:15:22 +0300 Subject: [PATCH 346/530] fix html in eventlog --- manager/actions/eventlog.dynamic.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/manager/actions/eventlog.dynamic.php b/manager/actions/eventlog.dynamic.php index 864e484674..59bea3073f 100644 --- a/manager/actions/eventlog.dynamic.php +++ b/manager/actions/eventlog.dynamic.php @@ -100,14 +100,14 @@ function menuAction(a) { -
    '.$_lang["export_site_failed"]." ".$_lang["export_site_failed_no_open_filepath"].'

    '; - return FALSE; - } else { - // Write $somecontent to our opened file. - if(fwrite($handle, $somecontent) === FALSE) { - echo '

    '.$_lang["export_site_failed"]." ".$_lang["export_site_failed_no_write"].'

    '; - return FALSE; - } - fclose($handle); - echo '

    '.$_lang["export_site_success"].'

    '; - } - } else { - echo '

    '.$_lang["export_site_failed"]." ".$_lang["export_site_failed_no_retrieve"].'

    '; -// return FALSE; - } - return TRUE; - } - - function getPageName($docid, $alias, $prefix, $suffix) { - if(empty($alias)) { - $filename = $prefix.$docid.$suffix; - } else { - $pa = pathinfo($alias); // get path info array - $tsuffix = !empty($pa['extension']) ? '':$suffix; - $filename = $prefix.$alias.$tsuffix; - } - return $filename; - } - - function scanDirectory($path, $files) { - // if the path has a slash at the end, remove it - if(substr($path, -1) == '/') { - $path = substr($path, 0, -1); - } - // if the path is not valid or is not a directory ... - if(!file_exists($path) || !is_dir($path)) { - return FALSE; - } elseif(!is_readable($path)) { - return FALSE; - } else { - $dh = opendir($path); - while (FALSE !== ($filename = @readdir($dh))) { - if($filename != '.' && $filename != '..' && substr($filename, 1) != '.') { - if (!in_array($filename, $files)) { - $file = $path."/".$filename; - if (is_dir($file)) { - removeDirectoryAll($file); - } else { - @unlink($file); - } - } - } - } - closedir($dh); - return TRUE; - } - } - - function exportDir($dirid, $dirpath, &$i) { - global $_lang; - global $base; - global $modx; - global $limit; - global $dbase; - global $table_prefix; - global $sqlcond; - - $sql = "SELECT id, alias, pagetitle, isfolder, (content = '' AND template = 0) AS wasNull, editedon FROM $dbase.`".$table_prefix."site_content` WHERE $dbname.`".$table_prefix."site_content`.parent = ".$dirid." AND ".$sqlcond; - $rs = $modx->db->query($sql); - $dircontent = array(); - while($row = $modx->db->getRow($rs)) { - if (!$row['wasNull']) { // needs writing a document - $docname = getPageName($row['id'], $row['alias'], $modx->config['friendly_url_prefix'], $suffix = $modx->config['friendly_url_suffix']); - printf($_lang['export_site_exporting_document'], $i++, $limit, $row['pagetitle'], $row['id']); - $filename = $dirpath.$docname; - if (is_dir($filename)) { - removeDirectoryAll($filename); - } - if (!file_exists($filename) || (filemtime($filename) < $row['editedon'])) { - if (!writeAPage($base, $row['id'], $filename)) exit; - } else { - echo '

    '.$_lang['export_site_success']." ".$_lang["export_site_success_skip_doc"].'

    '; - } - $dircontent[] = $docname; - } - if ($row['isfolder']) { // needs making a folder - $dirname = $dirpath.$row['alias']; - if (!is_dir($dirname)) { - if (file_exists($dirname)) @unlink($dirname); - mkdir($dirname); - if ($row['wasNull']) { - printf($_lang['export_site_exporting_document'], $i++, $limit, $row['pagetitle'], $row['id']); - echo '

    '.$_lang['export_site_success'].'

    '; - } - } else { - if ($row['wasNull']) { - printf($_lang['export_site_exporting_document'], $i++, $limit, $row['pagetitle'], $row['id']); - echo '

    '.$_lang['export_site_success'].$_lang["export_site_success_skip_dir"].'

    '; - } - } - exportDir($row['id'], $dirname."/", $i); - $dircontent[] = $row['alias']; - } - } - // remove No-MODx files/dirs - if (!scanDirectory($dirpath, $dircontent)) exit; -// print_r ($dircontent); - } - - if($modx->config['friendly_urls']==1 && $modx->config['use_alias_path']==1) { - $sqlcond = "$dbase.`".$table_prefix."site_content`.deleted=0 AND (($dbase.`".$table_prefix."site_content`.published=1 AND $dbase.`".$table_prefix."site_content`.type='document') OR ($dbase.`".$table_prefix."site_content`.isfolder=1)) $noncache"; - $sql = "SELECT count(*) as count1 FROM $dbase.`".$table_prefix."site_content` WHERE ".$sqlcond; - $rs = $modx->db->query($sql); - $row = $modx->db->getRow($rs,'num'); - $prefix = $modx->config['friendly_url_prefix']; - $suffix = $modx->config['friendly_url_suffix']; - $limit = $row[0]; - printf($_lang['export_site_numberdocs'], $limit); - $n = 1; - exportDir(0, $filepath, $n); - - } else { - // Modified for export alias path 2006/3/24 end - $sql = "SELECT id, alias, pagetitle FROM $dbase.`".$table_prefix."site_content` WHERE $dbase.`".$table_prefix."site_content`.deleted=0 AND $dbase.`".$table_prefix."site_content`.published=1 AND $dbase.`".$table_prefix."site_content`.type='document' $noncache"; - $rs = $modx->db->query($sql); - $limit = $modx->db->getRecordCount($rs); - printf($_lang['export_site_numberdocs'], $limit); - - for($i=0; $i<$limit; $i++) { - - $row=$modx->db->getRow($rs); - - $id = $row['id']; - printf($_lang['export_site_exporting_document'], $i, $limit, $row['pagetitle'], $id); - $alias = $row['alias']; - - if(empty($alias)) { - $filename = $prefix.$id.$suffix; - } else { - $pa = pathinfo($alias); // get path info array - $tsuffix = !empty($pa[extension]) ? '':$suffix; - $filename = $prefix.$alias.$tsuffix; - } - // get the file - if(@$handle = fopen("$base/index.php?id=$id", "r")) { - $buffer = ""; - while (!feof ($handle)) { - $buffer .= fgets($handle, 4096); - } - fclose ($handle); +} +?> - // save it - $filename = "$filepath$filename"; - $somecontent = $buffer; - if(!$handle = fopen($filename, 'w')) { - echo '

    '.$_lang["export_site_failed"]." ".$_lang["export_site_failed_no_open_filename"].'

    '; - exit; - } else { - // Write $somecontent to our opened file. - if(fwrite($handle, $somecontent) === FALSE) { - echo '

    '.$_lang["export_site_failed"]." ".$_lang["export_site_failed_no_writee"].'

    '; - exit; - } - fclose($handle); - echo '

    '.$_lang['export_site_success'].'

    '; - } - } else { - echo '

    '.$_lang["export_site_failed"]." ".$_lang["export_site_failed_no_retrieve"].'

    '; - } - } - } - $mtime = microtime(); $mtime = explode(" ",$mtime); $mtime = $mtime[1] + $mtime[0]; $exportend = $mtime; - $totaltime = ($exportend - $exportstart); - printf ('

    '.$_lang["export_site_time"].'

    ', round($totaltime, 3)); -?> - +
    +
    +

    + \ No newline at end of file + echo '

    '.$_lang['export_site_message'].'

    '; +?> +
    +
    +
    diff --git a/manager/includes/document.parser.class.inc.php b/manager/includes/document.parser.class.inc.php index cd68426e9d..aee0060f16 100755 --- a/manager/includes/document.parser.class.inc.php +++ b/manager/includes/document.parser.class.inc.php @@ -117,8 +117,16 @@ function loadExtension($extname) { else return false; break; + case 'EXPORT_SITE' : + if(include_once(MODX_BASE_PATH . 'manager/includes/extenders/export.class.inc.php')) + { + $this->export= new EXPORT_SITE; + return true; + } + else return false; + break; case 'PHPCOMPAT' : - if(is_object($this->phpcompat)) return; + if(is_object($this->phpcompat)) return; include_once(MODX_BASE_PATH . 'manager/includes/extenders/phpcompat.class.inc.php'); $this->phpcompat = new PHPCOMPAT; break; diff --git a/manager/includes/extenders/export.class.inc.php b/manager/includes/extenders/export.class.inc.php new file mode 100644 index 0000000000..72c7b64d12 --- /dev/null +++ b/manager/includes/extenders/export.class.inc.php @@ -0,0 +1,271 @@ +exportstart = $this->get_mtime(); + $this->count = 0; + $this->setUrlMode(); + $this->dirCheckCount = 0; + $this->generate_mode = 'crawl'; + $this->targetDir = $modx->config['base_path'] . 'temp/export'; + if(!isset($this->total)) $this->getTotal(); + } + + function setExportDir($dir) + { + $dir = str_replace('\\','/',$dir); + $dir = rtrim($dir, '/'); + $this->targetDir = $dir; + } + + function get_mtime() + { + $mtime = microtime(); + $mtime = explode(' ', $mtime); + $mtime = $mtime[1] + $mtime[0]; + return $mtime; + } + + function setUrlMode() + { + global $modx; + + if($modx->config['friendly_urls']==0) + { + $modx->config['friendly_urls'] = 1; + $modx->config['use_alias_path'] = 1; + $modx->clearCache(); + } + $modx->config['make_folders'] = '1'; + } + + function getTotal($ignore_ids='', $noncache='0') + { + global $modx; + + if($ignore_ids !== '') + { + $ignore_ids = explode(',', $ignore_ids); + foreach($ignore_ids as $i=>$v) + { + $v = $modx->db->escape(trim($v)); + $ignore_ids[$i] = "'{$v}'"; + } + $ignore_ids = join(',', $ignore_ids); + $ignore_ids = "AND NOT id IN ({$ignore_ids})"; + } + + $this->ignore_ids = $ignore_ids; + + $noncache = $include_noncache==1 ? '' : 'AND cacheable=1'; + $where = "deleted=0 AND ((published=1 AND type='document') OR (isfolder=1)) {$noncache} {$ignore_ids}"; + $rs = $modx->db->select('count(id) as total','[+prefix+]site_content',$where); + $row = $modx->db->getRow($rs); + $this->total = $row['total']; + return $row['total']; + } + + function removeDirectoryAll($directory='') + { + if(empty($directory)) $directory = $this->targetDir; + $directory = rtrim($directory,'/'); + // if the path is not valid or is not a directory ... + if(empty($directory)) return false; + if(strpos($directory,MODX_BASE_PATH)===false) return FALSE; + + if(!is_dir($directory)) return FALSE; + elseif(!is_readable($directory)) return FALSE; + else + { + $files = glob($directory . '/*'); + if(!empty($files)) + { + foreach($files as $path) + { + if(is_dir($path)) $this->removeDirectoryAll($path); + else $rs = unlink($path); + } + } + } + if($directory !== $this->targetDir) $rs = rmdir($directory); + + return $rs; + } + + function makeFile($docid, $filepath) + { + global $modx,$_lang; + $file_permission = octdec($modx->config['new_file_permissions']); + if($this->generate_mode==='direct') + { + $back_lang = $_lang; + $src = $modx->executeParser($docid); + + $_lang = $back_lang; + } + else $src = $this->curl_get_contents(MODX_SITE_URL . "index.php?id={$docid}"); + + + if($src !== false) + { + if($this->repl_before!==$this->repl_after) $src = str_replace($this->repl_before,$this->repl_after,$src); + $result = file_put_contents($filepath,$src); + if($result!==false) @chmod($filepath, $file_permission); + + if($result !== false) return 'success'; + else return 'failed_no_write'; + } + else return 'no_retrieve'; + } + + function getFileName($docid, $alias='', $prefix, $suffix) + { + global $modx; + + if($alias==='') $filename = $prefix.$docid.$suffix; + else + { + if($modx->config['suffix_mode']==='1' && strpos($alias, '.')!==false) + { + $suffix = ''; + } + $filename = $prefix.$alias.$suffix; + } + return $filename; + } + + function run($parent=0) + { + global $_lang; + global $modx; + $ignore_ids = $this->ignore_ids; + $dirpath = $this->targetDir . '/'; + + $prefix = $modx->config['friendly_url_prefix']; + $suffix = $modx->config['friendly_url_suffix']; + + $tpl = ' [+msg1+] [+msg2+]'; + $ph = array(); + + $ph['status'] = 'fail'; + $ph['msg1'] = $_lang['export_site_failed']; + $ph['msg2'] = $_lang["export_site_failed_no_write"] . ' - ' . $dirpath; + $msg_failed_no_write = $this->parsePlaceholder($tpl,$ph); + + $ph['msg2'] = $_lang["export_site_failed_no_retrieve"]; + $msg_failed_no_retrieve = $this->parsePlaceholder($tpl,$ph); + + $ph['status'] = 'success'; + $ph['msg1'] = $_lang['export_site_success']; + $ph['msg2'] = ''; + $msg_success = $this->parsePlaceholder($tpl,$ph); + + $ph['msg2'] = $_lang['export_site_success_skip_doc']; + $msg_success_skip_doc = $this->parsePlaceholder($tpl,$ph); + + $ph['msg2'] = $_lang['export_site_success_skip_dir']; + $msg_success_skip_dir = $this->parsePlaceholder($tpl,$ph); + + $fields = "id, alias, pagetitle, isfolder, (content = '' AND template = 0) AS wasNull, published"; + $noncache = $_POST['includenoncache']==1 ? '' : 'AND cacheable=1'; + $where = "parent = '{$parent}' AND deleted=0 AND ((published=1 AND type='document') OR (isfolder=1)) {$noncache} {$ignore_ids}"; + $rs = $modx->db->select($fields,'[+prefix+]site_content',$where); + + $ph = array(); + $ph['total'] = $this->total; + $folder_permission = octdec($modx->config['new_folder_permissions']); + while($row = $modx->db->getRow($rs)) + { + $this->count++; + + $row['count'] = $this->count; + + if (!$row['wasNull']) + { // needs writing a document + $docname = $this->getFileName($row['id'], $row['alias'], $prefix, $suffix); + $filename = $dirpath.$docname; + if (!is_file($filename)) + { + if($row['published']==='1') + { + $status = $this->makeFile($row['id'], $filename); + switch($status) + { + case 'failed_no_write' : $row['status'] = $msg_failed_no_write ; + case 'failed_no_retrieve': $row['status'] = $msg_failed_no_retrieve; + default: $row['status'] = $msg_success; + } + } + else $row['status'] = $msg_failed_no_retrieve; + } + else $row['status'] = $msg_success_skip_doc; + $this->output[] = $this->parsePlaceholder($_lang['export_site_exporting_document'], $row); + } + else + { + $row['status'] = $msg_success_skip_dir; + $this->output[] = $this->parsePlaceholder($_lang['export_site_exporting_document'], $row); + } + if ($row['isfolder']==='1' && ($modx->config['suffix_mode']!=='1' || strpos($row['alias'],'.')===false)) + { // needs making a folder + $end_dir = ($row['alias']!=='') ? $row['alias'] : $row['id']; + $dir_path = $dirpath . $end_dir; + if(strpos($dir_path,MODX_BASE_PATH)===false) return FALSE; + if (!is_dir($dir_path)) + { + if (is_file($dir_path)) @unlink($dir_path); + mkdir($dir_path); + @chmod($dir_path, $folder_permission); + + } + + + if($modx->config['make_folders']==='1' && $row['published']==='1') + { + if(is_file($filename)) rename($filename,$dir_path . '/index.html'); + } + $this->targetDir = $dir_path; + $this->run($row['id']); + } + } + return join("\n", $this->output); + } + + function curl_get_contents($url, $timeout = 30 ) + { + if(!function_exists('curl_init')) return @file_get_contents($url); + + $ch = curl_init(); + curl_setopt($ch, CURLOPT_URL, $url); + curl_setopt($ch, CURLOPT_HEADER, false); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true ); + curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); + $result = curl_exec($ch); + curl_close($ch); + return $result; + } + + function parsePlaceholder($tpl,$ph=array()) + { + foreach($ph as $k=>$v) + { + $k = "[+{$k}+]"; + $tpl = str_replace($k,$v,$tpl); + } + return $tpl; + } +} diff --git a/manager/includes/lang/english.inc.php b/manager/includes/lang/english.inc.php index 49ab485248..a7a538c645 100755 --- a/manager/includes/lang/english.inc.php +++ b/manager/includes/lang/english.inc.php @@ -278,7 +278,7 @@ $_lang["expand_tree"] = 'Expand Site Tree'; $_lang["export_site"] = 'Export Static HTML'; $_lang["export_site_cacheable"] = 'Include non-cacheable files:'; -$_lang["export_site_exporting_document"] = 'Exporting file %s of %s
          %s, id %s
          '; +$_lang["export_site_exporting_document"] = '[+status+] ([+count+]) index.php?id=[+id+] - [+pagetitle+]
    '; $_lang["export_site_failed"] = 'Failed!'; $_lang["export_site_failed_no_open"] = 'Cannot open file: '; $_lang["export_site_failed_no_retrieve"] = 'Cannot retrieve document.'; @@ -1202,3 +1202,12 @@ $_lang["user_street"] = 'Street'; $_lang["user_city"] = 'City'; $_lang["user_other"] = 'Other'; + +$_lang["a83_ignore_ids_title"] = 'Ignore IDs(comma separate)'; +$_lang["export_site.static.php1"] = 'Target'; +$_lang["export_site.static.php2"] = 'Only edited resources'; +$_lang["export_site.static.php3"] = 'All resources'; +$_lang["export_site.static.php4"] = 'Replace string (before)'; +$_lang["export_site.static.php5"] = 'Replace string (after)'; +$_lang["export_site.static.php6"] = 'Target'; +$_lang["export_site.static.php7"] = 'Files cannot be outputted to [+rb_base_url+]'; diff --git a/manager/processors/export_site.processor.php b/manager/processors/export_site.processor.php new file mode 100644 index 0000000000..62c8bfae99 --- /dev/null +++ b/manager/processors/export_site.processor.php @@ -0,0 +1,58 @@ +hasPermission('export_static')) +{ + $e->setError(3); + $e->dumpError(); +} + +$maxtime = (is_numeric($_POST['maxtime'])) ? $_POST['maxtime'] : 30; +@set_time_limit($maxtime); + +$modx->loadExtension('EXPORT_SITE'); + + +if(is_dir(MODX_BASE_PATH . 'temp')) $export_dir = MODX_BASE_PATH . 'temp/export'; +elseif(is_dir(MODX_BASE_PATH . 'assets')) $export_dir = MODX_BASE_PATH . 'assets/export'; +$modx->export->targetDir = $export_dir; + +if(strpos($modx->config['base_path'],"{$export_dir}/")===0 && 0 <= strlen(str_replace("{$export_dir}/",'',$modx->config['base_path']))) + return $_lang['export_site.static.php6']; +elseif($modx->config['rb_base_dir'] === $export_dir . '/') + return $modx->parsePlaceholder($_lang['export_site.static.php7'],'rb_base_url=' . $modx->config['base_url'] . $modx->config['rb_base_url']); +elseif(!is_writable($export_dir)) + return $_lang['export_site_target_unwritable']; + +$modx->export->generate_mode = $_POST['generate_mode']; + +$modx->export->setExportDir($export_dir); +$modx->export->removeDirectoryAll($export_dir); + +$ignore_ids = $_POST['ignore_ids']; +$repl_before = $_POST['repl_before']; +$repl_after = $_POST['repl_after']; +$includenoncache = $_POST['includenoncache']; + +if($ignore_ids!==$_POST['ignore_ids'] + ||$includenoncache!==$_POST['includenoncache'] + ||$repl_before!==$_POST['repl_before'] + ||$repl_after !==$_POST['repl_after']) { + $modx->clearCache(); +} + +$total = $modx->export->getTotal($_POST['ignore_ids'], $modx->config['export_includenoncache']); + +$output = sprintf($_lang['export_site_numberdocs'], $total); +$modx->export->total = $total; + +$modx->export->repl_before = $_POST['repl_before']; +$modx->export->repl_after = $_POST['repl_after']; + +$output .= $modx->export->run(); + +$exportend = $modx->export->get_mtime(); +$totaltime = ($exportend - $modx->export->exportstart); +$output .= sprintf ('

    '.$_lang["export_site_time"].'

    ', round($totaltime, 3)); +return $output; + + From 987b5a14b4296e79dc70d38e9a4138f19855e69a Mon Sep 17 00:00:00 2001 From: yama Date: Mon, 26 Aug 2013 20:18:38 +0900 Subject: [PATCH 352/530] Backup manager - Fix result message box --- manager/actions/bkmanager.static.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/manager/actions/bkmanager.static.php b/manager/actions/bkmanager.static.php index 0a907b3973..e7444ab43e 100644 --- a/manager/actions/bkmanager.static.php +++ b/manager/actions/bkmanager.static.php @@ -151,15 +151,21 @@ switch($_SESSION['result_msg']) { case 'import_ok': - $ph['result_msg'] = '
    ' . $_lang["bkmgr_import_ok"] . '
    '; + $ph['result_msg_import'] = '
    ' . $_lang["bkmgr_import_ok"] . '
    '; + $ph['result_msg_snapshot'] = '
    ' . $_lang["bkmgr_import_ok"] . '
    '; break; case 'snapshot_ok': - $ph['result_msg'] = '
    ' . $_lang["bkmgr_snapshot_ok"] . '
    '; + $ph['result_msg_import'] = ''; + $ph['result_msg_snapshot'] = '
    ' . $_lang["bkmgr_snapshot_ok"] . '
    '; break; } $_SESSION['result_msg'] = ''; } -else $ph['result_msg'] = ''; +else +{ + $ph['result_msg_import'] = ''; + $ph['result_msg_snapshot'] = ''; +} ?> @@ -283,7 +289,7 @@ function backup(){

    - +
    @@ -379,7 +385,7 @@ function checked($cond)

    - + "snapshot_path={$modx->config['snapshot_path']}"));?> From d7c45b4d552ca71b4fc2c9718081e2f64abd09fd Mon Sep 17 00:00:00 2001 From: yama Date: Mon, 26 Aug 2013 20:45:05 +0900 Subject: [PATCH 353/530] Fix - Export function --- manager/includes/extenders/export.class.inc.php | 12 +++++++++++- manager/includes/lang/english.inc.php | 2 +- manager/processors/export_site.processor.php | 10 +++++++++- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/manager/includes/extenders/export.class.inc.php b/manager/includes/extenders/export.class.inc.php index 72c7b64d12..319171036e 100644 --- a/manager/includes/extenders/export.class.inc.php +++ b/manager/includes/extenders/export.class.inc.php @@ -48,7 +48,7 @@ function setUrlMode() { $modx->config['friendly_urls'] = 1; $modx->config['use_alias_path'] = 1; - $modx->clearCache(); + $this->clearCache(); } $modx->config['make_folders'] = '1'; } @@ -193,6 +193,7 @@ function run($parent=0) $this->count++; $row['count'] = $this->count; + $row['url'] = $modx->makeUrl($row['id']); if (!$row['wasNull']) { // needs writing a document @@ -268,4 +269,13 @@ function parsePlaceholder($tpl,$ph=array()) } return $tpl; } + + function clearCache() + { + include_once(MODX_BASE_PATH . 'manager/processors/cache_sync.class.processor.php'); + $sync = new synccache(); + $sync->setCachepath(MODX_BASE_PATH . 'assets/cache/'); + $sync->setReport(false); + $sync->emptyCache(); + } } diff --git a/manager/includes/lang/english.inc.php b/manager/includes/lang/english.inc.php index a7a538c645..6860051a0d 100755 --- a/manager/includes/lang/english.inc.php +++ b/manager/includes/lang/english.inc.php @@ -278,7 +278,7 @@ $_lang["expand_tree"] = 'Expand Site Tree'; $_lang["export_site"] = 'Export Static HTML'; $_lang["export_site_cacheable"] = 'Include non-cacheable files:'; -$_lang["export_site_exporting_document"] = '[+status+] ([+count+]) index.php?id=[+id+] - [+pagetitle+]
    '; +$_lang["export_site_exporting_document"] = '[+status+] [+url+] - [+pagetitle+] ([+id+])
    '; $_lang["export_site_failed"] = 'Failed!'; $_lang["export_site_failed_no_open"] = 'Cannot open file: '; $_lang["export_site_failed_no_retrieve"] = 'Cannot retrieve document.'; diff --git a/manager/processors/export_site.processor.php b/manager/processors/export_site.processor.php index 62c8bfae99..0cf1722c03 100644 --- a/manager/processors/export_site.processor.php +++ b/manager/processors/export_site.processor.php @@ -37,7 +37,7 @@ ||$includenoncache!==$_POST['includenoncache'] ||$repl_before!==$_POST['repl_before'] ||$repl_after !==$_POST['repl_after']) { - $modx->clearCache(); + clearCache(); } $total = $modx->export->getTotal($_POST['ignore_ids'], $modx->config['export_includenoncache']); @@ -56,3 +56,11 @@ return $output; +function clearCache() +{ + include_once(MODX_BASE_PATH . 'manager/processors/cache_sync.class.processor.php'); + $sync = new synccache(); + $sync->setCachepath(MODX_BASE_PATH . 'assets/cache/'); + $sync->setReport(false); + $sync->emptyCache(); +} From 653f00fe63c5fdd17a84dd70a06d2a67fd3053ec Mon Sep 17 00:00:00 2001 From: yama Date: Mon, 26 Aug 2013 20:47:17 +0900 Subject: [PATCH 354/530] Refactor #10127 Rewrite Import HTML site function http://tracker.modx.com/issues/10127 --- manager/actions/import_site.static.php | 538 ++++++++++++++++++------- manager/includes/lang/english.inc.php | 6 + 2 files changed, 408 insertions(+), 136 deletions(-) diff --git a/manager/actions/import_site.static.php b/manager/actions/import_site.static.php index 0df088c681..01d584c771 100644 --- a/manager/actions/import_site.static.php +++ b/manager/actions/import_site.static.php @@ -1,13 +1,13 @@ INCLUDE_ORDERING_ERROR

    Please use the MODx Content Manager instead of accessing this file directly."); -if(!$modx->hasPermission('import_static')) { +if(!$modx->hasPermission('import_static')) +{ $e->setError(3); $e->dumpError(); } // Files to upload $allowedfiles = array('html','htm','shtml','xml'); - ?>

    + +
    + +
    +
    ".$_lang['import_site_message']."

    "; ?> -
    +
    @@ -43,165 +50,424 @@ function reloadTree() { 0 () - +  
    - + + + + + +   + +
    + + + + + +   + + + +
    -
    0) { - importFiles($parent,$filepath,$files); - } - - $mtime = microtime(); $mtime = explode(" ",$mtime); $mtime = $mtime[1] + $mtime[0]; $importend = $mtime; - $totaltime = ($importend - $importstart); - printf ("

    ".$_lang['import_site_time']."

    ", round($totaltime, 3)); +} +else +{ + run(); + clearCache(); ?> +
    +
    -function importFiles($parent,$filepath,$files) { +getFullTableName('site_content'); + $modx->db->delete('[+prefix+]site_content'); + $modx->db->query("ALTER TABLE {$tbl_site_content} AUTO_INCREMENT = 1"); + } + + $parent = intval($_POST['parent']); + + if(is_dir(MODX_BASE_PATH . 'temp/import')) $filedir = MODX_BASE_PATH . 'temp/import/'; + elseif(is_dir(MODX_BASE_PATH . 'assets/import')) $filedir = MODX_BASE_PATH . 'assets/import/'; + + $filesfound = 0; + + $files = getFiles($filedir); + $files = pop_index($files); + + // no. of files to import + $output .= sprintf('

    ' . $_lang['import_files_found'] . '

    ', $filesfound); + + // import files + if(0 < count($files)) + { + $rs = $modx->db->update(array('isfolder'=>1),'[+prefix+]site_content',"id={$parent}"); + importFiles($parent,$filedir,$files,'root'); + } + + $mtime = microtime(); $mtime = explode(' ', $mtime); $mtime = $mtime[1] + $mtime[0]; + $importend = $mtime; + $totaltime = ($importend - $importstart); + $output .= sprintf ('

    '.$_lang['import_site_time'].'

    ', round($totaltime, 3)); + + if($_POST['convert_link']=='on') convertLink(); + + return $output; +} +function importFiles($parent,$filedir,$files,$mode) { global $modx; global $_lang, $allowedfiles; - global $dbase, $table_prefix; - global $default_template, $search_default, $cache_default, $publish_default; - - + global $search_default, $cache_default, $publish_default; + $createdon = time(); $createdby = $modx->getLoginUserID(); if (!is_array($files)) return; - foreach($files as $id => $value){ - if(is_array($value)) { - // create folder - $alias = !isset($modx->documentListing[$id]) ? $id:$id.'-'.substr(uniqid(''),-3); - $modx->documentListing[$alias] = true; - printf("

    ".$_lang['import_site_importing_document']."

    ", $id); - $sql = "INSERT INTO $dbase.`".$table_prefix."site_content` - (type, contentType, pagetitle, alias, published, parent, isfolder, content, template, menuindex, searchable, cacheable, createdby, createdon) VALUES - ('document', 'text/html', '".$modx->db->escape($id)."', '".$modx->stripAlias($alias)."', ".$publish_default.", '$parent', 1, '', '".$default_template."', 0, ".$search_default.", ".$cache_default.", $createdby, $createdon);"; - $rs = $modx->db->query($sql); - $new_parent = $modx->db->getInsertId(); - - echo "

    ".$_lang["import_site_success"]."

    "; - importFiles($new_parent,$filepath."/$id/",$value); - } - else { - // create dcoument - $filename = $value; - $fparts = explode(".",$value); - $value = $fparts[0]; - $ext = (count($fparts)>1)? $fparts[count($fparts)-1]:""; - printf("

    ".$_lang['import_site_importing_document']."

    ", $filename); - $alias = !isset($modx->documentListing[$value]) ? $value:$value.'-'.substr(uniqid(''),-3); - $modx->documentListing[$alias] = true; - if(!in_array($ext,$allowedfiles)) echo "

    ".$_lang["import_site_skip"]."

    "; - else { - $file = getFileContent("$filepath/$filename"); - if (preg_match("/(.*)<\/title>/i",$file,$matches)) { - $pagetitle = $matches[1]; - } else $pagetitle = $value; - if(!$pagetitle) $pagetitle = $value; - if (preg_match("/<body[^>]*>(.*)[^<]+<\/body>/is",$file,$matches)) { - $content = $matches[1]; - - } else $content = $file; - $sql = "INSERT INTO $dbase.`".$table_prefix."site_content` - (type, contentType, pagetitle, alias, published, parent, isfolder, content, template, menuindex, searchable, cacheable, createdby, createdon) VALUES - ('document', 'text/html', '".$modx->db->escape($pagetitle)."', '".$modx->stripAlias($alias)."', ".$publish_default.", '$parent', 0, '".$modx->db->escape($content)."', '".$default_template."', 0, ".$search_default.", ".$cache_default.", $createdby, $createdon);"; - $rs = $modx->db->query($sql); - if(!$rs) { - echo "<p><span class=\"fail\">".$_lang["import_site_failed"]."</span> ".$_lang["import_site_failed_db_error"].$modx->db->getLastError()."</p>"; - exit; - } - echo "<p class=\"success\">".$_lang["import_site_success"]."</p>"; - } - } - } + if ($_POST['object']=='all') + { + $modx->config['default_template'] = '0'; + $richtext = '0'; + } + else + { + $richtext = '1'; + } + + foreach($files as $id => $value) + { + if(is_array($value)) + { + // create folder + $alias = $id; + printf('<span>'.$_lang['import_site_importing_document'].'</span>', $alias); + $field = array(); + $field['type'] = 'document'; + $field['contentType'] = 'text/html'; + $field['published'] = $publish_default; + $field['parent'] = $parent; + $field['alias'] = $modx->stripAlias($alias); + $field['richtext'] = $richtext; + $field['template'] = $modx->config['default_template']; + $field['searchable'] = $search_default; + $field['cacheable'] = $cache_default; + $field['createdby'] = $createdby; + $field['isfolder'] = 1; + $field['menuindex'] = 1; + $find = false; + foreach(array('index.html','index.htm') as $filename) + { + $filepath = $filedir . $alias . '/' . $filename; + if($find===false && file_exists($filepath)) + { + $file = getFileContent($filepath); + list($pagetitle,$content,$description) = treatContent($file,$filename,$alias); + + $date = filemtime($filepath); + $field['pagetitle'] = $pagetitle; + $field['longtitle'] = $pagetitle; + $field['description'] = $description; + $field['content'] = $modx->db->escape($content); + $field['createdon'] = $date; + $field['editedon'] = $date; + $newid = $modx->db->insert($field,'[+prefix+]site_content'); + if($newid) + { + $find = true; + echo ' - <span class="success">'.$_lang['import_site_success'] . '</span><br />' . "\n"; + importFiles($newid, $filedir . $alias . '/',$value,'sub'); + } + else + { + echo '<span class="fail">'.$_lang["import_site_failed"]."</span> " + .$_lang["import_site_failed_db_error"].$modx->db->getLastError(); + exit; + } + } + } + if($find===false) + { + $date = time(); + $field['pagetitle'] = '---'; + $field['content'] = ''; + $field['createdon'] = $date; + $field['editedon'] = $date; + $field['hidemenu'] = '1'; + $newid = $modx->db->insert($field,'[+prefix+]site_content'); + if($newid) + { + $find = true; + echo ' - <span class="success">'.$_lang['import_site_success'] . '</span><br />' . "\n"; + importFiles($newid, $filedir . $alias . '/',$value,'sub'); + } + else + { + echo '<span class="fail">'.$_lang["import_site_failed"]."</span> " + .$_lang["import_site_failed_db_error"].$modx->db->getLastError(); + exit; + } + } + } + else + { + // create document + if($mode=='sub' && $value == 'index.html') continue; + $filename = $value; + $fparts = explode('.',$value); + $alias = $fparts[0]; + $ext = (count($fparts)>1)? $fparts[count($fparts)-1]:""; + printf("<span>".$_lang['import_site_importing_document']."</span>", $filename); + + if(!in_array($ext,$allowedfiles)) echo ' - <span class="fail">'.$_lang["import_site_skip"].'</span><br />' . "\n"; + else + { + $filepath = $filedir . $filename; + $file = getFileContent($filepath); + list($pagetitle,$content,$description) = treatContent($file,$filename,$alias); + + $date = filemtime($filepath); + $field = array(); + $field['type'] = 'document'; + $field['contentType'] = 'text/html'; + $field['pagetitle'] = $pagetitle; + $field['longtitle'] = $pagetitle; + $field['description'] = $description; + $field['alias'] = $modx->stripAlias($alias); + $field['published'] = $publish_default; + $field['parent'] = $parent; + $field['content'] = $modx->db->escape($content); + $field['richtext'] = $richtext; + $field['template'] = $modx->config['default_template']; + $field['searchable'] = $search_default; + $field['cacheable'] = $cache_default; + $field['createdby'] = $createdby; + $field['createdon'] = $date; + $field['editedon'] = $date; + $field['isfolder'] = 0; + $field['menuindex'] = ($alias=='index') ? 0 : 2; + $newid = $modx->db->insert($field,'[+prefix+]site_content'); + if($newid) + { + echo ' - <span class="success">'.$_lang['import_site_success'] . '</span><br />' . "\n"; + } + else + { + echo '<span class="fail">'.$_lang["import_site_failed"]."</span> " + .$_lang["import_site_failed_db_error"].$modx->db->getLastError(); + exit; + } + + $is_site_start = false; + if($filename == 'index.html') $is_site_start = true; + if($is_site_start==true && $_POST['reset']=='on') + { + $modx->db->update("setting_value={$newid}",'[+prefix+]system_settings',"setting_name='site_start'"); + $modx->db->update('menuindex=0','[+prefix+]site_content',"id='{$newid}'"); + } + } + } + } } -function getFiles($directory,$listing = array(), $count = 0){ - global $_lang; - global $filesfound; - $dummy = $count; - if (@$handle = opendir($directory)) { - while ($file = readdir($handle)) { - if ($file=='.' || $file=='..') continue; - else if ($h = @opendir($directory.$file."/")) { - closedir($h); - $count = -1; - $listing["$file"] = getFiles($directory.$file."/",array(), $count + 1); - } - else { - $listing[$dummy] = $file; - $dummy = $dummy + 1; - $filesfound++; - } - } - } - else { - echo "<p><span class=\"fail\">".$_lang["import_site_failed"]."</span> ".$_lang["import_site_failed_no_open_dir"].$directory.".</p>"; - } - @closedir($handle); - return ($listing); +function getFiles($directory,$listing = array(), $count = 0) +{ + global $_lang; + global $filesfound; + $dummy = $count; + if ($files = scandir($directory)) + { + foreach($files as $file) + { + if ($file=='.' || $file=='..') continue; + elseif ($h = @opendir($directory.$file."/")) + { + closedir($h); + $count = -1; + $listing[$file] = getFiles($directory.$file."/",array(), $count + 1); + } + elseif(strpos($file,'.htm')!==false) + { + $listing[$dummy] = $file; + $dummy = $dummy + 1; + $filesfound++; + } + } + } + else + { + echo '<p><span class="fail">'.$_lang["import_site_failed"]."</span> " + .$_lang["import_site_failed_no_open_dir"].$directory.".</p>"; + } + return ($listing); } -function getFileContent($file) { - global $_lang; - // get the file - if(@$handle = fopen($file, "r")) { - $buffer = ""; - while (!feof ($handle)) { - $buffer .= fgets($handle, 4096); - } - fclose ($handle); - } - else { - echo "<p><span class=\"fail\">".$_lang['import_site_failed']."</span> ".$_lang["import_site_failed_no_retrieve_file"].$file.".</p>"; - } - return $buffer; +function getFileContent($filepath) +{ + global $_lang; + // get the file + if(!$buffer=file_get_contents($filepath)) + { + echo '<p><span class="fail">' . $_lang['import_site_failed']."</span> " + .$_lang["import_site_failed_no_retrieve_file"].$filepath.".</p>"; + } + else return $buffer; +} + +function pop_index($array) +{ + $new_array = array(); + foreach($array as $k=>$v) + { + if($v!=='index.html' && $v!=='index.htm') + { + $new_array[$k] = $v; + } + else + { + array_unshift($new_array, $v); + } + } + foreach($array as $k=>$v) + { + if(is_array($v)) + { + $new_array[$k] = $v; + } + } + return $new_array; } -/** - * @deprecated Use $modx->stripAlias() - */ -function stripAlias($alias) { - return $GLOBALS['modx']->stripAlias($alias); +function treatContent($src,$filename,$alias) +{ + global $modx; + + $src = mb_convert_encoding($src, $modx->config['modx_charset'], 'UTF-8,SJIS-win,eucJP-win,SJIS,EUC-JP,ASCII'); + + if (preg_match("@<title>(.*)@i",$src,$matches)) + { + $pagetitle = ($matches[1]!=='') ? $matches[1] : $filename; + $pagetitle = str_replace('[*pagetitle*]','',$pagetitle); + } + else $pagetitle = $alias; + if(!$pagetitle) $pagetitle = $alias; + + if (preg_match('@]+"description"[^>]+content=[\'"](.*)[\'"].+>@i',$src,$matches)) + { + $description = ($matches[1]!=='') ? $matches[1] : $filename; + $description = str_replace('[*description*]','',$description); + } + else $description = ''; + + if ((preg_match("@]*>(.*)[^<]+@is",$src,$matches)) && $_POST['object']=='body') + { + $content = $matches[1]; + } + else + { + $content = $src; + $s = '/(]+charset\s*=)[^>"\'=]+(.+>)/i'; + $r = '$1' . $modx->config['modx_charset'] . '$2'; + $content = preg_replace($s, $r, $content); + $content = preg_replace('@.*@i', "[*pagetitle*]", $content); + } + $content = str_replace('[*content*]','[ *content* ]',$content); + $content = trim($content); + $pagetitle = $modx->db->escape($pagetitle); + return array($pagetitle,$content,$description); +} + +function convertLink() +{ + global $modx; + + $rs = $modx->db->select('id,content','[+prefix+]site_content'); + while($row=$modx->db->getRow($rs)) + { + $id = $row['id']; + $array = explode('config['site_url'])!==false) + { + $_ = $modx->config['base_url'] . str_replace($modx->config['site_url'],'',$_); + } + if($_[0]==='/') $_ = substr($_,1); + $_ = str_replace('/index.html','.html',$_); + $level = substr_count($_,'../'); + if(1<$level) + { + if(!isset($p[$id])) $p[$id] = $modx->getParentIds($id); + $k = array_keys($p[$id]); + while(0<$level) + { + $dir = array_shift($k); + $level--; + } + if($dir!='') $dir .= '/'; + } + else $dir = ''; + + $_ = trim($_,'./'); + if(strpos($_,'/')!==false) $_ = substr($_,strrpos($_,'/')); + $_ = $dir . str_replace('.html','',$_); + if(!isset($target[$_])) $target[$_] = $modx->getIdFromAlias($_); + $target[$_] = trim($target[$_]); + if(!empty($target[$_])) $href = '[~' . $target[$_] . '~]'; + $array[$c] = 'db->escape($content); + $modx->db->update($f,'[+prefix+]site_content',"id='{$id}'"); + } +} +function clearCache() +{ + include_once(MODX_BASE_PATH . 'manager/processors/cache_sync.class.processor.php'); + $sync = new synccache(); + $sync->setCachepath(MODX_BASE_PATH . 'assets/cache/'); + $sync->setReport(false); + $sync->emptyCache(); } -?> \ No newline at end of file diff --git a/manager/includes/lang/english.inc.php b/manager/includes/lang/english.inc.php index 6860051a0d..5c10213c92 100755 --- a/manager/includes/lang/english.inc.php +++ b/manager/includes/lang/english.inc.php @@ -1203,6 +1203,12 @@ $_lang["user_city"] = 'City'; $_lang["user_other"] = 'Other'; +$_lang["import_site.static.php1"] = 'Reset resource tree'; +$_lang["import_site.static.php2"] = 'Reset resource tree, all IDs are initialize.'; +$_lang["import_site.static.php3"] = 'Target'; +$_lang["import_site.static.php4"] = '<body></body> only'; +$_lang["import_site.static.php5"] = 'File contain all'; + $_lang["a83_ignore_ids_title"] = 'Ignore IDs(comma separate)'; $_lang["export_site.static.php1"] = 'Target'; $_lang["export_site.static.php2"] = 'Only edited resources'; From f18b7caaa0f1140e173701c3e0f5f21456ad2440 Mon Sep 17 00:00:00 2001 From: yama Date: Mon, 26 Aug 2013 23:21:51 +0900 Subject: [PATCH 355/530] Fix phpThumb path issue --- assets/snippets/phpthumb/snippet.phpthumb.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/assets/snippets/phpthumb/snippet.phpthumb.php b/assets/snippets/phpthumb/snippet.phpthumb.php index e1042c8486..fde3d0c340 100644 --- a/assets/snippets/phpthumb/snippet.phpthumb.php +++ b/assets/snippets/phpthumb/snippet.phpthumb.php @@ -5,15 +5,13 @@ $base="assets/cache/images"; // тут можно менять путь -if(!defined('MODX_BASE_PATH')){die('What are you doing? Get out of here!');} - -if($input == '' || !file_exists($_SERVER['DOCUMENT_ROOT']."/".$input)){ +if($input === '' || !file_exists(MODX_BASE_PATH . $input)){ $input = 'assets/snippets/phpthumb/noimage.png'; } $options = 'f=jpg&q=96&'.strtr($options, Array("," => "&", "_" => "=")); $path_parts=pathinfo($input); - require_once MODX_BASE_PATH."/assets/snippets/phpthumb/phpthumb.class.php"; + require_once MODX_BASE_PATH.'assets/snippets/phpthumb/phpthumb.class.php'; $phpThumb = new phpthumb(); $phpThumb->setSourceFilename($input); @@ -24,7 +22,7 @@ $op[$thumb[0]]=$thumb[1]; } - $tmp=str_replace($_SERVER['DOCUMENT_ROOT']."assets/images","",$path_parts['dirname']); + $tmp=str_replace(MODX_BASE_PATH . "assets/images","",$path_parts['dirname']); $tmp=str_replace("assets/images","",$tmp); $tmp=explode("/",$tmp); $folder=$base; @@ -39,5 +37,4 @@ $outputFilename =MODX_BASE_PATH.$fname; if (!file_exists($outputFilename)) if ($phpThumb->GenerateThumbnail()) $phpThumb->RenderToFile($outputFilename) ; return $fname; - ?> \ No newline at end of file From d45bee8cf30f483c87f54daea657d12e9dbb6c02 Mon Sep 17 00:00:00 2001 From: Dmi3yy Date: Mon, 26 Aug 2013 18:10:26 +0300 Subject: [PATCH 356/530] update phpthumb class --- assets/snippets/phpthumb/phpthumb.class.php | 7568 ++++++++++--------- 1 file changed, 3888 insertions(+), 3680 deletions(-) diff --git a/assets/snippets/phpthumb/phpthumb.class.php b/assets/snippets/phpthumb/phpthumb.class.php index 4feb673856..a6dd3342de 100644 --- a/assets/snippets/phpthumb/phpthumb.class.php +++ b/assets/snippets/phpthumb/phpthumb.class.php @@ -10,16 +10,16 @@ ob_start(); if (!include_once(dirname(__FILE__).'/phpthumb.functions.php')) { - ob_end_flush(); - die('failed to include_once("'.realpath(dirname(__FILE__).'/phpthumb.functions.php').'")'); + ob_end_flush(); + die('failed to include_once("'.realpath(dirname(__FILE__).'/phpthumb.functions.php').'")'); } ob_end_clean(); class phpthumb { - // public: - // START PARAMETERS (for object mode and phpThumb.php) - // See phpthumb.readme.txt for descriptions of what each of these values are + // public: + // START PARAMETERS (for object mode and phpThumb.php) + // See phpthumb.readme.txt for descriptions of what each of these values are public $src = null; // SouRCe filename public $new = null; // NEW image (phpThumb.php only) public $w = null; // Width @@ -58,14 +58,14 @@ class phpthumb { public $file = null; // >>>deprecated, DO NOT USE, will be removed in future versions<<< public $phpThumbDebug = null; - // END PARAMETERS + // END PARAMETERS - // public: - // START CONFIGURATION OPTIONS (for object mode only) - // See phpThumb.config.php for descriptions of what each of these settings do + // public: + // START CONFIGURATION OPTIONS (for object mode only) + // See phpThumb.config.php for descriptions of what each of these settings do - // * Directory Configuration + // * Directory Configuration public $config_cache_directory = null; public $config_cache_directory_depth = 0; public $config_cache_disable_warning = true; @@ -74,13 +74,13 @@ class phpthumb { public $config_temp_directory = null; public $config_document_root = null; - // * Default output configuration: + // * Default output configuration: public $config_output_format = 'jpeg'; public $config_output_maxwidth = 0; public $config_output_maxheight = 0; public $config_output_interlace = true; - // * Error message configuration + // * Error message configuration public $config_error_image_width = 400; public $config_error_image_height = 100; public $config_error_message_image_default = ''; @@ -91,12 +91,12 @@ class phpthumb { public $config_error_silent_die_on_error = false; public $config_error_die_on_source_failure = true; - // * Anti-Hotlink Configuration: + // * Anti-Hotlink Configuration: public $config_nohotlink_enabled = true; public $config_nohotlink_valid_domains = array(); public $config_nohotlink_erase_image = true; public $config_nohotlink_text_message = 'Off-server thumbnailing is not allowed'; - // * Off-server Linking Configuration: + // * Off-server Linking Configuration: public $config_nooffsitelink_enabled = false; public $config_nooffsitelink_valid_domains = array(); public $config_nooffsitelink_require_refer = false; @@ -104,11 +104,11 @@ class phpthumb { public $config_nooffsitelink_watermark_src = ''; public $config_nooffsitelink_text_message = 'Off-server linking is not allowed'; - // * Border & Background default colors + // * Border & Background default colors public $config_border_hexcolor = '000000'; public $config_background_hexcolor = 'FFFFFF'; - // * TrueType Fonts + // * TrueType Fonts public $config_ttf_directory = './fonts'; public $config_max_source_pixels = null; @@ -128,14 +128,14 @@ class phpthumb { public $config_cache_force_passthru = true; public $config_cache_prefix = ''; // default value set in the constructor below - // * MySQL + // * MySQL public $config_mysql_query = null; public $config_mysql_hostname = null; public $config_mysql_username = null; public $config_mysql_password = null; public $config_mysql_database = null; - // * Security + // * Security public $config_high_security_enabled = false; public $config_high_security_password = null; public $config_disable_debug = false; @@ -144,27 +144,27 @@ class phpthumb { public $config_allow_parameter_file = false; public $config_allow_parameter_goto = false; - // * HTTP fopen + // * HTTP fopen public $config_http_fopen_timeout = 10; public $config_http_follow_redirect = true; - // * Compatability + // * Compatability public $config_disable_pathinfo_parsing = false; public $config_disable_imagecopyresampled = false; public $config_disable_onlycreateable_passthru = false; public $config_http_user_agent = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7'; - // END CONFIGURATION OPTIONS + // END CONFIGURATION OPTIONS - // public: error messages (read-only; persistant) + // public: error messages (read-only; persistant) public $debugmessages = array(); public $debugtiming = array(); public $fatalerror = null; - // private: (should not be modified directly) + // private: (should not be modified directly) public $thumbnailQuality = 75; public $thumbnailFormat = null; @@ -199,172 +199,193 @@ class phpthumb { public $thumbnail_image_width = null; public $thumbnail_image_height = null; - public $cache_filename = null; + public $tempFilesToDelete = array(); + public $cache_filename = null; public $AlphaCapableFormats = array('png', 'ico', 'gif'); public $is_alpha = false; - public $iswindows = null; - - public $phpthumb_version = '1.7.9-200712090829'; - - ////////////////////////////////////////////////////////////////////// - - // public: constructor - function __construct() { - $this->DebugTimingMessage('phpThumb() constructor', __FILE__, __LINE__); - $this->DebugMessage('phpThumb() v'.$this->phpthumb_version, __FILE__, __LINE__); - $this->config_max_source_pixels = round(max(intval(ini_get('memory_limit')), intval(get_cfg_var('memory_limit'))) * 1048576 * 0.20); // 20% of memory_limit - $this->iswindows = (bool) (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN'); - $this->config_document_root = (@$_SERVER['DOCUMENT_ROOT'] ? $_SERVER['DOCUMENT_ROOT'] : $this->config_document_root); - $this->config_cache_prefix = 'phpThumb_cache_'.@$_SERVER['SERVER_NAME']; - - $php_sapi_name = strtolower(function_exists('php_sapi_name') ? php_sapi_name() : ''); - if ($php_sapi_name == 'cli') { - $this->config_allow_src_above_docroot = true; - } - } - - // public: - function setSourceFilename($sourceFilename) { - //$this->resetObject(); - //$this->rawImageData = null; - $this->sourceFilename = $sourceFilename; - $this->src = $sourceFilename; - if (is_null($this->config_output_format)) { - $sourceFileExtension = strtolower(substr(strrchr($sourceFilename, '.'), 1)); - if (preg_match('/^[a-z]{3,4}$/', $sourceFileExtension)) { - $this->config_output_format = $sourceFileExtension; - $this->DebugMessage('setSourceFilename('.$sourceFilename.') set $this->config_output_format to "'.$sourceFileExtension.'"', __FILE__, __LINE__); - } else { - $this->DebugMessage('setSourceFilename('.$sourceFilename.') did NOT set $this->config_output_format to "'.$sourceFileExtension.'" because it did not seem like an appropriate image format', __FILE__, __LINE__); - } - } - $this->DebugMessage('setSourceFilename('.$sourceFilename.') set $this->sourceFilename to "'.$this->sourceFilename.'"', __FILE__, __LINE__); - return true; - } - - // public: - function setSourceData($rawImageData, $sourceFilename='') { - //$this->resetObject(); - //$this->sourceFilename = null; - $this->rawImageData = $rawImageData; - $this->DebugMessage('setSourceData() setting $this->rawImageData ('.strlen($this->rawImageData).' bytes; magic="'.substr($this->rawImageData, 0, 4).'" ('.phpthumb_functions::HexCharDisplay(substr($this->rawImageData, 0, 4)).'))', __FILE__, __LINE__); - if ($this->config_cache_source_enabled) { - $sourceFilename = ($sourceFilename ? $sourceFilename : md5($rawImageData)); - if (!is_dir($this->config_cache_source_directory)) { - $this->ErrorImage('$this->config_cache_source_directory ('.$this->config_cache_source_directory.') is not a directory'); - } elseif (!@is_writable($this->config_cache_source_directory)) { - $this->ErrorImage('$this->config_cache_source_directory ('.$this->config_cache_source_directory.') is not writable'); - } - $this->DebugMessage('setSourceData() attempting to save source image to "'.$this->config_cache_source_directory.DIRECTORY_SEPARATOR.urlencode($sourceFilename).'"', __FILE__, __LINE__); - if ($fp = @fopen($this->config_cache_source_directory.DIRECTORY_SEPARATOR.urlencode($sourceFilename), 'wb')) { - fwrite($fp, $rawImageData); - fclose($fp); - } elseif (!$this->phpThumbDebug) { - $this->ErrorImage('setSourceData() failed to write to source cache ('.$this->config_cache_source_directory.DIRECTORY_SEPARATOR.urlencode($sourceFilename).')'); - } - } - return true; - } - - // public: - function setSourceImageResource($gdimg) { - //$this->resetObject(); - $this->gdimg_source = $gdimg; - return true; - } - - // public: - function setParameter($param, $value) { - if ($param == 'src') { - $this->setSourceFilename($this->ResolveFilenameToAbsolute($value)); - } elseif (@is_array($this->$param)) { - if (is_array($value)) { - foreach ($value as $arraykey => $arrayvalue) { - array_push($this->$param, $arrayvalue); - } - } else { - array_push($this->$param, $value); - } - } else { - $this->$param = $value; - } - return true; - } - - // public: - function getParameter($param) { - //if (property_exists('phpThumb', $param)) { - return $this->$param; - //} - //$this->DebugMessage('setParameter() attempting to get non-existant parameter "'.$param.'"', __FILE__, __LINE__); - //return false; - } - - - // public: - function GenerateThumbnail() { - - $this->setOutputFormat(); - $this->phpThumbDebug('8a'); - $this->ResolveSource(); - $this->phpThumbDebug('8b'); - $this->SetCacheFilename(); - $this->phpThumbDebug('8c'); - $this->ExtractEXIFgetImageSize(); - $this->phpThumbDebug('8d'); - if ($this->useRawIMoutput) { - $this->DebugMessage('Skipping rest of GenerateThumbnail() because ($this->useRawIMoutput == true)', __FILE__, __LINE__); - return true; - } - $this->phpThumbDebug('8e'); - if (!$this->SourceImageToGD()) { - $this->DebugMessage('SourceImageToGD() failed', __FILE__, __LINE__); - return false; - } - $this->phpThumbDebug('8f'); - $this->Rotate(); - $this->phpThumbDebug('8g'); - $this->CreateGDoutput(); - $this->phpThumbDebug('8h'); - - switch ($this->far) { - case 'L': - case 'TL': - case 'BL': - $destination_offset_x = 0; - $destination_offset_y = round(($this->thumbnail_height - $this->thumbnail_image_height) / 2); - break; - case 'R': - case 'TR': - case 'BR': - $destination_offset_x = round($this->thumbnail_width - $this->thumbnail_image_width); - $destination_offset_y = round(($this->thumbnail_height - $this->thumbnail_image_height) / 2); - break; - case 'T': - case 'TL': - case 'TR': - $destination_offset_x = round(($this->thumbnail_width - $this->thumbnail_image_width) / 2); - $destination_offset_y = 0; - break; - case 'B': - case 'BL': - case 'BR': - $destination_offset_x = round(($this->thumbnail_width - $this->thumbnail_image_width) / 2); - $destination_offset_y = round($this->thumbnail_height - $this->thumbnail_image_height); - break; - case 'C': - default: - $destination_offset_x = round(($this->thumbnail_width - $this->thumbnail_image_width) / 2); - $destination_offset_y = round(($this->thumbnail_height - $this->thumbnail_image_height) / 2); - } + public $iswindows = null; + public $issafemode = null; + + public $phpthumb_version = '1.7.11-201108081537'; + + ////////////////////////////////////////////////////////////////////// + + // public: constructor + function phpThumb() { + $this->DebugTimingMessage('phpThumb() constructor', __FILE__, __LINE__); + $this->DebugMessage('phpThumb() v'.$this->phpthumb_version, __FILE__, __LINE__); + $this->config_max_source_pixels = round(max(intval(ini_get('memory_limit')), intval(get_cfg_var('memory_limit'))) * 1048576 * 0.20); // 20% of memory_limit + $this->iswindows = (bool) (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN'); + $this->issafemode = (bool) preg_match('#(1|ON)#i', ini_get('safe_mode')); + $this->config_document_root = (!empty($_SERVER['DOCUMENT_ROOT']) ? $_SERVER['DOCUMENT_ROOT'] : $this->config_document_root); + $this->config_cache_prefix = ( isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'].'_' : ''); + + $this->purgeTempFiles(); // purge existing temp files if re-initializing object + + $php_sapi_name = strtolower(function_exists('php_sapi_name') ? php_sapi_name() : ''); + if ($php_sapi_name == 'cli') { + $this->config_allow_src_above_docroot = true; + } + } + + function __destruct() { + $this->purgeTempFiles(); + } + + // public: + function purgeTempFiles() { + foreach ($this->tempFilesToDelete as $tempFileToDelete) { + if (file_exists($tempFileToDelete)) { + $this->DebugMessage('Deleting temp file "'.$tempFileToDelete.'"', __FILE__, __LINE__); + @unlink($tempFileToDelete); + } + } + $this->tempFilesToDelete = array(); + return true; + } + + // public: + function setSourceFilename($sourceFilename) { + //$this->resetObject(); + //$this->rawImageData = null; + $this->sourceFilename = $sourceFilename; + $this->src = $sourceFilename; + if (is_null($this->config_output_format)) { + $sourceFileExtension = strtolower(substr(strrchr($sourceFilename, '.'), 1)); + if (preg_match('#^[a-z]{3,4}$#', $sourceFileExtension)) { + $this->config_output_format = $sourceFileExtension; + $this->DebugMessage('setSourceFilename('.$sourceFilename.') set $this->config_output_format to "'.$sourceFileExtension.'"', __FILE__, __LINE__); + } else { + $this->DebugMessage('setSourceFilename('.$sourceFilename.') did NOT set $this->config_output_format to "'.$sourceFileExtension.'" because it did not seem like an appropriate image format', __FILE__, __LINE__); + } + } + $this->DebugMessage('setSourceFilename('.$sourceFilename.') set $this->sourceFilename to "'.$this->sourceFilename.'"', __FILE__, __LINE__); + return true; + } + + // public: + function setSourceData($rawImageData, $sourceFilename='') { + //$this->resetObject(); + //$this->sourceFilename = null; + $this->rawImageData = $rawImageData; + $this->DebugMessage('setSourceData() setting $this->rawImageData ('.strlen($this->rawImageData).' bytes; magic="'.substr($this->rawImageData, 0, 4).'" ('.phpthumb_functions::HexCharDisplay(substr($this->rawImageData, 0, 4)).'))', __FILE__, __LINE__); + if ($this->config_cache_source_enabled) { + $sourceFilename = ($sourceFilename ? $sourceFilename : md5($rawImageData)); + if (!is_dir($this->config_cache_source_directory)) { + $this->ErrorImage('$this->config_cache_source_directory ('.$this->config_cache_source_directory.') is not a directory'); + } elseif (!@is_writable($this->config_cache_source_directory)) { + $this->ErrorImage('$this->config_cache_source_directory ('.$this->config_cache_source_directory.') is not writable'); + } + $this->DebugMessage('setSourceData() attempting to save source image to "'.$this->config_cache_source_directory.DIRECTORY_SEPARATOR.urlencode($sourceFilename).'"', __FILE__, __LINE__); + if ($fp = @fopen($this->config_cache_source_directory.DIRECTORY_SEPARATOR.urlencode($sourceFilename), 'wb')) { + fwrite($fp, $rawImageData); + fclose($fp); + } elseif (!$this->phpThumbDebug) { + $this->ErrorImage('setSourceData() failed to write to source cache ('.$this->config_cache_source_directory.DIRECTORY_SEPARATOR.urlencode($sourceFilename).')'); + } + } + return true; + } + + // public: + function setSourceImageResource($gdimg) { + //$this->resetObject(); + $this->gdimg_source = $gdimg; + return true; + } + + // public: + function setParameter($param, $value) { + if ($param == 'src') { + $this->setSourceFilename($this->ResolveFilenameToAbsolute($value)); + } elseif (@is_array($this->$param)) { + if (is_array($value)) { + foreach ($value as $arraykey => $arrayvalue) { + array_push($this->$param, $arrayvalue); + } + } else { + array_push($this->$param, $value); + } + } else { + $this->$param = $value; + } + return true; + } + + // public: + function getParameter($param) { + //if (property_exists('phpThumb', $param)) { + return $this->$param; + //} + //$this->DebugMessage('setParameter() attempting to get non-existant parameter "'.$param.'"', __FILE__, __LINE__); + //return false; + } + + + // public: + function GenerateThumbnail() { + + $this->setOutputFormat(); + $this->phpThumbDebug('8a'); + $this->ResolveSource(); + $this->phpThumbDebug('8b'); + $this->SetCacheFilename(); + $this->phpThumbDebug('8c'); + $this->ExtractEXIFgetImageSize(); + $this->phpThumbDebug('8d'); + if ($this->useRawIMoutput) { + $this->DebugMessage('Skipping rest of GenerateThumbnail() because ($this->useRawIMoutput == true)', __FILE__, __LINE__); + return true; + } + $this->phpThumbDebug('8e'); + if (!$this->SourceImageToGD()) { + $this->DebugMessage('SourceImageToGD() failed', __FILE__, __LINE__); + return false; + } + $this->phpThumbDebug('8f'); + $this->Rotate(); + $this->phpThumbDebug('8g'); + $this->CreateGDoutput(); + $this->phpThumbDebug('8h'); + + switch ($this->far) { + case 'L': + case 'TL': + case 'BL': + $destination_offset_x = 0; + $destination_offset_y = round(($this->thumbnail_height - $this->thumbnail_image_height) / 2); + break; + case 'R': + case 'TR': + case 'BR': + $destination_offset_x = round($this->thumbnail_width - $this->thumbnail_image_width); + $destination_offset_y = round(($this->thumbnail_height - $this->thumbnail_image_height) / 2); + break; + case 'T': + case 'TL': + case 'TR': + $destination_offset_x = round(($this->thumbnail_width - $this->thumbnail_image_width) / 2); + $destination_offset_y = 0; + break; + case 'B': + case 'BL': + case 'BR': + $destination_offset_x = round(($this->thumbnail_width - $this->thumbnail_image_width) / 2); + $destination_offset_y = round($this->thumbnail_height - $this->thumbnail_image_height); + break; + case 'C': + default: + $destination_offset_x = round(($this->thumbnail_width - $this->thumbnail_image_width) / 2); + $destination_offset_y = round(($this->thumbnail_height - $this->thumbnail_image_height) / 2); + } // // copy/resize image to appropriate dimensions // $borderThickness = 0; // if (!empty($this->fltr)) { // foreach ($this->fltr as $key => $value) { -// if (preg_match('^bord\|([0-9]+)', $value, $matches)) { +// if (preg_match('#^bord\|([0-9]+)#', $value, $matches)) { // $borderThickness = $matches[1]; // break; // } @@ -374,3515 +395,3702 @@ function GenerateThumbnail() { // //$this->DebugMessage('Skipping ImageResizeFunction() because BorderThickness="'.$borderThickness.'"', __FILE__, __LINE__); // $this->thumbnail_image_height /= 2; // } - $this->ImageResizeFunction( - $this->gdimg_output, - $this->gdimg_source, - $destination_offset_x, - $destination_offset_y, - $this->thumbnailCropX, - $this->thumbnailCropY, - $this->thumbnail_image_width, - $this->thumbnail_image_height, - $this->thumbnailCropW, - $this->thumbnailCropH - ); - - $this->DebugMessage('memory_get_usage() after copy-resize = '.(function_exists('memory_get_usage') ? @memory_get_usage() : 'n/a'), __FILE__, __LINE__); - ImageDestroy($this->gdimg_source); - $this->DebugMessage('memory_get_usage() after ImageDestroy = '.(function_exists('memory_get_usage') ? @memory_get_usage() : 'n/a'), __FILE__, __LINE__); - - $this->phpThumbDebug('8i'); - $this->AntiOffsiteLinking(); - $this->phpThumbDebug('8j'); - $this->ApplyFilters(); - $this->phpThumbDebug('8k'); - $this->AlphaChannelFlatten(); - $this->phpThumbDebug('8l'); - $this->MaxFileSize(); - $this->phpThumbDebug('8m'); - - $this->DebugMessage('GenerateThumbnail() completed successfully', __FILE__, __LINE__); - return true; - } - - - // public: - function RenderOutput() { - if (!$this->useRawIMoutput && !is_resource($this->gdimg_output)) { - $this->DebugMessage('RenderOutput() failed because !is_resource($this->gdimg_output)', __FILE__, __LINE__); - return false; - } - if (!$this->thumbnailFormat) { - $this->DebugMessage('RenderOutput() failed because $this->thumbnailFormat is empty', __FILE__, __LINE__); - return false; - } - if ($this->useRawIMoutput) { - $this->DebugMessage('RenderOutput copying $this->IMresizedData ('.strlen($this->IMresizedData).' bytes) to $this->outputImage', __FILE__, __LINE__); - $this->outputImageData = $this->IMresizedData; - return true; - } - - $builtin_formats = array(); - if (function_exists('ImageTypes')) { - $imagetypes = ImageTypes(); - $builtin_formats['wbmp'] = (bool) ($imagetypes & IMG_WBMP); - $builtin_formats['jpg'] = (bool) ($imagetypes & IMG_JPG); - $builtin_formats['gif'] = (bool) ($imagetypes & IMG_GIF); - $builtin_formats['png'] = (bool) ($imagetypes & IMG_PNG); - } - $this->DebugMessage('RenderOutput() attempting Image'.strtoupper(@$this->thumbnailFormat).'($this->gdimg_output)', __FILE__, __LINE__); - ob_start(); - switch ($this->thumbnailFormat) { - case 'wbmp': - if (!@$builtin_formats['wbmp']) { - $this->DebugMessage('GD does not have required built-in support for WBMP output', __FILE__, __LINE__); - ob_end_clean(); - return false; - } - ImageJPEG($this->gdimg_output, null, $this->thumbnailQuality); - $this->outputImageData = ob_get_contents(); - break; - - case 'jpeg': - case 'jpg': // should be "jpeg" not "jpg" but just in case... - if (!@$builtin_formats['jpg']) { - $this->DebugMessage('GD does not have required built-in support for JPEG output', __FILE__, __LINE__); - ob_end_clean(); - return false; - } - ImageJPEG($this->gdimg_output, null, $this->thumbnailQuality); - $this->outputImageData = ob_get_contents(); - break; - - case 'png': - if (!@$builtin_formats['png']) { - $this->DebugMessage('GD does not have required built-in support for PNG output', __FILE__, __LINE__); - ob_end_clean(); - return false; - } - ImagePNG($this->gdimg_output); - $this->outputImageData = ob_get_contents(); - break; - - case 'gif': - if (!@$builtin_formats['gif']) { - $this->DebugMessage('GD does not have required built-in support for GIF output', __FILE__, __LINE__); - ob_end_clean(); - return false; - } - ImageGIF($this->gdimg_output); - $this->outputImageData = ob_get_contents(); - break; - - case 'bmp': - $ImageOutFunction = '"builtin BMP output"'; - if (!@include_once(dirname(__FILE__).'/phpthumb.bmp.php')) { - $this->DebugMessage('Error including "'.dirname(__FILE__).'/phpthumb.bmp.php" which is required for BMP format output', __FILE__, __LINE__); - ob_end_clean(); - return false; - } - $phpthumb_bmp = new phpthumb_bmp(); - $this->outputImageData = $phpthumb_bmp->GD2BMPstring($this->gdimg_output); - unset($phpthumb_bmp); - break; - - case 'ico': - $ImageOutFunction = '"builtin ICO output"'; - if (!@include_once(dirname(__FILE__).'/phpthumb.ico.php')) { - $this->DebugMessage('Error including "'.dirname(__FILE__).'/phpthumb.ico.php" which is required for ICO format output', __FILE__, __LINE__); - ob_end_clean(); - return false; - } - $phpthumb_ico = new phpthumb_ico(); - $arrayOfOutputImages = array($this->gdimg_output); - $this->outputImageData = $phpthumb_ico->GD2ICOstring($arrayOfOutputImages); - unset($phpthumb_ico); - break; - - default: - $this->DebugMessage('RenderOutput failed because $this->thumbnailFormat "'.$this->thumbnailFormat.'" is not valid', __FILE__, __LINE__); - ob_end_clean(); - return false; - } - ob_end_clean(); - if (!$this->outputImageData) { - $this->DebugMessage('RenderOutput() for "'.$this->thumbnailFormat.'" failed', __FILE__, __LINE__); - ob_end_clean(); - return false; - } - $this->DebugMessage('RenderOutput() completing with $this->outputImageData = '.strlen($this->outputImageData).' bytes', __FILE__, __LINE__); - return true; - } - - - // public: - function RenderToFile($filename) { - if (preg_match('/^(f|ht)tps?\:\/\//i', $filename)) { - $this->DebugMessage('RenderToFile() failed because $filename ('.$filename.') is a URL', __FILE__, __LINE__); - return false; - } - // render thumbnail to this file only, do not cache, do not output to browser - //$renderfilename = $this->ResolveFilenameToAbsolute(dirname($filename)).DIRECTORY_SEPARATOR.basename($filename); - $renderfilename = $filename; - if (($filename{0} != '/') && ($filename{0} != '\\') && ($filename{1} != ':')) { - $renderfilename = $this->ResolveFilenameToAbsolute($renderfilename); - } - if (!@is_writable(dirname($renderfilename))) { - $this->DebugMessage('RenderToFile() failed because "'.dirname($renderfilename).'/" is not writable', __FILE__, __LINE__); - return false; - } - if (@is_file($renderfilename) && !@is_writable($renderfilename)) { - $this->DebugMessage('RenderToFile() failed because "'.$renderfilename.'" is not writable', __FILE__, __LINE__); - return false; - } - - if ($this->RenderOutput()) { - if (file_put_contents($renderfilename, $this->outputImageData)) { - $this->DebugMessage('RenderToFile('.$renderfilename.') succeeded', __FILE__, __LINE__); - /*if trouble with chmod (infobox hoster)*/ - //chmod($renderfilename, 0644); - return true; - } - if (!@file_exists($renderfilename)) { - $this->DebugMessage('RenderOutput ['.$this->thumbnailFormat.'('.$renderfilename.')] did not appear to fail, but the output image does not exist either...', __FILE__, __LINE__); - } - } else { - $this->DebugMessage('RenderOutput ['.$this->thumbnailFormat.'('.$renderfilename.')] failed', __FILE__, __LINE__); - } - return false; - } - - - // public: - function OutputThumbnail() { - if (!$this->useRawIMoutput && !is_resource($this->gdimg_output)) { - $this->DebugMessage('OutputThumbnail() failed because !is_resource($this->gdimg_output)', __FILE__, __LINE__); - return false; - } - if (headers_sent()) { - return $this->ErrorImage('OutputThumbnail() failed - headers already sent'); - exit; - } - - $downloadfilename = phpthumb_functions::SanitizeFilename(is_string($this->sia) ? $this->sia : ($this->down ? $this->down : 'phpThumb_generated_thumbnail'.'.'.$this->thumbnailFormat)); - $this->DebugMessage('Content-Disposition header filename set to "'.$downloadfilename.'"', __FILE__, __LINE__); - if ($downloadfilename) { - header('Content-Disposition: '.($this->down ? 'attachment' : 'inline').'; filename="'.$downloadfilename.'"'); - } else { - $this->DebugMessage('failed to send Content-Disposition header because $downloadfilename is empty', __FILE__, __LINE__); - } - - if ($this->useRawIMoutput) { - - header('Content-Type: '.phpthumb_functions::ImageTypeToMIMEtype($this->thumbnailFormat)); - echo $this->IMresizedData; - - } else { - - $this->DebugMessage('ImageInterlace($this->gdimg_output, '.intval($this->config_output_interlace).')', __FILE__, __LINE__); - ImageInterlace($this->gdimg_output, intval($this->config_output_interlace)); - switch ($this->thumbnailFormat) { - case 'jpeg': - header('Content-Type: '.phpthumb_functions::ImageTypeToMIMEtype($this->thumbnailFormat)); - $ImageOutFunction = 'image'.$this->thumbnailFormat; - @$ImageOutFunction($this->gdimg_output, '', $this->thumbnailQuality); - break; - - case 'png': - case 'gif': - header('Content-Type: '.phpthumb_functions::ImageTypeToMIMEtype($this->thumbnailFormat)); - $ImageOutFunction = 'image'.$this->thumbnailFormat; - @$ImageOutFunction($this->gdimg_output); - break; - - case 'bmp': - if (!@include_once(dirname(__FILE__).'/phpthumb.bmp.php')) { - $this->DebugMessage('Error including "'.dirname(__FILE__).'/phpthumb.bmp.php" which is required for BMP format output', __FILE__, __LINE__); - return false; - } - $phpthumb_bmp = new phpthumb_bmp(); - if (is_object($phpthumb_bmp)) { - $bmp_data = $phpthumb_bmp->GD2BMPstring($this->gdimg_output); - unset($phpthumb_bmp); - if (!$bmp_data) { - $this->DebugMessage('$phpthumb_bmp->GD2BMPstring() failed', __FILE__, __LINE__); - return false; - } - header('Content-Type: '.phpthumb_functions::ImageTypeToMIMEtype($this->thumbnailFormat)); - echo $bmp_data; - } else { - $this->DebugMessage('new phpthumb_bmp() failed', __FILE__, __LINE__); - return false; - } - break; - - case 'ico': - if (!@include_once(dirname(__FILE__).'/phpthumb.ico.php')) { - $this->DebugMessage('Error including "'.dirname(__FILE__).'/phpthumb.ico.php" which is required for ICO format output', __FILE__, __LINE__); - return false; - } - $phpthumb_ico = new phpthumb_ico(); - if (is_object($phpthumb_ico)) { - $arrayOfOutputImages = array($this->gdimg_output); - $ico_data = $phpthumb_ico->GD2ICOstring($arrayOfOutputImages); - unset($phpthumb_ico); - if (!$ico_data) { - $this->DebugMessage('$phpthumb_ico->GD2ICOstring() failed', __FILE__, __LINE__); - return false; - } - header('Content-Type: '.phpthumb_functions::ImageTypeToMIMEtype($this->thumbnailFormat)); - echo $ico_data; - } else { - $this->DebugMessage('new phpthumb_ico() failed', __FILE__, __LINE__); - return false; - } - break; - - default: - $this->DebugMessage('OutputThumbnail failed because $this->thumbnailFormat "'.$this->thumbnailFormat.'" is not valid', __FILE__, __LINE__); - return false; - break; - } - - } - return true; - } - - - // public: - function CleanUpCacheDirectory() { - $this->DebugMessage('skipping CleanUpCacheDirectory() set to purge ('.number_format($this->config_cache_maxage / 86400, 1).' days; '.number_format($this->config_cache_maxsize / 1048576, 2).'MB; '.number_format($this->config_cache_maxfiles).' files)', __FILE__, __LINE__); - $DeletedKeys = array(); - $AllFilesInCacheDirectory = array(); - if (($this->config_cache_maxage > 0) || ($this->config_cache_maxsize > 0) || ($this->config_cache_maxfiles > 0)) { - $CacheDirOldFilesAge = array(); - $CacheDirOldFilesSize = array(); - $AllFilesInCacheDirectory = phpthumb_functions::GetAllFilesInSubfolders($this->config_cache_directory); - foreach ($AllFilesInCacheDirectory as $fullfilename) { - if (preg_match('/^phpThumb\_cache\_/i', basename($fullfilename)) && file_exists($fullfilename)) { - $CacheDirOldFilesAge[$fullfilename] = @fileatime($fullfilename); - if ($CacheDirOldFilesAge[$fullfilename] == 0) { - $CacheDirOldFilesAge[$fullfilename] = @filemtime($fullfilename); - } - $CacheDirOldFilesSize[$fullfilename] = @filesize($fullfilename); - } - } - if (empty($CacheDirOldFilesSize)) { - return true; - } - $DeletedKeys['zerobyte'] = array(); - foreach ($CacheDirOldFilesSize as $fullfilename => $filesize) { - // purge all zero-size files more than an hour old (to prevent trying to delete just-created and/or in-use files) - $cutofftime = time() - 3600; - if (($filesize == 0) && ($CacheDirOldFilesAge[$fullfilename] < $cutofftime)) { - if (@unlink($fullfilename)) { - $DeletedKeys['zerobyte'][] = $fullfilename; - unset($CacheDirOldFilesSize[$fullfilename]); - unset($CacheDirOldFilesAge[$fullfilename]); - } - } - } - $this->DebugMessage('CleanUpCacheDirectory() purged '.count($DeletedKeys['zerobyte']).' zero-byte files', __FILE__, __LINE__); - asort($CacheDirOldFilesAge); - - if ($this->config_cache_maxfiles > 0) { - $TotalCachedFiles = count($CacheDirOldFilesAge); - $DeletedKeys['maxfiles'] = array(); - foreach ($CacheDirOldFilesAge as $fullfilename => $filedate) { - if ($TotalCachedFiles > $this->config_cache_maxfiles) { - if (@unlink($fullfilename)) { - $TotalCachedFiles--; - $DeletedKeys['maxfiles'][] = $fullfilename; - } - } else { - // there are few enough files to keep the rest - break; - } - } - $this->DebugMessage('CleanUpCacheDirectory() purged '.count($DeletedKeys['maxfiles']).' files based on (config_cache_maxfiles='.$this->config_cache_maxfiles.')', __FILE__, __LINE__); - foreach ($DeletedKeys['maxfiles'] as $fullfilename) { - unset($CacheDirOldFilesAge[$fullfilename]); - unset($CacheDirOldFilesSize[$fullfilename]); - } - } - - if ($this->config_cache_maxage > 0) { - $mindate = time() - $this->config_cache_maxage; - $DeletedKeys['maxage'] = array(); - foreach ($CacheDirOldFilesAge as $fullfilename => $filedate) { - if ($filedate > 0) { - if ($filedate < $mindate) { - if (@unlink($fullfilename)) { - $DeletedKeys['maxage'][] = $fullfilename; - } - } else { - // the rest of the files are new enough to keep - break; - } - } - } - $this->DebugMessage('CleanUpCacheDirectory() purged '.count($DeletedKeys['maxage']).' files based on (config_cache_maxage='.$this->config_cache_maxage.')', __FILE__, __LINE__); - foreach ($DeletedKeys['maxage'] as $fullfilename) { - unset($CacheDirOldFilesAge[$fullfilename]); - unset($CacheDirOldFilesSize[$fullfilename]); - } - } - - if ($this->config_cache_maxsize > 0) { - $TotalCachedFileSize = array_sum($CacheDirOldFilesSize); - $DeletedKeys['maxsize'] = array(); - foreach ($CacheDirOldFilesAge as $fullfilename => $filedate) { - if ($TotalCachedFileSize > $this->config_cache_maxsize) { - if (@unlink($fullfilename)) { - $TotalCachedFileSize -= $CacheDirOldFilesSize[$fullfilename]; - $DeletedKeys['maxsize'][] = $fullfilename; - } - } else { - // the total filesizes are small enough to keep the rest of the files - break; - } - } - $this->DebugMessage('CleanUpCacheDirectory() purged '.count($DeletedKeys['maxsize']).' files based on (config_cache_maxsize='.$this->config_cache_maxsize.')', __FILE__, __LINE__); - foreach ($DeletedKeys['maxsize'] as $fullfilename) { - unset($CacheDirOldFilesAge[$fullfilename]); - unset($CacheDirOldFilesSize[$fullfilename]); - } - } - - } else { - $this->DebugMessage('skipping CleanUpCacheDirectory() because config set to not use it', __FILE__, __LINE__); - } - $totalpurged = 0; - foreach ($DeletedKeys as $key => $value) { - $totalpurged += count($value); - } - $this->DebugMessage('CleanUpCacheDirectory() purged '.$totalpurged.' files (from '.count($AllFilesInCacheDirectory).') based on config settings', __FILE__, __LINE__); - if ($totalpurged > 0) { - $empty_dirs = array(); - foreach ($AllFilesInCacheDirectory as $fullfilename) { - if (is_dir($fullfilename)) { - $empty_dirs[realpath($fullfilename)] = 1; - } else { - unset($empty_dirs[realpath(dirname($fullfilename))]); - } - } - krsort($empty_dirs); - $totalpurgeddirs = 0; - foreach ($empty_dirs as $empty_dir => $dummy) { - if ($empty_dir == $this->config_cache_directory) { - // shouldn't happen, but just in case, don't let it delete actual cache directory - continue; - } elseif (@rmdir($empty_dir)) { - $totalpurgeddirs++; - } else { - $this->DebugMessage('failed to rmdir('.$empty_dir.')', __FILE__, __LINE__); - } - } - $this->DebugMessage('purged '.$totalpurgeddirs.' empty directories', __FILE__, __LINE__); - } - return true; - } - - ////////////////////////////////////////////////////////////////////// - - // private: re-initializator (call between rendering multiple images with one object) - function resetObject() { - $class_vars = get_class_vars(get_class($this)); - foreach ($class_vars as $key => $value) { - // do not clobber debug or config info - if (!preg_match('/^(config\_|debug|fatalerror)/i', $key)) { - $this->$key = $value; - } - } - $this->phpThumb(); // re-initialize some class variables - return true; - } - - ////////////////////////////////////////////////////////////////////// - - function ResolveSource() { - if (is_resource($this->gdimg_source)) { - $this->DebugMessage('ResolveSource() exiting because is_resource($this->gdimg_source)', __FILE__, __LINE__); - return true; - } - if ($this->rawImageData) { - $this->sourceFilename = null; - $this->DebugMessage('ResolveSource() exiting because $this->rawImageData is set ('.number_format(strlen($this->rawImageData)).' bytes)', __FILE__, __LINE__); - return true; - } - if ($this->sourceFilename) { - $this->sourceFilename = $this->ResolveFilenameToAbsolute($this->sourceFilename); - $this->DebugMessage('$this->sourceFilename set to "'.$this->sourceFilename.'"', __FILE__, __LINE__); - } elseif ($this->src) { - $this->sourceFilename = $this->ResolveFilenameToAbsolute($this->src); - $this->DebugMessage('$this->sourceFilename set to "'.$this->sourceFilename.'" from $this->src ('.$this->src.')', __FILE__, __LINE__); - } else { - return $this->ErrorImage('$this->sourceFilename and $this->src are both empty'); - } - if ($this->iswindows && ((substr($this->sourceFilename, 0, 2) == '//') || (substr($this->sourceFilename, 0, 2) == '\\\\'))) { - // Windows \\share\filename.ext - } elseif (preg_match('/^(f|ht)tps?\:\/\//i', $this->sourceFilename)) { - // URL - if ($this->config_http_user_agent) { - ini_set('user_agent', $this->config_http_user_agent); - } - } elseif (!@file_exists($this->sourceFilename)) { - return $this->ErrorImage('"'.$this->sourceFilename.'" does not exist'); - } elseif (!@is_file($this->sourceFilename)) { - return $this->ErrorImage('"'.$this->sourceFilename.'" is not a file'); - } - return true; - } - - function setOutputFormat() { - static $alreadyCalled = false; - if ($this->thumbnailFormat && $alreadyCalled) { - return true; - } - $alreadyCalled = true; - - $AvailableImageOutputFormats = array(); - $AvailableImageOutputFormats[] = 'text'; - if (@is_readable(dirname(__FILE__).'/phpthumb.ico.php')) { - $AvailableImageOutputFormats[] = 'ico'; - } - if (@is_readable(dirname(__FILE__).'/phpthumb.bmp.php')) { - $AvailableImageOutputFormats[] = 'bmp'; - } - - $this->thumbnailFormat = 'ico'; - - // Set default output format based on what image types are available - if (function_exists('ImageTypes')) { - $imagetypes = ImageTypes(); - if ($imagetypes & IMG_WBMP) { - $this->thumbnailFormat = 'wbmp'; - $AvailableImageOutputFormats[] = 'wbmp'; - } - if ($imagetypes & IMG_GIF) { - $this->thumbnailFormat = 'gif'; - $AvailableImageOutputFormats[] = 'gif'; - } - if ($imagetypes & IMG_PNG) { - $this->thumbnailFormat = 'png'; - $AvailableImageOutputFormats[] = 'png'; - } - if ($imagetypes & IMG_JPG) { - $this->thumbnailFormat = 'jpeg'; - $AvailableImageOutputFormats[] = 'jpeg'; - } - } else { - //return $this->ErrorImage('ImageTypes() does not exist - GD support might not be enabled?'); - $this->DebugMessage('ImageTypes() does not exist - GD support might not be enabled?', __FILE__, __LINE__); - } - if ($this->ImageMagickVersion()) { - $IMformats = array('jpeg', 'png', 'gif', 'bmp', 'ico', 'wbmp'); - $this->DebugMessage('Addding ImageMagick formats to $AvailableImageOutputFormats ('.implode(';', $AvailableImageOutputFormats).')', __FILE__, __LINE__); - foreach ($IMformats as $key => $format) { - $AvailableImageOutputFormats[] = $format; - } - } - $AvailableImageOutputFormats = array_unique($AvailableImageOutputFormats); - $this->DebugMessage('$AvailableImageOutputFormats = array('.implode(';', $AvailableImageOutputFormats).')', __FILE__, __LINE__); - - $this->f = preg_replace('/[^a-z]/', '', strtolower($this->f)); - if (strtolower($this->config_output_format) == 'jpg') { - $this->config_output_format = 'jpeg'; - } - if (strtolower($this->f) == 'jpg') { - $this->f = 'jpeg'; - } - if (phpthumb_functions::CaseInsensitiveInArray($this->config_output_format, $AvailableImageOutputFormats)) { - // set output format to config default if that format is available - $this->DebugMessage('$this->thumbnailFormat set to $this->config_output_format "'.strtolower($this->config_output_format).'"', __FILE__, __LINE__); - $this->thumbnailFormat = strtolower($this->config_output_format); - } elseif ($this->config_output_format) { - $this->DebugMessage('$this->thumbnailFormat staying as "'.$this->thumbnailFormat.'" because $this->config_output_format ('.strtolower($this->config_output_format).') is not in $AvailableImageOutputFormats', __FILE__, __LINE__); - } - if ($this->f && (phpthumb_functions::CaseInsensitiveInArray($this->f, $AvailableImageOutputFormats))) { - // override output format if $this->f is set and that format is available - $this->DebugMessage('$this->thumbnailFormat set to $this->f "'.strtolower($this->f).'"', __FILE__, __LINE__); - $this->thumbnailFormat = strtolower($this->f); - } elseif ($this->f) { - $this->DebugMessage('$this->thumbnailFormat staying as "'.$this->thumbnailFormat.'" because $this->f ('.strtolower($this->f).') is not in $AvailableImageOutputFormats', __FILE__, __LINE__); - } - - // for JPEG images, quality 1 (worst) to 99 (best) - // quality < 25 is nasty, with not much size savings - not recommended - // problems with 100 - invalid JPEG? - $this->thumbnailQuality = max(1, min(99, ($this->q ? $this->q : 75))); - $this->DebugMessage('$this->thumbnailQuality set to "'.$this->thumbnailQuality.'"', __FILE__, __LINE__); - - return true; - } - - function setCacheDirectory() { - // resolve cache directory to absolute pathname - $this->DebugMessage('setCacheDirectory() starting with config_cache_directory = "'.$this->config_cache_directory.'"', __FILE__, __LINE__); - if (substr($this->config_cache_directory, 0, 1) == '.') { - if (preg_match('/^(f|ht)tps?\:\/\//i', $this->src)) { - if (!$this->config_cache_disable_warning) { - $this->ErrorImage('$this->config_cache_directory ('.$this->config_cache_directory.') cannot be used for remote images. Adjust "cache_directory" or "cache_disable_warning" in phpThumb.config.php'); - } - } elseif ($this->src) { - // resolve relative cache directory to source image - $this->config_cache_directory = dirname($this->ResolveFilenameToAbsolute($this->src)).DIRECTORY_SEPARATOR.$this->config_cache_directory; - } else { - // $this->new is probably set - } - } - if (substr($this->config_cache_directory, -1) == '/') { - $this->config_cache_directory = substr($this->config_cache_directory, 0, -1); - } - if ($this->iswindows) { - $this->config_cache_directory = str_replace('/', DIRECTORY_SEPARATOR, $this->config_cache_directory); - } - if ($this->config_cache_directory) { - $real_cache_path = realpath($this->config_cache_directory); - if (!$real_cache_path) { - $this->DebugMessage('realpath($this->config_cache_directory) failed for "'.$this->config_cache_directory.'"', __FILE__, __LINE__); - if (!is_dir($this->config_cache_directory)) { - $this->DebugMessage('!is_dir('.$this->config_cache_directory.')', __FILE__, __LINE__); - } - } - if ($real_cache_path) { - $this->DebugMessage('setting config_cache_directory to realpath('.$this->config_cache_directory.') = "'.$real_cache_path.'"', __FILE__, __LINE__); - $this->config_cache_directory = $real_cache_path; - } - } - if (!is_dir($this->config_cache_directory)) { - if (!$this->config_cache_disable_warning) { - $this->ErrorImage('$this->config_cache_directory ('.$this->config_cache_directory.') does not exist. Adjust "cache_directory" or "cache_disable_warning" in phpThumb.config.php'); - } - $this->DebugMessage('$this->config_cache_directory ('.$this->config_cache_directory.') is not a directory', __FILE__, __LINE__); - $this->config_cache_directory = null; - } elseif (!@is_writable($this->config_cache_directory)) { - $this->DebugMessage('$this->config_cache_directory is not writable ('.$this->config_cache_directory.')', __FILE__, __LINE__); - } - - $this->InitializeTempDirSetting(); - if (!@is_dir($this->config_temp_directory) && !@is_writable($this->config_temp_directory) && @is_dir($this->config_cache_directory) && @is_writable($this->config_cache_directory)) { - $this->DebugMessage('setting $this->config_temp_directory = $this->config_cache_directory ('.$this->config_cache_directory.')', __FILE__, __LINE__); - $this->config_temp_directory = $this->config_cache_directory; - } - return true; - } - - - function ResolveFilenameToAbsolute($filename) { - if (!$filename) { - return false; - } - - //if (eregi('^(f|ht)tps?\://', $filename)) { - if (preg_match('/^[a-z0-9]+\:\/{1,2}/i', $filename)) { - // eg: http://host/path/file.jpg (HTTP URL) - // eg: ftp://host/path/file.jpg (FTP URL) - // eg: data1:/path/file.jpg (Netware path) - - //$AbsoluteFilename = $filename; - return $filename; - - } elseif ($this->iswindows && ($filename{1} == ':')) { - - // absolute pathname (Windows) - $AbsoluteFilename = $filename; - - } elseif ($this->iswindows && ((substr($filename, 0, 2) == '//') || (substr($filename, 0, 2) == '\\\\'))) { - - // absolute pathname (Windows) - $AbsoluteFilename = $filename; - - } elseif ($filename{0} == '/') { - - if (@is_readable($filename) && !@is_readable($this->config_document_root.$filename)) { - - // absolute filename (*nix) - $AbsoluteFilename = $filename; - - } elseif ($filename{1} == '~') { - - // /~user/path - if ($ApacheLookupURIarray = phpthumb_functions::ApacheLookupURIarray($filename)) { - $AbsoluteFilename = $ApacheLookupURIarray['filename']; - } else { - $AbsoluteFilename = realpath($filename); - if (@is_readable($AbsoluteFilename)) { - $this->DebugMessage('phpthumb_functions::ApacheLookupURIarray() failed for "'.$filename.'", but the correct filename ('.$AbsoluteFilename.') seems to have been resolved with realpath($filename)', __FILE__, __LINE__); - } elseif (is_dir(dirname($AbsoluteFilename))) { - $this->DebugMessage('phpthumb_functions::ApacheLookupURIarray() failed for "'.dirname($filename).'", but the correct directory ('.dirname($AbsoluteFilename).') seems to have been resolved with realpath(.)', __FILE__, __LINE__); - } else { - return $this->ErrorImage('phpthumb_functions::ApacheLookupURIarray() failed for "'.$filename.'". This has been known to fail on Apache2 - try using the absolute filename for the source image (ex: "/home/user/httpdocs/image.jpg" instead of "/~user/image.jpg")'); - } - } - - } else { - - // relative filename (any OS) - if (preg_match('#^'.preg_quote($this->config_document_root).'#', $filename)) { - $AbsoluteFilename = $filename; - $this->DebugMessage('ResolveFilenameToAbsolute() NOT prepending $this->config_document_root ('.$this->config_document_root.') to $filename ('.$filename.') resulting in ($AbsoluteFilename = "'.$AbsoluteFilename.'")', __FILE__, __LINE__); - } else { - $AbsoluteFilename = $this->config_document_root.$filename; - $this->DebugMessage('ResolveFilenameToAbsolute() prepending $this->config_document_root ('.$this->config_document_root.') to $filename ('.$filename.') resulting in ($AbsoluteFilename = "'.$AbsoluteFilename.'")', __FILE__, __LINE__); - } - - } - - } else { - - // relative to current directory (any OS) - $AbsoluteFilename = $this->config_document_root.dirname(@$_SERVER['PHP_SELF']).DIRECTORY_SEPARATOR.$filename; - //if (!@file_exists($AbsoluteFilename) && @file_exists(realpath($this->DotPadRelativeDirectoryPath($filename)))) { - // $AbsoluteFilename = realpath($this->DotPadRelativeDirectoryPath($filename)); - //} - - if (substr(dirname(@$_SERVER['PHP_SELF']), 0, 2) == '/~') { - if ($ApacheLookupURIarray = phpthumb_functions::ApacheLookupURIarray(dirname(@$_SERVER['PHP_SELF']))) { - $AbsoluteFilename = $ApacheLookupURIarray['filename'].DIRECTORY_SEPARATOR.$filename; - } else { - $AbsoluteFilename = realpath('.').DIRECTORY_SEPARATOR.$filename; - if (@is_readable($AbsoluteFilename)) { - $this->DebugMessage('phpthumb_functions::ApacheLookupURIarray() failed for "'.dirname(@$_SERVER['PHP_SELF']).'", but the correct filename ('.$AbsoluteFilename.') seems to have been resolved with realpath(.)/$filename', __FILE__, __LINE__); - } elseif (is_dir(dirname($AbsoluteFilename))) { - $this->DebugMessage('phpthumb_functions::ApacheLookupURIarray() failed for "'.dirname(@$_SERVER['PHP_SELF']).'", but the correct directory ('.dirname($AbsoluteFilename).') seems to have been resolved with realpath(.)', __FILE__, __LINE__); - } else { - return $this->ErrorImage('phpthumb_functions::ApacheLookupURIarray() failed for "'.dirname(@$_SERVER['PHP_SELF']).'". This has been known to fail on Apache2 - try using the absolute filename for the source image'); - } - } - } - - } - if (is_link($AbsoluteFilename)) { - $this->DebugMessage('is_link()==true, changing "'.$AbsoluteFilename.'" to "'.readlink($AbsoluteFilename).'"', __FILE__, __LINE__); - $AbsoluteFilename = readlink($AbsoluteFilename); - } - if (realpath($AbsoluteFilename)) { - $AbsoluteFilename = realpath($AbsoluteFilename); - } - if ($this->iswindows) { - $AbsoluteFilename = preg_replace('#^'.preg_quote(realpath($this->config_document_root)).'#i', realpath($this->config_document_root), $AbsoluteFilename); - $AbsoluteFilename = str_replace(DIRECTORY_SEPARATOR, '/', $AbsoluteFilename); - } - if (!$this->config_allow_src_above_docroot && !preg_match('#^'.preg_quote(str_replace(DIRECTORY_SEPARATOR, '/', realpath($this->config_document_root))).'#', $AbsoluteFilename)) { - $this->DebugMessage('!$this->config_allow_src_above_docroot therefore setting "'.$AbsoluteFilename.'" (outside "'.realpath($this->config_document_root).'") to null', __FILE__, __LINE__); - return false; - } - if (!$this->config_allow_src_above_phpthumb && !preg_match('#^'.preg_quote(str_replace(DIRECTORY_SEPARATOR, '/', dirname(__FILE__))).'#', $AbsoluteFilename)) { - $this->DebugMessage('!$this->config_allow_src_above_phpthumb therefore setting "'.$AbsoluteFilename.'" (outside "'.dirname(__FILE__).'") to null', __FILE__, __LINE__); - return false; - } - return $AbsoluteFilename; - } - - function ImageMagickWhichConvert() { - static $WhichConvert = null; - if (is_null($WhichConvert)) { - if ($this->iswindows) { - $WhichConvert = false; - } else { - $WhichConvert = trim(phpthumb_functions::SafeExec('which convert')); - } - } - return $WhichConvert; - } - - function ImageMagickCommandlineBase() { - static $commandline = null; - if (is_null($commandline)) { - $commandline = (!is_null($this->config_imagemagick_path) ? $this->config_imagemagick_path : ''); - - if ($this->config_imagemagick_path && ($this->config_imagemagick_path != realpath($this->config_imagemagick_path))) { - if (@is_executable(realpath($this->config_imagemagick_path))) { - $this->DebugMessage('Changing $this->config_imagemagick_path ('.$this->config_imagemagick_path.') to realpath($this->config_imagemagick_path) ('.realpath($this->config_imagemagick_path).')', __FILE__, __LINE__); - $this->config_imagemagick_path = realpath($this->config_imagemagick_path); - } else { - $this->DebugMessage('Leaving $this->config_imagemagick_path as ('.$this->config_imagemagick_path.') because !is_execuatable(realpath($this->config_imagemagick_path)) ('.realpath($this->config_imagemagick_path).')', __FILE__, __LINE__); - } - } - $this->DebugMessage(' file_exists('.$this->config_imagemagick_path.') = '.intval( @file_exists($this->config_imagemagick_path)), __FILE__, __LINE__); - $this->DebugMessage('is_executable('.$this->config_imagemagick_path.') = '.intval(@is_executable($this->config_imagemagick_path)), __FILE__, __LINE__); - if (@file_exists($this->config_imagemagick_path)) { - $this->DebugMessage('using ImageMagick path from $this->config_imagemagick_path ('.$this->config_imagemagick_path.')', __FILE__, __LINE__); - if ($this->iswindows) { - $commandline = substr($this->config_imagemagick_path, 0, 2).' && cd "'.str_replace('/', DIRECTORY_SEPARATOR, substr(dirname($this->config_imagemagick_path), 2)).'" && '.basename($this->config_imagemagick_path); - } else { - $commandline = '"'.$this->config_imagemagick_path.'"'; - } - return $commandline; - } - - $which_convert = $this->ImageMagickWhichConvert(); - $IMversion = $this->ImageMagickVersion(); - - if ($which_convert && ($which_convert{0} == '/') && (function_exists('stream_resolve_include_path') ? @stream_resolve_include_path($which_convert) : @file_exists($which_convert))) { - - // `which convert` *should* return the path if "convert" exist, or nothing if it doesn't - // other things *may* get returned, like "sh: convert: not found" or "no convert in /usr/local/bin /usr/sbin /usr/bin /usr/ccs/bin" - // so only do this if the value returned exists as a file - $this->DebugMessage('using ImageMagick path from `which convert` ('.$which_convert.')', __FILE__, __LINE__); - $commandline = 'convert'; - - } elseif ($IMversion) { - - $this->DebugMessage('setting ImageMagick path to $this->config_imagemagick_path ('.$this->config_imagemagick_path.') ['.$IMversion.']', __FILE__, __LINE__); - $commandline = $this->config_imagemagick_path; - - } else { - - $this->DebugMessage('ImageMagickThumbnailToGD() aborting because cannot find convert in $this->config_imagemagick_path ('.$this->config_imagemagick_path.'), and `which convert` returned ('.$which_convert.')', __FILE__, __LINE__); - $commandline = ''; - - } - } - return $commandline; - } - - function ImageMagickVersion($returnRAW=false) { - static $versionstring = null; - if (is_null($versionstring)) { - $commandline = $this->ImageMagickCommandlineBase(); - $commandline = (!is_null($commandline) ? $commandline : ''); - - $versionstring = array(0=>'', 1=>''); - if ($commandline) { - $commandline .= ' --version'; - $this->DebugMessage('ImageMagick version checked with "'.$commandline.'"', __FILE__, __LINE__); - $versionstring[1] = trim(phpthumb_functions::SafeExec($commandline)); - if (preg_match('#^Version\: [^0-9]*([ 0-9\\.\\:Q/]+) (http|file)\:#i', $versionstring[1], $matches)) { - $versionstring[0] = $matches[1]; - } else { - $versionstring[0] = false; - $this->DebugMessage('ImageMagick did not return recognized version string ('.$versionstring[1].')', __FILE__, __LINE__); - } - $imsg = isset($matches[0]) ? $matches[0] : 'Unknown'; - $this->DebugMessage('ImageMagick convert --version says "'.$imsg.'"', __FILE__, __LINE__); - } - } - return @$versionstring[intval($returnRAW)]; - } - - function ImageMagickSwitchAvailable($switchname) { - static $IMoptions = null; - if (is_null($IMoptions)) { - $IMoptions = array(); - $commandline = $this->ImageMagickCommandlineBase(); - if (!is_null($commandline)) { - $commandline .= ' -help'; - $IMhelp_lines = explode("\n", phpthumb_functions::SafeExec($commandline)); - foreach ($IMhelp_lines as $line) { - if (preg_match('#^[\+\-]([a-z\-]+)#', trim($line), $matches)) { - $IMoptions[$matches[1]] = true; - } - } - } - } - if (is_array($switchname)) { - $allOK = true; - foreach ($switchname as $key => $value) { - if (!isset($IMoptions[$value])) { - $allOK = false; - break; - } - } - $this->DebugMessage('ImageMagickSwitchAvailable('.implode(';', $switchname).') = '.intval($allOK).'', __FILE__, __LINE__); - } else { - $allOK = isset($IMoptions[$switchname]); - $this->DebugMessage('ImageMagickSwitchAvailable('.$switchname.') = '.intval($allOK).'', __FILE__, __LINE__); - } - return $allOK; - } - - function ImageMagickFormatsList() { - static $IMformatsList = null; - if (is_null($IMformatsList)) { - $IMformatsList = ''; - $commandline = $this->ImageMagickCommandlineBase(); - if (!is_null($commandline)) { - $commandline = dirname($commandline).DIRECTORY_SEPARATOR.str_replace('convert', 'identify', basename($commandline)); - $commandline .= ' -list format'; - $IMformatsList = phpthumb_functions::SafeExec($commandline); - } - } - return $IMformatsList; - } - - function ImageMagickThumbnailToGD() { - // http://www.imagemagick.org/script/command-line-options.php - - if (ini_get('safe_mode')) { - $this->DebugMessage('ImageMagickThumbnailToGD() aborting because safe_mode is enabled', __FILE__, __LINE__); - $this->useRawIMoutput = false; - return false; - } - $this->useRawIMoutput = true; - if (phpthumb_functions::gd_version()) { - // if GD is not available, must use whatever ImageMagick can output - - // $UnAllowedParameters contains options that can only be processed in GD, not ImageMagick - // note: 'fltr' *may* need to be processed by GD, but we'll check that in more detail below - $UnAllowedParameters = array('xto', 'ar', 'bg', 'bc'); - // 'ra' may be part of this list, if not a multiple of 90� - foreach ($UnAllowedParameters as $parameter) { - if (isset($this->$parameter)) { - $this->DebugMessage('$this->useRawIMoutput=false because "'.$parameter.'" is set', __FILE__, __LINE__); - $this->useRawIMoutput = false; - break; - } - } - } - $this->DebugMessage('$this->useRawIMoutput='.($this->useRawIMoutput ? 'true' : 'false').' after checking $UnAllowedParameters', __FILE__, __LINE__); - $outputFormat = $this->thumbnailFormat; - if (phpthumb_functions::gd_version()) { - if ($this->useRawIMoutput) { - switch ($this->thumbnailFormat) { - case 'gif': - $ImageCreateFunction = 'ImageCreateFromGIF'; - $this->is_alpha = true; - break; - case 'png': - $ImageCreateFunction = 'ImageCreateFromPNG'; - $this->is_alpha = true; - break; - case 'jpg': - case 'jpeg': - $ImageCreateFunction = 'ImageCreateFromJPEG'; - break; - default: - $this->DebugMessage('Forcing output to PNG because $this->thumbnailFormat ('.$this->thumbnailFormat.' is not a GD-supported format)', __FILE__, __LINE__); - $outputFormat = 'png'; - $ImageCreateFunction = 'ImageCreateFromPNG'; - $this->is_alpha = true; - $this->useRawIMoutput = false; - break; - } - if (!function_exists(@$ImageCreateFunction)) { - // ImageMagickThumbnailToGD() depends on ImageCreateFromPNG/ImageCreateFromGIF - //$this->DebugMessage('ImageMagickThumbnailToGD() aborting because '.@$ImageCreateFunction.'() is not available', __FILE__, __LINE__); - $this->useRawIMoutput = true; - //return false; - } - } else { - $outputFormat = 'png'; - $ImageCreateFunction = 'ImageCreateFromPNG'; - $this->is_alpha = true; - $this->useRawIMoutput = false; - } - } - - if (!$this->sourceFilename && $this->rawImageData) { - if ($IMtempSourceFilename = $this->phpThumb_tempnam()) { - $IMtempSourceFilename = realpath($IMtempSourceFilename); - $this->sourceFilename = $IMtempSourceFilename; - $this->DebugMessage('ImageMagickThumbnailToGD() setting $this->sourceFilename to "'.$IMtempSourceFilename.'" from $this->rawImageData ('.strlen($this->rawImageData).' bytes)', __FILE__, __LINE__); - } - } - if (!$this->sourceFilename) { - $this->DebugMessage('ImageMagickThumbnailToGD() aborting because $this->sourceFilename is empty', __FILE__, __LINE__); - $this->useRawIMoutput = false; - return false; - } - - $commandline = $this->ImageMagickCommandlineBase(); - if ($commandline) { - if ($IMtempfilename = $this->phpThumb_tempnam()) { - $IMtempfilename = realpath($IMtempfilename); - - $IMuseExplicitImageOutputDimensions = false; - if ($this->ImageMagickSwitchAvailable('thumbnail') && $this->config_imagemagick_use_thumbnail) { - $IMresizeParameter = 'thumbnail'; - } else { - $IMresizeParameter = 'resize'; - - // some (older? around 2002) versions of IM won't accept "-resize 100x" but require "-resize 100x100" - $commandline_test = $this->ImageMagickCommandlineBase().' logo: -resize 1x "'.$IMtempfilename.'" 2>&1'; - $IMresult_test = phpthumb_functions::SafeExec($commandline_test); - $IMuseExplicitImageOutputDimensions = preg_match('/image dimensions are zero/i', $IMresult_test); - $this->DebugMessage('IMuseExplicitImageOutputDimensions = '.intval($IMuseExplicitImageOutputDimensions), __FILE__, __LINE__); - if ($fp_im_temp = @fopen($IMtempfilename, 'wb')) { - // erase temp image so ImageMagick logo doesn't get output if other processing fails - fclose($fp_im_temp); - } - } - - - if (!is_null($this->dpi) && $this->ImageMagickSwitchAvailable('density')) { - // for raster source formats only (WMF, PDF, etc) - $commandline .= ' -density '.$this->dpi; - } - ob_start(); - $getimagesize = GetImageSize($this->sourceFilename); - $GetImageSizeError = ob_get_contents(); - ob_end_clean(); - if (is_array($getimagesize)) { - $this->DebugMessage('GetImageSize('.$this->sourceFilename.') SUCCEEDED: '.serialize($getimagesize), __FILE__, __LINE__); - } else { - $this->DebugMessage('GetImageSize('.$this->sourceFilename.') FAILED with error "'.$GetImageSizeError.'"', __FILE__, __LINE__); - } - if (is_array($getimagesize)) { - $this->DebugMessage('GetImageSize('.$this->sourceFilename.') returned [w='.$getimagesize[0].';h='.$getimagesize[1].';f='.$getimagesize[2].']', __FILE__, __LINE__); - $this->source_width = $getimagesize[0]; - $this->source_height = $getimagesize[1]; - $this->DebugMessage('source dimensions set to '.$this->source_width.'x'.$this->source_height, __FILE__, __LINE__); - $this->SetOrientationDependantWidthHeight(); - - if (!preg_match('/('.implode('|', $this->AlphaCapableFormats).')/i', $outputFormat)) { - // not a transparency-capable format - $commandline .= ' -background "#'.($this->bg ? $this->bg : 'FFFFFF').'"'; - if ($getimagesize[2] == 1) { - // GIF - $commandline .= ' -flatten'; - } - } - if ($getimagesize[2] == 1) { - // GIF - $commandline .= ' -coalesce'; // may be needed for animated GIFs - } - if ($this->source_width || $this->source_height) { - if ($this->zc) { - - $borderThickness = 0; - if (!empty($this->fltr)) { - foreach ($this->fltr as $key => $value) { - if (preg_match('/^bord\|([0-9]+)/', $value, $matches)) { - $borderThickness = $matches[1]; - break; - } - } - } - $wAll = intval(max($this->w, $this->wp, $this->wl, $this->ws)) - (2 * $borderThickness); - $hAll = intval(max($this->h, $this->hp, $this->hl, $this->hs)) - (2 * $borderThickness); - $imAR = $this->source_width / $this->source_height; - $zcAR = (($wAll && $hAll) ? $wAll / $hAll : 1); - $side = phpthumb_functions::nonempty_min($this->source_width, $this->source_height, max($wAll, $hAll)); - $sideX = phpthumb_functions::nonempty_min($this->source_width, $wAll, round($hAll * $zcAR)); - $sideY = phpthumb_functions::nonempty_min( $this->source_height, $hAll, round($wAll / $zcAR)); - - $thumbnailH = round(max($sideY, ($sideY * $zcAR) / $imAR)); - if ($IMuseExplicitImageOutputDimensions) { - $commandline .= ' -'.$IMresizeParameter.' '.$thumbnailH.'x'.$thumbnailH; - } else { - $commandline .= ' -'.$IMresizeParameter.' x'.$thumbnailH; - } - - switch (strtoupper($this->zc)) { - case 'T': - $commandline .= ' -gravity north'; - break; - case 'B': - $commandline .= ' -gravity south'; - break; - case 'L': - $commandline .= ' -gravity west'; - break; - case 'R': - $commandline .= ' -gravity east'; - break; - case 'TL': - $commandline .= ' -gravity northwest'; - break; - case 'TR': - $commandline .= ' -gravity northeast'; - break; - case 'BL': - $commandline .= ' -gravity southwest'; - break; - case 'BR': - $commandline .= ' -gravity southeast'; - break; - case '1': - case 'C': - default: - $commandline .= ' -gravity center'; - break; - } - - if (($wAll > 0) && ($hAll > 0)) { - $commandline .= ' -crop '.$wAll.'x'.$hAll.'+0+0'; - } else { - $commandline .= ' -crop '.$side.'x'.$side.'+0+0'; - } - if ($this->ImageMagickSwitchAvailable('repage')) { - $commandline .= ' +repage'; - } else { - $this->DebugMessage('Skipping "+repage" because ImageMagick (v'.$this->ImageMagickVersion().') does not support it', __FILE__, __LINE__); - } - - } elseif ($this->sw || $this->sh || $this->sx || $this->sy) { - - $commandline .= ' -crop '.($this->sw ? $this->sw : $this->source_width).'x'.($this->sh ? $this->sh : $this->source_height).'+'.$this->sx.'+'.$this->sy; - // this is broken for aoe=1, but unsure how to fix. Send advice to info@silisoftware.com - if ($this->w || $this->h) { - if ($this->ImageMagickSwitchAvailable('repage')) { - $commandline .= ' -repage'; - } else { - $this->DebugMessage('Skipping "-repage" because ImageMagick (v'.$this->ImageMagickVersion().') does not support it', __FILE__, __LINE__); - } - if ($IMuseExplicitImageOutputDimensions) { - if ($this->w && !$this->h) { - $this->h = ceil($this->w / ($this->source_width / $this->source_height)); - } elseif ($this->h && !$this->w) { - $this->w = ceil($this->h * ($this->source_width / $this->source_height)); - } - } - $commandline .= ' -'.$IMresizeParameter.' '.$this->w.'x'.$this->h; - } - - } else { - - if ($this->iar && (intval($this->w) > 0) && (intval($this->h) > 0)) { - //$commandline .= ' -'.$IMresizeParameter.' '.$this->w.'x'.$this->h.'!'; - list($nw, $nh) = phpthumb_functions::TranslateWHbyAngle($this->w, $this->h, $this->ra); - $nw = ((round($nw) != 0) ? round($nw) : ''); - $nh = ((round($nh) != 0) ? round($nh) : ''); - $commandline .= ' -'.$IMresizeParameter.' '.$nw.'x'.$nh.'!'; - } else { - $this->w = ((($this->aoe || $this->far) && $this->w) ? $this->w : ($this->w ? phpthumb_functions::nonempty_min($this->w, $getimagesize[0]) : '')); - $this->h = ((($this->aoe || $this->far) && $this->h) ? $this->h : ($this->h ? phpthumb_functions::nonempty_min($this->h, $getimagesize[1]) : '')); - if ($this->w || $this->h) { - if ($IMuseExplicitImageOutputDimensions) { - if ($this->w && !$this->h) { - $this->h = ceil($this->w / ($this->source_width / $this->source_height)); - } elseif ($this->h && !$this->w) { - $this->w = ceil($this->h * ($this->source_width / $this->source_height)); - } - } - //$commandline .= ' -'.$IMresizeParameter.' '.$this->w.'x'.$this->h; - list($nw, $nh) = phpthumb_functions::TranslateWHbyAngle($this->w, $this->h, $this->ra); - $nw = ((round($nw) != 0) ? round($nw) : ''); - $nh = ((round($nh) != 0) ? round($nh) : ''); - $commandline .= ' -'.$IMresizeParameter.' '.$nw.'x'.$nh; - } - } - } - } - - } else { - - $this->DebugMessage('GetImageSize('.$this->sourceFilename.') failed', __FILE__, __LINE__); - if ($this->w || $this->h) { - if ($IMuseExplicitImageOutputDimensions) { - // unknown source aspect ration, just put large number and hope IM figures it out - $commandline .= ' -'.$IMresizeParameter.' '.($this->w ? $this->w : '9999').'x'.($this->h ? $this->h : '9999'); - } else { - $commandline .= ' -'.$IMresizeParameter.' '.$this->w.'x'.$this->h; - } - if ($this->iar && (intval($this->w) > 0) && (intval($this->h) > 0)) { - $commandline .= '!'; - } - } - - } - - if ($this->ra) { - $this->ra = intval($this->ra); - if ($this->ImageMagickSwitchAvailable('rotate')) { - if (!preg_match('/('.implode('|', $this->AlphaCapableFormats).')/i', $outputFormat) || phpthumb_functions::version_compare_replacement($this->ImageMagickVersion(), '6.3.7', '>=')) { - $this->DebugMessage('Using ImageMagick rotate', __FILE__, __LINE__); - $commandline .= ' -rotate '.$this->ra; - if (($this->ra % 90) != 0) { - if (preg_match('/('.implode('|', $this->AlphaCapableFormats).')/i', $outputFormat)) { - // alpha-capable format - $commandline .= ' -background rgba(255,255,255,0)'; - } else { - $commandline .= ' -background "#'.($this->bg ? $this->bg : 'FFFFFF').'"'; - } - } - $this->ra = 0; - } else { - $this->DebugMessage('Not using ImageMagick rotate because alpha background buggy before v6.3.7', __FILE__, __LINE__); - } - } else { - $this->DebugMessage('Not using ImageMagick rotate because not supported', __FILE__, __LINE__); - } - } - - foreach ($this->fltr as $filterkey => $filtercommand) { - @list($command, $parameter) = explode('|', $filtercommand, 2); - switch ($command) { - case 'brit': - if ($this->ImageMagickSwitchAvailable('modulate')) { - $commandline .= ' -modulate '.(100 + $parameter).',100,100'; - unset($this->fltr[$filterkey]); - } - break; - - case 'cont': - if ($this->ImageMagickSwitchAvailable('contrast')) { - $contDiv10 = round($parameter / 10); - if ($contDiv10 > 0) { - for ($i = 0; $i < $contDiv10; $i++) { - $commandline .= ' -contrast'; // increase contrast by 10% - } - } elseif ($contDiv10 < 0) { - for ($i = $contDiv10; $i < 0; $i++) { - $commandline .= ' +contrast'; // decrease contrast by 10% - } - } else { - // do nothing - } - unset($this->fltr[$filterkey]); - } - break; - - case 'ds': - if ($this->ImageMagickSwitchAvailable(array('colorspace', 'modulate'))) { - if ($parameter == 100) { - $commandline .= ' -colorspace GRAY -modulate 100,0,100'; - } else { - $commandline .= ' -modulate 100,'.(100 - $parameter).',100'; - } - unset($this->fltr[$filterkey]); - } - break; - - case 'sat': - if ($this->ImageMagickSwitchAvailable(array('colorspace', 'modulate'))) { - if ($parameter == -100) { - $commandline .= ' -colorspace GRAY -modulate 100,0,100'; - } else { - $commandline .= ' -modulate 100,'.(100 + $parameter).',100'; - } - unset($this->fltr[$filterkey]); - } - break; - - case 'gray': - if ($this->ImageMagickSwitchAvailable(array('colorspace', 'modulate'))) { - $commandline .= ' -colorspace GRAY -modulate 100,0,100'; - //$commandline .= ' -colorspace GRAY'; - unset($this->fltr[$filterkey]); - } - break; - - case 'clr': - if ($this->ImageMagickSwitchAvailable(array('fill', 'colorize'))) { - @list($amount, $color) = explode('|', $parameter); - $commandline .= ' -fill "#'.$color.'" -colorize '.$amount; - } - break; - - case 'sep': - if ($this->ImageMagickSwitchAvailable('sepia-tone')) { - @list($amount, $color) = explode('|', $parameter); - $amount = ($amount ? $amount : 80); - if (!$color) { - $commandline .= ' -sepia-tone '.$amount.'%'; - unset($this->fltr[$filterkey]); - } - } - break; - - case 'gam': - if ($this->ImageMagickSwitchAvailable('gamma')) { - $commandline .= ' -gamma '.$parameter; - unset($this->fltr[$filterkey]); - } - break; - - case 'neg': - if ($this->ImageMagickSwitchAvailable('negate')) { - $commandline .= ' -negate'; - unset($this->fltr[$filterkey]); - } - break; - - case 'th': - if ($this->ImageMagickSwitchAvailable(array('threshold', 'dither', 'monochrome'))) { - $commandline .= ' -threshold '.round($parameter / 2.55).'% -dither -monochrome'; - unset($this->fltr[$filterkey]); - } - break; - - case 'rcd': - if ($this->ImageMagickSwitchAvailable(array('colors', 'dither'))) { - @list($colors, $dither) = explode('|', $parameter); - $colors = ($colors ? (int) $colors : 256); - $dither = ((strlen($dither) > 0) ? (bool) $dither : true); - $commandline .= ' -colors '.max($colors, 8); // ImageMagick will otherwise fail with "cannot quantize to fewer than 8 colors" - $commandline .= ($dither ? ' -dither' : ' +dither'); - unset($this->fltr[$filterkey]); - } - break; - - case 'flip': - if ($this->ImageMagickSwitchAvailable(array('flip', 'flop'))) { - if (strpos(strtolower($parameter), 'x') !== false) { - $commandline .= ' -flop'; - } - if (strpos(strtolower($parameter), 'y') !== false) { - $commandline .= ' -flip'; - } - unset($this->fltr[$filterkey]); - } - break; - - case 'edge': - if ($this->ImageMagickSwitchAvailable('edge')) { - $parameter = ($parameter ? $parameter : 2); - $commandline .= ' -edge '.($parameter ? $parameter : 1); - unset($this->fltr[$filterkey]); - } - break; - - case 'emb': - if ($this->ImageMagickSwitchAvailable(array('emboss', 'negate'))) { - $parameter = ($parameter ? $parameter : 2); - $commandline .= ' -emboss '.$parameter; - if ($parameter < 2) { - $commandline .= ' -negate'; // ImageMagick negates the image for some reason with '-emboss 1'; - } - unset($this->fltr[$filterkey]); - } - break; - - case 'lvl': - @list($band, $method, $threshold) = explode('|', $parameter); - $band = ($band ? preg_replace('/[^RGBA\\*]/', '', strtoupper($band)) : '*'); - $method = ((strlen($method) > 0) ? intval($method) : 2); - $threshold = ((strlen($threshold) > 0) ? floatval($threshold) : 0.1); - - $band = preg_replace('/[^RGBA\\*]/', '', strtoupper($band)); - - if (($method > 1) && !$this->ImageMagickSwitchAvailable(array('channel', 'contrast-stretch'))) { - // Because ImageMagick processing happens before PHP-GD filters, and because some - // clipping is involved in the "lvl" filter, if "lvl" happens before "wb" then the - // "wb" filter will have (almost) no effect. Therefore, if "wb" is enabled then - // force the "lvl" filter to be processed by GD, not ImageMagick. - foreach ($this->fltr as $fltr_key => $fltr_value) { - list($fltr_cmd) = explode('|', $fltr_value); - if ($fltr_cmd == 'wb') { - $this->DebugMessage('Setting "lvl" filter method to "0" (from "'.$method.'") because white-balance filter also enabled', __FILE__, __LINE__); - $method = 0; - } - } - } - - switch ($method) { - case 0: // internal RGB - case 1: // internal grayscale - break; - case 2: // ImageMagick "contrast-stretch" - if ($this->ImageMagickSwitchAvailable('contrast-stretch')) { - $thiscommand = ' -contrast-stretch '.$threshold.'%'; - $commandline .= (($band == '*') ? $thiscommand : ' -channel '.strtoupper($band).$thiscommand.' +channel'); - unset($this->fltr[$filterkey]); - } - break; - case 3: // ImageMagick "normalize" - if ($this->ImageMagickSwitchAvailable('normalize')) { - $thiscommand = ' -normalize'; - $commandline .= (($band == '*') ? $thiscommand : ' -channel '.strtoupper($band).$thiscommand.' +channel'); - unset($this->fltr[$filterkey]); - } - break; - default: - $this->DebugMessage('unsupported method ('.$method.') for "lvl" filter', __FILE__, __LINE__); - break; - } - if (isset($this->fltr[$filterkey]) && ($method > 1)) { - $this->fltr[$filterkey] = $command.'|'.$band.'|0|'.$threshold; - $this->DebugMessage('filter "lvl" remapped from method "'.$method.'" to method "0" because ImageMagick support is missing', __FILE__, __LINE__); - } - break; - - case 'wb': - if ($this->ImageMagickSwitchAvailable(array('channel', 'contrast-stretch'))) { - @list($threshold) = explode('|', $parameter); - $threshold = (is_float($threshold) ? $threshold : 0.1); - $commandline .= ' -channel R -contrast-stretch '.$threshold.'%'; - $commandline .= ' -channel G -contrast-stretch '.$threshold.'%'; - $commandline .= ' -channel B -contrast-stretch '.$threshold.'%'; - $commandline .= ' +channel'; - unset($this->fltr[$filterkey]); - } - break; - - case 'blur': - if ($this->ImageMagickSwitchAvailable('blur')) { - @list($radius) = explode('|', $parameter); - $radius = ($radius ? $radius : 1); - $commandline .= ' -blur '.$radius; - unset($this->fltr[$filterkey]); - } - break; - - case 'gblr': - if ($this->ImageMagickSwitchAvailable('gaussian')) { - @list($radius) = explode('|', $parameter); - $radius = ($radius ? $radius : 1); - $commandline .= ' -gaussian '.$radius; - unset($this->fltr[$filterkey]); - } - break; - - case 'usm': - if ($this->ImageMagickSwitchAvailable('unsharp')) { - @list($amount, $radius, $threshold) = explode('|', $parameter); - $amount = ($amount ? $amount : 80); - $radius = ($radius ? $radius : 0.5); - $threshold = (strlen($threshold) ? $threshold : 3); - $commandline .= ' -unsharp '.number_format(($radius * 2) - 1, 2).'x1+'.number_format($amount / 100, 2).'+'.number_format($threshold / 100, 2); - unset($this->fltr[$filterkey]); - } - break; - - case 'bord': - if ($this->ImageMagickSwitchAvailable(array('border', 'bordercolor', 'thumbnail', 'crop'))) { - if (!$this->zc) { - @list($width, $rX, $rY, $color) = explode('|', $parameter); - if ($width && !$rX && !$rY) { - if (!phpthumb_functions::IsHexColor($color)) { - $color = ($this->bc ? $this->bc : '000000'); - } - $commandline .= ' -border '.$width.' -bordercolor "#'.$color.'"'; - if (preg_match('# \-crop ([0-9]+)x([0-9]+)\+0\+0 #', $commandline, $matches)) { - $commandline = str_replace(' -crop '.$matches[1].'x'.$matches[2].'+0+0 ', ' -crop '.($matches[1] - (2 * $width)).'x'.($matches[2] - (2 * $width)).'+0+0 ', $commandline); - } elseif (preg_match('# \-'.$IMresizeParameter.' ([0-9]+)x([0-9]+) #', $commandline, $matches)) { - $commandline = str_replace(' -'.$IMresizeParameter.' '.$matches[1].'x'.$matches[2].' ', ' -'.$IMresizeParameter.' '.($matches[1] - (2 * $width)).'x'.($matches[2] - (2 * $width)).' ', $commandline); - } - unset($this->fltr[$filterkey]); - } - } - } - break; - - case 'crop': - break; - - case 'sblr': - break; - - case 'mean': - break; - - case 'smth': - break; - - case 'bvl': - break; - - case 'wmi': - break; - - case 'wmt': - break; - - case 'over': - break; - - case 'hist': - break; - - case 'fram': - break; - - case 'drop': - break; - - case 'mask': - break; - - case 'elip': - break; - - case 'ric': - break; - - case 'stc': - break; - - case 'size': - break; - - default: - $this->DebugMessage('Unknown $this->fltr['.$filterkey.'] ('.$filtercommand.') -- deleting filter command', __FILE__, __LINE__); - unset($this->fltr[$filterkey]); - break; - } - if (!isset($this->fltr[$filterkey])) { - $this->DebugMessage('Processed $this->fltr['.$filterkey.'] ('.$filtercommand.') with ImageMagick', __FILE__, __LINE__); - } else { - $this->DebugMessage('Skipping $this->fltr['.$filterkey.'] ('.$filtercommand.') with ImageMagick', __FILE__, __LINE__); - } - } - $this->DebugMessage('Remaining $this->fltr after ImageMagick: ('.$this->phpThumbDebugVarDump($this->fltr).')', __FILE__, __LINE__); - if (count($this->fltr) > 0) { - $this->useRawIMoutput = false; - } - - if (preg_match('/jpe?g/i', $outputFormat) && $this->q) { - if ($this->ImageMagickSwitchAvailable(array('quality', 'interlace'))) { - $commandline .= ' -quality '.$this->thumbnailQuality; - if ($this->config_output_interlace) { - // causes weird things with animated GIF... leave for JPEG only - $commandline .= ' -interlace line '; // Use Line or Plane to create an interlaced PNG or GIF or progressive JPEG image - } - } - } - $commandline .= ' "'.str_replace('/', DIRECTORY_SEPARATOR, $this->sourceFilename).(($outputFormat == 'gif') ? '' : '['.intval($this->sfn).']').'"'; // [0] means first frame of (GIF) animation, can be ignored - $commandline .= ' '.$outputFormat.':"'.$IMtempfilename.'"'; - if (!$this->iswindows) { - $commandline .= ' 2>&1'; - } - $this->DebugMessage('ImageMagick called as ('.$commandline.')', __FILE__, __LINE__); - $IMresult = phpthumb_functions::SafeExec($commandline); - clearstatcache(); - if (@$IMtempSourceFilename && file_exists($IMtempSourceFilename)) { - @unlink($IMtempSourceFilename); - } - if (!@file_exists($IMtempfilename) || !@filesize($IMtempfilename)) { - $this->FatalError('ImageMagick failed with message ('.trim($IMresult).')'); - $this->DebugMessage('ImageMagick failed with message ('.trim($IMresult).')', __FILE__, __LINE__); - if ($this->iswindows && !$IMresult) { - $this->DebugMessage('Check to make sure that PHP has read+write permissions to "'.dirname($IMtempfilename).'"', __FILE__, __LINE__); - } - - } else { - - $this->IMresizedData = file_get_contents($IMtempfilename); - $getimagesize_imresized = @GetImageSize($IMtempfilename); - $this->DebugMessage('GetImageSize('.$IMtempfilename.') returned [w='.$getimagesize_imresized[0].';h='.$getimagesize_imresized[1].';f='.$getimagesize_imresized[2].']', __FILE__, __LINE__); - if (($this->config_max_source_pixels > 0) && (($getimagesize_imresized[0] * $getimagesize_imresized[1]) > $this->config_max_source_pixels)) { - $this->DebugMessage('skipping ImageMagickThumbnailToGD::'.$ImageCreateFunction.'() because IM output is too large ('.$getimagesize_imresized[0].'x'.$getimagesize_imresized[0].' = '.($getimagesize_imresized[0] * $getimagesize_imresized[1]).' > '.$this->config_max_source_pixels.')', __FILE__, __LINE__); - } elseif (function_exists(@$ImageCreateFunction) && ($this->gdimg_source = @$ImageCreateFunction($IMtempfilename))) { - $this->source_width = ImageSX($this->gdimg_source); - $this->source_height = ImageSY($this->gdimg_source); - $this->DebugMessage('ImageMagickThumbnailToGD::'.$ImageCreateFunction.'() succeeded, $this->gdimg_source is now ('.$this->source_width.'x'.$this->source_height.')', __FILE__, __LINE__); - $this->DebugMessage('ImageMagickThumbnailToGD() returning $this->IMresizedData ('.strlen($this->IMresizedData).' bytes)', __FILE__, __LINE__); - } else { - $this->useRawIMoutput = true; - $this->DebugMessage('$this->useRawIMoutput set to TRUE because '.@$ImageCreateFunction.'('.$IMtempfilename.') failed', __FILE__, __LINE__); - } - @unlink($IMtempfilename); - return true; - - } - unlink($IMtempfilename); - - } else { - $this->DebugMessage('ImageMagickThumbnailToGD() aborting, phpThumb_tempnam() failed', __FILE__, __LINE__); - } - } else { - $this->DebugMessage('ImageMagickThumbnailToGD() aborting because ImageMagickCommandlineBase() failed', __FILE__, __LINE__); - } - $this->useRawIMoutput = false; - return false; - } - - - function Rotate() { - if ($this->ra || $this->ar) { - if (!function_exists('ImageRotate')) { - $this->DebugMessage('!function_exists(ImageRotate)', __FILE__, __LINE__); - return false; - } - if (!include_once(dirname(__FILE__).'/phpthumb.filters.php')) { - $this->DebugMessage('Error including "'.dirname(__FILE__).'/phpthumb.filters.php" which is required for applying filters ('.implode(';', $this->fltr).')', __FILE__, __LINE__); - return false; - } - - $this->config_background_hexcolor = ($this->bg ? $this->bg : $this->config_background_hexcolor); - if (!phpthumb_functions::IsHexColor($this->config_background_hexcolor)) { - return $this->ErrorImage('Invalid hex color string "'.$this->config_background_hexcolor.'" for parameter "bg"'); - } - - $rotate_angle = 0; - if ($this->ra) { - - $rotate_angle = floatval($this->ra); - - } else { - - if ($this->ar == 'x') { - if (phpthumb_functions::version_compare_replacement(phpversion(), '4.2.0', '>=')) { - if ($this->sourceFilename) { - if (function_exists('exif_read_data')) { - if ($exif_data = @exif_read_data($this->sourceFilename, 'IFD0')) { - // http://sylvana.net/jpegcrop/exif_orientation.html - switch (@$exif_data['Orientation']) { - case 1: - $rotate_angle = 0; - break; - case 3: - $rotate_angle = 180; - break; - case 6: - $rotate_angle = 270; - break; - case 8: - $rotate_angle = 90; - break; - - default: - $this->DebugMessage('EXIF auto-rotate failed because unknown $exif_data[Orientation] "'.@$exif_data['Orientation'].'"', __FILE__, __LINE__); - return false; - break; - } - $this->DebugMessage('EXIF auto-rotate set to '.$rotate_angle.' degrees ($exif_data[Orientation] = "'.@$exif_data['Orientation'].'")', __FILE__, __LINE__); - } else { - $this->DebugMessage('failed: exif_read_data('.$this->sourceFilename.')', __FILE__, __LINE__); - return false; - } - } else { - $this->DebugMessage('!function_exists(exif_read_data)', __FILE__, __LINE__); - return false; - } - } else { - $this->DebugMessage('Cannot auto-rotate from EXIF data because $this->sourceFilename is empty', __FILE__, __LINE__); - return false; - } - } else { - $this->DebugMessage('Cannot auto-rotate from EXIF data because PHP is less than v4.2.0 ('.phpversion().')', __FILE__, __LINE__); - return false; - } - } elseif (($this->ar == 'l') && ($this->source_height > $this->source_width)) { - $rotate_angle = 270; - } elseif (($this->ar == 'L') && ($this->source_height > $this->source_width)) { - $rotate_angle = 90; - } elseif (($this->ar == 'p') && ($this->source_width > $this->source_height)) { - $rotate_angle = 90; - } elseif (($this->ar == 'P') && ($this->source_width > $this->source_height)) { - $rotate_angle = 270; - } - - } - if ($rotate_angle % 90) { - $this->is_alpha = true; - } - phpthumb_filters::ImprovedImageRotate($this->gdimg_source, $rotate_angle, $this->config_background_hexcolor, $this->bg); - $this->source_width = ImageSX($this->gdimg_source); - $this->source_height = ImageSY($this->gdimg_source); - } - return true; - } - - - function FixedAspectRatio() { - // optional fixed-dimension images (regardless of aspect ratio) - - if (!$this->far) { - // do nothing - return true; - } - - if (!$this->w || !$this->h) { - return false; - } - $this->thumbnail_width = $this->w; - $this->thumbnail_height = $this->h; - $this->is_alpha = true; - if ($this->thumbnail_image_width >= $this->thumbnail_width) { - - if ($this->w) { - $aspectratio = $this->thumbnail_image_height / $this->thumbnail_image_width; - $this->thumbnail_image_height = round($this->thumbnail_image_width * $aspectratio); - $this->thumbnail_height = ($this->h ? $this->h : $this->thumbnail_image_height); - } elseif ($this->thumbnail_image_height < $this->thumbnail_height) { - $this->thumbnail_image_height = $this->thumbnail_height; - $this->thumbnail_image_width = round($this->thumbnail_image_height / $aspectratio); - } - - } else { - if ($this->h) { - $aspectratio = $this->thumbnail_image_width / $this->thumbnail_image_height; - $this->thumbnail_image_width = round($this->thumbnail_image_height * $aspectratio); - } elseif ($this->thumbnail_image_width < $this->thumbnail_width) { - $this->thumbnail_image_width = $this->thumbnail_width; - $this->thumbnail_image_height = round($this->thumbnail_image_width / $aspectratio); - } - - } - return true; - } - - - function OffsiteDomainIsAllowed($hostname, $allowed_domains) { - static $domain_is_allowed = array(); - $hostname = strtolower($hostname); - if (!isset($domain_is_allowed[$hostname])) { - $domain_is_allowed[$hostname] = false; - foreach ($allowed_domains as $valid_domain) { - $starpos = strpos($valid_domain, '*'); - if ($starpos !== false) { - $valid_domain = substr($valid_domain, $starpos + 1); - if (preg_match('/'.$valid_domain.'$/i', $hostname)) { - $domain_is_allowed[$hostname] = true; - break; - } - } else { - if (strtolower($valid_domain) === $hostname) { - $domain_is_allowed[$hostname] = true; - break; - } - } - } - } - return $domain_is_allowed[$hostname]; - } - - - function AntiOffsiteLinking() { - // Optional anti-offsite hijacking of the thumbnail script - $allow = true; - if ($allow && $this->config_nooffsitelink_enabled && (@$_SERVER['HTTP_REFERER'] || $this->config_nooffsitelink_require_refer)) { - $this->DebugMessage('AntiOffsiteLinking() checking $_SERVER[HTTP_REFERER] "'.@$_SERVER['HTTP_REFERER'].'"', __FILE__, __LINE__); - foreach ($this->config_nooffsitelink_valid_domains as $key => $valid_domain) { - // $_SERVER['HTTP_HOST'] contains the port number, so strip it out here to make default configuration work - list($clean_domain) = explode(':', $valid_domain); - $this->config_nooffsitelink_valid_domains[$key] = $clean_domain; - } - $parsed_url = phpthumb_functions::ParseURLbetter(@$_SERVER['HTTP_REFERER']); - if (!$this->OffsiteDomainIsAllowed(@$parsed_url['host'], $this->config_nooffsitelink_valid_domains)) { - $allow = false; - $erase = $this->config_nooffsitelink_erase_image; - $message = $this->config_nooffsitelink_text_message; -$this->ErrorImage('AntiOffsiteLinking() - "'.@$parsed_url['host'].'" is NOT in $this->config_nooffsitelink_valid_domains ('.implode(';', $this->config_nooffsitelink_valid_domains).')'); -exit; - $this->DebugMessage('AntiOffsiteLinking() - "'.@$parsed_url['host'].'" is NOT in $this->config_nooffsitelink_valid_domains ('.implode(';', $this->config_nooffsitelink_valid_domains).')', __FILE__, __LINE__); - } else { - $this->DebugMessage('AntiOffsiteLinking() - "'.@$parsed_url['host'].'" is in $this->config_nooffsitelink_valid_domains ('.implode(';', $this->config_nooffsitelink_valid_domains).')', __FILE__, __LINE__); - } - } - - if ($allow && $this->config_nohotlink_enabled && preg_match('/^(f|ht)tps?\:\/\//i', $this->src)) { - $parsed_url = phpthumb_functions::ParseURLbetter($this->src); - //if (!phpthumb_functions::CaseInsensitiveInArray(@$parsed_url['host'], $this->config_nohotlink_valid_domains)) { - if (!$this->OffsiteDomainIsAllowed(@$parsed_url['host'], $this->config_nohotlink_valid_domains)) { - // This domain is not allowed - $allow = false; - $erase = $this->config_nohotlink_erase_image; - $message = $this->config_nohotlink_text_message; - $this->DebugMessage('AntiOffsiteLinking() - "'.$parsed_url['host'].'" is NOT in $this->config_nohotlink_valid_domains ('.implode(';', $this->config_nohotlink_valid_domains).')', __FILE__, __LINE__); - } else { - $this->DebugMessage('AntiOffsiteLinking() - "'.$parsed_url['host'].'" is in $this->config_nohotlink_valid_domains ('.implode(';', $this->config_nohotlink_valid_domains).')', __FILE__, __LINE__); - } - } - - if ($allow) { - $this->DebugMessage('AntiOffsiteLinking() says this is allowed', __FILE__, __LINE__); - return true; - } - - if (!phpthumb_functions::IsHexColor($this->config_error_bgcolor)) { - return $this->ErrorImage('Invalid hex color string "'.$this->config_error_bgcolor.'" for $this->config_error_bgcolor'); - } - if (!phpthumb_functions::IsHexColor($this->config_error_textcolor)) { - return $this->ErrorImage('Invalid hex color string "'.$this->config_error_textcolor.'" for $this->config_error_textcolor'); - } - if ($erase) { - - return $this->ErrorImage($message, $this->thumbnail_width, $this->thumbnail_height, $this->config_error_bgcolor, $this->config_error_textcolor, $this->config_error_fontsize); - - } else { - - $this->config_nooffsitelink_watermark_src = $this->ResolveFilenameToAbsolute($this->config_nooffsitelink_watermark_src); - if (is_file($this->config_nooffsitelink_watermark_src)) { - - if (!include_once(dirname(__FILE__).'/phpthumb.filters.php')) { - $this->DebugMessage('Error including "'.dirname(__FILE__).'/phpthumb.filters.php" which is required for applying watermark', __FILE__, __LINE__); - return false; - } - $watermark_img = $this->ImageCreateFromStringReplacement(file_get_contents($this->config_nooffsitelink_watermark_src)); - $phpthumbFilters = new phpthumb_filters(); - $phpthumbFilters->phpThumbObject = &$this; - $opacity = 50; - $margin = 5; - $phpthumbFilters->WatermarkOverlay($this->gdimg_output, $watermark_img, '*', $opacity, $margin); - ImageDestroy($watermark_img); - unset($phpthumbFilters); - - } else { - - $nohotlink_text_array = explode("\n", wordwrap($message, floor($this->thumbnail_width / ImageFontWidth($this->config_error_fontsize)), "\n")); - $nohotlink_text_color = phpthumb_functions::ImageHexColorAllocate($this->gdimg_output, $this->config_error_textcolor); - - $topoffset = round(($this->thumbnail_height - (count($nohotlink_text_array) * ImageFontHeight($this->config_error_fontsize))) / 2); - - $rowcounter = 0; - $this->DebugMessage('AntiOffsiteLinking() writing '.count($nohotlink_text_array).' lines of text "'.$message.'" (in #'.$this->config_error_textcolor.') on top of image', __FILE__, __LINE__); - foreach ($nohotlink_text_array as $textline) { - $leftoffset = max(0, round(($this->thumbnail_width - (strlen($textline) * ImageFontWidth($this->config_error_fontsize))) / 2)); - ImageString($this->gdimg_output, $this->config_error_fontsize, $leftoffset, $topoffset + ($rowcounter++ * ImageFontHeight($this->config_error_fontsize)), $textline, $nohotlink_text_color); - } - - } - - } - return true; - } - - - function AlphaChannelFlatten() { - if (!$this->is_alpha) { - // image doesn't have alpha transparency, no need to flatten - $this->DebugMessage('skipping AlphaChannelFlatten() because !$this->is_alpha', __FILE__, __LINE__); - return false; - } - switch ($this->thumbnailFormat) { - case 'png': - case 'ico': - // image has alpha transparency, but output as PNG or ICO which can handle it - $this->DebugMessage('skipping AlphaChannelFlatten() because ($this->thumbnailFormat == "'.$this->thumbnailFormat.'")', __FILE__, __LINE__); - return false; - break; - - case 'gif': - // image has alpha transparency, but output as GIF which can handle only single-color transparency - $CurrentImageColorTransparent = ImageColorTransparent($this->gdimg_output); - if ($CurrentImageColorTransparent == -1) { - // no transparent color defined - - if (phpthumb_functions::gd_version() < 2.0) { - $this->DebugMessage('AlphaChannelFlatten() failed because GD version is "'.phpthumb_functions::gd_version().'"', __FILE__, __LINE__); - return false; - } - - if ($img_alpha_mixdown_dither = @ImageCreateTrueColor(ImageSX($this->gdimg_output), ImageSY($this->gdimg_output))) { - - for ($i = 0; $i <= 255; $i++) { - $dither_color[$i] = ImageColorAllocate($img_alpha_mixdown_dither, $i, $i, $i); - } - - // scan through current truecolor image copy alpha channel to temp image as grayscale - for ($x = 0; $x < $this->thumbnail_width; $x++) { - for ($y = 0; $y < $this->thumbnail_height; $y++) { - $PixelColor = phpthumb_functions::GetPixelColor($this->gdimg_output, $x, $y); - ImageSetPixel($img_alpha_mixdown_dither, $x, $y, $dither_color[($PixelColor['alpha'] * 2)]); - } - } - - // dither alpha channel grayscale version down to 2 colors - ImageTrueColorToPalette($img_alpha_mixdown_dither, true, 2); - - // reduce color palette to 256-1 colors (leave one palette position for transparent color) - ImageTrueColorToPalette($this->gdimg_output, true, 255); - - // allocate a new color for transparent color index - $TransparentColor = ImageColorAllocate($this->gdimg_output, 1, 254, 253); - ImageColorTransparent($this->gdimg_output, $TransparentColor); - - // scan through alpha channel image and note pixels with >50% transparency - $TransparentPixels = array(); - for ($x = 0; $x < $this->thumbnail_width; $x++) { - for ($y = 0; $y < $this->thumbnail_height; $y++) { - $AlphaChannelPixel = phpthumb_functions::GetPixelColor($img_alpha_mixdown_dither, $x, $y); - if ($AlphaChannelPixel['red'] > 127) { - ImageSetPixel($this->gdimg_output, $x, $y, $TransparentColor); - } - } - } - ImageDestroy($img_alpha_mixdown_dither); - - $this->DebugMessage('AlphaChannelFlatten() set image to 255+1 colors with transparency for GIF output', __FILE__, __LINE__); - return true; - - } else { - $this->DebugMessage('AlphaChannelFlatten() failed ImageCreate('.ImageSX($this->gdimg_output).', '.ImageSY($this->gdimg_output).')', __FILE__, __LINE__); - return false; - } - - } else { - // a single transparent color already defined, leave as-is - $this->DebugMessage('skipping AlphaChannelFlatten() because ($this->thumbnailFormat == "'.$this->thumbnailFormat.'") and ImageColorTransparent returned "'.$CurrentImageColorTransparent.'"', __FILE__, __LINE__); - return true; - } - break; - } - $this->DebugMessage('continuing AlphaChannelFlatten() for output format "'.$this->thumbnailFormat.'"', __FILE__, __LINE__); - // image has alpha transparency, and is being output in a format that doesn't support it -- flatten - if ($gdimg_flatten_temp = phpthumb_functions::ImageCreateFunction($this->thumbnail_width, $this->thumbnail_height)) { - - $this->config_background_hexcolor = ($this->bg ? $this->bg : $this->config_background_hexcolor); - if (!phpthumb_functions::IsHexColor($this->config_background_hexcolor)) { - return $this->ErrorImage('Invalid hex color string "'.$this->config_background_hexcolor.'" for parameter "bg"'); - } - $background_color = phpthumb_functions::ImageHexColorAllocate($this->gdimg_output, $this->config_background_hexcolor); - ImageFilledRectangle($gdimg_flatten_temp, 0, 0, $this->thumbnail_width, $this->thumbnail_height, $background_color); - ImageCopy($gdimg_flatten_temp, $this->gdimg_output, 0, 0, 0, 0, $this->thumbnail_width, $this->thumbnail_height); - - ImageAlphaBlending($this->gdimg_output, true); - ImageSaveAlpha($this->gdimg_output, false); - ImageColorTransparent($this->gdimg_output, -1); - ImageCopy($this->gdimg_output, $gdimg_flatten_temp, 0, 0, 0, 0, $this->thumbnail_width, $this->thumbnail_height); - - ImageDestroy($gdimg_flatten_temp); - return true; - - } else { - $this->DebugMessage('ImageCreateFunction() failed', __FILE__, __LINE__); - } - return false; - } - - - function ApplyFilters() { - if ($this->fltr && is_array($this->fltr)) { - if (!include_once(dirname(__FILE__).'/phpthumb.filters.php')) { - $this->DebugMessage('Error including "'.dirname(__FILE__).'/phpthumb.filters.php" which is required for applying filters ('.implode(';', $this->fltr).')', __FILE__, __LINE__); - return false; - } - $phpthumbFilters = new phpthumb_filters(); - $phpthumbFilters->phpThumbObject = &$this; - foreach ($this->fltr as $filtercommand) { - @list($command, $parameter) = explode('|', $filtercommand, 2); - $this->DebugMessage('Attempting to process filter command "'.$command.'('.$parameter.')"', __FILE__, __LINE__); - switch ($command) { - case 'brit': // Brightness - $phpthumbFilters->Brightness($this->gdimg_output, $parameter); - break; - - case 'cont': // Contrast - $phpthumbFilters->Contrast($this->gdimg_output, $parameter); - break; - - case 'ds': // Desaturation - $phpthumbFilters->Desaturate($this->gdimg_output, $parameter, ''); - break; - - case 'sat': // Saturation - $phpthumbFilters->Saturation($this->gdimg_output, $parameter, ''); - break; - - case 'gray': // Grayscale - $phpthumbFilters->Grayscale($this->gdimg_output); - break; - - case 'clr': // Colorize - if (phpthumb_functions::gd_version() < 2) { - $this->DebugMessage('Skipping Colorize() because gd_version is "'.phpthumb_functions::gd_version().'"', __FILE__, __LINE__); - break; - } - @list($amount, $color) = explode('|', $parameter); - $phpthumbFilters->Colorize($this->gdimg_output, $amount, $color); - break; - - case 'sep': // Sepia - if (phpthumb_functions::gd_version() < 2) { - $this->DebugMessage('Skipping Sepia() because gd_version is "'.phpthumb_functions::gd_version().'"', __FILE__, __LINE__); - break; - } - @list($amount, $color) = explode('|', $parameter); - $phpthumbFilters->Sepia($this->gdimg_output, $amount, $color); - break; - - case 'gam': // Gamma correction - $phpthumbFilters->Gamma($this->gdimg_output, $parameter); - break; - - case 'neg': // Negative colors - $phpthumbFilters->Negative($this->gdimg_output); - break; - - case 'th': // Threshold - $phpthumbFilters->Threshold($this->gdimg_output, $parameter); - break; - - case 'rcd': // ReduceColorDepth - if (phpthumb_functions::gd_version() < 2) { - $this->DebugMessage('Skipping ReduceColorDepth() because gd_version is "'.phpthumb_functions::gd_version().'"', __FILE__, __LINE__); - break; - } - @list($colors, $dither) = explode('|', $parameter); - $colors = ($colors ? (int) $colors : 256); - $dither = ((strlen($dither) > 0) ? (bool) $dither : true); - $phpthumbFilters->ReduceColorDepth($this->gdimg_output, $colors, $dither); - break; - - case 'flip': // Flip - $phpthumbFilters->Flip($this->gdimg_output, (strpos(strtolower($parameter), 'x') !== false), (strpos(strtolower($parameter), 'y') !== false)); - break; - - case 'edge': // EdgeDetect - $phpthumbFilters->EdgeDetect($this->gdimg_output); - break; - - case 'emb': // Emboss - $phpthumbFilters->Emboss($this->gdimg_output); - break; - - case 'bvl': // Bevel - @list($width, $color1, $color2) = explode('|', $parameter); - $phpthumbFilters->Bevel($this->gdimg_output, $width, $color1, $color2); - break; - - case 'lvl': // autoLevels - @list($band, $method, $threshold) = explode('|', $parameter); - $band = ($band ? preg_replace('/[^RGBA\\*]/', '', strtoupper($band)) : '*'); - $method = ((strlen($method) > 0) ? intval($method) : 2); - $threshold = ((strlen($threshold) > 0) ? floatval($threshold) : 0.1); - - $phpthumbFilters->HistogramStretch($this->gdimg_output, $band, $method, $threshold); - break; - - case 'wb': // WhiteBalance - $phpthumbFilters->WhiteBalance($this->gdimg_output, $parameter); - break; - - case 'hist': // Histogram overlay - if (phpthumb_functions::gd_version() < 2) { - $this->DebugMessage('Skipping HistogramOverlay() because gd_version is "'.phpthumb_functions::gd_version().'"', __FILE__, __LINE__); - break; - } - @list($bands, $colors, $width, $height, $alignment, $opacity, $margin_x, $margin_y) = explode('|', $parameter); - $bands = ($bands ? $bands : '*'); - $colors = ($colors ? $colors : ''); - $width = ($width ? $width : 0.25); - $height = ($height ? $height : 0.25); - $alignment = ($alignment ? $alignment : 'BR'); - $opacity = ($opacity ? $opacity : 50); - $margin_x = ($margin_x ? $margin_x : 5); - $margin_y = $margin_y; // just to note it wasn't forgotten, but let the value always pass unchanged - $phpthumbFilters->HistogramOverlay($this->gdimg_output, $bands, $colors, $width, $height, $alignment, $opacity, $margin_x, $margin_y); - break; - - case 'fram': // Frame - @list($frame_width, $edge_width, $color_frame, $color1, $color2) = explode('|', $parameter); - $phpthumbFilters->Frame($this->gdimg_output, $frame_width, $edge_width, $color_frame, $color1, $color2); - break; - - case 'drop': // DropShadow - if (phpthumb_functions::gd_version() < 2) { - $this->DebugMessage('Skipping DropShadow() because gd_version is "'.phpthumb_functions::gd_version().'"', __FILE__, __LINE__); - return false; - } - $this->is_alpha = true; - @list($distance, $width, $color, $angle, $fade) = explode('|', $parameter); - $phpthumbFilters->DropShadow($this->gdimg_output, $distance, $width, $color, $angle, $fade); - break; - - case 'mask': // Mask cropping - if (phpthumb_functions::gd_version() < 2) { - $this->DebugMessage('Skipping Mask() because gd_version is "'.phpthumb_functions::gd_version().'"', __FILE__, __LINE__); - return false; - } - $mask_filename = $this->ResolveFilenameToAbsolute($parameter); - if (@is_readable($mask_filename) && ($fp_mask = @fopen($mask_filename, 'rb'))) { - $MaskImageData = ''; - do { - $buffer = fread($fp_mask, 8192); - $MaskImageData .= $buffer; - } while (strlen($buffer) > 0); - fclose($fp_mask); - if ($gdimg_mask = $this->ImageCreateFromStringReplacement($MaskImageData)) { - $this->is_alpha = true; - $phpthumbFilters->ApplyMask($gdimg_mask, $this->gdimg_output); - ImageDestroy($gdimg_mask); - } else { - $this->DebugMessage('ImageCreateFromStringReplacement() failed for "'.$mask_filename.'"', __FILE__, __LINE__); - } - } else { - $this->DebugMessage('Cannot open mask file "'.$mask_filename.'"', __FILE__, __LINE__); - } - break; - - case 'elip': // Elipse cropping - if (phpthumb_functions::gd_version() < 2) { - $this->DebugMessage('Skipping Elipse() because gd_version is "'.phpthumb_functions::gd_version().'"', __FILE__, __LINE__); - return false; - } - $this->is_alpha = true; - $phpthumbFilters->Elipse($this->gdimg_output); - break; - - case 'ric': // RoundedImageCorners - if (phpthumb_functions::gd_version() < 2) { - $this->DebugMessage('Skipping RoundedImageCorners() because gd_version is "'.phpthumb_functions::gd_version().'"', __FILE__, __LINE__); - return false; - } - @list($radius_x, $radius_y) = explode('|', $parameter); - if (($radius_x < 1) || ($radius_y < 1)) { - $this->DebugMessage('Skipping RoundedImageCorners('.$radius_x.', '.$radius_y.') because x/y radius is less than 1', __FILE__, __LINE__); - break; - } - $this->is_alpha = true; - $phpthumbFilters->RoundedImageCorners($this->gdimg_output, $radius_x, $radius_y); - break; - - case 'crop': // Crop - @list($left, $right, $top, $bottom) = explode('|', $parameter); - $phpthumbFilters->Crop($this->gdimg_output, $left, $right, $top, $bottom); - break; - - case 'bord': // Border - @list($border_width, $radius_x, $radius_y, $hexcolor_border) = explode('|', $parameter); - $this->is_alpha = true; - $phpthumbFilters->ImageBorder($this->gdimg_output, $border_width, $radius_x, $radius_y, $hexcolor_border); - break; - - case 'over': // Overlay - @list($filename, $underlay, $margin, $opacity) = explode('|', $parameter); - $underlay = (bool) ($underlay ? $underlay : false); - $margin = ((strlen($margin) > 0) ? $margin : ($underlay ? 0.1 : 0.0)); - $opacity = ((strlen($opacity) > 0) ? $opacity : 100); - if (($margin > 0) && ($margin < 1)) { - $margin = min(0.499, $margin); - } elseif (($margin > -1) && ($margin < 0)) { - $margin = max(-0.499, $margin); - } - - $filename = $this->ResolveFilenameToAbsolute($filename); - if (@is_readable($filename) && ($fp_watermark = @fopen($filename, 'rb'))) { - $WatermarkImageData = ''; - do { - $buffer = fread($fp_watermark, 8192); - $WatermarkImageData .= $buffer; - } while (strlen($buffer) > 0); - fclose($fp_watermark); - if ($img_watermark = $this->ImageCreateFromStringReplacement($WatermarkImageData)) { - if ($margin < 1) { - $resized_x = max(1, ImageSX($this->gdimg_output) - round(2 * (ImageSX($this->gdimg_output) * $margin))); - $resized_y = max(1, ImageSY($this->gdimg_output) - round(2 * (ImageSY($this->gdimg_output) * $margin))); - } else { - $resized_x = max(1, ImageSX($this->gdimg_output) - round(2 * $margin)); - $resized_y = max(1, ImageSY($this->gdimg_output) - round(2 * $margin)); - } - - if ($underlay) { - - if ($img_watermark_resized = phpthumb_functions::ImageCreateFunction(ImageSX($this->gdimg_output), ImageSY($this->gdimg_output))) { - ImageAlphaBlending($img_watermark_resized, false); - ImageSaveAlpha($img_watermark_resized, true); - $this->ImageResizeFunction($img_watermark_resized, $img_watermark, 0, 0, 0, 0, ImageSX($img_watermark_resized), ImageSY($img_watermark_resized), ImageSX($img_watermark), ImageSY($img_watermark)); - if ($img_source_resized = phpthumb_functions::ImageCreateFunction($resized_x, $resized_y)) { - ImageAlphaBlending($img_source_resized, false); - ImageSaveAlpha($img_source_resized, true); - $this->ImageResizeFunction($img_source_resized, $this->gdimg_output, 0, 0, 0, 0, ImageSX($img_source_resized), ImageSY($img_source_resized), ImageSX($this->gdimg_output), ImageSY($this->gdimg_output)); - $phpthumbFilters->WatermarkOverlay($img_watermark_resized, $img_source_resized, 'C', $opacity, $margin); - ImageCopy($this->gdimg_output, $img_watermark_resized, 0, 0, 0, 0, ImageSX($this->gdimg_output), ImageSY($this->gdimg_output)); - } else { - $this->DebugMessage('phpthumb_functions::ImageCreateFunction('.$resized_x.', '.$resized_y.')', __FILE__, __LINE__); - } - ImageDestroy($img_watermark_resized); - } else { - $this->DebugMessage('phpthumb_functions::ImageCreateFunction('.ImageSX($this->gdimg_output).', '.ImageSY($this->gdimg_output).')', __FILE__, __LINE__); - } - - } else { // overlay - - if ($img_watermark_resized = phpthumb_functions::ImageCreateFunction($resized_x, $resized_y)) { - ImageAlphaBlending($img_watermark_resized, false); - ImageSaveAlpha($img_watermark_resized, true); - $this->ImageResizeFunction($img_watermark_resized, $img_watermark, 0, 0, 0, 0, ImageSX($img_watermark_resized), ImageSY($img_watermark_resized), ImageSX($img_watermark), ImageSY($img_watermark)); - $phpthumbFilters->WatermarkOverlay($this->gdimg_output, $img_watermark_resized, 'C', $opacity, $margin); - ImageDestroy($img_watermark_resized); - } else { - $this->DebugMessage('phpthumb_functions::ImageCreateFunction('.$resized_x.', '.$resized_y.')', __FILE__, __LINE__); - } - - } - ImageDestroy($img_watermark); - - } else { - $this->DebugMessage('ImageCreateFromStringReplacement() failed for "'.$filename.'"', __FILE__, __LINE__); - } - } else { - $this->DebugMessage('Cannot open overlay file "'.$filename.'"', __FILE__, __LINE__); - } - break; - - case 'wmi': // WaterMarkImage - @list($filename, $alignment, $opacity, $margin['x'], $margin['y'], $rotate_angle) = explode('|', $parameter); - // $margin can be pixel margin or percent margin if $alignment is text, or max width/height if $alignment is position like "50x75" - $alignment = ($alignment ? $alignment : 'BR'); - $opacity = (strlen($opacity) ? intval($opacity) : 50); - $rotate_angle = (strlen($rotate_angle) ? intval($rotate_angle) : 0); - if (!preg_match('/^([0-9\\.\\-]*)x([0-9\\.\\-]*)$/i', $alignment, $matches)) { - $margins = array('x', 'y'); - foreach ($margins as $xy) { - $margin[$xy] = (strlen($margin[$xy]) ? $margin[$xy] : 5); - if (($margin[$xy] > 0) && ($margin[$xy] < 1)) { - $margin[$xy] = min(0.499, $margin[$xy]); - } elseif (($margin[$xy] > -1) && ($margin[$xy] < 0)) { - $margin[$xy] = max(-0.499, $margin[$xy]); - } - } - } - - $filename = $this->ResolveFilenameToAbsolute($filename); - if (@is_readable($filename)) { - if ($img_watermark = $this->ImageCreateFromFilename($filename)) { - if ($rotate_angle !== 0) { - $phpthumbFilters->ImprovedImageRotate($img_watermark, $rotate_angle); - } - if (preg_match('/^([0-9\\.\\-]*)x([0-9\\.\\-]*)$/i', $alignment, $matches)) { - $watermark_max_width = intval($margin['x'] ? $margin['x'] : ImageSX($img_watermark)); - $watermark_max_height = intval($margin['y'] ? $margin['y'] : ImageSY($img_watermark)); - $scale = phpthumb_functions::ScaleToFitInBox(ImageSX($img_watermark), ImageSY($img_watermark), $watermark_max_width, $watermark_max_height, true, true); - $this->DebugMessage('Scaling watermark by a factor of '.number_format($scale, 4), __FILE__, __LINE__); - if (($scale > 1) || ($scale < 1)) { - if ($img_watermark2 = phpthumb_functions::ImageCreateFunction($scale * ImageSX($img_watermark), $scale * ImageSY($img_watermark))) { - ImageAlphaBlending($img_watermark2, false); - ImageSaveAlpha($img_watermark2, true); - $this->ImageResizeFunction($img_watermark2, $img_watermark, 0, 0, 0, 0, ImageSX($img_watermark2), ImageSY($img_watermark2), ImageSX($img_watermark), ImageSY($img_watermark)); - $img_watermark = $img_watermark2; - } else { - $this->DebugMessage('ImageCreateFunction('.($scale * ImageSX($img_watermark)).', '.($scale * ImageSX($img_watermark)).') failed', __FILE__, __LINE__); - } - } - $watermark_dest_x = round($matches[1] - (ImageSX($img_watermark) / 2)); - $watermark_dest_y = round($matches[2] - (ImageSY($img_watermark) / 2)); - $alignment = $watermark_dest_x.'x'.$watermark_dest_y; - } - $phpthumbFilters->WatermarkOverlay($this->gdimg_output, $img_watermark, $alignment, $opacity, $margin['x'], $margin['y']); - ImageDestroy($img_watermark); - if (isset($img_watermark2) && is_resource($img_watermark2)) { - ImageDestroy($img_watermark2); - } - } else { - $this->DebugMessage('ImageCreateFromFilename() failed for "'.$filename.'"', __FILE__, __LINE__); - } - } else { - $this->DebugMessage('!is_readable('.$filename.')', __FILE__, __LINE__); - } - break; - - case 'wmt': // WaterMarkText - @list($text, $size, $alignment, $hex_color, $ttffont, $opacity, $margin, $angle, $bg_color, $bg_opacity, $fillextend) = explode('|', $parameter); - $text = ($text ? $text : ''); - $size = ($size ? $size : 3); - $alignment = ($alignment ? $alignment : 'BR'); - $hex_color = ($hex_color ? $hex_color : '000000'); - $ttffont = ($ttffont ? $ttffont : ''); - $opacity = (strlen($opacity) ? $opacity : 50); - $margin = (strlen($margin) ? $margin : 5); - $angle = (strlen($angle) ? $angle : 0); - $bg_color = ($bg_color ? $bg_color : false); - $bg_opacity = ($bg_opacity ? $bg_opacity : 0); - $fillextend = ($fillextend ? $fillextend : ''); - - if (basename($ttffont) == $ttffont) { - $ttffont = realpath($this->config_ttf_directory.DIRECTORY_SEPARATOR.$ttffont); - } else { - $ttffont = $this->ResolveFilenameToAbsolute($ttffont); - } - $phpthumbFilters->WatermarkText($this->gdimg_output, $text, $size, $alignment, $hex_color, $ttffont, $opacity, $margin, $angle, $bg_color, $bg_opacity, $fillextend); - break; - - case 'blur': // Blur - @list($radius) = explode('|', $parameter); - $radius = ($radius ? $radius : 1); - if (phpthumb_functions::gd_version() >= 2) { - $phpthumbFilters->Blur($this->gdimg_output, $radius); - } else { - $this->DebugMessage('Skipping Blur() because gd_version is "'.phpthumb_functions::gd_version().'"', __FILE__, __LINE__); - //return false; - } - break; - - case 'size': // Resize - @list($newwidth, $newheight, $stretch) = explode('|', $parameter); - $newwidth = (!$newwidth ? ImageSX($this->gdimg_output) : ((($newwidth > 0) && ($newwidth < 1)) ? round($newwidth * ImageSX($this->gdimg_output)) : round($newwidth))); - $newheight = (!$newheight ? ImageSY($this->gdimg_output) : ((($newheight > 0) && ($newheight < 1)) ? round($newheight * ImageSY($this->gdimg_output)) : round($newheight))); - $stretch = ($stretch ? true : false); - if ($stretch) { - $scale_x = phpthumb_functions::ScaleToFitInBox(ImageSX($this->gdimg_output), ImageSX($this->gdimg_output), $newwidth, $newwidth, true, true); - $scale_y = phpthumb_functions::ScaleToFitInBox(ImageSY($this->gdimg_output), ImageSY($this->gdimg_output), $newheight, $newheight, true, true); - } else { - $scale_x = phpthumb_functions::ScaleToFitInBox(ImageSX($this->gdimg_output), ImageSY($this->gdimg_output), $newwidth, $newheight, true, true); - $scale_y = $scale_x; - } - $this->DebugMessage('Scaling watermark ('.($stretch ? 'with' : 'without').' stretch) by a factor of "'.number_format($scale_x, 4).' x '.number_format($scale_y, 4).'"', __FILE__, __LINE__); - if (($scale_x > 1) || ($scale_x < 1) || ($scale_y > 1) || ($scale_y < 1)) { - if ($img_temp = phpthumb_functions::ImageCreateFunction(ImageSX($this->gdimg_output), ImageSY($this->gdimg_output))) { - ImageCopy($img_temp, $this->gdimg_output, 0, 0, 0, 0, ImageSX($this->gdimg_output), ImageSY($this->gdimg_output)); - //ImageDestroy($this->gdimg_output); - if ($this->gdimg_output = phpthumb_functions::ImageCreateFunction($scale_x * ImageSX($img_temp), $scale_y * ImageSY($img_temp))) { - ImageAlphaBlending($this->gdimg_output, false); - ImageSaveAlpha($this->gdimg_output, true); - $this->ImageResizeFunction($this->gdimg_output, $img_temp, 0, 0, 0, 0, ImageSX($this->gdimg_output), ImageSY($this->gdimg_output), ImageSX($img_temp), ImageSY($img_temp)); - } else { - $this->DebugMessage('ImageCreateFunction('.($scale_x * ImageSX($img_temp)).', '.($scale_y * ImageSY($img_temp)).') failed', __FILE__, __LINE__); - } - ImageDestroy($img_temp); - } else { - $this->DebugMessage('ImageCreateFunction('.ImageSX($this->gdimg_output).', '.ImageSY($this->gdimg_output).') failed', __FILE__, __LINE__); - } - } - break; - - case 'gblr': // Gaussian Blur - $phpthumbFilters->BlurGaussian($this->gdimg_output); - break; - - case 'sblr': // Selective Blur - $phpthumbFilters->BlurSelective($this->gdimg_output); - break; - - case 'mean': // MeanRemoval blur - $phpthumbFilters->MeanRemoval($this->gdimg_output); - break; - - case 'smth': // Smooth blur - $phpthumbFilters->Smooth($this->gdimg_output, $parameter); - break; - - case 'usm': // UnSharpMask sharpening - @list($amount, $radius, $threshold) = explode('|', $parameter); - $amount = ($amount ? $amount : 80); - $radius = ($radius ? $radius : 0.5); - $threshold = (strlen($threshold) ? $threshold : 3); - if (phpthumb_functions::gd_version() >= 2.0) { - ob_start(); - if (!@include_once(dirname(__FILE__).'/phpthumb.unsharp.php')) { - $include_error = ob_get_contents(); - if ($include_error) { - $this->DebugMessage('include_once("'.dirname(__FILE__).'/phpthumb.unsharp.php") generated message: "'.$include_error.'"', __FILE__, __LINE__); - } - $this->DebugMessage('Error including "'.dirname(__FILE__).'/phpthumb.unsharp.php" which is required for unsharp masking', __FILE__, __LINE__); - ob_end_clean(); - return false; - } - ob_end_clean(); - phpUnsharpMask::applyUnsharpMask($this->gdimg_output, $amount, $radius, $threshold); - } else { - $this->DebugMessage('Skipping unsharp mask because gd_version is "'.phpthumb_functions::gd_version().'"', __FILE__, __LINE__); - return false; - } - break; - - case 'rot': // ROTate - @list($angle, $bgcolor) = explode('|', $parameter); - $phpthumbFilters->ImprovedImageRotate($this->gdimg_output, $angle, $bgcolor); - break; - - case 'stc': // Source Transparent Color - @list($hexcolor, $min_limit, $max_limit) = explode('|', $parameter); - if (!phpthumb_functions::IsHexColor($hexcolor)) { - $this->DebugMessage('Skipping SourceTransparentColor hex color is invalid ('.$hexcolor.')', __FILE__, __LINE__); - return false; - } - $min_limit = (strlen($min_limit) ? $min_limit : 5); - $max_limit = (strlen($max_limit) ? $max_limit : 10); - if ($gdimg_mask = $phpthumbFilters->SourceTransparentColorMask($this->gdimg_output, $hexcolor, $min_limit, $max_limit)) { - $this->is_alpha = true; - $phpthumbFilters->ApplyMask($gdimg_mask, $this->gdimg_output); - ImageDestroy($gdimg_mask); - } else { - $this->DebugMessage('SourceTransparentColorMask() failed for "'.$mask_filename.'"', __FILE__, __LINE__); - } - break; - } - $this->DebugMessage('Finished processing filter command "'.$command.'('.$parameter.')"', __FILE__, __LINE__); - } - } - return true; - } - - - function MaxFileSize() { - if (phpthumb_functions::gd_version() < 2) { - $this->DebugMessage('Skipping MaxFileSize() because gd_version is "'.phpthumb_functions::gd_version().'"', __FILE__, __LINE__); - return false; - } - if ($this->maxb > 0) { - switch ($this->thumbnailFormat) { - case 'png': - case 'gif': - $imgRenderFunction = 'image'.$this->thumbnailFormat; - - ob_start(); - $imgRenderFunction($this->gdimg_output); - $imgdata = ob_get_contents(); - ob_end_clean(); - - if (strlen($imgdata) > $this->maxb) { - for ($i = 8; $i >= 1; $i--) { - $tempIMG = ImageCreateTrueColor(ImageSX($this->gdimg_output), ImageSY($this->gdimg_output)); - ImageCopy($tempIMG, $this->gdimg_output, 0, 0, 0, 0, ImageSX($this->gdimg_output), ImageSY($this->gdimg_output)); - ImageTrueColorToPalette($tempIMG, true, pow(2, $i)); - ob_start(); - $imgRenderFunction($tempIMG); - $imgdata = ob_get_contents(); - ob_end_clean(); - - if (strlen($imgdata) <= $this->maxb) { - ImageTrueColorToPalette($this->gdimg_output, true, pow(2, $i)); - break; - } - } - } - if (strlen($imgdata) > $this->maxb) { - ImageTrueColorToPalette($this->gdimg_output, true, pow(2, $i)); - return false; - } - break; - - case 'jpeg': - ob_start(); - ImageJPEG($this->gdimg_output); - $imgdata = ob_get_contents(); - ob_end_clean(); - - $OriginalJPEGquality = $this->thumbnailQuality; - if (strlen($imgdata) > $this->maxb) { - for ($i = 3; $i < 20; $i++) { - $q = round(100 * (1 - log10($i / 2))); - ob_start(); - ImageJPEG($this->gdimg_output, '', $q); - $imgdata = ob_get_contents(); - ob_end_clean(); - - $this->thumbnailQuality = $q; - if (strlen($imgdata) <= $this->maxb) { - break; - } - } - } - if (strlen($imgdata) > $this->maxb) { - return false; - } - break; - - default: - return false; - break; - } - } - return true; - } - - - function CalculateThumbnailDimensions() { + $this->ImageResizeFunction( + $this->gdimg_output, + $this->gdimg_source, + $destination_offset_x, + $destination_offset_y, + $this->thumbnailCropX, + $this->thumbnailCropY, + $this->thumbnail_image_width, + $this->thumbnail_image_height, + $this->thumbnailCropW, + $this->thumbnailCropH + ); + + $this->DebugMessage('memory_get_usage() after copy-resize = '.(function_exists('memory_get_usage') ? @memory_get_usage() : 'n/a'), __FILE__, __LINE__); + ImageDestroy($this->gdimg_source); + $this->DebugMessage('memory_get_usage() after ImageDestroy = '.(function_exists('memory_get_usage') ? @memory_get_usage() : 'n/a'), __FILE__, __LINE__); + + $this->phpThumbDebug('8i'); + $this->AntiOffsiteLinking(); + $this->phpThumbDebug('8j'); + $this->ApplyFilters(); + $this->phpThumbDebug('8k'); + $this->AlphaChannelFlatten(); + $this->phpThumbDebug('8l'); + $this->MaxFileSize(); + $this->phpThumbDebug('8m'); + + $this->DebugMessage('GenerateThumbnail() completed successfully', __FILE__, __LINE__); + return true; + } + + + // public: + function RenderOutput() { + if (!$this->useRawIMoutput && !is_resource($this->gdimg_output)) { + $this->DebugMessage('RenderOutput() failed because !is_resource($this->gdimg_output)', __FILE__, __LINE__); + return false; + } + if (!$this->thumbnailFormat) { + $this->DebugMessage('RenderOutput() failed because $this->thumbnailFormat is empty', __FILE__, __LINE__); + return false; + } + if ($this->useRawIMoutput) { + $this->DebugMessage('RenderOutput copying $this->IMresizedData ('.strlen($this->IMresizedData).' bytes) to $this->outputImage', __FILE__, __LINE__); + $this->outputImageData = $this->IMresizedData; + return true; + } + + $builtin_formats = array(); + if (function_exists('ImageTypes')) { + $imagetypes = ImageTypes(); + $builtin_formats['wbmp'] = (bool) ($imagetypes & IMG_WBMP); + $builtin_formats['jpg'] = (bool) ($imagetypes & IMG_JPG); + $builtin_formats['gif'] = (bool) ($imagetypes & IMG_GIF); + $builtin_formats['png'] = (bool) ($imagetypes & IMG_PNG); + } + $this->DebugMessage('RenderOutput() attempting Image'.strtoupper(@$this->thumbnailFormat).'($this->gdimg_output)', __FILE__, __LINE__); + ob_start(); + switch ($this->thumbnailFormat) { + case 'wbmp': + if (!@$builtin_formats['wbmp']) { + $this->DebugMessage('GD does not have required built-in support for WBMP output', __FILE__, __LINE__); + ob_end_clean(); + return false; + } + ImageJPEG($this->gdimg_output, null, $this->thumbnailQuality); + $this->outputImageData = ob_get_contents(); + break; + + case 'jpeg': + case 'jpg': // should be "jpeg" not "jpg" but just in case... + if (!@$builtin_formats['jpg']) { + $this->DebugMessage('GD does not have required built-in support for JPEG output', __FILE__, __LINE__); + ob_end_clean(); + return false; + } + ImageJPEG($this->gdimg_output, null, $this->thumbnailQuality); + $this->outputImageData = ob_get_contents(); + break; + + case 'png': + if (!@$builtin_formats['png']) { + $this->DebugMessage('GD does not have required built-in support for PNG output', __FILE__, __LINE__); + ob_end_clean(); + return false; + } + ImagePNG($this->gdimg_output); + $this->outputImageData = ob_get_contents(); + break; + + case 'gif': + if (!@$builtin_formats['gif']) { + $this->DebugMessage('GD does not have required built-in support for GIF output', __FILE__, __LINE__); + ob_end_clean(); + return false; + } + ImageGIF($this->gdimg_output); + $this->outputImageData = ob_get_contents(); + break; + + case 'bmp': + $ImageOutFunction = '"builtin BMP output"'; + if (!@include_once(dirname(__FILE__).'/phpthumb.bmp.php')) { + $this->DebugMessage('Error including "'.dirname(__FILE__).'/phpthumb.bmp.php" which is required for BMP format output', __FILE__, __LINE__); + ob_end_clean(); + return false; + } + $phpthumb_bmp = new phpthumb_bmp(); + $this->outputImageData = $phpthumb_bmp->GD2BMPstring($this->gdimg_output); + unset($phpthumb_bmp); + break; + + case 'ico': + $ImageOutFunction = '"builtin ICO output"'; + if (!@include_once(dirname(__FILE__).'/phpthumb.ico.php')) { + $this->DebugMessage('Error including "'.dirname(__FILE__).'/phpthumb.ico.php" which is required for ICO format output', __FILE__, __LINE__); + ob_end_clean(); + return false; + } + $phpthumb_ico = new phpthumb_ico(); + $arrayOfOutputImages = array($this->gdimg_output); + $this->outputImageData = $phpthumb_ico->GD2ICOstring($arrayOfOutputImages); + unset($phpthumb_ico); + break; + + default: + $this->DebugMessage('RenderOutput failed because $this->thumbnailFormat "'.$this->thumbnailFormat.'" is not valid', __FILE__, __LINE__); + ob_end_clean(); + return false; + } + ob_end_clean(); + if (!$this->outputImageData) { + $this->DebugMessage('RenderOutput() for "'.$this->thumbnailFormat.'" failed', __FILE__, __LINE__); + ob_end_clean(); + return false; + } + $this->DebugMessage('RenderOutput() completing with $this->outputImageData = '.strlen($this->outputImageData).' bytes', __FILE__, __LINE__); + return true; + } + + + // public: + function RenderToFile($filename) { + if (preg_match('#^(f|ht)tps?\://#i', $filename)) { + $this->DebugMessage('RenderToFile() failed because $filename ('.$filename.') is a URL', __FILE__, __LINE__); + return false; + } + // render thumbnail to this file only, do not cache, do not output to browser + //$renderfilename = $this->ResolveFilenameToAbsolute(dirname($filename)).DIRECTORY_SEPARATOR.basename($filename); + $renderfilename = $filename; + if (($filename{0} != '/') && ($filename{0} != '\\') && ($filename{1} != ':')) { + $renderfilename = $this->ResolveFilenameToAbsolute($renderfilename); + } + if (!@is_writable(dirname($renderfilename))) { + $this->DebugMessage('RenderToFile() failed because "'.dirname($renderfilename).'/" is not writable', __FILE__, __LINE__); + return false; + } + if (@is_file($renderfilename) && !@is_writable($renderfilename)) { + $this->DebugMessage('RenderToFile() failed because "'.$renderfilename.'" is not writable', __FILE__, __LINE__); + return false; + } + + if ($this->RenderOutput()) { + if (file_put_contents($renderfilename, $this->outputImageData)) { + $this->DebugMessage('RenderToFile('.$renderfilename.') succeeded', __FILE__, __LINE__); + /*if trouble with chmod (infobox hoster)*/ + //chmod($renderfilename, 0644); + return true; + } + if (!@file_exists($renderfilename)) { + $this->DebugMessage('RenderOutput ['.$this->thumbnailFormat.'('.$renderfilename.')] did not appear to fail, but the output image does not exist either...', __FILE__, __LINE__); + } + } else { + $this->DebugMessage('RenderOutput ['.$this->thumbnailFormat.'('.$renderfilename.')] failed', __FILE__, __LINE__); + } + return false; + } + + + // public: + function OutputThumbnail() { + $this->purgeTempFiles(); + + if (!$this->useRawIMoutput && !is_resource($this->gdimg_output)) { + $this->DebugMessage('OutputThumbnail() failed because !is_resource($this->gdimg_output)', __FILE__, __LINE__); + return false; + } + if (headers_sent()) { + return $this->ErrorImage('OutputThumbnail() failed - headers already sent'); + exit; + } + + $downloadfilename = phpthumb_functions::SanitizeFilename(is_string($this->sia) ? $this->sia : ($this->down ? $this->down : 'phpThumb_generated_thumbnail'.'.'.$this->thumbnailFormat)); + $this->DebugMessage('Content-Disposition header filename set to "'.$downloadfilename.'"', __FILE__, __LINE__); + if ($downloadfilename) { + header('Content-Disposition: '.($this->down ? 'attachment' : 'inline').'; filename="'.$downloadfilename.'"'); + } else { + $this->DebugMessage('failed to send Content-Disposition header because $downloadfilename is empty', __FILE__, __LINE__); + } + + if ($this->useRawIMoutput) { + + header('Content-Type: '.phpthumb_functions::ImageTypeToMIMEtype($this->thumbnailFormat)); + echo $this->IMresizedData; + + } else { + + $this->DebugMessage('ImageInterlace($this->gdimg_output, '.intval($this->config_output_interlace).')', __FILE__, __LINE__); + ImageInterlace($this->gdimg_output, intval($this->config_output_interlace)); + switch ($this->thumbnailFormat) { + case 'jpeg': + header('Content-Type: '.phpthumb_functions::ImageTypeToMIMEtype($this->thumbnailFormat)); + $ImageOutFunction = 'image'.$this->thumbnailFormat; + @$ImageOutFunction($this->gdimg_output, '', $this->thumbnailQuality); + break; + + case 'png': + case 'gif': + header('Content-Type: '.phpthumb_functions::ImageTypeToMIMEtype($this->thumbnailFormat)); + $ImageOutFunction = 'image'.$this->thumbnailFormat; + @$ImageOutFunction($this->gdimg_output); + break; + + case 'bmp': + if (!@include_once(dirname(__FILE__).'/phpthumb.bmp.php')) { + $this->DebugMessage('Error including "'.dirname(__FILE__).'/phpthumb.bmp.php" which is required for BMP format output', __FILE__, __LINE__); + return false; + } + $phpthumb_bmp = new phpthumb_bmp(); + if (is_object($phpthumb_bmp)) { + $bmp_data = $phpthumb_bmp->GD2BMPstring($this->gdimg_output); + unset($phpthumb_bmp); + if (!$bmp_data) { + $this->DebugMessage('$phpthumb_bmp->GD2BMPstring() failed', __FILE__, __LINE__); + return false; + } + header('Content-Type: '.phpthumb_functions::ImageTypeToMIMEtype($this->thumbnailFormat)); + echo $bmp_data; + } else { + $this->DebugMessage('new phpthumb_bmp() failed', __FILE__, __LINE__); + return false; + } + break; + + case 'ico': + if (!@include_once(dirname(__FILE__).'/phpthumb.ico.php')) { + $this->DebugMessage('Error including "'.dirname(__FILE__).'/phpthumb.ico.php" which is required for ICO format output', __FILE__, __LINE__); + return false; + } + $phpthumb_ico = new phpthumb_ico(); + if (is_object($phpthumb_ico)) { + $arrayOfOutputImages = array($this->gdimg_output); + $ico_data = $phpthumb_ico->GD2ICOstring($arrayOfOutputImages); + unset($phpthumb_ico); + if (!$ico_data) { + $this->DebugMessage('$phpthumb_ico->GD2ICOstring() failed', __FILE__, __LINE__); + return false; + } + header('Content-Type: '.phpthumb_functions::ImageTypeToMIMEtype($this->thumbnailFormat)); + echo $ico_data; + } else { + $this->DebugMessage('new phpthumb_ico() failed', __FILE__, __LINE__); + return false; + } + break; + + default: + $this->DebugMessage('OutputThumbnail failed because $this->thumbnailFormat "'.$this->thumbnailFormat.'" is not valid', __FILE__, __LINE__); + return false; + break; + } + + } + return true; + } + + + // public: + function CleanUpCacheDirectory() { + $this->DebugMessage('CleanUpCacheDirectory() set to purge ('.(is_null($this->config_cache_maxage) ? 'NULL' : number_format($this->config_cache_maxage / 86400, 1)).' days; '.(is_null($this->config_cache_maxsize) ? 'NULL' : number_format($this->config_cache_maxsize / 1048576, 2)).' MB; '.(is_null($this->config_cache_maxfiles) ? 'NULL' : number_format($this->config_cache_maxfiles)).' files)', __FILE__, __LINE__); + + if (!is_writable($this->config_cache_directory)) { + $this->DebugMessage('CleanUpCacheDirectory() skipped because "'.$this->config_cache_directory.'" is not writable', __FILE__, __LINE__); + return true; + } + + // cache status of cache directory for 1 hour to avoid hammering the filesystem functions + $phpThumbCacheStats_filename = $this->config_cache_directory.DIRECTORY_SEPARATOR.'phpThumbCacheStats.txt'; + if (file_exists($phpThumbCacheStats_filename) && is_readable($phpThumbCacheStats_filename) && (filemtime($phpThumbCacheStats_filename) >= (time() - 3600))) { + $this->DebugMessage('CleanUpCacheDirectory() skipped because "'.$phpThumbCacheStats_filename.'" is recently modified', __FILE__, __LINE__); + return true; + } + touch($phpThumbCacheStats_filename); + + $DeletedKeys = array(); + $AllFilesInCacheDirectory = array(); + if (($this->config_cache_maxage > 0) || ($this->config_cache_maxsize > 0) || ($this->config_cache_maxfiles > 0)) { + $CacheDirOldFilesAge = array(); + $CacheDirOldFilesSize = array(); + $AllFilesInCacheDirectory = phpthumb_functions::GetAllFilesInSubfolders($this->config_cache_directory); + foreach ($AllFilesInCacheDirectory as $fullfilename) { + if (preg_match('#^'.preg_quote($this->config_cache_prefix).'#i', $fullfilename) && file_exists($fullfilename)) { + $CacheDirOldFilesAge[$fullfilename] = @fileatime($fullfilename); + if ($CacheDirOldFilesAge[$fullfilename] == 0) { + $CacheDirOldFilesAge[$fullfilename] = @filemtime($fullfilename); + } + $CacheDirOldFilesSize[$fullfilename] = @filesize($fullfilename); + } + } + if (empty($CacheDirOldFilesSize)) { + return true; + } + $DeletedKeys['zerobyte'] = array(); + foreach ($CacheDirOldFilesSize as $fullfilename => $filesize) { + // purge all zero-size files more than an hour old (to prevent trying to delete just-created and/or in-use files) + $cutofftime = time() - 3600; + if (($filesize == 0) && ($CacheDirOldFilesAge[$fullfilename] < $cutofftime)) { + $this->DebugMessage('deleting "'.$fullfilename.'"', __FILE__, __LINE__); + if (@unlink($fullfilename)) { + $DeletedKeys['zerobyte'][] = $fullfilename; + unset($CacheDirOldFilesSize[$fullfilename]); + unset($CacheDirOldFilesAge[$fullfilename]); + } + } + } + $this->DebugMessage('CleanUpCacheDirectory() purged '.count($DeletedKeys['zerobyte']).' zero-byte files', __FILE__, __LINE__); + asort($CacheDirOldFilesAge); + + if ($this->config_cache_maxfiles > 0) { + $TotalCachedFiles = count($CacheDirOldFilesAge); + $DeletedKeys['maxfiles'] = array(); + foreach ($CacheDirOldFilesAge as $fullfilename => $filedate) { + if ($TotalCachedFiles > $this->config_cache_maxfiles) { + $this->DebugMessage('deleting "'.$fullfilename.'"', __FILE__, __LINE__); + if (@unlink($fullfilename)) { + $TotalCachedFiles--; + $DeletedKeys['maxfiles'][] = $fullfilename; + } + } else { + // there are few enough files to keep the rest + break; + } + } + $this->DebugMessage('CleanUpCacheDirectory() purged '.count($DeletedKeys['maxfiles']).' files based on (config_cache_maxfiles='.$this->config_cache_maxfiles.')', __FILE__, __LINE__); + foreach ($DeletedKeys['maxfiles'] as $fullfilename) { + unset($CacheDirOldFilesAge[$fullfilename]); + unset($CacheDirOldFilesSize[$fullfilename]); + } + } + + if ($this->config_cache_maxage > 0) { + $mindate = time() - $this->config_cache_maxage; + $DeletedKeys['maxage'] = array(); + foreach ($CacheDirOldFilesAge as $fullfilename => $filedate) { + if ($filedate > 0) { + if ($filedate < $mindate) { + $this->DebugMessage('deleting "'.$fullfilename.'"', __FILE__, __LINE__); + if (@unlink($fullfilename)) { + $DeletedKeys['maxage'][] = $fullfilename; + } + } else { + // the rest of the files are new enough to keep + break; + } + } + } + $this->DebugMessage('CleanUpCacheDirectory() purged '.count($DeletedKeys['maxage']).' files based on (config_cache_maxage='.$this->config_cache_maxage.')', __FILE__, __LINE__); + foreach ($DeletedKeys['maxage'] as $fullfilename) { + unset($CacheDirOldFilesAge[$fullfilename]); + unset($CacheDirOldFilesSize[$fullfilename]); + } + } + + if ($this->config_cache_maxsize > 0) { + $TotalCachedFileSize = array_sum($CacheDirOldFilesSize); + $DeletedKeys['maxsize'] = array(); + foreach ($CacheDirOldFilesAge as $fullfilename => $filedate) { + if ($TotalCachedFileSize > $this->config_cache_maxsize) { + $this->DebugMessage('deleting "'.$fullfilename.'"', __FILE__, __LINE__); + if (@unlink($fullfilename)) { + $TotalCachedFileSize -= $CacheDirOldFilesSize[$fullfilename]; + $DeletedKeys['maxsize'][] = $fullfilename; + } + } else { + // the total filesizes are small enough to keep the rest of the files + break; + } + } + $this->DebugMessage('CleanUpCacheDirectory() purged '.count($DeletedKeys['maxsize']).' files based on (config_cache_maxsize='.$this->config_cache_maxsize.')', __FILE__, __LINE__); + foreach ($DeletedKeys['maxsize'] as $fullfilename) { + unset($CacheDirOldFilesAge[$fullfilename]); + unset($CacheDirOldFilesSize[$fullfilename]); + } + } + + } else { + $this->DebugMessage('skipping CleanUpCacheDirectory() because config set to not use it', __FILE__, __LINE__); + } + $totalpurged = 0; + foreach ($DeletedKeys as $key => $value) { + $totalpurged += count($value); + } + $this->DebugMessage('CleanUpCacheDirectory() purged '.$totalpurged.' files (from '.count($AllFilesInCacheDirectory).') based on config settings', __FILE__, __LINE__); + if ($totalpurged > 0) { + $empty_dirs = array(); + foreach ($AllFilesInCacheDirectory as $fullfilename) { + if (is_dir($fullfilename)) { + $empty_dirs[realpath($fullfilename)] = 1; + } else { + unset($empty_dirs[realpath(dirname($fullfilename))]); + } + } + krsort($empty_dirs); + $totalpurgeddirs = 0; + foreach ($empty_dirs as $empty_dir => $dummy) { + if ($empty_dir == $this->config_cache_directory) { + // shouldn't happen, but just in case, don't let it delete actual cache directory + continue; + } elseif (@rmdir($empty_dir)) { + $totalpurgeddirs++; + } else { + $this->DebugMessage('failed to rmdir('.$empty_dir.')', __FILE__, __LINE__); + } + } + $this->DebugMessage('purged '.$totalpurgeddirs.' empty directories', __FILE__, __LINE__); + } + return true; + } + + ////////////////////////////////////////////////////////////////////// + + // private: re-initializator (call between rendering multiple images with one object) + function resetObject() { + $class_vars = get_class_vars(get_class($this)); + foreach ($class_vars as $key => $value) { + // do not clobber debug or config info + if (!preg_match('#^(config_|debug|fatalerror)#i', $key)) { + $this->$key = $value; + } + } + $this->phpThumb(); // re-initialize some class variables + return true; + } + + ////////////////////////////////////////////////////////////////////// + + function ResolveSource() { + if (is_resource($this->gdimg_source)) { + $this->DebugMessage('ResolveSource() exiting because is_resource($this->gdimg_source)', __FILE__, __LINE__); + return true; + } + if ($this->rawImageData) { + $this->sourceFilename = null; + $this->DebugMessage('ResolveSource() exiting because $this->rawImageData is set ('.number_format(strlen($this->rawImageData)).' bytes)', __FILE__, __LINE__); + return true; + } + if ($this->sourceFilename) { + $this->sourceFilename = $this->ResolveFilenameToAbsolute($this->sourceFilename); + $this->DebugMessage('$this->sourceFilename set to "'.$this->sourceFilename.'"', __FILE__, __LINE__); + } elseif ($this->src) { + $this->sourceFilename = $this->ResolveFilenameToAbsolute($this->src); + $this->DebugMessage('$this->sourceFilename set to "'.$this->sourceFilename.'" from $this->src ('.$this->src.')', __FILE__, __LINE__); + } else { + return $this->ErrorImage('$this->sourceFilename and $this->src are both empty'); + } + if ($this->iswindows && ((substr($this->sourceFilename, 0, 2) == '//') || (substr($this->sourceFilename, 0, 2) == '\\\\'))) { + // Windows \\share\filename.ext + } elseif (preg_match('#^(f|ht)tps?\://#i', $this->sourceFilename)) { + // URL + if ($this->config_http_user_agent) { + ini_set('user_agent', $this->config_http_user_agent); + } + } elseif (!@file_exists($this->sourceFilename)) { + return $this->ErrorImage('"'.$this->sourceFilename.'" does not exist'); + } elseif (!@is_file($this->sourceFilename)) { + return $this->ErrorImage('"'.$this->sourceFilename.'" is not a file'); + } + return true; + } + + function setOutputFormat() { + static $alreadyCalled = false; + if ($this->thumbnailFormat && $alreadyCalled) { + return true; + } + $alreadyCalled = true; + + $AvailableImageOutputFormats = array(); + $AvailableImageOutputFormats[] = 'text'; + if (@is_readable(dirname(__FILE__).'/phpthumb.ico.php')) { + $AvailableImageOutputFormats[] = 'ico'; + } + if (@is_readable(dirname(__FILE__).'/phpthumb.bmp.php')) { + $AvailableImageOutputFormats[] = 'bmp'; + } + + $this->thumbnailFormat = 'ico'; + + // Set default output format based on what image types are available + if (function_exists('ImageTypes')) { + $imagetypes = ImageTypes(); + if ($imagetypes & IMG_WBMP) { + $this->thumbnailFormat = 'wbmp'; + $AvailableImageOutputFormats[] = 'wbmp'; + } + if ($imagetypes & IMG_GIF) { + $this->thumbnailFormat = 'gif'; + $AvailableImageOutputFormats[] = 'gif'; + } + if ($imagetypes & IMG_PNG) { + $this->thumbnailFormat = 'png'; + $AvailableImageOutputFormats[] = 'png'; + } + if ($imagetypes & IMG_JPG) { + $this->thumbnailFormat = 'jpeg'; + $AvailableImageOutputFormats[] = 'jpeg'; + } + } else { + //return $this->ErrorImage('ImageTypes() does not exist - GD support might not be enabled?'); + $this->DebugMessage('ImageTypes() does not exist - GD support might not be enabled?', __FILE__, __LINE__); + } + if ($this->ImageMagickVersion()) { + $IMformats = array('jpeg', 'png', 'gif', 'bmp', 'ico', 'wbmp'); + $this->DebugMessage('Addding ImageMagick formats to $AvailableImageOutputFormats ('.implode(';', $AvailableImageOutputFormats).')', __FILE__, __LINE__); + foreach ($IMformats as $key => $format) { + $AvailableImageOutputFormats[] = $format; + } + } + $AvailableImageOutputFormats = array_unique($AvailableImageOutputFormats); + $this->DebugMessage('$AvailableImageOutputFormats = array('.implode(';', $AvailableImageOutputFormats).')', __FILE__, __LINE__); + + $this->f = preg_replace('#[^a-z]#', '', strtolower($this->f)); + if (strtolower($this->config_output_format) == 'jpg') { + $this->config_output_format = 'jpeg'; + } + if (strtolower($this->f) == 'jpg') { + $this->f = 'jpeg'; + } + if (phpthumb_functions::CaseInsensitiveInArray($this->config_output_format, $AvailableImageOutputFormats)) { + // set output format to config default if that format is available + $this->DebugMessage('$this->thumbnailFormat set to $this->config_output_format "'.strtolower($this->config_output_format).'"', __FILE__, __LINE__); + $this->thumbnailFormat = strtolower($this->config_output_format); + } elseif ($this->config_output_format) { + $this->DebugMessage('$this->thumbnailFormat staying as "'.$this->thumbnailFormat.'" because $this->config_output_format ('.strtolower($this->config_output_format).') is not in $AvailableImageOutputFormats', __FILE__, __LINE__); + } + if ($this->f && (phpthumb_functions::CaseInsensitiveInArray($this->f, $AvailableImageOutputFormats))) { + // override output format if $this->f is set and that format is available + $this->DebugMessage('$this->thumbnailFormat set to $this->f "'.strtolower($this->f).'"', __FILE__, __LINE__); + $this->thumbnailFormat = strtolower($this->f); + } elseif ($this->f) { + $this->DebugMessage('$this->thumbnailFormat staying as "'.$this->thumbnailFormat.'" because $this->f ('.strtolower($this->f).') is not in $AvailableImageOutputFormats', __FILE__, __LINE__); + } + + // for JPEG images, quality 1 (worst) to 99 (best) + // quality < 25 is nasty, with not much size savings - not recommended + // problems with 100 - invalid JPEG? + $this->thumbnailQuality = max(1, min(99, ($this->q ? intval($this->q) : 75))); + $this->DebugMessage('$this->thumbnailQuality set to "'.$this->thumbnailQuality.'"', __FILE__, __LINE__); + + return true; + } + + function setCacheDirectory() { + // resolve cache directory to absolute pathname + $this->DebugMessage('setCacheDirectory() starting with config_cache_directory = "'.$this->config_cache_directory.'"', __FILE__, __LINE__); + if (substr($this->config_cache_directory, 0, 1) == '.') { + if (preg_match('#^(f|ht)tps?\://#i', $this->src)) { + if (!$this->config_cache_disable_warning) { + $this->ErrorImage('$this->config_cache_directory ('.$this->config_cache_directory.') cannot be used for remote images. Adjust "cache_directory" or "cache_disable_warning" in phpThumb.config.php'); + } + } elseif ($this->src) { + // resolve relative cache directory to source image + $this->config_cache_directory = dirname($this->ResolveFilenameToAbsolute($this->src)).DIRECTORY_SEPARATOR.$this->config_cache_directory; + } else { + // $this->new is probably set + } + } + if (substr($this->config_cache_directory, -1) == '/') { + $this->config_cache_directory = substr($this->config_cache_directory, 0, -1); + } + if ($this->iswindows) { + $this->config_cache_directory = str_replace('/', DIRECTORY_SEPARATOR, $this->config_cache_directory); + } + if ($this->config_cache_directory) { + $real_cache_path = realpath($this->config_cache_directory); + if (!$real_cache_path) { + $this->DebugMessage('realpath($this->config_cache_directory) failed for "'.$this->config_cache_directory.'"', __FILE__, __LINE__); + if (!is_dir($this->config_cache_directory)) { + $this->DebugMessage('!is_dir('.$this->config_cache_directory.')', __FILE__, __LINE__); + } + } + if ($real_cache_path) { + $this->DebugMessage('setting config_cache_directory to realpath('.$this->config_cache_directory.') = "'.$real_cache_path.'"', __FILE__, __LINE__); + $this->config_cache_directory = $real_cache_path; + } + } + if (!is_dir($this->config_cache_directory)) { + if (!$this->config_cache_disable_warning) { + $this->ErrorImage('$this->config_cache_directory ('.$this->config_cache_directory.') does not exist. Adjust "cache_directory" or "cache_disable_warning" in phpThumb.config.php'); + } + $this->DebugMessage('$this->config_cache_directory ('.$this->config_cache_directory.') is not a directory', __FILE__, __LINE__); + $this->config_cache_directory = null; + } elseif (!@is_writable($this->config_cache_directory)) { + $this->DebugMessage('$this->config_cache_directory is not writable ('.$this->config_cache_directory.')', __FILE__, __LINE__); + } + + $this->InitializeTempDirSetting(); + if (!@is_dir($this->config_temp_directory) && !@is_writable($this->config_temp_directory) && @is_dir($this->config_cache_directory) && @is_writable($this->config_cache_directory)) { + $this->DebugMessage('setting $this->config_temp_directory = $this->config_cache_directory ('.$this->config_cache_directory.')', __FILE__, __LINE__); + $this->config_temp_directory = $this->config_cache_directory; + } + return true; + } + + + function ResolveFilenameToAbsolute($filename) { + if (empty($filename)) { + return false; + } + + if (preg_match('#^[a-z0-9]+\:/{1,2}#i', $filename)) { + // eg: http://host/path/file.jpg (HTTP URL) + // eg: ftp://host/path/file.jpg (FTP URL) + // eg: data1:/path/file.jpg (Netware path) + + //$AbsoluteFilename = $filename; + return $filename; + + } elseif ($this->iswindows && isset($filename{1}) && ($filename{1} == ':')) { + + // absolute pathname (Windows) + $AbsoluteFilename = $filename; + + } elseif ($this->iswindows && ((substr($filename, 0, 2) == '//') || (substr($filename, 0, 2) == '\\\\'))) { + + // absolute pathname (Windows) + $AbsoluteFilename = $filename; + + } elseif ($filename{0} == '/') { + + if (@is_readable($filename) && !@is_readable($this->config_document_root.$filename)) { + + // absolute filename (*nix) + $AbsoluteFilename = $filename; + + } elseif (isset($filename{1}) && ($filename{1} == '~')) { + + // /~user/path + if ($ApacheLookupURIarray = phpthumb_functions::ApacheLookupURIarray($filename)) { + $AbsoluteFilename = $ApacheLookupURIarray['filename']; + } else { + $AbsoluteFilename = realpath($filename); + if (@is_readable($AbsoluteFilename)) { + $this->DebugMessage('phpthumb_functions::ApacheLookupURIarray() failed for "'.$filename.'", but the correct filename ('.$AbsoluteFilename.') seems to have been resolved with realpath($filename)', __FILE__, __LINE__); + } elseif (is_dir(dirname($AbsoluteFilename))) { + $this->DebugMessage('phpthumb_functions::ApacheLookupURIarray() failed for "'.dirname($filename).'", but the correct directory ('.dirname($AbsoluteFilename).') seems to have been resolved with realpath(.)', __FILE__, __LINE__); + } else { + return $this->ErrorImage('phpthumb_functions::ApacheLookupURIarray() failed for "'.$filename.'". This has been known to fail on Apache2 - try using the absolute filename for the source image (ex: "/home/user/httpdocs/image.jpg" instead of "/~user/image.jpg")'); + } + } + + } else { + + // relative filename (any OS) + if (preg_match('#^'.preg_quote($this->config_document_root).'#', $filename)) { + $AbsoluteFilename = $filename; + $this->DebugMessage('ResolveFilenameToAbsolute() NOT prepending $this->config_document_root ('.$this->config_document_root.') to $filename ('.$filename.') resulting in ($AbsoluteFilename = "'.$AbsoluteFilename.'")', __FILE__, __LINE__); + } else { + $AbsoluteFilename = $this->config_document_root.$filename; + $this->DebugMessage('ResolveFilenameToAbsolute() prepending $this->config_document_root ('.$this->config_document_root.') to $filename ('.$filename.') resulting in ($AbsoluteFilename = "'.$AbsoluteFilename.'")', __FILE__, __LINE__); + } + + } + + } else { + + // relative to current directory (any OS) + $AbsoluteFilename = $this->config_document_root.preg_replace('#[/\\\\]#', DIRECTORY_SEPARATOR, dirname(@$_SERVER['PHP_SELF'])).DIRECTORY_SEPARATOR.preg_replace('#[/\\\\]#', DIRECTORY_SEPARATOR, $filename); + //$AbsoluteFilename = dirname(__FILE__).DIRECTORY_SEPARATOR.preg_replace('#[/\\\\]#', DIRECTORY_SEPARATOR, $filename); + + //if (!@file_exists($AbsoluteFilename) && @file_exists(realpath($this->DotPadRelativeDirectoryPath($filename)))) { + // $AbsoluteFilename = realpath($this->DotPadRelativeDirectoryPath($filename)); + //} + + if (substr(dirname(@$_SERVER['PHP_SELF']), 0, 2) == '/~') { + if ($ApacheLookupURIarray = phpthumb_functions::ApacheLookupURIarray(dirname(@$_SERVER['PHP_SELF']))) { + $AbsoluteFilename = $ApacheLookupURIarray['filename'].DIRECTORY_SEPARATOR.$filename; + } else { + $AbsoluteFilename = realpath('.').DIRECTORY_SEPARATOR.$filename; + if (@is_readable($AbsoluteFilename)) { + $this->DebugMessage('phpthumb_functions::ApacheLookupURIarray() failed for "'.dirname(@$_SERVER['PHP_SELF']).'", but the correct filename ('.$AbsoluteFilename.') seems to have been resolved with realpath(.)/$filename', __FILE__, __LINE__); + } elseif (is_dir(dirname($AbsoluteFilename))) { + $this->DebugMessage('phpthumb_functions::ApacheLookupURIarray() failed for "'.dirname(@$_SERVER['PHP_SELF']).'", but the correct directory ('.dirname($AbsoluteFilename).') seems to have been resolved with realpath(.)', __FILE__, __LINE__); + } else { + return $this->ErrorImage('phpthumb_functions::ApacheLookupURIarray() failed for "'.dirname(@$_SERVER['PHP_SELF']).'". This has been known to fail on Apache2 - try using the absolute filename for the source image'); + } + } + } + + } + if (is_link($AbsoluteFilename)) { + $this->DebugMessage('is_link()==true, changing "'.$AbsoluteFilename.'" to "'.readlink($AbsoluteFilename).'"', __FILE__, __LINE__); + $AbsoluteFilename = readlink($AbsoluteFilename); + } + if (realpath($AbsoluteFilename)) { + $AbsoluteFilename = realpath($AbsoluteFilename); + } + if ($this->iswindows) { + $AbsoluteFilename = preg_replace('#^'.preg_quote(realpath($this->config_document_root)).'#i', realpath($this->config_document_root), $AbsoluteFilename); + $AbsoluteFilename = str_replace(DIRECTORY_SEPARATOR, '/', $AbsoluteFilename); + } + if (!$this->config_allow_src_above_docroot && !preg_match('#^'.preg_quote(str_replace(DIRECTORY_SEPARATOR, '/', realpath($this->config_document_root))).'#', $AbsoluteFilename)) { + $this->DebugMessage('!$this->config_allow_src_above_docroot therefore setting "'.$AbsoluteFilename.'" (outside "'.realpath($this->config_document_root).'") to null', __FILE__, __LINE__); + return false; + } + if (!$this->config_allow_src_above_phpthumb && !preg_match('#^'.preg_quote(str_replace(DIRECTORY_SEPARATOR, '/', dirname(__FILE__))).'#', $AbsoluteFilename)) { + $this->DebugMessage('!$this->config_allow_src_above_phpthumb therefore setting "'.$AbsoluteFilename.'" (outside "'.dirname(__FILE__).'") to null', __FILE__, __LINE__); + return false; + } + return $AbsoluteFilename; + } + + function file_exists_ignoreopenbasedir($filename, $cached=true) { + static $open_basedirs = null; + static $file_exists_cache = array(); + if (!$cached || !isset($file_exists_cache[$filename])) { + if (is_null($open_basedirs)) { + $open_basedirs = explode(';', ini_get('open_basedir')); + } + if (empty($open_basedirs) || in_array(dirname($filename), $open_basedirs)) { + $file_exists_cache[$filename] = file_exists($filename); + } elseif ($this->iswindows) { + $ls_filename = trim(phpthumb_functions::SafeExec('dir '.escapeshellarg($filename))); + $file_exists_cache[$filename] = !preg_match('#File Not Found#i', $ls_filename); + } else { + $ls_filename = trim(phpthumb_functions::SafeExec('ls '.escapeshellarg($filename))); + $file_exists_cache[$filename] = ($ls_filename == $filename); + } + } + return $file_exists_cache[$filename]; + } + + function ImageMagickWhichConvert() { + static $WhichConvert = null; + if (is_null($WhichConvert)) { + if ($this->iswindows) { + $WhichConvert = false; + } else { + $WhichConvert = trim(phpthumb_functions::SafeExec('which convert')); + } + } + return $WhichConvert; + } + + function ImageMagickCommandlineBase() { + static $commandline = null; + if (is_null($commandline)) { + if ($this->issafemode) { + $commandline = ''; + return $commandline; + } + $commandline = (!is_null($this->config_imagemagick_path) ? $this->config_imagemagick_path : ''); + + if ($this->config_imagemagick_path && ($this->config_imagemagick_path != realpath($this->config_imagemagick_path))) { + if (@is_executable(realpath($this->config_imagemagick_path))) { + $this->DebugMessage('Changing $this->config_imagemagick_path ('.$this->config_imagemagick_path.') to realpath($this->config_imagemagick_path) ('.realpath($this->config_imagemagick_path).')', __FILE__, __LINE__); + $this->config_imagemagick_path = realpath($this->config_imagemagick_path); + } else { + $this->DebugMessage('Leaving $this->config_imagemagick_path as ('.$this->config_imagemagick_path.') because !is_execuatable(realpath($this->config_imagemagick_path)) ('.realpath($this->config_imagemagick_path).')', __FILE__, __LINE__); + } + } + $this->DebugMessage(' file_exists('.$this->config_imagemagick_path.') = '.intval( @file_exists($this->config_imagemagick_path)), __FILE__, __LINE__); + $this->DebugMessage('file_exists_ignoreopenbasedir('.$this->config_imagemagick_path.') = '.intval($this->file_exists_ignoreopenbasedir($this->config_imagemagick_path)), __FILE__, __LINE__); + $this->DebugMessage(' is_file('.$this->config_imagemagick_path.') = '.intval( @is_file($this->config_imagemagick_path)), __FILE__, __LINE__); + $this->DebugMessage('is_executable('.$this->config_imagemagick_path.') = '.intval(@is_executable($this->config_imagemagick_path)), __FILE__, __LINE__); + + if ($this->file_exists_ignoreopenbasedir($this->config_imagemagick_path)) { + $this->DebugMessage('using ImageMagick path from $this->config_imagemagick_path ('.$this->config_imagemagick_path.')', __FILE__, __LINE__); + if ($this->iswindows) { + $commandline = substr($this->config_imagemagick_path, 0, 2).' && cd '.escapeshellarg(str_replace('/', DIRECTORY_SEPARATOR, substr(dirname($this->config_imagemagick_path), 2))).' && '.escapeshellarg(basename($this->config_imagemagick_path)); + } else { + $commandline = escapeshellarg($this->config_imagemagick_path); + } + return $commandline; + } + + $which_convert = $this->ImageMagickWhichConvert(); + $IMversion = $this->ImageMagickVersion(); + + if ($which_convert && ($which_convert{0} == '/') && $this->file_exists_ignoreopenbasedir($which_convert)) { + + // `which convert` *should* return the path if "convert" exist, or nothing if it doesn't + // other things *may* get returned, like "sh: convert: not found" or "no convert in /usr/local/bin /usr/sbin /usr/bin /usr/ccs/bin" + // so only do this if the value returned exists as a file + $this->DebugMessage('using ImageMagick path from `which convert` ('.$which_convert.')', __FILE__, __LINE__); + $commandline = 'convert'; + + } elseif ($IMversion) { + + $this->DebugMessage('setting ImageMagick path to $this->config_imagemagick_path ('.$this->config_imagemagick_path.') ['.$IMversion.']', __FILE__, __LINE__); + $commandline = $this->config_imagemagick_path; + + } else { + + $this->DebugMessage('ImageMagickThumbnailToGD() aborting because cannot find convert in $this->config_imagemagick_path ('.$this->config_imagemagick_path.'), and `which convert` returned ('.$which_convert.')', __FILE__, __LINE__); + $commandline = ''; + + } + } + return $commandline; + } + + function ImageMagickVersion($returnRAW=false) { + static $versionstring = null; + if (is_null($versionstring)) { + $versionstring = array(0=>false, 1=>false); + $commandline = $this->ImageMagickCommandlineBase(); + $commandline = (!is_null($commandline) ? $commandline : ''); + + if ($commandline) { + $commandline .= ' --version'; + $this->DebugMessage('ImageMagick version checked with "'.$commandline.'"', __FILE__, __LINE__); + $versionstring[1] = trim(phpthumb_functions::SafeExec($commandline)); + if (preg_match('#^Version: [^0-9]*([ 0-9\\.\\:Q/\\-]+) (http|file)\:#i', $versionstring[1], $matches)) { + $versionstring[0] = $matches[1]; + } else { + $versionstring[0] = false; + $this->DebugMessage('ImageMagick did not return recognized version string ('.$versionstring[1].')', __FILE__, __LINE__); + } + $this->DebugMessage('ImageMagick convert --version says "'.@$matches[0].'"', __FILE__, __LINE__); + } + } + return $versionstring[intval($returnRAW)]; + } + + function ImageMagickSwitchAvailable($switchname) { + static $IMoptions = null; + if (is_null($IMoptions)) { + $IMoptions = array(); + $commandline = $this->ImageMagickCommandlineBase(); + if (!is_null($commandline)) { + $commandline .= ' -help'; + $IMhelp_lines = explode("\n", phpthumb_functions::SafeExec($commandline)); + foreach ($IMhelp_lines as $line) { + if (preg_match('#^[\\+\\-]([a-z\\-]+) #', trim($line), $matches)) { + $IMoptions[$matches[1]] = true; + } + } + } + } + if (is_array($switchname)) { + $allOK = true; + foreach ($switchname as $key => $value) { + if (!isset($IMoptions[$value])) { + $allOK = false; + break; + } + } + $this->DebugMessage('ImageMagickSwitchAvailable('.implode(';', $switchname).') = '.intval($allOK).'', __FILE__, __LINE__); + } else { + $allOK = isset($IMoptions[$switchname]); + $this->DebugMessage('ImageMagickSwitchAvailable('.$switchname.') = '.intval($allOK).'', __FILE__, __LINE__); + } + return $allOK; + } + + function ImageMagickFormatsList() { + static $IMformatsList = null; + if (is_null($IMformatsList)) { + $IMformatsList = ''; + $commandline = $this->ImageMagickCommandlineBase(); + if (!is_null($commandline)) { + $commandline = dirname($commandline).DIRECTORY_SEPARATOR.str_replace('convert', 'identify', basename($commandline)); + $commandline .= ' -list format'; + $IMformatsList = phpthumb_functions::SafeExec($commandline); + } + } + return $IMformatsList; + } + + function SourceDataToTempFile() { + if ($IMtempSourceFilename = $this->phpThumb_tempnam()) { + $IMtempSourceFilename = realpath($IMtempSourceFilename); + ob_start(); + $fp_tempfile = fopen($IMtempSourceFilename, 'wb'); + $tempfile_open_error = ob_get_contents(); + ob_end_clean(); + if ($fp_tempfile) { + fwrite($fp_tempfile, $this->rawImageData); + fclose($fp_tempfile); + $this->sourceFilename = $IMtempSourceFilename; + $this->DebugMessage('ImageMagickThumbnailToGD() setting $this->sourceFilename to "'.$IMtempSourceFilename.'" from $this->rawImageData ('.strlen($this->rawImageData).' bytes)', __FILE__, __LINE__); + } else { + $this->DebugMessage('ImageMagickThumbnailToGD() FAILED setting $this->sourceFilename to "'.$IMtempSourceFilename.'" (failed to open for writing: "'.$tempfile_open_error.'")', __FILE__, __LINE__); + } + unset($tempfile_open_error, $IMtempSourceFilename); + return true; + } + $this->DebugMessage('SourceDataToTempFile() FAILED because $this->phpThumb_tempnam() failed', __FILE__, __LINE__); + return false; + } + + function ImageMagickThumbnailToGD() { + // http://www.imagemagick.org/script/command-line-options.php + + $this->useRawIMoutput = true; + if (phpthumb_functions::gd_version()) { + // if GD is not available, must use whatever ImageMagick can output + + // $UnAllowedParameters contains options that can only be processed in GD, not ImageMagick + // note: 'fltr' *may* need to be processed by GD, but we'll check that in more detail below + $UnAllowedParameters = array('xto', 'ar', 'bg', 'bc'); + // 'ra' may be part of this list, if not a multiple of 90ᄚ + foreach ($UnAllowedParameters as $parameter) { + if (isset($this->$parameter)) { + $this->DebugMessage('$this->useRawIMoutput=false because "'.$parameter.'" is set', __FILE__, __LINE__); + $this->useRawIMoutput = false; + break; + } + } + } + $this->DebugMessage('$this->useRawIMoutput='.($this->useRawIMoutput ? 'true' : 'false').' after checking $UnAllowedParameters', __FILE__, __LINE__); + $outputFormat = $this->thumbnailFormat; + if (phpthumb_functions::gd_version()) { + if ($this->useRawIMoutput) { + switch ($this->thumbnailFormat) { + case 'gif': + $ImageCreateFunction = 'ImageCreateFromGIF'; + $this->is_alpha = true; + break; + case 'png': + $ImageCreateFunction = 'ImageCreateFromPNG'; + $this->is_alpha = true; + break; + case 'jpg': + case 'jpeg': + $ImageCreateFunction = 'ImageCreateFromJPEG'; + break; + default: + $this->DebugMessage('Forcing output to PNG because $this->thumbnailFormat ('.$this->thumbnailFormat.' is not a GD-supported format)', __FILE__, __LINE__); + $outputFormat = 'png'; + $ImageCreateFunction = 'ImageCreateFromPNG'; + $this->is_alpha = true; + $this->useRawIMoutput = false; + break; + } + if (!function_exists(@$ImageCreateFunction)) { + // ImageMagickThumbnailToGD() depends on ImageCreateFromPNG/ImageCreateFromGIF + //$this->DebugMessage('ImageMagickThumbnailToGD() aborting because '.@$ImageCreateFunction.'() is not available', __FILE__, __LINE__); + $this->useRawIMoutput = true; + //return false; + } + } else { + $outputFormat = 'png'; + $ImageCreateFunction = 'ImageCreateFromPNG'; + $this->is_alpha = true; + $this->useRawIMoutput = false; + } + } + + // http://freealter.org/doc_distrib/ImageMagick-5.1.1/www/convert.html + if (!$this->sourceFilename && $this->rawImageData) { + $this->SourceDataToTempFile(); + } + if (!$this->sourceFilename) { + $this->DebugMessage('ImageMagickThumbnailToGD() aborting because $this->sourceFilename is empty', __FILE__, __LINE__); + $this->useRawIMoutput = false; + return false; + } + if ($this->issafemode) { + $this->DebugMessage('ImageMagickThumbnailToGD() aborting because safe_mode is enabled', __FILE__, __LINE__); + $this->useRawIMoutput = false; + return false; + } +// TO BE FIXED +//if (true) { +// $this->DebugMessage('ImageMagickThumbnailToGD() aborting it is broken right now', __FILE__, __LINE__); +// $this->useRawIMoutput = false; +// return false; +//} + + $commandline = $this->ImageMagickCommandlineBase(); + if ($commandline) { + if ($IMtempfilename = $this->phpThumb_tempnam()) { + $IMtempfilename = realpath($IMtempfilename); + + $IMuseExplicitImageOutputDimensions = false; + if ($this->ImageMagickSwitchAvailable('thumbnail') && $this->config_imagemagick_use_thumbnail) { + $IMresizeParameter = 'thumbnail'; + } else { + $IMresizeParameter = 'resize'; + + // some (older? around 2002) versions of IM won't accept "-resize 100x" but require "-resize 100x100" + $commandline_test = $this->ImageMagickCommandlineBase().' logo: -resize 1x '.escapeshellarg($IMtempfilename).' 2>&1'; + $IMresult_test = phpthumb_functions::SafeExec($commandline_test); + $IMuseExplicitImageOutputDimensions = preg_match('#image dimensions are zero#i', $IMresult_test); + $this->DebugMessage('IMuseExplicitImageOutputDimensions = '.intval($IMuseExplicitImageOutputDimensions), __FILE__, __LINE__); + if ($fp_im_temp = @fopen($IMtempfilename, 'wb')) { + // erase temp image so ImageMagick logo doesn't get output if other processing fails + fclose($fp_im_temp); + } + } + + + if (!is_null($this->dpi) && $this->ImageMagickSwitchAvailable('density')) { + // for raster source formats only (WMF, PDF, etc) + $commandline .= ' -density '.escapeshellarg($this->dpi); + } + ob_start(); + $getimagesize = GetImageSize($this->sourceFilename); + $GetImageSizeError = ob_get_contents(); + ob_end_clean(); + if (is_array($getimagesize)) { + $this->DebugMessage('GetImageSize('.$this->sourceFilename.') SUCCEEDED: '.print_r($getimagesize, true), __FILE__, __LINE__); + } else { + $this->DebugMessage('GetImageSize('.$this->sourceFilename.') FAILED with error "'.$GetImageSizeError.'"', __FILE__, __LINE__); + } + if (is_array($getimagesize)) { + $this->DebugMessage('GetImageSize('.$this->sourceFilename.') returned [w='.$getimagesize[0].';h='.$getimagesize[1].';f='.$getimagesize[2].']', __FILE__, __LINE__); + $this->source_width = $getimagesize[0]; + $this->source_height = $getimagesize[1]; + $this->DebugMessage('source dimensions set to '.$this->source_width.'x'.$this->source_height, __FILE__, __LINE__); + $this->SetOrientationDependantWidthHeight(); + + if (!preg_match('#('.implode('|', $this->AlphaCapableFormats).')#i', $outputFormat)) { + // not a transparency-capable format + $commandline .= ' -background '.escapeshellarg('#'.($this->bg ? $this->bg : 'FFFFFF')); + if ($getimagesize[2] == IMAGETYPE_GIF) { + $commandline .= ' -flatten'; + } + } + if ($getimagesize[2] == IMAGETYPE_GIF) { + $commandline .= ' -coalesce'; // may be needed for animated GIFs + } + if ($this->source_width || $this->source_height) { + if ($this->zc) { + + $borderThickness = 0; + if (!empty($this->fltr)) { + foreach ($this->fltr as $key => $value) { + if (preg_match('#^bord\|([0-9]+)#', $value, $matches)) { + $borderThickness = $matches[1]; + break; + } + } + } + $wAll = intval(max($this->w, $this->wp, $this->wl, $this->ws)) - (2 * $borderThickness); + $hAll = intval(max($this->h, $this->hp, $this->hl, $this->hs)) - (2 * $borderThickness); + $imAR = $this->source_width / $this->source_height; + $zcAR = (($wAll && $hAll) ? $wAll / $hAll : 1); + $side = phpthumb_functions::nonempty_min($this->source_width, $this->source_height, max($wAll, $hAll)); + $sideX = phpthumb_functions::nonempty_min($this->source_width, $wAll, round($hAll * $zcAR)); + $sideY = phpthumb_functions::nonempty_min( $this->source_height, $hAll, round($wAll / $zcAR)); + + $thumbnailH = round(max($sideY, ($sideY * $zcAR) / $imAR)); + $commandline .= ' -'.$IMresizeParameter.' '.escapeshellarg(($IMuseExplicitImageOutputDimensions ? $thumbnailH : '').'x'.$thumbnailH); + + switch (strtoupper($this->zc)) { + case 'T': + $commandline .= ' -gravity north'; + break; + case 'B': + $commandline .= ' -gravity south'; + break; + case 'L': + $commandline .= ' -gravity west'; + break; + case 'R': + $commandline .= ' -gravity east'; + break; + case 'TL': + $commandline .= ' -gravity northwest'; + break; + case 'TR': + $commandline .= ' -gravity northeast'; + break; + case 'BL': + $commandline .= ' -gravity southwest'; + break; + case 'BR': + $commandline .= ' -gravity southeast'; + break; + case '1': + case 'C': + default: + $commandline .= ' -gravity center'; + break; + } + + if (($wAll > 0) && ($hAll > 0)) { + $commandline .= ' -crop '.escapeshellarg($wAll.'x'.$hAll.'+0+0'); + } else { + $commandline .= ' -crop '.escapeshellarg($side.'x'.$side.'+0+0'); + } + if ($this->ImageMagickSwitchAvailable('repage')) { + $commandline .= ' +repage'; + } else { + $this->DebugMessage('Skipping "+repage" because ImageMagick (v'.$this->ImageMagickVersion().') does not support it', __FILE__, __LINE__); + } + + } elseif ($this->sw || $this->sh || $this->sx || $this->sy) { + + $crop_param = ''; + $crop_param .= ($this->sw ? (($this->sw < 2) ? round($this->sw * $this->source_width) : $this->sw) : $this->source_width); + $crop_param .= 'x'.($this->sh ? (($this->sh < 2) ? round($this->sh * $this->source_height) : $this->sh) : $this->source_height); + $crop_param .= '+'.(($this->sx < 2) ? round($this->sx * $this->source_width) : $this->sx); + $crop_param .= '+'.(($this->sy < 2) ? round($this->sy * $this->source_height) : $this->sy); +// TO BE FIXED +// makes 1x1 output +// http://trainspotted.com/phpThumb/phpThumb.php?src=/content/CNR/47/CNR-4728-LD-L-20110723-898.jpg&w=100&h=100&far=1&f=png&fltr[]=lvl&sx=0.05&sy=0.25&sw=0.92&sh=0.42 +// '/usr/bin/convert' -density 150 -thumbnail 100x100 -contrast-stretch '0.1%' '/var/www/vhosts/trainspotted.com/httpdocs/content/CNR/47/CNR-4728-LD-L-20110723-898.jpg[0]' png:'/var/www/vhosts/trainspotted.com/httpdocs/phpThumb/_cache/pThumbIIUlvj' +// $commandline .= ' -crop '.escapeshellarg($crop_param); + + // this is broken for aoe=1, but unsure how to fix. Send advice to info@silisoftware.com + if ($this->w || $this->h) { + //if ($this->ImageMagickSwitchAvailable('repage')) { + if (false) { +// TO BE FIXED +// newer versions of ImageMagick require -repage + $commandline .= ' -repage'; + } else { + $this->DebugMessage('Skipping "-repage" because ImageMagick (v'.$this->ImageMagickVersion().') does not support it', __FILE__, __LINE__); + } + if ($IMuseExplicitImageOutputDimensions) { + if ($this->w && !$this->h) { + $this->h = ceil($this->w / ($this->source_width / $this->source_height)); + } elseif ($this->h && !$this->w) { + $this->w = ceil($this->h * ($this->source_width / $this->source_height)); + } + } + $commandline .= ' -'.$IMresizeParameter.' '.escapeshellarg($this->w.'x'.$this->h); + } + + } else { + + if ($this->iar && (intval($this->w) > 0) && (intval($this->h) > 0)) { + list($nw, $nh) = phpthumb_functions::TranslateWHbyAngle($this->w, $this->h, $this->ra); + $nw = ((round($nw) != 0) ? round($nw) : ''); + $nh = ((round($nh) != 0) ? round($nh) : ''); + $commandline .= ' -'.$IMresizeParameter.' '.escapeshellarg($nw.'x'.$nh.'!'); + } else { + $this->w = ((($this->aoe || $this->far) && $this->w) ? $this->w : ($this->w ? phpthumb_functions::nonempty_min($this->w, $getimagesize[0]) : '')); + $this->h = ((($this->aoe || $this->far) && $this->h) ? $this->h : ($this->h ? phpthumb_functions::nonempty_min($this->h, $getimagesize[1]) : '')); + if ($this->w || $this->h) { + if ($IMuseExplicitImageOutputDimensions) { + if ($this->w && !$this->h) { + $this->h = ceil($this->w / ($this->source_width / $this->source_height)); + } elseif ($this->h && !$this->w) { + $this->w = ceil($this->h * ($this->source_width / $this->source_height)); + } + } + list($nw, $nh) = phpthumb_functions::TranslateWHbyAngle($this->w, $this->h, $this->ra); + $nw = ((round($nw) != 0) ? round($nw) : ''); + $nh = ((round($nh) != 0) ? round($nh) : ''); + $commandline .= ' -'.$IMresizeParameter.' '.escapeshellarg($nw.'x'.$nh); + } + } + } + } + + } else { + + $this->DebugMessage('GetImageSize('.$this->sourceFilename.') failed', __FILE__, __LINE__); + if ($this->w || $this->h) { + $exactDimensionsBang = (($this->iar && (intval($this->w) > 0) && (intval($this->h) > 0)) ? '!' : ''); + if ($IMuseExplicitImageOutputDimensions) { + // unknown source aspect ratio, just put large number and hope IM figures it out + $commandline .= ' -'.$IMresizeParameter.' '.escapeshellarg(($this->w ? $this->w : '9999').'x'.($this->h ? $this->h : '9999').$exactDimensionsBang); + } else { + $commandline .= ' -'.$IMresizeParameter.' '.escapeshellarg($this->w.'x'.$this->h.$exactDimensionsBang); + } + } + + } + + if ($this->ra) { + $this->ra = intval($this->ra); + if ($this->ImageMagickSwitchAvailable('rotate')) { + if (!preg_match('#('.implode('|', $this->AlphaCapableFormats).')#i', $outputFormat) || phpthumb_functions::version_compare_replacement($this->ImageMagickVersion(), '6.3.7', '>=')) { + $this->DebugMessage('Using ImageMagick rotate', __FILE__, __LINE__); + $commandline .= ' -rotate '.escapeshellarg($this->ra); + if (($this->ra % 90) != 0) { + if (preg_match('#('.implode('|', $this->AlphaCapableFormats).')#i', $outputFormat)) { + // alpha-capable format + $commandline .= ' -background rgba(255,255,255,0)'; + } else { + $commandline .= ' -background '.escapeshellarg('#'.($this->bg ? $this->bg : 'FFFFFF')); + } + } + $this->ra = 0; + } else { + $this->DebugMessage('Not using ImageMagick rotate because alpha background buggy before v6.3.7', __FILE__, __LINE__); + } + } else { + $this->DebugMessage('Not using ImageMagick rotate because not supported', __FILE__, __LINE__); + } + } + + $successfullyProcessedFilters = array(); + foreach ($this->fltr as $filterkey => $filtercommand) { + @list($command, $parameter) = explode('|', $filtercommand, 2); + switch ($command) { + case 'brit': + if ($this->ImageMagickSwitchAvailable('modulate')) { + $commandline .= ' -modulate '.escapeshellarg((100 + intval($parameter)).',100,100'); + $successfullyProcessedFilters[] = $filterkey; + } + break; + + case 'cont': + if ($this->ImageMagickSwitchAvailable('contrast')) { + $contDiv10 = round(intval($parameter) / 10); + if ($contDiv10 > 0) { + $contDiv10 = min($contDiv10, 100); + for ($i = 0; $i < $contDiv10; $i++) { + $commandline .= ' -contrast'; // increase contrast by 10% + } + } elseif ($contDiv10 < 0) { + $contDiv10 = max($contDiv10, -100); + for ($i = $contDiv10; $i < 0; $i++) { + $commandline .= ' +contrast'; // decrease contrast by 10% + } + } else { + // do nothing + } + $successfullyProcessedFilters[] = $filterkey; + } + break; + + case 'ds': + if ($this->ImageMagickSwitchAvailable(array('colorspace', 'modulate'))) { + if ($parameter == 100) { + $commandline .= ' -colorspace GRAY'; + $commandline .= ' -modulate 100,0,100'; + } else { + $commandline .= ' -modulate '.escapeshellarg('100,'.(100 - intval($parameter)).',100'); + } + $successfullyProcessedFilters[] = $filterkey; + } + break; + + case 'sat': + if ($this->ImageMagickSwitchAvailable(array('colorspace', 'modulate'))) { + if ($parameter == -100) { + $commandline .= ' -colorspace GRAY'; + $commandline .= ' -modulate 100,0,100'; + } else { + $commandline .= ' -modulate '.escapeshellarg('100,'.(100 + intval($parameter)).',100'); + } + $successfullyProcessedFilters[] = $filterkey; + } + break; + + case 'gray': + if ($this->ImageMagickSwitchAvailable(array('colorspace', 'modulate'))) { + $commandline .= ' -colorspace GRAY'; + $commandline .= ' -modulate 100,0,100'; + $successfullyProcessedFilters[] = $filterkey; + } + break; + + case 'clr': + if ($this->ImageMagickSwitchAvailable(array('fill', 'colorize'))) { + @list($amount, $color) = explode('|', $parameter); + $commandline .= ' -fill '.escapeshellarg('#'.preg_replace('#[^0-9A-F]#i', '', $color)); + $commandline .= ' -colorize '.escapeshellarg(min(max(intval($amount), 0), 100)); + } + break; + + case 'sep': + if ($this->ImageMagickSwitchAvailable('sepia-tone')) { + @list($amount, $color) = explode('|', $parameter); + $amount = ($amount ? $amount : 80); + if (!$color) { + $commandline .= ' -sepia-tone '.escapeshellarg(min(max(intval($amount), 0), 100).'%'); + $successfullyProcessedFilters[] = $filterkey; + } + } + break; + + case 'gam': + @list($amount) = explode('|', $parameter); + $amount = min(max(floatval($amount), 0.001), 10); + if (number_format($amount, 3) != '1.000') { + if ($this->ImageMagickSwitchAvailable('gamma')) { + $commandline .= ' -gamma '.escapeshellarg($amount); + $successfullyProcessedFilters[] = $filterkey; + } + } + break; + + case 'neg': + if ($this->ImageMagickSwitchAvailable('negate')) { + $commandline .= ' -negate'; + $successfullyProcessedFilters[] = $filterkey; + } + break; + + case 'th': + @list($amount) = explode('|', $parameter); + if ($this->ImageMagickSwitchAvailable(array('threshold', 'dither', 'monochrome'))) { + $commandline .= ' -threshold '.escapeshellarg(round(min(max(intval($amount), 0), 255) / 2.55).'%'); + $commandline .= ' -dither'; + $commandline .= ' -monochrome'; + $successfullyProcessedFilters[] = $filterkey; + } + break; + + case 'rcd': + if ($this->ImageMagickSwitchAvailable(array('colors', 'dither'))) { + @list($colors, $dither) = explode('|', $parameter); + $colors = ($colors ? (int) $colors : 256); + $dither = ((strlen($dither) > 0) ? (bool) $dither : true); + $commandline .= ' -colors '.escapeshellarg(max($colors, 8)); // ImageMagick will otherwise fail with "cannot quantize to fewer than 8 colors" + $commandline .= ($dither ? ' -dither' : ' +dither'); + $successfullyProcessedFilters[] = $filterkey; + } + break; + + case 'flip': + if ($this->ImageMagickSwitchAvailable(array('flip', 'flop'))) { + if (strpos(strtolower($parameter), 'x') !== false) { + $commandline .= ' -flop'; + } + if (strpos(strtolower($parameter), 'y') !== false) { + $commandline .= ' -flip'; + } + $successfullyProcessedFilters[] = $filterkey; + } + break; + + case 'edge': + if ($this->ImageMagickSwitchAvailable('edge')) { + $parameter = (!empty($parameter) ? $parameter : 2); + $commandline .= ' -edge '.escapeshellarg(!empty($parameter) ? intval($parameter) : 1); + $successfullyProcessedFilters[] = $filterkey; + } + break; + + case 'emb': + if ($this->ImageMagickSwitchAvailable(array('emboss', 'negate'))) { + $parameter = (!empty($parameter) ? $parameter : 2); + $commandline .= ' -emboss '.escapeshellarg(intval($parameter)); + if ($parameter < 2) { + $commandline .= ' -negate'; // ImageMagick negates the image for some reason with '-emboss 1'; + } + $successfullyProcessedFilters[] = $filterkey; + } + break; + + case 'lvl': + @list($band, $method, $threshold) = explode('|', $parameter); + $band = ($band ? preg_replace('#[^RGBA\\*]#', '', strtoupper($band)) : '*'); + $method = ((strlen($method) > 0) ? intval($method) : 2); + $threshold = ((strlen($threshold) > 0) ? min(max(floatval($threshold), 0), 100) : 0.1); + + $band = preg_replace('#[^RGBA\\*]#', '', strtoupper($band)); + + if (($method > 1) && !$this->ImageMagickSwitchAvailable(array('channel', 'contrast-stretch'))) { + // Because ImageMagick processing happens before PHP-GD filters, and because some + // clipping is involved in the "lvl" filter, if "lvl" happens before "wb" then the + // "wb" filter will have (almost) no effect. Therefore, if "wb" is enabled then + // force the "lvl" filter to be processed by GD, not ImageMagick. + foreach ($this->fltr as $fltr_key => $fltr_value) { + list($fltr_cmd) = explode('|', $fltr_value); + if ($fltr_cmd == 'wb') { + $this->DebugMessage('Setting "lvl" filter method to "0" (from "'.$method.'") because white-balance filter also enabled', __FILE__, __LINE__); + $method = 0; + } + } + } + + switch ($method) { + case 0: // internal RGB + case 1: // internal grayscale + break; + case 2: // ImageMagick "contrast-stretch" + if ($this->ImageMagickSwitchAvailable('contrast-stretch')) { + if ($band != '*') { + $commandline .= ' -channel '.escapeshellarg(strtoupper($band)); + } + $threshold = preg_replace('#[^0-9\\.]#', '', $threshold); // should be unneccesary, but just to be double-sure + //$commandline .= ' -contrast-stretch '.escapeshellarg($threshold.'%'); + $commandline .= ' -contrast-stretch \''.$threshold.'%\''; + if ($band != '*') { + $commandline .= ' +channel'; + } + $successfullyProcessedFilters[] = $filterkey; + } + break; + case 3: // ImageMagick "normalize" + if ($this->ImageMagickSwitchAvailable('normalize')) { + if ($band != '*') { + $commandline .= ' -channel '.escapeshellarg(strtoupper($band)); + } + $commandline .= ' -normalize'; + if ($band != '*') { + $commandline .= ' +channel'; + } + $successfullyProcessedFilters[] = $filterkey; + } + break; + default: + $this->DebugMessage('unsupported method ('.$method.') for "lvl" filter', __FILE__, __LINE__); + break; + } + if (isset($this->fltr[$filterkey]) && ($method > 1)) { + $this->fltr[$filterkey] = $command.'|'.$band.'|0|'.$threshold; + $this->DebugMessage('filter "lvl" remapped from method "'.$method.'" to method "0" because ImageMagick support is missing', __FILE__, __LINE__); + } + break; + + case 'wb': + if ($this->ImageMagickSwitchAvailable(array('channel', 'contrast-stretch'))) { + @list($threshold) = explode('|', $parameter); + $threshold = (!empty($threshold) ? min(max(floatval($threshold), 0), 100) : 0.1); + $threshold = preg_replace('#[^0-9\\.]#', '', $threshold); // should be unneccesary, but just to be double-sure + //$commandline .= ' -channel R -contrast-stretch '.escapeshellarg($threshold.'%'); // doesn't work on Windows because most versions of PHP do not properly + //$commandline .= ' -channel G -contrast-stretch '.escapeshellarg($threshold.'%'); // escape special characters (such as %) and just replace them with spaces + //$commandline .= ' -channel B -contrast-stretch '.escapeshellarg($threshold.'%'); // https://bugs.php.net/bug.php?id=43261 + $commandline .= ' -channel R -contrast-stretch \''.$threshold.'%\''; + $commandline .= ' -channel G -contrast-stretch \''.$threshold.'%\''; + $commandline .= ' -channel B -contrast-stretch \''.$threshold.'%\''; + $commandline .= ' +channel'; + $successfullyProcessedFilters[] = $filterkey; + } + break; + + case 'blur': + if ($this->ImageMagickSwitchAvailable('blur')) { + @list($radius) = explode('|', $parameter); + $radius = (!empty($radius) ? min(max(intval($radius), 0), 25) : 1); + $commandline .= ' -blur '.escapeshellarg($radius); + $successfullyProcessedFilters[] = $filterkey; + } + break; + + case 'gblr': + @list($radius) = explode('|', $parameter); + $radius = (!empty($radius) ? min(max(intval($radius), 0), 25) : 1); + // "-gaussian" changed to "-gaussian-blur" sometime around 2009 + if ($this->ImageMagickSwitchAvailable('gaussian-blur')) { + $commandline .= ' -gaussian-blur '.escapeshellarg($radius); + $successfullyProcessedFilters[] = $filterkey; + } elseif ($this->ImageMagickSwitchAvailable('gaussian')) { + $commandline .= ' -gaussian '.escapeshellarg($radius); + $successfullyProcessedFilters[] = $filterkey; + } + break; + + case 'usm': + if ($this->ImageMagickSwitchAvailable('unsharp')) { + @list($amount, $radius, $threshold) = explode('|', $parameter); + $amount = ($amount ? min(max(intval($radius), 0), 255) : 80); + $radius = ($radius ? min(max(intval($radius), 0), 10) : 0.5); + $threshold = (strlen($threshold) ? min(max(intval($radius), 0), 50) : 3); + $commandline .= ' -unsharp '.escapeshellarg(number_format(($radius * 2) - 1, 2, '.', '').'x1+'.number_format($amount / 100, 2, '.', '').'+'.number_format($threshold / 100, 2, '.', '')); + $successfullyProcessedFilters[] = $filterkey; + } + break; + + case 'bord': + if ($this->ImageMagickSwitchAvailable(array('border', 'bordercolor', 'thumbnail', 'crop'))) { + if (!$this->zc) { + @list($width, $rX, $rY, $color) = explode('|', $parameter); + $width = intval($width); + $rX = intval($rX); + $rY = intval($rY); + if ($width && !$rX && !$rY) { + if (!phpthumb_functions::IsHexColor($color)) { + $color = ((!empty($this->bc) && phpthumb_functions::IsHexColor($this->bc)) ? $this->bc : '000000'); + } + $commandline .= ' -border '.escapeshellarg(intval($width)); + $commandline .= ' -bordercolor '.escapeshellarg('#'.$color); + + if (preg_match('# \\-crop "([0-9]+)x([0-9]+)\\+0\\+0" #', $commandline, $matches)) { + $commandline = str_replace(' -crop "'.$matches[1].'x'.$matches[2].'+0+0" ', ' -crop '.escapeshellarg(($matches[1] - (2 * $width)).'x'.($matches[2] - (2 * $width)).'+0+0').' ', $commandline); + } elseif (preg_match('# \\-'.$IMresizeParameter.' "([0-9]+)x([0-9]+)" #', $commandline, $matches)) { + $commandline = str_replace(' -'.$IMresizeParameter.' "'.$matches[1].'x'.$matches[2].'" ', ' -'.$IMresizeParameter.' '.escapeshellarg(($matches[1] - (2 * $width)).'x'.($matches[2] - (2 * $width))).' ', $commandline); + } + $successfullyProcessedFilters[] = $filterkey; + } + } + } + break; + + case 'crop': + break; + + case 'sblr': + break; + + case 'mean': + break; + + case 'smth': + break; + + case 'bvl': + break; + + case 'wmi': + break; + + case 'wmt': + break; + + case 'over': + break; + + case 'hist': + break; + + case 'fram': + break; + + case 'drop': + break; + + case 'mask': + break; + + case 'elip': + break; + + case 'ric': + break; + + case 'stc': + break; + + case 'size': + break; + + default: + $this->DebugMessage('Unknown $this->fltr['.$filterkey.'] ('.$filtercommand.') -- deleting filter command', __FILE__, __LINE__); + $successfullyProcessedFilters[] = $filterkey; + break; + } + if (!isset($this->fltr[$filterkey])) { + $this->DebugMessage('Processed $this->fltr['.$filterkey.'] ('.$filtercommand.') with ImageMagick', __FILE__, __LINE__); + } else { + $this->DebugMessage('Skipping $this->fltr['.$filterkey.'] ('.$filtercommand.') with ImageMagick', __FILE__, __LINE__); + } + } + $this->DebugMessage('Remaining $this->fltr after ImageMagick: ('.$this->phpThumbDebugVarDump($this->fltr).')', __FILE__, __LINE__); + if (count($this->fltr) > 0) { + $this->useRawIMoutput = false; + } + + if (preg_match('#jpe?g#i', $outputFormat) && $this->q) { + if ($this->ImageMagickSwitchAvailable(array('quality', 'interlace'))) { + $commandline .= ' -quality '.escapeshellarg($this->thumbnailQuality); + if ($this->config_output_interlace) { + // causes weird things with animated GIF... leave for JPEG only + $commandline .= ' -interlace line '; // Use Line or Plane to create an interlaced PNG or GIF or progressive JPEG image + } + } + } + $commandline .= ' '.escapeshellarg(preg_replace('#[/\\\\]#', DIRECTORY_SEPARATOR, $this->sourceFilename).(($outputFormat == 'gif') ? '' : '['.intval($this->sfn).']')); // [0] means first frame of (GIF) animation, can be ignored + $commandline .= ' '.$outputFormat.':'.escapeshellarg($IMtempfilename); + if (!$this->iswindows) { + $commandline .= ' 2>&1'; + } + $this->DebugMessage('ImageMagick called as ('.$commandline.')', __FILE__, __LINE__); + $IMresult = phpthumb_functions::SafeExec($commandline); + clearstatcache(); + if (!@file_exists($IMtempfilename) || !@filesize($IMtempfilename)) { + $this->FatalError('ImageMagick failed with message ('.trim($IMresult).')'); + $this->DebugMessage('ImageMagick failed with message ('.trim($IMresult).')', __FILE__, __LINE__); + if ($this->iswindows && !$IMresult) { + $this->DebugMessage('Check to make sure that PHP has read+write permissions to "'.dirname($IMtempfilename).'"', __FILE__, __LINE__); + } + + } else { + + foreach ($successfullyProcessedFilters as $dummy => $filterkey) { + unset($this->fltr[$filterkey]); + } + $this->IMresizedData = file_get_contents($IMtempfilename); + $getimagesize_imresized = @GetImageSize($IMtempfilename); + $this->DebugMessage('GetImageSize('.$IMtempfilename.') returned [w='.$getimagesize_imresized[0].';h='.$getimagesize_imresized[1].';f='.$getimagesize_imresized[2].']', __FILE__, __LINE__); + if (($this->config_max_source_pixels > 0) && (($getimagesize_imresized[0] * $getimagesize_imresized[1]) > $this->config_max_source_pixels)) { + $this->DebugMessage('skipping ImageMagickThumbnailToGD::'.$ImageCreateFunction.'() because IM output is too large ('.$getimagesize_imresized[0].'x'.$getimagesize_imresized[0].' = '.($getimagesize_imresized[0] * $getimagesize_imresized[1]).' > '.$this->config_max_source_pixels.')', __FILE__, __LINE__); + } elseif (function_exists(@$ImageCreateFunction) && ($this->gdimg_source = @$ImageCreateFunction($IMtempfilename))) { + $this->source_width = ImageSX($this->gdimg_source); + $this->source_height = ImageSY($this->gdimg_source); + $this->DebugMessage('ImageMagickThumbnailToGD::'.$ImageCreateFunction.'() succeeded, $this->gdimg_source is now ('.$this->source_width.'x'.$this->source_height.')', __FILE__, __LINE__); + $this->DebugMessage('ImageMagickThumbnailToGD() returning $this->IMresizedData ('.strlen($this->IMresizedData).' bytes)', __FILE__, __LINE__); + } else { + $this->useRawIMoutput = true; + $this->DebugMessage('$this->useRawIMoutput set to TRUE because '.@$ImageCreateFunction.'('.$IMtempfilename.') failed', __FILE__, __LINE__); + } + return true; + + } + if (file_exists($IMtempfilename)) { + $this->DebugMessage('deleting "'.$IMtempfilename.'"', __FILE__, __LINE__); + @unlink($IMtempfilename); + } + + } elseif ($this->issafemode) { + $this->DebugMessage('ImageMagickThumbnailToGD() aborting because PHP safe_mode is enabled and phpThumb_tempnam() failed', __FILE__, __LINE__); + $this->useRawIMoutput = false; + } else { + if (file_exists($IMtempfilename)) { + $this->DebugMessage('deleting "'.$IMtempfilename.'"', __FILE__, __LINE__); + @unlink($IMtempfilename); + } + $this->DebugMessage('ImageMagickThumbnailToGD() aborting, phpThumb_tempnam() failed', __FILE__, __LINE__); + } + } else { + $this->DebugMessage('ImageMagickThumbnailToGD() aborting because ImageMagickCommandlineBase() failed', __FILE__, __LINE__); + } + $this->useRawIMoutput = false; + return false; + } + + + function Rotate() { + if ($this->ra || $this->ar) { + if (!function_exists('ImageRotate')) { + $this->DebugMessage('!function_exists(ImageRotate)', __FILE__, __LINE__); + return false; + } + if (!include_once(dirname(__FILE__).'/phpthumb.filters.php')) { + $this->DebugMessage('Error including "'.dirname(__FILE__).'/phpthumb.filters.php" which is required for applying filters ('.implode(';', $this->fltr).')', __FILE__, __LINE__); + return false; + } + + $this->config_background_hexcolor = ($this->bg ? $this->bg : $this->config_background_hexcolor); + if (!phpthumb_functions::IsHexColor($this->config_background_hexcolor)) { + return $this->ErrorImage('Invalid hex color string "'.$this->config_background_hexcolor.'" for parameter "bg"'); + } + + $rotate_angle = 0; + if ($this->ra) { + + $rotate_angle = floatval($this->ra); + + } else { + + if ($this->ar == 'x') { + if (phpthumb_functions::version_compare_replacement(phpversion(), '4.2.0', '>=')) { + if ($this->sourceFilename) { + if (function_exists('exif_read_data')) { + if ($exif_data = @exif_read_data($this->sourceFilename, 'IFD0')) { + // http://sylvana.net/jpegcrop/exif_orientation.html + switch (@$exif_data['Orientation']) { + case 1: + $rotate_angle = 0; + break; + case 3: + $rotate_angle = 180; + break; + case 6: + $rotate_angle = 270; + break; + case 8: + $rotate_angle = 90; + break; + + default: + $this->DebugMessage('EXIF auto-rotate failed because unknown $exif_data[Orientation] "'.@$exif_data['Orientation'].'"', __FILE__, __LINE__); + return false; + break; + } + $this->DebugMessage('EXIF auto-rotate set to '.$rotate_angle.' degrees ($exif_data[Orientation] = "'.@$exif_data['Orientation'].'")', __FILE__, __LINE__); + } else { + $this->DebugMessage('failed: exif_read_data('.$this->sourceFilename.')', __FILE__, __LINE__); + return false; + } + } else { + $this->DebugMessage('!function_exists(exif_read_data)', __FILE__, __LINE__); + return false; + } + } else { + $this->DebugMessage('Cannot auto-rotate from EXIF data because $this->sourceFilename is empty', __FILE__, __LINE__); + return false; + } + } else { + $this->DebugMessage('Cannot auto-rotate from EXIF data because PHP is less than v4.2.0 ('.phpversion().')', __FILE__, __LINE__); + return false; + } + } elseif (($this->ar == 'l') && ($this->source_height > $this->source_width)) { + $rotate_angle = 270; + } elseif (($this->ar == 'L') && ($this->source_height > $this->source_width)) { + $rotate_angle = 90; + } elseif (($this->ar == 'p') && ($this->source_width > $this->source_height)) { + $rotate_angle = 90; + } elseif (($this->ar == 'P') && ($this->source_width > $this->source_height)) { + $rotate_angle = 270; + } + + } + if ($rotate_angle % 90) { + $this->is_alpha = true; + } + phpthumb_filters::ImprovedImageRotate($this->gdimg_source, $rotate_angle, $this->config_background_hexcolor, $this->bg); + $this->source_width = ImageSX($this->gdimg_source); + $this->source_height = ImageSY($this->gdimg_source); + } + return true; + } + + + function FixedAspectRatio() { + // optional fixed-dimension images (regardless of aspect ratio) + + if (!$this->far) { + // do nothing + return true; + } + + if (!$this->w || !$this->h) { + return false; + } + $this->thumbnail_width = $this->w; + $this->thumbnail_height = $this->h; + $this->is_alpha = true; + if ($this->thumbnail_image_width >= $this->thumbnail_width) { + + if ($this->w) { + $aspectratio = $this->thumbnail_image_height / $this->thumbnail_image_width; + $this->thumbnail_image_height = round($this->thumbnail_image_width * $aspectratio); + $this->thumbnail_height = ($this->h ? $this->h : $this->thumbnail_image_height); + } elseif ($this->thumbnail_image_height < $this->thumbnail_height) { + $this->thumbnail_image_height = $this->thumbnail_height; + $this->thumbnail_image_width = round($this->thumbnail_image_height / $aspectratio); + } + + } else { + if ($this->h) { + $aspectratio = $this->thumbnail_image_width / $this->thumbnail_image_height; + $this->thumbnail_image_width = round($this->thumbnail_image_height * $aspectratio); + } elseif ($this->thumbnail_image_width < $this->thumbnail_width) { + $this->thumbnail_image_width = $this->thumbnail_width; + $this->thumbnail_image_height = round($this->thumbnail_image_width / $aspectratio); + } + + } + return true; + } + + + function OffsiteDomainIsAllowed($hostname, $allowed_domains) { + static $domain_is_allowed = array(); + $hostname = strtolower($hostname); + if (!isset($domain_is_allowed[$hostname])) { + $domain_is_allowed[$hostname] = false; + foreach ($allowed_domains as $valid_domain) { + $starpos = strpos($valid_domain, '*'); + if ($starpos !== false) { + $valid_domain = substr($valid_domain, $starpos + 1); + if (preg_match('#'.preg_quote($valid_domain).'$#', $hostname)) { + $domain_is_allowed[$hostname] = true; + break; + } + } else { + if (strtolower($valid_domain) === $hostname) { + $domain_is_allowed[$hostname] = true; + break; + } + } + } + } + return $domain_is_allowed[$hostname]; + } + + + function AntiOffsiteLinking() { + // Optional anti-offsite hijacking of the thumbnail script + $allow = true; + if ($allow && $this->config_nooffsitelink_enabled && (@$_SERVER['HTTP_REFERER'] || $this->config_nooffsitelink_require_refer)) { + $this->DebugMessage('AntiOffsiteLinking() checking $_SERVER[HTTP_REFERER] "'.@$_SERVER['HTTP_REFERER'].'"', __FILE__, __LINE__); + foreach ($this->config_nooffsitelink_valid_domains as $key => $valid_domain) { + // $_SERVER['HTTP_HOST'] contains the port number, so strip it out here to make default configuration work + list($clean_domain) = explode(':', $valid_domain); + $this->config_nooffsitelink_valid_domains[$key] = $clean_domain; + } + $parsed_url = phpthumb_functions::ParseURLbetter(@$_SERVER['HTTP_REFERER']); + if (!$this->OffsiteDomainIsAllowed(@$parsed_url['host'], $this->config_nooffsitelink_valid_domains)) { + $allow = false; + $erase = $this->config_nooffsitelink_erase_image; + $message = $this->config_nooffsitelink_text_message; + $this->ErrorImage('AntiOffsiteLinking() - "'.@$parsed_url['host'].'" is NOT in $this->config_nooffsitelink_valid_domains ('.implode(';', $this->config_nooffsitelink_valid_domains).')'); + exit; + $this->DebugMessage('AntiOffsiteLinking() - "'.@$parsed_url['host'].'" is NOT in $this->config_nooffsitelink_valid_domains ('.implode(';', $this->config_nooffsitelink_valid_domains).')', __FILE__, __LINE__); + } else { + $this->DebugMessage('AntiOffsiteLinking() - "'.@$parsed_url['host'].'" is in $this->config_nooffsitelink_valid_domains ('.implode(';', $this->config_nooffsitelink_valid_domains).')', __FILE__, __LINE__); + } + } + + if ($allow && $this->config_nohotlink_enabled && preg_match('#^(f|ht)tps?\://#i', $this->src)) { + $parsed_url = phpthumb_functions::ParseURLbetter($this->src); + //if (!phpthumb_functions::CaseInsensitiveInArray(@$parsed_url['host'], $this->config_nohotlink_valid_domains)) { + if ($this->OffsiteDomainIsAllowed(@$parsed_url['host'], $this->config_nohotlink_valid_domains)) { + // This domain is not allowed + $allow = false; + $erase = $this->config_nohotlink_erase_image; + $message = $this->config_nohotlink_text_message; + $this->DebugMessage('AntiOffsiteLinking() - "'.$parsed_url['host'].'" is NOT in $this->config_nohotlink_valid_domains ('.implode(';', $this->config_nohotlink_valid_domains).')', __FILE__, __LINE__); + } else { + $this->DebugMessage('AntiOffsiteLinking() - "'.$parsed_url['host'].'" is in $this->config_nohotlink_valid_domains ('.implode(';', $this->config_nohotlink_valid_domains).')', __FILE__, __LINE__); + } + } + + if ($allow) { + $this->DebugMessage('AntiOffsiteLinking() says this is allowed', __FILE__, __LINE__); + return true; + } + + if (!phpthumb_functions::IsHexColor($this->config_error_bgcolor)) { + return $this->ErrorImage('Invalid hex color string "'.$this->config_error_bgcolor.'" for $this->config_error_bgcolor'); + } + if (!phpthumb_functions::IsHexColor($this->config_error_textcolor)) { + return $this->ErrorImage('Invalid hex color string "'.$this->config_error_textcolor.'" for $this->config_error_textcolor'); + } + if ($erase) { + + return $this->ErrorImage($message, $this->thumbnail_width, $this->thumbnail_height, $this->config_error_bgcolor, $this->config_error_textcolor, $this->config_error_fontsize); + + } else { + + $this->config_nooffsitelink_watermark_src = $this->ResolveFilenameToAbsolute($this->config_nooffsitelink_watermark_src); + if (is_file($this->config_nooffsitelink_watermark_src)) { + + if (!include_once(dirname(__FILE__).'/phpthumb.filters.php')) { + $this->DebugMessage('Error including "'.dirname(__FILE__).'/phpthumb.filters.php" which is required for applying watermark', __FILE__, __LINE__); + return false; + } + $watermark_img = $this->ImageCreateFromStringReplacement(file_get_contents($this->config_nooffsitelink_watermark_src)); + $phpthumbFilters = new phpthumb_filters(); + $phpthumbFilters->phpThumbObject = &$this; + $opacity = 50; + $margin = 5; + $phpthumbFilters->WatermarkOverlay($this->gdimg_output, $watermark_img, '*', $opacity, $margin); + ImageDestroy($watermark_img); + unset($phpthumbFilters); + + } else { + + $nohotlink_text_array = explode("\n", wordwrap($message, floor($this->thumbnail_width / ImageFontWidth($this->config_error_fontsize)), "\n")); + $nohotlink_text_color = phpthumb_functions::ImageHexColorAllocate($this->gdimg_output, $this->config_error_textcolor); + + $topoffset = round(($this->thumbnail_height - (count($nohotlink_text_array) * ImageFontHeight($this->config_error_fontsize))) / 2); + + $rowcounter = 0; + $this->DebugMessage('AntiOffsiteLinking() writing '.count($nohotlink_text_array).' lines of text "'.$message.'" (in #'.$this->config_error_textcolor.') on top of image', __FILE__, __LINE__); + foreach ($nohotlink_text_array as $textline) { + $leftoffset = max(0, round(($this->thumbnail_width - (strlen($textline) * ImageFontWidth($this->config_error_fontsize))) / 2)); + ImageString($this->gdimg_output, $this->config_error_fontsize, $leftoffset, $topoffset + ($rowcounter++ * ImageFontHeight($this->config_error_fontsize)), $textline, $nohotlink_text_color); + } + + } + + } + return true; + } + + + function AlphaChannelFlatten() { + if (!$this->is_alpha) { + // image doesn't have alpha transparency, no need to flatten + $this->DebugMessage('skipping AlphaChannelFlatten() because !$this->is_alpha', __FILE__, __LINE__); + return false; + } + switch ($this->thumbnailFormat) { + case 'png': + case 'ico': + // image has alpha transparency, but output as PNG or ICO which can handle it + $this->DebugMessage('skipping AlphaChannelFlatten() because ($this->thumbnailFormat == "'.$this->thumbnailFormat.'")', __FILE__, __LINE__); + return false; + break; + + case 'gif': + // image has alpha transparency, but output as GIF which can handle only single-color transparency + $CurrentImageColorTransparent = ImageColorTransparent($this->gdimg_output); + if ($CurrentImageColorTransparent == -1) { + // no transparent color defined + + if (phpthumb_functions::gd_version() < 2.0) { + $this->DebugMessage('AlphaChannelFlatten() failed because GD version is "'.phpthumb_functions::gd_version().'"', __FILE__, __LINE__); + return false; + } + + if ($img_alpha_mixdown_dither = @ImageCreateTrueColor(ImageSX($this->gdimg_output), ImageSY($this->gdimg_output))) { + + for ($i = 0; $i <= 255; $i++) { + $dither_color[$i] = ImageColorAllocate($img_alpha_mixdown_dither, $i, $i, $i); + } + + // scan through current truecolor image copy alpha channel to temp image as grayscale + for ($x = 0; $x < $this->thumbnail_width; $x++) { + for ($y = 0; $y < $this->thumbnail_height; $y++) { + $PixelColor = phpthumb_functions::GetPixelColor($this->gdimg_output, $x, $y); + ImageSetPixel($img_alpha_mixdown_dither, $x, $y, $dither_color[($PixelColor['alpha'] * 2)]); + } + } + + // dither alpha channel grayscale version down to 2 colors + ImageTrueColorToPalette($img_alpha_mixdown_dither, true, 2); + + // reduce color palette to 256-1 colors (leave one palette position for transparent color) + ImageTrueColorToPalette($this->gdimg_output, true, 255); + + // allocate a new color for transparent color index + $TransparentColor = ImageColorAllocate($this->gdimg_output, 1, 254, 253); + ImageColorTransparent($this->gdimg_output, $TransparentColor); + + // scan through alpha channel image and note pixels with >50% transparency + $TransparentPixels = array(); + for ($x = 0; $x < $this->thumbnail_width; $x++) { + for ($y = 0; $y < $this->thumbnail_height; $y++) { + $AlphaChannelPixel = phpthumb_functions::GetPixelColor($img_alpha_mixdown_dither, $x, $y); + if ($AlphaChannelPixel['red'] > 127) { + ImageSetPixel($this->gdimg_output, $x, $y, $TransparentColor); + } + } + } + ImageDestroy($img_alpha_mixdown_dither); + + $this->DebugMessage('AlphaChannelFlatten() set image to 255+1 colors with transparency for GIF output', __FILE__, __LINE__); + return true; + + } else { + $this->DebugMessage('AlphaChannelFlatten() failed ImageCreate('.ImageSX($this->gdimg_output).', '.ImageSY($this->gdimg_output).')', __FILE__, __LINE__); + return false; + } + + } else { + // a single transparent color already defined, leave as-is + $this->DebugMessage('skipping AlphaChannelFlatten() because ($this->thumbnailFormat == "'.$this->thumbnailFormat.'") and ImageColorTransparent returned "'.$CurrentImageColorTransparent.'"', __FILE__, __LINE__); + return true; + } + break; + } + $this->DebugMessage('continuing AlphaChannelFlatten() for output format "'.$this->thumbnailFormat.'"', __FILE__, __LINE__); + // image has alpha transparency, and is being output in a format that doesn't support it -- flatten + if ($gdimg_flatten_temp = phpthumb_functions::ImageCreateFunction($this->thumbnail_width, $this->thumbnail_height)) { + + $this->config_background_hexcolor = ($this->bg ? $this->bg : $this->config_background_hexcolor); + if (!phpthumb_functions::IsHexColor($this->config_background_hexcolor)) { + return $this->ErrorImage('Invalid hex color string "'.$this->config_background_hexcolor.'" for parameter "bg"'); + } + $background_color = phpthumb_functions::ImageHexColorAllocate($this->gdimg_output, $this->config_background_hexcolor); + ImageFilledRectangle($gdimg_flatten_temp, 0, 0, $this->thumbnail_width, $this->thumbnail_height, $background_color); + ImageCopy($gdimg_flatten_temp, $this->gdimg_output, 0, 0, 0, 0, $this->thumbnail_width, $this->thumbnail_height); + + ImageAlphaBlending($this->gdimg_output, true); + ImageSaveAlpha($this->gdimg_output, false); + ImageColorTransparent($this->gdimg_output, -1); + ImageCopy($this->gdimg_output, $gdimg_flatten_temp, 0, 0, 0, 0, $this->thumbnail_width, $this->thumbnail_height); + + ImageDestroy($gdimg_flatten_temp); + return true; + + } else { + $this->DebugMessage('ImageCreateFunction() failed', __FILE__, __LINE__); + } + return false; + } + + + function ApplyFilters() { + if ($this->fltr && is_array($this->fltr)) { + if (!include_once(dirname(__FILE__).'/phpthumb.filters.php')) { + $this->DebugMessage('Error including "'.dirname(__FILE__).'/phpthumb.filters.php" which is required for applying filters ('.implode(';', $this->fltr).')', __FILE__, __LINE__); + return false; + } + $phpthumbFilters = new phpthumb_filters(); + $phpthumbFilters->phpThumbObject = &$this; + foreach ($this->fltr as $filtercommand) { + @list($command, $parameter) = explode('|', $filtercommand, 2); + $this->DebugMessage('Attempting to process filter command "'.$command.'('.$parameter.')"', __FILE__, __LINE__); + switch ($command) { + case 'brit': // Brightness + $phpthumbFilters->Brightness($this->gdimg_output, $parameter); + break; + + case 'cont': // Contrast + $phpthumbFilters->Contrast($this->gdimg_output, $parameter); + break; + + case 'ds': // Desaturation + $phpthumbFilters->Desaturate($this->gdimg_output, $parameter, ''); + break; + + case 'sat': // Saturation + $phpthumbFilters->Saturation($this->gdimg_output, $parameter, ''); + break; + + case 'gray': // Grayscale + $phpthumbFilters->Grayscale($this->gdimg_output); + break; + + case 'clr': // Colorize + if (phpthumb_functions::gd_version() < 2) { + $this->DebugMessage('Skipping Colorize() because gd_version is "'.phpthumb_functions::gd_version().'"', __FILE__, __LINE__); + break; + } + @list($amount, $color) = explode('|', $parameter, 2); + $phpthumbFilters->Colorize($this->gdimg_output, $amount, $color); + break; + + case 'sep': // Sepia + if (phpthumb_functions::gd_version() < 2) { + $this->DebugMessage('Skipping Sepia() because gd_version is "'.phpthumb_functions::gd_version().'"', __FILE__, __LINE__); + break; + } + @list($amount, $color) = explode('|', $parameter, 2); + $phpthumbFilters->Sepia($this->gdimg_output, $amount, $color); + break; + + case 'gam': // Gamma correction + $phpthumbFilters->Gamma($this->gdimg_output, $parameter); + break; + + case 'neg': // Negative colors + $phpthumbFilters->Negative($this->gdimg_output); + break; + + case 'th': // Threshold + $phpthumbFilters->Threshold($this->gdimg_output, $parameter); + break; + + case 'rcd': // ReduceColorDepth + if (phpthumb_functions::gd_version() < 2) { + $this->DebugMessage('Skipping ReduceColorDepth() because gd_version is "'.phpthumb_functions::gd_version().'"', __FILE__, __LINE__); + break; + } + @list($colors, $dither) = explode('|', $parameter, 2); + $colors = ($colors ? (int) $colors : 256); + $dither = ((strlen($dither) > 0) ? (bool) $dither : true); + $phpthumbFilters->ReduceColorDepth($this->gdimg_output, $colors, $dither); + break; + + case 'flip': // Flip + $phpthumbFilters->Flip($this->gdimg_output, (strpos(strtolower($parameter), 'x') !== false), (strpos(strtolower($parameter), 'y') !== false)); + break; + + case 'edge': // EdgeDetect + $phpthumbFilters->EdgeDetect($this->gdimg_output); + break; + + case 'emb': // Emboss + $phpthumbFilters->Emboss($this->gdimg_output); + break; + + case 'bvl': // Bevel + @list($width, $color1, $color2) = explode('|', $parameter, 3); + $phpthumbFilters->Bevel($this->gdimg_output, $width, $color1, $color2); + break; + + case 'lvl': // autoLevels + @list($band, $method, $threshold) = explode('|', $parameter, 3); + $band = ($band ? preg_replace('#[^RGBA\\*]#', '', strtoupper($band)) : '*'); + $method = ((strlen($method) > 0) ? intval($method) : 2); + $threshold = ((strlen($threshold) > 0) ? floatval($threshold) : 0.1); + + $phpthumbFilters->HistogramStretch($this->gdimg_output, $band, $method, $threshold); + break; + + case 'wb': // WhiteBalance + $phpthumbFilters->WhiteBalance($this->gdimg_output, $parameter); + break; + + case 'hist': // Histogram overlay + if (phpthumb_functions::gd_version() < 2) { + $this->DebugMessage('Skipping HistogramOverlay() because gd_version is "'.phpthumb_functions::gd_version().'"', __FILE__, __LINE__); + break; + } + @list($bands, $colors, $width, $height, $alignment, $opacity, $margin_x, $margin_y) = explode('|', $parameter, 8); + $bands = ($bands ? $bands : '*'); + $colors = ($colors ? $colors : ''); + $width = ($width ? $width : 0.25); + $height = ($height ? $height : 0.25); + $alignment = ($alignment ? $alignment : 'BR'); + $opacity = ($opacity ? $opacity : 50); + $margin_x = ($margin_x ? $margin_x : 5); + $margin_y = $margin_y; // just to note it wasn't forgotten, but let the value always pass unchanged + $phpthumbFilters->HistogramOverlay($this->gdimg_output, $bands, $colors, $width, $height, $alignment, $opacity, $margin_x, $margin_y); + break; + + case 'fram': // Frame + @list($frame_width, $edge_width, $color_frame, $color1, $color2) = explode('|', $parameter, 5); + $phpthumbFilters->Frame($this->gdimg_output, $frame_width, $edge_width, $color_frame, $color1, $color2); + break; + + case 'drop': // DropShadow + if (phpthumb_functions::gd_version() < 2) { + $this->DebugMessage('Skipping DropShadow() because gd_version is "'.phpthumb_functions::gd_version().'"', __FILE__, __LINE__); + return false; + } + $this->is_alpha = true; + @list($distance, $width, $color, $angle, $fade) = explode('|', $parameter, 5); + $phpthumbFilters->DropShadow($this->gdimg_output, $distance, $width, $color, $angle, $fade); + break; + + case 'mask': // Mask cropping + if (phpthumb_functions::gd_version() < 2) { + $this->DebugMessage('Skipping Mask() because gd_version is "'.phpthumb_functions::gd_version().'"', __FILE__, __LINE__); + return false; + } + $mask_filename = $this->ResolveFilenameToAbsolute($parameter); + if (@is_readable($mask_filename) && ($fp_mask = @fopen($mask_filename, 'rb'))) { + $MaskImageData = ''; + do { + $buffer = fread($fp_mask, 8192); + $MaskImageData .= $buffer; + } while (strlen($buffer) > 0); + fclose($fp_mask); + if ($gdimg_mask = $this->ImageCreateFromStringReplacement($MaskImageData)) { + $this->is_alpha = true; + $phpthumbFilters->ApplyMask($gdimg_mask, $this->gdimg_output); + ImageDestroy($gdimg_mask); + } else { + $this->DebugMessage('ImageCreateFromStringReplacement() failed for "'.$mask_filename.'"', __FILE__, __LINE__); + } + } else { + $this->DebugMessage('Cannot open mask file "'.$mask_filename.'"', __FILE__, __LINE__); + } + break; + + case 'elip': // Elipse cropping + if (phpthumb_functions::gd_version() < 2) { + $this->DebugMessage('Skipping Elipse() because gd_version is "'.phpthumb_functions::gd_version().'"', __FILE__, __LINE__); + return false; + } + $this->is_alpha = true; + $phpthumbFilters->Elipse($this->gdimg_output); + break; + + case 'ric': // RoundedImageCorners + if (phpthumb_functions::gd_version() < 2) { + $this->DebugMessage('Skipping RoundedImageCorners() because gd_version is "'.phpthumb_functions::gd_version().'"', __FILE__, __LINE__); + return false; + } + @list($radius_x, $radius_y) = explode('|', $parameter, 2); + if (($radius_x < 1) || ($radius_y < 1)) { + $this->DebugMessage('Skipping RoundedImageCorners('.$radius_x.', '.$radius_y.') because x/y radius is less than 1', __FILE__, __LINE__); + break; + } + $this->is_alpha = true; + $phpthumbFilters->RoundedImageCorners($this->gdimg_output, $radius_x, $radius_y); + break; + + case 'crop': // Crop + @list($left, $right, $top, $bottom) = explode('|', $parameter, 4); + $phpthumbFilters->Crop($this->gdimg_output, $left, $right, $top, $bottom); + break; + + case 'bord': // Border + @list($border_width, $radius_x, $radius_y, $hexcolor_border) = explode('|', $parameter, 4); + $this->is_alpha = true; + $phpthumbFilters->ImageBorder($this->gdimg_output, $border_width, $radius_x, $radius_y, $hexcolor_border); + break; + + case 'over': // Overlay + @list($filename, $underlay, $margin, $opacity) = explode('|', $parameter, 4); + $underlay = (bool) ($underlay ? $underlay : false); + $margin = ((strlen($margin) > 0) ? $margin : ($underlay ? 0.1 : 0.0)); + $opacity = ((strlen($opacity) > 0) ? $opacity : 100); + if (($margin > 0) && ($margin < 1)) { + $margin = min(0.499, $margin); + } elseif (($margin > -1) && ($margin < 0)) { + $margin = max(-0.499, $margin); + } + + $filename = $this->ResolveFilenameToAbsolute($filename); + if (@is_readable($filename) && ($fp_watermark = @fopen($filename, 'rb'))) { + $WatermarkImageData = ''; + do { + $buffer = fread($fp_watermark, 8192); + $WatermarkImageData .= $buffer; + } while (strlen($buffer) > 0); + fclose($fp_watermark); + if ($img_watermark = $this->ImageCreateFromStringReplacement($WatermarkImageData)) { + if ($margin < 1) { + $resized_x = max(1, ImageSX($this->gdimg_output) - round(2 * (ImageSX($this->gdimg_output) * $margin))); + $resized_y = max(1, ImageSY($this->gdimg_output) - round(2 * (ImageSY($this->gdimg_output) * $margin))); + } else { + $resized_x = max(1, ImageSX($this->gdimg_output) - round(2 * $margin)); + $resized_y = max(1, ImageSY($this->gdimg_output) - round(2 * $margin)); + } + + if ($underlay) { + + if ($img_watermark_resized = phpthumb_functions::ImageCreateFunction(ImageSX($this->gdimg_output), ImageSY($this->gdimg_output))) { + ImageAlphaBlending($img_watermark_resized, false); + ImageSaveAlpha($img_watermark_resized, true); + $this->ImageResizeFunction($img_watermark_resized, $img_watermark, 0, 0, 0, 0, ImageSX($img_watermark_resized), ImageSY($img_watermark_resized), ImageSX($img_watermark), ImageSY($img_watermark)); + if ($img_source_resized = phpthumb_functions::ImageCreateFunction($resized_x, $resized_y)) { + ImageAlphaBlending($img_source_resized, false); + ImageSaveAlpha($img_source_resized, true); + $this->ImageResizeFunction($img_source_resized, $this->gdimg_output, 0, 0, 0, 0, ImageSX($img_source_resized), ImageSY($img_source_resized), ImageSX($this->gdimg_output), ImageSY($this->gdimg_output)); + $phpthumbFilters->WatermarkOverlay($img_watermark_resized, $img_source_resized, 'C', $opacity, $margin); + ImageCopy($this->gdimg_output, $img_watermark_resized, 0, 0, 0, 0, ImageSX($this->gdimg_output), ImageSY($this->gdimg_output)); + } else { + $this->DebugMessage('phpthumb_functions::ImageCreateFunction('.$resized_x.', '.$resized_y.')', __FILE__, __LINE__); + } + ImageDestroy($img_watermark_resized); + } else { + $this->DebugMessage('phpthumb_functions::ImageCreateFunction('.ImageSX($this->gdimg_output).', '.ImageSY($this->gdimg_output).')', __FILE__, __LINE__); + } + + } else { // overlay + + if ($img_watermark_resized = phpthumb_functions::ImageCreateFunction($resized_x, $resized_y)) { + ImageAlphaBlending($img_watermark_resized, false); + ImageSaveAlpha($img_watermark_resized, true); + $this->ImageResizeFunction($img_watermark_resized, $img_watermark, 0, 0, 0, 0, ImageSX($img_watermark_resized), ImageSY($img_watermark_resized), ImageSX($img_watermark), ImageSY($img_watermark)); + $phpthumbFilters->WatermarkOverlay($this->gdimg_output, $img_watermark_resized, 'C', $opacity, $margin); + ImageDestroy($img_watermark_resized); + } else { + $this->DebugMessage('phpthumb_functions::ImageCreateFunction('.$resized_x.', '.$resized_y.')', __FILE__, __LINE__); + } + + } + ImageDestroy($img_watermark); + + } else { + $this->DebugMessage('ImageCreateFromStringReplacement() failed for "'.$filename.'"', __FILE__, __LINE__); + } + } else { + $this->DebugMessage('Cannot open overlay file "'.$filename.'"', __FILE__, __LINE__); + } + break; + + case 'wmi': // WaterMarkImage + @list($filename, $alignment, $opacity, $margin['x'], $margin['y'], $rotate_angle) = explode('|', $parameter, 6); + // $margin can be pixel margin or percent margin if $alignment is text, or max width/height if $alignment is position like "50x75" + $alignment = ($alignment ? $alignment : 'BR'); + $opacity = (strlen($opacity) ? intval($opacity) : 50); + $rotate_angle = (strlen($rotate_angle) ? intval($rotate_angle) : 0); + if (!preg_match('#^([0-9\\.\\-]*)x([0-9\\.\\-]*)$#i', $alignment, $matches)) { + $margins = array('x', 'y'); + foreach ($margins as $xy) { + $margin[$xy] = (strlen($margin[$xy]) ? $margin[$xy] : 5); + if (($margin[$xy] > 0) && ($margin[$xy] < 1)) { + $margin[$xy] = min(0.499, $margin[$xy]); + } elseif (($margin[$xy] > -1) && ($margin[$xy] < 0)) { + $margin[$xy] = max(-0.499, $margin[$xy]); + } + } + } + + $filename = $this->ResolveFilenameToAbsolute($filename); + if (@is_readable($filename)) { + if ($img_watermark = $this->ImageCreateFromFilename($filename)) { + if ($rotate_angle !== 0) { + $phpthumbFilters->ImprovedImageRotate($img_watermark, $rotate_angle); + } + if (preg_match('#^([0-9\\.\\-]*)x([0-9\\.\\-]*)$#i', $alignment, $matches)) { + $watermark_max_width = intval($margin['x'] ? $margin['x'] : ImageSX($img_watermark)); + $watermark_max_height = intval($margin['y'] ? $margin['y'] : ImageSY($img_watermark)); + $scale = phpthumb_functions::ScaleToFitInBox(ImageSX($img_watermark), ImageSY($img_watermark), $watermark_max_width, $watermark_max_height, true, true); + $this->DebugMessage('Scaling watermark by a factor of '.number_format($scale, 4), __FILE__, __LINE__); + if (($scale > 1) || ($scale < 1)) { + if ($img_watermark2 = phpthumb_functions::ImageCreateFunction($scale * ImageSX($img_watermark), $scale * ImageSY($img_watermark))) { + ImageAlphaBlending($img_watermark2, false); + ImageSaveAlpha($img_watermark2, true); + $this->ImageResizeFunction($img_watermark2, $img_watermark, 0, 0, 0, 0, ImageSX($img_watermark2), ImageSY($img_watermark2), ImageSX($img_watermark), ImageSY($img_watermark)); + $img_watermark = $img_watermark2; + } else { + $this->DebugMessage('ImageCreateFunction('.($scale * ImageSX($img_watermark)).', '.($scale * ImageSX($img_watermark)).') failed', __FILE__, __LINE__); + } + } + $watermark_dest_x = round($matches[1] - (ImageSX($img_watermark) / 2)); + $watermark_dest_y = round($matches[2] - (ImageSY($img_watermark) / 2)); + $alignment = $watermark_dest_x.'x'.$watermark_dest_y; + } + $phpthumbFilters->WatermarkOverlay($this->gdimg_output, $img_watermark, $alignment, $opacity, $margin['x'], $margin['y']); + ImageDestroy($img_watermark); + if (isset($img_watermark2) && is_resource($img_watermark2)) { + ImageDestroy($img_watermark2); + } + } else { + $this->DebugMessage('ImageCreateFromFilename() failed for "'.$filename.'"', __FILE__, __LINE__); + } + } else { + $this->DebugMessage('!is_readable('.$filename.')', __FILE__, __LINE__); + } + break; + + case 'wmt': // WaterMarkText + @list($text, $size, $alignment, $hex_color, $ttffont, $opacity, $margin, $angle, $bg_color, $bg_opacity, $fillextend) = explode('|', $parameter, 11); + $text = ($text ? $text : ''); + $size = ($size ? $size : 3); + $alignment = ($alignment ? $alignment : 'BR'); + $hex_color = ($hex_color ? $hex_color : '000000'); + $ttffont = ($ttffont ? $ttffont : ''); + $opacity = (strlen($opacity) ? $opacity : 50); + $margin = (strlen($margin) ? $margin : 5); + $angle = (strlen($angle) ? $angle : 0); + $bg_color = ($bg_color ? $bg_color : false); + $bg_opacity = ($bg_opacity ? $bg_opacity : 0); + $fillextend = ($fillextend ? $fillextend : ''); + + if (basename($ttffont) == $ttffont) { + $ttffont = realpath($this->config_ttf_directory.DIRECTORY_SEPARATOR.$ttffont); + } else { + $ttffont = $this->ResolveFilenameToAbsolute($ttffont); + } + $phpthumbFilters->WatermarkText($this->gdimg_output, $text, $size, $alignment, $hex_color, $ttffont, $opacity, $margin, $angle, $bg_color, $bg_opacity, $fillextend); + break; + + case 'blur': // Blur + @list($radius) = explode('|', $parameter, 1); + $radius = ($radius ? $radius : 1); + if (phpthumb_functions::gd_version() >= 2) { + $phpthumbFilters->Blur($this->gdimg_output, $radius); + } else { + $this->DebugMessage('Skipping Blur() because gd_version is "'.phpthumb_functions::gd_version().'"', __FILE__, __LINE__); + } + break; + + case 'gblr': // Gaussian Blur + $phpthumbFilters->BlurGaussian($this->gdimg_output); + break; + + case 'sblr': // Selective Blur + $phpthumbFilters->BlurSelective($this->gdimg_output); + break; + + case 'mean': // MeanRemoval blur + $phpthumbFilters->MeanRemoval($this->gdimg_output); + break; + + case 'smth': // Smooth blur + $phpthumbFilters->Smooth($this->gdimg_output, $parameter); + break; + + case 'usm': // UnSharpMask sharpening + @list($amount, $radius, $threshold) = explode('|', $parameter, 3); + $amount = ($amount ? $amount : 80); + $radius = ($radius ? $radius : 0.5); + $threshold = (strlen($threshold) ? $threshold : 3); + if (phpthumb_functions::gd_version() >= 2.0) { + ob_start(); + if (!@include_once(dirname(__FILE__).'/phpthumb.unsharp.php')) { + $include_error = ob_get_contents(); + if ($include_error) { + $this->DebugMessage('include_once("'.dirname(__FILE__).'/phpthumb.unsharp.php") generated message: "'.$include_error.'"', __FILE__, __LINE__); + } + $this->DebugMessage('Error including "'.dirname(__FILE__).'/phpthumb.unsharp.php" which is required for unsharp masking', __FILE__, __LINE__); + ob_end_clean(); + return false; + } + ob_end_clean(); + phpUnsharpMask::applyUnsharpMask($this->gdimg_output, $amount, $radius, $threshold); + } else { + $this->DebugMessage('Skipping unsharp mask because gd_version is "'.phpthumb_functions::gd_version().'"', __FILE__, __LINE__); + return false; + } + break; + + case 'size': // Resize + @list($newwidth, $newheight, $stretch) = explode('|', $parameter); + $newwidth = (!$newwidth ? ImageSX($this->gdimg_output) : ((($newwidth > 0) && ($newwidth < 1)) ? round($newwidth * ImageSX($this->gdimg_output)) : round($newwidth))); + $newheight = (!$newheight ? ImageSY($this->gdimg_output) : ((($newheight > 0) && ($newheight < 1)) ? round($newheight * ImageSY($this->gdimg_output)) : round($newheight))); + $stretch = ($stretch ? true : false); + if ($stretch) { + $scale_x = phpthumb_functions::ScaleToFitInBox(ImageSX($this->gdimg_output), ImageSX($this->gdimg_output), $newwidth, $newwidth, true, true); + $scale_y = phpthumb_functions::ScaleToFitInBox(ImageSY($this->gdimg_output), ImageSY($this->gdimg_output), $newheight, $newheight, true, true); + } else { + $scale_x = phpthumb_functions::ScaleToFitInBox(ImageSX($this->gdimg_output), ImageSY($this->gdimg_output), $newwidth, $newheight, true, true); + $scale_y = $scale_x; + } + $this->DebugMessage('Scaling watermark ('.($stretch ? 'with' : 'without').' stretch) by a factor of "'.number_format($scale_x, 4).' x '.number_format($scale_y, 4).'"', __FILE__, __LINE__); + if (($scale_x > 1) || ($scale_x < 1) || ($scale_y > 1) || ($scale_y < 1)) { + if ($img_temp = phpthumb_functions::ImageCreateFunction(ImageSX($this->gdimg_output), ImageSY($this->gdimg_output))) { + ImageCopy($img_temp, $this->gdimg_output, 0, 0, 0, 0, ImageSX($this->gdimg_output), ImageSY($this->gdimg_output)); + //ImageDestroy($this->gdimg_output); + if ($this->gdimg_output = phpthumb_functions::ImageCreateFunction($scale_x * ImageSX($img_temp), $scale_y * ImageSY($img_temp))) { + ImageAlphaBlending($this->gdimg_output, false); + ImageSaveAlpha($this->gdimg_output, true); + $this->ImageResizeFunction($this->gdimg_output, $img_temp, 0, 0, 0, 0, ImageSX($this->gdimg_output), ImageSY($this->gdimg_output), ImageSX($img_temp), ImageSY($img_temp)); + } else { + $this->DebugMessage('ImageCreateFunction('.($scale_x * ImageSX($img_temp)).', '.($scale_y * ImageSY($img_temp)).') failed', __FILE__, __LINE__); + } + ImageDestroy($img_temp); + } else { + $this->DebugMessage('ImageCreateFunction('.ImageSX($this->gdimg_output).', '.ImageSY($this->gdimg_output).') failed', __FILE__, __LINE__); + } + } + break; + + case 'rot': // ROTate + @list($angle, $bgcolor) = explode('|', $parameter, 2); + $phpthumbFilters->ImprovedImageRotate($this->gdimg_output, $angle, $bgcolor); + break; + + case 'stc': // Source Transparent Color + @list($hexcolor, $min_limit, $max_limit) = explode('|', $parameter, 3); + if (!phpthumb_functions::IsHexColor($hexcolor)) { + $this->DebugMessage('Skipping SourceTransparentColor hex color is invalid ('.$hexcolor.')', __FILE__, __LINE__); + return false; + } + $min_limit = (strlen($min_limit) ? $min_limit : 5); + $max_limit = (strlen($max_limit) ? $max_limit : 10); + if ($gdimg_mask = $phpthumbFilters->SourceTransparentColorMask($this->gdimg_output, $hexcolor, $min_limit, $max_limit)) { + $this->is_alpha = true; + $phpthumbFilters->ApplyMask($gdimg_mask, $this->gdimg_output); + ImageDestroy($gdimg_mask); + } else { + $this->DebugMessage('SourceTransparentColorMask() failed for "'.$mask_filename.'"', __FILE__, __LINE__); + } + break; + } + $this->DebugMessage('Finished processing filter command "'.$command.'('.$parameter.')"', __FILE__, __LINE__); + } + } + return true; + } + + + function MaxFileSize() { + if (phpthumb_functions::gd_version() < 2) { + $this->DebugMessage('Skipping MaxFileSize() because gd_version is "'.phpthumb_functions::gd_version().'"', __FILE__, __LINE__); + return false; + } + if ($this->maxb > 0) { + switch ($this->thumbnailFormat) { + case 'png': + case 'gif': + $imgRenderFunction = 'image'.$this->thumbnailFormat; + + ob_start(); + $imgRenderFunction($this->gdimg_output); + $imgdata = ob_get_contents(); + ob_end_clean(); + + if (strlen($imgdata) > $this->maxb) { + for ($i = 8; $i >= 1; $i--) { + $tempIMG = ImageCreateTrueColor(ImageSX($this->gdimg_output), ImageSY($this->gdimg_output)); + ImageCopy($tempIMG, $this->gdimg_output, 0, 0, 0, 0, ImageSX($this->gdimg_output), ImageSY($this->gdimg_output)); + ImageTrueColorToPalette($tempIMG, true, pow(2, $i)); + ob_start(); + $imgRenderFunction($tempIMG); + $imgdata = ob_get_contents(); + ob_end_clean(); + + if (strlen($imgdata) <= $this->maxb) { + ImageTrueColorToPalette($this->gdimg_output, true, pow(2, $i)); + break; + } + } + } + if (strlen($imgdata) > $this->maxb) { + ImageTrueColorToPalette($this->gdimg_output, true, pow(2, $i)); + return false; + } + break; + + case 'jpeg': + ob_start(); + ImageJPEG($this->gdimg_output); + $imgdata = ob_get_contents(); + ob_end_clean(); + + $OriginalJPEGquality = $this->thumbnailQuality; + if (strlen($imgdata) > $this->maxb) { + for ($i = 3; $i < 20; $i++) { + $q = round(100 * (1 - log10($i / 2))); + ob_start(); + ImageJPEG($this->gdimg_output, '', $q); + $imgdata = ob_get_contents(); + ob_end_clean(); + + $this->thumbnailQuality = $q; + if (strlen($imgdata) <= $this->maxb) { + break; + } + } + } + if (strlen($imgdata) > $this->maxb) { + return false; + } + break; + + default: + return false; + break; + } + } + return true; + } + + + function CalculateThumbnailDimensions() { + $this->DebugMessage('CalculateThumbnailDimensions() starting with [W,H,sx,sy,sw,sh] initially set to ['.$this->source_width.','.$this->source_height.','.$this->sx.','.$this->sy.','.$this->sw.','.$this->sh.']', __FILE__, __LINE__); //echo $this->source_width.'x'.$this->source_height.'
    '; - $this->thumbnailCropX = ($this->sx ? (($this->sx >= 1) ? $this->sx : round($this->sx * $this->source_width)) : 0); + $this->thumbnailCropX = ($this->sx ? (($this->sx >= 2) ? $this->sx : round($this->sx * $this->source_width)) : 0); //echo $this->thumbnailCropX.'
    '; - $this->thumbnailCropY = ($this->sy ? (($this->sy >= 1) ? $this->sy : round($this->sy * $this->source_height)) : 0); + $this->thumbnailCropY = ($this->sy ? (($this->sy >= 2) ? $this->sy : round($this->sy * $this->source_height)) : 0); //echo $this->thumbnailCropY.'
    '; - $this->thumbnailCropW = ($this->sw ? (($this->sw >= 1) ? $this->sw : round($this->sw * $this->source_width)) : $this->source_width); + $this->thumbnailCropW = ($this->sw ? (($this->sw >= 2) ? $this->sw : round($this->sw * $this->source_width)) : $this->source_width); //echo $this->thumbnailCropW.'
    '; - $this->thumbnailCropH = ($this->sh ? (($this->sh >= 1) ? $this->sh : round($this->sh * $this->source_height)) : $this->source_height); + $this->thumbnailCropH = ($this->sh ? (($this->sh >= 2) ? $this->sh : round($this->sh * $this->source_height)) : $this->source_height); //echo $this->thumbnailCropH.'
    '; - // limit source area to original image area - $this->thumbnailCropW = max(1, min($this->thumbnailCropW, $this->source_width - $this->thumbnailCropX)); - $this->thumbnailCropH = max(1, min($this->thumbnailCropH, $this->source_height - $this->thumbnailCropY)); - - $this->DebugMessage('CalculateThumbnailDimensions() [x,y,w,h] initially set to ['.$this->thumbnailCropX.','.$this->thumbnailCropY.','.$this->thumbnailCropW.','.$this->thumbnailCropH.']', __FILE__, __LINE__); - - - if ($this->zc && $this->w && $this->h) { - // Zoom Crop - // retain proportional resizing we did above, but crop off larger dimension so smaller - // dimension fully fits available space - - $scaling_X = $this->source_width / $this->w; - $scaling_Y = $this->source_height / $this->h; - if ($scaling_X > $scaling_Y) { - // some of the width will need to be cropped - $allowable_width = $this->source_width / $scaling_X * $scaling_Y; - $this->thumbnailCropW = round($allowable_width); - $this->thumbnailCropX = round(($this->source_width - $allowable_width) / 2); - - } elseif ($scaling_Y > $scaling_X) { - // some of the height will need to be cropped - $allowable_height = $this->source_height / $scaling_Y * $scaling_X; - $this->thumbnailCropH = round($allowable_height); - $this->thumbnailCropY = round(($this->source_height - $allowable_height) / 2); - - } else { - // image fits perfectly, no cropping needed - } - $this->thumbnail_width = $this->w; - $this->thumbnail_height = $this->h; - $this->thumbnail_image_width = $this->thumbnail_width; - $this->thumbnail_image_height = $this->thumbnail_height; - - } elseif ($this->iar && $this->w && $this->h) { - - // Ignore Aspect Ratio - // stretch image to fit exactly 'w' x 'h' - $this->thumbnail_width = $this->w; - $this->thumbnail_height = $this->h; - $this->thumbnail_image_width = $this->thumbnail_width; - $this->thumbnail_image_height = $this->thumbnail_height; - - } else { - - $original_aspect_ratio = $this->thumbnailCropW / $this->thumbnailCropH; - if ($this->aoe) { - if ($this->w && $this->h) { - $maxwidth = min($this->w, $this->h * $original_aspect_ratio); - $maxheight = min($this->h, $this->w / $original_aspect_ratio); - } elseif ($this->w) { - $maxwidth = $this->w; - $maxheight = $this->w / $original_aspect_ratio; - } elseif ($this->h) { - $maxwidth = $this->h * $original_aspect_ratio; - $maxheight = $this->h; - } else { - $maxwidth = $this->thumbnailCropW; - $maxheight = $this->thumbnailCropH; - } - } else { - $maxwidth = phpthumb_functions::nonempty_min($this->w, $this->thumbnailCropW, $this->config_output_maxwidth); - $maxheight = phpthumb_functions::nonempty_min($this->h, $this->thumbnailCropH, $this->config_output_maxheight); + // limit source area to original image area + $this->thumbnailCropW = max(1, min($this->thumbnailCropW, $this->source_width - $this->thumbnailCropX)); + $this->thumbnailCropH = max(1, min($this->thumbnailCropH, $this->source_height - $this->thumbnailCropY)); + + $this->DebugMessage('CalculateThumbnailDimensions() starting with [x,y,w,h] initially set to ['.$this->thumbnailCropX.','.$this->thumbnailCropY.','.$this->thumbnailCropW.','.$this->thumbnailCropH.']', __FILE__, __LINE__); + + + if ($this->zc && $this->w && $this->h) { + // Zoom Crop + // retain proportional resizing we did above, but crop off larger dimension so smaller + // dimension fully fits available space + + $scaling_X = $this->source_width / $this->w; + $scaling_Y = $this->source_height / $this->h; + if ($scaling_X > $scaling_Y) { + // some of the width will need to be cropped + $allowable_width = $this->source_width / $scaling_X * $scaling_Y; + $this->thumbnailCropW = round($allowable_width); + $this->thumbnailCropX = round(($this->source_width - $allowable_width) / 2); + + } elseif ($scaling_Y > $scaling_X) { + // some of the height will need to be cropped + $allowable_height = $this->source_height / $scaling_Y * $scaling_X; + $this->thumbnailCropH = round($allowable_height); + $this->thumbnailCropY = round(($this->source_height - $allowable_height) / 2); + + } else { + // image fits perfectly, no cropping needed + } + $this->thumbnail_width = $this->w; + $this->thumbnail_height = $this->h; + $this->thumbnail_image_width = $this->thumbnail_width; + $this->thumbnail_image_height = $this->thumbnail_height; + + } elseif ($this->iar && $this->w && $this->h) { + + // Ignore Aspect Ratio + // stretch image to fit exactly 'w' x 'h' + $this->thumbnail_width = $this->w; + $this->thumbnail_height = $this->h; + $this->thumbnail_image_width = $this->thumbnail_width; + $this->thumbnail_image_height = $this->thumbnail_height; + + } else { + + $original_aspect_ratio = $this->thumbnailCropW / $this->thumbnailCropH; + if ($this->aoe) { + if ($this->w && $this->h) { + $maxwidth = min($this->w, $this->h * $original_aspect_ratio); + $maxheight = min($this->h, $this->w / $original_aspect_ratio); + } elseif ($this->w) { + $maxwidth = $this->w; + $maxheight = $this->w / $original_aspect_ratio; + } elseif ($this->h) { + $maxwidth = $this->h * $original_aspect_ratio; + $maxheight = $this->h; + } else { + $maxwidth = $this->thumbnailCropW; + $maxheight = $this->thumbnailCropH; + } + } else { + $maxwidth = phpthumb_functions::nonempty_min($this->w, $this->thumbnailCropW, $this->config_output_maxwidth); + $maxheight = phpthumb_functions::nonempty_min($this->h, $this->thumbnailCropH, $this->config_output_maxheight); //echo $maxwidth.'x'.$maxheight.'
    '; - $maxwidth = min($maxwidth, $maxheight * $original_aspect_ratio); - $maxheight = min($maxheight, $maxwidth / $original_aspect_ratio); + $maxwidth = min($maxwidth, $maxheight * $original_aspect_ratio); + $maxheight = min($maxheight, $maxwidth / $original_aspect_ratio); //echo $maxwidth.'x'.$maxheight.'
    '; - } - - $this->thumbnail_image_width = $maxwidth; - $this->thumbnail_image_height = $maxheight; - $this->thumbnail_width = $maxwidth; - $this->thumbnail_height = $maxheight; - - $this->FixedAspectRatio(); - } - - $this->thumbnail_width = max(1, floor($this->thumbnail_width)); - $this->thumbnail_height = max(1, floor($this->thumbnail_height)); - return true; - } - - - function CreateGDoutput() { - $this->CalculateThumbnailDimensions(); - - // Create the GD image (either true-color or 256-color, depending on GD version) - $this->gdimg_output = phpthumb_functions::ImageCreateFunction($this->thumbnail_width, $this->thumbnail_height); - - // Images that have transparency must have the background filled with the configured 'bg' color - // otherwise the transparent color will appear as black - ImageSaveAlpha($this->gdimg_output, true); - if ($this->is_alpha && phpthumb_functions::gd_version() >= 2) { - - ImageAlphaBlending($this->gdimg_output, false); - $output_full_alpha = phpthumb_functions::ImageColorAllocateAlphaSafe($this->gdimg_output, 255, 255, 255, 127); - ImageFilledRectangle($this->gdimg_output, 0, 0, $this->thumbnail_width, $this->thumbnail_height, $output_full_alpha); - - } else { - - $current_transparent_color = ImageColorTransparent($this->gdimg_source); - if ($this->bg || (@$current_transparent_color >= 0)) { - - $this->config_background_hexcolor = ($this->bg ? $this->bg : $this->config_background_hexcolor); - if (!phpthumb_functions::IsHexColor($this->config_background_hexcolor)) { - return $this->ErrorImage('Invalid hex color string "'.$this->config_background_hexcolor.'" for parameter "bg"'); - } - $background_color = phpthumb_functions::ImageHexColorAllocate($this->gdimg_output, $this->config_background_hexcolor); - ImageFilledRectangle($this->gdimg_output, 0, 0, $this->thumbnail_width, $this->thumbnail_height, $background_color); - - } - - } - $this->DebugMessage('CreateGDoutput() returning canvas "'.$this->thumbnail_width.'x'.$this->thumbnail_height.'"', __FILE__, __LINE__); - return true; - } - - function SetOrientationDependantWidthHeight() { - $this->DebugMessage('SetOrientationDependantWidthHeight() starting with "'.$this->source_width.'"x"'.$this->source_height.'"', __FILE__, __LINE__); - if ($this->source_height > $this->source_width) { - // portrait - $this->w = phpthumb_functions::OneOfThese($this->wp, $this->w, $this->ws, $this->wl); - $this->h = phpthumb_functions::OneOfThese($this->hp, $this->h, $this->hs, $this->hl); - } elseif ($this->source_height < $this->source_width) { - // landscape - $this->w = phpthumb_functions::OneOfThese($this->wl, $this->w, $this->ws, $this->wp); - $this->h = phpthumb_functions::OneOfThese($this->hl, $this->h, $this->hs, $this->hp); - } else { - // square - $this->w = phpthumb_functions::OneOfThese($this->ws, $this->w, $this->wl, $this->wp); - $this->h = phpthumb_functions::OneOfThese($this->hs, $this->h, $this->hl, $this->hp); - } - //$this->w = round($this->w ? $this->w : (($this->h && $this->source_height) ? $this->h * $this->source_width / $this->source_height : $this->w)); - //$this->h = round($this->h ? $this->h : (($this->w && $this->source_width) ? $this->w * $this->source_height / $this->source_width : $this->h)); - $this->DebugMessage('SetOrientationDependantWidthHeight() setting w="'.intval($this->w).'", h="'.intval($this->h).'"', __FILE__, __LINE__); - return true; - } - - function ExtractEXIFgetImageSize() { - $this->DebugMessage('starting ExtractEXIFgetImageSize()', __FILE__, __LINE__); - - if (is_resource($this->gdimg_source)) { - - $this->source_width = ImageSX($this->gdimg_source); - $this->source_height = ImageSY($this->gdimg_source); - - $this->SetOrientationDependantWidthHeight(); - - } elseif ($this->rawImageData && !$this->sourceFilename) { - - $this->DebugMessage('bypassing EXIF and GetImageSize sections because $this->rawImageData is set and $this->sourceFilename is not set', __FILE__, __LINE__); - - } - - if (is_null($this->getimagesizeinfo)) { - $this->getimagesizeinfo = @GetImageSize($this->sourceFilename); - } - - if (!empty($this->getimagesizeinfo)) { - // great - $this->getimagesizeinfo['filesize'] = @filesize($this->sourceFilename); - } elseif (!$this->rawImageData) { - $this->DebugMessage('GetImageSize("'.$this->sourceFilename.'") failed', __FILE__, __LINE__); - } - - if ($this->config_prefer_imagemagick) { - if ($this->ImageMagickThumbnailToGD()) { - return true; - } - $this->DebugMessage('ImageMagickThumbnailToGD() failed', __FILE__, __LINE__); - } - - $this->source_width = $this->getimagesizeinfo[0]; - $this->source_height = $this->getimagesizeinfo[1]; - - $this->SetOrientationDependantWidthHeight(); - - if (phpthumb_functions::version_compare_replacement(phpversion(), '4.2.0', '>=') && function_exists('exif_read_data')) { - $this->exif_raw_data = @exif_read_data($this->sourceFilename, 0, true); - } - if (function_exists('exif_thumbnail') && ($this->getimagesizeinfo[2] == 2)) { - // Extract EXIF info from JPEGs - - $this->exif_thumbnail_width = ''; - $this->exif_thumbnail_height = ''; - $this->exif_thumbnail_type = ''; - - // The parameters width, height and imagetype are available since PHP v4.3.0 - if (phpthumb_functions::version_compare_replacement(phpversion(), '4.3.0', '>=')) { - - $this->exif_thumbnail_data = @exif_thumbnail($this->sourceFilename, $this->exif_thumbnail_width, $this->exif_thumbnail_height, $this->exif_thumbnail_type); - - } else { - - // older versions of exif_thumbnail output an error message but NOT return false on failure - ob_start(); - $this->exif_thumbnail_data = exif_thumbnail($this->sourceFilename); - $exit_thumbnail_error = ob_get_contents(); - ob_end_clean(); - if (!$exit_thumbnail_error && $this->exif_thumbnail_data) { - - if ($gdimg_exif_temp = $this->ImageCreateFromStringReplacement($this->exif_thumbnail_data, false)) { - $this->exif_thumbnail_width = ImageSX($gdimg_exif_temp); - $this->exif_thumbnail_height = ImageSY($gdimg_exif_temp); - $this->exif_thumbnail_type = 2; // (2 == JPEG) before PHP v4.3.0 only JPEG format EXIF thumbnails are returned - unset($gdimg_exif_temp); - } else { - return $this->ErrorImage('Failed - $this->ImageCreateFromStringReplacement($this->exif_thumbnail_data) in '.__FILE__.' on line '.__LINE__); - } - - } - - } - - } elseif (!function_exists('exif_thumbnail')) { - - $this->DebugMessage('exif_thumbnail() does not exist, cannot extract EXIF thumbnail', __FILE__, __LINE__); - return false; - - } - - $this->DebugMessage('EXIF thumbnail extraction: (size='.strlen($this->exif_thumbnail_data).'; type="'.$this->exif_thumbnail_type.'"; '.intval($this->exif_thumbnail_width).'x'.intval($this->exif_thumbnail_height).')', __FILE__, __LINE__); - - // see if EXIF thumbnail can be used directly with no processing - if ($this->config_use_exif_thumbnail_for_speed && $this->exif_thumbnail_data) { - while (true) { - if (!$this->xto) { - $source_ar = $this->source_width / $this->source_height; - $exif_ar = $this->exif_thumbnail_width / $this->exif_thumbnail_height; - if (number_format($source_ar, 2) != number_format($exif_ar, 2)) { - $this->DebugMessage('not using EXIF thumbnail because $source_ar != $exif_ar ('.$source_ar.' != '.$exif_ar.')', __FILE__, __LINE__); - break; - } - if ($this->w && ($this->w != $this->exif_thumbnail_width)) { - $this->DebugMessage('not using EXIF thumbnail because $this->w != $this->exif_thumbnail_width ('.$this->w.' != '.$this->exif_thumbnail_width.')', __FILE__, __LINE__); - break; - } - if ($this->h && ($this->h != $this->exif_thumbnail_height)) { - $this->DebugMessage('not using EXIF thumbnail because $this->h != $this->exif_thumbnail_height ('.$this->h.' != '.$this->exif_thumbnail_height.')', __FILE__, __LINE__); - break; - } - $CannotBeSetParameters = array('sx', 'sy', 'sh', 'sw', 'far', 'bg', 'bc', 'fltr', 'phpThumbDebug'); - foreach ($CannotBeSetParameters as $parameter) { - if ($this->$parameter) { - break 2; - } - } - } - - $this->DebugMessage('setting $this->gdimg_source = $this->ImageCreateFromStringReplacement($this->exif_thumbnail_data)', __FILE__, __LINE__); - $this->gdimg_source = $this->ImageCreateFromStringReplacement($this->exif_thumbnail_data); - $this->source_width = ImageSX($this->gdimg_source); - $this->source_height = ImageSY($this->gdimg_source); - return true; - } - } - - if (($this->config_max_source_pixels > 0) && (($this->source_width * $this->source_height) > $this->config_max_source_pixels)) { - - // Source image is larger than would fit in available PHP memory. - // If ImageMagick is installed, use it to generate the thumbnail. - // Else, if an EXIF thumbnail is available, use that as the source image. - // Otherwise, no choice but to fail with an error message - $this->DebugMessage('image is '.$this->source_width.'x'.$this->source_height.' and therefore contains more pixels ('.($this->source_width * $this->source_height).') than $this->config_max_source_pixels setting ('.$this->config_max_source_pixels.')', __FILE__, __LINE__); - if (!$this->config_prefer_imagemagick && $this->ImageMagickThumbnailToGD()) { - // excellent, we have a thumbnailed source image - return true; - } - - } - return true; - } - - - function SetCacheFilename() { - if (!is_null($this->cache_filename)) { - $this->DebugMessage('$this->cache_filename already set, skipping SetCacheFilename()', __FILE__, __LINE__); - return true; - } - $this->setOutputFormat(); - $this->setCacheDirectory(); - if (!$this->config_cache_directory) { - $this->DebugMessage('SetCacheFilename() failed because $this->config_cache_directory is empty', __FILE__, __LINE__); - return false; - } - - if (!$this->sourceFilename && !$this->rawImageData && $this->src) { - $this->sourceFilename = $this->ResolveFilenameToAbsolute($this->src); - } - - if ($this->config_cache_default_only_suffix && $this->sourceFilename) { - // simplified cache filenames: - // only use default parameters in phpThumb.config.php - // substitute source filename into * in $this->config_cache_default_only_suffix - // (eg: '*_thumb' becomes 'picture_thumb.jpg') - if (strpos($this->config_cache_default_only_suffix, '*') === false) { - $this->DebugMessage('aborting simplified caching filename because no * in "'.$this->config_cache_default_only_suffix.'"', __FILE__, __LINE__); - } else { - preg_match('/(.+)(\.[a-z0-9]+)?$/i', basename($this->sourceFilename), $matches); - $this->cache_filename = $this->config_cache_directory.DIRECTORY_SEPARATOR.rawurlencode(str_replace('*', @$matches[1], $this->config_cache_default_only_suffix)).'.'.strtolower($this->thumbnailFormat); - return true; - } - } - - $this->cache_filename = ''; - $broad_directory_name = ''; - if ($this->new) { - $broad_directory_name = strtolower(md5($this->new)); - $this->cache_filename .= '_new'.$broad_directory_name; - } elseif ($this->md5s) { - // source image MD5 hash provided - $this->DebugMessage('SetCacheFilename() _raw set from $this->md5s = "'.$this->md5s.'"', __FILE__, __LINE__); - $broad_directory_name = $this->md5s; - $this->cache_filename .= '_raw'.$this->md5s; - } elseif (!$this->src && $this->rawImageData) { - $this->DebugMessage('SetCacheFilename() _raw set from md5($this->rawImageData) = "'.md5($this->rawImageData).'"', __FILE__, __LINE__); - $broad_directory_name = strtolower(md5($this->rawImageData)); - $this->cache_filename .= '_raw'.$broad_directory_name; - } else { - $this->DebugMessage('SetCacheFilename() _src set from md5($this->sourceFilename) "'.$this->sourceFilename.'" = "'.md5($this->sourceFilename).'"', __FILE__, __LINE__); - $broad_directory_name = strtolower(md5($this->sourceFilename)); - $this->cache_filename .= '_src'.$broad_directory_name; - } - if (@$_SERVER['HTTP_REFERER'] && $this->config_nooffsitelink_enabled) { - $parsed_url1 = @phpthumb_functions::ParseURLbetter(@$_SERVER['HTTP_REFERER']); - $parsed_url2 = @phpthumb_functions::ParseURLbetter('http://'.@$_SERVER['HTTP_HOST']); - if (@$parsed_url1['host'] && @$parsed_url2['host'] && ($parsed_url1['host'] != $parsed_url2['host'])) { - // include "_offsite" only if nooffsitelink_enabled and if referrer doesn't match the domain of the current server - $this->cache_filename .= '_offsite'; - } - } - - $ParametersString = ''; - if ($this->fltr && is_array($this->fltr)) { - $ParametersString .= '_fltr'.implode('_fltr', $this->fltr); - } - $FilenameParameters1 = array('ar', 'bg', 'bc', 'far', 'sx', 'sy', 'sw', 'sh', 'zc'); - foreach ($FilenameParameters1 as $key) { - if ($this->$key) { - $ParametersString .= '_'.$key.$this->$key; - } - } - $FilenameParameters2 = array('h', 'w', 'wl', 'wp', 'ws', 'hp', 'hs', 'xto', 'ra', 'iar', 'aoe', 'maxb', 'sfn', 'dpi'); - foreach ($FilenameParameters2 as $key) { - if ($this->$key) { - $ParametersString .= '_'.$key.intval($this->$key); - } - } - if ($this->thumbnailFormat == 'jpeg') { - // only JPEG output has variable quality option - $ParametersString .= '_q'.intval($this->thumbnailQuality); - } - $this->DebugMessage('SetCacheFilename() _par set from md5('.$ParametersString.')', __FILE__, __LINE__); - $this->cache_filename .= '_par'.strtolower(md5($ParametersString)); - - if ($this->md5s) { - // source image MD5 hash provided - // do not source image modification date -- - // cached image will be used even if file was modified or removed - } elseif (!$this->config_cache_source_filemtime_ignore_remote && preg_match('/^(f|ht)tps?\:\/\//i', $this->src)) { - $this->cache_filename .= '_dat'.intval(phpthumb_functions::filedate_remote($this->src)); - } elseif (!$this->config_cache_source_filemtime_ignore_local && $this->src && !$this->rawImageData) { - $this->cache_filename .= '_dat'.intval(@filemtime($this->sourceFilename)); - } - - $this->cache_filename .= '.'.strtolower($this->thumbnailFormat); - $broad_directories = ''; - for ($i = 0; $i < $this->config_cache_directory_depth; $i++) { - $broad_directories .= DIRECTORY_SEPARATOR.substr($broad_directory_name, 0, $i + 1); - } - - $this->cache_filename = $this->config_cache_directory.$broad_directories.DIRECTORY_SEPARATOR.$this->config_cache_prefix.rawurlencode($this->cache_filename); - return true; - } - - - function SourceImageIsTooLarge($width, $height) { - if (!$this->config_max_source_pixels) { - return false; - } - if (function_exists('memory_get_usage')) { - $available_memory = max(intval(ini_get('memory_limit')), intval(get_cfg_var('memory_limit'))) * 1048576; - $available_memory -= memory_get_usage(); - return (bool) (($width * $height * 5) > $available_memory); - } - return (bool) (($width * $height) > $this->config_max_source_pixels); - } - - function ImageCreateFromFilename($filename) { - // try to create GD image source directly via GD, if possible, - // rather than buffering to memory and creating with ImageCreateFromString - $ImageCreateWasAttempted = false; - $gd_image = false; - - $this->DebugMessage('starting ImageCreateFromFilename('.$filename.')', __FILE__, __LINE__); - if ($filename && ($getimagesizeinfo = @GetImageSize($filename))) { - if (!$this->SourceImageIsTooLarge($getimagesizeinfo[0], $getimagesizeinfo[1])) { - $ImageCreateFromFunction = array( - 1 => 'ImageCreateFromGIF', - 2 => 'ImageCreateFromJPEG', - 3 => 'ImageCreateFromPNG', - 15 => 'ImageCreateFromWBMP', - ); - $this->DebugMessage('ImageCreateFromFilename found ($getimagesizeinfo[2]=='.@$getimagesizeinfo[2].')', __FILE__, __LINE__); - switch (@$getimagesizeinfo[2]) { - case 1: // GIF - case 2: // JPEG - case 3: // PNG - case 15: // WBMP - $ImageCreateFromFunctionName = $ImageCreateFromFunction[$getimagesizeinfo[2]]; - if (function_exists($ImageCreateFromFunctionName)) { - $this->DebugMessage('Calling '.$ImageCreateFromFunctionName.'('.$filename.')', __FILE__, __LINE__); - $ImageCreateWasAttempted = true; - $gd_image = $ImageCreateFromFunctionName($filename); - } else { - $this->DebugMessage('NOT calling '.$ImageCreateFromFunctionName.'('.$filename.') because !function_exists('.$ImageCreateFromFunctionName.')', __FILE__, __LINE__); - } - break; - - case 4: // SWF - case 5: // PSD - case 6: // BMP - case 7: // TIFF (LE) - case 8: // TIFF (BE) - case 9: // JPC - case 10: // JP2 - case 11: // JPX - case 12: // JB2 - case 13: // SWC - case 14: // IFF - case 16: // XBM - $this->DebugMessage('No built-in image creation function for image type "'.@$getimagesizeinfo[2].'" ($getimagesizeinfo[2])', __FILE__, __LINE__); - break; - - default: - $this->DebugMessage('Unknown value for $getimagesizeinfo[2]: "'.@$getimagesizeinfo[2].'"', __FILE__, __LINE__); - break; - } - } else { - $this->DebugMessage('image is '.$getimagesizeinfo[0].'x'.$getimagesizeinfo[1].' and therefore contains more pixels ('.($getimagesizeinfo[0] * $getimagesizeinfo[1]).') than $this->config_max_source_pixels setting ('.$this->config_max_source_pixels.')', __FILE__, __LINE__); - return false; - } - } else { - $this->DebugMessage('empty $filename or GetImageSize('.$filename.') failed', __FILE__, __LINE__); - } - - if (!$gd_image) { - // cannot create from filename, attempt to create source image with ImageCreateFromString, if possible - if ($ImageCreateWasAttempted) { - $this->DebugMessage(@$ImageCreateFromFunctionName.'() was attempted but FAILED', __FILE__, __LINE__); - } - $this->DebugMessage('Populating $rawimagedata', __FILE__, __LINE__); - $rawimagedata = ''; - if ($fp = @fopen($filename, 'rb')) { - $filesize = filesize($filename); - $blocksize = 8192; - $blockreads = ceil($filesize / $blocksize); - for ($i = 0; $i < $blockreads; $i++) { - $rawimagedata .= fread($fp, $blocksize); - } - fclose($fp); - } else { - $this->DebugMessage('cannot fopen('.$filename.')', __FILE__, __LINE__); - } - if ($rawimagedata) { - $this->DebugMessage('attempting ImageCreateFromStringReplacement($rawimagedata ('.strlen($rawimagedata).' bytes), true)', __FILE__, __LINE__); - $gd_image = $this->ImageCreateFromStringReplacement($rawimagedata, true); - } - } - return $gd_image; - } - - function SourceImageToGD() { - if (is_resource($this->gdimg_source)) { - $this->source_width = ImageSX($this->gdimg_source); - $this->source_height = ImageSY($this->gdimg_source); - $this->DebugMessage('skipping SourceImageToGD() because $this->gdimg_source is already a resource ('.$this->source_width.'x'.$this->source_height.')', __FILE__, __LINE__); - return true; - } - $this->DebugMessage('starting SourceImageToGD()', __FILE__, __LINE__); - - if ($this->ImageMagickThumbnailToGD()) { - - // excellent, we have a thumbnailed source image - $this->DebugMessage('ImageMagickThumbnailToGD() succeeded', __FILE__, __LINE__); - - } elseif (!$this->gdimg_source && $this->rawImageData) { - - if ($this->md5s && ($this->md5s != md5($this->rawImageData))) { - return $this->ErrorImage('$this->md5s != md5($this->rawImageData)'."\n".'"'.$this->md5s.'" != '."\n".'"'.md5($this->rawImageData).'"'); - } - $this->gdimg_source = $this->ImageCreateFromStringReplacement($this->rawImageData); - if (!$this->gdimg_source) { - if (substr($this->rawImageData, 0, 2) === 'BM') { - $this->getimagesizeinfo[2] = 6; // BMP - } elseif (substr($this->rawImageData, 0, 4) === 'II'."\x2A\x00") { - $this->getimagesizeinfo[2] = 7; // TIFF (littlendian) - } elseif (substr($this->rawImageData, 0, 4) === 'MM'."\x00\x2A") { - $this->getimagesizeinfo[2] = 8; // TIFF (bigendian) - } - $this->DebugMessage('SourceImageToGD.ImageCreateFromStringReplacement() failed with unknown image type "'.substr($this->rawImageData, 0, 4).'" ('.phpthumb_functions::HexCharDisplay(substr($this->rawImageData, 0, 4)).')', __FILE__, __LINE__); + } + + $this->thumbnail_image_width = $maxwidth; + $this->thumbnail_image_height = $maxheight; + $this->thumbnail_width = $maxwidth; + $this->thumbnail_height = $maxheight; + + $this->FixedAspectRatio(); + } + + $this->thumbnail_width = max(1, floor($this->thumbnail_width)); + $this->thumbnail_height = max(1, floor($this->thumbnail_height)); + return true; + } + + + function CreateGDoutput() { + $this->CalculateThumbnailDimensions(); + + // Create the GD image (either true-color or 256-color, depending on GD version) + $this->gdimg_output = phpthumb_functions::ImageCreateFunction($this->thumbnail_width, $this->thumbnail_height); + + // Images that have transparency must have the background filled with the configured 'bg' color + // otherwise the transparent color will appear as black + ImageSaveAlpha($this->gdimg_output, true); + if ($this->is_alpha && phpthumb_functions::gd_version() >= 2) { + + ImageAlphaBlending($this->gdimg_output, false); + $output_full_alpha = phpthumb_functions::ImageColorAllocateAlphaSafe($this->gdimg_output, 255, 255, 255, 127); + ImageFilledRectangle($this->gdimg_output, 0, 0, $this->thumbnail_width, $this->thumbnail_height, $output_full_alpha); + + } else { + + $current_transparent_color = ImageColorTransparent($this->gdimg_source); + if ($this->bg || (@$current_transparent_color >= 0)) { + + $this->config_background_hexcolor = ($this->bg ? $this->bg : $this->config_background_hexcolor); + if (!phpthumb_functions::IsHexColor($this->config_background_hexcolor)) { + return $this->ErrorImage('Invalid hex color string "'.$this->config_background_hexcolor.'" for parameter "bg"'); + } + $background_color = phpthumb_functions::ImageHexColorAllocate($this->gdimg_output, $this->config_background_hexcolor); + ImageFilledRectangle($this->gdimg_output, 0, 0, $this->thumbnail_width, $this->thumbnail_height, $background_color); + + } + + } + $this->DebugMessage('CreateGDoutput() returning canvas "'.$this->thumbnail_width.'x'.$this->thumbnail_height.'"', __FILE__, __LINE__); + return true; + } + + function SetOrientationDependantWidthHeight() { + $this->DebugMessage('SetOrientationDependantWidthHeight() starting with "'.$this->source_width.'"x"'.$this->source_height.'"', __FILE__, __LINE__); + if ($this->source_height > $this->source_width) { + // portrait + $this->w = phpthumb_functions::OneOfThese($this->wp, $this->w, $this->ws, $this->wl); + $this->h = phpthumb_functions::OneOfThese($this->hp, $this->h, $this->hs, $this->hl); + } elseif ($this->source_height < $this->source_width) { + // landscape + $this->w = phpthumb_functions::OneOfThese($this->wl, $this->w, $this->ws, $this->wp); + $this->h = phpthumb_functions::OneOfThese($this->hl, $this->h, $this->hs, $this->hp); + } else { + // square + $this->w = phpthumb_functions::OneOfThese($this->ws, $this->w, $this->wl, $this->wp); + $this->h = phpthumb_functions::OneOfThese($this->hs, $this->h, $this->hl, $this->hp); + } + //$this->w = round($this->w ? $this->w : (($this->h && $this->source_height) ? $this->h * $this->source_width / $this->source_height : $this->w)); + //$this->h = round($this->h ? $this->h : (($this->w && $this->source_width) ? $this->w * $this->source_height / $this->source_width : $this->h)); + $this->DebugMessage('SetOrientationDependantWidthHeight() setting w="'.intval($this->w).'", h="'.intval($this->h).'"', __FILE__, __LINE__); + return true; + } + + function ExtractEXIFgetImageSize() { + $this->DebugMessage('starting ExtractEXIFgetImageSize()', __FILE__, __LINE__); + + if (preg_match('#^http:#i', $this->src) && !$this->sourceFilename && $this->rawImageData) { + !$this->SourceDataToTempFile(); + } + if (is_null($this->getimagesizeinfo)) { + if ($this->sourceFilename) { + $this->getimagesizeinfo = @GetImageSize($this->sourceFilename); + $this->source_width = $this->getimagesizeinfo[0]; + $this->source_height = $this->getimagesizeinfo[1]; + $this->DebugMessage('GetImageSize('.$this->sourceFilename.') says image is '.$this->source_width.'x'.$this->source_height, __FILE__, __LINE__); + } else { + $this->DebugMessage('skipping GetImageSize() because $this->sourceFilename is empty', __FILE__, __LINE__); + } + } else { + $this->DebugMessage('skipping GetImageSize() because !is_null($this->getimagesizeinfo)', __FILE__, __LINE__); + } + + if (is_resource($this->gdimg_source)) { + + $this->source_width = ImageSX($this->gdimg_source); + $this->source_height = ImageSY($this->gdimg_source); + + $this->SetOrientationDependantWidthHeight(); + + } elseif ($this->rawImageData && !$this->sourceFilename) { + + if ($this->SourceImageIsTooLarge($this->source_width, $this->source_height)) { + $this->DebugMessage('NOT bypassing EXIF and GetImageSize sections because source image is too large for GD ('.$this->source_width.'x'.$this->source_width.'='.($this->source_width * $this->source_height * 5).'MB)', __FILE__, __LINE__); + } else { + $this->DebugMessage('bypassing EXIF and GetImageSize sections because $this->rawImageData is set, and $this->sourceFilename is not set, and source image is not too large for GD ('.$this->source_width.'x'.$this->source_width.'='.($this->source_width * $this->source_height * 5).'MB)', __FILE__, __LINE__); + } + + } + + if (is_null($this->getimagesizeinfo)) { + $this->getimagesizeinfo = @GetImageSize($this->sourceFilename); + } + + if (!empty($this->getimagesizeinfo)) { + // great + $this->getimagesizeinfo['filesize'] = @filesize($this->sourceFilename); + } elseif (!$this->rawImageData) { + $this->DebugMessage('GetImageSize("'.$this->sourceFilename.'") failed', __FILE__, __LINE__); + } + + if ($this->config_prefer_imagemagick) { + if ($this->ImageMagickThumbnailToGD()) { + return true; + } + $this->DebugMessage('ImageMagickThumbnailToGD() failed', __FILE__, __LINE__); + } + + $this->source_width = $this->getimagesizeinfo[0]; + $this->source_height = $this->getimagesizeinfo[1]; + + $this->SetOrientationDependantWidthHeight(); + + if (phpthumb_functions::version_compare_replacement(phpversion(), '4.2.0', '>=') && function_exists('exif_read_data')) { + switch ($this->getimagesizeinfo[2]) { + case IMAGETYPE_JPEG: + case IMAGETYPE_TIFF_II: + case IMAGETYPE_TIFF_MM: + $this->exif_raw_data = @exif_read_data($this->sourceFilename, 0, true); + break; + } + } + if (function_exists('exif_thumbnail') && ($this->getimagesizeinfo[2] == IMAGETYPE_JPEG)) { + // Extract EXIF info from JPEGs + + $this->exif_thumbnail_width = ''; + $this->exif_thumbnail_height = ''; + $this->exif_thumbnail_type = ''; + + // The parameters width, height and imagetype are available since PHP v4.3.0 + if (phpthumb_functions::version_compare_replacement(phpversion(), '4.3.0', '>=')) { + + $this->exif_thumbnail_data = @exif_thumbnail($this->sourceFilename, $this->exif_thumbnail_width, $this->exif_thumbnail_height, $this->exif_thumbnail_type); + + } else { + + // older versions of exif_thumbnail output an error message but NOT return false on failure + ob_start(); + $this->exif_thumbnail_data = exif_thumbnail($this->sourceFilename); + $exit_thumbnail_error = ob_get_contents(); + ob_end_clean(); + if (!$exit_thumbnail_error && $this->exif_thumbnail_data) { + + if ($gdimg_exif_temp = $this->ImageCreateFromStringReplacement($this->exif_thumbnail_data, false)) { + $this->exif_thumbnail_width = ImageSX($gdimg_exif_temp); + $this->exif_thumbnail_height = ImageSY($gdimg_exif_temp); + $this->exif_thumbnail_type = 2; // (2 == JPEG) before PHP v4.3.0 only JPEG format EXIF thumbnails are returned + unset($gdimg_exif_temp); + } else { + return $this->ErrorImage('Failed - $this->ImageCreateFromStringReplacement($this->exif_thumbnail_data) in '.__FILE__.' on line '.__LINE__); + } + + } + + } + + } elseif (!function_exists('exif_thumbnail')) { + + $this->DebugMessage('exif_thumbnail() does not exist, cannot extract EXIF thumbnail', __FILE__, __LINE__); + + } + + $this->DebugMessage('EXIF thumbnail extraction: (size='.strlen($this->exif_thumbnail_data).'; type="'.$this->exif_thumbnail_type.'"; '.intval($this->exif_thumbnail_width).'x'.intval($this->exif_thumbnail_height).')', __FILE__, __LINE__); + + // see if EXIF thumbnail can be used directly with no processing + if ($this->config_use_exif_thumbnail_for_speed && $this->exif_thumbnail_data) { + while (true) { + if (!$this->xto) { + $source_ar = $this->source_width / $this->source_height; + $exif_ar = $this->exif_thumbnail_width / $this->exif_thumbnail_height; + if (number_format($source_ar, 2) != number_format($exif_ar, 2)) { + $this->DebugMessage('not using EXIF thumbnail because $source_ar != $exif_ar ('.$source_ar.' != '.$exif_ar.')', __FILE__, __LINE__); + break; + } + if ($this->w && ($this->w != $this->exif_thumbnail_width)) { + $this->DebugMessage('not using EXIF thumbnail because $this->w != $this->exif_thumbnail_width ('.$this->w.' != '.$this->exif_thumbnail_width.')', __FILE__, __LINE__); + break; + } + if ($this->h && ($this->h != $this->exif_thumbnail_height)) { + $this->DebugMessage('not using EXIF thumbnail because $this->h != $this->exif_thumbnail_height ('.$this->h.' != '.$this->exif_thumbnail_height.')', __FILE__, __LINE__); + break; + } + $CannotBeSetParameters = array('sx', 'sy', 'sh', 'sw', 'far', 'bg', 'bc', 'fltr', 'phpThumbDebug'); + foreach ($CannotBeSetParameters as $parameter) { + if ($this->$parameter) { + break 2; + } + } + } + + $this->DebugMessage('setting $this->gdimg_source = $this->ImageCreateFromStringReplacement($this->exif_thumbnail_data)', __FILE__, __LINE__); + $this->gdimg_source = $this->ImageCreateFromStringReplacement($this->exif_thumbnail_data); + $this->source_width = ImageSX($this->gdimg_source); + $this->source_height = ImageSY($this->gdimg_source); + return true; + } + } + + if (($this->config_max_source_pixels > 0) && (($this->source_width * $this->source_height) > $this->config_max_source_pixels)) { + + // Source image is larger than would fit in available PHP memory. + // If ImageMagick is installed, use it to generate the thumbnail. + // Else, if an EXIF thumbnail is available, use that as the source image. + // Otherwise, no choice but to fail with an error message + $this->DebugMessage('image is '.$this->source_width.'x'.$this->source_height.' and therefore contains more pixels ('.($this->source_width * $this->source_height).') than $this->config_max_source_pixels setting ('.$this->config_max_source_pixels.')', __FILE__, __LINE__); + if (!$this->config_prefer_imagemagick && $this->ImageMagickThumbnailToGD()) { + // excellent, we have a thumbnailed source image + return true; + } + + } + return true; + } + + + function SetCacheFilename() { + if (!is_null($this->cache_filename)) { + $this->DebugMessage('$this->cache_filename already set, skipping SetCacheFilename()', __FILE__, __LINE__); + return true; + } + $this->setOutputFormat(); + $this->setCacheDirectory(); + if (!$this->config_cache_directory) { + $this->DebugMessage('SetCacheFilename() failed because $this->config_cache_directory is empty', __FILE__, __LINE__); + return false; + } + + if (!$this->sourceFilename && !$this->rawImageData && $this->src) { + $this->sourceFilename = $this->ResolveFilenameToAbsolute($this->src); + } + + if ($this->config_cache_default_only_suffix && $this->sourceFilename) { + // simplified cache filenames: + // only use default parameters in phpThumb.config.php + // substitute source filename into * in $this->config_cache_default_only_suffix + // (eg: '*_thumb' becomes 'picture_thumb.jpg') + if (strpos($this->config_cache_default_only_suffix, '*') === false) { + $this->DebugMessage('aborting simplified caching filename because no * in "'.$this->config_cache_default_only_suffix.'"', __FILE__, __LINE__); + } else { + preg_match('#(.+)(\\.[a-z0-9]+)?$#i', basename($this->sourceFilename), $matches); + $this->cache_filename = $this->config_cache_directory.DIRECTORY_SEPARATOR.rawurlencode(str_replace('*', @$matches[1], $this->config_cache_default_only_suffix)).'.'.strtolower($this->thumbnailFormat); + return true; + } + } + + $this->cache_filename = ''; + $broad_directory_name = ''; + if ($this->new) { + $broad_directory_name = strtolower(md5($this->new)); + $this->cache_filename .= '_new'.$broad_directory_name; + } elseif ($this->md5s) { + // source image MD5 hash provided + $this->DebugMessage('SetCacheFilename() _raw set from $this->md5s = "'.$this->md5s.'"', __FILE__, __LINE__); + $broad_directory_name = $this->md5s; + $this->cache_filename .= '_raw'.$this->md5s; + } elseif (!$this->src && $this->rawImageData) { + $this->DebugMessage('SetCacheFilename() _raw set from md5($this->rawImageData) = "'.md5($this->rawImageData).'"', __FILE__, __LINE__); + $broad_directory_name = strtolower(md5($this->rawImageData)); + $this->cache_filename .= '_raw'.$broad_directory_name; + } else { + $this->DebugMessage('SetCacheFilename() _src set from md5($this->sourceFilename) "'.$this->sourceFilename.'" = "'.md5($this->sourceFilename).'"', __FILE__, __LINE__); + $broad_directory_name = strtolower(md5($this->sourceFilename)); + $this->cache_filename .= '_src'.$broad_directory_name; + } + if (@$_SERVER['HTTP_REFERER'] && $this->config_nooffsitelink_enabled) { + $parsed_url1 = @phpthumb_functions::ParseURLbetter(@$_SERVER['HTTP_REFERER']); + $parsed_url2 = @phpthumb_functions::ParseURLbetter('http://'.@$_SERVER['HTTP_HOST']); + if (@$parsed_url1['host'] && @$parsed_url2['host'] && ($parsed_url1['host'] != $parsed_url2['host'])) { + // include "_offsite" only if nooffsitelink_enabled and if referrer doesn't match the domain of the current server + $this->cache_filename .= '_offsite'; + } + } + + $ParametersString = ''; + if ($this->fltr && is_array($this->fltr)) { + $ParametersString .= '_fltr'.implode('_fltr', $this->fltr); + } + $FilenameParameters1 = array('ar', 'bg', 'bc', 'far', 'sx', 'sy', 'sw', 'sh', 'zc'); + foreach ($FilenameParameters1 as $key) { + if ($this->$key) { + $ParametersString .= '_'.$key.$this->$key; + } + } + $FilenameParameters2 = array('h', 'w', 'wl', 'wp', 'ws', 'hp', 'hs', 'xto', 'ra', 'iar', 'aoe', 'maxb', 'sfn', 'dpi'); + foreach ($FilenameParameters2 as $key) { + if ($this->$key) { + $ParametersString .= '_'.$key.intval($this->$key); + } + } + if ($this->thumbnailFormat == 'jpeg') { + // only JPEG output has variable quality option + $ParametersString .= '_q'.intval($this->thumbnailQuality); + } + $this->DebugMessage('SetCacheFilename() _par set from md5('.$ParametersString.')', __FILE__, __LINE__); + $this->cache_filename .= '_par'.strtolower(md5($ParametersString)); + + if ($this->md5s) { + // source image MD5 hash provided + // do not source image modification date -- + // cached image will be used even if file was modified or removed + } elseif (!$this->config_cache_source_filemtime_ignore_remote && preg_match('#^(f|ht)tps?\://#i', $this->src)) { + $this->cache_filename .= '_dat'.intval(phpthumb_functions::filedate_remote($this->src)); + } elseif (!$this->config_cache_source_filemtime_ignore_local && $this->src && !$this->rawImageData) { + $this->cache_filename .= '_dat'.intval(@filemtime($this->sourceFilename)); + } + + $this->cache_filename .= '.'.strtolower($this->thumbnailFormat); + $broad_directories = ''; + for ($i = 0; $i < $this->config_cache_directory_depth; $i++) { + $broad_directories .= DIRECTORY_SEPARATOR.substr($broad_directory_name, 0, $i + 1); + } + + $this->cache_filename = $this->config_cache_directory.$broad_directories.DIRECTORY_SEPARATOR.$this->config_cache_prefix.rawurlencode($this->cache_filename); + return true; + } + + + function SourceImageIsTooLarge($width, $height) { + if (!$this->config_max_source_pixels) { + return false; + } + if (function_exists('memory_get_usage')) { + $available_memory = max(intval(ini_get('memory_limit')), intval(get_cfg_var('memory_limit'))) * 1048576; + $available_memory -= memory_get_usage(); + return (bool) (($width * $height * 5) > $available_memory); + } + return (bool) (($width * $height) > $this->config_max_source_pixels); + } + + function ImageCreateFromFilename($filename) { + // try to create GD image source directly via GD, if possible, + // rather than buffering to memory and creating with ImageCreateFromString + $ImageCreateWasAttempted = false; + $gd_image = false; + + $this->DebugMessage('starting ImageCreateFromFilename('.$filename.')', __FILE__, __LINE__); + if ($filename && ($getimagesizeinfo = @GetImageSize($filename))) { + if (!$this->SourceImageIsTooLarge($getimagesizeinfo[0], $getimagesizeinfo[1])) { + $ImageCreateFromFunction = array( + 1 => 'ImageCreateFromGIF', + 2 => 'ImageCreateFromJPEG', + 3 => 'ImageCreateFromPNG', + 15 => 'ImageCreateFromWBMP', + ); + $this->DebugMessage('ImageCreateFromFilename found ($getimagesizeinfo[2]=='.@$getimagesizeinfo[2].')', __FILE__, __LINE__); + switch (@$getimagesizeinfo[2]) { + case 1: // GIF + case 2: // JPEG + case 3: // PNG + case 15: // WBMP + $ImageCreateFromFunctionName = $ImageCreateFromFunction[$getimagesizeinfo[2]]; + if (function_exists($ImageCreateFromFunctionName)) { + $this->DebugMessage('Calling '.$ImageCreateFromFunctionName.'('.$filename.')', __FILE__, __LINE__); + $ImageCreateWasAttempted = true; + $gd_image = $ImageCreateFromFunctionName($filename); + } else { + $this->DebugMessage('NOT calling '.$ImageCreateFromFunctionName.'('.$filename.') because !function_exists('.$ImageCreateFromFunctionName.')', __FILE__, __LINE__); + } + break; + + case 4: // SWF + case 5: // PSD + case 6: // BMP + case 7: // TIFF (LE) + case 8: // TIFF (BE) + case 9: // JPC + case 10: // JP2 + case 11: // JPX + case 12: // JB2 + case 13: // SWC + case 14: // IFF + case 16: // XBM + $this->DebugMessage('No built-in image creation function for image type "'.@$getimagesizeinfo[2].'" ($getimagesizeinfo[2])', __FILE__, __LINE__); + break; + + default: + $this->DebugMessage('Unknown value for $getimagesizeinfo[2]: "'.@$getimagesizeinfo[2].'"', __FILE__, __LINE__); + break; + } + } else { + $this->DebugMessage('image is '.$getimagesizeinfo[0].'x'.$getimagesizeinfo[1].' and therefore contains more pixels ('.($getimagesizeinfo[0] * $getimagesizeinfo[1]).') than $this->config_max_source_pixels setting ('.$this->config_max_source_pixels.')', __FILE__, __LINE__); + return false; + } + } else { + $this->DebugMessage('empty $filename or GetImageSize('.$filename.') failed', __FILE__, __LINE__); + } + + if (!$gd_image) { + // cannot create from filename, attempt to create source image with ImageCreateFromString, if possible + if ($ImageCreateWasAttempted) { + $this->DebugMessage(@$ImageCreateFromFunctionName.'() was attempted but FAILED', __FILE__, __LINE__); + } + $this->DebugMessage('Populating $rawimagedata', __FILE__, __LINE__); + $rawimagedata = ''; + if ($fp = @fopen($filename, 'rb')) { + $filesize = filesize($filename); + $blocksize = 8192; + $blockreads = ceil($filesize / $blocksize); + for ($i = 0; $i < $blockreads; $i++) { + $rawimagedata .= fread($fp, $blocksize); + } + fclose($fp); + } else { + $this->DebugMessage('cannot fopen('.$filename.')', __FILE__, __LINE__); + } + if ($rawimagedata) { + $this->DebugMessage('attempting ImageCreateFromStringReplacement($rawimagedata ('.strlen($rawimagedata).' bytes), true)', __FILE__, __LINE__); + $gd_image = $this->ImageCreateFromStringReplacement($rawimagedata, true); + } + } + return $gd_image; + } + + function SourceImageToGD() { + if (is_resource($this->gdimg_source)) { + $this->source_width = ImageSX($this->gdimg_source); + $this->source_height = ImageSY($this->gdimg_source); + $this->DebugMessage('skipping SourceImageToGD() because $this->gdimg_source is already a resource ('.$this->source_width.'x'.$this->source_height.')', __FILE__, __LINE__); + return true; + } + $this->DebugMessage('starting SourceImageToGD()', __FILE__, __LINE__); + + if ($this->config_prefer_imagemagick) { + if (empty($this->sourceFilename) && !empty($this->rawImageData)) { + $this->DebugMessage('Copying raw image data to temp file and trying again with ImageMagick', __FILE__, __LINE__); + if ($tempnam = $this->phpThumb_tempnam()) { + if (file_put_contents($tempname, $this->rawImageData)) { + $this->sourceFilename = $tempnam; + if ($this->ImageMagickThumbnailToGD()) { + // excellent, we have a thumbnailed source image + $this->DebugMessage('ImageMagickThumbnailToGD() succeeded', __FILE__, __LINE__); + } else { + $this->DebugMessage('ImageMagickThumbnailToGD() failed', __FILE__, __LINE__); + } + } else { + $this->DebugMessage('failed to put $this->rawImageData into temp file "'.$tempnam.'"', __FILE__, __LINE__); + } + } else { + $this->DebugMessage('failed to generate temp file name', __FILE__, __LINE__); + } + } + } + if (!$this->gdimg_source && $this->rawImageData) { + + if ($this->SourceImageIsTooLarge($this->source_width, $this->source_height)) { + $memory_get_usage = (function_exists('memory_get_usage') ? memory_get_usage() : 0); + return $this->ErrorImage('Source image is too large ('.$this->source_width.'x'.$this->source_height.' = '.number_format($this->source_width * $this->source_height / 1000000, 1).'Mpx, max='.number_format($this->config_max_source_pixels / 1000000, 1).'Mpx) for GD creation (either install ImageMagick or increase PHP memory_limit to at least '.ceil(($memory_get_usage + (5 * $this->source_width * $this->source_height)) / 1048576).'M).'); + } + if ($this->md5s && ($this->md5s != md5($this->rawImageData))) { + return $this->ErrorImage('$this->md5s != md5($this->rawImageData)'."\n".'"'.$this->md5s.'" != '."\n".'"'.md5($this->rawImageData).'"'); + } + //if ($this->issafemode) { + // return $this->ErrorImage('Cannot generate thumbnails from raw image data when PHP SAFE_MODE enabled'); + //} + $this->gdimg_source = $this->ImageCreateFromStringReplacement($this->rawImageData); + if (!$this->gdimg_source) { + if (substr($this->rawImageData, 0, 2) === 'BM') { + $this->getimagesizeinfo[2] = 6; // BMP + } elseif (substr($this->rawImageData, 0, 4) === 'II'."\x2A\x00") { + $this->getimagesizeinfo[2] = 7; // TIFF (littlendian) + } elseif (substr($this->rawImageData, 0, 4) === 'MM'."\x00\x2A") { + $this->getimagesizeinfo[2] = 8; // TIFF (bigendian) + } + $this->DebugMessage('SourceImageToGD.ImageCreateFromStringReplacement() failed with unknown image type "'.substr($this->rawImageData, 0, 4).'" ('.phpthumb_functions::HexCharDisplay(substr($this->rawImageData, 0, 4)).')', __FILE__, __LINE__); // return $this->ErrorImage('Unknown image type identified by "'.substr($this->rawImageData, 0, 4).'" ('.phpthumb_functions::HexCharDisplay(substr($this->rawImageData, 0, 4)).') in SourceImageToGD()['.__LINE__.']'); - } - - } elseif (!$this->gdimg_source && $this->sourceFilename) { - - if ($this->md5s && ($this->md5s != phpthumb_functions::md5_file_safe($this->sourceFilename))) { - return $this->ErrorImage('$this->md5s != md5(sourceFilename)'."\n".'"'.$this->md5s.'" != '."\n".'"'.phpthumb_functions::md5_file_safe($this->sourceFilename).'"'); - } - switch (@$this->getimagesizeinfo[2]) { - case 1: - case 3: - // GIF or PNG input file may have transparency - $this->is_alpha = true; - break; - } - if (!$this->SourceImageIsTooLarge($this->source_width, $this->source_height)) { - $this->gdimg_source = $this->ImageCreateFromFilename($this->sourceFilename); - } - - } - - while (true) { - if ($this->gdimg_source) { - $this->DebugMessage('Not using EXIF thumbnail data because $this->gdimg_source is already set', __FILE__, __LINE__); - break; - } - if (!$this->exif_thumbnail_data) { - $this->DebugMessage('Not using EXIF thumbnail data because $this->exif_thumbnail_data is empty', __FILE__, __LINE__); - break; - } - if (ini_get('safe_mode')) { - if (!$this->SourceImageIsTooLarge($this->source_width, $this->source_height)) { - $this->DebugMessage('Using EXIF thumbnail data because source image too large and safe_mode enabled', __FILE__, __LINE__); - $this->aoe = true; - } else { - break; - } - } else { - if (!$this->config_use_exif_thumbnail_for_speed) { - $this->DebugMessage('Not using EXIF thumbnail data because $this->config_use_exif_thumbnail_for_speed is FALSE', __FILE__, __LINE__); - break; - } - if (($this->thumbnailCropX != 0) || ($this->thumbnailCropY != 0)) { - $this->DebugMessage('Not using EXIF thumbnail data because source cropping is enabled ('.$this->thumbnailCropX.','.$this->thumbnailCropY.')', __FILE__, __LINE__); - break; - } - if (($this->w > $this->exif_thumbnail_width) || ($this->h > $this->exif_thumbnail_height)) { - $this->DebugMessage('Not using EXIF thumbnail data because EXIF thumbnail is too small ('.$this->exif_thumbnail_width.'x'.$this->exif_thumbnail_height.' vs '.$this->w.'x'.$this->h.')', __FILE__, __LINE__); - break; - } - $source_ar = $this->source_width / $this->source_height; - $exif_ar = $this->exif_thumbnail_width / $this->exif_thumbnail_height; - if (number_format($source_ar, 2) != number_format($exif_ar, 2)) { - $this->DebugMessage('not using EXIF thumbnail because $source_ar != $exif_ar ('.$source_ar.' != '.$exif_ar.')', __FILE__, __LINE__); - break; - } - } - - // EXIF thumbnail exists, and is equal to or larger than destination thumbnail, and will be use as source image - $this->DebugMessage('Trying to use EXIF thumbnail as source image', __FILE__, __LINE__); - - if ($gdimg_exif_temp = $this->ImageCreateFromStringReplacement($this->exif_thumbnail_data, false)) { - - $this->DebugMessage('Successfully using EXIF thumbnail as source image', __FILE__, __LINE__); - $this->gdimg_source = $gdimg_exif_temp; - $this->source_width = $this->exif_thumbnail_width; - $this->source_height = $this->exif_thumbnail_height; - $this->thumbnailCropW = $this->source_width; - $this->thumbnailCropH = $this->source_height; - return true; - - } else { - $this->DebugMessage('$this->ImageCreateFromStringReplacement($this->exif_thumbnail_data, false) failed', __FILE__, __LINE__); - } - - break; - } - - if (!$this->gdimg_source) { - $this->DebugMessage('$this->gdimg_source is still empty', __FILE__, __LINE__); - - $this->DebugMessage('ImageMagickThumbnailToGD() failed', __FILE__, __LINE__); - - $imageHeader = ''; - $gd_info = gd_info(); - $GDreadSupport = false; - switch (@$this->getimagesizeinfo[2]) { - case 1: - $imageHeader = 'Content-Type: image/gif'; - $GDreadSupport = (bool) @$gd_info['GIF Read Support']; - break; - case 2: - $imageHeader = 'Content-Type: image/jpeg'; - $GDreadSupport = (bool) @$gd_info['JPG Support']; - break; - case 3: - $imageHeader = 'Content-Type: image/png'; - $GDreadSupport = (bool) @$gd_info['PNG Support']; - break; - } - if ($imageHeader) { - // cannot create image for whatever reason (maybe ImageCreateFromJPEG et al are not available?) - // and ImageMagick is not available either, no choice but to output original (not resized/modified) data and exit - if ($this->config_error_die_on_source_failure) { - $errormessages = array(); - $errormessages[] = 'All attempts to create GD image source failed.'; - if ($this->fatalerror) { - $errormessages[] = $this->fatalerror; - } - if (ini_get('safe_mode')) { - $errormessages[] = 'Safe Mode enabled, therefore ImageMagick is unavailable. (disable Safe Mode if possible)'; - } elseif (!$this->ImageMagickVersion()) { - $errormessages[] = 'ImageMagick is not installed (it is highly recommended that you install it).'; - } - if ($this->SourceImageIsTooLarge($this->getimagesizeinfo[0], $this->getimagesizeinfo[1])) { - $memory_get_usage = (function_exists('memory_get_usage') ? memory_get_usage() : 0); - $errormessages[] = 'Source image is too large ('.$this->getimagesizeinfo[0].'x'.$this->getimagesizeinfo[1].' = '.number_format($this->getimagesizeinfo[0] * $this->getimagesizeinfo[1] / 1000000, 1).'Mpx, max='.number_format($this->config_max_source_pixels / 1000000, 1).'Mpx) for GD creation (either install ImageMagick or increase PHP memory_limit to at least '.ceil(($memory_get_usage + (5 * $this->getimagesizeinfo[0] * $this->getimagesizeinfo[1])) / 1000000).'M).'; - } elseif (!$GDreadSupport) { - $errormessages[] = 'GD does not have read support for "'.$imageHeader.'".'; - } else { - $errormessages[] = 'Source image probably corrupt.'; - } - $this->ErrorImage(implode("\n", $errormessages)); - - } else { - $this->DebugMessage('All attempts to create GD image source failed ('.(ini_get('safe_mode') ? 'Safe Mode enabled, ImageMagick unavailable and source image probably too large for GD': ($GDreadSupport ? 'source image probably corrupt' : 'GD does not have read support for "'.$imageHeader.'"')).'), cannot generate thumbnail'); - //$this->DebugMessage('All attempts to create GD image source failed ('.($GDreadSupport ? 'source image probably corrupt' : 'GD does not have read support for "'.$imageHeader.'"').'), outputing raw image', __FILE__, __LINE__); - //if (!$this->phpThumbDebug) { - // header($imageHeader); - // echo $this->rawImageData; - // exit; - //} - return false; - } - } - - //switch (substr($this->rawImageData, 0, 2)) { - // case 'BM': - switch (@$this->getimagesizeinfo[2]) { - case 6: - ob_start(); - if (!@include_once(dirname(__FILE__).'/phpthumb.bmp.php')) { - ob_end_clean(); - return $this->ErrorImage('include_once('.dirname(__FILE__).'/phpthumb.bmp.php) failed'); - } - ob_end_clean(); - if ($fp = @fopen($this->sourceFilename, 'rb')) { - $this->rawImageData = ''; - while (!feof($fp)) { - $this->rawImageData .= fread($fp, 32768); - } - fclose($fp); - } - $phpthumb_bmp = new phpthumb_bmp(); - $this->gdimg_source = $phpthumb_bmp->phpthumb_bmp2gd($this->rawImageData, (phpthumb_functions::gd_version() >= 2.0)); - unset($phpthumb_bmp); - if ($this->gdimg_source) { - $this->DebugMessage('$phpthumb_bmp->phpthumb_bmp2gd() succeeded', __FILE__, __LINE__); - } else { - return $this->ErrorImage($this->ImageMagickVersion() ? 'ImageMagick failed on BMP source conversion' : 'phpthumb_bmp2gd() failed'); - } - break; - //} - //switch (substr($this->rawImageData, 0, 4)) { - // case 'II'."\x2A\x00": - // case 'MM'."\x00\x2A": - case 7: - case 8: - return $this->ErrorImage($this->ImageMagickVersion() ? 'ImageMagick failed on TIFF source conversion' : 'ImageMagick is unavailable and phpThumb() does not support TIFF source images without it'); - break; - - //case "\xD7\xCD\xC6\x9A": - // return $this->ErrorImage($this->ImageMagickVersion() ? 'ImageMagick failed on WMF source conversion' : 'ImageMagick is unavailable and phpThumb() does not support WMF source images without it'); - // break; - } - - if (!$this->gdimg_source) { - $HeaderFourBytes = ''; - if ($fp = @fopen($this->sourceFilename, 'rb')) { - $HeaderFourBytes = fread($fp, 4); - fclose($fp); - } - if ($HeaderFourBytes == "\xD7\xCD\xC6\x9A") { // WMF - return $this->ErrorImage($this->ImageMagickVersion() ? 'ImageMagick failed on WMF source conversion' : 'ImageMagick is unavailable and phpThumb() does not support WMF source images without it'); - } elseif ($HeaderFourBytes == '%PDF') { // "%PDF" - return $this->ErrorImage($this->ImageMagickVersion() ? 'ImageMagick and GhostScript are both required for PDF source images; GhostScript may not be properly configured' : 'ImageMagick and/or GhostScript are unavailable and phpThumb() does not support PDF source images without them'); - } elseif (substr($HeaderFourBytes, 0, 3) == "\xFF\xD8\xFF") { // JPEG - return $this->ErrorImage('Image is too large for PHP-GD memory_limit, please install ImageMagick or increase php.ini memory_limit setting'); - } elseif ($HeaderFourBytes == '%PNG') { // "%PNG" - return $this->ErrorImage('Image is too large for PHP-GD memory_limit, please install ImageMagick or increase php.ini memory_limit setting'); - } elseif (substr($HeaderFourBytes, 0, 3) == 'GIF') { // GIF - return $this->ErrorImage('Image is too large for PHP-GD memory_limit, please install ImageMagick or increase php.ini memory_limit setting'); - } - return $this->ErrorImage('Unknown image type identified by "'.substr($HeaderFourBytes, 0, 4).'" ('.phpthumb_functions::HexCharDisplay(substr($HeaderFourBytes, 0, 4)).') in SourceImageToGD()['.__LINE__.']'); - - } - } - - if (!$this->gdimg_source) { - if ($gdimg_exif_temp = $this->ImageCreateFromStringReplacement($this->exif_thumbnail_data, false)) { - $this->DebugMessage('All other attempts failed, but successfully using EXIF thumbnail as source image', __FILE__, __LINE__); - $this->gdimg_source = $gdimg_exif_temp; - // override allow-enlarging setting if EXIF thumbnail is the only source available - // otherwise thumbnails larger than the EXIF thumbnail will be created at EXIF size - $this->aoe = true; - return true; - } - return false; - } - - $this->source_width = ImageSX($this->gdimg_source); - $this->source_height = ImageSY($this->gdimg_source); - return true; - } - - - function phpThumbDebugVarDump($var) { - if (is_null($var)) { - return 'NULL'; - } elseif (is_bool($var)) { - return ($var ? 'TRUE' : 'FALSE'); - } elseif (is_string($var)) { - return 'string('.strlen($var).')'.str_repeat(' ', max(0, 3 - strlen(strlen($var)))).' "'.$var.'"'; - } elseif (is_int($var)) { - return 'integer '.$var; - } elseif (is_float($var)) { - return 'float '.$var; - } elseif (is_array($var)) { - ob_start(); - var_dump($var); - $vardumpoutput = ob_get_contents(); - ob_end_clean(); - return strtr($vardumpoutput, "\n\r\t", ' '); - } - return gettype($var); - } - - function phpThumbDebug($level='') { - if ($level && ($this->phpThumbDebug !== $level)) { - return true; - } - if ($this->config_disable_debug) { - return $this->ErrorImage('phpThumbDebug disabled'); - } - - $FunctionsExistance = array('exif_thumbnail', 'gd_info', 'image_type_to_mime_type', 'ImageCopyResampled', 'ImageCopyResized', 'ImageCreate', 'ImageCreateFromString', 'ImageCreateTrueColor', 'ImageIsTrueColor', 'ImageRotate', 'ImageTypes', 'version_compare', 'ImageCreateFromGIF', 'ImageCreateFromJPEG', 'ImageCreateFromPNG', 'ImageCreateFromWBMP', 'ImageCreateFromXBM', 'ImageCreateFromXPM', 'ImageCreateFromString', 'ImageCreateFromGD', 'ImageCreateFromGD2', 'ImageCreateFromGD2Part', 'ImageJPEG', 'ImageGIF', 'ImagePNG', 'ImageWBMP'); - $ParameterNames = array('src', 'new', 'w', 'h', 'f', 'q', 'sx', 'sy', 'sw', 'sh', 'far', 'bg', 'bc', 'file', 'goto', 'err', 'xto', 'ra', 'ar', 'aoe', 'iar', 'maxb'); - $ConfigVariableNames = array('document_root', 'temp_directory', 'output_format', 'output_maxwidth', 'output_maxheight', 'error_message_image_default', 'error_bgcolor', 'error_textcolor', 'error_fontsize', 'error_die_on_error', 'error_silent_die_on_error', 'error_die_on_source_failure', 'nohotlink_enabled', 'nohotlink_valid_domains', 'nohotlink_erase_image', 'nohotlink_text_message', 'nooffsitelink_enabled', 'nooffsitelink_valid_domains', 'nooffsitelink_require_refer', 'nooffsitelink_erase_image', 'nooffsitelink_text_message', 'high_security_enabled', 'allow_src_above_docroot', 'allow_src_above_phpthumb', 'allow_parameter_file', 'allow_parameter_goto', 'max_source_pixels', 'use_exif_thumbnail_for_speed', 'border_hexcolor', 'background_hexcolor', 'ttf_directory', 'disable_pathinfo_parsing', 'disable_imagecopyresampled'); - $OtherVariableNames = array('phpThumbDebug', 'thumbnailQuality', 'thumbnailFormat', 'gdimg_output', 'gdimg_source', 'sourceFilename', 'source_width', 'source_height', 'thumbnailCropX', 'thumbnailCropY', 'thumbnailCropW', 'thumbnailCropH', 'exif_thumbnail_width', 'exif_thumbnail_height', 'exif_thumbnail_type', 'thumbnail_width', 'thumbnail_height', 'thumbnail_image_width', 'thumbnail_image_height'); - - $DebugOutput = array(); - $DebugOutput[] = 'phpThumb() version = '.$this->phpthumb_version; - $DebugOutput[] = 'phpversion() = '.@phpversion(); - $DebugOutput[] = 'PHP_OS = '.PHP_OS; - $DebugOutput[] = '__FILE__ = '.__FILE__; - $DebugOutput[] = 'realpath(.) = '.@realpath('.'); - $DebugOutput[] = '$_SERVER[PHP_SELF] = '.@$_SERVER['PHP_SELF']; - $DebugOutput[] = '$_SERVER[HOST_NAME] = '.@$_SERVER['HOST_NAME']; - $DebugOutput[] = '$_SERVER[HTTP_REFERER] = '.@$_SERVER['HTTP_REFERER']; - $DebugOutput[] = '$_SERVER[QUERY_STRING] = '.@$_SERVER['QUERY_STRING']; - $DebugOutput[] = '$_SERVER[PATH_INFO] = '.@$_SERVER['PATH_INFO']; - $DebugOutput[] = '$_SERVER[DOCUMENT_ROOT] = '.@$_SERVER['DOCUMENT_ROOT']; - $DebugOutput[] = 'getenv(DOCUMENT_ROOT) = '.@getenv('DOCUMENT_ROOT'); - $DebugOutput[] = ''; - - $DebugOutput[] = 'get_magic_quotes_gpc() = '.$this->phpThumbDebugVarDump(@get_magic_quotes_gpc()); - $DebugOutput[] = 'get_magic_quotes_runtime() = '.$this->phpThumbDebugVarDump(@get_magic_quotes_runtime()); - $DebugOutput[] = 'error_reporting() = '.$this->phpThumbDebugVarDump(error_reporting()); - $DebugOutput[] = 'ini_get(error_reporting) = '.$this->phpThumbDebugVarDump(@ini_get('error_reporting')); - $DebugOutput[] = 'ini_get(display_errors) = '.$this->phpThumbDebugVarDump(@ini_get('display_errors')); - $DebugOutput[] = 'ini_get(allow_url_fopen) = '.$this->phpThumbDebugVarDump(@ini_get('allow_url_fopen')); - $DebugOutput[] = 'ini_get(disable_functions) = '.$this->phpThumbDebugVarDump(@ini_get('disable_functions')); - $DebugOutput[] = 'get_cfg_var(disable_functions) = '.$this->phpThumbDebugVarDump(@get_cfg_var('disable_functions')); - $DebugOutput[] = 'ini_get(safe_mode) = '.$this->phpThumbDebugVarDump(@ini_get('safe_mode')); - $DebugOutput[] = 'ini_get(open_basedir) = '.$this->phpThumbDebugVarDump(@ini_get('open_basedir')); - $DebugOutput[] = 'ini_get(max_execution_time) = '.$this->phpThumbDebugVarDump(@ini_get('max_execution_time')); - $DebugOutput[] = 'ini_get(memory_limit) = '.$this->phpThumbDebugVarDump(@ini_get('memory_limit')); - $DebugOutput[] = 'get_cfg_var(memory_limit) = '.$this->phpThumbDebugVarDump(@get_cfg_var('memory_limit')); - $DebugOutput[] = 'memory_get_usage() = '.(function_exists('memory_get_usage') ? $this->phpThumbDebugVarDump(@memory_get_usage()) : 'n/a'); - $DebugOutput[] = ''; - - $DebugOutput[] = '$this->config_prefer_imagemagick = '.$this->phpThumbDebugVarDump($this->config_prefer_imagemagick); - $DebugOutput[] = '$this->config_imagemagick_path = '.$this->phpThumbDebugVarDump($this->config_imagemagick_path); - $DebugOutput[] = '$this->ImageMagickWhichConvert() = '.$this->ImageMagickWhichConvert(); - $IMpathUsed = ($this->config_imagemagick_path ? $this->config_imagemagick_path : $this->ImageMagickWhichConvert()); - $DebugOutput[] = '[actual ImageMagick path used] = '.$this->phpThumbDebugVarDump($IMpathUsed); - $DebugOutput[] = 'file_exists([actual ImageMagick path used]) = '.$this->phpThumbDebugVarDump(@file_exists($IMpathUsed)); - $DebugOutput[] = 'ImageMagickVersion(false) = '.$this->ImageMagickVersion(false); - $DebugOutput[] = 'ImageMagickVersion(true) = '.$this->ImageMagickVersion(true); - $DebugOutput[] = ''; - - $DebugOutput[] = '$this->config_cache_directory = '.$this->phpThumbDebugVarDump($this->config_cache_directory); - $DebugOutput[] = '$this->config_cache_directory_depth = '.$this->phpThumbDebugVarDump($this->config_cache_directory_depth); - $DebugOutput[] = '$this->config_cache_disable_warning = '.$this->phpThumbDebugVarDump($this->config_cache_disable_warning); - $DebugOutput[] = '$this->config_cache_maxage = '.$this->phpThumbDebugVarDump($this->config_cache_maxage); - $DebugOutput[] = '$this->config_cache_maxsize = '.$this->phpThumbDebugVarDump($this->config_cache_maxsize); - $DebugOutput[] = '$this->config_cache_maxfiles = '.$this->phpThumbDebugVarDump($this->config_cache_maxfiles); - $DebugOutput[] = '$this->config_cache_force_passthru = '.$this->phpThumbDebugVarDump($this->config_cache_force_passthru); - $DebugOutput[] = '$this->cache_filename = '.$this->phpThumbDebugVarDump($this->cache_filename); - $DebugOutput[] = 'is_readable($this->config_cache_directory) = '.$this->phpThumbDebugVarDump(@is_readable($this->config_cache_directory)); - $DebugOutput[] = 'is_writable($this->config_cache_directory) = '.$this->phpThumbDebugVarDump(@is_writable($this->config_cache_directory)); - $DebugOutput[] = 'is_readable($this->cache_filename) = '.$this->phpThumbDebugVarDump(@is_readable($this->cache_filename)); - $DebugOutput[] = 'is_writable($this->cache_filename) = '.(@file_exists($this->cache_filename) ? $this->phpThumbDebugVarDump(@is_writable($this->cache_filename)) : 'n/a'); - $DebugOutput[] = ''; - - foreach ($ConfigVariableNames as $varname) { - $varname = 'config_'.$varname; - $value = $this->$varname; - $DebugOutput[] = '$this->'.str_pad($varname, 37, ' ', STR_PAD_RIGHT).' = '.$this->phpThumbDebugVarDump($value); - } - $DebugOutput[] = ''; - foreach ($OtherVariableNames as $varname) { - $value = $this->$varname; - $DebugOutput[] = '$this->'.str_pad($varname, 27, ' ', STR_PAD_RIGHT).' = '.$this->phpThumbDebugVarDump($value); - } - $DebugOutput[] = 'strlen($this->rawImageData) = '.strlen(@$this->rawImageData); - $DebugOutput[] = 'strlen($this->exif_thumbnail_data) = '.strlen(@$this->exif_thumbnail_data); - $DebugOutput[] = ''; - - foreach ($ParameterNames as $varname) { - $value = $this->$varname; - $DebugOutput[] = '$this->'.str_pad($varname, 4, ' ', STR_PAD_RIGHT).' = '.$this->phpThumbDebugVarDump($value); - } - $DebugOutput[] = ''; - - foreach ($FunctionsExistance as $functionname) { - $DebugOutput[] = 'builtin_function_exists('.$functionname.')'.str_repeat(' ', 23 - strlen($functionname)).' = '.$this->phpThumbDebugVarDump(phpthumb_functions::builtin_function_exists($functionname)); - } - $DebugOutput[] = ''; - - $gd_info = gd_info(); - foreach ($gd_info as $key => $value) { - $DebugOutput[] = 'gd_info.'.str_pad($key, 34, ' ', STR_PAD_RIGHT).' = '.$this->phpThumbDebugVarDump($value); - } - $DebugOutput[] = ''; - - $exif_info = phpthumb_functions::exif_info(); - foreach ($exif_info as $key => $value) { - $DebugOutput[] = 'exif_info.'.str_pad($key, 26, ' ', STR_PAD_RIGHT).' = '.$this->phpThumbDebugVarDump($value); - } - $DebugOutput[] = ''; - - if ($ApacheLookupURIarray = phpthumb_functions::ApacheLookupURIarray(dirname(@$_SERVER['PHP_SELF']))) { - foreach ($ApacheLookupURIarray as $key => $value) { - $DebugOutput[] = 'ApacheLookupURIarray.'.str_pad($key, 15, ' ', STR_PAD_RIGHT).' = '.$this->phpThumbDebugVarDump($value); - } - } else { - $DebugOutput[] = 'ApacheLookupURIarray() -- FAILED'; - } - $DebugOutput[] = ''; - - if (isset($_GET) && is_array($_GET)) { - foreach ($_GET as $key => $value) { - $DebugOutput[] = '$_GET['.$key.']'.str_repeat(' ', 30 - strlen($key)).'= '.$this->phpThumbDebugVarDump($value); - } - } - if (isset($_POST) && is_array($_POST)) { - foreach ($_POST as $key => $value) { - $DebugOutput[] = '$_POST['.$key.']'.str_repeat(' ', 29 - strlen($key)).'= '.$this->phpThumbDebugVarDump($value); - } - } - $DebugOutput[] = ''; - - $DebugOutput[] = '$this->debugmessages:'; - foreach ($this->debugmessages as $errorstring) { - $DebugOutput[] = ' * '.$errorstring; - } - $DebugOutput[] = ''; - - $DebugOutput[] = '$this->debugtiming:'; - foreach ($this->debugtiming as $timestamp => $timingstring) { - $DebugOutput[] = ' * '.$timestamp.' '.$timingstring; - } - $DebugOutput[] = ' * Total processing time: '.number_format(max(array_keys($this->debugtiming)) - min(array_keys($this->debugtiming)), 6); - - $this->f = (isset($_GET['f']) ? $_GET['f'] : $this->f); // debug modes 0-2 don't recognize text mode otherwise - return $this->ErrorImage(implode("\n", $DebugOutput), 700, 500, true); - } - - function FatalError($text) { - if (is_null($this->fatalerror)) { - $this->fatalerror = $text; - } - return true; - } - - function ErrorImage($text, $width=0, $height=0, $forcedisplay=false) { - $width = ($width ? $width : $this->config_error_image_width); - $height = ($height ? $height : $this->config_error_image_height); - - $text = 'phpThumb() v'.$this->phpthumb_version."\n\n".$text; - if ($this->config_disable_debug) { - $text = 'Error messages disabled'; - } - - $this->FatalError($text); - $this->DebugMessage($text, __FILE__, __LINE__); - if ($this->phpThumbDebug && !$forcedisplay) { - return false; - } - if (!$this->config_error_die_on_error && !$forcedisplay) { - return false; - } - if ($this->config_error_silent_die_on_error) { - exit; - } - if ($this->err || $this->config_error_message_image_default) { - // Show generic custom error image instead of error message - // for use on production sites where you don't want debug messages - if ($this->err == 'showerror') { - // fall through and actually show error message even if default error image is set - } else { - header('Location: '.($this->err ? $this->err : $this->config_error_message_image_default)); - exit; - } - } - $this->setOutputFormat(); - if (!$this->thumbnailFormat || (phpthumb_functions::gd_version() < 1)) { - $this->thumbnailFormat = 'text'; - } - if (@$this->thumbnailFormat == 'text') { - // bypass all GD functions and output text error message - if (!headers_sent()) { - header('Content-type: text/plain'); - echo $text; - } else { - echo '
    '.htmlspecialchars($text).'
    '; - } - exit; - } - - $FontWidth = ImageFontWidth($this->config_error_fontsize); - $FontHeight = ImageFontHeight($this->config_error_fontsize); - - $LinesOfText = explode("\n", @wordwrap($text, floor($width / $FontWidth), "\n", true)); - $height = max($height, count($LinesOfText) * $FontHeight); - - $headers_file = ''; - $headers_line = ''; - if (phpthumb_functions::version_compare_replacement(phpversion(), '4.3.0', '>=') && headers_sent($headers_file, $headers_line)) { - - echo "\n".'**Headers already sent in file "'.$headers_file.'" on line "'.$headers_line.'", dumping error message as text:**
    '."\n\n".$text."\n".'
    '; - - } elseif (headers_sent()) { - - echo "\n".'**Headers already sent, dumping error message as text:**
    '."\n\n".$text."\n".'
    '; - - } elseif ($gdimg_error = ImageCreate($width, $height)) { - - $background_color = phpthumb_functions::ImageHexColorAllocate($gdimg_error, $this->config_error_bgcolor, true); - $text_color = phpthumb_functions::ImageHexColorAllocate($gdimg_error, $this->config_error_textcolor, true); - ImageFilledRectangle($gdimg_error, 0, 0, $width, $height, $background_color); - $lineYoffset = 0; - foreach ($LinesOfText as $line) { - ImageString($gdimg_error, $this->config_error_fontsize, 2, $lineYoffset, $line, $text_color); - $lineYoffset += $FontHeight; - } - if (function_exists('ImageTypes')) { - $imagetypes = ImageTypes(); - if ($imagetypes & IMG_PNG) { - header('Content-Type: image/png'); - ImagePNG($gdimg_error); - } elseif ($imagetypes & IMG_GIF) { - header('Content-Type: image/gif'); - ImageGIF($gdimg_error); - } elseif ($imagetypes & IMG_JPG) { - header('Content-Type: image/jpeg'); - ImageJPEG($gdimg_error); - } elseif ($imagetypes & IMG_WBMP) { - header('Content-Type: image/vnd.wap.wbmp'); - ImageWBMP($gdimg_error); - } - } - ImageDestroy($gdimg_error); - - } - if (!headers_sent()) { - echo "\n".'**Failed to send graphical error image, dumping error message as text:**
    '."\n\n".$text; - } - exit; - return true; - } - - function ImageCreateFromStringReplacement(&$RawImageData, $DieOnErrors=false) { - // there are serious bugs in the non-bundled versions of GD which may cause - // PHP to segfault when calling ImageCreateFromString() - avoid if at all possible - // when not using a bundled version of GD2 - if (!phpthumb_functions::gd_version()) { - if ($DieOnErrors) { - if (!headers_sent()) { - // base64-encoded error image in GIF format - $ERROR_NOGD = 'R0lGODlhIAAgALMAAAAAABQUFCQkJDY2NkZGRldXV2ZmZnJycoaGhpSUlKWlpbe3t8XFxdXV1eTk5P7+/iwAAAAAIAAgAAAE/vDJSau9WILtTAACUinDNijZtAHfCojS4W5H+qxD8xibIDE9h0OwWaRWDIljJSkUJYsN4bihMB8th3IToAKs1VtYM75cyV8sZ8vygtOE5yMKmGbO4jRdICQCjHdlZzwzNW4qZSQmKDaNjhUMBX4BBAlmMywFSRWEmAI6b5gAlhNxokGhooAIK5o/pi9vEw4Lfj4OLTAUpj6IabMtCwlSFw0DCKBoFqwAB04AjI54PyZ+yY3TD0ss2YcVmN/gvpcu4TOyFivWqYJlbAHPpOntvxNAACcmGHjZzAZqzSzcq5fNjxFmAFw9iFRunD1epU6tsIPmFCAJnWYE0FURk7wJDA0MTKpEzoWAAskiAAA7'; - header('Content-Type: image/gif'); - echo base64_decode($ERROR_NOGD); - } else { - echo '*** ERROR: No PHP-GD support available ***'; - } - exit; - } else { - $this->DebugMessage('ImageCreateFromStringReplacement() failed: gd_version says "'.phpthumb_functions::gd_version().'"', __FILE__, __LINE__); - return false; - } - } - if (phpthumb_functions::gd_is_bundled()) { - $this->DebugMessage('ImageCreateFromStringReplacement() calling built-in ImageCreateFromString()', __FILE__, __LINE__); - return @ImageCreateFromString($RawImageData); - } - if (ini_get('safe_mode')) { - $this->DebugMessage('ImageCreateFromStringReplacement() failed: cannot create temp file in SAFE_MODE', __FILE__, __LINE__); - return false; - } - - switch (substr($RawImageData, 0, 3)) { - case 'GIF': - $ICFSreplacementFunctionName = 'ImageCreateFromGIF'; - break; - case "\xFF\xD8\xFF": - $ICFSreplacementFunctionName = 'ImageCreateFromJPEG'; - break; - case "\x89".'PN': - $ICFSreplacementFunctionName = 'ImageCreateFromPNG'; - break; - default: - $this->DebugMessage('ImageCreateFromStringReplacement() failed: unknown fileformat signature "'.phpthumb_functions::HexCharDisplay(substr($RawImageData, 0, 3)).'"', __FILE__, __LINE__); - return false; - break; - } - if ($tempnam = $this->phpThumb_tempnam()) { - if ($fp_tempnam = @fopen($tempnam, 'wb')) { - fwrite($fp_tempnam, $RawImageData); - fclose($fp_tempnam); - if (($ICFSreplacementFunctionName == 'ImageCreateFromGIF') && !function_exists($ICFSreplacementFunctionName)) { - - // Need to create from GIF file, but ImageCreateFromGIF does not exist - ob_start(); - if (!@include_once(dirname(__FILE__).'/phpthumb.gif.php')) { - $ErrorMessage = 'Failed to include required file "'.dirname(__FILE__).'/phpthumb.gif.php" in '.__FILE__.' on line '.__LINE__; - $this->DebugMessage($ErrorMessage, __FILE__, __LINE__); - } - ob_end_clean(); - // gif_loadFileToGDimageResource() cannot read from raw data, write to file first - if ($tempfilename = $this->phpThumb_tempnam()) { - if ($fp_tempfile = @fopen($tempfilename, 'wb')) { - fwrite($fp_tempfile, $RawImageData); - fclose($fp_tempfile); - $gdimg_source = gif_loadFileToGDimageResource($tempfilename); - $this->DebugMessage('gif_loadFileToGDimageResource('.$tempfilename.') completed', __FILE__, __LINE__); - unlink($tempfilename); - return $gdimg_source; - break; - } else { - $ErrorMessage = 'Failed to open tempfile in '.__FILE__.' on line '.__LINE__; - $this->DebugMessage($ErrorMessage, __FILE__, __LINE__); - } - } else { - $ErrorMessage = 'Failed to open generate tempfile name in '.__FILE__.' on line '.__LINE__; - $this->DebugMessage($ErrorMessage, __FILE__, __LINE__); - } - - } elseif (function_exists($ICFSreplacementFunctionName) && ($gdimg_source = @$ICFSreplacementFunctionName($tempnam))) { - - // great - $this->DebugMessage($ICFSreplacementFunctionName.'('.$tempnam.') succeeded', __FILE__, __LINE__); - unlink($tempnam); - return $gdimg_source; - - } else { - - // GD functions not available, or failed to create image - $this->DebugMessage($ICFSreplacementFunctionName.'('.$tempnam.') '.(function_exists($ICFSreplacementFunctionName) ? 'failed' : 'does not exist'), __FILE__, __LINE__); - if (isset($_GET['phpThumbDebug'])) { - $this->phpThumbDebug(); - } - - } - } else { - $ErrorMessage = 'Failed to fopen('.$tempnam.', "wb") in '.__FILE__.' on line '.__LINE__."\n".'You may need to set $PHPTHUMB_CONFIG[temp_directory] in phpThumb.config.php'; - $this->DebugMessage($ErrorMessage, __FILE__, __LINE__); - } - @unlink($tempnam); - } else { - $ErrorMessage = 'Failed to generate phpThumb_tempnam() in '.__FILE__.' on line '.__LINE__."\n".'You may need to set $PHPTHUMB_CONFIG[temp_directory] in phpThumb.config.php'; - } - if ($DieOnErrors && $ErrorMessage) { - return $this->ErrorImage($ErrorMessage); - } - return false; - } - - function ImageResizeFunction(&$dst_im, &$src_im, $dstX, $dstY, $srcX, $srcY, $dstW, $dstH, $srcW, $srcH) { - $this->DebugMessage('ImageResizeFunction($o, $s, '.$dstX.', '.$dstY.', '.$srcX.', '.$srcY.', '.$dstW.', '.$dstH.', '.$srcW.', '.$srcH.')', __FILE__, __LINE__); - if (($dstW == $srcW) && ($dstH == $srcH)) { - return ImageCopy($dst_im, $src_im, $dstX, $dstY, $srcX, $srcY, $srcW, $srcH); - } - if (phpthumb_functions::gd_version() >= 2.0) { - if ($this->config_disable_imagecopyresampled) { - return phpthumb_functions::ImageCopyResampleBicubic($dst_im, $src_im, $dstX, $dstY, $srcX, $srcY, $dstW, $dstH, $srcW, $srcH); - } - return ImageCopyResampled($dst_im, $src_im, $dstX, $dstY, $srcX, $srcY, $dstW, $dstH, $srcW, $srcH); - } - return ImageCopyResized($dst_im, $src_im, $dstX, $dstY, $srcX, $srcY, $dstW, $dstH, $srcW, $srcH); - } - - function InitializeTempDirSetting() { - $this->config_temp_directory = realpath($this->config_temp_directory ? $this->config_temp_directory : (getenv('TMPDIR') ? getenv('TMPDIR') : getenv('TMP'))); - return true; - } - - function phpThumb_tempnam() { - $this->InitializeTempDirSetting(); - $tempnam = realpath(tempnam($this->config_temp_directory, 'pThumb')); - $this->DebugMessage('phpThumb_tempnam() returning "'.$tempnam.'"', __FILE__, __LINE__); - return $tempnam; - } - - function DebugMessage($message, $file='', $line='') { - $this->debugmessages[] = $message.($file ? ' in file "'.(basename($file) ? basename($file) : $file).'"' : '').($line ? ' on line '.$line : ''); - return true; - } - - function DebugTimingMessage($message, $file='', $line='', $timestamp=0) { - if (!$timestamp) { - $timestamp = array_sum(explode(' ', microtime())); - } - $this->debugtiming[number_format($timestamp, 6, '.', '')] = ': '.$message.($file ? ' in file "'.(basename($file) ? basename($file) : $file).'"' : '').($line ? ' on line '.$line : ''); - return true; - } + } + + } elseif (!$this->gdimg_source && $this->sourceFilename) { + + if ($this->md5s && ($this->md5s != phpthumb_functions::md5_file_safe($this->sourceFilename))) { + return $this->ErrorImage('$this->md5s != md5(sourceFilename)'."\n".'"'.$this->md5s.'" != '."\n".'"'.phpthumb_functions::md5_file_safe($this->sourceFilename).'"'); + } + switch (@$this->getimagesizeinfo[2]) { + case 1: + case 3: + // GIF or PNG input file may have transparency + $this->is_alpha = true; + break; + } + if (!$this->SourceImageIsTooLarge($this->source_width, $this->source_height)) { + $this->gdimg_source = $this->ImageCreateFromFilename($this->sourceFilename); + } + + } + + while (true) { + if ($this->gdimg_source) { + $this->DebugMessage('Not using EXIF thumbnail data because $this->gdimg_source is already set', __FILE__, __LINE__); + break; + } + if (!$this->exif_thumbnail_data) { + $this->DebugMessage('Not using EXIF thumbnail data because $this->exif_thumbnail_data is empty', __FILE__, __LINE__); + break; + } + if (ini_get('safe_mode')) { + if (!$this->SourceImageIsTooLarge($this->source_width, $this->source_height)) { + $this->DebugMessage('Using EXIF thumbnail data because source image too large and safe_mode enabled', __FILE__, __LINE__); + $this->aoe = true; + } else { + break; + } + } else { + if (!$this->config_use_exif_thumbnail_for_speed) { + $this->DebugMessage('Not using EXIF thumbnail data because $this->config_use_exif_thumbnail_for_speed is FALSE', __FILE__, __LINE__); + break; + } + if (($this->thumbnailCropX != 0) || ($this->thumbnailCropY != 0)) { + $this->DebugMessage('Not using EXIF thumbnail data because source cropping is enabled ('.$this->thumbnailCropX.','.$this->thumbnailCropY.')', __FILE__, __LINE__); + break; + } + if (($this->w > $this->exif_thumbnail_width) || ($this->h > $this->exif_thumbnail_height)) { + $this->DebugMessage('Not using EXIF thumbnail data because EXIF thumbnail is too small ('.$this->exif_thumbnail_width.'x'.$this->exif_thumbnail_height.' vs '.$this->w.'x'.$this->h.')', __FILE__, __LINE__); + break; + } + $source_ar = $this->source_width / $this->source_height; + $exif_ar = $this->exif_thumbnail_width / $this->exif_thumbnail_height; + if (number_format($source_ar, 2) != number_format($exif_ar, 2)) { + $this->DebugMessage('not using EXIF thumbnail because $source_ar != $exif_ar ('.$source_ar.' != '.$exif_ar.')', __FILE__, __LINE__); + break; + } + } + + // EXIF thumbnail exists, and is equal to or larger than destination thumbnail, and will be use as source image + $this->DebugMessage('Trying to use EXIF thumbnail as source image', __FILE__, __LINE__); + + if ($gdimg_exif_temp = $this->ImageCreateFromStringReplacement($this->exif_thumbnail_data, false)) { + + $this->DebugMessage('Successfully using EXIF thumbnail as source image', __FILE__, __LINE__); + $this->gdimg_source = $gdimg_exif_temp; + $this->source_width = $this->exif_thumbnail_width; + $this->source_height = $this->exif_thumbnail_height; + $this->thumbnailCropW = $this->source_width; + $this->thumbnailCropH = $this->source_height; + return true; + + } else { + $this->DebugMessage('$this->ImageCreateFromStringReplacement($this->exif_thumbnail_data, false) failed', __FILE__, __LINE__); + } + + break; + } + + if (!$this->gdimg_source) { + $this->DebugMessage('$this->gdimg_source is still empty', __FILE__, __LINE__); + + $this->DebugMessage('ImageMagickThumbnailToGD() failed', __FILE__, __LINE__); + + $imageHeader = ''; + $gd_info = gd_info(); + $GDreadSupport = false; + switch (@$this->getimagesizeinfo[2]) { + case 1: + $imageHeader = 'Content-Type: image/gif'; + $GDreadSupport = (bool) @$gd_info['GIF Read Support']; + break; + case 2: + $imageHeader = 'Content-Type: image/jpeg'; + $GDreadSupport = (bool) @$gd_info['JPG Support']; + break; + case 3: + $imageHeader = 'Content-Type: image/png'; + $GDreadSupport = (bool) @$gd_info['PNG Support']; + break; + } + if ($imageHeader) { + // cannot create image for whatever reason (maybe ImageCreateFromJPEG et al are not available?) + // and ImageMagick is not available either, no choice but to output original (not resized/modified) data and exit + if ($this->config_error_die_on_source_failure) { + $errormessages = array(); + $errormessages[] = 'All attempts to create GD image source failed.'; + if ($this->fatalerror) { + $errormessages[] = $this->fatalerror; + } + if ($this->issafemode) { + $errormessages[] = 'Safe Mode enabled, therefore ImageMagick is unavailable. (disable Safe Mode if possible)'; + } elseif (!$this->ImageMagickVersion()) { + $errormessages[] = 'ImageMagick is not installed (it is highly recommended that you install it).'; + } + if ($this->SourceImageIsTooLarge($this->getimagesizeinfo[0], $this->getimagesizeinfo[1])) { + $memory_get_usage = (function_exists('memory_get_usage') ? memory_get_usage() : 0); + $errormessages[] = 'Source image is too large ('.$this->getimagesizeinfo[0].'x'.$this->getimagesizeinfo[1].' = '.number_format($this->getimagesizeinfo[0] * $this->getimagesizeinfo[1] / 1000000, 1).'Mpx, max='.number_format($this->config_max_source_pixels / 1000000, 1).'Mpx) for GD creation (either install ImageMagick or increase PHP memory_limit to at least '.ceil(($memory_get_usage + (5 * $this->getimagesizeinfo[0] * $this->getimagesizeinfo[1])) / 1048576).'M).'; + } elseif (!$GDreadSupport) { + $errormessages[] = 'GD does not have read support for "'.$imageHeader.'".'; + } else { + $errormessages[] = 'Source image probably corrupt.'; + } + $this->ErrorImage(implode("\n", $errormessages)); + + } else { + $this->DebugMessage('All attempts to create GD image source failed ('.(ini_get('safe_mode') ? 'Safe Mode enabled, ImageMagick unavailable and source image probably too large for GD': ($GDreadSupport ? 'source image probably corrupt' : 'GD does not have read support for "'.$imageHeader.'"')).'), cannot generate thumbnail'); + //$this->DebugMessage('All attempts to create GD image source failed ('.($GDreadSupport ? 'source image probably corrupt' : 'GD does not have read support for "'.$imageHeader.'"').'), outputing raw image', __FILE__, __LINE__); + //if (!$this->phpThumbDebug) { + // header($imageHeader); + // echo $this->rawImageData; + // exit; + //} + return false; + } + } + + //switch (substr($this->rawImageData, 0, 2)) { + // case 'BM': + switch (@$this->getimagesizeinfo[2]) { + case 6: + ob_start(); + if (!@include_once(dirname(__FILE__).'/phpthumb.bmp.php')) { + ob_end_clean(); + return $this->ErrorImage('include_once('.dirname(__FILE__).'/phpthumb.bmp.php) failed'); + } + ob_end_clean(); + if ($fp = @fopen($this->sourceFilename, 'rb')) { + $this->rawImageData = ''; + while (!feof($fp)) { + $this->rawImageData .= fread($fp, 32768); + } + fclose($fp); + } + $phpthumb_bmp = new phpthumb_bmp(); + $this->gdimg_source = $phpthumb_bmp->phpthumb_bmp2gd($this->rawImageData, (phpthumb_functions::gd_version() >= 2.0)); + unset($phpthumb_bmp); + if ($this->gdimg_source) { + $this->DebugMessage('$phpthumb_bmp->phpthumb_bmp2gd() succeeded', __FILE__, __LINE__); + } else { + return $this->ErrorImage($this->ImageMagickVersion() ? 'ImageMagick failed on BMP source conversion' : 'phpthumb_bmp2gd() failed'); + } + break; + //} + //switch (substr($this->rawImageData, 0, 4)) { + // case 'II'."\x2A\x00": + // case 'MM'."\x00\x2A": + case 7: + case 8: + return $this->ErrorImage($this->ImageMagickVersion() ? 'ImageMagick failed on TIFF source conversion' : 'ImageMagick is unavailable and phpThumb() does not support TIFF source images without it'); + break; + + //case "\xD7\xCD\xC6\x9A": + // return $this->ErrorImage($this->ImageMagickVersion() ? 'ImageMagick failed on WMF source conversion' : 'ImageMagick is unavailable and phpThumb() does not support WMF source images without it'); + // break; + } + + if (!$this->gdimg_source) { + $HeaderFourBytes = ''; + if ($this->rawImageData) { + $HeaderFourBytes = substr($this->rawImageData, 0, 4); + } elseif ($this->sourceFilename) { + if ($fp = @fopen($this->sourceFilename, 'rb')) { + $HeaderFourBytes = fread($fp, 4); + fclose($fp); + } else { + return $this->ErrorImage('failed to open "'.$this->sourceFilename.'" SourceImageToGD() ['.__LINE__.']'); + } + } else { + return $this->ErrorImage('Unable to create image, neither filename nor image data suppplied in SourceImageToGD() ['.__LINE__.']'); + } + if (!$this->ImageMagickVersion() && !phpthumb_functions::gd_version()) { + return $this->ErrorImage('Neither GD nor ImageMagick seem to be installed on this server. At least one (preferably GD), or better both, MUST be installed for phpThumb to work.'); + } elseif ($HeaderFourBytes == "\xD7\xCD\xC6\x9A") { // WMF + return $this->ErrorImage($this->ImageMagickVersion() ? 'ImageMagick failed on WMF source conversion' : 'ImageMagick is unavailable and phpThumb() does not support WMF source images without it'); + } elseif ($HeaderFourBytes == '%PDF') { // "%PDF" + return $this->ErrorImage($this->ImageMagickVersion() ? 'ImageMagick and GhostScript are both required for PDF source images; GhostScript may not be properly configured' : 'ImageMagick and/or GhostScript are unavailable and phpThumb() does not support PDF source images without them'); + } elseif (substr($HeaderFourBytes, 0, 3) == "\xFF\xD8\xFF") { // JPEG + return $this->ErrorImage('Image (JPEG) is too large for PHP-GD memory_limit, please install ImageMagick or increase php.ini memory_limit setting'); + } elseif ($HeaderFourBytes == '%PNG') { // "%PNG" + return $this->ErrorImage('Image (PNG) is too large for PHP-GD memory_limit, please install ImageMagick or increase php.ini memory_limit setting'); + } elseif (substr($HeaderFourBytes, 0, 3) == 'GIF') { // GIF + return $this->ErrorImage('Image (GIF) is too large for PHP-GD memory_limit, please install ImageMagick or increase php.ini memory_limit setting'); + } + return $this->ErrorImage('Unknown image type identified by "'.$HeaderFourBytes.'" ('.phpthumb_functions::HexCharDisplay($HeaderFourBytes).') in SourceImageToGD() ['.__LINE__.']'); + } + } + + if (!$this->gdimg_source) { + if ($gdimg_exif_temp = $this->ImageCreateFromStringReplacement($this->exif_thumbnail_data, false)) { + $this->DebugMessage('All other attempts failed, but successfully using EXIF thumbnail as source image', __FILE__, __LINE__); + $this->gdimg_source = $gdimg_exif_temp; + // override allow-enlarging setting if EXIF thumbnail is the only source available + // otherwise thumbnails larger than the EXIF thumbnail will be created at EXIF size + $this->aoe = true; + return true; + } + return false; + } + + $this->source_width = ImageSX($this->gdimg_source); + $this->source_height = ImageSY($this->gdimg_source); + return true; + } + + + function phpThumbDebugVarDump($var) { + if (is_null($var)) { + return 'NULL'; + } elseif (is_bool($var)) { + return ($var ? 'TRUE' : 'FALSE'); + } elseif (is_string($var)) { + return 'string('.strlen($var).')'.str_repeat(' ', max(0, 3 - strlen(strlen($var)))).' "'.$var.'"'; + } elseif (is_int($var)) { + return 'integer '.$var; + } elseif (is_float($var)) { + return 'float '.$var; + } elseif (is_array($var)) { + ob_start(); + var_dump($var); + $vardumpoutput = ob_get_contents(); + ob_end_clean(); + return strtr($vardumpoutput, "\n\r\t", ' '); + } + return gettype($var); + } + + function phpThumbDebug($level='') { + if ($level && ($this->phpThumbDebug !== $level)) { + return true; + } + if ($this->config_disable_debug) { + return $this->ErrorImage('phpThumbDebug disabled'); + } + + $FunctionsExistance = array('exif_thumbnail', 'gd_info', 'image_type_to_mime_type', 'GetImageSize', 'ImageCopyResampled', 'ImageCopyResized', 'ImageCreate', 'ImageCreateFromString', 'ImageCreateTrueColor', 'ImageIsTrueColor', 'ImageRotate', 'ImageTypes', 'version_compare', 'ImageCreateFromGIF', 'ImageCreateFromJPEG', 'ImageCreateFromPNG', 'ImageCreateFromWBMP', 'ImageCreateFromXBM', 'ImageCreateFromXPM', 'ImageCreateFromString', 'ImageCreateFromGD', 'ImageCreateFromGD2', 'ImageCreateFromGD2Part', 'ImageJPEG', 'ImageGIF', 'ImagePNG', 'ImageWBMP'); + $ParameterNames = array('src', 'new', 'w', 'h', 'f', 'q', 'sx', 'sy', 'sw', 'sh', 'far', 'bg', 'bc', 'file', 'goto', 'err', 'xto', 'ra', 'ar', 'aoe', 'iar', 'maxb'); + $ConfigVariableNames = array('document_root', 'temp_directory', 'output_format', 'output_maxwidth', 'output_maxheight', 'error_message_image_default', 'error_bgcolor', 'error_textcolor', 'error_fontsize', 'error_die_on_error', 'error_silent_die_on_error', 'error_die_on_source_failure', 'nohotlink_enabled', 'nohotlink_valid_domains', 'nohotlink_erase_image', 'nohotlink_text_message', 'nooffsitelink_enabled', 'nooffsitelink_valid_domains', 'nooffsitelink_require_refer', 'nooffsitelink_erase_image', 'nooffsitelink_text_message', 'high_security_enabled', 'allow_src_above_docroot', 'allow_src_above_phpthumb', 'max_source_pixels', 'use_exif_thumbnail_for_speed', 'border_hexcolor', 'background_hexcolor', 'ttf_directory', 'disable_pathinfo_parsing', 'disable_imagecopyresampled'); + $OtherVariableNames = array('phpThumbDebug', 'thumbnailQuality', 'thumbnailFormat', 'gdimg_output', 'gdimg_source', 'sourceFilename', 'source_width', 'source_height', 'thumbnailCropX', 'thumbnailCropY', 'thumbnailCropW', 'thumbnailCropH', 'exif_thumbnail_width', 'exif_thumbnail_height', 'exif_thumbnail_type', 'thumbnail_width', 'thumbnail_height', 'thumbnail_image_width', 'thumbnail_image_height'); + + $DebugOutput = array(); + $DebugOutput[] = 'phpThumb() version = '.$this->phpthumb_version; + $DebugOutput[] = 'phpversion() = '.@phpversion(); + $DebugOutput[] = 'PHP_OS = '.PHP_OS; + $DebugOutput[] = '$_SERVER[SERVER_SOFTWARE] = '.@$_SERVER['SERVER_SOFTWARE']; + $DebugOutput[] = '__FILE__ = '.__FILE__; + $DebugOutput[] = 'realpath(.) = '.@realpath('.'); + $DebugOutput[] = '$_SERVER[PHP_SELF] = '.@$_SERVER['PHP_SELF']; + $DebugOutput[] = '$_SERVER[HOST_NAME] = '.@$_SERVER['HOST_NAME']; + $DebugOutput[] = '$_SERVER[HTTP_REFERER] = '.@$_SERVER['HTTP_REFERER']; + $DebugOutput[] = '$_SERVER[QUERY_STRING] = '.@$_SERVER['QUERY_STRING']; + $DebugOutput[] = '$_SERVER[PATH_INFO] = '.@$_SERVER['PATH_INFO']; + $DebugOutput[] = '$_SERVER[DOCUMENT_ROOT] = '.@$_SERVER['DOCUMENT_ROOT']; + $DebugOutput[] = 'getenv(DOCUMENT_ROOT) = '.@getenv('DOCUMENT_ROOT'); + $DebugOutput[] = ''; + + $DebugOutput[] = 'get_magic_quotes_gpc() = '.$this->phpThumbDebugVarDump(@get_magic_quotes_gpc()); + $DebugOutput[] = 'get_magic_quotes_runtime() = '.$this->phpThumbDebugVarDump(@get_magic_quotes_runtime()); + $DebugOutput[] = 'error_reporting() = '.$this->phpThumbDebugVarDump(error_reporting()); + $DebugOutput[] = 'ini_get(error_reporting) = '.$this->phpThumbDebugVarDump(@ini_get('error_reporting')); + $DebugOutput[] = 'ini_get(display_errors) = '.$this->phpThumbDebugVarDump(@ini_get('display_errors')); + $DebugOutput[] = 'ini_get(allow_url_fopen) = '.$this->phpThumbDebugVarDump(@ini_get('allow_url_fopen')); + $DebugOutput[] = 'ini_get(disable_functions) = '.$this->phpThumbDebugVarDump(@ini_get('disable_functions')); + $DebugOutput[] = 'get_cfg_var(disable_functions) = '.$this->phpThumbDebugVarDump(@get_cfg_var('disable_functions')); + $DebugOutput[] = 'ini_get(safe_mode) = '.$this->phpThumbDebugVarDump(@ini_get('safe_mode')); + $DebugOutput[] = 'ini_get(open_basedir) = '.$this->phpThumbDebugVarDump(@ini_get('open_basedir')); + $DebugOutput[] = 'ini_get(max_execution_time) = '.$this->phpThumbDebugVarDump(@ini_get('max_execution_time')); + $DebugOutput[] = 'ini_get(memory_limit) = '.$this->phpThumbDebugVarDump(@ini_get('memory_limit')); + $DebugOutput[] = 'get_cfg_var(memory_limit) = '.$this->phpThumbDebugVarDump(@get_cfg_var('memory_limit')); + $DebugOutput[] = 'memory_get_usage() = '.(function_exists('memory_get_usage') ? $this->phpThumbDebugVarDump(@memory_get_usage()) : 'n/a'); + $DebugOutput[] = ''; + + $DebugOutput[] = '$this->config_prefer_imagemagick = '.$this->phpThumbDebugVarDump($this->config_prefer_imagemagick); + $DebugOutput[] = '$this->config_imagemagick_path = '.$this->phpThumbDebugVarDump($this->config_imagemagick_path); + $DebugOutput[] = '$this->ImageMagickWhichConvert() = '.$this->ImageMagickWhichConvert(); + $IMpathUsed = ($this->config_imagemagick_path ? $this->config_imagemagick_path : $this->ImageMagickWhichConvert()); + $DebugOutput[] = '[actual ImageMagick path used] = '.$this->phpThumbDebugVarDump($IMpathUsed); + $DebugOutput[] = 'file_exists([actual ImageMagick path used]) = '.$this->phpThumbDebugVarDump(@file_exists($IMpathUsed)); + $DebugOutput[] = 'ImageMagickVersion(false) = '.$this->ImageMagickVersion(false); + $DebugOutput[] = 'ImageMagickVersion(true) = '.$this->ImageMagickVersion(true); + $DebugOutput[] = ''; + + $DebugOutput[] = '$this->config_cache_directory = '.$this->phpThumbDebugVarDump($this->config_cache_directory); + $DebugOutput[] = '$this->config_cache_directory_depth = '.$this->phpThumbDebugVarDump($this->config_cache_directory_depth); + $DebugOutput[] = '$this->config_cache_disable_warning = '.$this->phpThumbDebugVarDump($this->config_cache_disable_warning); + $DebugOutput[] = '$this->config_cache_maxage = '.$this->phpThumbDebugVarDump($this->config_cache_maxage); + $DebugOutput[] = '$this->config_cache_maxsize = '.$this->phpThumbDebugVarDump($this->config_cache_maxsize); + $DebugOutput[] = '$this->config_cache_maxfiles = '.$this->phpThumbDebugVarDump($this->config_cache_maxfiles); + $DebugOutput[] = '$this->config_cache_force_passthru = '.$this->phpThumbDebugVarDump($this->config_cache_force_passthru); + $DebugOutput[] = '$this->cache_filename = '.$this->phpThumbDebugVarDump($this->cache_filename); + $DebugOutput[] = 'is_readable($this->config_cache_directory) = '.$this->phpThumbDebugVarDump(@is_readable($this->config_cache_directory)); + $DebugOutput[] = 'is_writable($this->config_cache_directory) = '.$this->phpThumbDebugVarDump(@is_writable($this->config_cache_directory)); + $DebugOutput[] = 'is_readable($this->cache_filename) = '.$this->phpThumbDebugVarDump(@is_readable($this->cache_filename)); + $DebugOutput[] = 'is_writable($this->cache_filename) = '.(@file_exists($this->cache_filename) ? $this->phpThumbDebugVarDump(@is_writable($this->cache_filename)) : 'n/a'); + $DebugOutput[] = ''; + + foreach ($ConfigVariableNames as $varname) { + $varname = 'config_'.$varname; + $value = $this->$varname; + $DebugOutput[] = '$this->'.str_pad($varname, 37, ' ', STR_PAD_RIGHT).' = '.$this->phpThumbDebugVarDump($value); + } + $DebugOutput[] = ''; + foreach ($OtherVariableNames as $varname) { + $value = $this->$varname; + $DebugOutput[] = '$this->'.str_pad($varname, 27, ' ', STR_PAD_RIGHT).' = '.$this->phpThumbDebugVarDump($value); + } + $DebugOutput[] = 'strlen($this->rawImageData) = '.strlen(@$this->rawImageData); + $DebugOutput[] = 'strlen($this->exif_thumbnail_data) = '.strlen(@$this->exif_thumbnail_data); + $DebugOutput[] = ''; + + foreach ($ParameterNames as $varname) { + $value = $this->$varname; + $DebugOutput[] = '$this->'.str_pad($varname, 4, ' ', STR_PAD_RIGHT).' = '.$this->phpThumbDebugVarDump($value); + } + $DebugOutput[] = ''; + + foreach ($FunctionsExistance as $functionname) { + $DebugOutput[] = 'builtin_function_exists('.$functionname.')'.str_repeat(' ', 23 - strlen($functionname)).' = '.$this->phpThumbDebugVarDump(phpthumb_functions::builtin_function_exists($functionname)); + } + $DebugOutput[] = ''; + + $gd_info = gd_info(); + foreach ($gd_info as $key => $value) { + $DebugOutput[] = 'gd_info.'.str_pad($key, 34, ' ', STR_PAD_RIGHT).' = '.$this->phpThumbDebugVarDump($value); + } + $DebugOutput[] = ''; + + $exif_info = phpthumb_functions::exif_info(); + foreach ($exif_info as $key => $value) { + $DebugOutput[] = 'exif_info.'.str_pad($key, 26, ' ', STR_PAD_RIGHT).' = '.$this->phpThumbDebugVarDump($value); + } + $DebugOutput[] = ''; + + if ($ApacheLookupURIarray = phpthumb_functions::ApacheLookupURIarray(dirname(@$_SERVER['PHP_SELF']))) { + foreach ($ApacheLookupURIarray as $key => $value) { + $DebugOutput[] = 'ApacheLookupURIarray.'.str_pad($key, 15, ' ', STR_PAD_RIGHT).' = '.$this->phpThumbDebugVarDump($value); + } + } else { + $DebugOutput[] = 'ApacheLookupURIarray() -- FAILED'; + } + $DebugOutput[] = ''; + + if (isset($_GET) && is_array($_GET)) { + foreach ($_GET as $key => $value) { + $DebugOutput[] = '$_GET['.$key.']'.str_repeat(' ', 30 - strlen($key)).'= '.$this->phpThumbDebugVarDump($value); + } + } + if (isset($_POST) && is_array($_POST)) { + foreach ($_POST as $key => $value) { + $DebugOutput[] = '$_POST['.$key.']'.str_repeat(' ', 29 - strlen($key)).'= '.$this->phpThumbDebugVarDump($value); + } + } + $DebugOutput[] = ''; + + $DebugOutput[] = '$this->debugmessages:'; + foreach ($this->debugmessages as $errorstring) { + $DebugOutput[] = ' * '.$errorstring; + } + $DebugOutput[] = ''; + + $DebugOutput[] = '$this->debugtiming:'; + foreach ($this->debugtiming as $timestamp => $timingstring) { + $DebugOutput[] = ' * '.$timestamp.' '.$timingstring; + } + $DebugOutput[] = ' * Total processing time: '.number_format(max(array_keys($this->debugtiming)) - min(array_keys($this->debugtiming)), 6); + + $this->f = (isset($_GET['f']) ? $_GET['f'] : $this->f); // debug modes 0-2 don't recognize text mode otherwise + return $this->ErrorImage(implode("\n", $DebugOutput), 700, 500, true); + } + + function FatalError($text) { + if (is_null($this->fatalerror)) { + $this->fatalerror = $text; + } + return true; + } + + function ErrorImage($text, $width=0, $height=0, $forcedisplay=false) { + $width = ($width ? $width : $this->config_error_image_width); + $height = ($height ? $height : $this->config_error_image_height); + + $text = 'phpThumb() v'.$this->phpthumb_version."\n".'http://phpthumb.sourceforge.net'."\n\n".($this->config_disable_debug ? 'Error messages disabled' : $text); + + $this->FatalError($text); + $this->DebugMessage($text, __FILE__, __LINE__); + $this->purgeTempFiles(); + if ($this->phpThumbDebug && !$forcedisplay) { + return false; + } + if (!$this->config_error_die_on_error && !$forcedisplay) { + return false; + } + if ($this->config_error_silent_die_on_error) { + exit; + } + if ($this->err || $this->config_error_message_image_default) { + // Show generic custom error image instead of error message + // for use on production sites where you don't want debug messages + if (($this->err == 'showerror') || $this->phpThumbDebug) { + // fall through and actually show error message even if default error image is set + } else { + header('Location: '.($this->err ? $this->err : $this->config_error_message_image_default)); + exit; + } + } + $this->setOutputFormat(); + if (!$this->thumbnailFormat || (phpthumb_functions::gd_version() < 1)) { + $this->thumbnailFormat = 'text'; + } + if (@$this->thumbnailFormat == 'text') { + // bypass all GD functions and output text error message + if (!headers_sent()) { + header('Content-type: text/plain'); + echo $text; + } else { + echo '
    '.htmlspecialchars($text).'
    '; + } + exit; + } + + $FontWidth = ImageFontWidth($this->config_error_fontsize); + $FontHeight = ImageFontHeight($this->config_error_fontsize); + + $LinesOfText = explode("\n", @wordwrap($text, floor($width / $FontWidth), "\n", true)); + $height = max($height, count($LinesOfText) * $FontHeight); + + $headers_file = ''; + $headers_line = ''; + if (phpthumb_functions::version_compare_replacement(phpversion(), '4.3.0', '>=') && headers_sent($headers_file, $headers_line)) { + + echo "\n".'**Headers already sent in file "'.$headers_file.'" on line "'.$headers_line.'", dumping error message as text:**
    '."\n\n".$text."\n".'
    '; + + } elseif (headers_sent()) { + + echo "\n".'**Headers already sent, dumping error message as text:**
    '."\n\n".$text."\n".'
    '; + + } elseif ($gdimg_error = ImageCreate($width, $height)) { + + $background_color = phpthumb_functions::ImageHexColorAllocate($gdimg_error, $this->config_error_bgcolor, true); + $text_color = phpthumb_functions::ImageHexColorAllocate($gdimg_error, $this->config_error_textcolor, true); + ImageFilledRectangle($gdimg_error, 0, 0, $width, $height, $background_color); + $lineYoffset = 0; + foreach ($LinesOfText as $line) { + ImageString($gdimg_error, $this->config_error_fontsize, 2, $lineYoffset, $line, $text_color); + $lineYoffset += $FontHeight; + } + if (function_exists('ImageTypes')) { + $imagetypes = ImageTypes(); + if ($imagetypes & IMG_PNG) { + header('Content-Type: image/png'); + ImagePNG($gdimg_error); + } elseif ($imagetypes & IMG_GIF) { + header('Content-Type: image/gif'); + ImageGIF($gdimg_error); + } elseif ($imagetypes & IMG_JPG) { + header('Content-Type: image/jpeg'); + ImageJPEG($gdimg_error); + } elseif ($imagetypes & IMG_WBMP) { + header('Content-Type: image/vnd.wap.wbmp'); + ImageWBMP($gdimg_error); + } + } + ImageDestroy($gdimg_error); + + } + if (!headers_sent()) { + echo "\n".'**Failed to send graphical error image, dumping error message as text:**
    '."\n\n".$text; + } + exit; + return true; + } + + function ImageCreateFromStringReplacement(&$RawImageData, $DieOnErrors=false) { + // there are serious bugs in the non-bundled versions of GD which may cause + // PHP to segfault when calling ImageCreateFromString() - avoid if at all possible + // when not using a bundled version of GD2 + if (!phpthumb_functions::gd_version()) { + if ($DieOnErrors) { + if (!headers_sent()) { + // base64-encoded error image in GIF format + $ERROR_NOGD = 'R0lGODlhIAAgALMAAAAAABQUFCQkJDY2NkZGRldXV2ZmZnJycoaGhpSUlKWlpbe3t8XFxdXV1eTk5P7+/iwAAAAAIAAgAAAE/vDJSau9WILtTAACUinDNijZtAHfCojS4W5H+qxD8xibIDE9h0OwWaRWDIljJSkUJYsN4bihMB8th3IToAKs1VtYM75cyV8sZ8vygtOE5yMKmGbO4jRdICQCjHdlZzwzNW4qZSQmKDaNjhUMBX4BBAlmMywFSRWEmAI6b5gAlhNxokGhooAIK5o/pi9vEw4Lfj4OLTAUpj6IabMtCwlSFw0DCKBoFqwAB04AjI54PyZ+yY3TD0ss2YcVmN/gvpcu4TOyFivWqYJlbAHPpOntvxNAACcmGHjZzAZqzSzcq5fNjxFmAFw9iFRunD1epU6tsIPmFCAJnWYE0FURk7wJDA0MTKpEzoWAAskiAAA7'; + header('Content-Type: image/gif'); + echo base64_decode($ERROR_NOGD); + } else { + echo '*** ERROR: No PHP-GD support available ***'; + } + exit; + } else { + $this->DebugMessage('ImageCreateFromStringReplacement() failed: gd_version says "'.phpthumb_functions::gd_version().'"', __FILE__, __LINE__); + return false; + } + } + if (phpthumb_functions::gd_is_bundled()) { + $this->DebugMessage('ImageCreateFromStringReplacement() calling built-in ImageCreateFromString()', __FILE__, __LINE__); + return @ImageCreateFromString($RawImageData); + } + if ($this->issafemode) { + $this->DebugMessage('ImageCreateFromStringReplacement() failed: cannot create temp file in SAFE_MODE', __FILE__, __LINE__); + return false; + } + + switch (substr($RawImageData, 0, 3)) { + case 'GIF': + $ICFSreplacementFunctionName = 'ImageCreateFromGIF'; + break; + case "\xFF\xD8\xFF": + $ICFSreplacementFunctionName = 'ImageCreateFromJPEG'; + break; + case "\x89".'PN': + $ICFSreplacementFunctionName = 'ImageCreateFromPNG'; + break; + default: + $this->DebugMessage('ImageCreateFromStringReplacement() failed: unknown fileformat signature "'.phpthumb_functions::HexCharDisplay(substr($RawImageData, 0, 3)).'"', __FILE__, __LINE__); + return false; + break; + } + if ($tempnam = $this->phpThumb_tempnam()) { + if ($fp_tempnam = @fopen($tempnam, 'wb')) { + fwrite($fp_tempnam, $RawImageData); + fclose($fp_tempnam); + if (($ICFSreplacementFunctionName == 'ImageCreateFromGIF') && !function_exists($ICFSreplacementFunctionName)) { + + // Need to create from GIF file, but ImageCreateFromGIF does not exist + ob_start(); + if (!@include_once(dirname(__FILE__).'/phpthumb.gif.php')) { + $ErrorMessage = 'Failed to include required file "'.dirname(__FILE__).'/phpthumb.gif.php" in '.__FILE__.' on line '.__LINE__; + $this->DebugMessage($ErrorMessage, __FILE__, __LINE__); + } + ob_end_clean(); + // gif_loadFileToGDimageResource() cannot read from raw data, write to file first + if ($tempfilename = $this->phpThumb_tempnam()) { + if ($fp_tempfile = @fopen($tempfilename, 'wb')) { + fwrite($fp_tempfile, $RawImageData); + fclose($fp_tempfile); + $gdimg_source = gif_loadFileToGDimageResource($tempfilename); + $this->DebugMessage('gif_loadFileToGDimageResource('.$tempfilename.') completed', __FILE__, __LINE__); + $this->DebugMessage('deleting "'.$tempfilename.'"', __FILE__, __LINE__); + unlink($tempfilename); + return $gdimg_source; + break; + } else { + $ErrorMessage = 'Failed to open tempfile in '.__FILE__.' on line '.__LINE__; + $this->DebugMessage($ErrorMessage, __FILE__, __LINE__); + } + } else { + $ErrorMessage = 'Failed to open generate tempfile name in '.__FILE__.' on line '.__LINE__; + $this->DebugMessage($ErrorMessage, __FILE__, __LINE__); + } + + } elseif (function_exists($ICFSreplacementFunctionName) && ($gdimg_source = @$ICFSreplacementFunctionName($tempnam))) { + + // great + $this->DebugMessage($ICFSreplacementFunctionName.'('.$tempnam.') succeeded', __FILE__, __LINE__); + $this->DebugMessage('deleting "'.$tempnam.'"', __FILE__, __LINE__); + unlink($tempnam); + return $gdimg_source; + + } else { + + // GD functions not available, or failed to create image + $this->DebugMessage($ICFSreplacementFunctionName.'('.$tempnam.') '.(function_exists($ICFSreplacementFunctionName) ? 'failed' : 'does not exist'), __FILE__, __LINE__); + if (isset($_GET['phpThumbDebug'])) { + $this->phpThumbDebug(); + } + + } + } else { + $ErrorMessage = 'Failed to fopen('.$tempnam.', "wb") in '.__FILE__.' on line '.__LINE__."\n".'You may need to set $PHPTHUMB_CONFIG[temp_directory] in phpThumb.config.php'; + if ($this->issafemode) { + $ErrorMessage = 'ImageCreateFromStringReplacement() failed in '.__FILE__.' on line '.__LINE__.': cannot create temp file in SAFE_MODE'; + } + $this->DebugMessage($ErrorMessage, __FILE__, __LINE__); + } + $this->DebugMessage('deleting "'.$tempnam.'"', __FILE__, __LINE__); + @unlink($tempnam); + } else { + $ErrorMessage = 'Failed to generate phpThumb_tempnam() in '.__FILE__.' on line '.__LINE__."\n".'You may need to set $PHPTHUMB_CONFIG[temp_directory] in phpThumb.config.php'; + if ($this->issafemode) { + $ErrorMessage = 'ImageCreateFromStringReplacement() failed in '.__FILE__.' on line '.__LINE__.': cannot create temp file in SAFE_MODE'; + } + } + if ($DieOnErrors && $ErrorMessage) { + return $this->ErrorImage($ErrorMessage); + } + return false; + } + + function ImageResizeFunction(&$dst_im, &$src_im, $dstX, $dstY, $srcX, $srcY, $dstW, $dstH, $srcW, $srcH) { + $this->DebugMessage('ImageResizeFunction($o, $s, '.$dstX.', '.$dstY.', '.$srcX.', '.$srcY.', '.$dstW.', '.$dstH.', '.$srcW.', '.$srcH.')', __FILE__, __LINE__); + if (($dstW == $srcW) && ($dstH == $srcH)) { + return ImageCopy($dst_im, $src_im, $dstX, $dstY, $srcX, $srcY, $srcW, $srcH); + } + if (phpthumb_functions::gd_version() >= 2.0) { + if ($this->config_disable_imagecopyresampled) { + return phpthumb_functions::ImageCopyResampleBicubic($dst_im, $src_im, $dstX, $dstY, $srcX, $srcY, $dstW, $dstH, $srcW, $srcH); + } + return ImageCopyResampled($dst_im, $src_im, $dstX, $dstY, $srcX, $srcY, $dstW, $dstH, $srcW, $srcH); + } + return ImageCopyResized($dst_im, $src_im, $dstX, $dstY, $srcX, $srcY, $dstW, $dstH, $srcW, $srcH); + } + + function InitializeTempDirSetting() { + $this->config_temp_directory = realpath($this->config_temp_directory ? $this->config_temp_directory : (getenv('TMPDIR') ? getenv('TMPDIR') : getenv('TMP'))); + return true; + } + + function phpThumb_tempnam() { + $this->InitializeTempDirSetting(); + $tempnam = realpath(tempnam($this->config_temp_directory, 'pThumb')); + $this->tempFilesToDelete[$tempnam] = $tempnam; + $this->DebugMessage('phpThumb_tempnam() returning "'.$tempnam.'"', __FILE__, __LINE__); + return $tempnam; + } + + function DebugMessage($message, $file='', $line='') { + $this->debugmessages[] = $message.($file ? ' in file "'.(basename($file) ? basename($file) : $file).'"' : '').($line ? ' on line '.$line : ''); + return true; + } + + function DebugTimingMessage($message, $file='', $line='', $timestamp=0) { + if (!$timestamp) { + $timestamp = array_sum(explode(' ', microtime())); + } + $this->debugtiming[number_format($timestamp, 6, '.', '')] = ': '.$message.($file ? ' in file "'.(basename($file) ? basename($file) : $file).'"' : '').($line ? ' on line '.$line : ''); + return true; + } } -?> +?> \ No newline at end of file From a58d5cd6091d3d42e92d2b1cdab2b6424d0d69b9 Mon Sep 17 00:00:00 2001 From: Dmi3yy Date: Mon, 26 Aug 2013 18:10:54 +0300 Subject: [PATCH 357/530] update phpthumb config --- assets/snippets/phpthumb/phpThumb.config.php | 32 +++++++++---------- .../phpthumb/phpThumb.config.php.default | 18 +++++------ 2 files changed, 24 insertions(+), 26 deletions(-) diff --git a/assets/snippets/phpthumb/phpThumb.config.php b/assets/snippets/phpthumb/phpThumb.config.php index 9b03b2ac22..11191b885a 100644 --- a/assets/snippets/phpthumb/phpThumb.config.php +++ b/assets/snippets/phpthumb/phpThumb.config.php @@ -12,8 +12,8 @@ ob_start(); if (!file_exists(dirname(__FILE__).'/phpthumb.functions.php') || !include_once(dirname(__FILE__).'/phpthumb.functions.php')) { - ob_end_flush(); - die('failed to include_once(phpthumb.functions.php) - realpath="'.realpath(dirname(__FILE__).'/phpthumb.functions.php').'"'); + ob_end_flush(); + die('failed to include_once(phpthumb.functions.php) - realpath="'.realpath(dirname(__FILE__).'/phpthumb.functions.php').'"'); } ob_end_clean(); @@ -27,7 +27,7 @@ //$PHPTHUMB_CONFIG['document_root'] = 'c:\\webroot\\example.com\\www'; //$PHPTHUMB_CONFIG['document_root'] = $_SERVER['DOCUMENT_ROOT']; $PHPTHUMB_CONFIG['document_root'] = realpath((@$_SERVER['DOCUMENT_ROOT'] && file_exists(@$_SERVER['DOCUMENT_ROOT'].$_SERVER['PHP_SELF'])) ? $_SERVER['DOCUMENT_ROOT'] : str_replace(dirname(@$_SERVER['PHP_SELF']), '', str_replace(DIRECTORY_SEPARATOR, '/', realpath('.')))); -//$PHPTHUMB_CONFIG['document_root'] = realpath((getenv('DOCUMENT_ROOT') && ereg('^'.preg_quote(realpath(getenv('DOCUMENT_ROOT'))), realpath(__FILE__))) ? getenv('DOCUMENT_ROOT') : str_replace(dirname(@$_SERVER['PHP_SELF']), '', str_replace(DIRECTORY_SEPARATOR, '/', dirname(__FILE__)))); +//$PHPTHUMB_CONFIG['document_root'] = realpath((getenv('DOCUMENT_ROOT') && preg_match('#^'.preg_quote(realpath(getenv('DOCUMENT_ROOT'))).'#', realpath(__FILE__))) ? getenv('DOCUMENT_ROOT') : str_replace(dirname(@$_SERVER['PHP_SELF']), '', str_replace(DIRECTORY_SEPARATOR, '/', dirname(__FILE__)))); // * Cache directory configuration (choose only one of these - leave the other lines commented-out): // Note: this directory must be writable (usually chmod 777 is neccesary) for caching to work. @@ -108,15 +108,15 @@ // As a general guideline, this number will be about 20% of your PHP memory // configuration, so 8M = 1,677,722; 16M = 3,355,443; 32M = 6,710,886; etc. if (phpthumb_functions::version_compare_replacement(phpversion(), '4.3.2', '>=') && !defined('memory_get_usage') && !@ini_get('memory_limit')) { - // memory_get_usage() will only be defined if your PHP is compiled with the --enable-memory-limit configuration option. - $PHPTHUMB_CONFIG['max_source_pixels'] = 0; // no memory limit + // memory_get_usage() will only be defined if your PHP is compiled with the --enable-memory-limit configuration option. + $PHPTHUMB_CONFIG['max_source_pixels'] = 0; // no memory limit } else { - // calculate default max_source_pixels as 1/6 of memory limit configuration - $PHPTHUMB_CONFIG['max_source_pixels'] = round(max(intval(ini_get('memory_limit')), intval(get_cfg_var('memory_limit'))) * 1048576 / 6); - //$PHPTHUMB_CONFIG['max_source_pixels'] = 0; // no memory limit - //$PHPTHUMB_CONFIG['max_source_pixels'] = 1920000; // allow 1600x1200 images (2Mpx), no larger (about 12MB memory required) - //$PHPTHUMB_CONFIG['max_source_pixels'] = 2795000; // 16MB memory limit - //$PHPTHUMB_CONFIG['max_source_pixels'] = 3871488; // allow 2272x1704 images (4Mpx), no larger (about 24MB memory required) + // calculate default max_source_pixels as 1/6 of memory limit configuration + $PHPTHUMB_CONFIG['max_source_pixels'] = round(max(intval(ini_get('memory_limit')), intval(get_cfg_var('memory_limit'))) * 1048576 / 6); + //$PHPTHUMB_CONFIG['max_source_pixels'] = 0; // no memory limit + //$PHPTHUMB_CONFIG['max_source_pixels'] = 1920000; // allow 1600x1200 images (2Mpx), no larger (about 12MB memory required) + //$PHPTHUMB_CONFIG['max_source_pixels'] = 2795000; // 16MB memory limit + //$PHPTHUMB_CONFIG['max_source_pixels'] = 3871488; // allow 2272x1704 images (4Mpx), no larger (about 24MB memory required) } @@ -124,12 +124,12 @@ $PHPTHUMB_CONFIG['prefer_imagemagick'] = false; // If true, use ImageMagick to resize thumbnails if possible, since it is usually faster than GD functions; if false only use ImageMagick if PHP memory limit is too low. $PHPTHUMB_CONFIG['imagemagick_use_thumbnail'] = false; // If true, use ImageMagick's "-thumbnail" resizing parameter (if available) which removes extra non-image metadata (profiles, EXIF info, etc) resulting in much smaller filesize; if false, use "-resize" paramter which retains this info if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') { - // Windows: set absolute pathname - $PHPTHUMB_CONFIG['imagemagick_path'] = ''; + // Windows: set absolute pathname + $PHPTHUMB_CONFIG['imagemagick_path'] = ''; } else { - // *nix: set absolute pathname to "convert", or leave as null if "convert" is in the path (location detected with `which`) - //$PHPTHUMB_CONFIG['imagemagick_path'] = '/usr/local/bin/convert'; - $PHPTHUMB_CONFIG['imagemagick_path'] = null; + // *nix: set absolute pathname to "convert", or leave as null if "convert" is in the path (location detected with `which`) + //$PHPTHUMB_CONFIG['imagemagick_path'] = '/usr/local/bin/convert'; + $PHPTHUMB_CONFIG['imagemagick_path'] = null; } diff --git a/assets/snippets/phpthumb/phpThumb.config.php.default b/assets/snippets/phpthumb/phpThumb.config.php.default index e6cf99ef7b..d710cdde94 100644 --- a/assets/snippets/phpthumb/phpThumb.config.php.default +++ b/assets/snippets/phpthumb/phpThumb.config.php.default @@ -27,7 +27,7 @@ ob_end_clean(); //$PHPTHUMB_CONFIG['document_root'] = 'c:\\webroot\\example.com\\www'; //$PHPTHUMB_CONFIG['document_root'] = $_SERVER['DOCUMENT_ROOT']; //$PHPTHUMB_CONFIG['document_root'] = realpath((@$_SERVER['DOCUMENT_ROOT'] && file_exists(@$_SERVER['DOCUMENT_ROOT'].$_SERVER['PHP_SELF'])) ? $_SERVER['DOCUMENT_ROOT'] : str_replace(dirname(@$_SERVER['PHP_SELF']), '', str_replace(DIRECTORY_SEPARATOR, '/', realpath('.')))); -$PHPTHUMB_CONFIG['document_root'] = realpath((getenv('DOCUMENT_ROOT') && ereg('^'.preg_quote(realpath(getenv('DOCUMENT_ROOT'))), realpath(__FILE__))) ? getenv('DOCUMENT_ROOT') : str_replace(dirname(@$_SERVER['PHP_SELF']), '', str_replace(DIRECTORY_SEPARATOR, '/', dirname(__FILE__)))); +$PHPTHUMB_CONFIG['document_root'] = realpath((getenv('DOCUMENT_ROOT') && preg_match('#^'.preg_quote(realpath(getenv('DOCUMENT_ROOT'))).'#', realpath(__FILE__))) ? getenv('DOCUMENT_ROOT') : str_replace(dirname(@$_SERVER['PHP_SELF']), '', str_replace(DIRECTORY_SEPARATOR, '/', dirname(__FILE__)))); // * Cache directory configuration (choose only one of these - leave the other lines commented-out): // Note: this directory must be writable (usually chmod 777 is neccesary) for caching to work. @@ -42,7 +42,7 @@ $PHPTHUMB_CONFIG['cache_directory'] = dirname(__FILE__).'/cache/'; // $PHPTHUMB_CONFIG['cache_directory'] = '/tmp/persistent/phpthumb/cache/'; //} -$PHPTHUMB_CONFIG['cache_disable_warning'] = true; // If [cache_directory] is non-existant or not writable, and [cache_disable_warning] is false, an error image will be generated warning to either set the cache directory or disable the warning (to avoid people not knowing about the cache) +$PHPTHUMB_CONFIG['cache_disable_warning'] = false; // If [cache_directory] is non-existant or not writable, and [cache_disable_warning] is false, an error image will be generated warning to either set the cache directory or disable the warning (to avoid people not knowing about the cache) $PHPTHUMB_CONFIG['cache_directory_depth'] = 4; // If this larger than zero, cache structure will be broken into a broad directory structure based on cache filename. For example "cache_src012345..." will be stored in "/0/01/012/0123/cache_src012345..." when (cache_directory_depth = 4) @@ -78,7 +78,7 @@ $PHPTHUMB_CONFIG['cache_default_only_suffix'] = ''; // cached in norma //$PHPTHUMB_CONFIG['cache_default_only_suffix'] = '*_thumb'; // cache 'pic.jpg' becomes 'pic_thumb.jpg' (or 'pic_thumb.png' if PNG output is selected, etc) //$PHPTHUMB_CONFIG['cache_default_only_suffix'] = 'small-*'; // cache 'pic.jpg' becomes 'small-pic.jpg' (or 'small-pic.png' if PNG output is selected, etc) -$PHPTHUMB_CONFIG['cache_prefix'] = 'phpThumb_cache_'.str_replace('www.', '', @$_SERVER['SERVER_NAME']); +$PHPTHUMB_CONFIG['cache_prefix'] = 'phpThumb_cache_'.(isset($_SERVER['SERVER_NAME']) ? str_replace('www.', '', $_SERVER['SERVER_NAME']).'_' : ''); // keep cache file separate by domain //$PHPTHUMB_CONFIG['cache_prefix'] = 'phpThumb_cache'; // allow phpThumb to share 1 set of cached files even if accessed under different servername/domains on same server $PHPTHUMB_CONFIG['cache_force_passthru'] = true; // if true, cached image data will always be passed to browser; if false, HTTP redirect will be used instead @@ -135,7 +135,7 @@ if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') { // * Default output configuration: -$PHPTHUMB_CONFIG['output_format'] = 'jpeg'; // default output format ('jpeg', 'png' or 'gif') - thumbnail will be output in this format (if available in your version of GD). This is always overridden by ?f=___ GETstring parameter +$PHPTHUMB_CONFIG['output_format'] = 'jpeg'; // default output format ('jpeg', 'png' or 'gif') - thumbnail will be output in this format (if available in your version of GD or ImageMagick). This is only used if the "f" parameter is not specified, and if the thumbnail can't be output in the input format. $PHPTHUMB_CONFIG['output_maxwidth'] = 0; // default maximum thumbnail width. If this is zero then default width is the width of the source image. This is always overridden by ?w=___ GETstring parameter $PHPTHUMB_CONFIG['output_maxheight'] = 0; // default maximum thumbnail height. If this is zero then default height is the height of the source image. This is always overridden by ?h=___ GETstring parameter $PHPTHUMB_CONFIG['output_interlace'] = true; // if true: interlaced output for GIF/PNG, progressive output for JPEG; if false: non-interlaced for GIF/PNG, baseline for JPEG. @@ -181,7 +181,7 @@ $PHPTHUMB_CONFIG['ttf_directory'] = dirname(__FILE__).'/fonts'; // Base director // Note: the data retrieved must be the actual binary data of the image, not a URL or filename $PHPTHUMB_CONFIG['mysql_query'] = ''; -//$PHPTHUMB_CONFIG['mysql_query'] = 'SELECT `picture` FROM `products` WHERE (`id` = \''.mysql_real_escape_string(@$_GET['id']).'\')'; +//$PHPTHUMB_CONFIG['mysql_query'] = 'SELECT `picture` FROM `products` WHERE (`id` = \''.mysql_escape_string(@$_GET['id']).'\')'; // These 4 values must be modified if $PHPTHUMB_CONFIG['mysql_query'] is not empty, but may be ignored if $PHPTHUMB_CONFIG['mysql_query'] is blank. $PHPTHUMB_CONFIG['mysql_hostname'] = 'localhost'; @@ -191,13 +191,11 @@ $PHPTHUMB_CONFIG['mysql_database'] = ''; // * Security configuration -$PHPTHUMB_CONFIG['high_security_enabled'] = false; // if enabled, requires 'high_security_password' set to at least 5 characters, and requires the use of phpThumbURL() function (at the bottom of phpThumb.config.php) to generate hashed URLs -$PHPTHUMB_CONFIG['high_security_password'] = ''; // required if 'high_security_enabled' is true, must be at least 5 characters long -$PHPTHUMB_CONFIG['disable_debug'] = false; // prevent phpThumb from displaying any information about your system. If true, phpThumbDebug and error messages will be disabled +$PHPTHUMB_CONFIG['high_security_enabled'] = false; // if enabled, requires 'high_security_password' set to be set and requires the use of phpThumbURL() function (at the bottom of phpThumb.config.php) to generate hashed URLs +$PHPTHUMB_CONFIG['high_security_password'] = ''; // required if 'high_security_enabled' is true, and must be at complex (uppercase, lowercase, numbers, punctuation, etc -- punctuation is strongest, lowercase is weakest; see PasswordStrength() in phpThumb.php). You can use a password generator like http://silisoftware.com/tools/password-random.php to generate a strong password +$PHPTHUMB_CONFIG['disable_debug'] = true; // prevent phpThumb from displaying any information about your system. If true, phpThumbDebug and error messages will be disabled $PHPTHUMB_CONFIG['allow_src_above_docroot'] = false; // if true, allow src to be anywhere in filesystem; if false (default) only allow src within document_root $PHPTHUMB_CONFIG['allow_src_above_phpthumb'] = true; // if true (default), allow src to be anywhere in filesystem; if false only allow src within sub-directory of phpThumb installation -$PHPTHUMB_CONFIG['allow_parameter_file'] = false; // if true, allow use of 'file' parameter; if false (default) the 'file' parameter is disabled/ignored -$PHPTHUMB_CONFIG['allow_parameter_goto'] = false; // if true, allow use of 'goto' parameter; if false (default) the 'goto' parameter is disabled/ignored // * HTTP UserAgent configuration From 7f526881052f56ede0330dbb28afff2987be5f69 Mon Sep 17 00:00:00 2001 From: Dmi3yy Date: Mon, 26 Aug 2013 18:11:26 +0300 Subject: [PATCH 358/530] update phpthumb filters function --- assets/snippets/phpthumb/phpthumb.filters.php | 285 ++++++++++++++---- .../snippets/phpthumb/phpthumb.functions.php | 46 +-- 2 files changed, 251 insertions(+), 80 deletions(-) diff --git a/assets/snippets/phpthumb/phpthumb.filters.php b/assets/snippets/phpthumb/phpthumb.filters.php index 11b67c81da..c30a98cc7a 100644 --- a/assets/snippets/phpthumb/phpthumb.filters.php +++ b/assets/snippets/phpthumb/phpthumb.filters.php @@ -73,20 +73,20 @@ function Bevel(&$gdimg, $width, $hexcolor1, $hexcolor2) { ImageAlphaBlending($gdimg, true); for ($i = 0; $i < $width; $i++) { $alpha = round(($i / $width) * 127); - $color1[$i] = phpthumb_functions::ImageHexColorAllocate($gdimg, $hexcolor1, false, $alpha); - $color2[$i] = phpthumb_functions::ImageHexColorAllocate($gdimg, $hexcolor2, false, $alpha); + $color1 = phpthumb_functions::ImageHexColorAllocate($gdimg, $hexcolor1, false, $alpha); + $color2 = phpthumb_functions::ImageHexColorAllocate($gdimg, $hexcolor2, false, $alpha); - ImageLine($gdimg, $i, $i, $i, ImageSY($gdimg) - $i, $color1[$i]); // left - ImageLine($gdimg, $i, $i, ImageSX($gdimg) - $i, $i, $color1[$i]); // top - ImageLine($gdimg, ImageSX($gdimg) - $i, ImageSY($gdimg) - $i, ImageSX($gdimg) - $i, $i, $color2[$i]); // right - ImageLine($gdimg, ImageSX($gdimg) - $i, ImageSY($gdimg) - $i, $i, ImageSY($gdimg) - $i, $color2[$i]); // bottom + ImageLine($gdimg, $i, $i + 1, $i, ImageSY($gdimg) - $i - 1, $color1); // left + ImageLine($gdimg, $i, $i , ImageSX($gdimg) - $i, $i , $color1); // top + ImageLine($gdimg, ImageSX($gdimg) - $i, ImageSY($gdimg) - $i - 1, ImageSX($gdimg) - $i, $i + 1, $color2); // right + ImageLine($gdimg, ImageSX($gdimg) - $i, ImageSY($gdimg) - $i , $i, ImageSY($gdimg) - $i , $color2); // bottom } return true; } function Blur(&$gdimg, $radius=0.5) { - // Taken from Torstein Hnsi's phpUnsharpMask (see phpthumb.unsharp.php) + // Taken from Torstein H￸nsi's phpUnsharpMask (see phpthumb.unsharp.php) $radius = round(max(0, min($radius, 50)) * 2); if (!$radius) { @@ -185,6 +185,8 @@ function Contrast(&$gdimg, $amount=0) { $amount = max(-255, min(255, $amount)); if (phpthumb_functions::version_compare_replacement(phpversion(), '5.0.0', '>=') && phpthumb_functions::gd_is_bundled()) { + // ImageFilter(IMG_FILTER_CONTRAST) has range +100 to -100 (positive numbers make it darker!) + $amount = ($amount / 255) * -100; if (ImageFilter($gdimg, IMG_FILTER_CONTRAST, $amount)) { return true; } @@ -212,6 +214,7 @@ function Contrast(&$gdimg, $amount=0) { function Colorize(&$gdimg, $amount, $targetColor) { $amount = (is_numeric($amount) ? $amount : 25); + $amountPct = $amount / 100; $targetColor = (phpthumb_functions::IsHexColor($targetColor) ? $targetColor : 'gray'); if ($amount == 0) { @@ -222,9 +225,9 @@ function Colorize(&$gdimg, $amount, $targetColor) { if ($targetColor == 'gray') { $targetColor = '808080'; } - $r = substr($targetColor, 0, 2); - $g = substr($targetColor, 2, 2); - $b = substr($targetColor, 4, 2); + $r = round($amountPct * hexdec(substr($targetColor, 0, 2))); + $g = round($amountPct * hexdec(substr($targetColor, 2, 2))); + $b = round($amountPct * hexdec(substr($targetColor, 4, 2))); if (ImageFilter($gdimg, IMG_FILTER_COLORIZE, $r, $g, $b)) { return true; } @@ -246,7 +249,7 @@ function Colorize(&$gdimg, $amount, $targetColor) { $TargetPixel = phpthumb_functions::GrayscalePixel($OriginalPixel); } foreach ($TargetPixel as $key => $value) { - $NewPixel[$key] = round(max(0, min(255, ($OriginalPixel[$key] * ((100 - $amount) / 100)) + ($TargetPixel[$key] * ($amount / 100))))); + $NewPixel[$key] = round(max(0, min(255, ($OriginalPixel[$key] * ((100 - $amount) / 100)) + ($TargetPixel[$key] * $amountPct)))); } //$newColor = phpthumb_functions::ImageColorAllocateAlphaSafe($gdimg, $NewPixel['red'], $NewPixel['green'], $NewPixel['blue'], $OriginalPixel['alpha']); $newColor = ImageColorAllocate($gdimg, $NewPixel['red'], $NewPixel['green'], $NewPixel['blue']); @@ -293,15 +296,24 @@ function Desaturate(&$gdimg, $amount, $color='') { } - function DropShadow(&$gdimg, $distance, $width, $hexcolor, $angle, $fade) { + function DropShadow(&$gdimg, $distance, $width, $hexcolor, $angle, $alpha) { if (phpthumb_functions::gd_version() < 2) { return false; } $distance = ($distance ? $distance : 10); $width = ($width ? $width : 10); $hexcolor = ($hexcolor ? $hexcolor : '000000'); - $angle = ($angle ? $angle : 225); - $fade = ($fade ? $fade : 1); + $angle = ($angle ? $angle : 225) % 360; + $alpha = max(0, min(100, ($alpha ? $alpha : 100))); + + if ($alpha <= 0) { + // invisible shadow, nothing to do + return true; + } + if ($distance <= 0) { + // shadow completely obscured by source image, nothing to do + return true; + } $width_shadow = cos(deg2rad($angle)) * ($distance + $width); $height_shadow = sin(deg2rad($angle)) * ($distance + $width); @@ -309,7 +321,7 @@ function DropShadow(&$gdimg, $distance, $width, $hexcolor, $angle, $fade) { $scaling = min(ImageSX($gdimg) / (ImageSX($gdimg) + abs($width_shadow)), ImageSY($gdimg) / (ImageSY($gdimg) + abs($height_shadow))); for ($i = 0; $i < $width; $i++) { - $WidthAlpha[$i] = (abs(($width / 2) - $i) / $width) * $fade; + $WidthAlpha[$i] = (abs(($width / 2) - $i) / $width); $Offset['x'] = cos(deg2rad($angle)) * ($distance + $i); $Offset['y'] = sin(deg2rad($angle)) * ($distance + $i); } @@ -626,7 +638,7 @@ function HistogramOverlay(&$gdimg, $bands='*', $colors='', $width=0.25, $height= $DefaultColors = array('r'=>'FF0000', 'g'=>'00FF00', 'b'=>'0000FF', 'a'=>'999999', '*'=>'FFFFFF'); $Colors = explode(';', $colors); - $BandsToGraph = array_unique(preg_split('//', $bands)); + $BandsToGraph = array_unique(preg_split('##', $bands)); $keys = array('r'=>'red', 'g'=>'green', 'b'=>'blue', 'a'=>'alpha', '*'=>'gray'); foreach ($BandsToGraph as $key => $band) { if (!isset($keys[$band])) { @@ -909,12 +921,33 @@ function Saturation(&$gdimg, $amount, $color='') { function Sepia(&$gdimg, $amount, $targetColor) { $amount = (is_numeric($amount) ? max(0, min(100, $amount)) : 50); + $amountPct = $amount / 100; $targetColor = (phpthumb_functions::IsHexColor($targetColor) ? $targetColor : 'A28065'); if ($amount == 0) { return true; } + if (phpthumb_functions::version_compare_replacement(phpversion(), '5.0.0', '>=') && phpthumb_functions::gd_is_bundled()) { + if (ImageFilter($gdimg, IMG_FILTER_GRAYSCALE)) { + + $r = round($amountPct * hexdec(substr($targetColor, 0, 2))); + $g = round($amountPct * hexdec(substr($targetColor, 2, 2))); + $b = round($amountPct * hexdec(substr($targetColor, 4, 2))); + if (ImageFilter($gdimg, IMG_FILTER_COLORIZE, $r, $g, $b)) { + return true; + } + $this->DebugMessage('FAILED: ImageFilter($gdimg, IMG_FILTER_COLORIZE)', __FILE__, __LINE__); + // fall through and try it the hard way + + } else { + + $this->DebugMessage('FAILED: ImageFilter($gdimg, IMG_FILTER_GRAYSCALE)', __FILE__, __LINE__); + // fall through and try it the hard way + + } + } + $TargetPixel['red'] = hexdec(substr($targetColor, 0, 2)); $TargetPixel['green'] = hexdec(substr($targetColor, 2, 2)); $TargetPixel['blue'] = hexdec(substr($targetColor, 4, 2)); @@ -929,7 +962,7 @@ function Sepia(&$gdimg, $amount, $targetColor) { // http://www.gimpguru.org/Tutorials/SepiaToning/ // "In the traditional sepia toning process, the tinting occurs most in // the mid-tones: the lighter and darker areas appear to be closer to B&W." - $SepiaAmount = ((128 - abs($GrayPixel['red'] - 128)) / 128) * ($amount / 100); + $SepiaAmount = ((128 - abs($GrayPixel['red'] - 128)) / 128) * $amountPct; foreach ($TargetPixel as $key => $value) { $NewPixel[$key] = round(max(0, min(255, $GrayPixel[$key] * (1 - $SepiaAmount) + ($TargetPixel[$key] * $SepiaAmount)))); @@ -960,10 +993,36 @@ function Smooth(&$gdimg, $amount=6) { } + function SourceTransparentColorMask(&$gdimg, $hexcolor, $min_limit=5, $max_limit=10) { + $width = ImageSX($gdimg); + $height = ImageSY($gdimg); + if ($gdimg_mask = ImageCreateTrueColor($width, $height)) { + $R = hexdec(substr($hexcolor, 0, 2)); + $G = hexdec(substr($hexcolor, 2, 2)); + $B = hexdec(substr($hexcolor, 4, 2)); + $targetPixel = array('red'=>$R, 'green'=>$G, 'blue'=>$B); + $cutoffRange = $max_limit - $min_limit; + for ($x = 0; $x < $width; $x++) { + for ($y = 0; $y < $height; $y++) { + $currentPixel = phpthumb_functions::GetPixelColor($gdimg, $x, $y); + $colorDiff = phpthumb_functions::PixelColorDifferencePercent($currentPixel, $targetPixel); + $grayLevel = min($cutoffRange, MAX(0, -$min_limit + $colorDiff)) * (255 / MAX(1, $cutoffRange)); + $newColor = ImageColorAllocate($gdimg_mask, $grayLevel, $grayLevel, $grayLevel); + ImageSetPixel($gdimg_mask, $x, $y, $newColor); + } + } + return $gdimg_mask; + } + return false; + } + + function Threshold(&$gdimg, $cutoff) { + $width = ImageSX($gdimg); + $height = ImageSY($gdimg); $cutoff = min(255, max(0, ($cutoff ? $cutoff : 128))); - for ($x = 0; $x < ImageSX($gdimg); $x++) { - for ($y = 0; $y < ImageSY($gdimg); $y++) { + for ($x = 0; $x < $width; $x++) { + for ($y = 0; $y < $height; $y++) { $currentPixel = phpthumb_functions::GetPixelColor($gdimg, $x, $y); $grayPixel = phpthumb_functions::GrayscalePixel($currentPixel); if ($grayPixel['red'] < $cutoff) { @@ -1045,6 +1104,16 @@ function WatermarkText(&$gdimg, $text, $size, $alignment, $hex_color='000000', $ } ImageAlphaBlending($gdimg, true); + if (preg_match('#^([0-9\\.\\-]*)x([0-9\\.\\-]*)(@[LCR])?$#i', $alignment, $matches)) { + $originOffsetX = intval($matches[1]); + $originOffsetY = intval($matches[2]); + $alignment = (@$matches[4] ? $matches[4] : 'L'); + $margin = 0; + } else { + $originOffsetX = 0; + $originOffsetY = 0; + } + $metaTextArray = array( '^Fb' => $this->phpThumbObject->getimagesizeinfo['filesize'], '^Fk' => round($this->phpThumbObject->getimagesizeinfo['filesize'] / 1024), @@ -1060,10 +1129,12 @@ function WatermarkText(&$gdimg, $text, $size, $alignment, $hex_color='000000', $ $text = str_replace("\r\n", "\n", $text); $text = str_replace("\r", "\n", $text); $textlines = explode("\n", $text); + $this->DebugMessage('Processing '.count($textlines).' lines of text', __FILE__, __LINE__); if (@is_readable($ttffont) && is_file($ttffont)) { $opacity = 100 - intval(max(min($opacity, 100), 0)); + $letter_color_text = phpthumb_functions::ImageHexColorAllocate($gdimg, $hex_color, false, $opacity * 1.27); $this->DebugMessage('Using TTF font "'.$ttffont.'"', __FILE__, __LINE__); @@ -1084,68 +1155,73 @@ function WatermarkText(&$gdimg, $text, $size, $alignment, $hex_color='000000', $ $char_max_y = max($TTFboxChar[1], $TTFboxChar[3], $TTFboxChar[5], $TTFboxChar[7]); $char_height = round($char_max_y - $char_min_y); + if ($alignment == '*') { + + $text_origin_y = $char_height + $margin; + while (($text_origin_y - $text_height) < ImageSY($gdimg)) { + $text_origin_x = $margin; + while ($text_origin_x < ImageSX($gdimg)) { + ImageTTFtext($gdimg, $size, $angle, $text_origin_x, $text_origin_y, $letter_color_text, $ttffont, $text); + $text_origin_x += ($text_width + $margin); + } + $text_origin_y += ($text_height + $margin); + } + + } else { + + // this block for background color only + switch ($alignment) { + case '*': + // handled separately + break; + case 'T': - $text_origin_x = round((ImageSX($gdimg) - $text_width) / 2); - $text_origin_y = $char_height + $margin; + $text_origin_x = ($originOffsetX ? $originOffsetX - round($text_width / 2) : round((ImageSX($gdimg) - $text_width) / 2)); + $text_origin_y = $char_height + $margin + $originOffsetY; break; case 'B': - $text_origin_x = round((ImageSX($gdimg) - $text_width) / 2); - $text_origin_y = ImageSY($gdimg) + $TTFbox[1] - $margin; + $text_origin_x = ($originOffsetX ? $originOffsetX - round($text_width / 2) : round((ImageSX($gdimg) - $text_width) / 2)); + $text_origin_y = ImageSY($gdimg) + $TTFbox[1] - $margin + $originOffsetY; break; case 'L': - $text_origin_x = $margin; - $text_origin_y = round((ImageSY($gdimg) - $text_height) / 2) + $char_height; + $text_origin_x = $margin + $originOffsetX; + $text_origin_y = ($originOffsetY ? $originOffsetY : round((ImageSY($gdimg) - $text_height) / 2) + $char_height); break; case 'R': - $text_origin_x = ImageSX($gdimg) - $text_width + $TTFbox[0] - $min_x + round($size * 0.25) - $margin; - $text_origin_y = round((ImageSY($gdimg) - $text_height) / 2) + $char_height; + $text_origin_x = ($originOffsetX ? $originOffsetX - $text_width : ImageSX($gdimg) - $text_width + $TTFbox[0] - $min_x + round($size * 0.25) - $margin); + $text_origin_y = ($originOffsetY ? $originOffsetY : round((ImageSY($gdimg) - $text_height) / 2) + $char_height); break; case 'C': - $text_origin_x = round((ImageSX($gdimg) - $text_width) / 2); - $text_origin_y = round((ImageSY($gdimg) - $text_height) / 2) + $char_height; + $text_origin_x = ($originOffsetX ? $originOffsetX - round($text_width / 2) : round((ImageSX($gdimg) - $text_width) / 2)); + $text_origin_y = ($originOffsetY ? $originOffsetY : round((ImageSY($gdimg) - $text_height) / 2) + $char_height); break; case 'TL': - $text_origin_x = $margin; - $text_origin_y = $char_height + $margin; + $text_origin_x = $margin + $originOffsetX; + $text_origin_y = $char_height + $margin + $originOffsetY; break; case 'TR': - $text_origin_x = ImageSX($gdimg) - $text_width + $TTFbox[0] - $min_x + round($size * 0.25) - $margin; - $text_origin_y = $char_height + $margin; + $text_origin_x = ($originOffsetX ? $originOffsetX - $text_width : ImageSX($gdimg) - $text_width + $TTFbox[0] - $min_x + round($size * 0.25) - $margin); + $text_origin_y = $char_height + $margin + $originOffsetY; break; case 'BL': - $text_origin_x = $margin; - $text_origin_y = ImageSY($gdimg) + $TTFbox[1] - $margin; + $text_origin_x = $margin + $originOffsetX; + $text_origin_y = ImageSY($gdimg) + $TTFbox[1] - $margin + $originOffsetY; break; case 'BR': default: - $text_origin_x = ImageSX($gdimg) - $text_width + $TTFbox[0] - $min_x + round($size * 0.25) - $margin; - $text_origin_y = ImageSY($gdimg) + $TTFbox[1] - $margin; + $text_origin_x = ($originOffsetX ? $originOffsetX - $text_width : ImageSX($gdimg) - $text_width + $TTFbox[0] - $min_x + round($size * 0.25) - $margin); + $text_origin_y = ImageSY($gdimg) + $TTFbox[1] - $margin + $originOffsetY; break; } - $letter_color_text = phpthumb_functions::ImageHexColorAllocate($gdimg, $hex_color, false, $opacity * 1.27); - - if ($alignment == '*') { - - $text_origin_y = $char_height + $margin; - while (($text_origin_y - $text_height) < ImageSY($gdimg)) { - $text_origin_x = $margin; - while ($text_origin_x < ImageSX($gdimg)) { - ImageTTFtext($gdimg, $size, $angle, $text_origin_x, $text_origin_y, $letter_color_text, $ttffont, $text); - $text_origin_x += ($text_width + $margin); - } - $text_origin_y += ($text_height + $margin); - } - - } else { //ImageRectangle($gdimg, $text_origin_x + $min_x, $text_origin_y + $TTFbox[1], $text_origin_x + $min_x + $text_width, $text_origin_y + $TTFbox[1] - $text_height, $letter_color_text); if (phpthumb_functions::IsHexColor($bg_color)) { @@ -1158,17 +1234,63 @@ function WatermarkText(&$gdimg, $text, $size, $alignment, $hex_color='000000', $ $y1 = $text_origin_y + $TTFbox[1]; $x2 = $text_origin_x + $min_x + $text_width; $y2 = $text_origin_y + $TTFbox[1] - $text_height; - $x_TL = eregi('x', $fillextend) ? 0 : min($x1, $x2); - $y_TL = eregi('y', $fillextend) ? 0 : min($y1, $y2); - $x_BR = eregi('x', $fillextend) ? ImageSX($gdimg) : max($x1, $x2); - $y_BR = eregi('y', $fillextend) ? ImageSY($gdimg) : max($y1, $y2); + $x_TL = preg_match('#x#i', $fillextend) ? 0 : min($x1, $x2); + $y_TL = preg_match('#y#i', $fillextend) ? 0 : min($y1, $y2); + $x_BR = preg_match('#x#i', $fillextend) ? ImageSX($gdimg) : max($x1, $x2); + $y_BR = preg_match('#y#i', $fillextend) ? ImageSY($gdimg) : max($y1, $y2); //while ($y_BR > ImageSY($gdimg)) { // $y_TL--; // $y_BR--; // $text_origin_y--; //} + $this->DebugMessage('WatermarkText() calling ImageFilledRectangle($gdimg, '.$x_TL.', '.$y_TL.', '.$x_BR.', '.$y_BR.', $text_color_background)', __FILE__, __LINE__); ImageFilledRectangle($gdimg, $x_TL, $y_TL, $x_BR, $y_BR, $text_color_background); - ImageTTFtext($gdimg, $size, $angle, $text_origin_x, $text_origin_y, $letter_color_text, $ttffont, $text); + + // end block for background color only + + + $y_offset = 0; + foreach ($textlines as $dummy => $line) { + + $TTFboxLine = ImageTTFbBox($size, $angle, $ttffont, $line); + $min_x_line = min($TTFboxLine[0], $TTFboxLine[2], $TTFboxLine[4], $TTFboxLine[6]); + $max_x_line = max($TTFboxLine[0], $TTFboxLine[2], $TTFboxLine[4], $TTFboxLine[6]); + //$text_width = round($max_x - $min_x + ($size * 0.5)); + $text_width_line = round($max_x_line - $min_x_line); + + $min_y_line = min($TTFboxLine[1], $TTFboxLine[3], $TTFboxLine[5], $TTFboxLine[7]); + $max_y_line = max($TTFboxLine[1], $TTFboxLine[3], $TTFboxLine[5], $TTFboxLine[7]); + //$text_height = round($max_y - $min_y + ($size * 0.5)); + $text_height_line = round($max_y_line - $min_y_line); + + switch ($alignment) { + // $text_origin_y set above, just re-set $text_origin_x here as needed + + case 'L': + case 'TL': + case 'BL': + // no change neccesary + break; + + case 'C': + case 'T': + case 'B': + $text_origin_x = ($originOffsetX ? $originOffsetX - round($text_width_line / 2) : round((ImageSX($gdimg) - $text_width_line) / 2)); + break; + + case 'R': + case 'TR': + case 'BR': + $text_origin_x = ($originOffsetX ? $originOffsetX - $text_width_line : ImageSX($gdimg) - $text_width_line + $TTFbox[0] - $min_x + round($size * 0.25) - $margin); + break; + } + + //ImageTTFtext($gdimg, $size, $angle, $text_origin_x, $text_origin_y, $letter_color_text, $ttffont, $text); + $this->DebugMessage('WatermarkText() calling ImageTTFtext($gdimg, '.$size.', '.$angle.', '.$text_origin_x.', '.($text_origin_y + $y_offset).', $letter_color_text, '.$ttffont.', '.$line.')', __FILE__, __LINE__); + ImageTTFtext($gdimg, $size, $angle, $text_origin_x, $text_origin_y + $y_offset, $letter_color_text, $ttffont, $line); + + $y_offset += $char_height; + } } return true; @@ -1192,6 +1314,7 @@ function WatermarkText(&$gdimg, $text, $size, $alignment, $hex_color='000000', $ } else { $text_color_background = phpthumb_functions::ImageHexColorAllocate($img_watermark, 'FFFFFF', false, 127); } + $this->DebugMessage('WatermarkText() calling ImageFilledRectangle($img_watermark, 0, 0, '.ImageSX($img_watermark).', '.ImageSY($img_watermark).', $text_color_background)', __FILE__, __LINE__); ImageFilledRectangle($img_watermark, 0, 0, ImageSX($img_watermark), ImageSY($img_watermark), $text_color_background); if ($angle && function_exists('ImageRotate')) { @@ -1208,26 +1331,64 @@ function WatermarkText(&$gdimg, $text, $size, $alignment, $hex_color='000000', $ foreach ($textlines as $key => $line) { switch ($alignment) { case 'C': + $x_offset = round(($text_width - (ImageFontWidth($size) * strlen($line))) / 2); + $originOffsetX = (ImageSX($gdimg) - ImageSX($img_watermark)) / 2; + $originOffsetY = (ImageSY($gdimg) - ImageSY($img_watermark)) / 2; + break; + case 'T': + $x_offset = round(($text_width - (ImageFontWidth($size) * strlen($line))) / 2); + $originOffsetX = (ImageSX($gdimg) - ImageSX($img_watermark)) / 2; + $originOffsetY = $margin; + break; + case 'B': $x_offset = round(($text_width - (ImageFontWidth($size) * strlen($line))) / 2); + $originOffsetX = (ImageSX($gdimg) - ImageSX($img_watermark)) / 2; + $originOffsetY = ImageSY($gdimg) - ImageSY($img_watermark) - $margin; break; case 'L': + $x_offset = 0; + $originOffsetX = $margin; + $originOffsetY = (ImageSY($gdimg) - ImageSY($img_watermark)) / 2; + break; + case 'TL': + $x_offset = 0; + $originOffsetX = $margin; + $originOffsetY = $margin; + break; + case 'BL': $x_offset = 0; + $originOffsetX = $margin; + $originOffsetY = ImageSY($gdimg) - ImageSY($img_watermark) - $margin; break; case 'R': + $x_offset = $text_width - (ImageFontWidth($size) * strlen($line)); + $originOffsetX = ImageSX($gdimg) - ImageSX($img_watermark) - $margin; + $originOffsetY = (ImageSY($gdimg) - ImageSY($img_watermark)) / 2; + break; + case 'TR': + $x_offset = $text_width - (ImageFontWidth($size) * strlen($line)); + $originOffsetX = ImageSX($gdimg) - ImageSX($img_watermark) - $margin; + $originOffsetY = $margin; + break; + case 'BR': default: $x_offset = $text_width - (ImageFontWidth($size) * strlen($line)); + $originOffsetX = ImageSX($gdimg) - ImageSX($img_watermark) - $margin; + $originOffsetY = ImageSY($gdimg) - ImageSY($img_watermark) - $margin; break; } + $this->DebugMessage('WatermarkText() calling ImageString($img_watermark, '.$size.', '.$x_offset.', '.($key * ImageFontHeight($size)).', '.$line.', $text_color_watermark)', __FILE__, __LINE__); ImageString($img_watermark, $size, $x_offset, $key * ImageFontHeight($size), $line, $text_color_watermark); if ($angle && $img_watermark_mask) { + $this->DebugMessage('WatermarkText() calling ImageString($img_watermark_mask, '.$size.', '.$x_offset.', '.($key * ImageFontHeight($size)).', '.$text.', $mask_color_watermark)', __FILE__, __LINE__); ImageString($img_watermark_mask, $size, $x_offset, $key * ImageFontHeight($size), $text, $mask_color_watermark); } } @@ -1236,7 +1397,9 @@ function WatermarkText(&$gdimg, $text, $size, $alignment, $hex_color='000000', $ $img_watermark_mask = ImageRotate($img_watermark_mask, $angle, $mask_color_background); phpthumb_filters::ApplyMask($img_watermark_mask, $img_watermark); } - phpthumb_filters::WatermarkOverlay($gdimg, $img_watermark, $alignment, $opacity, $margin); + //phpthumb_filters::WatermarkOverlay($gdimg, $img_watermark, $alignment, $opacity, $margin); + $this->DebugMessage('WatermarkText() calling phpthumb_filters::WatermarkOverlay($gdimg, $img_watermark, '.($originOffsetX.'x'.$originOffsetY).', '.$opacity.', 0)', __FILE__, __LINE__); + phpthumb_filters::WatermarkOverlay($gdimg, $img_watermark, $originOffsetX.'x'.$originOffsetY, $opacity, 0); ImageDestroy($img_watermark); return true; } @@ -1247,6 +1410,7 @@ function WatermarkText(&$gdimg, $text, $size, $alignment, $hex_color='000000', $ function WatermarkOverlay(&$gdimg_dest, &$img_watermark, $alignment='*', $opacity=50, $margin_x=5, $margin_y=null) { + if (is_resource($gdimg_dest) && is_resource($img_watermark)) { $watermark_source_x = 0; $watermark_source_y = 0; @@ -1258,6 +1422,10 @@ function WatermarkOverlay(&$gdimg_dest, &$img_watermark, $alignment='*', $opacit $margin_y = (is_null($margin_y) ? $margin_x : $margin_y); $watermark_margin_x = ((($margin_x > 0) && ($margin_x < 1)) ? round((1 - $margin_x) * $img_source_width) : $margin_x); $watermark_margin_y = ((($margin_y > 0) && ($margin_y < 1)) ? round((1 - $margin_y) * $img_source_height) : $margin_y); + if (preg_match('#^([0-9\\.\\-]*)x([0-9\\.\\-]*)$#i', $alignment, $matches)) { + $watermark_destination_x = intval($matches[1]); + $watermark_destination_y = intval($matches[2]); + } else { switch ($alignment) { case '*': if ($gdimg_tiledwatermark = phpthumb_functions::ImageCreateFunction($img_source_width, $img_source_height)) { @@ -1355,6 +1523,7 @@ function WatermarkOverlay(&$gdimg_dest, &$img_watermark, $alignment='*', $opacit $watermark_destination_y = $img_source_height - $watermark_source_height - $watermark_margin_y; break; } + } ImageAlphaBlending($gdimg_dest, false); ImageSaveAlpha($gdimg_dest, true); ImageSaveAlpha($img_watermark, true); diff --git a/assets/snippets/phpthumb/phpthumb.functions.php b/assets/snippets/phpthumb/phpthumb.functions.php index 87b7b36df6..d9218959a9 100644 --- a/assets/snippets/phpthumb/phpthumb.functions.php +++ b/assets/snippets/phpthumb/phpthumb.functions.php @@ -39,7 +39,8 @@ public static function version_compare_replacement_sub($version1, $version2, $op // The possible operators are: <, lt, <=, le, >, gt, >=, ge, ==, =, eq, !=, <>, ne respectively. // Using this argument, the function will return 1 if the relationship is the one specified by the operator, 0 otherwise. - // If a part contains special version strings these are handled in the following order: dev < (alpha = a) < (beta = b) < RC < pl + // If a part contains special version strings these are handled in the following order: + // (any string not found in this list) < (dev) < (alpha = a) < (beta = b) < (RC = rc) < (#) < (pl = p) static $versiontype_lookup = array(); if (empty($versiontype_lookup)) { $versiontype_lookup['dev'] = 10001; @@ -48,14 +49,13 @@ public static function version_compare_replacement_sub($version1, $version2, $op $versiontype_lookup['b'] = 10003; $versiontype_lookup['beta'] = 10003; $versiontype_lookup['RC'] = 10004; - $versiontype_lookup['pl'] = 10005; - } - if (isset($versiontype_lookup[$version1])) { - $version1 = $versiontype_lookup[$version1]; - } - if (isset($versiontype_lookup[$version2])) { - $version2 = $versiontype_lookup[$version2]; + $versiontype_lookup['rc'] = 10004; + $versiontype_lookup['#'] = 10005; + $versiontype_lookup['pl'] = 10006; + $versiontype_lookup['p'] = 10006; } + $version1 = (isset($versiontype_lookup[$version1]) ? $versiontype_lookup[$version1] : $version1); + $version2 = (isset($versiontype_lookup[$version2]) ? $versiontype_lookup[$version2] : $version2); switch ($operator) { case '<': @@ -106,8 +106,8 @@ public static function version_compare_replacement($version1, $version2, $operat // and also inserts dots . before and after any non number so that for example '4.3.2RC1' becomes '4.3.2.RC.1'. // Then it splits the results like if you were using explode('.',$ver). Then it compares the parts starting from left to right. - $version1 = preg_replace('/([0-9]+)([A-Z]+)([0-9]+)/i', '\\1.\\2.\\3', $version1); - $version2 = preg_replace('/([0-9]+)([A-Z]+)([0-9]+)/i', '\\1.\\2.\\3', $version2); + $version1 = preg_replace('#([0-9]+)([A-Z]+)([0-9]+)#i', "$1.$2.$3", $version1); + $version2 = preg_replace('#([0-9]+)([A-Z]+)([0-9]+)#i', "$1.$2.$3", $version2); $parts1 = explode('.', $version1); $parts2 = explode('.', $version1); @@ -416,7 +416,7 @@ public static function ProportionalResize($old_width, $old_height, $new_width=fa // limited by height $new_width = $new_height * $old_aspect_ratio; } - return array(round($new_width), round($new_height)); + return array(intval(round($new_width)), intval(round($new_height))); } @@ -484,6 +484,7 @@ public static function SafeExec($command) { public static function ApacheLookupURIarray($filename) { // apache_lookup_uri() only works when PHP is installed as an Apache module. if (php_sapi_name() == 'apache') { + //$property_exists_exists = function_exists('property_exists'); $keys = array('status', 'the_request', 'status_line', 'method', 'content_type', 'handler', 'uri', 'filename', 'path_info', 'args', 'boundary', 'no_cache', 'no_local_copy', 'allowed', 'send_bodyct', 'bytes_sent', 'byterange', 'clength', 'unparsed_uri', 'mtime', 'request_time'); if ($apacheLookupURIobject = @apache_lookup_uri($filename)) { $apacheLookupURIarray = array(); @@ -511,7 +512,7 @@ public static function gd_version($fullstring=false) { static $cache_gd_version = array(); if (empty($cache_gd_version)) { $gd_info = gd_info(); - if (preg_match('/bundled \((.+)\)$/i', $gd_info['GD Version'], $matches)) { + if (preg_match('#bundled \((.+)\)$#i', $gd_info['GD Version'], $matches)) { $cache_gd_version[1] = $gd_info['GD Version']; // e.g. "bundled (2.0.15 compatible)" $cache_gd_version[0] = (float) $matches[1]; // e.g. "2.0" (not "bundled (2.0.15 compatible)") } else { @@ -533,7 +534,7 @@ public static function filesize_remote($remotefile, $timeout=10) { } while (!feof($fp)) { $headerline = fgets($fp, 4096); - if (preg_match('/^Content\-Length\: (.*)/i', $headerline, $matches)) { + if (preg_match('#^Content-Length: (.*)#i', $headerline, $matches)) { $size = intval($matches[1]); break; } @@ -554,7 +555,7 @@ public static function filedate_remote($remotefile, $timeout=10) { } while (!feof($fp)) { $headerline = fgets($fp, 4096); - if (preg_match('/^Last\-Modified\: (.*)/i', $headerline, $matches)) { + if (preg_match('#^Last-Modified: (.*)#i', $headerline, $matches)) { $date = strtotime($matches[1]) - date('Z'); break; } @@ -632,7 +633,7 @@ public static function URLreadFsock($host, $file, &$errstr, $successonly=true, $ $errstr = 'fsockopen() unavailable'; return false; } - if ($fp = @fsockopen($host, 80, $errno, $errstr, $timeout)) { + if ($fp = @fsockopen($host, $port, $errno, $errstr, $timeout)) { $out = 'GET '.$file.' HTTP/1.0'."\r\n"; $out .= 'Host: '.$host."\r\n"; $out .= 'Connection: Close'."\r\n\r\n"; @@ -649,10 +650,10 @@ public static function URLreadFsock($host, $file, &$errstr, $successonly=true, $ } else { $Data_body .= $line; } - if (preg_match('/^HTTP\/[\\.0-9]+ ([0-9]+) (.+)$/i', rtrim($line), $matches)) { + if (preg_match('#^HTTP/[\\.0-9]+ ([0-9]+) (.+)$#i', rtrim($line), $matches)) { list($dummy, $errno, $errstr) = $matches; $errno = intval($errno); - } elseif (preg_match('/^Location\: (.*)$/i', rtrim($line), $matches)) { + } elseif (preg_match('#^Location: (.*)$#i', rtrim($line), $matches)) { $header_newlocation = $matches[1]; } if ($isHeader && ($line == "\r\n")) { @@ -679,7 +680,7 @@ public static function URLreadFsock($host, $file, &$errstr, $successonly=true, $ } public static function CleanUpURLencoding($url, $queryseperator='&') { - if (!preg_match('/^http/i', $url)) { + if (!preg_match('#^http#i', $url)) { return $url; } $parse_url = phpthumb_functions::ParseURLbetter($url); @@ -695,7 +696,7 @@ public static function CleanUpURLencoding($url, $queryseperator='&') { } } - $queries = explode($queryseperator, @$parse_url['query']); + $queries = explode($queryseperator, (isset($parse_url['query']) ? $parse_url['query'] : '')); $CleanQueries = array(); foreach ($queries as $key => $query) { @list($param, $value) = explode('=', $query); @@ -710,6 +711,7 @@ public static function CleanUpURLencoding($url, $queryseperator='&') { $cleaned_url = $parse_url['scheme'].'://'; $cleaned_url .= (@$parse_url['username'] ? $parse_url['host'].(@$parse_url['password'] ? ':'.$parse_url['password'] : '').'@' : ''); $cleaned_url .= $parse_url['host']; + $cleaned_url .= ((!empty($parse_url['port']) && ($parse_url['port'] != 80)) ? ':'.$parse_url['port'] : ''); $cleaned_url .= '/'.implode('/', $CleanPathElements); $cleaned_url .= (@$CleanQueries ? '?'.implode($queryseperator, $CleanQueries) : ''); return $cleaned_url; @@ -742,7 +744,7 @@ public static function SafeURLread($url, &$error, $timeout=10, $followredirects= while (true) { $tryagain = false; $rawData = phpthumb_functions::URLreadFsock(@$parsed_url['host'], @$parsed_url['path'].'?'.@$parsed_url['query'], $errstr, true, (@$parsed_url['port'] ? @$parsed_url['port'] : 80), $timeout); - if (preg_match('/302 [a-z ]+; Location\\: (http.*)/i', $errstr, $matches)) { + if (preg_match('#302 [a-z ]+; Location\\: (http.*)#i', $errstr, $matches)) { $matches[1] = trim(@$matches[1]); if (!@$alreadyLookedAtURLs[$matches[1]]) { // loop through and examine new URL @@ -819,7 +821,7 @@ public static function SafeURLread($url, &$error, $timeout=10, $followredirects= public static function EnsureDirectoryExists($dirname) { $directory_elements = explode(DIRECTORY_SEPARATOR, $dirname); $startoffset = (!$directory_elements[0] ? 2 : 1); // unix with leading "/" then start with 2nd element; Windows with leading "c:\" then start with 1st element - $open_basedirs = preg_split('/[;:]/', ini_get('open_basedir')); + $open_basedirs = preg_split('#[;:]#', ini_get('open_basedir')); foreach ($open_basedirs as $key => $open_basedir) { if (preg_match('#^'.preg_quote($open_basedir).'#', $dirname) && (strlen($dirname) > strlen($open_basedir))) { $startoffset = count(explode(DIRECTORY_SEPARATOR, $open_basedir)); @@ -994,7 +996,7 @@ function preg_quote($string, $delimiter='\\') { if (!function_exists('file_get_contents')) { // included in PHP v4.3.0+ function file_get_contents($filename) { - if (preg_match('/^(f|ht)tp\:\/\//i', $filename)) { + if (preg_match('#^(f|ht)tp\://#i', $filename)) { return SafeURLread($filename, $error); } if ($fp = @fopen($filename, 'rb')) { From 3354b53a301d55186a7c6ab4d9b243bd8c4276ec Mon Sep 17 00:00:00 2001 From: Dmi3yy Date: Mon, 26 Aug 2013 18:12:14 +0300 Subject: [PATCH 359/530] update phpthumb done --- assets/snippets/phpthumb/phpThumb.php | 327 ++++++++++-------- assets/snippets/phpthumb/phpthumb.bmp.php | 6 +- assets/snippets/phpthumb/phpthumb.class.php | 2 +- assets/snippets/phpthumb/phpthumb.gif.php | 7 +- assets/snippets/phpthumb/phpthumb.unsharp.php | 143 ++++---- 5 files changed, 256 insertions(+), 229 deletions(-) diff --git a/assets/snippets/phpthumb/phpThumb.php b/assets/snippets/phpthumb/phpThumb.php index 18f8113ecd..b1712a2fc0 100644 --- a/assets/snippets/phpthumb/phpThumb.php +++ b/assets/snippets/phpthumb/phpThumb.php @@ -11,11 +11,8 @@ error_reporting(E_ALL); ini_set('display_errors', '1'); -if (!@ini_get('safe_mode')) { - set_time_limit(60); // shouldn't take nearly this long in most cases, but with many filter and/or a slow server... -} ini_set('magic_quotes_runtime', '0'); -if (@ini_get('magic_quotes_runtime')) { +if (ini_get('magic_quotes_runtime')) { die('"magic_quotes_runtime" is set in php.ini, cannot run phpThumb with this enabled'); } $starttime = array_sum(explode(' ', microtime())); @@ -26,6 +23,88 @@ $_GET = $HTTP_GET_VARS; } +function SendSaveAsFileHeaderIfNeeded() { + if (headers_sent()) { + return false; + } + global $phpThumb; + $downloadfilename = phpthumb_functions::SanitizeFilename(@$_GET['sia'] ? $_GET['sia'] : (@$_GET['down'] ? $_GET['down'] : 'phpThumb_generated_thumbnail'.(@$_GET['f'] ? $_GET['f'] : 'jpg'))); + if (@$downloadfilename) { + $phpThumb->DebugMessage('SendSaveAsFileHeaderIfNeeded() sending header: Content-Disposition: '.(@$_GET['down'] ? 'attachment' : 'inline').'; filename="'.$downloadfilename.'"', __FILE__, __LINE__); + header('Content-Disposition: '.(@$_GET['down'] ? 'attachment' : 'inline').'; filename="'.$downloadfilename.'"'); + } + return true; +} + +function PasswordStrength($password) { + $strength = 0; + $strength += strlen(preg_replace('#[^a-z]#', '', $password)) * 0.5; // lowercase characters are weak + $strength += strlen(preg_replace('#[^A-Z]#', '', $password)) * 0.8; // uppercase characters are somewhat better + $strength += strlen(preg_replace('#[^0-9]#', '', $password)) * 1.0; // numbers are somewhat better + $strength += strlen(preg_replace('#[a-zA-Z0-9]#', '', $password)) * 2.0; // other non-alphanumeric characters are best + return $strength; +} + +function RedirectToCachedFile() { + global $phpThumb, $PHPTHUMB_CONFIG; + + $nice_cachefile = str_replace(DIRECTORY_SEPARATOR, '/', $phpThumb->cache_filename); + $nice_docroot = str_replace(DIRECTORY_SEPARATOR, '/', rtrim($PHPTHUMB_CONFIG['document_root'], '/\\')); + + $parsed_url = phpthumb_functions::ParseURLbetter(@$_SERVER['HTTP_REFERER']); + + $nModified = filemtime($phpThumb->cache_filename); + + if ($phpThumb->config_nooffsitelink_enabled && @$_SERVER['HTTP_REFERER'] && !in_array(@$parsed_url['host'], $phpThumb->config_nooffsitelink_valid_domains)) { + + $phpThumb->DebugMessage('Would have used cached (image/'.$phpThumb->thumbnailFormat.') file "'.$phpThumb->cache_filename.'" (Last-Modified: '.gmdate('D, d M Y H:i:s', $nModified).' GMT), but skipping because $_SERVER[HTTP_REFERER] ('.@$_SERVER['HTTP_REFERER'].') is not in $phpThumb->config_nooffsitelink_valid_domains ('.implode(';', $phpThumb->config_nooffsitelink_valid_domains).')', __FILE__, __LINE__); + + } elseif ($phpThumb->phpThumbDebug) { + + $phpThumb->DebugTimingMessage('skipped using cached image', __FILE__, __LINE__); + $phpThumb->DebugMessage('Would have used cached file, but skipping due to phpThumbDebug', __FILE__, __LINE__); + $phpThumb->DebugMessage('* Would have sent headers (1): Last-Modified: '.gmdate('D, d M Y H:i:s', $nModified).' GMT', __FILE__, __LINE__); + if ($getimagesize = @GetImageSize($phpThumb->cache_filename)) { + $phpThumb->DebugMessage('* Would have sent headers (2): Content-Type: '.phpthumb_functions::ImageTypeToMIMEtype($getimagesize[2]), __FILE__, __LINE__); + } + if (preg_match('#^'.preg_quote($nice_docroot).'(.*)$#', $nice_cachefile, $matches)) { + $phpThumb->DebugMessage('* Would have sent headers (3): Location: '.dirname($matches[1]).'/'.urlencode(basename($matches[1])), __FILE__, __LINE__); + } else { + $phpThumb->DebugMessage('* Would have sent data: readfile('.$phpThumb->cache_filename.')', __FILE__, __LINE__); + } + + } else { + + if (headers_sent()) { + $phpThumb->ErrorImage('Headers already sent ('.basename(__FILE__).' line '.__LINE__.')'); + exit; + } + SendSaveAsFileHeaderIfNeeded(); + + header('Last-Modified: '.gmdate('D, d M Y H:i:s', $nModified).' GMT'); + if (@$_SERVER['HTTP_IF_MODIFIED_SINCE'] && ($nModified == strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE'])) && @$_SERVER['SERVER_PROTOCOL']) { + header($_SERVER['SERVER_PROTOCOL'].' 304 Not Modified'); + exit; + } + + if ($getimagesize = @GetImageSize($phpThumb->cache_filename)) { + header('Content-Type: '.phpthumb_functions::ImageTypeToMIMEtype($getimagesize[2])); + } elseif (preg_match('#\\.ico$#i', $phpThumb->cache_filename)) { + header('Content-Type: image/x-icon'); + } + if (!@$PHPTHUMB_CONFIG['cache_force_passthru'] && preg_match('#^'.preg_quote($nice_docroot).'(.*)$#', $nice_cachefile, $matches)) { + header('Location: '.dirname($matches[1]).'/'.urlencode(basename($matches[1]))); + } else { + @readfile($phpThumb->cache_filename); + } + exit; + + } + return true; +} + + + // instantiate a new phpThumb() object ob_start(); if (!include_once(dirname(__FILE__).'/phpthumb.class.php')) { @@ -33,10 +112,15 @@ die('failed to include_once("'.realpath(dirname(__FILE__).'/phpthumb.class.php').'")'); } ob_end_clean(); + $phpThumb = new phpThumb(); $phpThumb->DebugTimingMessage('phpThumb.php start', __FILE__, __LINE__, $starttime); $phpThumb->SetParameter('config_error_die_on_error', true); +if (!phpthumb_functions::FunctionIsDisabled('set_time_limit')) { + set_time_limit(60); // shouldn't take nearly this long in most cases, but with many filters and/or a slow server... +} + // phpThumbDebug[0] used to be here, but may reveal too much // info when high_security_mode should be enabled (not set yet) @@ -46,28 +130,32 @@ // great } else { ob_end_flush(); + $phpThumb->config_disable_debug = false; // otherwise error message won't print $phpThumb->ErrorImage('failed to include_once('.dirname(__FILE__).'/phpThumb.config.php) - realpath="'.realpath(dirname(__FILE__).'/phpThumb.config.php').'"'); } ob_end_clean(); } elseif (file_exists(dirname(__FILE__).'/phpThumb.config.php.default')) { + $phpThumb->config_disable_debug = false; // otherwise error message won't print $phpThumb->ErrorImage('Please rename "phpThumb.config.php.default" to "phpThumb.config.php"'); } else { + $phpThumb->config_disable_debug = false; // otherwise error message won't print $phpThumb->ErrorImage('failed to include_once('.dirname(__FILE__).'/phpThumb.config.php) - realpath="'.realpath(dirname(__FILE__).'/phpThumb.config.php').'"'); } -if (!@$PHPTHUMB_CONFIG['disable_pathinfo_parsing'] && (empty($_GET) || isset($_GET['phpThumbDebug'])) && !empty($_SERVER['PATH_INFO'])) { +if (empty($PHPTHUMB_CONFIG['disable_pathinfo_parsing']) && (empty($_GET) || isset($_GET['phpThumbDebug'])) && !empty($_SERVER['PATH_INFO'])) { $_SERVER['PHP_SELF'] = str_replace($_SERVER['PATH_INFO'], '', @$_SERVER['PHP_SELF']); $args = explode(';', substr($_SERVER['PATH_INFO'], 1)); $phpThumb->DebugMessage('PATH_INFO.$args set to ('.implode(')(', $args).')', __FILE__, __LINE__); if (!empty($args)) { $_GET['src'] = @$args[count($args) - 1]; - if (eregi('^new\=([a-z0-9]+)', $_GET['src'], $matches)) { + $phpThumb->DebugMessage('PATH_INFO."src" = "'.$_GET['src'].'"', __FILE__, __LINE__); + if (preg_match('#^new\=([a-z0-9]+)#i', $_GET['src'], $matches)) { unset($_GET['src']); $_GET['new'] = $matches[1]; } } - if (eregi('^([0-9]*)x?([0-9]*)$', @$args[count($args) - 2], $matches)) { + if (preg_match('#^([0-9]*)x?([0-9]*)$#i', @$args[count($args) - 2], $matches)) { $_GET['w'] = $matches[1]; $_GET['h'] = $matches[2]; $phpThumb->DebugMessage('PATH_INFO."w"x"h" set to "'.$_GET['w'].'"x"'.$_GET['h'].'"', __FILE__, __LINE__); @@ -85,16 +173,16 @@ } } -if (@$PHPTHUMB_CONFIG['high_security_enabled']) { - - $ptquery = str_replace('&hash='.$_GET['hash'], '', $_SERVER['QUERY_STRING']); - $hash = md5($ptquery.$PHPTHUMB_CONFIG['high_security_password']); - - if (!@$_GET['hash']) { +if (!empty($PHPTHUMB_CONFIG['high_security_enabled'])) { + if (empty($_GET['hash'])) { + $phpThumb->config_disable_debug = false; // otherwise error message won't print $phpThumb->ErrorImage('ERROR: missing hash'); - } elseif (strlen($PHPTHUMB_CONFIG['high_security_password']) < 5) { - $phpThumb->ErrorImage('ERROR: strlen($PHPTHUMB_CONFIG[high_security_password]) < 5'); - } elseif($_GET['hash'] != $hash) { + } elseif (PasswordStrength($PHPTHUMB_CONFIG['high_security_password']) < 20) { + $phpThumb->config_disable_debug = false; // otherwise error message won't print + $phpThumb->ErrorImage('ERROR: $PHPTHUMB_CONFIG[high_security_password] is not complex enough'); + } elseif ($_GET['hash'] != md5(str_replace('&hash='.$_GET['hash'], '', $_SERVER['QUERY_STRING']).$PHPTHUMB_CONFIG['high_security_password'])) { + sleep(10); // deliberate delay to discourage password-guessing + $phpThumb->config_disable_debug = false; // otherwise error message won't print $phpThumb->ErrorImage('ERROR: invalid hash'); } } @@ -102,27 +190,33 @@ //////////////////////////////////////////////////////////////// // Debug output, to try and help me diagnose problems $phpThumb->DebugTimingMessage('phpThumbDebug[0]', __FILE__, __LINE__); -if (@$_GET['phpThumbDebug'] == '0') { +if (isset($_GET['phpThumbDebug']) && ($_GET['phpThumbDebug'] == '0')) { $phpThumb->phpThumbDebug(); } //////////////////////////////////////////////////////////////// // returned the fixed string if the evil "magic_quotes_gpc" setting is on if (get_magic_quotes_gpc()) { - $RequestVarsToStripSlashes = array('src', 'wmf', 'file', 'err', 'goto', 'down'); + // deprecated: 'err', 'file', 'goto', + $RequestVarsToStripSlashes = array('src', 'wmf', 'down'); foreach ($RequestVarsToStripSlashes as $key) { if (isset($_GET[$key])) { + if (is_string($_GET[$key])) { $_GET[$key] = stripslashes($_GET[$key]); + } else { + unset($_GET[$key]); + } } } } -if (!@$_SERVER['PATH_INFO'] && !@$_SERVER['QUERY_STRING']) { - $phpThumb->ErrorImage('phpThumb() v'.$phpThumb->phpthumb_version.'
    http://phpthumb.sourceforge.net

    ERROR: no parameters specified'); +if (empty($_SERVER['PATH_INFO']) && empty($_SERVER['QUERY_STRING'])) { + $phpThumb->config_disable_debug = false; // otherwise error message won't print + $phpThumb->ErrorImage('ERROR: no parameters specified'); } if (@$_GET['src'] && isset($_GET['md5s']) && empty($_GET['md5s'])) { - if (eregi('^(f|ht)tps?://', $_GET['src'])) { + if (preg_match('#^(f|ht)tps?://#i', $_GET['src'])) { if ($rawImageData = phpthumb_functions::SafeURLread($_GET['src'], $error, $phpThumb->config_http_fopen_timeout, $phpThumb->config_http_follow_redirect)) { $md5s = md5($rawImageData); } @@ -145,7 +239,7 @@ foreach ($PHPTHUMB_CONFIG as $key => $value) { $keyname = 'config_'.$key; $phpThumb->setParameter($keyname, $value); - if (!eregi('password', $key)) { + if (!preg_match('#(password|mysql)#i', $key)) { $phpThumb->DebugMessage('setParameter('.$keyname.', '.$phpThumb->phpThumbDebugVarDump($value).')', __FILE__, __LINE__); } } @@ -153,24 +247,24 @@ $phpThumb->DebugMessage('$PHPTHUMB_CONFIG is empty', __FILE__, __LINE__); } -if (@$_GET['src'] && !@$PHPTHUMB_CONFIG['allow_local_http_src'] && eregi('^http://'.@$_SERVER['HTTP_HOST'].'(.+)', @$_GET['src'], $matches)) { +if (@$_GET['src'] && !@$PHPTHUMB_CONFIG['allow_local_http_src'] && preg_match('#^http://'.@$_SERVER['HTTP_HOST'].'(.+)#i', @$_GET['src'], $matches)) { $phpThumb->ErrorImage('It is MUCH better to specify the "src" parameter as "'.$matches[1].'" instead of "'.$matches[0].'".'."\n\n".'If you really must do it this way, enable "allow_local_http_src" in phpThumb.config.php'); } //////////////////////////////////////////////////////////////// // Debug output, to try and help me diagnose problems $phpThumb->DebugTimingMessage('phpThumbDebug[1]', __FILE__, __LINE__); -if (@$_GET['phpThumbDebug'] == '1') { +if (isset($_GET['phpThumbDebug']) && ($_GET['phpThumbDebug'] == '1')) { $phpThumb->phpThumbDebug(); } //////////////////////////////////////////////////////////////// -$parsed_url_referer = parse_url(@$_SERVER['HTTP_REFERER']); +$parsed_url_referer = phpthumb_functions::ParseURLbetter(@$_SERVER['HTTP_REFERER']); if ($phpThumb->config_nooffsitelink_require_refer && !in_array(@$parsed_url_referer['host'], $phpThumb->config_nohotlink_valid_domains)) { $phpThumb->ErrorImage('config_nooffsitelink_require_refer enabled and '.(@$parsed_url_referer['host'] ? '"'.$parsed_url_referer['host'].'" is not an allowed referer' : 'no HTTP_REFERER exists')); } -$parsed_url_src = parse_url(@$_GET['src']); -if ($phpThumb->config_nohotlink_enabled && $phpThumb->config_nohotlink_erase_image && eregi('^(f|ht)tps?://', @$_GET['src']) && !in_array(@$parsed_url_src['host'], $phpThumb->config_nohotlink_valid_domains)) { +$parsed_url_src = phpthumb_functions::ParseURLbetter(@$_GET['src']); +if ($phpThumb->config_nohotlink_enabled && $phpThumb->config_nohotlink_erase_image && preg_match('#^(f|ht)tps?://#i', @$_GET['src']) && !in_array(@$parsed_url_src['host'], $phpThumb->config_nohotlink_valid_domains)) { $phpThumb->ErrorImage($phpThumb->config_nohotlink_text_message); } @@ -207,29 +301,27 @@ //////////////////////////////////////////////////////////////// // Debug output, to try and help me diagnose problems $phpThumb->DebugTimingMessage('phpThumbDebug[2]', __FILE__, __LINE__); -if (@$_GET['phpThumbDebug'] == '2') { +if (isset($_GET['phpThumbDebug']) && ($_GET['phpThumbDebug'] == '2')) { $phpThumb->phpThumbDebug(); } //////////////////////////////////////////////////////////////// -if (@$PHPTHUMB_CONFIG['cache_default_only_suffix'] && (strpos($PHPTHUMB_CONFIG['cache_default_only_suffix'], '*') !== false)) { - $PHPTHUMB_DEFAULTS_DISABLEGETPARAMS = true; -} -// deprecated: 'err', 'file', 'goto', -$allowedGETparameters = array('src', 'new', 'w', 'h', 'wp', 'hp', 'wl', 'hl', 'ws', 'hs', 'f', 'q', 'sx', 'sy', 'sw', 'sh', 'zc', 'bc', 'bg', 'bgt', 'fltr', 'xto', 'ra', 'ar', 'aoe', 'far', 'iar', 'maxb', 'down', 'phpThumbDebug', 'hash', 'md5s', 'sfn', 'dpi', 'sia'); +$PHPTHUMB_DEFAULTS_DISABLEGETPARAMS = (bool) (@$PHPTHUMB_CONFIG['cache_default_only_suffix'] && (strpos($PHPTHUMB_CONFIG['cache_default_only_suffix'], '*') !== false)); + if (!empty($PHPTHUMB_DEFAULTS) && is_array($PHPTHUMB_DEFAULTS)) { $phpThumb->DebugMessage('setting $PHPTHUMB_DEFAULTS['.implode(';', array_keys($PHPTHUMB_DEFAULTS)).']', __FILE__, __LINE__); foreach ($PHPTHUMB_DEFAULTS as $key => $value) { if ($PHPTHUMB_DEFAULTS_GETSTRINGOVERRIDE || !isset($_GET[$key])) { $_GET[$key] = $value; $phpThumb->DebugMessage('PHPTHUMB_DEFAULTS assigning ('.$value.') to $_GET['.$key.']', __FILE__, __LINE__); - //$phpThumb->DebugMessage('PHPTHUMB_DEFAULTS.setParameter('.$key.', '.$phpThumb->phpThumbDebugVarDump($value).')', __FILE__, __LINE__); - //$phpThumb->setParameter($key, $value); } } } + +// deprecated: 'err', 'file', 'goto', +$allowedGETparameters = array('src', 'new', 'w', 'h', 'wp', 'hp', 'wl', 'hl', 'ws', 'hs', 'f', 'q', 'sx', 'sy', 'sw', 'sh', 'zc', 'bc', 'bg', 'bgt', 'fltr', 'xto', 'ra', 'ar', 'aoe', 'far', 'iar', 'maxb', 'down', 'phpThumbDebug', 'hash', 'md5s', 'sfn', 'dpi', 'sia', 'nocache'); foreach ($_GET as $key => $value) { - if (@$PHPTHUMB_DEFAULTS_DISABLEGETPARAMS && ($key != 'src')) { + if (!empty($PHPTHUMB_DEFAULTS_DISABLEGETPARAMS) && ($key != 'src')) { // disabled, do not set parameter $phpThumb->DebugMessage('ignoring $_GET['.$key.'] because of $PHPTHUMB_DEFAULTS_DISABLEGETPARAMS', __FILE__, __LINE__); } elseif (in_array($key, $allowedGETparameters)) { @@ -243,37 +335,38 @@ //////////////////////////////////////////////////////////////// // Debug output, to try and help me diagnose problems $phpThumb->DebugTimingMessage('phpThumbDebug[3]', __FILE__, __LINE__); -if (@$_GET['phpThumbDebug'] == '3') { +if (isset($_GET['phpThumbDebug']) && ($_GET['phpThumbDebug'] == '3')) { $phpThumb->phpThumbDebug(); } //////////////////////////////////////////////////////////////// -//if (!@$_GET['phpThumbDebug'] && !$phpThumb->sourceFilename && !function_exists('ImageJPEG') && !function_exists('ImagePNG') && !function_exists('ImageGIF')) { -if (!@$_GET['phpThumbDebug'] && !is_file($phpThumb->sourceFilename) && !phpthumb_functions::gd_version()) { - if (!headers_sent()) { - // base64-encoded error image in GIF format - $ERROR_NOGD = 'R0lGODlhIAAgALMAAAAAABQUFCQkJDY2NkZGRldXV2ZmZnJycoaGhpSUlKWlpbe3t8XFxdXV1eTk5P7+/iwAAAAAIAAgAAAE/vDJSau9WILtTAACUinDNijZtAHfCojS4W5H+qxD8xibIDE9h0OwWaRWDIljJSkUJYsN4bihMB8th3IToAKs1VtYM75cyV8sZ8vygtOE5yMKmGbO4jRdICQCjHdlZzwzNW4qZSQmKDaNjhUMBX4BBAlmMywFSRWEmAI6b5gAlhNxokGhooAIK5o/pi9vEw4Lfj4OLTAUpj6IabMtCwlSFw0DCKBoFqwAB04AjI54PyZ+yY3TD0ss2YcVmN/gvpcu4TOyFivWqYJlbAHPpOntvxNAACcmGHjZzAZqzSzcq5fNjxFmAFw9iFRunD1epU6tsIPmFCAJnWYE0FURk7wJDA0MTKpEzoWAAskiAAA7'; - header('Content-Type: image/gif'); - echo base64_decode($ERROR_NOGD); - } else { - echo '*** ERROR: No PHP-GD support available ***'; - } - exit; -} +//if (!@$_GET['phpThumbDebug'] && !is_file($phpThumb->sourceFilename) && !phpthumb_functions::gd_version()) { +// if (!headers_sent()) { +// // base64-encoded error image in GIF format +// $ERROR_NOGD = 'R0lGODlhIAAgALMAAAAAABQUFCQkJDY2NkZGRldXV2ZmZnJycoaGhpSUlKWlpbe3t8XFxdXV1eTk5P7+/iwAAAAAIAAgAAAE/vDJSau9WILtTAACUinDNijZtAHfCojS4W5H+qxD8xibIDE9h0OwWaRWDIljJSkUJYsN4bihMB8th3IToAKs1VtYM75cyV8sZ8vygtOE5yMKmGbO4jRdICQCjHdlZzwzNW4qZSQmKDaNjhUMBX4BBAlmMywFSRWEmAI6b5gAlhNxokGhooAIK5o/pi9vEw4Lfj4OLTAUpj6IabMtCwlSFw0DCKBoFqwAB04AjI54PyZ+yY3TD0ss2YcVmN/gvpcu4TOyFivWqYJlbAHPpOntvxNAACcmGHjZzAZqzSzcq5fNjxFmAFw9iFRunD1epU6tsIPmFCAJnWYE0FURk7wJDA0MTKpEzoWAAskiAAA7'; +// header('Content-Type: image/gif'); +// echo base64_decode($ERROR_NOGD); +// } else { +// echo '*** ERROR: No PHP-GD support available ***'; +// } +// exit; +//} // check to see if file can be output from source with no processing or caching $CanPassThroughDirectly = true; if ($phpThumb->rawImageData) { // data from SQL, should be fine -} elseif (eregi('^(f|ht)tp\://', $phpThumb->src)) { - $phpThumb->DebugMessage('$CanPassThroughDirectly=false because eregi("^(f|ht)tp\://", '.$phpThumb->src.')', __FILE__, __LINE__); - $CanPassThroughDirectly = false; -} elseif (!@is_file($phpThumb->sourceFilename)) { - $phpThumb->DebugMessage('$CanPassThroughDirectly=false because !@is_file('.$phpThumb->sourceFilename.')', __FILE__, __LINE__); +} elseif (preg_match('#^http\://[^\\?&]+\\.(jpe?g|gif|png)$#i', $phpThumb->src)) { + // assume is ok to passthru if no other parameters specified +} elseif (preg_match('#^(f|ht)tp\://#i', $phpThumb->src)) { + $phpThumb->DebugMessage('$CanPassThroughDirectly=false because preg_match("#^(f|ht)tp\://#i", '.$phpThumb->src.')', __FILE__, __LINE__); $CanPassThroughDirectly = false; } elseif (!@is_readable($phpThumb->sourceFilename)) { $phpThumb->DebugMessage('$CanPassThroughDirectly=false because !@is_readable('.$phpThumb->sourceFilename.')', __FILE__, __LINE__); $CanPassThroughDirectly = false; +} elseif (!@is_file($phpThumb->sourceFilename)) { + $phpThumb->DebugMessage('$CanPassThroughDirectly=false because !@is_file('.$phpThumb->sourceFilename.')', __FILE__, __LINE__); + $CanPassThroughDirectly = false; } foreach ($_GET as $key => $value) { switch ($key) { @@ -284,6 +377,10 @@ case 'w': case 'h': // might be OK if exactly matches original + if (preg_match('#^http\://[^\\?&]+\\.(jpe?g|gif|png)$#i', $phpThumb->src)) { + // assume it is not ok for direct-passthru of remote image + $CanPassThroughDirectly = false; + } break; case 'phpThumbDebug': @@ -305,27 +402,21 @@ //////////////////////////////////////////////////////////////// // Debug output, to try and help me diagnose problems $phpThumb->DebugTimingMessage('phpThumbDebug[4]', __FILE__, __LINE__); -if (@$_GET['phpThumbDebug'] == '4') { +if (isset($_GET['phpThumbDebug']) && ($_GET['phpThumbDebug'] == '4')) { $phpThumb->phpThumbDebug(); } //////////////////////////////////////////////////////////////// -function SendSaveAsFileHeaderIfNeeded() { - if (headers_sent()) { - return false; - } - global $phpThumb; - $downloadfilename = phpthumb_functions::SanitizeFilename(@$_GET['sia'] ? $_GET['sia'] : (@$_GET['down'] ? $_GET['down'] : 'phpThumb_generated_thumbnail'.(@$_GET['f'] ? $_GET['f'] : 'jpg'))); - if (@$downloadfilename) { - $phpThumb->DebugMessage('SendSaveAsFileHeaderIfNeeded() sending header: Content-Disposition: '.(@$_GET['down'] ? 'attachment' : 'inline').'; filename="'.$downloadfilename.'"', __FILE__, __LINE__); - header('Content-Disposition: '.(@$_GET['down'] ? 'attachment' : 'inline').'; filename="'.$downloadfilename.'"'); - } - return true; -} - $phpThumb->DebugMessage('$CanPassThroughDirectly="'.intval($CanPassThroughDirectly).'" && $phpThumb->src="'.$phpThumb->src.'"', __FILE__, __LINE__); while ($CanPassThroughDirectly && $phpThumb->src) { // no parameters set, passthru + + if (preg_match('#^http\://[^\\?&]+\.(jpe?g|gif|png)$#i', $phpThumb->src)) { + $phpThumb->DebugMessage('Passing HTTP source through directly as Location: redirect ('.$phpThumb->src.')', __FILE__, __LINE__); + header('Location: '.$phpThumb->src); + exit; + } + $SourceFilename = $phpThumb->ResolveFilenameToAbsolute($phpThumb->src); // security and size checks @@ -396,72 +487,14 @@ function SendSaveAsFileHeaderIfNeeded() { //////////////////////////////////////////////////////////////// // Debug output, to try and help me diagnose problems $phpThumb->DebugTimingMessage('phpThumbDebug[5]', __FILE__, __LINE__); -if (@$_GET['phpThumbDebug'] == '5') { +if (isset($_GET['phpThumbDebug']) && ($_GET['phpThumbDebug'] == '5')) { $phpThumb->phpThumbDebug(); } //////////////////////////////////////////////////////////////// -function RedirectToCachedFile() { - global $phpThumb, $PHPTHUMB_CONFIG; - - $nice_cachefile = str_replace(DIRECTORY_SEPARATOR, '/', $phpThumb->cache_filename); - $nice_docroot = str_replace(DIRECTORY_SEPARATOR, '/', rtrim($PHPTHUMB_CONFIG['document_root'], '/\\')); - - $parsed_url = @parse_url(@$_SERVER['HTTP_REFERER']); - - $nModified = filemtime($phpThumb->cache_filename); - - if ($phpThumb->config_nooffsitelink_enabled && @$_SERVER['HTTP_REFERER'] && !in_array(@$parsed_url['host'], $phpThumb->config_nooffsitelink_valid_domains)) { - - $phpThumb->DebugMessage('Would have used cached (image/'.$phpThumb->thumbnailFormat.') file "'.$phpThumb->cache_filename.'" (Last-Modified: '.gmdate('D, d M Y H:i:s', $nModified).' GMT), but skipping because $_SERVER[HTTP_REFERER] ('.@$_SERVER['HTTP_REFERER'].') is not in $phpThumb->config_nooffsitelink_valid_domains ('.implode(';', $phpThumb->config_nooffsitelink_valid_domains).')', __FILE__, __LINE__); - - } elseif ($phpThumb->phpThumbDebug) { - - $phpThumb->DebugTimingMessage('skipped using cached image', __FILE__, __LINE__); - $phpThumb->DebugMessage('Would have used cached file, but skipping due to phpThumbDebug', __FILE__, __LINE__); - $phpThumb->DebugMessage('* Would have sent headers (1): Last-Modified: '.gmdate('D, d M Y H:i:s', $nModified).' GMT', __FILE__, __LINE__); - if ($getimagesize = @GetImageSize($phpThumb->cache_filename)) { - $phpThumb->DebugMessage('* Would have sent headers (2): Content-Type: '.phpthumb_functions::ImageTypeToMIMEtype($getimagesize[2]), __FILE__, __LINE__); - } - if (ereg('^'.preg_quote($nice_docroot).'(.*)$', $nice_cachefile, $matches)) { - $phpThumb->DebugMessage('* Would have sent headers (3): Location: '.dirname($matches[1]).'/'.urlencode(basename($matches[1])), __FILE__, __LINE__); - } else { - $phpThumb->DebugMessage('* Would have sent data: readfile('.$phpThumb->cache_filename.')', __FILE__, __LINE__); - } - - } else { - - if (headers_sent()) { - $phpThumb->ErrorImage('Headers already sent ('.basename(__FILE__).' line '.__LINE__.')'); - exit; - } - SendSaveAsFileHeaderIfNeeded(); - - header('Last-Modified: '.gmdate('D, d M Y H:i:s', $nModified).' GMT'); - if (@$_SERVER['HTTP_IF_MODIFIED_SINCE'] && ($nModified == strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE'])) && @$_SERVER['SERVER_PROTOCOL']) { - header($_SERVER['SERVER_PROTOCOL'].' 304 Not Modified'); - exit; - } - - if ($getimagesize = @GetImageSize($phpThumb->cache_filename)) { - header('Content-Type: '.phpthumb_functions::ImageTypeToMIMEtype($getimagesize[2])); - } elseif (eregi('\.ico$', $phpThumb->cache_filename)) { - header('Content-Type: image/x-icon'); - } - if (!@$PHPTHUMB_CONFIG['cache_force_passthru'] && ereg('^'.preg_quote($nice_docroot).'(.*)$', $nice_cachefile, $matches)) { - header('Location: '.dirname($matches[1]).'/'.urlencode(basename($matches[1]))); - } else { - @readfile($phpThumb->cache_filename); - } - exit; - - } - return true; -} - // check to see if file already exists in cache, and output it with no processing if it does $phpThumb->SetCacheFilename(); -if (@is_file($phpThumb->cache_filename)) { +if (@is_readable($phpThumb->cache_filename)) { RedirectToCachedFile(); } else { $phpThumb->DebugMessage('Cached file "'.$phpThumb->cache_filename.'" does not exist, processing as normal', __FILE__, __LINE__); @@ -470,7 +503,7 @@ function RedirectToCachedFile() { //////////////////////////////////////////////////////////////// // Debug output, to try and help me diagnose problems $phpThumb->DebugTimingMessage('phpThumbDebug[6]', __FILE__, __LINE__); -if (@$_GET['phpThumbDebug'] == '6') { +if (isset($_GET['phpThumbDebug']) && ($_GET['phpThumbDebug'] == '6')) { $phpThumb->phpThumbDebug(); } //////////////////////////////////////////////////////////////// @@ -479,7 +512,7 @@ function RedirectToCachedFile() { // great -} elseif (@$_GET['new']) { +} elseif (!empty($_GET['new'])) { // generate a blank image resource of the specified size/background color/opacity if (($phpThumb->w <= 0) || ($phpThumb->h <= 0)) { @@ -507,13 +540,20 @@ function RedirectToCachedFile() { $phpThumb->ErrorImage('Usage: '.$_SERVER['PHP_SELF'].'?src=/path/and/filename.jpg'."\n".'read Usage comments for details'); -} elseif (eregi('^(f|ht)tp\://', $phpThumb->src)) { +} elseif (preg_match('#^(f|ht)tp\://#i', $phpThumb->src)) { + $phpThumb->DebugMessage('$phpThumb->src ('.$phpThumb->src.') is remote image, attempting to download', __FILE__, __LINE__); if ($phpThumb->config_http_user_agent) { + $phpThumb->DebugMessage('Setting "user_agent" to "'.$phpThumb->config_http_user_agent.'"', __FILE__, __LINE__); ini_set('user_agent', $phpThumb->config_http_user_agent); } - - if ($rawImageData = phpthumb_functions::SafeURLread(phpthumb_functions::CleanUpURLencoding($phpThumb->src), $error, $phpThumb->config_http_fopen_timeout, $phpThumb->config_http_follow_redirect)) { + $cleanedupurl = phpthumb_functions::CleanUpURLencoding($phpThumb->src); + $phpThumb->DebugMessage('CleanUpURLencoding('.$phpThumb->src.') returned "'.$cleanedupurl.'"', __FILE__, __LINE__); + $phpThumb->src = $cleanedupurl; + unset($cleanedupurl); + if ($rawImageData = phpthumb_functions::SafeURLread($phpThumb->src, $error, $phpThumb->config_http_fopen_timeout, $phpThumb->config_http_follow_redirect)) { + $phpThumb->DebugMessage('SafeURLread('.$phpThumb->src.') succeeded'.($error ? ' with messsages: "'.$error.'"' : ''), __FILE__, __LINE__); + $phpThumb->DebugMessage('Setting source data from URL "'.$phpThumb->src.'"', __FILE__, __LINE__); $phpThumb->setSourceData($rawImageData, urlencode($phpThumb->src)); } else { $phpThumb->ErrorImage($error); @@ -523,7 +563,7 @@ function RedirectToCachedFile() { //////////////////////////////////////////////////////////////// // Debug output, to try and help me diagnose problems $phpThumb->DebugTimingMessage('phpThumbDebug[7]', __FILE__, __LINE__); -if (@$_GET['phpThumbDebug'] == '7') { +if (isset($_GET['phpThumbDebug']) && ($_GET['phpThumbDebug'] == '7')) { $phpThumb->phpThumbDebug(); } //////////////////////////////////////////////////////////////// @@ -533,28 +573,19 @@ function RedirectToCachedFile() { //////////////////////////////////////////////////////////////// // Debug output, to try and help me diagnose problems $phpThumb->DebugTimingMessage('phpThumbDebug[8]', __FILE__, __LINE__); -if (@$_GET['phpThumbDebug'] == '8') { +if (isset($_GET['phpThumbDebug']) && ($_GET['phpThumbDebug'] == '8')) { $phpThumb->phpThumbDebug(); } //////////////////////////////////////////////////////////////// -if ($phpThumb->config_allow_parameter_file && $phpThumb->file) { - - $phpThumb->RenderToFile($phpThumb->ResolveFilenameToAbsolute($phpThumb->file)); - if ($phpThumb->config_allow_parameter_goto && $phpThumb->goto && eregi('^(f|ht)tps?://', $phpThumb->goto)) { - // redirect to another URL after image has been rendered to file - header('Location: '.$phpThumb->goto); - exit; - } - -} elseif (@$PHPTHUMB_CONFIG['high_security_enabled'] && @$_GET['nocache']) { +if (!empty($PHPTHUMB_CONFIG['high_security_enabled']) && !empty($_GET['nocache'])) { // cache disabled, don't write cachefile } else { phpthumb_functions::EnsureDirectoryExists(dirname($phpThumb->cache_filename)); - if ((file_exists($phpThumb->cache_filename) && is_writable($phpThumb->cache_filename)) || is_writable(dirname($phpThumb->cache_filename))) { + if (is_writable(dirname($phpThumb->cache_filename)) || (file_exists($phpThumb->cache_filename) && is_writable($phpThumb->cache_filename))) { $phpThumb->CleanUpCacheDirectory(); if ($phpThumb->RenderToFile($phpThumb->cache_filename) && is_readable($phpThumb->cache_filename)) { @@ -575,7 +606,7 @@ function RedirectToCachedFile() { //////////////////////////////////////////////////////////////// // Debug output, to try and help me diagnose problems $phpThumb->DebugTimingMessage('phpThumbDebug[9]', __FILE__, __LINE__); -if (@$_GET['phpThumbDebug'] == '9') { +if (isset($_GET['phpThumbDebug']) && ($_GET['phpThumbDebug'] == '9')) { $phpThumb->phpThumbDebug(); } //////////////////////////////////////////////////////////////// @@ -587,7 +618,7 @@ function RedirectToCachedFile() { //////////////////////////////////////////////////////////////// // Debug output, to try and help me diagnose problems $phpThumb->DebugTimingMessage('phpThumbDebug[10]', __FILE__, __LINE__); -if (@$_GET['phpThumbDebug'] == '10') { +if (isset($_GET['phpThumbDebug']) && ($_GET['phpThumbDebug'] == '10')) { $phpThumb->phpThumbDebug(); } //////////////////////////////////////////////////////////////// diff --git a/assets/snippets/phpthumb/phpthumb.bmp.php b/assets/snippets/phpthumb/phpthumb.bmp.php index d46ed13f9a..0496622159 100644 --- a/assets/snippets/phpthumb/phpthumb.bmp.php +++ b/assets/snippets/phpthumb/phpthumb.bmp.php @@ -734,7 +734,9 @@ function PlotPixelsGD(&$BMPdata, $truecolor=true) { } foreach ($BMPdata['data'] as $row => $colarray) { - @set_time_limit(30); + if (!phpthumb_functions::FunctionIsDisabled('set_time_limit')) { + set_time_limit(30); + } foreach ($colarray as $col => $color) { list($red, $green, $blue) = $this->IntColor2RGB($color); if ($truecolor) { @@ -754,7 +756,9 @@ function PlotBMP(&$BMPinfo) { echo 'ERROR: no pixel data
    '; return false; } + if (!phpthumb_functions::FunctionIsDisabled('set_time_limit')) { set_time_limit(intval(round($BMPinfo['resolution_x'] * $BMPinfo['resolution_y'] / 10000))); + } $im = $this->PlotPixelsGD($BMPinfo['bmp']); if (headers_sent()) { echo 'plotted '.($BMPinfo['resolution_x'] * $BMPinfo['resolution_y']).' pixels in '.(time() - $starttime).' seconds
    '; diff --git a/assets/snippets/phpthumb/phpthumb.class.php b/assets/snippets/phpthumb/phpthumb.class.php index a6dd3342de..84d5d6cb1c 100644 --- a/assets/snippets/phpthumb/phpthumb.class.php +++ b/assets/snippets/phpthumb/phpthumb.class.php @@ -4059,7 +4059,7 @@ function ImageResizeFunction(&$dst_im, &$src_im, $dstX, $dstY, $srcX, $srcY, $ds if (phpthumb_functions::gd_version() >= 2.0) { if ($this->config_disable_imagecopyresampled) { return phpthumb_functions::ImageCopyResampleBicubic($dst_im, $src_im, $dstX, $dstY, $srcX, $srcY, $dstW, $dstH, $srcW, $srcH); - } + } return ImageCopyResampled($dst_im, $src_im, $dstX, $dstY, $srcX, $srcY, $dstW, $dstH, $srcW, $srcH); } return ImageCopyResized($dst_im, $src_im, $dstX, $dstY, $srcX, $srcY, $dstW, $dstH, $srcW, $srcH); diff --git a/assets/snippets/phpthumb/phpthumb.gif.php b/assets/snippets/phpthumb/phpthumb.gif.php index b5a7fb1d9e..ac2d4aabeb 100644 --- a/assets/snippets/phpthumb/phpthumb.gif.php +++ b/assets/snippets/phpthumb/phpthumb.gif.php @@ -37,7 +37,10 @@ function gif_loadFileToGDimageResource($gifFilename, $bgColor = -1) { if ($gif = gif_loadFile($gifFilename)) { - @set_time_limit(300); + if (!phpthumb_functions::FunctionIsDisabled('set_time_limit')) { + // shouldn't take nearly this long + set_time_limit(120); + } // general strategy: convert raw data to PNG then convert PNG data to GD image resource $PNGdata = $gif->getPng($bgColor); if ($img = @ImageCreateFromString($PNGdata)) { @@ -1093,7 +1096,9 @@ function getGD_PixelPlotterVersion() $data = $this->m_img->m_data; $nPxl = ($this->m_gfh->m_nHeight - 1) * $this->m_gfh->m_nWidth; for ($y = 0; $y < $this->m_gfh->m_nHeight; $y++) { + if (!phpthumb_functions::FunctionIsDisabled('set_time_limit')) { set_time_limit(30); + } for ($x = 0; $x < $this->m_gfh->m_nWidth; $x++, $nPxl++) { if ( ($x >= $this->m_img->m_gih->m_nLeft) && diff --git a/assets/snippets/phpthumb/phpthumb.unsharp.php b/assets/snippets/phpthumb/phpthumb.unsharp.php index ff32838b07..283f3122ee 100644 --- a/assets/snippets/phpthumb/phpthumb.unsharp.php +++ b/assets/snippets/phpthumb/phpthumb.unsharp.php @@ -1,24 +1,27 @@ // // for use in phpThumb() on 3 February 2003. // +// updated to v2.1.1 on 24 April 2011 // // // // phpThumb() is found at http://phpthumb.sourceforge.net /// ////////////////////////////////////////////////////////////// /* -WARNING! Due to a known bug in PHP 4.3.2 this script is not working well in this version. -The sharpened images get too dark. The bug is fixed in version 4.3.3. +New: +- In version 2.1 (February 26 2007) Tom Bishop has done some important speed enhancements. +- From version 2 (July 17 2006) the script uses the imageconvolution function in PHP + version >= 5.1, which improves the performance considerably. Unsharp masking is a traditional darkroom technique that has proven very suitable for digital imaging. The principle of unsharp masking is to create a blurred copy of the image @@ -45,105 +48,70 @@ function applyUnsharpMask(&$img, $amount, $radius, $threshold) { // imgcreatetruecolor. No url! $img must be a truecolor image. // Attempt to calibrate the parameters to Photoshop: - $amount = min($amount, 500); - $amount = $amount * 0.016; - if ($amount == 0) { - return true; - } - - $radius = min($radius, 50); - $radius = $radius * 2; - - $threshold = min($threshold, 255); - - $radius = abs(round($radius)); // Only integers make sense. + $amount = min($amount, 500) * 0.016; + $radius = abs(round(min(50, $radius) * 2)); // Only integers make sense. + $threshold = min(255, $threshold); if ($radius == 0) { return true; } - $w = ImageSX($img); $h = ImageSY($img); $imgCanvas = ImageCreateTrueColor($w, $h); - $imgCanvas2 = ImageCreateTrueColor($w, $h); - ImageCopy($imgCanvas, $img, 0, 0, 0, 0, $w, $h); - ImageCopy($imgCanvas2, $img, 0, 0, 0, 0, $w, $h); - - - $builtinFilterSucceeded = false; - if ($radius == 1) { - if (phpthumb_functions::version_compare_replacement(phpversion(), '5.0.0', '>=') && phpthumb_functions::gd_is_bundled()) { - if (ImageFilter($imgCanvas, IMG_FILTER_GAUSSIAN_BLUR) && ImageFilter($imgCanvas2, IMG_FILTER_GAUSSIAN_BLUR)) { - $builtinFilterSucceeded = true; - } - } - } - - if (!$builtinFilterSucceeded) { $imgBlur = ImageCreateTrueColor($w, $h); - $imgBlur2 = ImageCreateTrueColor($w, $h); - /////////////////////////// + // Gaussian blur matrix: // - // Gaussian blur matrix: // 1 2 1 // 2 4 2 // 1 2 1 // - /////////////////////////// + ////////////////////////////////////////////////// + + if (function_exists('imageconvolution')) { // PHP >= 5.1 + $matrix = array( + array(1, 2, 1), + array(2, 4, 2), + array(1, 2, 1) + ); + ImageCopy($imgBlur, $img, 0, 0, 0, 0, $w, $h); + ImageConvolution($imgBlur, $matrix, 16, 0); + + } else { // Move copies of the image around one pixel at the time and merge them with weight // according to the matrix. The same matrix is simply repeated for higher radii. for ($i = 0; $i < $radius; $i++) { - ImageCopy ($imgBlur, $imgCanvas, 0, 0, 1, 1, $w - 1, $h - 1); // up left - ImageCopyMerge($imgBlur, $imgCanvas, 1, 1, 0, 0, $w, $h, 50); // down right - ImageCopyMerge($imgBlur, $imgCanvas, 0, 1, 1, 0, $w - 1, $h, 33.33333); // down left - ImageCopyMerge($imgBlur, $imgCanvas, 1, 0, 0, 1, $w, $h - 1, 25); // up right - ImageCopyMerge($imgBlur, $imgCanvas, 0, 0, 1, 0, $w - 1, $h, 33.33333); // left - ImageCopyMerge($imgBlur, $imgCanvas, 1, 0, 0, 0, $w, $h, 25); // right - ImageCopyMerge($imgBlur, $imgCanvas, 0, 0, 0, 1, $w, $h - 1, 20 ); // up - ImageCopyMerge($imgBlur, $imgCanvas, 0, 1, 0, 0, $w, $h, 16.666667); // down - ImageCopyMerge($imgBlur, $imgCanvas, 0, 0, 0, 0, $w, $h, 50); // center + ImageCopy( $imgBlur, $img, 0, 0, 1, 0, $w - 1, $h); // left + ImageCopyMerge($imgBlur, $img, 1, 0, 0, 0, $w , $h, 50); // right + ImageCopyMerge($imgBlur, $img, 0, 0, 0, 0, $w , $h, 50); // center ImageCopy ($imgCanvas, $imgBlur, 0, 0, 0, 0, $w, $h); - - // During the loop above the blurred copy darkens, possibly due to a roundoff - // error. Therefore the sharp picture has to go through the same loop to - // produce a similar image for comparison. This is not a good thing, as processing - // time increases heavily. - ImageCopy ($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h); - ImageCopyMerge($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h, 50); - ImageCopyMerge($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h, 33.33333); - ImageCopyMerge($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h, 25); - ImageCopyMerge($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h, 33.33333); - ImageCopyMerge($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h, 25); - ImageCopyMerge($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h, 20 ); - ImageCopyMerge($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h, 16.666667); - ImageCopyMerge($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h, 50); - ImageCopy ($imgCanvas2, $imgBlur2, 0, 0, 0, 0, $w, $h); + ImageCopyMerge($imgBlur, $imgCanvas, 0, 0, 0, 1, $w , $h - 1, 33.33333); // up + ImageCopyMerge($imgBlur, $imgCanvas, 0, 1, 0, 0, $w , $h, 25); // down } - ImageDestroy($imgBlur); - ImageDestroy($imgBlur2); } + if ($threshold > 0){ // Calculate the difference between the blurred pixels and the original // and set the pixels - for ($x = 0; $x < $w; $x++) { // each row + for ($x = 0; $x < $w-1; $x++) { // each row for ($y = 0; $y < $h; $y++) { // each pixel - $rgbOrig = ImageColorAt($imgCanvas2, $x, $y); + $rgbOrig = ImageColorAt($img, $x, $y); $rOrig = (($rgbOrig >> 16) & 0xFF); $gOrig = (($rgbOrig >> 8) & 0xFF); $bOrig = ($rgbOrig & 0xFF); - $rgbBlur = ImageColorAt($imgCanvas, $x, $y); + $rgbBlur = ImageColorAt($imgBlur, $x, $y); + $rBlur = (($rgbBlur >> 16) & 0xFF); $gBlur = (($rgbBlur >> 8) & 0xFF); $bBlur = ($rgbBlur & 0xFF); // When the masked pixels differ less from the original // than the threshold specifies, they are set to their original value. - $rNew = (abs($rOrig - $rBlur) >= $threshold) ? max(0, min(255, ($amount * ($rOrig - $rBlur)) + $rOrig)) : $rOrig; - $gNew = (abs($gOrig - $gBlur) >= $threshold) ? max(0, min(255, ($amount * ($gOrig - $gBlur)) + $gOrig)) : $gOrig; - $bNew = (abs($bOrig - $bBlur) >= $threshold) ? max(0, min(255, ($amount * ($bOrig - $bBlur)) + $bOrig)) : $bOrig; + $rNew = ((abs($rOrig - $rBlur) >= $threshold) ? max(0, min(255, ($amount * ($rOrig - $rBlur)) + $rOrig)) : $rOrig); + $gNew = ((abs($gOrig - $gBlur) >= $threshold) ? max(0, min(255, ($amount * ($gOrig - $gBlur)) + $gOrig)) : $gOrig); + $bNew = ((abs($bOrig - $bBlur) >= $threshold) ? max(0, min(255, ($amount * ($bOrig - $bBlur)) + $bOrig)) : $bOrig); if (($rOrig != $rNew) || ($gOrig != $gNew) || ($bOrig != $bNew)) { $pixCol = ImageColorAllocate($img, $rNew, $gNew, $bNew); @@ -151,12 +119,31 @@ function applyUnsharpMask(&$img, $amount, $radius, $threshold) { } } } + } else { + for ($x = 0; $x < $w; $x++) { // each row + for ($y = 0; $y < $h; $y++) { // each pixel + $rgbOrig = ImageColorAt($img, $x, $y); + $rOrig = (($rgbOrig >> 16) & 0xFF); + $gOrig = (($rgbOrig >> 8) & 0xFF); + $bOrig = ($rgbOrig & 0xFF); + + $rgbBlur = ImageColorAt($imgBlur, $x, $y); + + $rBlur = (($rgbBlur >> 16) & 0xFF); + $gBlur = (($rgbBlur >> 8) & 0xFF); + $bBlur = ($rgbBlur & 0xFF); + + $rNew = min(255, max(0, ($amount * ($rOrig - $rBlur)) + $rOrig)); + $gNew = min(255, max(0, ($amount * ($gOrig - $gBlur)) + $gOrig)); + $bNew = min(255, max(0, ($amount * ($bOrig - $bBlur)) + $bOrig)); + $rgbNew = ($rNew << 16) + ($gNew <<8) + $bNew; + ImageSetPixel($img, $x, $y, $rgbNew); + } + } + } ImageDestroy($imgCanvas); - ImageDestroy($imgCanvas2); - + ImageDestroy($imgBlur); return true; } - } - ?> \ No newline at end of file From a4b4ec9474f700f10895a6fb13c2803b018f895f Mon Sep 17 00:00:00 2001 From: Dmi3yy Date: Mon, 26 Aug 2013 18:14:39 +0300 Subject: [PATCH 360/530] delete sample config in phpthumb --- .../phpthumb/phpThumb.config.php.default | 254 ------------------ 1 file changed, 254 deletions(-) delete mode 100644 assets/snippets/phpthumb/phpThumb.config.php.default diff --git a/assets/snippets/phpthumb/phpThumb.config.php.default b/assets/snippets/phpthumb/phpThumb.config.php.default deleted file mode 100644 index d710cdde94..0000000000 --- a/assets/snippets/phpthumb/phpThumb.config.php.default +++ /dev/null @@ -1,254 +0,0 @@ - // -// available at http://phpthumb.sourceforge.net /// -////////////////////////////////////////////////////////////// -/// // -// See: phpthumb.readme.txt for usage instructions // -// NOTE: THIS FILE HAS NO EFFECT IN OBJECT MODE! // -// THIS CONFIG FILE ONLY APPLIES TO phpThumb.php // -// /// -////////////////////////////////////////////////////////////// - -ob_start(); -if (!file_exists(dirname(__FILE__).'/phpthumb.functions.php') || !include_once(dirname(__FILE__).'/phpthumb.functions.php')) { - ob_end_flush(); - die('failed to include_once(phpthumb.functions.php) - realpath="'.realpath(dirname(__FILE__).'/phpthumb.functions.php').'"'); -} -ob_end_clean(); - -// START USER CONFIGURATION SECTION: - -// * DocumentRoot configuration -// phpThumb() depends on $_SERVER['DOCUMENT_ROOT'] to resolve path/filenames. This value is usually correct, -// but has been known to be broken on some servers. This value allows you to override the default value. -// Do not modify from the auto-detect default value unless you are having problems. -//$PHPTHUMB_CONFIG['document_root'] = '/home/httpd/httpdocs'; -//$PHPTHUMB_CONFIG['document_root'] = 'c:\\webroot\\example.com\\www'; -//$PHPTHUMB_CONFIG['document_root'] = $_SERVER['DOCUMENT_ROOT']; -//$PHPTHUMB_CONFIG['document_root'] = realpath((@$_SERVER['DOCUMENT_ROOT'] && file_exists(@$_SERVER['DOCUMENT_ROOT'].$_SERVER['PHP_SELF'])) ? $_SERVER['DOCUMENT_ROOT'] : str_replace(dirname(@$_SERVER['PHP_SELF']), '', str_replace(DIRECTORY_SEPARATOR, '/', realpath('.')))); -$PHPTHUMB_CONFIG['document_root'] = realpath((getenv('DOCUMENT_ROOT') && preg_match('#^'.preg_quote(realpath(getenv('DOCUMENT_ROOT'))).'#', realpath(__FILE__))) ? getenv('DOCUMENT_ROOT') : str_replace(dirname(@$_SERVER['PHP_SELF']), '', str_replace(DIRECTORY_SEPARATOR, '/', dirname(__FILE__)))); - -// * Cache directory configuration (choose only one of these - leave the other lines commented-out): -// Note: this directory must be writable (usually chmod 777 is neccesary) for caching to work. -// If the directory is not writable no error will be generated but caching will be disabled. -$PHPTHUMB_CONFIG['cache_directory'] = dirname(__FILE__).'/cache/'; // set the cache directory relative to the phpThumb() installation -//$PHPTHUMB_CONFIG['cache_directory'] = $PHPTHUMB_CONFIG['document_root'].'/phpthumb/cache/'; // set the cache directory to an absolute directory for all source images -//$PHPTHUMB_CONFIG['cache_directory'] = './cache/'; // set the cache directory relative to the source image - must start with '.' (will not work to cache URL- or database-sourced images, please use an absolute directory name) -//$PHPTHUMB_CONFIG['cache_directory'] = null; // disable thumbnail caching (not recommended) -//if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') { -// $PHPTHUMB_CONFIG['cache_directory'] = dirname(__FILE__).'/cache/'; // set the cache directory to an absolute directory for all source images -//} else { -// $PHPTHUMB_CONFIG['cache_directory'] = '/tmp/persistent/phpthumb/cache/'; -//} - -$PHPTHUMB_CONFIG['cache_disable_warning'] = false; // If [cache_directory] is non-existant or not writable, and [cache_disable_warning] is false, an error image will be generated warning to either set the cache directory or disable the warning (to avoid people not knowing about the cache) - -$PHPTHUMB_CONFIG['cache_directory_depth'] = 4; // If this larger than zero, cache structure will be broken into a broad directory structure based on cache filename. For example "cache_src012345..." will be stored in "/0/01/012/0123/cache_src012345..." when (cache_directory_depth = 4) - - -// * Cache culling: phpThumb can automatically limit the contents of the cache directory -// based on last-access date and/or number of files and/or total filesize. - -//$PHPTHUMB_CONFIG['cache_maxage'] = null; // never delete cached thumbnails based on last-access time -$PHPTHUMB_CONFIG['cache_maxage'] = 86400 * 30; // delete cached thumbnails that haven't been accessed in more than [30 days] (value is maximum time since last access in seconds to avoid deletion) - -//$PHPTHUMB_CONFIG['cache_maxsize'] = null; // never delete cached thumbnails based on byte size of cache directory -$PHPTHUMB_CONFIG['cache_maxsize'] = 10 * 1024 * 1024; // delete least-recently-accessed cached thumbnails when more than [10MB] of cached files are present (value is maximum bytesize of all cached files) - -//$PHPTHUMB_CONFIG['cache_maxfiles'] = null; // never delete cached thumbnails based on number of cached files -$PHPTHUMB_CONFIG['cache_maxfiles'] = 200; // delete least-recently-accessed cached thumbnails when more than [200] cached files are present (value is maximum number of cached files to keep) - - -// * Source image cache configuration -$PHPTHUMB_CONFIG['cache_source_enabled'] = false; // if true, source images obtained via HTTP are cached to $PHPTHUMB_CONFIG['cache_source_directory'] -$PHPTHUMB_CONFIG['cache_source_directory'] = dirname(__FILE__).'/cache/source/'; // set the cache directory for unprocessed source images - -// * cache source modification date configuration -$PHPTHUMB_CONFIG['cache_source_filemtime_ignore_local'] = false; // if true, local source images will not be checked for modification date and cached image will be used if available, even if source image is changed or removed -$PHPTHUMB_CONFIG['cache_source_filemtime_ignore_remote'] = true; // if true, remote source images will not be checked for modification date and cached image will be used if available, even if source image is changed or removed. WARNING: cached performance MUCH slower if this is set to false. - - -// * Simplified cache filename configuration -// Instead of creating unique cache filenames for all parameter combinations, create "simple" cache files (eg: "pic_thumb.jpg") -// If cache_default_only_suffix is non-empty, GETstring parameters (except 'src') are ignored and only $PHPTHUMB_DEFAULTS -// parameters (set at the bottom of phpThumb.config.php) are used for processing. -// The '*' character MUST be used to represent the source image name -$PHPTHUMB_CONFIG['cache_default_only_suffix'] = ''; // cached in normal phpThumb manner -//$PHPTHUMB_CONFIG['cache_default_only_suffix'] = '*_thumb'; // cache 'pic.jpg' becomes 'pic_thumb.jpg' (or 'pic_thumb.png' if PNG output is selected, etc) -//$PHPTHUMB_CONFIG['cache_default_only_suffix'] = 'small-*'; // cache 'pic.jpg' becomes 'small-pic.jpg' (or 'small-pic.png' if PNG output is selected, etc) - -$PHPTHUMB_CONFIG['cache_prefix'] = 'phpThumb_cache_'.(isset($_SERVER['SERVER_NAME']) ? str_replace('www.', '', $_SERVER['SERVER_NAME']).'_' : ''); // keep cache file separate by domain -//$PHPTHUMB_CONFIG['cache_prefix'] = 'phpThumb_cache'; // allow phpThumb to share 1 set of cached files even if accessed under different servername/domains on same server - -$PHPTHUMB_CONFIG['cache_force_passthru'] = true; // if true, cached image data will always be passed to browser; if false, HTTP redirect will be used instead - - - -// * Temp directory configuration -// phpThumb() may need to create temp files. Usually the system temp dir is writable and can be used. -// Leave this value as NULL in most cases. If you get errors about "failed to open for writing" -// you should change this to a full pathname to a directory you do have write access to. -//$PHPTHUMB_CONFIG['temp_directory'] = null; // attempt to auto-detect -//$PHPTHUMB_CONFIG['temp_directory'] = '/tmp/persistent/phpthumb/cache/'; // set to absolute path -$PHPTHUMB_CONFIG['temp_directory'] = $PHPTHUMB_CONFIG['cache_directory']; // set to same as cache directory - - -// NOTE: "max_source_pixels" only affects GD-resized thumbnails. If you have ImageMagick -// installed it will bypass most of these limits -// maximum number of pixels in source image to attempt to process entire image in GD mode. -// If this is zero then no limit on source image dimensions. -// If this is nonzero then this is the maximum number of pixels the source image -// can have to be processed normally, otherwise the embedded EXIF thumbnail will -// be used (if available) or an "image too large" notice will be displayed. -// This is to be used for large source images (> 1600x1200) and low PHP memory -// limits. If PHP runs out of memory the script will usually just die with no output. -// To calculate this number, multiply the dimensions of the largest image -// you can process with your memory limitation (e.g. 1600 * 1200 = 1920000) -// As a general guideline, this number will be about 20% of your PHP memory -// configuration, so 8M = 1,677,722; 16M = 3,355,443; 32M = 6,710,886; etc. -if (phpthumb_functions::version_compare_replacement(phpversion(), '4.3.2', '>=') && !defined('memory_get_usage') && !@ini_get('memory_limit')) { - // memory_get_usage() will only be defined if your PHP is compiled with the --enable-memory-limit configuration option. - $PHPTHUMB_CONFIG['max_source_pixels'] = 0; // no memory limit -} else { - // calculate default max_source_pixels as 1/6 of memory limit configuration - $PHPTHUMB_CONFIG['max_source_pixels'] = round(max(intval(ini_get('memory_limit')), intval(get_cfg_var('memory_limit'))) * 1048576 / 6); - //$PHPTHUMB_CONFIG['max_source_pixels'] = 0; // no memory limit - //$PHPTHUMB_CONFIG['max_source_pixels'] = 1920000; // allow 1600x1200 images (2Mpx), no larger (about 12MB memory required) - //$PHPTHUMB_CONFIG['max_source_pixels'] = 2795000; // 16MB memory limit - //$PHPTHUMB_CONFIG['max_source_pixels'] = 3871488; // allow 2272x1704 images (4Mpx), no larger (about 24MB memory required) -} - - -// ImageMagick configuration -$PHPTHUMB_CONFIG['prefer_imagemagick'] = true; // If true, use ImageMagick to resize thumbnails if possible, since it is usually faster than GD functions; if false only use ImageMagick if PHP memory limit is too low. -$PHPTHUMB_CONFIG['imagemagick_use_thumbnail'] = true; // If true, use ImageMagick's "-thumbnail" resizing parameter (if available) which removes extra non-image metadata (profiles, EXIF info, etc) resulting in much smaller filesize; if false, use "-resize" paramter which retains this info -if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') { - // Windows: set absolute pathname - $PHPTHUMB_CONFIG['imagemagick_path'] = 'C:/ImageMagick/convert.exe'; -} else { - // *nix: set absolute pathname to "convert", or leave as null if "convert" is in the path (location detected with `which`) - //$PHPTHUMB_CONFIG['imagemagick_path'] = '/usr/local/bin/convert'; - $PHPTHUMB_CONFIG['imagemagick_path'] = null; -} - - - -// * Default output configuration: -$PHPTHUMB_CONFIG['output_format'] = 'jpeg'; // default output format ('jpeg', 'png' or 'gif') - thumbnail will be output in this format (if available in your version of GD or ImageMagick). This is only used if the "f" parameter is not specified, and if the thumbnail can't be output in the input format. -$PHPTHUMB_CONFIG['output_maxwidth'] = 0; // default maximum thumbnail width. If this is zero then default width is the width of the source image. This is always overridden by ?w=___ GETstring parameter -$PHPTHUMB_CONFIG['output_maxheight'] = 0; // default maximum thumbnail height. If this is zero then default height is the height of the source image. This is always overridden by ?h=___ GETstring parameter -$PHPTHUMB_CONFIG['output_interlace'] = true; // if true: interlaced output for GIF/PNG, progressive output for JPEG; if false: non-interlaced for GIF/PNG, baseline for JPEG. - -// * Error message configuration -$PHPTHUMB_CONFIG['error_image_width'] = 400; // default width for error images -$PHPTHUMB_CONFIG['error_image_height'] = 100; // default height for error images -$PHPTHUMB_CONFIG['error_message_image_default'] = ''; // Set this to the name of a generic error image (e.g. '/images/error.png') that you want displayed in place of any error message that may occur. This setting is overridden by the 'err' parameter, which does the same thing. -$PHPTHUMB_CONFIG['error_bgcolor'] = 'CCCCFF'; // background color of error message images -$PHPTHUMB_CONFIG['error_textcolor'] = 'FF0000'; // color of text in error messages -$PHPTHUMB_CONFIG['error_fontsize'] = 1; // size of text in error messages, from 1 (smallest) to 5 (largest) -$PHPTHUMB_CONFIG['error_die_on_error'] = true; // die with error message on any fatal error (recommended with standalone phpThumb.php) -$PHPTHUMB_CONFIG['error_silent_die_on_error'] = false; // simply die with no output of any kind on fatal errors (not recommended) -$PHPTHUMB_CONFIG['error_die_on_source_failure'] = true; // die with error message if source image cannot be processed by phpThumb() (usually because source image is corrupt in some way). If false the source image will be passed through unprocessed, if true (default) an error message will be displayed. - -// * Off-server Thumbnailing Configuration: -$PHPTHUMB_CONFIG['nohotlink_enabled'] = false; // If false will allow thumbnailing from any source domain -$PHPTHUMB_CONFIG['nohotlink_valid_domains'] = array(@$_SERVER['HTTP_HOST']); // This is the list of domains for which thumbnails are allowed to be created. Note: domain only, do not include port numbers. The default value of the current domain should be fine in most cases, but if neccesary you can add more domains in here, in the format "www.example.com" -$PHPTHUMB_CONFIG['nohotlink_erase_image'] = true; // if true thumbnail is covered up with $PHPTHUMB_CONFIG['nohotlink_fill_color'] before text is applied, if false text is written over top of thumbnail -$PHPTHUMB_CONFIG['nohotlink_text_message'] = 'Off-server thumbnailing is not allowed'; // text of error message - -// * Off-server Linking Configuration: -$PHPTHUMB_CONFIG['nooffsitelink_enabled'] = true; // If false will allow thumbnails to be linked to from any domain, if true only domains listed below in 'nooffsitelink_valid_domains' will be allowed. -$PHPTHUMB_CONFIG['nooffsitelink_valid_domains'] = array(@$_SERVER['HTTP_HOST']); // This is the list of domains for which thumbnails are allowed to be created. The default value of the current domain should be fine in most cases, but if neccesary you can add more domains in here, in the format 'www.example.com' -$PHPTHUMB_CONFIG['nooffsitelink_require_refer'] = false; // If false will allow standalone calls to phpThumb(). If true then only requests with a $_SERVER['HTTP_REFERER'] value in 'nooffsitelink_valid_domains' are allowed. -$PHPTHUMB_CONFIG['nooffsitelink_erase_image'] = false; // if true thumbnail is covered up with $PHPTHUMB_CONFIG['nohotlink_fill_color'] before text is applied, if false text is written over top of thumbnail -$PHPTHUMB_CONFIG['nooffsitelink_watermark_src'] = '/demo/images/watermark.png'; // webroot-relative image to overlay on hotlinked images -$PHPTHUMB_CONFIG['nooffsitelink_text_message'] = 'Image taken from '.@$_SERVER['HTTP_HOST']; // text of error message (used if [nooffsitelink_watermark_src] is not a valid image) - - -// * Border & Background default colors -$PHPTHUMB_CONFIG['border_hexcolor'] = '000000'; // Default border color - usual HTML-style hex color notation (overidden with 'bc' parameter) -$PHPTHUMB_CONFIG['background_hexcolor'] = 'FFFFFF'; // Default background color when thumbnail aspect ratio does not match fixed-dimension box - usual HTML-style hex color notation (overridden with 'bg' parameter) - -// * Watermark configuration -$PHPTHUMB_CONFIG['ttf_directory'] = dirname(__FILE__).'/fonts'; // Base directory for TTF font files -//$PHPTHUMB_CONFIG['ttf_directory'] = 'c:/windows/fonts'; - - -// * MySQL configuration -// You may want to pull data from a database rather than a physical file -// If so, modify the $PHPTHUMB_CONFIG['mysql_query'] line to suit your database structure -// Note: the data retrieved must be the actual binary data of the image, not a URL or filename - -$PHPTHUMB_CONFIG['mysql_query'] = ''; -//$PHPTHUMB_CONFIG['mysql_query'] = 'SELECT `picture` FROM `products` WHERE (`id` = \''.mysql_escape_string(@$_GET['id']).'\')'; - -// These 4 values must be modified if $PHPTHUMB_CONFIG['mysql_query'] is not empty, but may be ignored if $PHPTHUMB_CONFIG['mysql_query'] is blank. -$PHPTHUMB_CONFIG['mysql_hostname'] = 'localhost'; -$PHPTHUMB_CONFIG['mysql_username'] = ''; -$PHPTHUMB_CONFIG['mysql_password'] = ''; -$PHPTHUMB_CONFIG['mysql_database'] = ''; - - -// * Security configuration -$PHPTHUMB_CONFIG['high_security_enabled'] = false; // if enabled, requires 'high_security_password' set to be set and requires the use of phpThumbURL() function (at the bottom of phpThumb.config.php) to generate hashed URLs -$PHPTHUMB_CONFIG['high_security_password'] = ''; // required if 'high_security_enabled' is true, and must be at complex (uppercase, lowercase, numbers, punctuation, etc -- punctuation is strongest, lowercase is weakest; see PasswordStrength() in phpThumb.php). You can use a password generator like http://silisoftware.com/tools/password-random.php to generate a strong password -$PHPTHUMB_CONFIG['disable_debug'] = true; // prevent phpThumb from displaying any information about your system. If true, phpThumbDebug and error messages will be disabled -$PHPTHUMB_CONFIG['allow_src_above_docroot'] = false; // if true, allow src to be anywhere in filesystem; if false (default) only allow src within document_root -$PHPTHUMB_CONFIG['allow_src_above_phpthumb'] = true; // if true (default), allow src to be anywhere in filesystem; if false only allow src within sub-directory of phpThumb installation - - -// * HTTP UserAgent configuration -//$PHPTHUMB_CONFIG['http_user_agent'] = ''; // PHP default: none -//$PHPTHUMB_CONFIG['http_user_agent'] = 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)'; // Windows XP, Internet Explorer -$PHPTHUMB_CONFIG['http_user_agent'] = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7'; // Windows XP, Firefox - - -// * Compatability settings -$PHPTHUMB_CONFIG['disable_pathinfo_parsing'] = false; // if true, $_SERVER[PATH_INFO] is not parsed. May be needed on some server configurations to allow normal behavior. -$PHPTHUMB_CONFIG['disable_imagecopyresampled'] = false; // if true, ImageCopyResampled is replaced with ImageCopyResampleBicubic. May be needed for buggy versions of PHP-GD. -$PHPTHUMB_CONFIG['disable_onlycreateable_passthru'] = true; // if true, any image that can be parsed by GetImageSize() can be passed through; if false, only images that can be converted to GD by ImageCreateFrom(JPEG|GIF|PNG) functions are allowed - - -// * HTTP remote file opening settings -$PHPTHUMB_CONFIG['http_fopen_timeout'] = 10; // timeout (in seconds) for fopen / curl / fsockopen -$PHPTHUMB_CONFIG['http_follow_redirect'] = true; // if true (default), follow "302 Found" redirects to new URL; if false, return error message - - -// * Speed optimizations configuration -$PHPTHUMB_CONFIG['use_exif_thumbnail_for_speed'] = false; // If true, and EXIF thumbnail is available, and is larger or equal to output image dimensions, use EXIF thumbnail rather than actual source image for generating thumbnail. Benefit is only speed, avoiding resizing large image. -$PHPTHUMB_CONFIG['allow_local_http_src'] = false; // If true, 'src' parameter can be "http:///path/image.ext" instead of just "/path/image.ext"; if false then display warning message to encourage more efficient local-filename calling. - -// END USER CONFIGURATION SECTION - -/////////////////////////////////////////////////////////////////////////////// - -// START DEFAULT PARAMETERS SECTION -// If any parameters are constant across ALL images, you can set them here - -$PHPTHUMB_DEFAULTS_GETSTRINGOVERRIDE = true; // if true, any parameters in the URL will override the defaults set here; if false, any parameters set here cannot be overridden in the URL -$PHPTHUMB_DEFAULTS_DISABLEGETPARAMS = false; // if true, GETstring parameters will be ignored (except for 'src') and only below default parameters will be used; if false, both default and GETstring parameters will be used (depending on $PHPTHUMB_DEFAULTS_GETSTRINGOVERRIDE). Will be auto-set true if !empty($PHPTHUMB_CONFIG['cache_default_only_suffix']) - -//$PHPTHUMB_DEFAULTS['w'] = 200; -//$PHPTHUMB_DEFAULTS['fltr'] = array('blur|10'); -//$PHPTHUMB_DEFAULTS['q'] = 90; - - -// END DEFAULT PARAMETERS SECTION - - - -/////////////////////////////////////////////////////////////////////////////// -// Function for generating hashed calls to phpThumb if 'high_security_enabled' -// example: -// require_once($_SERVER['DOCUMENT_ROOT'].'/phpThumb/phpThumb.config.php'); -// echo ''; - -function phpThumbURL($ParameterString) { - global $PHPTHUMB_CONFIG; - return str_replace(@$PHPTHUMB_CONFIG['document_root'], '', dirname(__FILE__)).DIRECTORY_SEPARATOR.'phpThumb.php?'.$ParameterString.'&hash='.md5($ParameterString.@$PHPTHUMB_CONFIG['high_security_password']); -} - -/////////////////////////////////////////////////////////////////////////////// - -?> \ No newline at end of file From 43a0d681688770ed64d6dd9d39d5487332b651fc Mon Sep 17 00:00:00 2001 From: Dmi3yy Date: Mon, 26 Aug 2013 18:20:31 +0300 Subject: [PATCH 361/530] fix MODX to MODX Evolution after install --- install/setup.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/setup.sql b/install/setup.sql index 5b384dd305..b2f5e9abaf 100755 --- a/install/setup.sql +++ b/install/setup.sql @@ -772,7 +772,7 @@ REPLACE INTO `{PREFIX}site_templates` # Default Site Documents -REPLACE INTO `{PREFIX}site_content` VALUES (1,'document','text/html','MODX CMS Install Success','Welcome to the MODX Content Management System','','minimal-base','',1,0,0,0,0,'','

    Install Successful!

    \r\n

    You have successfully installed MODX.

    \r\n\r\n

    Getting Help

    \r\n

    The MODX Community provides a great starting point to learn all things MODX, or you can also see some great learning resources (books, tutorials, blogs and screencasts).

    \r\n

    Welcome to MODX!

    \r\n',1,3,0,1,1,1,1130304721,1,1130304927,0,0,0,1130304721,1,'Base Install',0,0,0,0,0,0,0); +REPLACE INTO `{PREFIX}site_content` VALUES (1,'document','text/html','MODX CMS Install Success','Welcome to the MODX Content Management System','','minimal-base','',1,0,0,0,0,'','

    Install Successful!

    \r\n

    You have successfully installed MODX Evolution.

    \r\n\r\n

    Getting Help

    \r\n

    The MODX Community provides a great starting point to learn all things MODX Evolution, or you can also see some great learning resources (books, tutorials, blogs and screencasts).

    \r\n

    Welcome to MODX!

    \r\n',1,3,0,1,1,1,1130304721,1,1130304927,0,0,0,1130304721,1,'Base Install',0,0,0,0,0,0,0); REPLACE INTO `{PREFIX}manager_users` From de3bb70b847460965f38292f55f7020ce9717dde Mon Sep 17 00:00:00 2001 From: Dmi3yy Date: Mon, 26 Aug 2013 18:23:50 +0300 Subject: [PATCH 362/530] some fix in russian lang --- manager/includes/lang/russian-UTF8.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manager/includes/lang/russian-UTF8.inc.php b/manager/includes/lang/russian-UTF8.inc.php index 0ad3eb82ba..18c5e1fe37 100755 --- a/manager/includes/lang/russian-UTF8.inc.php +++ b/manager/includes/lang/russian-UTF8.inc.php @@ -91,7 +91,7 @@ $_lang["change_password_confirm"] = 'Подтвердить пароль'; $_lang["change_password_message"] = 'Введите новый пароль, затем введите его еще раз для подтверждения. Длина пароля должна составлять от 6 до 15 символов.'; $_lang["change_password_new"] = 'Новый пароль'; -$_lang["charset_message"] = 'Выберите кодировку страниц сайта. Помните, что MODX тестировался не на всех кодировках. Для большинства языков подходит кодировка ISO-8859-1.'; +$_lang["charset_message"] = 'Выберите кодировку страниц сайта. Помните, что MODX тестировался не на всех кодировках. Для большинства языков подходит кодировка UTF-8.'; $_lang["charset_title"] = 'Кодировка:'; $_lang["chunk"] = 'Чанк (HTML-элемент шаблона)'; $_lang["chunk_code"] = 'Код чанка (HTML)'; From f7058d4931402b5936d2e58bd2b5f3876fcc4466 Mon Sep 17 00:00:00 2001 From: Dmi3yy Date: Mon, 26 Aug 2013 18:32:49 +0300 Subject: [PATCH 363/530] fix tpl --- assets/templates/modxhost/modxhost.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/templates/modxhost/modxhost.tpl b/assets/templates/modxhost/modxhost.tpl index cc9b610245..40f0ee93f6 100755 --- a/assets/templates/modxhost/modxhost.tpl +++ b/assets/templates/modxhost/modxhost.tpl @@ -1 +1 @@ - [(site_name)] | [*pagetitle*]

    [*longtitle*]

    [*#content*]

    \ No newline at end of file + [(site_name)] | [*pagetitle*]

    [*longtitle*]

    [*#content*]

    \ No newline at end of file From fad2f3dae5f822bd616ee7627813ee6332e68468 Mon Sep 17 00:00:00 2001 From: Dmi3yy Date: Mon, 26 Aug 2013 18:35:47 +0300 Subject: [PATCH 364/530] small fix --- assets/snippets/breadcrumbs/snippet.breadcrumbs.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/snippets/breadcrumbs/snippet.breadcrumbs.php b/assets/snippets/breadcrumbs/snippet.breadcrumbs.php index 0a2046d1dc..74660b2aef 100644 --- a/assets/snippets/breadcrumbs/snippet.breadcrumbs.php +++ b/assets/snippets/breadcrumbs/snippet.breadcrumbs.php @@ -4,7 +4,7 @@ ( isset($pathThruUnPub) ) ? $pathThruUnPub : $pathThruUnPub = 1; ( isset($respectHidemenu) ) ? (int)$respectHidemenu : $respectHidemenu = 1; ( isset($showCurrentCrumb) ) ? $showCurrentCrumb : $showCurrentCrumb = 1; -( $currentAsLink ) ? $currentAsLink : $currentAsLink = 0; +( isset($currentAsLink) ) ? $currentAsLink : $currentAsLink = 0; ( isset($linkTextField) ) ? $linkTextField : $linkTextField = 'menutitle,pagetitle,longtitle'; ( isset($linkDescField) ) ? $linkDescField : $linkDescField = 'description,longtitle,pagetitle,menutitle'; ( isset($showCrumbsAsLinks) ) ? $showCrumbsAsLinks : $showCrumbsAsLinks = 1; From c52fd00005fc171497c2f0183cfa4fa030105989 Mon Sep 17 00:00:00 2001 From: Dmi3yy Date: Mon, 26 Aug 2013 18:36:43 +0300 Subject: [PATCH 365/530] small fix --- .../snippets/firstchildredirect/snippet.firstchildredirect.php | 1 - 1 file changed, 1 deletion(-) diff --git a/assets/snippets/firstchildredirect/snippet.firstchildredirect.php b/assets/snippets/firstchildredirect/snippet.firstchildredirect.php index f7c8e4e5a3..9cdff123a4 100644 --- a/assets/snippets/firstchildredirect/snippet.firstchildredirect.php +++ b/assets/snippets/firstchildredirect/snippet.firstchildredirect.php @@ -29,6 +29,5 @@ } else { $firstChildUrl= $modx->makeUrl($modx->config['site_start']); } -// return $modx->sendRedirect($firstChildUrl); return $modx->sendRedirect($firstChildUrl,0,'REDIRECT_HEADER','HTTP/1.1 301 Moved Permanently'); ?> \ No newline at end of file From f97cde6e0bf37bdc005def31c1a112f520ad7c8b Mon Sep 17 00:00:00 2001 From: Dmi3yy Date: Mon, 26 Aug 2013 18:42:18 +0300 Subject: [PATCH 366/530] fix floater in MODxRE --- manager/media/style/MODxRE/style.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manager/media/style/MODxRE/style.css b/manager/media/style/MODxRE/style.css index 6ae8cd447f..d11d2570a7 100644 --- a/manager/media/style/MODxRE/style.css +++ b/manager/media/style/MODxRE/style.css @@ -649,10 +649,10 @@ div.treeframebody { #floater { display: none; position: absolute; - width: 200px; + width: auto; padding:5px; top: 25px; - left: 4px; + left: 0px; background: #fff; border: 1px solid #ccc; z-index: 500; From b655f5f781fc4be3b89902ae36a62508aa24d195 Mon Sep 17 00:00:00 2001 From: yama Date: Tue, 27 Aug 2013 09:43:39 +0900 Subject: [PATCH 367/530] Fix - Backup manager --- manager/actions/bkmanager.static.php | 62 ++++++++++++++++++++-------- 1 file changed, 44 insertions(+), 18 deletions(-) diff --git a/manager/actions/bkmanager.static.php b/manager/actions/bkmanager.static.php index e7444ab43e..2a3d62b346 100644 --- a/manager/actions/bkmanager.static.php +++ b/manager/actions/bkmanager.static.php @@ -63,7 +63,7 @@ $dumper = new Mysqldumper($database_server, $database_user, $database_password, $dbase); $dumper->setDBtables($tables); $dumper->setDroptables((isset($_POST['droptables']) ? true : false)); - $dumpfinished = $dumper->createDump('callBack'); + $dumpfinished = $dumper->createDump('dumpSql'); if($dumpfinished) { exit; @@ -84,7 +84,7 @@ mkdir(rtrim($modx->config['snapshot_path'],'/')); @chmod(rtrim($modx->config['snapshot_path'],'/'), 0777); } - if(!file_exists("{$modx->config['snapshot_path']}.htaccess")) + if(!is_file("{$modx->config['snapshot_path']}.htaccess")) { $htaccess = "order deny,allow\ndeny from all\n"; file_put_contents("{$modx->config['snapshot_path']}.htaccess",$htaccess); @@ -478,6 +478,7 @@ function createDump($callBack) { // Set line feed $lf = "\n"; + $tempfile_path = $modx->config['base_path'] . 'temp/backup/temp.php'; $result = $modx->db->query('SHOW TABLES'); $tables = $this->result2Array(0, $result); @@ -496,6 +497,8 @@ function createDump($callBack) { $output .= "# PHP Version: " . phpversion() . $lf; $output .= "# Database : `{$this->dbname}`{$lf}"; $output .= "#"; + file_put_contents($tempfile_path, $output, FILE_APPEND | LOCK_EX); + $output = ''; // Generate dumptext for the tables. if (isset($this->_dbtables) && count($this->_dbtables)) { @@ -510,6 +513,16 @@ function createDump($callBack) { continue; } } + if($callBack==='snapshot') + { + switch($tblval) + { + case $table_prefix.'event_log': + case $table_prefix.'manager_log': + continue 2; + } + if(!preg_match('@^'.$table_prefix.'@', $tblval)) continue; + } $output .= "{$lf}{$lf}# --------------------------------------------------------{$lf}{$lf}"; $output .= "#{$lf}# Table structure for table `{$tblval}`{$lf}"; $output .= "#{$lf}{$lf}"; @@ -532,14 +545,28 @@ function createDump($callBack) { $insertdump .= "'$value',"; } $output .= rtrim($insertdump,',') . ");"; + if(1048576 < strlen($output)) + { + file_put_contents($tempfile_path, $output, FILE_APPEND | LOCK_EX); + $output = ''; + } } - // invoke callback -- raymond - if ($callBack) { - if (!$callBack($output)) break; - $output = ''; - } + file_put_contents($tempfile_path, $output, FILE_APPEND | LOCK_EX); + $output = ''; } - return ($callBack) ? true: $output; + $output = file_get_contents($tempfile_path); + if(!empty($output)) unlink($tempfile_path); + + switch($callBack) + { + case 'dumpSql': + dumpSql($output); + break; + case 'snapshot': + snapshot($output); + break; + } + return true; } // Private function object2Array. @@ -585,19 +612,18 @@ function import_sql($source,$result_code='import_ok') { global $modx,$e; - $tbl_active_users = $modx->getFullTableName('active_users'); - $rs = $modx->db->select('*',$tbl_active_users,"action='27'"); + $rs = $modx->db->select('*','[+prefix+]active_users',"action='27'"); if(0 < $modx->db->getRecordCount($rs)) { - echo ''. - ''. - ''; + include_once "header.inc.php"; // start normal header + $e->setError(5, 'Resource is edit now by any user'); + $e->dumpError(); exit; } $settings = getSettings(); - $source = str_replace(array("\r\n","\n","\r"),"\n",$source); + if(strpos($source, "\r")!==false) $source = str_replace(array("\r\n","\n","\r"),"\n",$source); $sql_array = preg_split('@;[ \t]*\n@', $source); foreach($sql_array as $sql_entry) { @@ -624,11 +650,13 @@ function callBack(&$dumpstring) { $today = $modx->toDateFormat(time(),'dateOnly'); $today = str_replace('/', '-', $today); $today = strtolower($today); + $size = strlen($dumpstring); if(!headers_sent()) { header('Expires: 0'); header('Cache-Control: private'); header('Pragma: cache'); header('Content-type: application/download'); + header("Content-Length: {$size}"); header("Content-Disposition: attachment; filename={$today}_database_backup.sql"); } echo $dumpstring; @@ -645,8 +673,7 @@ function getSettings() { global $modx; - $tbl_system_settings = $modx->getFullTableName('system_settings'); - $rs = $modx->db->select('setting_name, setting_value',$tbl_system_settings); + $rs = $modx->db->select('setting_name, setting_value','[+prefix+]system_settings'); $settings = array(); while ($row = $modx->db->getRow($rs)) @@ -668,10 +695,9 @@ function restoreSettings($settings) { global $modx; - $tbl_system_settings = $modx->getFullTableName('system_settings'); foreach($settings as $k=>$v) { - $modx->db->update(array('setting_value'=>$v),$tbl_system_settings,"setting_name='{$k}'"); + $modx->db->update(array('setting_value'=>$v),'[+prefix+]system_settings',"setting_name='{$k}'"); } } From 7f025b855c2025cae3055c7ddfba33cbe727cde2 Mon Sep 17 00:00:00 2001 From: yama Date: Tue, 27 Aug 2013 09:43:54 +0900 Subject: [PATCH 368/530] Small fix --- manager/actions/eventlog.dynamic.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manager/actions/eventlog.dynamic.php b/manager/actions/eventlog.dynamic.php index f62c883d4b..432eb1ce6f 100644 --- a/manager/actions/eventlog.dynamic.php +++ b/manager/actions/eventlog.dynamic.php @@ -35,9 +35,9 @@ // context menu include_once MODX_MANAGER_PATH."includes/controls/contextmenu.php"; $cm = new ContextMenu("cntxm", 150); -$cm->addItem($_lang['view_log'],"js:menuAction(1)","media/style/" . $manager_theme ."images/icons/save.png"); +$cm->addItem($_lang['view_log'],"js:menuAction(1)",$_style['icons_save']); $cm->addSeparator(); -$cm->addItem($_lang['delete'], "js:menuAction(2)","media/style/" . $manager_theme ."images/icons/delete.png",(!$modx->hasPermission('delete_eventlog') ? 1:0)); +$cm->addItem($_lang['delete'], "js:menuAction(2)",$_style['icons_delete'],(!$modx->hasPermission('delete_eventlog') ? 1:0)); echo $cm->render(); ?> From e7da9523b93f476003139459782c4867fa5ddfee Mon Sep 17 00:00:00 2001 From: yama Date: Tue, 27 Aug 2013 13:05:46 +0900 Subject: [PATCH 369/530] Missing jquery path --- assets/js/{jquery-1.4.4.min.js => jquery.min.js} | 0 assets/snippets/ajaxSearch/configs/default.config.php | 2 +- install/action.options.php | 4 ++-- install/assets/plugins/mgrmgr.tpl | 2 +- install/assets/plugins/qm.tpl | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) rename assets/js/{jquery-1.4.4.min.js => jquery.min.js} (100%) diff --git a/assets/js/jquery-1.4.4.min.js b/assets/js/jquery.min.js similarity index 100% rename from assets/js/jquery-1.4.4.min.js rename to assets/js/jquery.min.js diff --git a/assets/snippets/ajaxSearch/configs/default.config.php b/assets/snippets/ajaxSearch/configs/default.config.php index 53394a92ec..c46755a286 100755 --- a/assets/snippets/ajaxSearch/configs/default.config.php +++ b/assets/snippets/ajaxSearch/configs/default.config.php @@ -75,7 +75,7 @@ $dcfg['addJscript'] = 1; $dcfg['jsMooTools'] = MODX_MANAGER_URL.'/media/script/mootools/mootools.js'; $dcfg['jsMooTools2'] = AS_SPATH . 'js/mootools2/mootools-1.2.4.js'; -$dcfg['jsJquery'] = 'assets/js/jquery-1.4.4.min.js'; +$dcfg['jsJquery'] = 'assets/js/jquery.min.js'; // For a global parameter initialisation use the following syntax $__param = 'value'; // To overwrite parameter snippet call use $param = 'value'; diff --git a/install/action.options.php b/install/action.options.php index 862090fa20..51054a661d 100644 --- a/install/action.options.php +++ b/install/action.options.php @@ -198,9 +198,9 @@

    - +

    [*longtitle*]

    [*#content*]

    \ No newline at end of file + [(site_name)] | [*pagetitle*]

    [*longtitle*]

    [*#content*]

    \ No newline at end of file From a542502f73b88eae3d467626e3daef2454ad295a Mon Sep 17 00:00:00 2001 From: yama Date: Tue, 27 Aug 2013 13:11:58 +0900 Subject: [PATCH 372/530] Refactor #10131 Update jQuery version (1.4.4 -> 1.8.3) http://tracker.modx.com/issues/10131 --- assets/js/jquery.min.js | 169 +--------------------------------------- 1 file changed, 2 insertions(+), 167 deletions(-) diff --git a/assets/js/jquery.min.js b/assets/js/jquery.min.js index 8f3ca2e2da..3883779527 100644 --- a/assets/js/jquery.min.js +++ b/assets/js/jquery.min.js @@ -1,167 +1,2 @@ -/*! - * jQuery JavaScript Library v1.4.4 - * http://jquery.com/ - * - * Copyright 2010, John Resig - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * Includes Sizzle.js - * http://sizzlejs.com/ - * Copyright 2010, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * - * Date: Thu Nov 11 19:04:53 2010 -0500 - */ -(function(E,B){function ka(a,b,d){if(d===B&&a.nodeType===1){d=a.getAttribute("data-"+b);if(typeof d==="string"){try{d=d==="true"?true:d==="false"?false:d==="null"?null:!c.isNaN(d)?parseFloat(d):Ja.test(d)?c.parseJSON(d):d}catch(e){}c.data(a,b,d)}else d=B}return d}function U(){return false}function ca(){return true}function la(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function Ka(a){var b,d,e,f,h,l,k,o,x,r,A,C=[];f=[];h=c.data(this,this.nodeType?"events":"__events__");if(typeof h==="function")h= -h.events;if(!(a.liveFired===this||!h||!h.live||a.button&&a.type==="click")){if(a.namespace)A=RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)");a.liveFired=this;var J=h.live.slice(0);for(k=0;kd)break;a.currentTarget=f.elem;a.data=f.handleObj.data;a.handleObj=f.handleObj;A=f.handleObj.origHandler.apply(f.elem,arguments);if(A===false||a.isPropagationStopped()){d=f.level;if(A===false)b=false;if(a.isImmediatePropagationStopped())break}}return b}}function Y(a,b){return(a&&a!=="*"?a+".":"")+b.replace(La, -"`").replace(Ma,"&")}function ma(a,b,d){if(c.isFunction(b))return c.grep(a,function(f,h){return!!b.call(f,h,f)===d});else if(b.nodeType)return c.grep(a,function(f){return f===b===d});else if(typeof b==="string"){var e=c.grep(a,function(f){return f.nodeType===1});if(Na.test(b))return c.filter(b,e,!d);else b=c.filter(b,e)}return c.grep(a,function(f){return c.inArray(f,b)>=0===d})}function na(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var e=c.data(a[d++]),f=c.data(this, -e);if(e=e&&e.events){delete f.handle;f.events={};for(var h in e)for(var l in e[h])c.event.add(this,h,e[h][l],e[h][l].data)}}})}function Oa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function oa(a,b,d){var e=b==="width"?a.offsetWidth:a.offsetHeight;if(d==="border")return e;c.each(b==="width"?Pa:Qa,function(){d||(e-=parseFloat(c.css(a,"padding"+this))||0);if(d==="margin")e+=parseFloat(c.css(a, -"margin"+this))||0;else e-=parseFloat(c.css(a,"border"+this+"Width"))||0});return e}function da(a,b,d,e){if(c.isArray(b)&&b.length)c.each(b,function(f,h){d||Ra.test(a)?e(a,h):da(a+"["+(typeof h==="object"||c.isArray(h)?f:"")+"]",h,d,e)});else if(!d&&b!=null&&typeof b==="object")c.isEmptyObject(b)?e(a,""):c.each(b,function(f,h){da(a+"["+f+"]",h,d,e)});else e(a,b)}function S(a,b){var d={};c.each(pa.concat.apply([],pa.slice(0,b)),function(){d[this]=a});return d}function qa(a){if(!ea[a]){var b=c("<"+ -a+">").appendTo("body"),d=b.css("display");b.remove();if(d==="none"||d==="")d="block";ea[a]=d}return ea[a]}function fa(a){return c.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var t=E.document,c=function(){function a(){if(!b.isReady){try{t.documentElement.doScroll("left")}catch(j){setTimeout(a,1);return}b.ready()}}var b=function(j,s){return new b.fn.init(j,s)},d=E.jQuery,e=E.$,f,h=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,l=/\S/,k=/^\s+/,o=/\s+$/,x=/\W/,r=/\d/,A=/^<(\w+)\s*\/?>(?:<\/\1>)?$/, -C=/^[\],:{}\s]*$/,J=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,w=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,I=/(?:^|:|,)(?:\s*\[)+/g,L=/(webkit)[ \/]([\w.]+)/,g=/(opera)(?:.*version)?[ \/]([\w.]+)/,i=/(msie) ([\w.]+)/,n=/(mozilla)(?:.*? rv:([\w.]+))?/,m=navigator.userAgent,p=false,q=[],u,y=Object.prototype.toString,F=Object.prototype.hasOwnProperty,M=Array.prototype.push,N=Array.prototype.slice,O=String.prototype.trim,D=Array.prototype.indexOf,R={};b.fn=b.prototype={init:function(j, -s){var v,z,H;if(!j)return this;if(j.nodeType){this.context=this[0]=j;this.length=1;return this}if(j==="body"&&!s&&t.body){this.context=t;this[0]=t.body;this.selector="body";this.length=1;return this}if(typeof j==="string")if((v=h.exec(j))&&(v[1]||!s))if(v[1]){H=s?s.ownerDocument||s:t;if(z=A.exec(j))if(b.isPlainObject(s)){j=[t.createElement(z[1])];b.fn.attr.call(j,s,true)}else j=[H.createElement(z[1])];else{z=b.buildFragment([v[1]],[H]);j=(z.cacheable?z.fragment.cloneNode(true):z.fragment).childNodes}return b.merge(this, -j)}else{if((z=t.getElementById(v[2]))&&z.parentNode){if(z.id!==v[2])return f.find(j);this.length=1;this[0]=z}this.context=t;this.selector=j;return this}else if(!s&&!x.test(j)){this.selector=j;this.context=t;j=t.getElementsByTagName(j);return b.merge(this,j)}else return!s||s.jquery?(s||f).find(j):b(s).find(j);else if(b.isFunction(j))return f.ready(j);if(j.selector!==B){this.selector=j.selector;this.context=j.context}return b.makeArray(j,this)},selector:"",jquery:"1.4.4",length:0,size:function(){return this.length}, -toArray:function(){return N.call(this,0)},get:function(j){return j==null?this.toArray():j<0?this.slice(j)[0]:this[j]},pushStack:function(j,s,v){var z=b();b.isArray(j)?M.apply(z,j):b.merge(z,j);z.prevObject=this;z.context=this.context;if(s==="find")z.selector=this.selector+(this.selector?" ":"")+v;else if(s)z.selector=this.selector+"."+s+"("+v+")";return z},each:function(j,s){return b.each(this,j,s)},ready:function(j){b.bindReady();if(b.isReady)j.call(t,b);else q&&q.push(j);return this},eq:function(j){return j=== --1?this.slice(j):this.slice(j,+j+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(N.apply(this,arguments),"slice",N.call(arguments).join(","))},map:function(j){return this.pushStack(b.map(this,function(s,v){return j.call(s,v,s)}))},end:function(){return this.prevObject||b(null)},push:M,sort:[].sort,splice:[].splice};b.fn.init.prototype=b.fn;b.extend=b.fn.extend=function(){var j,s,v,z,H,G=arguments[0]||{},K=1,Q=arguments.length,ga=false; -if(typeof G==="boolean"){ga=G;G=arguments[1]||{};K=2}if(typeof G!=="object"&&!b.isFunction(G))G={};if(Q===K){G=this;--K}for(;K0))if(q){var s=0,v=q;for(q=null;j=v[s++];)j.call(t,b);b.fn.trigger&&b(t).trigger("ready").unbind("ready")}}},bindReady:function(){if(!p){p=true;if(t.readyState==="complete")return setTimeout(b.ready,1);if(t.addEventListener){t.addEventListener("DOMContentLoaded",u,false);E.addEventListener("load",b.ready,false)}else if(t.attachEvent){t.attachEvent("onreadystatechange",u);E.attachEvent("onload", -b.ready);var j=false;try{j=E.frameElement==null}catch(s){}t.documentElement.doScroll&&j&&a()}}},isFunction:function(j){return b.type(j)==="function"},isArray:Array.isArray||function(j){return b.type(j)==="array"},isWindow:function(j){return j&&typeof j==="object"&&"setInterval"in j},isNaN:function(j){return j==null||!r.test(j)||isNaN(j)},type:function(j){return j==null?String(j):R[y.call(j)]||"object"},isPlainObject:function(j){if(!j||b.type(j)!=="object"||j.nodeType||b.isWindow(j))return false;if(j.constructor&& -!F.call(j,"constructor")&&!F.call(j.constructor.prototype,"isPrototypeOf"))return false;for(var s in j);return s===B||F.call(j,s)},isEmptyObject:function(j){for(var s in j)return false;return true},error:function(j){throw j;},parseJSON:function(j){if(typeof j!=="string"||!j)return null;j=b.trim(j);if(C.test(j.replace(J,"@").replace(w,"]").replace(I,"")))return E.JSON&&E.JSON.parse?E.JSON.parse(j):(new Function("return "+j))();else b.error("Invalid JSON: "+j)},noop:function(){},globalEval:function(j){if(j&& -l.test(j)){var s=t.getElementsByTagName("head")[0]||t.documentElement,v=t.createElement("script");v.type="text/javascript";if(b.support.scriptEval)v.appendChild(t.createTextNode(j));else v.text=j;s.insertBefore(v,s.firstChild);s.removeChild(v)}},nodeName:function(j,s){return j.nodeName&&j.nodeName.toUpperCase()===s.toUpperCase()},each:function(j,s,v){var z,H=0,G=j.length,K=G===B||b.isFunction(j);if(v)if(K)for(z in j){if(s.apply(j[z],v)===false)break}else for(;H
    a";var f=d.getElementsByTagName("*"),h=d.getElementsByTagName("a")[0],l=t.createElement("select"), -k=l.appendChild(t.createElement("option"));if(!(!f||!f.length||!h)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(h.getAttribute("style")),hrefNormalized:h.getAttribute("href")==="/a",opacity:/^0.55$/.test(h.style.opacity),cssFloat:!!h.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:k.selected,deleteExpando:true,optDisabled:false,checkClone:false, -scriptEval:false,noCloneEvent:true,boxModel:null,inlineBlockNeedsLayout:false,shrinkWrapBlocks:false,reliableHiddenOffsets:true};l.disabled=true;c.support.optDisabled=!k.disabled;b.type="text/javascript";try{b.appendChild(t.createTextNode("window."+e+"=1;"))}catch(o){}a.insertBefore(b,a.firstChild);if(E[e]){c.support.scriptEval=true;delete E[e]}try{delete b.test}catch(x){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function r(){c.support.noCloneEvent= -false;d.detachEvent("onclick",r)});d.cloneNode(true).fireEvent("onclick")}d=t.createElement("div");d.innerHTML="";a=t.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var r=t.createElement("div");r.style.width=r.style.paddingLeft="1px";t.body.appendChild(r);c.boxModel=c.support.boxModel=r.offsetWidth===2;if("zoom"in r.style){r.style.display="inline";r.style.zoom= -1;c.support.inlineBlockNeedsLayout=r.offsetWidth===2;r.style.display="";r.innerHTML="
    ";c.support.shrinkWrapBlocks=r.offsetWidth!==2}r.innerHTML="
    t
    ";var A=r.getElementsByTagName("td");c.support.reliableHiddenOffsets=A[0].offsetHeight===0;A[0].style.display="";A[1].style.display="none";c.support.reliableHiddenOffsets=c.support.reliableHiddenOffsets&&A[0].offsetHeight===0;r.innerHTML="";t.body.removeChild(r).style.display= -"none"});a=function(r){var A=t.createElement("div");r="on"+r;var C=r in A;if(!C){A.setAttribute(r,"return;");C=typeof A[r]==="function"}return C};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=f=h=null}})();var ra={},Ja=/^(?:\{.*\}|\[.*\])$/;c.extend({cache:{},uuid:0,expando:"jQuery"+c.now(),noData:{embed:true,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:true},data:function(a,b,d){if(c.acceptData(a)){a=a==E?ra:a;var e=a.nodeType,f=e?a[c.expando]:null,h= -c.cache;if(!(e&&!f&&typeof b==="string"&&d===B)){if(e)f||(a[c.expando]=f=++c.uuid);else h=a;if(typeof b==="object")if(e)h[f]=c.extend(h[f],b);else c.extend(h,b);else if(e&&!h[f])h[f]={};a=e?h[f]:h;if(d!==B)a[b]=d;return typeof b==="string"?a[b]:a}}},removeData:function(a,b){if(c.acceptData(a)){a=a==E?ra:a;var d=a.nodeType,e=d?a[c.expando]:a,f=c.cache,h=d?f[e]:e;if(b){if(h){delete h[b];d&&c.isEmptyObject(h)&&c.removeData(a)}}else if(d&&c.support.deleteExpando)delete a[c.expando];else if(a.removeAttribute)a.removeAttribute(c.expando); -else if(d)delete f[e];else for(var l in a)delete a[l]}},acceptData:function(a){if(a.nodeName){var b=c.noData[a.nodeName.toLowerCase()];if(b)return!(b===true||a.getAttribute("classid")!==b)}return true}});c.fn.extend({data:function(a,b){var d=null;if(typeof a==="undefined"){if(this.length){var e=this[0].attributes,f;d=c.data(this[0]);for(var h=0,l=e.length;h-1)return true;return false},val:function(a){if(!arguments.length){var b=this[0];if(b){if(c.nodeName(b,"option")){var d=b.attributes.value;return!d||d.specified?b.value:b.text}if(c.nodeName(b,"select")){var e=b.selectedIndex;d=[];var f=b.options;b=b.type==="select-one"; -if(e<0)return null;var h=b?e:0;for(e=b?e+1:f.length;h=0;else if(c.nodeName(this,"select")){var A=c.makeArray(r);c("option",this).each(function(){this.selected=c.inArray(c(this).val(),A)>=0});if(!A.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true}, -attr:function(a,b,d,e){if(!a||a.nodeType===3||a.nodeType===8)return B;if(e&&b in c.attrFn)return c(a)[b](d);e=a.nodeType!==1||!c.isXMLDoc(a);var f=d!==B;b=e&&c.props[b]||b;var h=Ta.test(b);if((b in a||a[b]!==B)&&e&&!h){if(f){b==="type"&&Ua.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed");if(d===null)a.nodeType===1&&a.removeAttribute(b);else a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&& -b.specified?b.value:Va.test(a.nodeName)||Wa.test(a.nodeName)&&a.href?0:B;return a[b]}if(!c.support.style&&e&&b==="style"){if(f)a.style.cssText=""+d;return a.style.cssText}f&&a.setAttribute(b,""+d);if(!a.attributes[b]&&a.hasAttribute&&!a.hasAttribute(b))return B;a=!c.support.hrefNormalized&&e&&h?a.getAttribute(b,2):a.getAttribute(b);return a===null?B:a}});var X=/\.(.*)$/,ia=/^(?:textarea|input|select)$/i,La=/\./g,Ma=/ /g,Xa=/[^\w\s.|`]/g,Ya=function(a){return a.replace(Xa,"\\$&")},ua={focusin:0,focusout:0}; -c.event={add:function(a,b,d,e){if(!(a.nodeType===3||a.nodeType===8)){if(c.isWindow(a)&&a!==E&&!a.frameElement)a=E;if(d===false)d=U;else if(!d)return;var f,h;if(d.handler){f=d;d=f.handler}if(!d.guid)d.guid=c.guid++;if(h=c.data(a)){var l=a.nodeType?"events":"__events__",k=h[l],o=h.handle;if(typeof k==="function"){o=k.handle;k=k.events}else if(!k){a.nodeType||(h[l]=h=function(){});h.events=k={}}if(!o)h.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem, -arguments):B};o.elem=a;b=b.split(" ");for(var x=0,r;l=b[x++];){h=f?c.extend({},f):{handler:d,data:e};if(l.indexOf(".")>-1){r=l.split(".");l=r.shift();h.namespace=r.slice(0).sort().join(".")}else{r=[];h.namespace=""}h.type=l;if(!h.guid)h.guid=d.guid;var A=k[l],C=c.event.special[l]||{};if(!A){A=k[l]=[];if(!C.setup||C.setup.call(a,e,r,o)===false)if(a.addEventListener)a.addEventListener(l,o,false);else a.attachEvent&&a.attachEvent("on"+l,o)}if(C.add){C.add.call(a,h);if(!h.handler.guid)h.handler.guid= -d.guid}A.push(h);c.event.global[l]=true}a=null}}},global:{},remove:function(a,b,d,e){if(!(a.nodeType===3||a.nodeType===8)){if(d===false)d=U;var f,h,l=0,k,o,x,r,A,C,J=a.nodeType?"events":"__events__",w=c.data(a),I=w&&w[J];if(w&&I){if(typeof I==="function"){w=I;I=I.events}if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(f in I)c.event.remove(a,f+b)}else{for(b=b.split(" ");f=b[l++];){r=f;k=f.indexOf(".")<0;o=[];if(!k){o=f.split(".");f=o.shift();x=RegExp("(^|\\.)"+ -c.map(o.slice(0).sort(),Ya).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(A=I[f])if(d){r=c.event.special[f]||{};for(h=e||0;h=0){a.type=f=f.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[f]&&c.each(c.cache,function(){this.events&&this.events[f]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType=== -8)return B;a.result=B;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(e=d.nodeType?c.data(d,"handle"):(c.data(d,"__events__")||{}).handle)&&e.apply(d,b);e=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+f]&&d["on"+f].apply(d,b)===false){a.result=false;a.preventDefault()}}catch(h){}if(!a.isPropagationStopped()&&e)c.event.trigger(a,b,e,true);else if(!a.isDefaultPrevented()){var l;e=a.target;var k=f.replace(X,""),o=c.nodeName(e,"a")&&k=== -"click",x=c.event.special[k]||{};if((!x._default||x._default.call(d,a)===false)&&!o&&!(e&&e.nodeName&&c.noData[e.nodeName.toLowerCase()])){try{if(e[k]){if(l=e["on"+k])e["on"+k]=null;c.event.triggered=true;e[k]()}}catch(r){}if(l)e["on"+k]=l;c.event.triggered=false}}},handle:function(a){var b,d,e,f;d=[];var h=c.makeArray(arguments);a=h[0]=c.event.fix(a||E.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive;if(!b){e=a.type.split(".");a.type=e.shift();d=e.slice(0).sort();e=RegExp("(^|\\.)"+ -d.join("\\.(?:.*\\.)?")+"(\\.|$)")}a.namespace=a.namespace||d.join(".");f=c.data(this,this.nodeType?"events":"__events__");if(typeof f==="function")f=f.events;d=(f||{})[a.type];if(f&&d){d=d.slice(0);f=0;for(var l=d.length;f-1?c.map(a.options,function(e){return e.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},Z=function(a,b){var d=a.target,e,f;if(!(!ia.test(d.nodeName)||d.readOnly)){e=c.data(d,"_change_data");f=xa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data",f);if(!(e===B||f===e))if(e!=null||f){a.type="change";a.liveFired= -B;return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:Z,beforedeactivate:Z,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return Z.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return Z.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a,"_change_data",xa(a))}},setup:function(){if(this.type=== -"file")return false;for(var a in V)c.event.add(this,a+".specialChange",V[a]);return ia.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return ia.test(this.nodeName)}};V=c.event.special.change.filters;V.focus=V.beforeactivate}t.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(e){e=c.event.fix(e);e.type=b;return c.event.trigger(e,null,e.target)}c.event.special[b]={setup:function(){ua[b]++===0&&t.addEventListener(a,d,true)},teardown:function(){--ua[b]=== -0&&t.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,e,f){if(typeof d==="object"){for(var h in d)this[b](h,e,d[h],f);return this}if(c.isFunction(e)||e===false){f=e;e=B}var l=b==="one"?c.proxy(f,function(o){c(this).unbind(o,l);return f.apply(this,arguments)}):f;if(d==="unload"&&b!=="one")this.one(d,e,f);else{h=0;for(var k=this.length;h0?this.bind(b,d,e):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});E.attachEvent&&!E.addEventListener&&c(E).bind("unload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}}); -(function(){function a(g,i,n,m,p,q){p=0;for(var u=m.length;p0){F=y;break}}y=y[g]}m[p]=F}}}var d=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e=0,f=Object.prototype.toString,h=false,l=true;[0,0].sort(function(){l=false;return 0});var k=function(g,i,n,m){n=n||[];var p=i=i||t;if(i.nodeType!==1&&i.nodeType!==9)return[];if(!g||typeof g!=="string")return n;var q,u,y,F,M,N=true,O=k.isXML(i),D=[],R=g;do{d.exec("");if(q=d.exec(R)){R=q[3];D.push(q[1]);if(q[2]){F=q[3]; -break}}}while(q);if(D.length>1&&x.exec(g))if(D.length===2&&o.relative[D[0]])u=L(D[0]+D[1],i);else for(u=o.relative[D[0]]?[i]:k(D.shift(),i);D.length;){g=D.shift();if(o.relative[g])g+=D.shift();u=L(g,u)}else{if(!m&&D.length>1&&i.nodeType===9&&!O&&o.match.ID.test(D[0])&&!o.match.ID.test(D[D.length-1])){q=k.find(D.shift(),i,O);i=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]}if(i){q=m?{expr:D.pop(),set:C(m)}:k.find(D.pop(),D.length===1&&(D[0]==="~"||D[0]==="+")&&i.parentNode?i.parentNode:i,O);u=q.expr?k.filter(q.expr, -q.set):q.set;if(D.length>0)y=C(u);else N=false;for(;D.length;){q=M=D.pop();if(o.relative[M])q=D.pop();else M="";if(q==null)q=i;o.relative[M](y,q,O)}}else y=[]}y||(y=u);y||k.error(M||g);if(f.call(y)==="[object Array]")if(N)if(i&&i.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&k.contains(i,y[g])))n.push(u[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&n.push(u[g]);else n.push.apply(n,y);else C(y,n);if(F){k(F,p,n,m);k.uniqueSort(n)}return n};k.uniqueSort=function(g){if(w){h= -l;g.sort(w);if(h)for(var i=1;i0};k.find=function(g,i,n){var m;if(!g)return[];for(var p=0,q=o.order.length;p":function(g,i){var n,m=typeof i==="string",p=0,q=g.length;if(m&&!/\W/.test(i))for(i=i.toLowerCase();p=0))n||m.push(u);else if(n)i[q]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()},CHILD:function(g){if(g[1]==="nth"){var i=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=i[1]+(i[2]||1)-0;g[3]=i[3]-0}g[0]=e++;return g},ATTR:function(g,i,n, -m,p,q){i=g[1].replace(/\\/g,"");if(!q&&o.attrMap[i])g[1]=o.attrMap[i];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,i,n,m,p){if(g[1]==="not")if((d.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,i);else{g=k.filter(g[3],i,n,true^p);n||m.push.apply(m,g);return false}else if(o.match.POS.test(g[0])||o.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled=== -true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,i,n){return!!k(n[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)},text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"=== -g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}},setFilters:{first:function(g,i){return i===0},last:function(g,i,n,m){return i===m.length-1},even:function(g,i){return i%2===0},odd:function(g,i){return i%2===1},lt:function(g,i,n){return in[3]-0},nth:function(g,i,n){return n[3]- -0===i},eq:function(g,i,n){return n[3]-0===i}},filter:{PSEUDO:function(g,i,n,m){var p=i[1],q=o.filters[p];if(q)return q(g,n,i,m);else if(p==="contains")return(g.textContent||g.innerText||k.getText([g])||"").indexOf(i[3])>=0;else if(p==="not"){i=i[3];n=0;for(m=i.length;n=0}},ID:function(g,i){return g.nodeType===1&&g.getAttribute("id")===i},TAG:function(g,i){return i==="*"&&g.nodeType===1||g.nodeName.toLowerCase()=== -i},CLASS:function(g,i){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(i)>-1},ATTR:function(g,i){var n=i[1];n=o.attrHandle[n]?o.attrHandle[n](g):g[n]!=null?g[n]:g.getAttribute(n);var m=n+"",p=i[2],q=i[4];return n==null?p==="!=":p==="="?m===q:p==="*="?m.indexOf(q)>=0:p==="~="?(" "+m+" ").indexOf(q)>=0:!q?m&&n!==false:p==="!="?m!==q:p==="^="?m.indexOf(q)===0:p==="$="?m.substr(m.length-q.length)===q:p==="|="?m===q||m.substr(0,q.length+1)===q+"-":false},POS:function(g,i,n,m){var p=o.setFilters[i[2]]; -if(p)return p(g,n,i,m)}}},x=o.match.POS,r=function(g,i){return"\\"+(i-0+1)},A;for(A in o.match){o.match[A]=RegExp(o.match[A].source+/(?![^\[]*\])(?![^\(]*\))/.source);o.leftMatch[A]=RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[A].source.replace(/\\(\d+)/g,r))}var C=function(g,i){g=Array.prototype.slice.call(g,0);if(i){i.push.apply(i,g);return i}return g};try{Array.prototype.slice.call(t.documentElement.childNodes,0)}catch(J){C=function(g,i){var n=0,m=i||[];if(f.call(g)==="[object Array]")Array.prototype.push.apply(m, -g);else if(typeof g.length==="number")for(var p=g.length;n";n.insertBefore(g,n.firstChild);if(t.getElementById(i)){o.find.ID=function(m,p,q){if(typeof p.getElementById!=="undefined"&&!q)return(p=p.getElementById(m[1]))?p.id===m[1]||typeof p.getAttributeNode!=="undefined"&&p.getAttributeNode("id").nodeValue===m[1]?[p]:B:[]};o.filter.ID=function(m,p){var q=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&q&&q.nodeValue===p}}n.removeChild(g); -n=g=null})();(function(){var g=t.createElement("div");g.appendChild(t.createComment(""));if(g.getElementsByTagName("*").length>0)o.find.TAG=function(i,n){var m=n.getElementsByTagName(i[1]);if(i[1]==="*"){for(var p=[],q=0;m[q];q++)m[q].nodeType===1&&p.push(m[q]);m=p}return m};g.innerHTML="";if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")o.attrHandle.href=function(i){return i.getAttribute("href",2)};g=null})();t.querySelectorAll&& -function(){var g=k,i=t.createElement("div");i.innerHTML="

    ";if(!(i.querySelectorAll&&i.querySelectorAll(".TEST").length===0)){k=function(m,p,q,u){p=p||t;m=m.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!u&&!k.isXML(p))if(p.nodeType===9)try{return C(p.querySelectorAll(m),q)}catch(y){}else if(p.nodeType===1&&p.nodeName.toLowerCase()!=="object"){var F=p.getAttribute("id"),M=F||"__sizzle__";F||p.setAttribute("id",M);try{return C(p.querySelectorAll("#"+M+" "+m),q)}catch(N){}finally{F|| -p.removeAttribute("id")}}return g(m,p,q,u)};for(var n in g)k[n]=g[n];i=null}}();(function(){var g=t.documentElement,i=g.matchesSelector||g.mozMatchesSelector||g.webkitMatchesSelector||g.msMatchesSelector,n=false;try{i.call(t.documentElement,"[test!='']:sizzle")}catch(m){n=true}if(i)k.matchesSelector=function(p,q){q=q.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(p))try{if(n||!o.match.PSEUDO.test(q)&&!/!=/.test(q))return i.call(p,q)}catch(u){}return k(q,null,null,[p]).length>0}})();(function(){var g= -t.createElement("div");g.innerHTML="
    ";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){o.order.splice(1,0,"CLASS");o.find.CLASS=function(i,n,m){if(typeof n.getElementsByClassName!=="undefined"&&!m)return n.getElementsByClassName(i[1])};g=null}}})();k.contains=t.documentElement.contains?function(g,i){return g!==i&&(g.contains?g.contains(i):true)}:t.documentElement.compareDocumentPosition? -function(g,i){return!!(g.compareDocumentPosition(i)&16)}:function(){return false};k.isXML=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false};var L=function(g,i){for(var n,m=[],p="",q=i.nodeType?[i]:i;n=o.match.PSEUDO.exec(g);){p+=n[0];g=g.replace(o.match.PSEUDO,"")}g=o.relative[g]?g+"*":g;n=0;for(var u=q.length;n0)for(var h=d;h0},closest:function(a,b){var d=[],e,f,h=this[0];if(c.isArray(a)){var l,k={},o=1;if(h&&a.length){e=0;for(f=a.length;e-1:c(h).is(e))d.push({selector:l,elem:h,level:o})}h= -h.parentNode;o++}}return d}l=cb.test(a)?c(a,b||this.context):null;e=0;for(f=this.length;e-1:c.find.matchesSelector(h,a)){d.push(h);break}else{h=h.parentNode;if(!h||!h.ownerDocument||h===b)break}d=d.length>1?c.unique(d):d;return this.pushStack(d,"closest",a)},index:function(a){if(!a||typeof a==="string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var d=typeof a==="string"?c(a,b||this.context): -c.makeArray(a),e=c.merge(this.get(),d);return this.pushStack(!d[0]||!d[0].parentNode||d[0].parentNode.nodeType===11||!e[0]||!e[0].parentNode||e[0].parentNode.nodeType===11?e:c.unique(e))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode",d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a, -2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a, -b){c.fn[a]=function(d,e){var f=c.map(this,b,d);Za.test(a)||(e=d);if(e&&typeof e==="string")f=c.filter(e,f);f=this.length>1?c.unique(f):f;if((this.length>1||ab.test(e))&&$a.test(a))f=f.reverse();return this.pushStack(f,a,bb.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return b.length===1?c.find.matchesSelector(b[0],a)?[b[0]]:[]:c.find.matches(a,b)},dir:function(a,b,d){var e=[];for(a=a[b];a&&a.nodeType!==9&&(d===B||a.nodeType!==1||!c(a).is(d));){a.nodeType===1&& -e.push(a);a=a[b]}return e},nth:function(a,b,d){b=b||1;for(var e=0;a;a=a[d])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var za=/ jQuery\d+="(?:\d+|null)"/g,$=/^\s+/,Aa=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Ba=/<([\w:]+)/,db=/\s]+\/)>/g,P={option:[1, -""],legend:[1,"
    ","
    "],thead:[1,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],col:[2,"","
    "],area:[1,"",""],_default:[0,"",""]};P.optgroup=P.option;P.tbody=P.tfoot=P.colgroup=P.caption=P.thead;P.th=P.td;if(!c.support.htmlSerialize)P._default=[1,"div
    ","
    "];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d= -c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==B)return this.empty().append((this[0]&&this[0].ownerDocument||t).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this}, -wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})}, -prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b, -this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,e;(e=this[d])!=null;d++)if(!a||c.filter(a,[e]).length){if(!b&&e.nodeType===1){c.cleanData(e.getElementsByTagName("*"));c.cleanData([e])}e.parentNode&&e.parentNode.removeChild(e)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild); -return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,e=this.ownerDocument;if(!d){d=e.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(za,"").replace(fb,'="$1">').replace($,"")],e)[0]}else return this.cloneNode(true)});if(a===true){na(this,b);na(this.find("*"),b.find("*"))}return b},html:function(a){if(a===B)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(za,""):null; -else if(typeof a==="string"&&!Ca.test(a)&&(c.support.leadingWhitespace||!$.test(a))&&!P[(Ba.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Aa,"<$1>");try{for(var b=0,d=this.length;b0||e.cacheable||this.length>1?h.cloneNode(true):h)}k.length&&c.each(k,Oa)}return this}});c.buildFragment=function(a,b,d){var e,f,h;b=b&&b[0]?b[0].ownerDocument||b[0]:t;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&b===t&&!Ca.test(a[0])&&(c.support.checkClone||!Da.test(a[0]))){f=true;if(h=c.fragments[a[0]])if(h!==1)e=h}if(!e){e=b.createDocumentFragment();c.clean(a,b,e,d)}if(f)c.fragments[a[0]]=h?e:1;return{fragment:e,cacheable:f}};c.fragments={};c.each({appendTo:"append", -prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var e=[];d=c(d);var f=this.length===1&&this[0].parentNode;if(f&&f.nodeType===11&&f.childNodes.length===1&&d.length===1){d[b](this[0]);return this}else{f=0;for(var h=d.length;f0?this.clone(true):this).get();c(d[f])[b](l);e=e.concat(l)}return this.pushStack(e,a,d.selector)}}});c.extend({clean:function(a,b,d,e){b=b||t;if(typeof b.createElement==="undefined")b=b.ownerDocument|| -b[0]&&b[0].ownerDocument||t;for(var f=[],h=0,l;(l=a[h])!=null;h++){if(typeof l==="number")l+="";if(l){if(typeof l==="string"&&!eb.test(l))l=b.createTextNode(l);else if(typeof l==="string"){l=l.replace(Aa,"<$1>");var k=(Ba.exec(l)||["",""])[1].toLowerCase(),o=P[k]||P._default,x=o[0],r=b.createElement("div");for(r.innerHTML=o[1]+l+o[2];x--;)r=r.lastChild;if(!c.support.tbody){x=db.test(l);k=k==="table"&&!x?r.firstChild&&r.firstChild.childNodes:o[1]===""&&!x?r.childNodes:[];for(o=k.length- -1;o>=0;--o)c.nodeName(k[o],"tbody")&&!k[o].childNodes.length&&k[o].parentNode.removeChild(k[o])}!c.support.leadingWhitespace&&$.test(l)&&r.insertBefore(b.createTextNode($.exec(l)[0]),r.firstChild);l=r.childNodes}if(l.nodeType)f.push(l);else f=c.merge(f,l)}}if(d)for(h=0;f[h];h++)if(e&&c.nodeName(f[h],"script")&&(!f[h].type||f[h].type.toLowerCase()==="text/javascript"))e.push(f[h].parentNode?f[h].parentNode.removeChild(f[h]):f[h]);else{f[h].nodeType===1&&f.splice.apply(f,[h+1,0].concat(c.makeArray(f[h].getElementsByTagName("script")))); -d.appendChild(f[h])}return f},cleanData:function(a){for(var b,d,e=c.cache,f=c.event.special,h=c.support.deleteExpando,l=0,k;(k=a[l])!=null;l++)if(!(k.nodeName&&c.noData[k.nodeName.toLowerCase()]))if(d=k[c.expando]){if((b=e[d])&&b.events)for(var o in b.events)f[o]?c.event.remove(k,o):c.removeEvent(k,o,b.handle);if(h)delete k[c.expando];else k.removeAttribute&&k.removeAttribute(c.expando);delete e[d]}}});var Ea=/alpha\([^)]*\)/i,gb=/opacity=([^)]*)/,hb=/-([a-z])/ig,ib=/([A-Z])/g,Fa=/^-?\d+(?:px)?$/i, -jb=/^-?\d/,kb={position:"absolute",visibility:"hidden",display:"block"},Pa=["Left","Right"],Qa=["Top","Bottom"],W,Ga,aa,lb=function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){if(arguments.length===2&&b===B)return this;return c.access(this,a,b,true,function(d,e,f){return f!==B?c.style(d,e,f):c.css(d,e)})};c.extend({cssHooks:{opacity:{get:function(a,b){if(b){var d=W(a,"opacity","opacity");return d===""?"1":d}else return a.style.opacity}}},cssNumber:{zIndex:true,fontWeight:true,opacity:true, -zoom:true,lineHeight:true},cssProps:{"float":c.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,d,e){if(!(!a||a.nodeType===3||a.nodeType===8||!a.style)){var f,h=c.camelCase(b),l=a.style,k=c.cssHooks[h];b=c.cssProps[h]||h;if(d!==B){if(!(typeof d==="number"&&isNaN(d)||d==null)){if(typeof d==="number"&&!c.cssNumber[h])d+="px";if(!k||!("set"in k)||(d=k.set(a,d))!==B)try{l[b]=d}catch(o){}}}else{if(k&&"get"in k&&(f=k.get(a,false,e))!==B)return f;return l[b]}}},css:function(a,b,d){var e,f=c.camelCase(b), -h=c.cssHooks[f];b=c.cssProps[f]||f;if(h&&"get"in h&&(e=h.get(a,true,d))!==B)return e;else if(W)return W(a,b,f)},swap:function(a,b,d){var e={},f;for(f in b){e[f]=a.style[f];a.style[f]=b[f]}d.call(a);for(f in b)a.style[f]=e[f]},camelCase:function(a){return a.replace(hb,lb)}});c.curCSS=c.css;c.each(["height","width"],function(a,b){c.cssHooks[b]={get:function(d,e,f){var h;if(e){if(d.offsetWidth!==0)h=oa(d,b,f);else c.swap(d,kb,function(){h=oa(d,b,f)});if(h<=0){h=W(d,b,b);if(h==="0px"&&aa)h=aa(d,b,b); -if(h!=null)return h===""||h==="auto"?"0px":h}if(h<0||h==null){h=d.style[b];return h===""||h==="auto"?"0px":h}return typeof h==="string"?h:h+"px"}},set:function(d,e){if(Fa.test(e)){e=parseFloat(e);if(e>=0)return e+"px"}else return e}}});if(!c.support.opacity)c.cssHooks.opacity={get:function(a,b){return gb.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var d=a.style;d.zoom=1;var e=c.isNaN(b)?"":"alpha(opacity="+b*100+")",f= -d.filter||"";d.filter=Ea.test(f)?f.replace(Ea,e):d.filter+" "+e}};if(t.defaultView&&t.defaultView.getComputedStyle)Ga=function(a,b,d){var e;d=d.replace(ib,"-$1").toLowerCase();if(!(b=a.ownerDocument.defaultView))return B;if(b=b.getComputedStyle(a,null)){e=b.getPropertyValue(d);if(e===""&&!c.contains(a.ownerDocument.documentElement,a))e=c.style(a,d)}return e};if(t.documentElement.currentStyle)aa=function(a,b){var d,e,f=a.currentStyle&&a.currentStyle[b],h=a.style;if(!Fa.test(f)&&jb.test(f)){d=h.left; -e=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;h.left=b==="fontSize"?"1em":f||0;f=h.pixelLeft+"px";h.left=d;a.runtimeStyle.left=e}return f===""?"auto":f};W=Ga||aa;if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b=a.offsetHeight;return a.offsetWidth===0&&b===0||!c.support.reliableHiddenOffsets&&(a.style.display||c.css(a,"display"))==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var mb=c.now(),nb=/)<[^<]*)*<\/script>/gi, -ob=/^(?:select|textarea)/i,pb=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,qb=/^(?:GET|HEAD)$/,Ra=/\[\]$/,T=/\=\?(&|$)/,ja=/\?/,rb=/([?&])_=[^&]*/,sb=/^(\w+:)?\/\/([^\/?#]+)/,tb=/%20/g,ub=/#.*$/,Ha=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!=="string"&&Ha)return Ha.apply(this,arguments);else if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var f=a.slice(e,a.length);a=a.slice(0,e)}e="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b=== -"object"){b=c.param(b,c.ajaxSettings.traditional);e="POST"}var h=this;c.ajax({url:a,type:e,dataType:"html",data:b,complete:function(l,k){if(k==="success"||k==="notmodified")h.html(f?c("
    ").append(l.responseText.replace(nb,"")).find(f):l.responseText);d&&h.each(d,[l.responseText,k,l])}});return this},serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&& -!this.disabled&&(this.checked||ob.test(this.nodeName)||pb.test(this.type))}).map(function(a,b){var d=c(this).val();return d==null?null:c.isArray(d)?c.map(d,function(e){return{name:b.name,value:e}}):{name:b.name,value:d}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,e){if(c.isFunction(b)){e=e||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:e})}, -getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,e){if(c.isFunction(b)){e=e||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:e})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return new E.XMLHttpRequest},accepts:{xml:"application/xml, text/xml",html:"text/html", -script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},ajax:function(a){var b=c.extend(true,{},c.ajaxSettings,a),d,e,f,h=b.type.toUpperCase(),l=qb.test(h);b.url=b.url.replace(ub,"");b.context=a&&a.context!=null?a.context:b;if(b.data&&b.processData&&typeof b.data!=="string")b.data=c.param(b.data,b.traditional);if(b.dataType==="jsonp"){if(h==="GET")T.test(b.url)||(b.url+=(ja.test(b.url)?"&":"?")+(b.jsonp||"callback")+"=?");else if(!b.data|| -!T.test(b.data))b.data=(b.data?b.data+"&":"")+(b.jsonp||"callback")+"=?";b.dataType="json"}if(b.dataType==="json"&&(b.data&&T.test(b.data)||T.test(b.url))){d=b.jsonpCallback||"jsonp"+mb++;if(b.data)b.data=(b.data+"").replace(T,"="+d+"$1");b.url=b.url.replace(T,"="+d+"$1");b.dataType="script";var k=E[d];E[d]=function(m){if(c.isFunction(k))k(m);else{E[d]=B;try{delete E[d]}catch(p){}}f=m;c.handleSuccess(b,w,e,f);c.handleComplete(b,w,e,f);r&&r.removeChild(A)}}if(b.dataType==="script"&&b.cache===null)b.cache= -false;if(b.cache===false&&l){var o=c.now(),x=b.url.replace(rb,"$1_="+o);b.url=x+(x===b.url?(ja.test(b.url)?"&":"?")+"_="+o:"")}if(b.data&&l)b.url+=(ja.test(b.url)?"&":"?")+b.data;b.global&&c.active++===0&&c.event.trigger("ajaxStart");o=(o=sb.exec(b.url))&&(o[1]&&o[1].toLowerCase()!==location.protocol||o[2].toLowerCase()!==location.host);if(b.dataType==="script"&&h==="GET"&&o){var r=t.getElementsByTagName("head")[0]||t.documentElement,A=t.createElement("script");if(b.scriptCharset)A.charset=b.scriptCharset; -A.src=b.url;if(!d){var C=false;A.onload=A.onreadystatechange=function(){if(!C&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){C=true;c.handleSuccess(b,w,e,f);c.handleComplete(b,w,e,f);A.onload=A.onreadystatechange=null;r&&A.parentNode&&r.removeChild(A)}}}r.insertBefore(A,r.firstChild);return B}var J=false,w=b.xhr();if(w){b.username?w.open(h,b.url,b.async,b.username,b.password):w.open(h,b.url,b.async);try{if(b.data!=null&&!l||a&&a.contentType)w.setRequestHeader("Content-Type", -b.contentType);if(b.ifModified){c.lastModified[b.url]&&w.setRequestHeader("If-Modified-Since",c.lastModified[b.url]);c.etag[b.url]&&w.setRequestHeader("If-None-Match",c.etag[b.url])}o||w.setRequestHeader("X-Requested-With","XMLHttpRequest");w.setRequestHeader("Accept",b.dataType&&b.accepts[b.dataType]?b.accepts[b.dataType]+", */*; q=0.01":b.accepts._default)}catch(I){}if(b.beforeSend&&b.beforeSend.call(b.context,w,b)===false){b.global&&c.active--===1&&c.event.trigger("ajaxStop");w.abort();return false}b.global&& -c.triggerGlobal(b,"ajaxSend",[w,b]);var L=w.onreadystatechange=function(m){if(!w||w.readyState===0||m==="abort"){J||c.handleComplete(b,w,e,f);J=true;if(w)w.onreadystatechange=c.noop}else if(!J&&w&&(w.readyState===4||m==="timeout")){J=true;w.onreadystatechange=c.noop;e=m==="timeout"?"timeout":!c.httpSuccess(w)?"error":b.ifModified&&c.httpNotModified(w,b.url)?"notmodified":"success";var p;if(e==="success")try{f=c.httpData(w,b.dataType,b)}catch(q){e="parsererror";p=q}if(e==="success"||e==="notmodified")d|| -c.handleSuccess(b,w,e,f);else c.handleError(b,w,e,p);d||c.handleComplete(b,w,e,f);m==="timeout"&&w.abort();if(b.async)w=null}};try{var g=w.abort;w.abort=function(){w&&Function.prototype.call.call(g,w);L("abort")}}catch(i){}b.async&&b.timeout>0&&setTimeout(function(){w&&!J&&L("timeout")},b.timeout);try{w.send(l||b.data==null?null:b.data)}catch(n){c.handleError(b,w,null,n);c.handleComplete(b,w,e,f)}b.async||L();return w}},param:function(a,b){var d=[],e=function(h,l){l=c.isFunction(l)?l():l;d[d.length]= -encodeURIComponent(h)+"="+encodeURIComponent(l)};if(b===B)b=c.ajaxSettings.traditional;if(c.isArray(a)||a.jquery)c.each(a,function(){e(this.name,this.value)});else for(var f in a)da(f,a[f],b,e);return d.join("&").replace(tb,"+")}});c.extend({active:0,lastModified:{},etag:{},handleError:function(a,b,d,e){a.error&&a.error.call(a.context,b,d,e);a.global&&c.triggerGlobal(a,"ajaxError",[b,a,e])},handleSuccess:function(a,b,d,e){a.success&&a.success.call(a.context,e,d,b);a.global&&c.triggerGlobal(a,"ajaxSuccess", -[b,a])},handleComplete:function(a,b,d){a.complete&&a.complete.call(a.context,b,d);a.global&&c.triggerGlobal(a,"ajaxComplete",[b,a]);a.global&&c.active--===1&&c.event.trigger("ajaxStop")},triggerGlobal:function(a,b,d){(a.context&&a.context.url==null?c(a.context):c.event).trigger(b,d)},httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status===1223}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"), -e=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(e)c.etag[b]=e;return a.status===304},httpData:function(a,b,d){var e=a.getResponseHeader("content-type")||"",f=b==="xml"||!b&&e.indexOf("xml")>=0;a=f?a.responseXML:a.responseText;f&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b==="json"||!b&&e.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&e.indexOf("javascript")>=0)c.globalEval(a);return a}}); -if(E.ActiveXObject)c.ajaxSettings.xhr=function(){if(E.location.protocol!=="file:")try{return new E.XMLHttpRequest}catch(a){}try{return new E.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}};c.support.ajax=!!c.ajaxSettings.xhr();var ea={},vb=/^(?:toggle|show|hide)$/,wb=/^([+\-]=)?([\d+.\-]+)(.*)$/,ba,pa=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b,d){if(a||a===0)return this.animate(S("show", -3),a,b,d);else{d=0;for(var e=this.length;d=0;e--)if(d[e].elem===this){b&&d[e](true);d.splice(e,1)}});b||this.dequeue();return this}});c.each({slideDown:S("show",1),slideUp:S("hide",1),slideToggle:S("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){c.fn[a]=function(d,e,f){return this.animate(b, -d,e,f)}});c.extend({speed:function(a,b,d){var e=a&&typeof a==="object"?c.extend({},a):{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};e.duration=c.fx.off?0:typeof e.duration==="number"?e.duration:e.duration in c.fx.speeds?c.fx.speeds[e.duration]:c.fx.speeds._default;e.old=e.complete;e.complete=function(){e.queue!==false&&c(this).dequeue();c.isFunction(e.old)&&e.old.call(this)};return e},easing:{linear:function(a,b,d,e){return d+e*a},swing:function(a,b,d,e){return(-Math.cos(a* -Math.PI)/2+0.5)*e+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]||c.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a=parseFloat(c.css(this.elem,this.prop));return a&&a>-1E4?a:0},custom:function(a,b,d){function e(l){return f.step(l)} -var f=this,h=c.fx;this.startTime=c.now();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;this.pos=this.state=0;e.elem=this.elem;if(e()&&c.timers.push(e)&&!ba)ba=setInterval(h.tick,h.interval)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true; -this.custom(this.cur(),0)},step:function(a){var b=c.now(),d=true;if(a||b>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var e in this.options.curAnim)if(this.options.curAnim[e]!==true)d=false;if(d){if(this.options.overflow!=null&&!c.support.shrinkWrapBlocks){var f=this.elem,h=this.options;c.each(["","X","Y"],function(k,o){f.style["overflow"+o]=h.overflow[k]})}this.options.hide&&c(this.elem).hide();if(this.options.hide|| -this.options.show)for(var l in this.options.curAnim)c.style(this.elem,l,this.options.orig[l]);this.options.complete.call(this.elem)}return false}else{a=b-this.startTime;this.state=a/this.options.duration;b=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||b](this.state,a,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a= -c.timers,b=0;b-1;e={};var x={};if(o)x=f.position();l=o?x.top:parseInt(l,10)||0;k=o?x.left:parseInt(k,10)||0;if(c.isFunction(b))b=b.call(a,d,h);if(b.top!=null)e.top=b.top-h.top+l;if(b.left!=null)e.left=b.left-h.left+k;"using"in b?b.using.call(a, -e):f.css(e)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),e=Ia.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.css(a,"marginTop"))||0;d.left-=parseFloat(c.css(a,"marginLeft"))||0;e.top+=parseFloat(c.css(b[0],"borderTopWidth"))||0;e.left+=parseFloat(c.css(b[0],"borderLeftWidth"))||0;return{top:d.top-e.top,left:d.left-e.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||t.body;a&&!Ia.test(a.nodeName)&& -c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(e){var f=this[0],h;if(!f)return null;if(e!==B)return this.each(function(){if(h=fa(this))h.scrollTo(!a?e:c(h).scrollLeft(),a?e:c(h).scrollTop());else this[d]=e});else return(h=fa(f))?"pageXOffset"in h?h[a?"pageYOffset":"pageXOffset"]:c.support.boxModel&&h.document.documentElement[d]||h.document.body[d]:f[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase(); -c.fn["inner"+b]=function(){return this[0]?parseFloat(c.css(this[0],d,"padding")):null};c.fn["outer"+b]=function(e){return this[0]?parseFloat(c.css(this[0],d,e?"margin":"border")):null};c.fn[d]=function(e){var f=this[0];if(!f)return e==null?null:this;if(c.isFunction(e))return this.each(function(l){var k=c(this);k[d](e.call(this,l,k[d]()))});if(c.isWindow(f))return f.document.compatMode==="CSS1Compat"&&f.document.documentElement["client"+b]||f.document.body["client"+b];else if(f.nodeType===9)return Math.max(f.documentElement["client"+ -b],f.body["scroll"+b],f.documentElement["scroll"+b],f.body["offset"+b],f.documentElement["offset"+b]);else if(e===B){f=c.css(f,d);var h=parseFloat(f);return c.isNaN(h)?f:h}else return this.css(d,typeof e==="string"?e:e+"px")}})})(window); +/*! jQuery v1.8.3 jquery.com | jquery.org/license */ +(function(e,t){function _(e){var t=M[e]={};return v.each(e.split(y),function(e,n){t[n]=!0}),t}function H(e,n,r){if(r===t&&e.nodeType===1){var i="data-"+n.replace(P,"-$1").toLowerCase();r=e.getAttribute(i);if(typeof r=="string"){try{r=r==="true"?!0:r==="false"?!1:r==="null"?null:+r+""===r?+r:D.test(r)?v.parseJSON(r):r}catch(s){}v.data(e,n,r)}else r=t}return r}function B(e){var t;for(t in e){if(t==="data"&&v.isEmptyObject(e[t]))continue;if(t!=="toJSON")return!1}return!0}function et(){return!1}function tt(){return!0}function ut(e){return!e||!e.parentNode||e.parentNode.nodeType===11}function at(e,t){do e=e[t];while(e&&e.nodeType!==1);return e}function ft(e,t,n){t=t||0;if(v.isFunction(t))return v.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return v.grep(e,function(e,r){return e===t===n});if(typeof t=="string"){var r=v.grep(e,function(e){return e.nodeType===1});if(it.test(t))return v.filter(t,r,!n);t=v.filter(t,r)}return v.grep(e,function(e,r){return v.inArray(e,t)>=0===n})}function lt(e){var t=ct.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}function Lt(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function At(e,t){if(t.nodeType!==1||!v.hasData(e))return;var n,r,i,s=v._data(e),o=v._data(t,s),u=s.events;if(u){delete o.handle,o.events={};for(n in u)for(r=0,i=u[n].length;r").appendTo(i.body),n=t.css("display");t.remove();if(n==="none"||n===""){Pt=i.body.appendChild(Pt||v.extend(i.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!Ht||!Pt.createElement)Ht=(Pt.contentWindow||Pt.contentDocument).document,Ht.write(""),Ht.close();t=Ht.body.appendChild(Ht.createElement(e)),n=Dt(t,"display"),i.body.removeChild(Pt)}return Wt[e]=n,n}function fn(e,t,n,r){var i;if(v.isArray(t))v.each(t,function(t,i){n||sn.test(e)?r(e,i):fn(e+"["+(typeof i=="object"?t:"")+"]",i,n,r)});else if(!n&&v.type(t)==="object")for(i in t)fn(e+"["+i+"]",t[i],n,r);else r(e,t)}function Cn(e){return function(t,n){typeof t!="string"&&(n=t,t="*");var r,i,s,o=t.toLowerCase().split(y),u=0,a=o.length;if(v.isFunction(n))for(;u)[^>]*$|#([\w\-]*)$)/,E=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,S=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,T=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,N=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,C=/^-ms-/,k=/-([\da-z])/gi,L=function(e,t){return(t+"").toUpperCase()},A=function(){i.addEventListener?(i.removeEventListener("DOMContentLoaded",A,!1),v.ready()):i.readyState==="complete"&&(i.detachEvent("onreadystatechange",A),v.ready())},O={};v.fn=v.prototype={constructor:v,init:function(e,n,r){var s,o,u,a;if(!e)return this;if(e.nodeType)return this.context=this[0]=e,this.length=1,this;if(typeof e=="string"){e.charAt(0)==="<"&&e.charAt(e.length-1)===">"&&e.length>=3?s=[null,e,null]:s=w.exec(e);if(s&&(s[1]||!n)){if(s[1])return n=n instanceof v?n[0]:n,a=n&&n.nodeType?n.ownerDocument||n:i,e=v.parseHTML(s[1],a,!0),E.test(s[1])&&v.isPlainObject(n)&&this.attr.call(e,n,!0),v.merge(this,e);o=i.getElementById(s[2]);if(o&&o.parentNode){if(o.id!==s[2])return r.find(e);this.length=1,this[0]=o}return this.context=i,this.selector=e,this}return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e)}return v.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),v.makeArray(e,this))},selector:"",jquery:"1.8.3",length:0,size:function(){return this.length},toArray:function(){return l.call(this)},get:function(e){return e==null?this.toArray():e<0?this[this.length+e]:this[e]},pushStack:function(e,t,n){var r=v.merge(this.constructor(),e);return r.prevObject=this,r.context=this.context,t==="find"?r.selector=this.selector+(this.selector?" ":"")+n:t&&(r.selector=this.selector+"."+t+"("+n+")"),r},each:function(e,t){return v.each(this,e,t)},ready:function(e){return v.ready.promise().done(e),this},eq:function(e){return e=+e,e===-1?this.slice(e):this.slice(e,e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(l.apply(this,arguments),"slice",l.call(arguments).join(","))},map:function(e){return this.pushStack(v.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:[].sort,splice:[].splice},v.fn.init.prototype=v.fn,v.extend=v.fn.extend=function(){var e,n,r,i,s,o,u=arguments[0]||{},a=1,f=arguments.length,l=!1;typeof u=="boolean"&&(l=u,u=arguments[1]||{},a=2),typeof u!="object"&&!v.isFunction(u)&&(u={}),f===a&&(u=this,--a);for(;a0)return;r.resolveWith(i,[v]),v.fn.trigger&&v(i).trigger("ready").off("ready")},isFunction:function(e){return v.type(e)==="function"},isArray:Array.isArray||function(e){return v.type(e)==="array"},isWindow:function(e){return e!=null&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return e==null?String(e):O[h.call(e)]||"object"},isPlainObject:function(e){if(!e||v.type(e)!=="object"||e.nodeType||v.isWindow(e))return!1;try{if(e.constructor&&!p.call(e,"constructor")&&!p.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||p.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw new Error(e)},parseHTML:function(e,t,n){var r;return!e||typeof e!="string"?null:(typeof t=="boolean"&&(n=t,t=0),t=t||i,(r=E.exec(e))?[t.createElement(r[1])]:(r=v.buildFragment([e],t,n?null:[]),v.merge([],(r.cacheable?v.clone(r.fragment):r.fragment).childNodes)))},parseJSON:function(t){if(!t||typeof t!="string")return null;t=v.trim(t);if(e.JSON&&e.JSON.parse)return e.JSON.parse(t);if(S.test(t.replace(T,"@").replace(N,"]").replace(x,"")))return(new Function("return "+t))();v.error("Invalid JSON: "+t)},parseXML:function(n){var r,i;if(!n||typeof n!="string")return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(s){r=t}return(!r||!r.documentElement||r.getElementsByTagName("parsererror").length)&&v.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&g.test(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(C,"ms-").replace(k,L)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,n,r){var i,s=0,o=e.length,u=o===t||v.isFunction(e);if(r){if(u){for(i in e)if(n.apply(e[i],r)===!1)break}else for(;s0&&e[0]&&e[a-1]||a===0||v.isArray(e));if(f)for(;u-1)a.splice(n,1),i&&(n<=o&&o--,n<=u&&u--)}),this},has:function(e){return v.inArray(e,a)>-1},empty:function(){return a=[],this},disable:function(){return a=f=n=t,this},disabled:function(){return!a},lock:function(){return f=t,n||c.disable(),this},locked:function(){return!f},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],a&&(!r||f)&&(i?f.push(t):l(t)),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},v.extend({Deferred:function(e){var t=[["resolve","done",v.Callbacks("once memory"),"resolved"],["reject","fail",v.Callbacks("once memory"),"rejected"],["notify","progress",v.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return v.Deferred(function(n){v.each(t,function(t,r){var s=r[0],o=e[t];i[r[1]](v.isFunction(o)?function(){var e=o.apply(this,arguments);e&&v.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[s+"With"](this===i?n:this,[e])}:n[s])}),e=null}).promise()},promise:function(e){return e!=null?v.extend(e,r):r}},i={};return r.pipe=r.then,v.each(t,function(e,s){var o=s[2],u=s[3];r[s[1]]=o.add,u&&o.add(function(){n=u},t[e^1][2].disable,t[2][2].lock),i[s[0]]=o.fire,i[s[0]+"With"]=o.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=l.call(arguments),r=n.length,i=r!==1||e&&v.isFunction(e.promise)?r:0,s=i===1?e:v.Deferred(),o=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?l.call(arguments):r,n===u?s.notifyWith(t,n):--i||s.resolveWith(t,n)}},u,a,f;if(r>1){u=new Array(r),a=new Array(r),f=new Array(r);for(;t
    a",n=p.getElementsByTagName("*"),r=p.getElementsByTagName("a")[0];if(!n||!r||!n.length)return{};s=i.createElement("select"),o=s.appendChild(i.createElement("option")),u=p.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:r.getAttribute("href")==="/a",opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:u.value==="on",optSelected:o.selected,getSetAttribute:p.className!=="t",enctype:!!i.createElement("form").enctype,html5Clone:i.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",boxModel:i.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},u.checked=!0,t.noCloneChecked=u.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!o.disabled;try{delete p.test}catch(d){t.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",h=function(){t.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick"),p.detachEvent("onclick",h)),u=i.createElement("input"),u.value="t",u.setAttribute("type","radio"),t.radioValue=u.value==="t",u.setAttribute("checked","checked"),u.setAttribute("name","t"),p.appendChild(u),a=i.createDocumentFragment(),a.appendChild(p.lastChild),t.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,t.appendChecked=u.checked,a.removeChild(u),a.appendChild(p);if(p.attachEvent)for(l in{submit:!0,change:!0,focusin:!0})f="on"+l,c=f in p,c||(p.setAttribute(f,"return;"),c=typeof p[f]=="function"),t[l+"Bubbles"]=c;return v(function(){var n,r,s,o,u="padding:0;margin:0;border:0;display:block;overflow:hidden;",a=i.getElementsByTagName("body")[0];if(!a)return;n=i.createElement("div"),n.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",a.insertBefore(n,a.firstChild),r=i.createElement("div"),n.appendChild(r),r.innerHTML="
    t
    ",s=r.getElementsByTagName("td"),s[0].style.cssText="padding:0;margin:0;border:0;display:none",c=s[0].offsetHeight===0,s[0].style.display="",s[1].style.display="none",t.reliableHiddenOffsets=c&&s[0].offsetHeight===0,r.innerHTML="",r.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=r.offsetWidth===4,t.doesNotIncludeMarginInBodyOffset=a.offsetTop!==1,e.getComputedStyle&&(t.pixelPosition=(e.getComputedStyle(r,null)||{}).top!=="1%",t.boxSizingReliable=(e.getComputedStyle(r,null)||{width:"4px"}).width==="4px",o=i.createElement("div"),o.style.cssText=r.style.cssText=u,o.style.marginRight=o.style.width="0",r.style.width="1px",r.appendChild(o),t.reliableMarginRight=!parseFloat((e.getComputedStyle(o,null)||{}).marginRight)),typeof r.style.zoom!="undefined"&&(r.innerHTML="",r.style.cssText=u+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=r.offsetWidth===3,r.style.display="block",r.style.overflow="visible",r.innerHTML="
    ",r.firstChild.style.width="5px",t.shrinkWrapBlocks=r.offsetWidth!==3,n.style.zoom=1),a.removeChild(n),n=r=s=o=null}),a.removeChild(p),n=r=s=o=u=a=p=null,t}();var D=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;v.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(v.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?v.cache[e[v.expando]]:e[v.expando],!!e&&!B(e)},data:function(e,n,r,i){if(!v.acceptData(e))return;var s,o,u=v.expando,a=typeof n=="string",f=e.nodeType,l=f?v.cache:e,c=f?e[u]:e[u]&&u;if((!c||!l[c]||!i&&!l[c].data)&&a&&r===t)return;c||(f?e[u]=c=v.deletedIds.pop()||v.guid++:c=u),l[c]||(l[c]={},f||(l[c].toJSON=v.noop));if(typeof n=="object"||typeof n=="function")i?l[c]=v.extend(l[c],n):l[c].data=v.extend(l[c].data,n);return s=l[c],i||(s.data||(s.data={}),s=s.data),r!==t&&(s[v.camelCase(n)]=r),a?(o=s[n],o==null&&(o=s[v.camelCase(n)])):o=s,o},removeData:function(e,t,n){if(!v.acceptData(e))return;var r,i,s,o=e.nodeType,u=o?v.cache:e,a=o?e[v.expando]:v.expando;if(!u[a])return;if(t){r=n?u[a]:u[a].data;if(r){v.isArray(t)||(t in r?t=[t]:(t=v.camelCase(t),t in r?t=[t]:t=t.split(" ")));for(i=0,s=t.length;i1,null,!1))},removeData:function(e){return this.each(function(){v.removeData(this,e)})}}),v.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=v._data(e,t),n&&(!r||v.isArray(n)?r=v._data(e,t,v.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=v.queue(e,t),r=n.length,i=n.shift(),s=v._queueHooks(e,t),o=function(){v.dequeue(e,t)};i==="inprogress"&&(i=n.shift(),r--),i&&(t==="fx"&&n.unshift("inprogress"),delete s.stop,i.call(e,o,s)),!r&&s&&s.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return v._data(e,n)||v._data(e,n,{empty:v.Callbacks("once memory").add(function(){v.removeData(e,t+"queue",!0),v.removeData(e,n,!0)})})}}),v.fn.extend({queue:function(e,n){var r=2;return typeof e!="string"&&(n=e,e="fx",r--),arguments.length1)},removeAttr:function(e){return this.each(function(){v.removeAttr(this,e)})},prop:function(e,t){return v.access(this,v.prop,e,t,arguments.length>1)},removeProp:function(e){return e=v.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,s,o,u;if(v.isFunction(e))return this.each(function(t){v(this).addClass(e.call(this,t,this.className))});if(e&&typeof e=="string"){t=e.split(y);for(n=0,r=this.length;n=0)r=r.replace(" "+n[s]+" "," ");i.className=e?v.trim(r):""}}}return this},toggleClass:function(e,t){var n=typeof e,r=typeof t=="boolean";return v.isFunction(e)?this.each(function(n){v(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if(n==="string"){var i,s=0,o=v(this),u=t,a=e.split(y);while(i=a[s++])u=r?u:!o.hasClass(i),o[u?"addClass":"removeClass"](i)}else if(n==="undefined"||n==="boolean")this.className&&v._data(this,"__className__",this.className),this.className=this.className||e===!1?"":v._data(this,"__className__")||""})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;n=0)return!0;return!1},val:function(e){var n,r,i,s=this[0];if(!arguments.length){if(s)return n=v.valHooks[s.type]||v.valHooks[s.nodeName.toLowerCase()],n&&"get"in n&&(r=n.get(s,"value"))!==t?r:(r=s.value,typeof r=="string"?r.replace(R,""):r==null?"":r);return}return i=v.isFunction(e),this.each(function(r){var s,o=v(this);if(this.nodeType!==1)return;i?s=e.call(this,r,o.val()):s=e,s==null?s="":typeof s=="number"?s+="":v.isArray(s)&&(s=v.map(s,function(e){return e==null?"":e+""})),n=v.valHooks[this.type]||v.valHooks[this.nodeName.toLowerCase()];if(!n||!("set"in n)||n.set(this,s,"value")===t)this.value=s})}}),v.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,s=e.type==="select-one"||i<0,o=s?null:[],u=s?i+1:r.length,a=i<0?u:s?i:0;for(;a=0}),n.length||(e.selectedIndex=-1),n}}},attrFn:{},attr:function(e,n,r,i){var s,o,u,a=e.nodeType;if(!e||a===3||a===8||a===2)return;if(i&&v.isFunction(v.fn[n]))return v(e)[n](r);if(typeof e.getAttribute=="undefined")return v.prop(e,n,r);u=a!==1||!v.isXMLDoc(e),u&&(n=n.toLowerCase(),o=v.attrHooks[n]||(X.test(n)?F:j));if(r!==t){if(r===null){v.removeAttr(e,n);return}return o&&"set"in o&&u&&(s=o.set(e,r,n))!==t?s:(e.setAttribute(n,r+""),r)}return o&&"get"in o&&u&&(s=o.get(e,n))!==null?s:(s=e.getAttribute(n),s===null?t:s)},removeAttr:function(e,t){var n,r,i,s,o=0;if(t&&e.nodeType===1){r=t.split(y);for(;o=0}})});var $=/^(?:textarea|input|select)$/i,J=/^([^\.]*|)(?:\.(.+)|)$/,K=/(?:^|\s)hover(\.\S+|)\b/,Q=/^key/,G=/^(?:mouse|contextmenu)|click/,Y=/^(?:focusinfocus|focusoutblur)$/,Z=function(e){return v.event.special.hover?e:e.replace(K,"mouseenter$1 mouseleave$1")};v.event={add:function(e,n,r,i,s){var o,u,a,f,l,c,h,p,d,m,g;if(e.nodeType===3||e.nodeType===8||!n||!r||!(o=v._data(e)))return;r.handler&&(d=r,r=d.handler,s=d.selector),r.guid||(r.guid=v.guid++),a=o.events,a||(o.events=a={}),u=o.handle,u||(o.handle=u=function(e){return typeof v=="undefined"||!!e&&v.event.triggered===e.type?t:v.event.dispatch.apply(u.elem,arguments)},u.elem=e),n=v.trim(Z(n)).split(" ");for(f=0;f=0&&(y=y.slice(0,-1),a=!0),y.indexOf(".")>=0&&(b=y.split("."),y=b.shift(),b.sort());if((!s||v.event.customEvent[y])&&!v.event.global[y])return;n=typeof n=="object"?n[v.expando]?n:new v.Event(y,n):new v.Event(y),n.type=y,n.isTrigger=!0,n.exclusive=a,n.namespace=b.join("."),n.namespace_re=n.namespace?new RegExp("(^|\\.)"+b.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,h=y.indexOf(":")<0?"on"+y:"";if(!s){u=v.cache;for(f in u)u[f].events&&u[f].events[y]&&v.event.trigger(n,r,u[f].handle.elem,!0);return}n.result=t,n.target||(n.target=s),r=r!=null?v.makeArray(r):[],r.unshift(n),p=v.event.special[y]||{};if(p.trigger&&p.trigger.apply(s,r)===!1)return;m=[[s,p.bindType||y]];if(!o&&!p.noBubble&&!v.isWindow(s)){g=p.delegateType||y,l=Y.test(g+y)?s:s.parentNode;for(c=s;l;l=l.parentNode)m.push([l,g]),c=l;c===(s.ownerDocument||i)&&m.push([c.defaultView||c.parentWindow||e,g])}for(f=0;f=0:v.find(h,this,null,[s]).length),u[h]&&f.push(c);f.length&&w.push({elem:s,matches:f})}d.length>m&&w.push({elem:this,matches:d.slice(m)});for(r=0;r0?this.on(t,null,e,n):this.trigger(t)},Q.test(t)&&(v.event.fixHooks[t]=v.event.keyHooks),G.test(t)&&(v.event.fixHooks[t]=v.event.mouseHooks)}),function(e,t){function nt(e,t,n,r){n=n||[],t=t||g;var i,s,a,f,l=t.nodeType;if(!e||typeof e!="string")return n;if(l!==1&&l!==9)return[];a=o(t);if(!a&&!r)if(i=R.exec(e))if(f=i[1]){if(l===9){s=t.getElementById(f);if(!s||!s.parentNode)return n;if(s.id===f)return n.push(s),n}else if(t.ownerDocument&&(s=t.ownerDocument.getElementById(f))&&u(t,s)&&s.id===f)return n.push(s),n}else{if(i[2])return S.apply(n,x.call(t.getElementsByTagName(e),0)),n;if((f=i[3])&&Z&&t.getElementsByClassName)return S.apply(n,x.call(t.getElementsByClassName(f),0)),n}return vt(e.replace(j,"$1"),t,n,r,a)}function rt(e){return function(t){var n=t.nodeName.toLowerCase();return n==="input"&&t.type===e}}function it(e){return function(t){var n=t.nodeName.toLowerCase();return(n==="input"||n==="button")&&t.type===e}}function st(e){return N(function(t){return t=+t,N(function(n,r){var i,s=e([],n.length,t),o=s.length;while(o--)n[i=s[o]]&&(n[i]=!(r[i]=n[i]))})})}function ot(e,t,n){if(e===t)return n;var r=e.nextSibling;while(r){if(r===t)return-1;r=r.nextSibling}return 1}function ut(e,t){var n,r,s,o,u,a,f,l=L[d][e+" "];if(l)return t?0:l.slice(0);u=e,a=[],f=i.preFilter;while(u){if(!n||(r=F.exec(u)))r&&(u=u.slice(r[0].length)||u),a.push(s=[]);n=!1;if(r=I.exec(u))s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=r[0].replace(j," ");for(o in i.filter)(r=J[o].exec(u))&&(!f[o]||(r=f[o](r)))&&(s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=o,n.matches=r);if(!n)break}return t?u.length:u?nt.error(e):L(e,a).slice(0)}function at(e,t,r){var i=t.dir,s=r&&t.dir==="parentNode",o=w++;return t.first?function(t,n,r){while(t=t[i])if(s||t.nodeType===1)return e(t,n,r)}:function(t,r,u){if(!u){var a,f=b+" "+o+" ",l=f+n;while(t=t[i])if(s||t.nodeType===1){if((a=t[d])===l)return t.sizset;if(typeof a=="string"&&a.indexOf(f)===0){if(t.sizset)return t}else{t[d]=l;if(e(t,r,u))return t.sizset=!0,t;t.sizset=!1}}}else while(t=t[i])if(s||t.nodeType===1)if(e(t,r,u))return t}}function ft(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function lt(e,t,n,r,i){var s,o=[],u=0,a=e.length,f=t!=null;for(;u-1&&(s[f]=!(o[f]=c))}}else g=lt(g===o?g.splice(d,g.length):g),i?i(null,o,g,a):S.apply(o,g)})}function ht(e){var t,n,r,s=e.length,o=i.relative[e[0].type],u=o||i.relative[" "],a=o?1:0,f=at(function(e){return e===t},u,!0),l=at(function(e){return T.call(t,e)>-1},u,!0),h=[function(e,n,r){return!o&&(r||n!==c)||((t=n).nodeType?f(e,n,r):l(e,n,r))}];for(;a1&&ft(h),a>1&&e.slice(0,a-1).join("").replace(j,"$1"),n,a0,s=e.length>0,o=function(u,a,f,l,h){var p,d,v,m=[],y=0,w="0",x=u&&[],T=h!=null,N=c,C=u||s&&i.find.TAG("*",h&&a.parentNode||a),k=b+=N==null?1:Math.E;T&&(c=a!==g&&a,n=o.el);for(;(p=C[w])!=null;w++){if(s&&p){for(d=0;v=e[d];d++)if(v(p,a,f)){l.push(p);break}T&&(b=k,n=++o.el)}r&&((p=!v&&p)&&y--,u&&x.push(p))}y+=w;if(r&&w!==y){for(d=0;v=t[d];d++)v(x,m,a,f);if(u){if(y>0)while(w--)!x[w]&&!m[w]&&(m[w]=E.call(l));m=lt(m)}S.apply(l,m),T&&!u&&m.length>0&&y+t.length>1&&nt.uniqueSort(l)}return T&&(b=k,c=N),x};return o.el=0,r?N(o):o}function dt(e,t,n){var r=0,i=t.length;for(;r2&&(f=u[0]).type==="ID"&&t.nodeType===9&&!s&&i.relative[u[1].type]){t=i.find.ID(f.matches[0].replace($,""),t,s)[0];if(!t)return n;e=e.slice(u.shift().length)}for(o=J.POS.test(e)?-1:u.length-1;o>=0;o--){f=u[o];if(i.relative[l=f.type])break;if(c=i.find[l])if(r=c(f.matches[0].replace($,""),z.test(u[0].type)&&t.parentNode||t,s)){u.splice(o,1),e=r.length&&u.join("");if(!e)return S.apply(n,x.call(r,0)),n;break}}}return a(e,h)(r,t,s,n,z.test(e)),n}function mt(){}var n,r,i,s,o,u,a,f,l,c,h=!0,p="undefined",d=("sizcache"+Math.random()).replace(".",""),m=String,g=e.document,y=g.documentElement,b=0,w=0,E=[].pop,S=[].push,x=[].slice,T=[].indexOf||function(e){var t=0,n=this.length;for(;ti.cacheLength&&delete e[t.shift()],e[n+" "]=r},e)},k=C(),L=C(),A=C(),O="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",_=M.replace("w","w#"),D="([*^$|!~]?=)",P="\\["+O+"*("+M+")"+O+"*(?:"+D+O+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+_+")|)|)"+O+"*\\]",H=":("+M+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+P+")|[^:]|\\\\.)*|.*))\\)|)",B=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+O+"*((?:-\\d)?\\d*)"+O+"*\\)|)(?=[^-]|$)",j=new RegExp("^"+O+"+|((?:^|[^\\\\])(?:\\\\.)*)"+O+"+$","g"),F=new RegExp("^"+O+"*,"+O+"*"),I=new RegExp("^"+O+"*([\\x20\\t\\r\\n\\f>+~])"+O+"*"),q=new RegExp(H),R=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,U=/^:not/,z=/[\x20\t\r\n\f]*[+~]/,W=/:not\($/,X=/h\d/i,V=/input|select|textarea|button/i,$=/\\(?!\\)/g,J={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),NAME:new RegExp("^\\[name=['\"]?("+M+")['\"]?\\]"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+H),POS:new RegExp(B,"i"),CHILD:new RegExp("^:(only|nth|first|last)-child(?:\\("+O+"*(even|odd|(([+-]|)(\\d*)n|)"+O+"*(?:([+-]|)"+O+"*(\\d+)|))"+O+"*\\)|)","i"),needsContext:new RegExp("^"+O+"*[>+~]|"+B,"i")},K=function(e){var t=g.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}},Q=K(function(e){return e.appendChild(g.createComment("")),!e.getElementsByTagName("*").length}),G=K(function(e){return e.innerHTML="",e.firstChild&&typeof e.firstChild.getAttribute!==p&&e.firstChild.getAttribute("href")==="#"}),Y=K(function(e){e.innerHTML="";var t=typeof e.lastChild.getAttribute("multiple");return t!=="boolean"&&t!=="string"}),Z=K(function(e){return e.innerHTML="",!e.getElementsByClassName||!e.getElementsByClassName("e").length?!1:(e.lastChild.className="e",e.getElementsByClassName("e").length===2)}),et=K(function(e){e.id=d+0,e.innerHTML="
    ",y.insertBefore(e,y.firstChild);var t=g.getElementsByName&&g.getElementsByName(d).length===2+g.getElementsByName(d+0).length;return r=!g.getElementById(d),y.removeChild(e),t});try{x.call(y.childNodes,0)[0].nodeType}catch(tt){x=function(e){var t,n=[];for(;t=this[e];e++)n.push(t);return n}}nt.matches=function(e,t){return nt(e,null,null,t)},nt.matchesSelector=function(e,t){return nt(t,null,null,[e]).length>0},s=nt.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(i===1||i===9||i===11){if(typeof e.textContent=="string")return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=s(e)}else if(i===3||i===4)return e.nodeValue}else for(;t=e[r];r++)n+=s(t);return n},o=nt.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?t.nodeName!=="HTML":!1},u=nt.contains=y.contains?function(e,t){var n=e.nodeType===9?e.documentElement:e,r=t&&t.parentNode;return e===r||!!(r&&r.nodeType===1&&n.contains&&n.contains(r))}:y.compareDocumentPosition?function(e,t){return t&&!!(e.compareDocumentPosition(t)&16)}:function(e,t){while(t=t.parentNode)if(t===e)return!0;return!1},nt.attr=function(e,t){var n,r=o(e);return r||(t=t.toLowerCase()),(n=i.attrHandle[t])?n(e):r||Y?e.getAttribute(t):(n=e.getAttributeNode(t),n?typeof e[t]=="boolean"?e[t]?t:null:n.specified?n.value:null:null)},i=nt.selectors={cacheLength:50,createPseudo:N,match:J,attrHandle:G?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},find:{ID:r?function(e,t,n){if(typeof t.getElementById!==p&&!n){var r=t.getElementById(e);return r&&r.parentNode?[r]:[]}}:function(e,n,r){if(typeof n.getElementById!==p&&!r){var i=n.getElementById(e);return i?i.id===e||typeof i.getAttributeNode!==p&&i.getAttributeNode("id").value===e?[i]:t:[]}},TAG:Q?function(e,t){if(typeof t.getElementsByTagName!==p)return t.getElementsByTagName(e)}:function(e,t){var n=t.getElementsByTagName(e);if(e==="*"){var r,i=[],s=0;for(;r=n[s];s++)r.nodeType===1&&i.push(r);return i}return n},NAME:et&&function(e,t){if(typeof t.getElementsByName!==p)return t.getElementsByName(name)},CLASS:Z&&function(e,t,n){if(typeof t.getElementsByClassName!==p&&!n)return t.getElementsByClassName(e)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace($,""),e[3]=(e[4]||e[5]||"").replace($,""),e[2]==="~="&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),e[1]==="nth"?(e[2]||nt.error(e[0]),e[3]=+(e[3]?e[4]+(e[5]||1):2*(e[2]==="even"||e[2]==="odd")),e[4]=+(e[6]+e[7]||e[2]==="odd")):e[2]&&nt.error(e[0]),e},PSEUDO:function(e){var t,n;if(J.CHILD.test(e[0]))return null;if(e[3])e[2]=e[3];else if(t=e[4])q.test(t)&&(n=ut(t,!0))&&(n=t.indexOf(")",t.length-n)-t.length)&&(t=t.slice(0,n),e[0]=e[0].slice(0,n)),e[2]=t;return e.slice(0,3)}},filter:{ID:r?function(e){return e=e.replace($,""),function(t){return t.getAttribute("id")===e}}:function(e){return e=e.replace($,""),function(t){var n=typeof t.getAttributeNode!==p&&t.getAttributeNode("id");return n&&n.value===e}},TAG:function(e){return e==="*"?function(){return!0}:(e=e.replace($,"").toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=k[d][e+" "];return t||(t=new RegExp("(^|"+O+")"+e+"("+O+"|$)"))&&k(e,function(e){return t.test(e.className||typeof e.getAttribute!==p&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r,i){var s=nt.attr(r,e);return s==null?t==="!=":t?(s+="",t==="="?s===n:t==="!="?s!==n:t==="^="?n&&s.indexOf(n)===0:t==="*="?n&&s.indexOf(n)>-1:t==="$="?n&&s.substr(s.length-n.length)===n:t==="~="?(" "+s+" ").indexOf(n)>-1:t==="|="?s===n||s.substr(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r){return e==="nth"?function(e){var t,i,s=e.parentNode;if(n===1&&r===0)return!0;if(s){i=0;for(t=s.firstChild;t;t=t.nextSibling)if(t.nodeType===1){i++;if(e===t)break}}return i-=r,i===n||i%n===0&&i/n>=0}:function(t){var n=t;switch(e){case"only":case"first":while(n=n.previousSibling)if(n.nodeType===1)return!1;if(e==="first")return!0;n=t;case"last":while(n=n.nextSibling)if(n.nodeType===1)return!1;return!0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||nt.error("unsupported pseudo: "+e);return r[d]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?N(function(e,n){var i,s=r(e,t),o=s.length;while(o--)i=T.call(e,s[o]),e[i]=!(n[i]=s[o])}):function(e){return r(e,0,n)}):r}},pseudos:{not:N(function(e){var t=[],n=[],r=a(e.replace(j,"$1"));return r[d]?N(function(e,t,n,i){var s,o=r(e,null,i,[]),u=e.length;while(u--)if(s=o[u])e[u]=!(t[u]=s)}):function(e,i,s){return t[0]=e,r(t,null,s,n),!n.pop()}}),has:N(function(e){return function(t){return nt(e,t).length>0}}),contains:N(function(e){return function(t){return(t.textContent||t.innerText||s(t)).indexOf(e)>-1}}),enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&!!e.checked||t==="option"&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},parent:function(e){return!i.pseudos.empty(e)},empty:function(e){var t;e=e.firstChild;while(e){if(e.nodeName>"@"||(t=e.nodeType)===3||t===4)return!1;e=e.nextSibling}return!0},header:function(e){return X.test(e.nodeName)},text:function(e){var t,n;return e.nodeName.toLowerCase()==="input"&&(t=e.type)==="text"&&((n=e.getAttribute("type"))==null||n.toLowerCase()===t)},radio:rt("radio"),checkbox:rt("checkbox"),file:rt("file"),password:rt("password"),image:rt("image"),submit:it("submit"),reset:it("reset"),button:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&e.type==="button"||t==="button"},input:function(e){return V.test(e.nodeName)},focus:function(e){var t=e.ownerDocument;return e===t.activeElement&&(!t.hasFocus||t.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},active:function(e){return e===e.ownerDocument.activeElement},first:st(function(){return[0]}),last:st(function(e,t){return[t-1]}),eq:st(function(e,t,n){return[n<0?n+t:n]}),even:st(function(e,t){for(var n=0;n=0;)e.push(r);return e}),gt:st(function(e,t,n){for(var r=n<0?n+t:n;++r",e.querySelectorAll("[selected]").length||i.push("\\["+O+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||i.push(":checked")}),K(function(e){e.innerHTML="

    ",e.querySelectorAll("[test^='']").length&&i.push("[*^$]="+O+"*(?:\"\"|'')"),e.innerHTML="",e.querySelectorAll(":enabled").length||i.push(":enabled",":disabled")}),i=new RegExp(i.join("|")),vt=function(e,r,s,o,u){if(!o&&!u&&!i.test(e)){var a,f,l=!0,c=d,h=r,p=r.nodeType===9&&e;if(r.nodeType===1&&r.nodeName.toLowerCase()!=="object"){a=ut(e),(l=r.getAttribute("id"))?c=l.replace(n,"\\$&"):r.setAttribute("id",c),c="[id='"+c+"'] ",f=a.length;while(f--)a[f]=c+a[f].join("");h=z.test(e)&&r.parentNode||r,p=a.join(",")}if(p)try{return S.apply(s,x.call(h.querySelectorAll(p),0)),s}catch(v){}finally{l||r.removeAttribute("id")}}return t(e,r,s,o,u)},u&&(K(function(t){e=u.call(t,"div");try{u.call(t,"[test!='']:sizzle"),s.push("!=",H)}catch(n){}}),s=new RegExp(s.join("|")),nt.matchesSelector=function(t,n){n=n.replace(r,"='$1']");if(!o(t)&&!s.test(n)&&!i.test(n))try{var a=u.call(t,n);if(a||e||t.document&&t.document.nodeType!==11)return a}catch(f){}return nt(n,null,null,[t]).length>0})}(),i.pseudos.nth=i.pseudos.eq,i.filters=mt.prototype=i.pseudos,i.setFilters=new mt,nt.attr=v.attr,v.find=nt,v.expr=nt.selectors,v.expr[":"]=v.expr.pseudos,v.unique=nt.uniqueSort,v.text=nt.getText,v.isXMLDoc=nt.isXML,v.contains=nt.contains}(e);var nt=/Until$/,rt=/^(?:parents|prev(?:Until|All))/,it=/^.[^:#\[\.,]*$/,st=v.expr.match.needsContext,ot={children:!0,contents:!0,next:!0,prev:!0};v.fn.extend({find:function(e){var t,n,r,i,s,o,u=this;if(typeof e!="string")return v(e).filter(function(){for(t=0,n=u.length;t0)for(i=r;i=0:v.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,r=0,i=this.length,s=[],o=st.test(e)||typeof e!="string"?v(e,t||this.context):0;for(;r-1:v.find.matchesSelector(n,e)){s.push(n);break}n=n.parentNode}}return s=s.length>1?v.unique(s):s,this.pushStack(s,"closest",e)},index:function(e){return e?typeof e=="string"?v.inArray(this[0],v(e)):v.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(e,t){var n=typeof e=="string"?v(e,t):v.makeArray(e&&e.nodeType?[e]:e),r=v.merge(this.get(),n);return this.pushStack(ut(n[0])||ut(r[0])?r:v.unique(r))},addBack:function(e){return this.add(e==null?this.prevObject:this.prevObject.filter(e))}}),v.fn.andSelf=v.fn.addBack,v.each({parent:function(e){var t=e.parentNode;return t&&t.nodeType!==11?t:null},parents:function(e){return v.dir(e,"parentNode")},parentsUntil:function(e,t,n){return v.dir(e,"parentNode",n)},next:function(e){return at(e,"nextSibling")},prev:function(e){return at(e,"previousSibling")},nextAll:function(e){return v.dir(e,"nextSibling")},prevAll:function(e){return v.dir(e,"previousSibling")},nextUntil:function(e,t,n){return v.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return v.dir(e,"previousSibling",n)},siblings:function(e){return v.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return v.sibling(e.firstChild)},contents:function(e){return v.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:v.merge([],e.childNodes)}},function(e,t){v.fn[e]=function(n,r){var i=v.map(this,t,n);return nt.test(e)||(r=n),r&&typeof r=="string"&&(i=v.filter(r,i)),i=this.length>1&&!ot[e]?v.unique(i):i,this.length>1&&rt.test(e)&&(i=i.reverse()),this.pushStack(i,e,l.call(arguments).join(","))}}),v.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),t.length===1?v.find.matchesSelector(t[0],e)?[t[0]]:[]:v.find.matches(e,t)},dir:function(e,n,r){var i=[],s=e[n];while(s&&s.nodeType!==9&&(r===t||s.nodeType!==1||!v(s).is(r)))s.nodeType===1&&i.push(s),s=s[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)e.nodeType===1&&e!==t&&n.push(e);return n}});var ct="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",ht=/ jQuery\d+="(?:null|\d+)"/g,pt=/^\s+/,dt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,vt=/<([\w:]+)/,mt=/]","i"),Et=/^(?:checkbox|radio)$/,St=/checked\s*(?:[^=]|=\s*.checked.)/i,xt=/\/(java|ecma)script/i,Tt=/^\s*\s*$/g,Nt={option:[1,""],legend:[1,"
    ","
    "],thead:[1,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],col:[2,"","
    "],area:[1,"",""],_default:[0,"",""]},Ct=lt(i),kt=Ct.appendChild(i.createElement("div"));Nt.optgroup=Nt.option,Nt.tbody=Nt.tfoot=Nt.colgroup=Nt.caption=Nt.thead,Nt.th=Nt.td,v.support.htmlSerialize||(Nt._default=[1,"X
    ","
    "]),v.fn.extend({text:function(e){return v.access(this,function(e){return e===t?v.text(this):this.empty().append((this[0]&&this[0].ownerDocument||i).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(v.isFunction(e))return this.each(function(t){v(this).wrapAll(e.call(this,t))});if(this[0]){var t=v(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&e.firstChild.nodeType===1)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return v.isFunction(e)?this.each(function(t){v(this).wrapInner(e.call(this,t))}):this.each(function(){var t=v(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=v.isFunction(e);return this.each(function(n){v(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){v.nodeName(this,"body")||v(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(e,this.firstChild)})},before:function(){if(!ut(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this)});if(arguments.length){var e=v.clean(arguments);return this.pushStack(v.merge(e,this),"before",this.selector)}},after:function(){if(!ut(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this.nextSibling)});if(arguments.length){var e=v.clean(arguments);return this.pushStack(v.merge(this,e),"after",this.selector)}},remove:function(e,t){var n,r=0;for(;(n=this[r])!=null;r++)if(!e||v.filter(e,[n]).length)!t&&n.nodeType===1&&(v.cleanData(n.getElementsByTagName("*")),v.cleanData([n])),n.parentNode&&n.parentNode.removeChild(n);return this},empty:function(){var e,t=0;for(;(e=this[t])!=null;t++){e.nodeType===1&&v.cleanData(e.getElementsByTagName("*"));while(e.firstChild)e.removeChild(e.firstChild)}return this},clone:function(e,t){return e=e==null?!1:e,t=t==null?e:t,this.map(function(){return v.clone(this,e,t)})},html:function(e){return v.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return n.nodeType===1?n.innerHTML.replace(ht,""):t;if(typeof e=="string"&&!yt.test(e)&&(v.support.htmlSerialize||!wt.test(e))&&(v.support.leadingWhitespace||!pt.test(e))&&!Nt[(vt.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(dt,"<$1>");try{for(;r1&&typeof f=="string"&&St.test(f))return this.each(function(){v(this).domManip(e,n,r)});if(v.isFunction(f))return this.each(function(i){var s=v(this);e[0]=f.call(this,i,n?s.html():t),s.domManip(e,n,r)});if(this[0]){i=v.buildFragment(e,this,l),o=i.fragment,s=o.firstChild,o.childNodes.length===1&&(o=s);if(s){n=n&&v.nodeName(s,"tr");for(u=i.cacheable||c-1;a0?this.clone(!0):this).get(),v(o[i])[t](r),s=s.concat(r);return this.pushStack(s,e,o.selector)}}),v.extend({clone:function(e,t,n){var r,i,s,o;v.support.html5Clone||v.isXMLDoc(e)||!wt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(kt.innerHTML=e.outerHTML,kt.removeChild(o=kt.firstChild));if((!v.support.noCloneEvent||!v.support.noCloneChecked)&&(e.nodeType===1||e.nodeType===11)&&!v.isXMLDoc(e)){Ot(e,o),r=Mt(e),i=Mt(o);for(s=0;r[s];++s)i[s]&&Ot(r[s],i[s])}if(t){At(e,o);if(n){r=Mt(e),i=Mt(o);for(s=0;r[s];++s)At(r[s],i[s])}}return r=i=null,o},clean:function(e,t,n,r){var s,o,u,a,f,l,c,h,p,d,m,g,y=t===i&&Ct,b=[];if(!t||typeof t.createDocumentFragment=="undefined")t=i;for(s=0;(u=e[s])!=null;s++){typeof u=="number"&&(u+="");if(!u)continue;if(typeof u=="string")if(!gt.test(u))u=t.createTextNode(u);else{y=y||lt(t),c=t.createElement("div"),y.appendChild(c),u=u.replace(dt,"<$1>"),a=(vt.exec(u)||["",""])[1].toLowerCase(),f=Nt[a]||Nt._default,l=f[0],c.innerHTML=f[1]+u+f[2];while(l--)c=c.lastChild;if(!v.support.tbody){h=mt.test(u),p=a==="table"&&!h?c.firstChild&&c.firstChild.childNodes:f[1]===""&&!h?c.childNodes:[];for(o=p.length-1;o>=0;--o)v.nodeName(p[o],"tbody")&&!p[o].childNodes.length&&p[o].parentNode.removeChild(p[o])}!v.support.leadingWhitespace&&pt.test(u)&&c.insertBefore(t.createTextNode(pt.exec(u)[0]),c.firstChild),u=c.childNodes,c.parentNode.removeChild(c)}u.nodeType?b.push(u):v.merge(b,u)}c&&(u=c=y=null);if(!v.support.appendChecked)for(s=0;(u=b[s])!=null;s++)v.nodeName(u,"input")?_t(u):typeof u.getElementsByTagName!="undefined"&&v.grep(u.getElementsByTagName("input"),_t);if(n){m=function(e){if(!e.type||xt.test(e.type))return r?r.push(e.parentNode?e.parentNode.removeChild(e):e):n.appendChild(e)};for(s=0;(u=b[s])!=null;s++)if(!v.nodeName(u,"script")||!m(u))n.appendChild(u),typeof u.getElementsByTagName!="undefined"&&(g=v.grep(v.merge([],u.getElementsByTagName("script")),m),b.splice.apply(b,[s+1,0].concat(g)),s+=g.length)}return b},cleanData:function(e,t){var n,r,i,s,o=0,u=v.expando,a=v.cache,f=v.support.deleteExpando,l=v.event.special;for(;(i=e[o])!=null;o++)if(t||v.acceptData(i)){r=i[u],n=r&&a[r];if(n){if(n.events)for(s in n.events)l[s]?v.event.remove(i,s):v.removeEvent(i,s,n.handle);a[r]&&(delete a[r],f?delete i[u]:i.removeAttribute?i.removeAttribute(u):i[u]=null,v.deletedIds.push(r))}}}}),function(){var e,t;v.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e=v.uaMatch(o.userAgent),t={},e.browser&&(t[e.browser]=!0,t.version=e.version),t.chrome?t.webkit=!0:t.webkit&&(t.safari=!0),v.browser=t,v.sub=function(){function e(t,n){return new e.fn.init(t,n)}v.extend(!0,e,this),e.superclass=this,e.fn=e.prototype=this(),e.fn.constructor=e,e.sub=this.sub,e.fn.init=function(r,i){return i&&i instanceof v&&!(i instanceof e)&&(i=e(i)),v.fn.init.call(this,r,i,t)},e.fn.init.prototype=e.fn;var t=e(i);return e}}();var Dt,Pt,Ht,Bt=/alpha\([^)]*\)/i,jt=/opacity=([^)]*)/,Ft=/^(top|right|bottom|left)$/,It=/^(none|table(?!-c[ea]).+)/,qt=/^margin/,Rt=new RegExp("^("+m+")(.*)$","i"),Ut=new RegExp("^("+m+")(?!px)[a-z%]+$","i"),zt=new RegExp("^([-+])=("+m+")","i"),Wt={BODY:"block"},Xt={position:"absolute",visibility:"hidden",display:"block"},Vt={letterSpacing:0,fontWeight:400},$t=["Top","Right","Bottom","Left"],Jt=["Webkit","O","Moz","ms"],Kt=v.fn.toggle;v.fn.extend({css:function(e,n){return v.access(this,function(e,n,r){return r!==t?v.style(e,n,r):v.css(e,n)},e,n,arguments.length>1)},show:function(){return Yt(this,!0)},hide:function(){return Yt(this)},toggle:function(e,t){var n=typeof e=="boolean";return v.isFunction(e)&&v.isFunction(t)?Kt.apply(this,arguments):this.each(function(){(n?e:Gt(this))?v(this).show():v(this).hide()})}}),v.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Dt(e,"opacity");return n===""?"1":n}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":v.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(!e||e.nodeType===3||e.nodeType===8||!e.style)return;var s,o,u,a=v.camelCase(n),f=e.style;n=v.cssProps[a]||(v.cssProps[a]=Qt(f,a)),u=v.cssHooks[n]||v.cssHooks[a];if(r===t)return u&&"get"in u&&(s=u.get(e,!1,i))!==t?s:f[n];o=typeof r,o==="string"&&(s=zt.exec(r))&&(r=(s[1]+1)*s[2]+parseFloat(v.css(e,n)),o="number");if(r==null||o==="number"&&isNaN(r))return;o==="number"&&!v.cssNumber[a]&&(r+="px");if(!u||!("set"in u)||(r=u.set(e,r,i))!==t)try{f[n]=r}catch(l){}},css:function(e,n,r,i){var s,o,u,a=v.camelCase(n);return n=v.cssProps[a]||(v.cssProps[a]=Qt(e.style,a)),u=v.cssHooks[n]||v.cssHooks[a],u&&"get"in u&&(s=u.get(e,!0,i)),s===t&&(s=Dt(e,n)),s==="normal"&&n in Vt&&(s=Vt[n]),r||i!==t?(o=parseFloat(s),r||v.isNumeric(o)?o||0:s):s},swap:function(e,t,n){var r,i,s={};for(i in t)s[i]=e.style[i],e.style[i]=t[i];r=n.call(e);for(i in t)e.style[i]=s[i];return r}}),e.getComputedStyle?Dt=function(t,n){var r,i,s,o,u=e.getComputedStyle(t,null),a=t.style;return u&&(r=u.getPropertyValue(n)||u[n],r===""&&!v.contains(t.ownerDocument,t)&&(r=v.style(t,n)),Ut.test(r)&&qt.test(n)&&(i=a.width,s=a.minWidth,o=a.maxWidth,a.minWidth=a.maxWidth=a.width=r,r=u.width,a.width=i,a.minWidth=s,a.maxWidth=o)),r}:i.documentElement.currentStyle&&(Dt=function(e,t){var n,r,i=e.currentStyle&&e.currentStyle[t],s=e.style;return i==null&&s&&s[t]&&(i=s[t]),Ut.test(i)&&!Ft.test(t)&&(n=s.left,r=e.runtimeStyle&&e.runtimeStyle.left,r&&(e.runtimeStyle.left=e.currentStyle.left),s.left=t==="fontSize"?"1em":i,i=s.pixelLeft+"px",s.left=n,r&&(e.runtimeStyle.left=r)),i===""?"auto":i}),v.each(["height","width"],function(e,t){v.cssHooks[t]={get:function(e,n,r){if(n)return e.offsetWidth===0&&It.test(Dt(e,"display"))?v.swap(e,Xt,function(){return tn(e,t,r)}):tn(e,t,r)},set:function(e,n,r){return Zt(e,n,r?en(e,t,r,v.support.boxSizing&&v.css(e,"boxSizing")==="border-box"):0)}}}),v.support.opacity||(v.cssHooks.opacity={get:function(e,t){return jt.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=v.isNumeric(t)?"alpha(opacity="+t*100+")":"",s=r&&r.filter||n.filter||"";n.zoom=1;if(t>=1&&v.trim(s.replace(Bt,""))===""&&n.removeAttribute){n.removeAttribute("filter");if(r&&!r.filter)return}n.filter=Bt.test(s)?s.replace(Bt,i):s+" "+i}}),v(function(){v.support.reliableMarginRight||(v.cssHooks.marginRight={get:function(e,t){return v.swap(e,{display:"inline-block"},function(){if(t)return Dt(e,"marginRight")})}}),!v.support.pixelPosition&&v.fn.position&&v.each(["top","left"],function(e,t){v.cssHooks[t]={get:function(e,n){if(n){var r=Dt(e,t);return Ut.test(r)?v(e).position()[t]+"px":r}}}})}),v.expr&&v.expr.filters&&(v.expr.filters.hidden=function(e){return e.offsetWidth===0&&e.offsetHeight===0||!v.support.reliableHiddenOffsets&&(e.style&&e.style.display||Dt(e,"display"))==="none"},v.expr.filters.visible=function(e){return!v.expr.filters.hidden(e)}),v.each({margin:"",padding:"",border:"Width"},function(e,t){v.cssHooks[e+t]={expand:function(n){var r,i=typeof n=="string"?n.split(" "):[n],s={};for(r=0;r<4;r++)s[e+$t[r]+t]=i[r]||i[r-2]||i[0];return s}},qt.test(e)||(v.cssHooks[e+t].set=Zt)});var rn=/%20/g,sn=/\[\]$/,on=/\r?\n/g,un=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,an=/^(?:select|textarea)/i;v.fn.extend({serialize:function(){return v.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?v.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||an.test(this.nodeName)||un.test(this.type))}).map(function(e,t){var n=v(this).val();return n==null?null:v.isArray(n)?v.map(n,function(e,n){return{name:t.name,value:e.replace(on,"\r\n")}}):{name:t.name,value:n.replace(on,"\r\n")}}).get()}}),v.param=function(e,n){var r,i=[],s=function(e,t){t=v.isFunction(t)?t():t==null?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};n===t&&(n=v.ajaxSettings&&v.ajaxSettings.traditional);if(v.isArray(e)||e.jquery&&!v.isPlainObject(e))v.each(e,function(){s(this.name,this.value)});else for(r in e)fn(r,e[r],n,s);return i.join("&").replace(rn,"+")};var ln,cn,hn=/#.*$/,pn=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,dn=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,vn=/^(?:GET|HEAD)$/,mn=/^\/\//,gn=/\?/,yn=/)<[^<]*)*<\/script>/gi,bn=/([?&])_=[^&]*/,wn=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,En=v.fn.load,Sn={},xn={},Tn=["*/"]+["*"];try{cn=s.href}catch(Nn){cn=i.createElement("a"),cn.href="",cn=cn.href}ln=wn.exec(cn.toLowerCase())||[],v.fn.load=function(e,n,r){if(typeof e!="string"&&En)return En.apply(this,arguments);if(!this.length)return this;var i,s,o,u=this,a=e.indexOf(" ");return a>=0&&(i=e.slice(a,e.length),e=e.slice(0,a)),v.isFunction(n)?(r=n,n=t):n&&typeof n=="object"&&(s="POST"),v.ajax({url:e,type:s,dataType:"html",data:n,complete:function(e,t){r&&u.each(r,o||[e.responseText,t,e])}}).done(function(e){o=arguments,u.html(i?v("
    ").append(e.replace(yn,"")).find(i):e)}),this},v.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,t){v.fn[t]=function(e){return this.on(t,e)}}),v.each(["get","post"],function(e,n){v[n]=function(e,r,i,s){return v.isFunction(r)&&(s=s||i,i=r,r=t),v.ajax({type:n,url:e,data:r,success:i,dataType:s})}}),v.extend({getScript:function(e,n){return v.get(e,t,n,"script")},getJSON:function(e,t,n){return v.get(e,t,n,"json")},ajaxSetup:function(e,t){return t?Ln(e,v.ajaxSettings):(t=e,e=v.ajaxSettings),Ln(e,t),e},ajaxSettings:{url:cn,isLocal:dn.test(ln[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":Tn},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":v.parseJSON,"text xml":v.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:Cn(Sn),ajaxTransport:Cn(xn),ajax:function(e,n){function T(e,n,s,a){var l,y,b,w,S,T=n;if(E===2)return;E=2,u&&clearTimeout(u),o=t,i=a||"",x.readyState=e>0?4:0,s&&(w=An(c,x,s));if(e>=200&&e<300||e===304)c.ifModified&&(S=x.getResponseHeader("Last-Modified"),S&&(v.lastModified[r]=S),S=x.getResponseHeader("Etag"),S&&(v.etag[r]=S)),e===304?(T="notmodified",l=!0):(l=On(c,w),T=l.state,y=l.data,b=l.error,l=!b);else{b=T;if(!T||e)T="error",e<0&&(e=0)}x.status=e,x.statusText=(n||T)+"",l?d.resolveWith(h,[y,T,x]):d.rejectWith(h,[x,T,b]),x.statusCode(g),g=t,f&&p.trigger("ajax"+(l?"Success":"Error"),[x,c,l?y:b]),m.fireWith(h,[x,T]),f&&(p.trigger("ajaxComplete",[x,c]),--v.active||v.event.trigger("ajaxStop"))}typeof e=="object"&&(n=e,e=t),n=n||{};var r,i,s,o,u,a,f,l,c=v.ajaxSetup({},n),h=c.context||c,p=h!==c&&(h.nodeType||h instanceof v)?v(h):v.event,d=v.Deferred(),m=v.Callbacks("once memory"),g=c.statusCode||{},b={},w={},E=0,S="canceled",x={readyState:0,setRequestHeader:function(e,t){if(!E){var n=e.toLowerCase();e=w[n]=w[n]||e,b[e]=t}return this},getAllResponseHeaders:function(){return E===2?i:null},getResponseHeader:function(e){var n;if(E===2){if(!s){s={};while(n=pn.exec(i))s[n[1].toLowerCase()]=n[2]}n=s[e.toLowerCase()]}return n===t?null:n},overrideMimeType:function(e){return E||(c.mimeType=e),this},abort:function(e){return e=e||S,o&&o.abort(e),T(0,e),this}};d.promise(x),x.success=x.done,x.error=x.fail,x.complete=m.add,x.statusCode=function(e){if(e){var t;if(E<2)for(t in e)g[t]=[g[t],e[t]];else t=e[x.status],x.always(t)}return this},c.url=((e||c.url)+"").replace(hn,"").replace(mn,ln[1]+"//"),c.dataTypes=v.trim(c.dataType||"*").toLowerCase().split(y),c.crossDomain==null&&(a=wn.exec(c.url.toLowerCase()),c.crossDomain=!(!a||a[1]===ln[1]&&a[2]===ln[2]&&(a[3]||(a[1]==="http:"?80:443))==(ln[3]||(ln[1]==="http:"?80:443)))),c.data&&c.processData&&typeof c.data!="string"&&(c.data=v.param(c.data,c.traditional)),kn(Sn,c,n,x);if(E===2)return x;f=c.global,c.type=c.type.toUpperCase(),c.hasContent=!vn.test(c.type),f&&v.active++===0&&v.event.trigger("ajaxStart");if(!c.hasContent){c.data&&(c.url+=(gn.test(c.url)?"&":"?")+c.data,delete c.data),r=c.url;if(c.cache===!1){var N=v.now(),C=c.url.replace(bn,"$1_="+N);c.url=C+(C===c.url?(gn.test(c.url)?"&":"?")+"_="+N:"")}}(c.data&&c.hasContent&&c.contentType!==!1||n.contentType)&&x.setRequestHeader("Content-Type",c.contentType),c.ifModified&&(r=r||c.url,v.lastModified[r]&&x.setRequestHeader("If-Modified-Since",v.lastModified[r]),v.etag[r]&&x.setRequestHeader("If-None-Match",v.etag[r])),x.setRequestHeader("Accept",c.dataTypes[0]&&c.accepts[c.dataTypes[0]]?c.accepts[c.dataTypes[0]]+(c.dataTypes[0]!=="*"?", "+Tn+"; q=0.01":""):c.accepts["*"]);for(l in c.headers)x.setRequestHeader(l,c.headers[l]);if(!c.beforeSend||c.beforeSend.call(h,x,c)!==!1&&E!==2){S="abort";for(l in{success:1,error:1,complete:1})x[l](c[l]);o=kn(xn,c,n,x);if(!o)T(-1,"No Transport");else{x.readyState=1,f&&p.trigger("ajaxSend",[x,c]),c.async&&c.timeout>0&&(u=setTimeout(function(){x.abort("timeout")},c.timeout));try{E=1,o.send(b,T)}catch(k){if(!(E<2))throw k;T(-1,k)}}return x}return x.abort()},active:0,lastModified:{},etag:{}});var Mn=[],_n=/\?/,Dn=/(=)\?(?=&|$)|\?\?/,Pn=v.now();v.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Mn.pop()||v.expando+"_"+Pn++;return this[e]=!0,e}}),v.ajaxPrefilter("json jsonp",function(n,r,i){var s,o,u,a=n.data,f=n.url,l=n.jsonp!==!1,c=l&&Dn.test(f),h=l&&!c&&typeof a=="string"&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Dn.test(a);if(n.dataTypes[0]==="jsonp"||c||h)return s=n.jsonpCallback=v.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,o=e[s],c?n.url=f.replace(Dn,"$1"+s):h?n.data=a.replace(Dn,"$1"+s):l&&(n.url+=(_n.test(f)?"&":"?")+n.jsonp+"="+s),n.converters["script json"]=function(){return u||v.error(s+" was not called"),u[0]},n.dataTypes[0]="json",e[s]=function(){u=arguments},i.always(function(){e[s]=o,n[s]&&(n.jsonpCallback=r.jsonpCallback,Mn.push(s)),u&&v.isFunction(o)&&o(u[0]),u=o=t}),"script"}),v.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(e){return v.globalEval(e),e}}}),v.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),v.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=i.head||i.getElementsByTagName("head")[0]||i.documentElement;return{send:function(s,o){n=i.createElement("script"),n.async="async",e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,i){if(i||!n.readyState||/loaded|complete/.test(n.readyState))n.onload=n.onreadystatechange=null,r&&n.parentNode&&r.removeChild(n),n=t,i||o(200,"success")},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(0,1)}}}});var Hn,Bn=e.ActiveXObject?function(){for(var e in Hn)Hn[e](0,1)}:!1,jn=0;v.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&Fn()||In()}:Fn,function(e){v.extend(v.support,{ajax:!!e,cors:!!e&&"withCredentials"in e})}(v.ajaxSettings.xhr()),v.support.ajax&&v.ajaxTransport(function(n){if(!n.crossDomain||v.support.cors){var r;return{send:function(i,s){var o,u,a=n.xhr();n.username?a.open(n.type,n.url,n.async,n.username,n.password):a.open(n.type,n.url,n.async);if(n.xhrFields)for(u in n.xhrFields)a[u]=n.xhrFields[u];n.mimeType&&a.overrideMimeType&&a.overrideMimeType(n.mimeType),!n.crossDomain&&!i["X-Requested-With"]&&(i["X-Requested-With"]="XMLHttpRequest");try{for(u in i)a.setRequestHeader(u,i[u])}catch(f){}a.send(n.hasContent&&n.data||null),r=function(e,i){var u,f,l,c,h;try{if(r&&(i||a.readyState===4)){r=t,o&&(a.onreadystatechange=v.noop,Bn&&delete Hn[o]);if(i)a.readyState!==4&&a.abort();else{u=a.status,l=a.getAllResponseHeaders(),c={},h=a.responseXML,h&&h.documentElement&&(c.xml=h);try{c.text=a.responseText}catch(p){}try{f=a.statusText}catch(p){f=""}!u&&n.isLocal&&!n.crossDomain?u=c.text?200:404:u===1223&&(u=204)}}}catch(d){i||s(-1,d)}c&&s(u,f,c,l)},n.async?a.readyState===4?setTimeout(r,0):(o=++jn,Bn&&(Hn||(Hn={},v(e).unload(Bn)),Hn[o]=r),a.onreadystatechange=r):r()},abort:function(){r&&r(0,1)}}}});var qn,Rn,Un=/^(?:toggle|show|hide)$/,zn=new RegExp("^(?:([-+])=|)("+m+")([a-z%]*)$","i"),Wn=/queueHooks$/,Xn=[Gn],Vn={"*":[function(e,t){var n,r,i=this.createTween(e,t),s=zn.exec(t),o=i.cur(),u=+o||0,a=1,f=20;if(s){n=+s[2],r=s[3]||(v.cssNumber[e]?"":"px");if(r!=="px"&&u){u=v.css(i.elem,e,!0)||n||1;do a=a||".5",u/=a,v.style(i.elem,e,u+r);while(a!==(a=i.cur()/o)&&a!==1&&--f)}i.unit=r,i.start=u,i.end=s[1]?u+(s[1]+1)*n:n}return i}]};v.Animation=v.extend(Kn,{tweener:function(e,t){v.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;r-1,f={},l={},c,h;a?(l=i.position(),c=l.top,h=l.left):(c=parseFloat(o)||0,h=parseFloat(u)||0),v.isFunction(t)&&(t=t.call(e,n,s)),t.top!=null&&(f.top=t.top-s.top+c),t.left!=null&&(f.left=t.left-s.left+h),"using"in t?t.using.call(e,f):i.css(f)}},v.fn.extend({position:function(){if(!this[0])return;var e=this[0],t=this.offsetParent(),n=this.offset(),r=er.test(t[0].nodeName)?{top:0,left:0}:t.offset();return n.top-=parseFloat(v.css(e,"marginTop"))||0,n.left-=parseFloat(v.css(e,"marginLeft"))||0,r.top+=parseFloat(v.css(t[0],"borderTopWidth"))||0,r.left+=parseFloat(v.css(t[0],"borderLeftWidth"))||0,{top:n.top-r.top,left:n.left-r.left}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||i.body;while(e&&!er.test(e.nodeName)&&v.css(e,"position")==="static")e=e.offsetParent;return e||i.body})}}),v.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);v.fn[e]=function(i){return v.access(this,function(e,i,s){var o=tr(e);if(s===t)return o?n in o?o[n]:o.document.documentElement[i]:e[i];o?o.scrollTo(r?v(o).scrollLeft():s,r?s:v(o).scrollTop()):e[i]=s},e,i,arguments.length,null)}}),v.each({Height:"height",Width:"width"},function(e,n){v.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){v.fn[i]=function(i,s){var o=arguments.length&&(r||typeof i!="boolean"),u=r||(i===!0||s===!0?"margin":"border");return v.access(this,function(n,r,i){var s;return v.isWindow(n)?n.document.documentElement["client"+e]:n.nodeType===9?(s=n.documentElement,Math.max(n.body["scroll"+e],s["scroll"+e],n.body["offset"+e],s["offset"+e],s["client"+e])):i===t?v.css(n,r,i,u):v.style(n,r,i,u)},n,o?i:t,o,null)}})}),e.jQuery=e.$=v,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return v})})(window); \ No newline at end of file From 77918bd2a7d361d03fbb20301cafd888994e6cac Mon Sep 17 00:00:00 2001 From: yama Date: Tue, 27 Aug 2013 13:13:57 +0900 Subject: [PATCH 373/530] Refactor #10131 Update jQuery version (1.4.4 -> 1.8.3) http://tracker.modx.com/issues/10131 --- install/assets/plugins/mgrmgr.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/assets/plugins/mgrmgr.tpl b/install/assets/plugins/mgrmgr.tpl index d060d9c4a6..674fa37917 100644 --- a/install/assets/plugins/mgrmgr.tpl +++ b/install/assets/plugins/mgrmgr.tpl @@ -16,6 +16,6 @@ $js_default_url_local = $modx->config['site_url']. '/assets/js/jquery.min.js'; -$js_default_url_remote = 'http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js'; +$js_default_url_remote = 'http://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js'; $asset_path = $modx->config['base_path'] . 'assets/plugins/managermanager/mm.inc.php'; include($asset_path); From f41673041537ac559a7c0406a785ea816db4dedc Mon Sep 17 00:00:00 2001 From: yama Date: Tue, 27 Aug 2013 13:34:57 +0900 Subject: [PATCH 374/530] maybe typo --- manager/includes/lang/english.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manager/includes/lang/english.inc.php b/manager/includes/lang/english.inc.php index 3e0f12ae35..1f84d2f499 100755 --- a/manager/includes/lang/english.inc.php +++ b/manager/includes/lang/english.inc.php @@ -1191,7 +1191,7 @@ $_lang["setting_resource_tree_node_name_desc"] = 'Specify the Resource field to use when rendering the nodes in the Resource Tree. Defaults to pagetitle, although any Resource field can be used, such as menutitle, alias.'; $_lang['resource_opt_is_published'] = 'Published'; -$_lang["docid_incrmnt_method_title"] = 'Intsrement method Resource ID'; +$_lang["docid_incrmnt_method_title"] = 'Increment method Resource ID'; $_lang["docid_incrmnt_method_0"] = 'DB auto increment'; $_lang["docid_incrmnt_method_1"] = 'Minimum missed ID'; $_lang["docid_incrmnt_method_2"] = 'Maximal ID+1'; From f89de3cc2822fdf3c416f44d0f9102134a9d7970 Mon Sep 17 00:00:00 2001 From: yama Date: Tue, 27 Aug 2013 13:59:35 +0900 Subject: [PATCH 375/530] Fix - restore function --- manager/actions/bkmanager.static.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manager/actions/bkmanager.static.php b/manager/actions/bkmanager.static.php index 2a3d62b346..793202a051 100644 --- a/manager/actions/bkmanager.static.php +++ b/manager/actions/bkmanager.static.php @@ -478,7 +478,7 @@ function createDump($callBack) { // Set line feed $lf = "\n"; - $tempfile_path = $modx->config['base_path'] . 'temp/backup/temp.php'; + $tempfile_path = $modx->config['base_path'] . 'assets/backup/temp.php'; $result = $modx->db->query('SHOW TABLES'); $tables = $this->result2Array(0, $result); From c5f800e757cdcc9d4c8d0abda1f9a45f0b70f6fe Mon Sep 17 00:00:00 2001 From: yama Date: Tue, 27 Aug 2013 14:06:35 +0900 Subject: [PATCH 376/530] Fix - Backup manager --- manager/actions/bkmanager.static.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manager/actions/bkmanager.static.php b/manager/actions/bkmanager.static.php index 793202a051..113c3d1788 100644 --- a/manager/actions/bkmanager.static.php +++ b/manager/actions/bkmanager.static.php @@ -91,7 +91,7 @@ } if(!is_writable(rtrim($modx->config['snapshot_path'],'/'))) { - echo parsePlaceholder($_lang["bkmgr_alert_mkdir"],$modx->config['snapshot_path']); + echo parsePlaceholder($_lang["bkmgr_alert_mkdir"],array('snapshot_path'=>$modx->config['snapshot_path'])); exit; } $escaped_table_prefix = str_replace('_', '\\_', $table_prefix); @@ -645,7 +645,7 @@ function import_sql($source,$result_code='import_ok') $_SESSION['result_msg'] = $result_code; } -function callBack(&$dumpstring) { +function dumpSql(&$dumpstring) { global $modx; $today = $modx->toDateFormat(time(),'dateOnly'); $today = str_replace('/', '-', $today); From 5b4d810551af2efd916deda8f4c276b7112d6a57 Mon Sep 17 00:00:00 2001 From: Dmi3yy Date: Tue, 27 Aug 2013 08:15:57 +0300 Subject: [PATCH 377/530] fix setting html --- manager/actions/mutate_settings.dynamic.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manager/actions/mutate_settings.dynamic.php b/manager/actions/mutate_settings.dynamic.php index 6f4103aee7..dc69cf94b6 100644 --- a/manager/actions/mutate_settings.dynamic.php +++ b/manager/actions/mutate_settings.dynamic.php @@ -508,7 +508,7 @@ function confirmLangChange(el, lkey, elupd){
    - +
    /> From 13a6142dd6b626552c700dc11a7ba402467de03a Mon Sep 17 00:00:00 2001 From: Dmi3yy Date: Tue, 27 Aug 2013 08:16:43 +0300 Subject: [PATCH 378/530] fix setup default value --- install/setup.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/install/setup.sql b/install/setup.sql index b2f5e9abaf..741597fa11 100755 --- a/install/setup.sql +++ b/install/setup.sql @@ -893,6 +893,7 @@ INSERT IGNORE INTO `{PREFIX}system_settings` ('denyZipDownload', '0'), ('denyExtensionRename', '0'), ('showHiddenFiles', '0'), +('docid_incrmnt_method', '0'), ('make_folders', '0'); From f776daabc4f22d554a62d1769a2f123f50049045 Mon Sep 17 00:00:00 2001 From: Dmi3yy Date: Tue, 27 Aug 2013 08:22:19 +0300 Subject: [PATCH 379/530] fix modx manager path --- manager/includes/document.parser.class.inc.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/manager/includes/document.parser.class.inc.php b/manager/includes/document.parser.class.inc.php index aee0060f16..c7848ccaa8 100755 --- a/manager/includes/document.parser.class.inc.php +++ b/manager/includes/document.parser.class.inc.php @@ -111,14 +111,14 @@ function loadExtension($extname) { // PHPMailer case 'MODxMailer' : - include_once(MODX_BASE_PATH . 'manager/includes/extenders/modxmailer.class.inc.php'); + include_once(MODX_MANAGER_PATH . 'includes/extenders/modxmailer.class.inc.php'); $this->mail= new MODxMailer; if($this->mail) return true; else return false; break; case 'EXPORT_SITE' : - if(include_once(MODX_BASE_PATH . 'manager/includes/extenders/export.class.inc.php')) + if(include_once(MODX_MANAGER_PATH . 'includes/extenders/export.class.inc.php')) { $this->export= new EXPORT_SITE; return true; @@ -127,7 +127,7 @@ function loadExtension($extname) { break; case 'PHPCOMPAT' : if(is_object($this->phpcompat)) return; - include_once(MODX_BASE_PATH . 'manager/includes/extenders/phpcompat.class.inc.php'); + include_once(MODX_MANAGER_PATH . 'includes/extenders/phpcompat.class.inc.php'); $this->phpcompat = new PHPCOMPAT; break; From 959f1d4e1734ad95daa3b5eb15cd0599facfa772 Mon Sep 17 00:00:00 2001 From: yama Date: Tue, 27 Aug 2013 14:43:38 +0900 Subject: [PATCH 380/530] Refactor #10132 QM - Update jQuery ColorBox plugin http://tracker.modx.com/issues/10132 --- assets/plugins/qm/css/colorbox.css | 90 ++++++++++-------- assets/plugins/qm/css/images/controls.png | Bin 1249 -> 2893 bytes .../qm/css/images/internet_explorer/Thumbs.db | Bin 5632 -> 0 bytes assets/plugins/qm/css/images/loading.gif | Bin 0 -> 9427 bytes assets/plugins/qm/css/style.css | 23 ++--- assets/plugins/qm/js/jquery.colorbox-min.js | 11 ++- 6 files changed, 70 insertions(+), 54 deletions(-) delete mode 100755 assets/plugins/qm/css/images/internet_explorer/Thumbs.db create mode 100644 assets/plugins/qm/css/images/loading.gif diff --git a/assets/plugins/qm/css/colorbox.css b/assets/plugins/qm/css/colorbox.css index 518e8d8773..1dedd90f11 100755 --- a/assets/plugins/qm/css/colorbox.css +++ b/assets/plugins/qm/css/colorbox.css @@ -1,57 +1,69 @@ /* - ColorBox Core Style - The following rules are the styles that are consistant between themes. - Avoid changing this area to maintain compatability with future versions of ColorBox. + Colorbox Core Style: + The following CSS is consistent between example themes and should not be altered. */ #colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;} #cboxOverlay{position:fixed; width:100%; height:100%;} #cboxMiddleLeft, #cboxBottomLeft{clear:left;} -#cboxContent{position:relative; overflow:hidden;} -#cboxLoadedContent{overflow:auto;} -#cboxLoadedContent iframe{display:block; width:100%; height:100%; border:0;} +#cboxContent{position:relative;} +#cboxLoadedContent{overflow:auto; -webkit-overflow-scrolling: touch;} #cboxTitle{margin:0;} -#cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%;} +#cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%; height:100%;} #cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;} +.cboxPhoto{float:left; margin:auto; border:0; display:block; max-width:none; -ms-interpolation-mode:bicubic;} +.cboxIframe{width:100%; height:100%; display:block; border:0;} +#colorbox, #cboxContent, #cboxLoadedContent{box-sizing:content-box; -moz-box-sizing:content-box; -webkit-box-sizing:content-box;} /* - Example user style - The following rules are ordered and tabbed in a way that represents the - order/nesting of the generated HTML, so that the structure easier to understand. + User Style: + Change the following styles to modify the appearance of Colorbox. They are + ordered & tabbed in a way that represents the nesting of the generated HTML. */ -#cboxOverlay{background:#000;} -#colorbox{} - #cboxTopLeft{width:21px; height:21px; background:url(images/controls.png) -100px 0 no-repeat;} - #cboxTopRight{width:21px; height:21px; background:url(images/controls.png) -129px 0 no-repeat;} - #cboxBottomLeft{width:21px; height:21px; background:url(images/controls.png) -100px -29px no-repeat;} - #cboxBottomRight{width:21px; height:21px; background:url(images/controls.png) -129px -29px no-repeat;} +#cboxOverlay{background:url(images/overlay.png) repeat 0 0;} +#colorbox{outline:0;} + #cboxTopLeft{width:21px; height:21px; background:url(images/controls.png) no-repeat -101px 0;} + #cboxTopRight{width:21px; height:21px; background:url(images/controls.png) no-repeat -130px 0;} + #cboxBottomLeft{width:21px; height:21px; background:url(images/controls.png) no-repeat -101px -29px;} + #cboxBottomRight{width:21px; height:21px; background:url(images/controls.png) no-repeat -130px -29px;} #cboxMiddleLeft{width:21px; background:url(images/controls.png) left top repeat-y;} #cboxMiddleRight{width:21px; background:url(images/controls.png) right top repeat-y;} #cboxTopCenter{height:21px; background:url(images/border.png) 0 0 repeat-x;} #cboxBottomCenter{height:21px; background:url(images/border.png) 0 -29px repeat-x;} - #cboxContent{background:#fff;} + #cboxContent{background:#fff; overflow:hidden;} + .cboxIframe{background:#fff;} + #cboxError{padding:50px; border:1px solid #ccc;} #cboxLoadedContent{margin-bottom:28px;} - #cboxTitle{position:absolute; bottom:3px; left:0; text-align:center; width:100%; color:#949494;} - #cboxCurrent{position:absolute; bottom:3px; left:58px; color:#949494;} - #cboxSlideshow{position:absolute; bottom:3px; right:30px; color:#0092ef;} - #cboxPrevious{position:absolute; bottom:0; left:0px; background:url(images/controls.png) -75px 0px no-repeat; width:25px; height:25px; text-indent:-9999px;} - #cboxPrevious.hover{background-position:-75px -25px;} - #cboxNext{position:absolute; bottom:0; left:27px; background:url(images/controls.png) -50px 0px no-repeat; width:25px; height:25px; text-indent:-9999px;} - #cboxNext.hover{background-position:-50px -25px;} - #cboxLoadingOverlay{background:url(images/loading_background.png) center center no-repeat;} - #cboxLoadingGraphic{background:url(images/ajax-loader.gif) center center no-repeat;} - #cboxClose{position:absolute; bottom:0; right:0; background:url(images/controls.png) -25px 0px no-repeat; width:25px; height:25px; text-indent:-9999px;} - #cboxClose.hover{background-position:-25px -25px;} + #cboxTitle{position:absolute; bottom:4px; left:0; text-align:center; width:100%; color:#949494;} + #cboxCurrent{position:absolute; bottom:4px; left:58px; color:#949494;} + #cboxLoadingOverlay{background:url(images/loading_background.png) no-repeat center center;} + #cboxLoadingGraphic{background:url(images/loading.gif) no-repeat center center;} + + /* these elements are buttons, and may need to have additional styles reset to avoid unwanted base styles */ + #cboxPrevious, #cboxNext, #cboxSlideshow, #cboxClose {border:0; padding:0; margin:0; overflow:visible; width:auto; background:none; } + + /* avoid outlines on :active (mouseclick), but preserve outlines on :focus (tabbed navigating) */ + #cboxPrevious:active, #cboxNext:active, #cboxSlideshow:active, #cboxClose:active {outline:0;} + + #cboxSlideshow{position:absolute; bottom:4px; right:30px; color:#0092ef;} + #cboxPrevious{position:absolute; bottom:0; left:0; background:url(images/controls.png) no-repeat -75px 0; width:25px; height:25px; text-indent:-9999px;} + #cboxPrevious:hover{background-position:-75px -25px;} + #cboxNext{position:absolute; bottom:0; left:27px; background:url(images/controls.png) no-repeat -50px 0; width:25px; height:25px; text-indent:-9999px;} + #cboxNext:hover{background-position:-50px -25px;} + #cboxClose{position:absolute; bottom:0; right:0; background:url(images/controls.png) no-repeat -25px 0; width:25px; height:25px; text-indent:-9999px;} + #cboxClose:hover{background-position:-25px -25px;} /* - The following fixes png-transparency for IE6. - It is also necessary for png-transparency in IE7 & IE8 to avoid 'black halos' with the fade transition - - Since this method does not support CSS background-positioning, it is incompatible with CSS sprites. - Colorbox preloads navigation hover classes to account for this. - - !! Important Note: AlphaImageLoader src paths are relative to the HTML document, - while regular CSS background images are relative to the CSS document. - - => Moved to qm.inc.php for friendly url compatibility + The following fixes a problem where IE7 and IE8 replace a PNG's alpha transparency with a black fill + when an alpha filter (opacity change) is set on the element or ancestor element. This style is not applied to or needed in IE9. + See: http://jacklmoore.com/notes/ie-transparency-problems/ */ - +.cboxIE #cboxTopLeft, +.cboxIE #cboxTopCenter, +.cboxIE #cboxTopRight, +.cboxIE #cboxBottomLeft, +.cboxIE #cboxBottomCenter, +.cboxIE #cboxBottomRight, +.cboxIE #cboxMiddleLeft, +.cboxIE #cboxMiddleRight { + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#00FFFFFF,endColorstr=#00FFFFFF); +} \ No newline at end of file diff --git a/assets/plugins/qm/css/images/controls.png b/assets/plugins/qm/css/images/controls.png index 9257176616c3e0a5c145e381a12ee15fa556dc8e..dcfd6fb9f178454613123d018bf742c8cc905df7 100755 GIT binary patch literal 2893 zcmV-T3$pZyP)_ZK9@9A5hhZ`zJ|^XJp&7A=Y=V7G`@Q^Xk=19M@a5{n88C2urGbw3uPN`H$U$)~*R zDG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(|MH8c;e7fRb;Z z=p`-S6U_JKknc@PUwdjST0t|wU3eP$GGPzp{xmDGa{g7q0HG}46K;LARAd7PK&#{c z7+@1EeBD34Iq+@#7|bUe`nJ!1)AxU02`UT7WBL+4;r@Q+0V0A|Q;Qs)aP5nw_5!?)*?^0x3>g-<$cLB zU7pQm9~?h#Dm0rIMbY~a>mTSc<)`naIj|E?j~RHs_RrLpETh4iq_}Tp>-+wF8GOiX z37n}fnck7qjP)fy|G56er~EN0gXD+b*EB&nPhaxM_t*57RBMrsgTa8j?itWiave|{ z^nJW9nfd0t1p6WXoOf!pl;OSW(@yK~uB*MGk$ z1Cqb$OGamSAE1%7A6QeQ@CkJIzC}aPD>IDKD8L8Uwp zD8N$+>xvXU;oyBNH_mf>Un0zeaPz*KM@m^&i|`2-zbE+j|6b!y_Ir_OkE~-m00000 LNkvXXu0mjfA+dCQ diff --git a/assets/plugins/qm/css/images/internet_explorer/Thumbs.db b/assets/plugins/qm/css/images/internet_explorer/Thumbs.db deleted file mode 100755 index 97f96690214b991246433154316f208a0ee49a02..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5632 zcmeI0dpK0v`@q+jalc>2r3(tlr4%9^OcA1RkVI(?s^O5^QEtPOj%!6aNm5iu6b`ze zj;WAxNfAmhjC)Lm#4s~^f7f&_-=4nTo~QGBe*gS_&w2O$JbSJ6uC>>C-?jF;_u9|f zr2DUwFBt$|h&jLl1QiAXpOs@^n#U)R0)P)DczFax(ccRJfXRR4|Bwf`aIC!fGyd%&4_C~ep7|>_e5E<_hHitO zbrS{)^$)~G@P4HK>e_!!u-@NPJZOxlAp6_^b^0nt*1nNW~Vi2C&Bp{Ly_zD2h5E+Op zL=J+7$U_t$iV!8p639}>GRSg>GDHQU3RwYJ2~mTnLo^_(AexZX5G{x{LjQQBiRT87XlIX$etLDS0VrSvfo&FD9v= zC@-fdBZrsc-2{V$ZE*a;{QSal;-cbme_PN8Kw5}5C@f|r;FHE+r7>tdZyjOy;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BFEJ~Xug1!^O41ONur#>f-W9%tRBieJWqM3PZ;oK?LiVe z)!;i7x}1K)&7v#dzSAfQeD>{mhgj2$CuMFT`z9H^w=R+dl_rjlJM_i)(rnBmhkw75 z<(Zgn7%_1jNHY}$xjJd=S=xYmdLU6H!ekl#0QDkX4X0B6*6IG@OQSWp$}D4qT8M)7 z?^0-@+CfT*L-w&VIqy*rXud7w^qB(ZsmbPrma2k*Q&C%XZu}Nb~u!GG{IfnVz***NP3*fv(3yj)_y7;1#LN3P(X$ub;dLH zM26d9JlUh(<-$nOsuG7#d(U?lyYKH z!qf=@vc1GpaBgpx;llj8eal{M@THFCUhoke{F z)-u9^+7t7oobO&D8m!bcdiH6-{K|CCX7>3L#gzkD;XdJ;L;c@R@skbOYn37-qD7bb zo|~9F85rogZszH*_Px;ENA0jjL)?|6)4peF9IJSaD7=$5YAmJ%?6K`lb331NlXl6U z7E#uadCpB91A?YUvTW{)&oYk}oIjQXl{kyh!4t`98F)Ll{tEM>c z1!HjTt#99tDwA!n<@4Ma6dXH3;l!qWk*DGpbBvK=?m-N8cUgTpW8~gN(O?VQm+He!)K*{&EPxT*!CCVu8&;N{oDlC7We7BCe9@A|(l{{nz`r{4eo diff --git a/assets/plugins/qm/css/images/loading.gif b/assets/plugins/qm/css/images/loading.gif new file mode 100644 index 0000000000000000000000000000000000000000..b4695d811d4f84ed693eff7b5e6b4d61a3e8c48d GIT binary patch literal 9427 zcmb{2c~}$o+BfjYkbx{fLNXyN2~I-9fRL~W0YSqMAPQmvXc3WJ1&c@(6VN-G66{!m#Dz&KKu^y_lMYNSx+iL6S@to6V&NF~*-@fnlUXMN3lYjN{kB{H` zJHPuk6Sp8%7M6_w2=Fri{G0eK0q}qQ6Mu9M|N1`u%P;s)H-1oqA2;E5d+=93<3CK` z#|(Jq2l(X{{QIx*J;k^=2|tA4&mQAH|A_D3iubhP14r@F5d6Jx{6jh3yas$&IP=`6My*}-(7^Ct;HXY;7`Z#qk24xg=aGHLJ^+fh;NY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width():n.height();return typeof a==="string"?Math.round(/%/.test(a)?b/100*parseInt(a,10):parseInt(a,10)):a}function U(b){return a.photo||/\.(gif|png|jpg|jpeg|bmp)(?:\?([^#]*))?(?:#(\.*))?$/i.test(b)}function cb(a){for(var c in a)if(b.isFunction(a[c])&&c.substring(0,2)!=="on")a[c]=a[c].call(l);a.rel=a.rel||l.rel||L;a.href=a.href||b(l).attr("href");a.title=a.title||l.title;return a}function w(c,a){a&&a.call(l);b.event.trigger(c)}function jb(){var b,e=i+"Slideshow_",c="click."+i,f,k;if(a.slideshow&&h[1]){f=function(){F.text(a.slideshowStop).unbind(c).bind(V,function(){if(g");c.open=e}a.each(function(){b.data(this,r,b.extend({},b.data(this,r)||gb,c));b(this).addClass(G)});d=c.open;if(b.isFunction(d))d=d.call(a);d&&db(a[0]);return a};d.init=function(){var l="hover",m="clear:left";n=b(ib);j=f().attr({id:r,"class":E?i+"IE":""});x=f("Overlay",X?"position:absolute":"").hide();A=f("Wrapper");s=f("Content").append(k=f(M,"width:0; height:0; overflow:hidden"),K=f("LoadingOverlay").add(f("LoadingGraphic")),Z=f("Title"),Y=f("Current"),I=f("Next"),H=f("Previous"),F=f("Slideshow").bind(fb,jb),ab=f("Close"));A.append(f().append(f("TopLeft"),bb=f("TopCenter"),f("TopRight")),f(c,m).append(T=f("MiddleLeft"),s,R=f("MiddleRight")),f(c,m).append(f("BottomLeft"),S=f("BottomCenter"),f("BottomRight"))).children().children().css({"float":"left"});J=f(c,"position:absolute; width:9999px; visibility:hidden; display:none");b("body").prepend(x,j.append(A,J));s.children().hover(function(){b(this).addClass(l)},function(){b(this).removeClass(l)}).addClass(l);B=bb.height()+S.height()+s.outerHeight(e)-s.height();C=T.width()+R.width()+s.outerWidth(e)-s.width();y=k.outerHeight(e);z=k.outerWidth(e);j.css({"padding-bottom":B,"padding-right":C}).hide();I.click(d.next);H.click(d.prev);ab.click(d.close);s.children().removeClass(l);b("."+G).live("click",function(a){if(!(a.button!==0&&typeof a.button!=="undefined"||a.ctrlKey||a.shiftKey||a.altKey)){a.preventDefault();db(this)}});x.click(function(){a.overlayClose&&d.close()});b(document).bind("keydown",function(b){if(u&&a.escKey&&b.keyCode===27){b.preventDefault();d.close()}if(u&&a.arrowKey&&!D&&h[1])if(b.keyCode===37&&(g||a.loop)){b.preventDefault();H.click()}else if(b.keyCode===39&&(g").children();a.h=b.height();b.replaceWith(b.children())}k.css({height:a.h});d.position(a.transition===t?0:a.speed)}};d.prep=function(m){var c="hidden";function l(s){var p,f,m,c,l=h.length,q=a.loop;d.position(s,function(){function s(){E&&j[0].style.removeAttribute("filter")}if(u){E&&o&&k.fadeIn(100);k.show();w(hb);Z.show().html(a.title);if(l>1){typeof a.current==="string"&&Y.html(a.current.replace(/\{current\}/,g+1).replace(/\{total\}/,l)).show();I[q||g")[0].src=c;if(U(f))b("")[0].src=f}}K.hide();a.transition==="fade"?j.fadeTo(e,1,function(){s()}):s();n.bind(v+i,function(){d.position(0)});w(V,a.onComplete)}})}if(u){var o,e=a.transition===t?0:a.speed;n.unbind(v+i);k.remove();k=f(M).html(m);k.hide().appendTo(J.show()).css({width:function(){a.w=a.w||k.width();a.w=a.mw&&a.mw")[0];c.name=i+ +new Date;c.src=a.href;if(!a.scrolling)c.scrolling="no";if(E)c.allowtransparency="true";b(c).appendTo(k).one(Q,function(){c.src="//about:blank"})});q(" ")}else if(a.html)q(a.html);else if(U(n)){c=new Image;c.onload=function(){var e;c.onload=null;c.id=i+"Photo";b(c).css({border:t,display:"block",cssFloat:"left"});if(a.scalePhotos){s=function(){c.height-=c.height*e;c.width-=c.width*e};if(a.mw&&c.width>a.mw){e=(c.width-a.mw)/c.width;s()}if(a.mh&&c.height>a.mh){e=(c.height-a.mh)/c.height;s()}}if(a.h)c.style.marginTop=Math.max(a.h-c.height,0)/2+"px";h[1]&&(gi?e+i:i}function l(t,e){return Math.round((/%/.test(t)?("x"===e?H.width():n())/100:1)*parseInt(t,10))}function h(t,e){return t.photo||t.photoRegex.test(e)}function s(t,e){return t.retinaUrl&&i.devicePixelRatio>1?e.replace(t.photoRegex,t.retinaSuffix):e}function a(t){"contains"in v[0]&&!v[0].contains(t.target)&&(t.stopPropagation(),v.focus())}function d(){var e,i=t.data(A,Z);null==i?(O=t.extend({},Y),console&&console.log&&console.log("Error: cboxElement missing settings object")):O=t.extend({},i);for(e in O)t.isFunction(O[e])&&"on"!==e.slice(0,2)&&(O[e]=O[e].call(A));O.rel=O.rel||A.rel||t(A).data("rel")||"nofollow",O.href=O.href||t(A).attr("href"),O.title=O.title||A.title,"string"==typeof O.href&&(O.href=t.trim(O.href))}function c(i,o){t(e).trigger(i),se.trigger(i),t.isFunction(o)&&o.call(A)}function u(){var t,e,i,o,n,r=te+"Slideshow_",l="click."+te;O.slideshow&&E[1]?(e=function(){clearTimeout(t)},i=function(){(O.loop||E[j+1])&&(t=setTimeout(J.next,O.slideshowSpeed))},o=function(){R.html(O.slideshowStop).unbind(l).one(l,n),se.bind(ne,i).bind(oe,e).bind(re,n),v.removeClass(r+"off").addClass(r+"on")},n=function(){e(),se.unbind(ne,i).unbind(oe,e).unbind(re,n),R.html(O.slideshowStart).unbind(l).one(l,function(){J.next(),o()}),v.removeClass(r+"on").addClass(r+"off")},O.slideshowAuto?o():n()):v.removeClass(r+"off "+r+"on")}function p(i){G||(A=i,d(),E=t(A),j=0,"nofollow"!==O.rel&&(E=t("."+ee).filter(function(){var e,i=t.data(this,Z);return i&&(e=t(this).data("rel")||i.rel||this.rel),e===O.rel}),j=E.index(A),-1===j&&(E=E.add(A),j=E.length-1)),g.css({opacity:parseFloat(O.opacity),cursor:O.overlayClose?"pointer":"auto",visibility:"visible"}).show(),V&&v.add(g).removeClass(V),O.className&&v.add(g).addClass(O.className),V=O.className,O.closeButton?P.html(O.close).appendTo(x):P.appendTo("
    "),$||($=q=!0,v.css({visibility:"hidden",display:"block"}),W=o(ae,"LoadedContent","width:0; height:0; overflow:hidden"),x.css({width:"",height:""}).append(W),_=b.height()+k.height()+x.outerHeight(!0)-x.height(),D=T.width()+C.width()+x.outerWidth(!0)-x.width(),N=W.outerHeight(!0),z=W.outerWidth(!0),O.w=l(O.initialWidth,"x"),O.h=l(O.initialHeight,"y"),J.position(),u(),c(ie,O.onOpen),B.add(S).hide(),v.focus(),O.trapFocus&&e.addEventListener&&(e.addEventListener("focus",a,!0),se.one(le,function(){e.removeEventListener("focus",a,!0)})),O.returnFocus&&se.one(le,function(){t(A).focus()})),w())}function f(){!v&&e.body&&(X=!1,H=t(i),v=o(ae).attr({id:Z,"class":t.support.opacity===!1?te+"IE":"",role:"dialog",tabindex:"-1"}).hide(),g=o(ae,"Overlay").hide(),L=t([o(ae,"LoadingOverlay")[0],o(ae,"LoadingGraphic")[0]]),y=o(ae,"Wrapper"),x=o(ae,"Content").append(S=o(ae,"Title"),M=o(ae,"Current"),K=t('
    + From 5a84e3affbc569d7c568dcbe605b026de441f63d Mon Sep 17 00:00:00 2001 From: yama Date: Mon, 2 Sep 2013 10:51:20 +0900 Subject: [PATCH 417/530] 1.0.11RC2 --- manager/includes/version.inc.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/manager/includes/version.inc.php b/manager/includes/version.inc.php index f53547359c..9a755719bd 100755 --- a/manager/includes/version.inc.php +++ b/manager/includes/version.inc.php @@ -1,5 +1,5 @@ Date: Mon, 2 Sep 2013 11:10:26 +0900 Subject: [PATCH 418/530] Fix - Install language --- install/lang/bulgarian.inc.php | 8 ++++---- install/lang/danish.inc.php | 8 ++++---- install/lang/finnish-utf8.inc.php | 8 ++++---- install/lang/francais-utf8.inc.php | 8 ++++---- install/lang/hebrew.inc.php | 8 ++++---- install/lang/japanese-utf8.inc.php | 10 +++++----- install/lang/norwegian.inc.php | 8 ++++---- install/lang/persian.inc.php | 8 ++++---- install/lang/polish-utf8.inc.php | 10 +++++----- install/lang/russian-UTF8.inc.php | 16 ++++++++-------- install/lang/spanish-utf8.inc.php | 8 ++++---- install/lang/svenska.inc.php | 8 ++++---- 12 files changed, 54 insertions(+), 54 deletions(-) diff --git a/install/lang/bulgarian.inc.php b/install/lang/bulgarian.inc.php index 37fdf55772..f021797314 100644 --- a/install/lang/bulgarian.inc.php +++ b/install/lang/bulgarian.inc.php @@ -29,13 +29,13 @@ $_lang["btnclose_value"] = 'Затваряне'; $_lang["btnnext_value"] = 'Напред'; $_lang["cant_write_config_file"] = 'MODx не успя да запише конфигурационния файл. Моля, копирайте следното във файла '; -$_lang["cant_write_config_file_note"] = 'След като инсталацията завърши, можете да се логнете в Мениджъра на MODx, като напишете в браузера си YourSiteName.com/'.MGR_DIR.'/.'; +$_lang["cant_write_config_file_note"] = 'След като инсталацията завърши, можете да се логнете в Мениджъра на MODx, като напишете в браузера си YourSiteName.com/[+MGR_DIR+]/.'; $_lang["checkbox_select_options"] = 'Опции:'; $_lang["checking_if_cache_exist"] = 'Проверка дали съществува директорията assets/cache : '; $_lang["checking_if_cache_file2_writable"] = 'Проверка дали може да се пише във файла assets/cache/sitePublishing.idx.php : '; $_lang["checking_if_cache_file_writable"] = 'Проверка дали може да се пише във файла assets/cache/siteCache.idx.php : '; $_lang["checking_if_cache_writable"] = 'Проверка дали в директорията assets/cache може да се пише: '; -$_lang["checking_if_config_exist_and_writable"] = 'Проверка дали '.MGR_DIR.'/includes/config.inc.php съществува и може да се пише в него: '; +$_lang["checking_if_config_exist_and_writable"] = 'Проверка дали [+MGR_DIR+]/includes/config.inc.php съществува и може да се пише в него: '; $_lang["checking_if_export_exists"] = 'Проверка дали съществува директорията assets/export : '; $_lang["checking_if_export_writable"] = 'Проверка дали в директорията assets/export може да се пише: '; $_lang["checking_if_images_exist"] = 'Проверка дали съществува директорията assets/images : '; @@ -48,7 +48,7 @@ $_lang["checking_sessions"] = 'Проверка дали сесиите са правилно конфигурирани: '; $_lang["checking_table_prefix"] = 'Проверка на префикса на таблицата `'; $_lang["chunks"] = 'Чънкове'; -$_lang["config_permissions_note"] = 'За нови Linux/Unix инсталации, моля, създайте празен файл с име config.inc.php в директорията '.MGR_DIR.'/includes/ и задайте права на файла 0666.'; +$_lang["config_permissions_note"] = 'За нови Linux/Unix инсталации, моля, създайте празен файл с име config.inc.php в директорията [+MGR_DIR+]/includes/ и задайте права на файла 0666.'; $_lang["connection_screen_collation"] = 'Колация:'; $_lang["connection_screen_connection_information"] = 'Информация за връзката'; $_lang["connection_screen_connection_method"] = 'Начин на свързване - метод:'; @@ -156,7 +156,7 @@ $_lang["table_prefix_not_exist"] = ' - Префиксът на таблицата не съществува в тази БД!'; $_lang["table_prefix_not_exist_note"] = 'Инсталаторът не може да инсталира в избраната БД, тъй като тя не съдържа таблици със зададения префикс, които да бъдат обновявени. Моля, изберете съществуващ префикс на таблица и стартирайте Инсталатора отново.'; $_lang["templates"] = 'Шаблони'; -$_lang["to_log_into_content_manager"] = 'За да се логнете в Мениджъра ('.MGR_DIR.'/index.php) кликнете на бутона `Затваряне` .'; +$_lang["to_log_into_content_manager"] = 'За да се логнете в Мениджъра ([+MGR_DIR+]/index.php) кликнете на бутона `Затваряне` .'; $_lang["toggle"] = 'Включване'; $_lang["unable_install_chunk"] = 'Не успя да инсталира Чънк. Файл'; $_lang["unable_install_module"] = 'Не успя да инсталира Модул. Файл'; diff --git a/install/lang/danish.inc.php b/install/lang/danish.inc.php index 44f127effc..36d582bc89 100644 --- a/install/lang/danish.inc.php +++ b/install/lang/danish.inc.php @@ -31,13 +31,13 @@ $_lang["btnclose_value"] = 'Luk'; $_lang["btnnext_value"] = 'Næste'; $_lang["cant_write_config_file"] = 'MODx kunne ikke gemme konfigurationsfilen. Du skal kopiere nedenstående ind i filen '; -$_lang["cant_write_config_file_note"] = 'Når dette er gjort, kan du logge ind i MODx på adressen http://Ditdomænenavn.dk/'.MGR_DIR.'/.'; +$_lang["cant_write_config_file_note"] = 'Når dette er gjort, kan du logge ind i MODx på adressen http://Ditdomænenavn.dk/[+MGR_DIR+]/.'; $_lang["checkbox_select_options"] = 'Valgmuligheder:'; $_lang["checking_if_cache_exist"] = 'Kontrollerer om /assets/cache og /assets/cache/rss mapperne er oprettet: '; $_lang["checking_if_cache_file_writable"] = 'Kontrollerer om /assets/cache/siteCache.idx.php filen er skrivbar: '; $_lang["checking_if_cache_file2_writable"] = 'Kontrollerer om /assets/cache/sitePublishing.idx.php filen er skrivbar: '; $_lang["checking_if_cache_writable"] = 'Kontrollerer om /assets/cache og /assets/cache/rss mapperne er skrivbare: '; -$_lang["checking_if_config_exist_and_writable"] = 'Kontrollerer om /'.MGR_DIR.'/includes/config.inc.php er oprettet og er skrivbar: '; +$_lang["checking_if_config_exist_and_writable"] = 'Kontrollerer om /[+MGR_DIR+]/includes/config.inc.php er oprettet og er skrivbar: '; $_lang["checking_if_export_exists"] = 'Kontrollerer om /assets/export mappen er oprettet: '; $_lang["checking_if_export_writable"] = 'Kontrollerer om /assets/export mappen er skrivbar: '; $_lang["checking_if_images_exist"] = 'Kontrollerer om /assets/images, /assets/files, /assets/flash, /assets/media, /assets/backup og /assets/.thumbs mapperne er oprettet: '; @@ -50,7 +50,7 @@ $_lang["checking_sessions"] = 'Kontrollerer om sessions er korrekt konfigureret: '; $_lang["checking_table_prefix"] = 'Kontrollerer database tabellernes præfiks `'; $_lang["chunks"] = 'Chunks'; -$_lang["config_permissions_note"] = 'Ved nyinstallation under Linux eller Unix, skal du oprette en tom fil, med navnet config.inc.php i /'.MGR_DIR.'/includes/ mappen, med filrettighederne indstillet til 0666.'; +$_lang["config_permissions_note"] = 'Ved nyinstallation under Linux eller Unix, skal du oprette en tom fil, med navnet config.inc.php i /[+MGR_DIR+]/includes/ mappen, med filrettighederne indstillet til 0666.'; $_lang["connection_screen_collation"] = 'Collation:'; $_lang["connection_screen_connection_method"] = 'Connection\'s metode:'; $_lang["connection_screen_database_connection_information"] = 'Database information'; @@ -173,7 +173,7 @@ $_lang["table_prefix_not_exist"] = ' - Tabellens præfiks eksisterer ikke i denne database!'; $_lang["table_prefix_not_exist_note"] = 'Installationsprogrammet kunne ikke installere i den valgte database, da de eksisterende tabeller du har valgt der skal opdateres, ikke indeholder det præfiks du har indtastet. Indtast et eksisterende tabel præfiks og prøv at køre installationsprogrammet igen.'; $_lang["templates"] = 'Skabeloner'; -$_lang["to_log_into_content_manager"] = 'For at logge ind i CMS\'et ('.MGR_DIR.'/index.php) skal du klikke på `Luk` knappen.'; +$_lang["to_log_into_content_manager"] = 'For at logge ind i CMS\'et ([+MGR_DIR+]/index.php) skal du klikke på `Luk` knappen.'; $_lang["toggle"] = 'Byt om på det valgte'; $_lang['tvs'] = 'Skabelon variabler'; $_lang["unable_install_chunk"] = 'Kunne ikke installere chunk. Fil'; diff --git a/install/lang/finnish-utf8.inc.php b/install/lang/finnish-utf8.inc.php index 9f1e155616..9dad470351 100644 --- a/install/lang/finnish-utf8.inc.php +++ b/install/lang/finnish-utf8.inc.php @@ -30,13 +30,13 @@ $_lang["btnclose_value"] = 'Sulje'; $_lang["btnnext_value"] = 'Seuraava'; $_lang["cant_write_config_file"] = 'MODx ei voinut kirjoittaa asetukset tiedostoa. Ole hyvä ja kopioi seuraava asetustiedostoon '; -$_lang["cant_write_config_file_note"] = 'Kun tämä on tehty, voit kirjautua MODx hallintaan osoitteessa sinunosoite.fi/'.MGR_DIR.'/.'; +$_lang["cant_write_config_file_note"] = 'Kun tämä on tehty, voit kirjautua MODx hallintaan osoitteessa sinunosoite.fi/[+MGR_DIR+]/.'; $_lang["checkbox_select_options"] = 'Valitse valintaruuduista:'; $_lang["checking_if_cache_exist"] = 'Tarkistetaan onko kansiot /assets/cache ja /assets/cache/rss olemassa: '; $_lang["checking_if_cache_file_writable"] = 'Tarkistetaan voiko tiedostoon /assets/cache/siteCache.idx.php kirjoittaa: '; $_lang["checking_if_cache_file2_writable"] = 'Tarkistetaan voiko tiedostoon /assets/cache/sitePublishing.idx.php kirjoittaa: '; $_lang["checking_if_cache_writable"] = 'Tarkistetaan voiko kansioihin /assets/cache ja /assets/cache/rss luoda uusia tiedostoja: '; -$_lang["checking_if_config_exist_and_writable"] = 'Tarkistetaan onko asetustiedosto '.MGR_DIR.'/includes/config.inc.php olemassa ja voiko siihen kirjoittaa: '; +$_lang["checking_if_config_exist_and_writable"] = 'Tarkistetaan onko asetustiedosto [+MGR_DIR+]/includes/config.inc.php olemassa ja voiko siihen kirjoittaa: '; $_lang["checking_if_export_exists"] = 'Tarkistetaan onko kansio /assets/export olemassa: '; $_lang["checking_if_export_writable"] = 'Tarkistetaan voiko kansioon /assets/export luoda uusia tiedostoja: '; $_lang["checking_if_images_exist"] = 'Tarkistetaan onko kansiot /assets/images, /assets/files, /assets/flash, /assets/media, /assets/backup ja /assets/.thumbs olemassa: '; @@ -49,7 +49,7 @@ $_lang["checking_sessions"] = 'Tarkistetaan onko palvelinistunnot asetettu toimimaan oikein: '; $_lang["checking_table_prefix"] = 'Tarkistetaan tietokannan taulujen etuliite `'; $_lang["chunks"] = 'HTML-palaset'; -$_lang["config_permissions_note"] = 'Jos olet asentamassa järjestelmää Linux / Unix palvelimeen, luo kansioon '.MGR_DIR.'/includes/ tyhjä tiedosto nimeltä config.inc.php ja aseta tiedostoon 0666 oikeudet.'; +$_lang["config_permissions_note"] = 'Jos olet asentamassa järjestelmää Linux / Unix palvelimeen, luo kansioon [+MGR_DIR+]/includes/ tyhjä tiedosto nimeltä config.inc.php ja aseta tiedostoon 0666 oikeudet.'; $_lang["connection_screen_collation"] = 'Merkistö:'; $_lang["connection_screen_connection_method"] = 'Yhteystyyppi:'; $_lang["connection_screen_database_connection_information"] = 'Tietokannan yhteysasetukset'; @@ -166,7 +166,7 @@ $_lang["table_prefix_not_exist"] = ' - Tietokannan taulujen etuliitettä ei löydetty tästä tietokannasta!'; $_lang["table_prefix_not_exist_note"] = 'Asennusohjelma ei voinut asentaa valittuun tietokantaan, koska se ei sisällä tauluja asetetulla etuliitteellä, jotka asetit päivitystietoihin. Ole hyvä ja valitse uusi etuliite ja yritä uudelleen.'; $_lang["templates"] = 'Sivupohjat'; -$_lang["to_log_into_content_manager"] = 'Kirjautuaksesi sisällönhallintajärjestelmään ('.MGR_DIR.'/index.php) napsauta `Sulje` painiketta.'; +$_lang["to_log_into_content_manager"] = 'Kirjautuaksesi sisällönhallintajärjestelmään ([+MGR_DIR+]/index.php) napsauta `Sulje` painiketta.'; $_lang["toggle"] = 'Vastakkaiset'; $_lang["unable_install_chunk"] = 'HTML-palasta ei voitu asentaa. Tiedosto'; $_lang["unable_install_module"] = 'Moduulia ei voitu asentaa. Tiedosto'; diff --git a/install/lang/francais-utf8.inc.php b/install/lang/francais-utf8.inc.php index 7419b8cb8e..a180ae4122 100644 --- a/install/lang/francais-utf8.inc.php +++ b/install/lang/francais-utf8.inc.php @@ -30,13 +30,13 @@ $_lang["btnclose_value"] = 'Fermer'; $_lang["btnnext_value"] = 'Suivant'; $_lang["cant_write_config_file"] = 'MODx n\'a pas pu écrire le fichier de configuration. Veuillez copier/coller ceci dans le fichier '; -$_lang["cant_write_config_file_note"] = 'Une fois l\'opération effectuée, vous pouvez vous connecter à l\'interface d\'administration de MODx en utilisant l\'adresse VotreSite.com/'.MGR_DIR.'/.'; +$_lang["cant_write_config_file_note"] = 'Une fois l\'opération effectuée, vous pouvez vous connecter à l\'interface d\'administration de MODx en utilisant l\'adresse VotreSite.com/[+MGR_DIR+]/.'; $_lang["checkbox_select_options"] = 'Cochez pour sélectionner les options:'; $_lang["checking_if_cache_exist"] = 'Vérification de l\'existence du répertoire assets/cache: '; $_lang["checking_if_cache_file2_writable"] = 'Vérification des droits en écriture du fichier assets/cache/sitePublishing.idx.php: '; $_lang["checking_if_cache_file_writable"] = 'Vérification des droits en écriture du fichier assets/cache/siteCache.idx.php: '; $_lang["checking_if_cache_writable"] = 'Vérification des droits en écriture du répertoire assets/cache: '; -$_lang["checking_if_config_exist_and_writable"] = 'Vérification de l\'existence et des droits en écriture du fichier '.MGR_DIR.'/includes/config.inc.php: '; +$_lang["checking_if_config_exist_and_writable"] = 'Vérification de l\'existence et des droits en écriture du fichier [+MGR_DIR+]/includes/config.inc.php: '; $_lang["checking_if_export_exists"] = 'Vérification de l\'existence du répertoire assets/export: '; $_lang["checking_if_export_writable"] = 'Vérification des droits en écriture du répertoire assets/export: '; $_lang["checking_if_images_exist"] = 'Vérification de l\'existence du répertoire assets/images: '; @@ -49,7 +49,7 @@ $_lang["checking_sessions"] = 'Vérifications des paramètres de sessions: '; $_lang["checking_table_prefix"] = 'Vérification du préfixe de table `'; $_lang["chunks"] = 'Chunks'; -$_lang["config_permissions_note"] = 'Lors des installations Linux/Unix, veuillez créer un nouveau fichier nommé config.inc.php dans le répertoire '.MGR_DIR.'/includes/ avec les droits d\'accès 0666.'; +$_lang["config_permissions_note"] = 'Lors des installations Linux/Unix, veuillez créer un nouveau fichier nommé config.inc.php dans le répertoire [+MGR_DIR+]/includes/ avec les droits d\'accès 0666.'; $_lang["connection_screen_collation"] = 'Collation:'; $_lang["connection_screen_connection_method"] = 'Méthode de connexion:'; $_lang["connection_screen_database_connection_information"] = 'Informations base de données'; @@ -172,7 +172,7 @@ $_lang["table_prefix_not_exist"] = ' - Le préfixe de table n\'existe pas dans la base de données!'; $_lang["table_prefix_not_exist_note"] = 'Le programme d\'installation n\'a pas pu utiliser la base de données spécifiée parce qu\'elle ne contient pas de tables comportant le préfixe que vous avez choisi pour la mise à jour. Veuillez choisir un préfixe de table existant et recommencer l\'installation.'; $_lang["templates"] = 'Modèles'; -$_lang["to_log_into_content_manager"] = 'Pour vous connecter au Gestionnaire de Contenu ('.MGR_DIR.'/index.php), cliquez sur le bouton «Fermer».'; +$_lang["to_log_into_content_manager"] = 'Pour vous connecter au Gestionnaire de Contenu ([+MGR_DIR+]/index.php), cliquez sur le bouton «Fermer».'; $_lang["toggle"] = 'Intervertir'; $_lang['tvs'] = 'Variables de Template'; $_lang["unable_install_chunk"] = 'Impossible d\'installer le Chunk. Fichier'; diff --git a/install/lang/hebrew.inc.php b/install/lang/hebrew.inc.php index 6bee842090..e6df7fbea2 100755 --- a/install/lang/hebrew.inc.php +++ b/install/lang/hebrew.inc.php @@ -31,13 +31,13 @@ $_lang["btnclose_value"] = 'סגור'; $_lang["btnnext_value"] = 'הבא'; $_lang["cant_write_config_file"] = 'MODx couldn\'t write the config file. Please copy the following into the file '; -$_lang["cant_write_config_file_note"] = 'Once that\'s been done, you can log into MODx Admin by pointing your browser at YourSiteName.com/'.MGR_DIR.'/.'; +$_lang["cant_write_config_file_note"] = 'Once that\'s been done, you can log into MODx Admin by pointing your browser at YourSiteName.com/[+MGR_DIR+]/.'; $_lang["checkbox_select_options"] = 'אפשרויות שדה סימון:'; $_lang["checking_if_cache_exist"] = 'Checking if assets/cache directory exists: '; $_lang["checking_if_cache_file2_writable"] = 'Checking if assets/cache/sitePublishing.idx.php file is writable: '; $_lang["checking_if_cache_file_writable"] = 'Checking if assets/cache/siteCache.idx.php file is writable: '; $_lang["checking_if_cache_writable"] = 'Checking if assets/cache directory is writable: '; -$_lang["checking_if_config_exist_and_writable"] = 'Checking if '.MGR_DIR.'/includes/config.inc.php exists and is writable: '; +$_lang["checking_if_config_exist_and_writable"] = 'Checking if [+MGR_DIR+]/includes/config.inc.php exists and is writable: '; $_lang["checking_if_export_exists"] = 'Checking if assets/export directory exists: '; $_lang["checking_if_export_writable"] = 'Checking if assets/export directory is writable: '; $_lang["checking_if_images_exist"] = 'Checking if assets/images directory exists: '; @@ -50,7 +50,7 @@ $_lang["checking_sessions"] = 'Checking if sessions are properly configured: '; $_lang["checking_table_prefix"] = 'Checking table prefix '; $_lang["chunks"] = 'מיני תבניות'; -$_lang["config_permissions_note"] = 'For new Linux/Unix installs, please create a blank file named config.inc.php in the '.MGR_DIR.'/includes/ directory with file permissions set to 0666.'; +$_lang["config_permissions_note"] = 'For new Linux/Unix installs, please create a blank file named config.inc.php in the [+MGR_DIR+]/includes/ directory with file permissions set to 0666.'; $_lang["connection_screen_character_set"] = 'חיבור ערכת תווים:'; $_lang["connection_screen_collation"] = 'אוסף נתונים:'; $_lang["connection_screen_connection_information"] = 'מידע התחברות'; @@ -164,7 +164,7 @@ $_lang["table_prefix_not_exist_note"] = 'Setup couldn\'t install into the selected database, as it does not contain existing tables with the prefix you specified to be upgraded. Please choose an existing table prefix, and run Setup again.'; $_lang["templates"] = 'תבניות עיצוב'; $_lang["testing_connection"] = 'בודק חיבור...'; -$_lang["to_log_into_content_manager"] = 'על מנת להתחבר למערכת הניהול ('.MGR_DIR.'/index.php) ניתן ללחוץ על כפתור `סגור`.'; +$_lang["to_log_into_content_manager"] = 'על מנת להתחבר למערכת הניהול ([+MGR_DIR+]/index.php) ניתן ללחוץ על כפתור `סגור`.'; $_lang["toggle"] = 'בחירה הפוכה'; $_lang["unable_install_chunk"] = 'Unable to install chunk. File'; $_lang["unable_install_module"] = 'Unable to install module. File'; diff --git a/install/lang/japanese-utf8.inc.php b/install/lang/japanese-utf8.inc.php index 4fc17970e4..9e05c7da91 100755 --- a/install/lang/japanese-utf8.inc.php +++ b/install/lang/japanese-utf8.inc.php @@ -30,13 +30,13 @@ $_lang["btnclose_value"] = 'インストール終了'; $_lang["btnnext_value"] = '進む'; $_lang["cant_write_config_file"] = '設定ファイルを生成できませんでした。以下をコピーしてconfig.inc.phpに反映してください '; -$_lang["cant_write_config_file_note"] = '実行後は、サイト名/'.MGR_DIR.'/ にアクセスすることで管理画面にログインできます。'; +$_lang["cant_write_config_file_note"] = '実行後は、サイト名/[+MGR_DIR+]/ にアクセスすることで管理画面にログインできます。'; $_lang["checkbox_select_options"] = '拡張機能の選択:'; $_lang["checking_if_cache_exist"] = '/assets/cacheディレクトリの存在チェック(なければ転送に失敗しています): '; $_lang["checking_if_cache_file_writable"] = 'ファイル/assets/cache/siteCache.idx.phpの書き込み属性(606などに設定): '; $_lang["checking_if_cache_file2_writable"] = 'ファイル/assets/cache/sitePublishing.idx.phpの書き込み属性(606などに設定): '; $_lang["checking_if_cache_writable"] = '/assets/cacheディレクトリの書き込み属性(707などに設定): '; -$_lang["checking_if_config_exist_and_writable"] = 'ファイル/'.MGR_DIR.'/includes/config.inc.phpの存在と書き込み属性: '; +$_lang["checking_if_config_exist_and_writable"] = 'ファイル/[+MGR_DIR+]/includes/config.inc.phpの存在と書き込み属性: '; $_lang["checking_if_export_exists"] = '/assets/exportディレクトリの存在(なければ転送に失敗しています): '; $_lang["checking_if_export_writable"] = '/assets/exportディレクトリの書き込み属性(707などに設定): '; $_lang["checking_if_images_exist"] = '/assets/images,/assets/files,/assets/flash, /assets/media,/assets/backup,/assets/.thumbsディレクトリの存在(なければ転送に失敗しています): '; @@ -49,7 +49,7 @@ $_lang["checking_sessions"] = 'セッション情報が正常に構成されるかどうか: '; $_lang["checking_table_prefix"] = 'Tableプリフィックスの設定 `'; $_lang["chunks"] = 'チャンク'; -$_lang["config_permissions_note"] = 'config.inc.phpという名前の空ファイルを作って/'.MGR_DIR.'/includes/ディレクトリに転送するか、すでに転送済みのconfig.inc.php.blankをリネームするなどし、パーミッションを606などに設定してください。'; +$_lang["config_permissions_note"] = 'config.inc.phpという名前の空ファイルを作って/[+MGR_DIR+]/includes/ディレクトリに転送するか、すでに転送済みのconfig.inc.php.blankをリネームするなどし、パーミッションを606などに設定してください。'; $_lang["connection_screen_collation"] = '照合順序(エンコード指定含む):
    ※utf8_general_ciを
    おすすめします'; $_lang["connection_screen_connection_method"] = '接続時の文字セットの扱い:'; $_lang["connection_screen_database_connection_information"] = 'データベース設定'; @@ -102,7 +102,7 @@ $_lang["installation_upgrade_advanced"] = 'カスタムアップデート
    (データベース設定をアップデートできます)'; $_lang["installation_upgrade_advanced_note"] = 'データベース設定の変更を伴うアップデート(MySQL4→MySQL5など)が必要な場合はこちらを選んでください。config.inc.phpのデータベース接続情報一式を更新します。
    '; $_lang["installation_upgrade_existing"] = '通常アップデート'; -$_lang["installation_upgrade_existing_note"] = '通常のアップデートはこのオプションを。コアファイル・リソースファイルの両方とデータベースをアップデートします。
    【注意】データベースのバックアップはお済みですか?まだの場合は今からでも
    バックアップマネージャーでどうぞ。'; +$_lang["installation_upgrade_existing_note"] = '通常のアップデートはこのオプションを。コアファイル・リソースファイルの両方とデータベースをアップデートします。
    【注意】データベースのバックアップはお済みですか?まだの場合は今からでもバックアップマネージャーでどうぞ。'; $_lang["installed"] = 'インストールしました'; $_lang["installing_demo_site"] = 'サンプルサイトのインストール: '; $_lang["language_code"] = 'ja'; @@ -172,7 +172,7 @@ $_lang["table_prefix_not_exist"] = ' - 指定されたテーブルプレフィックスがデータベース内に存在していなかったため、インストールが完了しませんでした。正しいテーブルプリフィックスを指定し、再度実行してください。'; $_lang["table_prefix_not_exist_note"] = 'Setup couldn\'t install into the selected database, as it does not contain existing tables with the prefix you specified to be upgraded. Please choose an existing table prefix, and run Setup again.'; $_lang["templates"] = 'テンプレート'; -$_lang["to_log_into_content_manager"] = 'おつかれさまでした。「インストール終了」ボタンをクリックすると、管理画面のログインページ('.MGR_DIR.'/index.php)にアクセスします。'; +$_lang["to_log_into_content_manager"] = 'おつかれさまでした。「インストール終了」ボタンをクリックすると、管理画面のログインページ([+MGR_DIR+]/index.php)にアクセスします。'; $_lang["toggle"] = '選択状態を反転'; $_lang['tvs'] = 'テンプレート変数'; $_lang["unable_install_chunk"] = 'チャンクをインストールできません'; diff --git a/install/lang/norwegian.inc.php b/install/lang/norwegian.inc.php index 44b5f5f36d..353e70748c 100644 --- a/install/lang/norwegian.inc.php +++ b/install/lang/norwegian.inc.php @@ -32,13 +32,13 @@ $_lang["btnclose_value"] = 'Lukk'; $_lang["btnnext_value"] = 'Neste'; $_lang["cant_write_config_file"] = 'MODx kunne ikke skrive konfigurasjonsfilen. Kopier følgende til filen '; -$_lang["cant_write_config_file_note"] = 'Når det er klart kan du logge inn i MODx administrasjonskontoen ved å gå til adressen DittDomene.xx/'.MGR_DIR.'/ i din nettleser.'; +$_lang["cant_write_config_file_note"] = 'Når det er klart kan du logge inn i MODx administrasjonskontoen ved å gå til adressen DittDomene.xx/[+MGR_DIR+]/ i din nettleser.'; $_lang["checkbox_select_options"] = 'Alternativ for kryssbokser:'; $_lang["checking_if_cache_exist"] = 'Kontrollerer at katalogen assets/cache eksisterer: '; $_lang["checking_if_cache_file2_writable"] = 'Kontrollerer at filen assets/cache/sitePublishing.idx.php er skrivbar: '; $_lang["checking_if_cache_file_writable"] = 'Kontrollerer at filen assets/cache/siteCache.idx.php er skrivbar: '; $_lang["checking_if_cache_writable"] = 'Kontrollerer at katalogen assets/cache er skrivbar: '; -$_lang["checking_if_config_exist_and_writable"] = 'Kontrollerer at filen '.MGR_DIR.'/includes/config.inc.php eksisterer og er skrivbar: '; +$_lang["checking_if_config_exist_and_writable"] = 'Kontrollerer at filen [+MGR_DIR+]/includes/config.inc.php eksisterer og er skrivbar: '; $_lang["checking_if_export_exists"] = 'Kontrollerer at katalogen assets/export eksisterer: '; $_lang["checking_if_export_writable"] = 'Kontrollerer at katalogen assets/export er skrivbar: '; $_lang["checking_if_images_exist"] = 'Kontrollerer at katalogen assets/images, /assets/media, /assets/backup, /assets/.thumbs eksisterer: '; @@ -51,7 +51,7 @@ $_lang["checking_sessions"] = 'Kontrollerer at sesjoner er korrekt konfigurert: '; $_lang["checking_table_prefix"] = 'Kontrollerer tabellprefixet `'; $_lang["chunks"] = 'Chunks'; -$_lang["config_permissions_note"] = 'For nye installasjoner i Linux/Unix-miljø må en tom fil med navnet config.inc.php opprettes i katalogen '.MGR_DIR.'/includes/ med skriverrettighetene satt til 666.'; +$_lang["config_permissions_note"] = 'For nye installasjoner i Linux/Unix-miljø må en tom fil med navnet config.inc.php opprettes i katalogen [+MGR_DIR+]/includes/ med skriverrettighetene satt til 666.'; $_lang["connection_screen_collation"] = 'Kollasjonering:'; $_lang["connection_screen_connection_information"] = 'Tilkoblingsopplysninger'; $_lang["connection_screen_connection_method"] = 'Tilkoblingsmetode:'; @@ -160,7 +160,7 @@ $_lang["table_prefix_not_exist"] = ' - Tabellprefixet finnes ikke i denne databasen!'; $_lang["table_prefix_not_exist_note"] = 'Installasjonsprogrammet kunne ikke installere i den valgte databasen ettersom den ikke inneholder tabeller med det prefixet du oppga før oppgraderingen. Velg et eksisterende prefix og kjør installasjonsprogrammet på nytt.'; $_lang["templates"] = 'Maler'; -$_lang["to_log_into_content_manager"] = 'Du kan logge inn i inneholdshåndtereren ('.MGR_DIR.'/index.php)ved å klikke på \"Lukk\"-knappen.'; +$_lang["to_log_into_content_manager"] = 'Du kan logge inn i inneholdshåndtereren ([+MGR_DIR+]/index.php)ved å klikke på \"Lukk\"-knappen.'; $_lang["toggle"] = 'Skift'; $_lang["unable_install_chunk"] = 'Kunne ikke installere chunk. Fil'; $_lang["unable_install_module"] = 'Kunne ikke installere modul. Fil'; diff --git a/install/lang/persian.inc.php b/install/lang/persian.inc.php index 340f0783d9..29ad6cd29c 100644 --- a/install/lang/persian.inc.php +++ b/install/lang/persian.inc.php @@ -31,13 +31,13 @@ $_lang["btnclose_value"] = 'ببند'; $_lang["btnnext_value"] = 'بعدی'; $_lang["cant_write_config_file"] = 'مد ایکس نتوانست فایل پیکر بندی (config) را بنویسد. لطفا این ها را در فایل پیکر بندی کپی کنید.'; -$_lang["cant_write_config_file_note"] = 'هنگامی که نصب با موفقیت یه اتمام رسید شما می توانید به قسمت مدیریت سایت خود به آدرس YourSiteName.com/'.MGR_DIR.'/ بروید.'; +$_lang["cant_write_config_file_note"] = 'هنگامی که نصب با موفقیت یه اتمام رسید شما می توانید به قسمت مدیریت سایت خود به آدرس YourSiteName.com/[+MGR_DIR+]/ بروید.'; $_lang["checkbox_select_options"] = 'موارد را انتخاب کنید:'; $_lang["checking_if_cache_exist"] = 'مرور اینکه آیا assets/cache موجود است: '; $_lang["checking_if_cache_file2_writable"] = 'ررو اینکه آیا فایل assets/cache/sitePublishing.idx.php قابل نوشتن است: '; $_lang["checking_if_cache_file_writable"] = 'مرور اینکه آیا فایل assets/cache/siteCache.idx.php قابل نوشتن است: '; $_lang["checking_if_cache_writable"] = 'مرور اینکه آیا assets/cache قابل نوشتن است: '; -$_lang["checking_if_config_exist_and_writable"] = 'مرور اینکه آیا فایل '.MGR_DIR.'/includes/config.inc.php موجود است و قابل نوشتن است: '; +$_lang["checking_if_config_exist_and_writable"] = 'مرور اینکه آیا فایل [+MGR_DIR+]/includes/config.inc.php موجود است و قابل نوشتن است: '; $_lang["checking_if_export_exists"] = 'مرور اینکه آیا assets/export موجود است: '; $_lang["checking_if_export_writable"] = 'مرور اینکه آیا assets/export قابل نوشتن است: '; $_lang["checking_if_images_exist"] = 'مرور اینکه آیا assets/images موجود است: '; @@ -50,7 +50,7 @@ $_lang["checking_sessions"] = 'بازخوانی sessions مطابق تنظیمات درست: '; $_lang["checking_table_prefix"] = 'مرور پیشوند جدول `'; $_lang["chunks"] = 'چانکها'; -$_lang["config_permissions_note"] = 'برای نصب جدید روی لینوکس/یونیکس, لطفا یک فایل خالی به نام config.inc.php در دایرکتوری '.MGR_DIR.'/includes/ ایجاد کنید که سطح دسترسی به آن 0666 تنظیم شده باشد.'; +$_lang["config_permissions_note"] = 'برای نصب جدید روی لینوکس/یونیکس, لطفا یک فایل خالی به نام config.inc.php در دایرکتوری [+MGR_DIR+]/includes/ ایجاد کنید که سطح دسترسی به آن 0666 تنظیم شده باشد.'; $_lang["connection_screen_collation"] = 'تطبیق(Collation):'; $_lang["connection_screen_connection_information"] = 'جزییات اتصال به پایگاه داده »'; $_lang["connection_screen_database_connection_information"] = 'اطلاعات پایگاه داده'; @@ -158,7 +158,7 @@ $_lang["table_prefix_not_exist"] = ' - پیشوند جداول موجود نمی باشد'; $_lang["table_prefix_not_exist_note"] = 'صب و بروزرسانی با پیشوند جداولی که انتخاب کردید به علت موجود نبودن یشوند جداول با مشکل روبرو شد. لطف پیشوند جداول را بازرسی و دوباره امتحان کنید.'; $_lang["templates"] = 'قالب ها'; -$_lang["to_log_into_content_manager"] = 'برای ورود به قسمت مدیریت ('.MGR_DIR.'/index.php) شما می توانید بر دکمه "ببند" کلیک کنید.'; +$_lang["to_log_into_content_manager"] = 'برای ورود به قسمت مدیریت ([+MGR_DIR+]/index.php) شما می توانید بر دکمه "ببند" کلیک کنید.'; $_lang["toggle"] = 'دستور'; $_lang["unable_install_chunk"] = 'نصب چانک با مشکل روبرو شد. فایل'; $_lang["unable_install_module"] = 'نصب ماژول با مشکل روبرو شد. فایل'; diff --git a/install/lang/polish-utf8.inc.php b/install/lang/polish-utf8.inc.php index 51a3ab1ed9..95f18a9feb 100644 --- a/install/lang/polish-utf8.inc.php +++ b/install/lang/polish-utf8.inc.php @@ -1,7 +1,7 @@ /assets/cache oraz /assets/cache/rss: '; $_lang["checking_if_cache_file_writable"] = 'Sprawdzanie, czy plik /assets/cache/siteCache.idx.php jest zapisywalny: '; $_lang["checking_if_cache_file2_writable"] = 'Sprawdzanie, czy plik /assets/cache/sitePublishing.idx.php jest zapisywalny: '; $_lang["checking_if_cache_writable"] = 'Sprawdzanie, czy foldery /assets/cache oraz /assets/cache/rss są zapisywalne: '; -$_lang["checking_if_config_exist_and_writable"] = 'Sprawdzanie, czy plik /'.MGR_DIR.'/includes/config.inc.php istnieje i jest zapisywalny: '; +$_lang["checking_if_config_exist_and_writable"] = 'Sprawdzanie, czy plik /[+MGR_DIR+]/includes/config.inc.php istnieje i jest zapisywalny: '; $_lang["checking_if_export_exists"] = 'Sprawdzanie, czy istnieje folder /assets/export: '; $_lang["checking_if_export_writable"] = 'Sprawdzanie, czy folder /assets/export jest zapisywalny: '; $_lang["checking_if_images_exist"] = 'Sprawdzanie, czy istnieją foldery /assets/images, /assets/files, /assets/flash oraz /assets/media: '; @@ -54,7 +54,7 @@ $_lang["checking_sessions"] = 'Sprawdzanie, czy obsługa sesji jest skonfigurowana poprawnie: '; $_lang["checking_table_prefix"] = 'Sprawdzanie prefiksu tabeli `'; $_lang["chunks"] = 'Chunki'; -$_lang["config_permissions_note"] = 'Dla nowych instalacji na systemach Linux/Unix utwórz pusty plik o nazwie config.inc.php w folderze /'.MGR_DIR.'/includes/ i ustaw dla niego prawa dostępu na 0666.'; +$_lang["config_permissions_note"] = 'Dla nowych instalacji na systemach Linux/Unix utwórz pusty plik o nazwie config.inc.php w folderze /[+MGR_DIR+]/includes/ i ustaw dla niego prawa dostępu na 0666.'; $_lang["connection_screen_collation"] = 'System porównań (collation): '; $_lang["connection_screen_connection_method"] = 'Metoda połączenia: '; $_lang["connection_screen_database_connection_information"] = 'Informacje o bazie danych'; @@ -177,7 +177,7 @@ $_lang["table_prefix_not_exist"] = '- Tabele o tym prefiksie nie istnieją w wybranej bazie danych!'; $_lang["table_prefix_not_exist_note"] = 'Nie można zaktualizować MODxa w wybranej bazie danych, ponieważ nie zawiera ona tabel z określonym prefiksem. Wybierz prefiks, który został zastosowany dla istniejących już tabel i uruchom instalatora ponownie.'; $_lang["templates"] = 'Szablony'; -$_lang["to_log_into_content_manager"] = 'Po kliknięciu w przycisk `Zamknij` będziesz mógł zalogować się do Menedżera MODxa ('.MGR_DIR.'/index.php).'; +$_lang["to_log_into_content_manager"] = 'Po kliknięciu w przycisk `Zamknij` będziesz mógł zalogować się do Menedżera MODxa ([+MGR_DIR+]/index.php).'; $_lang["toggle"] = 'Odwróć zaznaczenie'; $_lang['tvs'] = 'Zmienne Szablonów'; $_lang["unable_install_chunk"] = 'Nie można zainstalować chunków. Plik'; diff --git a/install/lang/russian-UTF8.inc.php b/install/lang/russian-UTF8.inc.php index 721a2b8d63..dbd290a0b7 100644 --- a/install/lang/russian-UTF8.inc.php +++ b/install/lang/russian-UTF8.inc.php @@ -33,13 +33,13 @@ $_lang["btnclose_value"] = 'Закрыть'; $_lang["btnnext_value"] = 'Далее'; $_lang["cant_write_config_file"] = 'Программа установки не смогла записать файл конфигурации. Скопируйте вышеперечисленное в файл '; -$_lang["cant_write_config_file_note"] = 'Как только вы это сделаете, вы можете войти в панель управления, перейдя в браузере по адресу Адрес_Вашего_Сайта/'.MGR_DIR.'/.'; +$_lang["cant_write_config_file_note"] = 'Как только вы это сделаете, вы можете войти в панель управления, перейдя в браузере по адресу Адрес_Вашего_Сайта/[+MGR_DIR+]/.'; $_lang["checkbox_select_options"] = 'Параметры выбора флажков:'; $_lang["checking_if_cache_exist"] = 'Проверка существования папок /assets/cache и /assets/cache/rss: '; $_lang["checking_if_cache_file_writable"] = 'Проверка возможности записи в файл /assets/cache/siteCache.idx.php: '; $_lang["checking_if_cache_file2_writable"] = 'Проверка возможности записи в файл /assets/cache/sitePublishing.idx.php: '; $_lang["checking_if_cache_writable"] = 'Проверка возможности записи в папки /assets/cache и /assets/cache/rss: '; -$_lang["checking_if_config_exist_and_writable"] = 'Проверка существования и возможности записи в файл /'.MGR_DIR.'/includes/config.inc.php: '; +$_lang["checking_if_config_exist_and_writable"] = 'Проверка существования и возможности записи в файл /[+MGR_DIR+]/includes/config.inc.php: '; $_lang["checking_if_export_exists"] = 'Проверка существования папки /assets/export: '; $_lang["checking_if_export_writable"] = 'Проверка возможности записи в папку /assets/export: '; $_lang["checking_if_images_exist"] = 'Проверка существования папок /assets/images, /assets/files, /assets/flash, /assets/media, /assets/backup и /assets/.thumbs: '; @@ -52,7 +52,7 @@ $_lang["checking_sessions"] = 'Проверка настроек сессий: '; $_lang["checking_table_prefix"] = 'Проверка префикса таблиц `'; $_lang["chunks"] = 'Чанки'; -$_lang["config_permissions_note"] = 'При новой Linux/Unix установке, создайте пустой файл config.inc.php в папке /'.MGR_DIR.'/includes/ с правами 0666.'; +$_lang["config_permissions_note"] = 'При новой Linux/Unix установке, создайте пустой файл config.inc.php в папке /[+MGR_DIR+]/includes/ с правами 0666.'; $_lang["connection_screen_collation"] = 'Сопоставление:'; $_lang["connection_screen_connection_method"] = 'Метод сопоставления:'; $_lang["connection_screen_database_connection_information"] = 'Параметры базы данных'; @@ -111,10 +111,10 @@ $_lang["language_code"] = 'ru'; $_lang["loading"] = 'Загружается...'; $_lang["modules"] = 'Модули'; -$_lang["MODX_footer1"] = '© 2005-2013 MODX Content Mangement Framework (CMF) project. Все права защищены. MODX лицензирован GNU GPL.'; -$_lang["MODX_footer2"] = 'MODX — свободное программное обеспечение. Мы поощряем вас быть творческими и использовать MODX как вы считаете целесообразным. Если вы внесете изменения и решите распространять ваш измененный вариант MODX, то должны сохранять и распространять исходный код бесплатно.'; -$_lang["MODX_install"] = 'MODX » Установка'; -$_lang["MODX_requires_php"] = ', а MODX необходим PHP 4.2.0 или более поздний'; +$_lang["modx_footer1"] = '© 2005-2013 MODX Content Mangement Framework (CMF) project. Все права защищены. MODX лицензирован GNU GPL.'; +$_lang["modx_footer2"] = 'MODX — свободное программное обеспечение. Мы поощряем вас быть творческими и использовать MODX как вы считаете целесообразным. Если вы внесете изменения и решите распространять ваш измененный вариант MODX, то должны сохранять и распространять исходный код бесплатно.'; +$_lang["modx_install"] = 'MODX » Установка'; +$_lang["modx_requires_php"] = ', а MODX необходим PHP 4.4.9 или более поздний'; $_lang["mysql_5051"] = ' версия MySQL - 5.0.51!'; $_lang["mysql_5051_warning"] = 'Известны проблемы с MySQL 5.0.51. Настоятельно рекомендуем обновить базу данных перед продолжением установки.'; $_lang["mysql_version_is"] = ' Ваша версия MySQL: '; @@ -175,7 +175,7 @@ $_lang["table_prefix_not_exist"] = ' - нет такого префикса таблиц в базе данных!'; $_lang["table_prefix_not_exist_note"] = 'Продолжение установки невозможно, так как нет таблиц с указанным префиксом, измените префикс таблиц и попробуйте снова.'; $_lang["templates"] = 'Шаблоны'; -$_lang["to_log_into_content_manager"] = 'Чтобы войти в панель управления ('.MGR_DIR.'/index.php) нажмите на кнопку `Закрыть`.'; +$_lang["to_log_into_content_manager"] = 'Чтобы войти в панель управления ([+MGR_DIR+]/index.php) нажмите на кнопку `Закрыть`.'; $_lang["toggle"] = 'Переключить'; $_lang["tvs"] = 'Параметры (TV)'; $_lang["unable_install_chunk"] = 'Невозможно установить чанк. Файл'; diff --git a/install/lang/spanish-utf8.inc.php b/install/lang/spanish-utf8.inc.php index d4c0357d5b..614e7d426d 100644 --- a/install/lang/spanish-utf8.inc.php +++ b/install/lang/spanish-utf8.inc.php @@ -30,13 +30,13 @@ $_lang["btnclose_value"] = 'Cerrar'; $_lang["btnnext_value"] = 'Siguiente'; $_lang["cant_write_config_file"] = 'MODx no pudo escribir al archivo de configuración. Por favor copia lo siguiente en el archivo. '; -$_lang["cant_write_config_file_note"] = 'Una vez que se ha hecho eso, puedes entrar al sistema administrativo de MODx al poner en tu navegador la dirección YourSiteName.com/'.MGR_DIR.'/.'; +$_lang["cant_write_config_file_note"] = 'Una vez que se ha hecho eso, puedes entrar al sistema administrativo de MODx al poner en tu navegador la dirección YourSiteName.com/[+MGR_DIR+]/.'; $_lang["checkbox_select_options"] = 'Lista Múltiple:'; $_lang["checking_if_cache_exist"] = 'Comprobando si el directorio assets/cache existe: '; $_lang["checking_if_cache_file2_writable"] = 'Comprobando que el archivo assets/cache/sitePublishing.idx.php es escribible: '; $_lang["checking_if_cache_file_writable"] = 'Comprobando que el archivo assets/cache/siteCache.idx.php es escribible: '; $_lang["checking_if_cache_writable"] = 'Comprobando que el directorio assets/cache es escribible: '; -$_lang["checking_if_config_exist_and_writable"] = 'Comprobando que el archivo '.MGR_DIR.'/includes/config.inc.php existe y es escribible: '; +$_lang["checking_if_config_exist_and_writable"] = 'Comprobando que el archivo [+MGR_DIR+]/includes/config.inc.php existe y es escribible: '; $_lang["checking_if_export_exists"] = 'Comprobando que el directorio assets/export existe: '; $_lang["checking_if_export_writable"] = 'Comprobando que el directorio assets/export es escribible: '; $_lang["checking_if_images_exist"] = 'Comprobando que los directorios assets/images, /assets/files, /assets/flash, /assets/media, /assets/backup y /assets/.thumbs existan: '; @@ -49,7 +49,7 @@ $_lang["checking_sessions"] = 'Checando si las sesiones están apropiadamente configuradas: '; $_lang["checking_table_prefix"] = 'Checando el prefijo de las tablas `'; $_lang["chunks"] = 'Chunks'; -$_lang["config_permissions_note"] = 'Para instalaciones nuevas en servidores Linux/Unix, favpr de crear un archivo nuevo en blanco llamado config.inc.php en el directorio '.MGR_DIR.'/includes/ con los permisos de archivo configurados a 0666.'; +$_lang["config_permissions_note"] = 'Para instalaciones nuevas en servidores Linux/Unix, favpr de crear un archivo nuevo en blanco llamado config.inc.php en el directorio [+MGR_DIR+]/includes/ con los permisos de archivo configurados a 0666.'; $_lang["connection_screen_collation"] = 'Compaginación:'; $_lang["connection_screen_connection_method"] = 'Método de Conexión:'; $_lang["connection_screen_database_connection_information"] = 'Información de la base de datos'; @@ -166,7 +166,7 @@ $_lang["table_prefix_not_exist"] = ' - ¡Este prefijo no existe en esta base de datos!'; $_lang["table_prefix_not_exist_note"] = 'El configurador no pudo instalar en la base de datos seleccionada, no contiene tablas existentes con el prefijo que especificaste para ser actualizadas. Por favor escoge un prefijo de tablas existente y corre el configurador otra vez.'; $_lang["templates"] = 'Templates'; -$_lang["to_log_into_content_manager"] = 'Para entrar al sistema de administración de MODx ('.MGR_DIR.'/index.php) dando clic en el botón de `Cerrar`.'; +$_lang["to_log_into_content_manager"] = 'Para entrar al sistema de administración de MODx ([+MGR_DIR+]/index.php) dando clic en el botón de `Cerrar`.'; $_lang["toggle"] = 'Invertir'; $_lang['tvs'] = 'Template Variables'; $_lang["unable_install_chunk"] = 'No se pudo instalar el chunk. Archivo'; diff --git a/install/lang/svenska.inc.php b/install/lang/svenska.inc.php index 11110ce047..e470ca249f 100644 --- a/install/lang/svenska.inc.php +++ b/install/lang/svenska.inc.php @@ -35,13 +35,13 @@ $_lang["btnclose_value"] = 'Stäng'; $_lang["btnnext_value"] = 'Nästa'; $_lang["cant_write_config_file"] = 'MODx kunde inte skriva konfigurationsfilen. Kopiera följande till filen '; -$_lang["cant_write_config_file_note"] = 'När det är klart kan du logga in i MODx administrationsdel genom att ange adressen DinWebbplats.se/'.MGR_DIR.'/ i din webbläsare.'; +$_lang["cant_write_config_file_note"] = 'När det är klart kan du logga in i MODx administrationsdel genom att ange adressen DinWebbplats.se/[+MGR_DIR+]/ i din webbläsare.'; $_lang["checkbox_select_options"] = 'Välj flera element:'; $_lang["checking_if_cache_exist"] = 'Kontrollerar att katalogerna /assets/cache och /assets/cache/rss existerar: '; $_lang["checking_if_cache_file_writable"] = 'Kontrollerar att filen /assets/cache/siteCache.idx.php är skrivbar: '; $_lang["checking_if_cache_file2_writable"] = 'Kontrollerar att filen /assets/cache/sitePublishing.idx.php är skrivbar: '; $_lang["checking_if_cache_writable"] = 'Kontrollerar att katalogerna /assets/cache och /assets/cache/rss är skrivbara: '; -$_lang["checking_if_config_exist_and_writable"] = 'Kontrollerar att filen /'.MGR_DIR.'/includes/config.inc.php existerar och är skrivbar: '; +$_lang["checking_if_config_exist_and_writable"] = 'Kontrollerar att filen /[+MGR_DIR+]/includes/config.inc.php existerar och är skrivbar: '; $_lang["checking_if_export_exists"] = 'Kontrollerar att katalogen /assets/export existerar: '; $_lang["checking_if_export_writable"] = 'Kontrollerar att katalogen /assets/export är skrivbar: '; $_lang["checking_if_images_exist"] = 'Kontrollerar att katalogerna /assets/images, /assets/files, /assets/flash, /assets/media, /assets/backup och /assets/.thumbs existerar: '; @@ -54,7 +54,7 @@ $_lang["checking_sessions"] = 'Kontrollerar att sessioner är korrekt konfigurerade: '; $_lang["checking_table_prefix"] = 'Kontrollerar tabellprefixet `'; $_lang["chunks"] = 'Chunks'; -$_lang["config_permissions_note"] = 'För nya installationer i Linux/Unix-miljö måste en tom fil med namnet config.inc.php skapas i katalogen /'.MGR_DIR.'/includes/ med åtkomsträttigheterna satta till 0666.'; +$_lang["config_permissions_note"] = 'För nya installationer i Linux/Unix-miljö måste en tom fil med namnet config.inc.php skapas i katalogen /[+MGR_DIR+]/includes/ med åtkomsträttigheterna satta till 0666.'; $_lang["connection_screen_collation"] = 'Kollationering:'; $_lang["connection_screen_connection_method"] = 'Anslutningsmetod:'; $_lang["connection_screen_database_connection_information"] = 'Databasuppgifter'; @@ -177,7 +177,7 @@ $_lang["table_prefix_not_exist"] = ' - Tabellprefixet finns inte i den här databasen!'; $_lang["table_prefix_not_exist_note"] = 'Installationsprogrammet kunde inte installera i den valda databasen eftersom den inte innehåller tabeller med det prefix du angav för uppgradering. Välj ett existerande prefix och kör sedan installationsprogrammet igen.'; $_lang["templates"] = 'Mallar'; -$_lang["to_log_into_content_manager"] = 'Du kan logga in i innehållshanteraren ('.MGR_DIR.'/index.php) genom att klicka på "Stäng"-knappen.'; +$_lang["to_log_into_content_manager"] = 'Du kan logga in i innehållshanteraren ([+MGR_DIR+]/index.php) genom att klicka på "Stäng"-knappen.'; $_lang["toggle"] = 'Växla'; $_lang['tvs'] = 'Mallvariabler'; $_lang["unable_install_chunk"] = 'Kunde inte installera chunk. Fil'; From 309f1bf083c5287d287e8880683e50c14b8919a9 Mon Sep 17 00:00:00 2001 From: yama Date: Mon, 2 Sep 2013 11:10:47 +0900 Subject: [PATCH 419/530] Fix - MODxRE/style.css --- manager/media/style/MODxRE/style.css | 1 - 1 file changed, 1 deletion(-) diff --git a/manager/media/style/MODxRE/style.css b/manager/media/style/MODxRE/style.css index 07b2ea219d..bc7a99d5a4 100644 --- a/manager/media/style/MODxRE/style.css +++ b/manager/media/style/MODxRE/style.css @@ -1791,5 +1791,4 @@ strong[style*='color:#EF1D1D'] { color: red !important; } -span.unpublish{color:gray;} #tabEvents table, #tabEvents td {padding:2px;} From 41aaf7b9924a859520282268f64c465ea28f793d Mon Sep 17 00:00:00 2001 From: yama Date: Mon, 2 Sep 2013 11:14:09 +0900 Subject: [PATCH 420/530] Fix - Install language --- install/lang/portuguese-br.inc.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/install/lang/portuguese-br.inc.php b/install/lang/portuguese-br.inc.php index 47d599d26d..364ca135f3 100755 --- a/install/lang/portuguese-br.inc.php +++ b/install/lang/portuguese-br.inc.php @@ -29,13 +29,13 @@ $_lang["btnclose_value"] = 'Fechar'; $_lang["btnnext_value"] = 'Prximo'; $_lang["cant_write_config_file"] = 'MODx no pode escrever o arquivo de configurao. Por favor copie no arquivo as seguintes informaes '; -$_lang["cant_write_config_file_note"] = 'Assim que isto for feito, voc pode acessar o MODx Admin por apontar seu navegador para NomeDoSeuSite.com/'.MGR_DIR.'/.'; +$_lang["cant_write_config_file_note"] = 'Assim que isto for feito, voc pode acessar o MODx Admin por apontar seu navegador para NomeDoSeuSite.com/[+MGR_DIR+]/.'; $_lang["checkbox_select_options"] = 'Selecionar:'; $_lang["checking_if_cache_exist"] = 'Checando se o diretrio assets/cache existe: '; $_lang["checking_if_cache_file2_writable"] = 'Checando se o arquivo assets/cache/sitePublishing.idx.php est liberado pra escrita: '; $_lang["checking_if_cache_file_writable"] = 'Checando se o arquivo assets/cache/siteCache.idx.php est liberado pra escrita: '; $_lang["checking_if_cache_writable"] = 'Checando se o diretrio assets/cache est liberado pra escrita: '; -$_lang["checking_if_config_exist_and_writable"] = 'Checando se o arquivo '.MGR_DIR.'/includes/config.inc.php existe e est liberado pra escrita: '; +$_lang["checking_if_config_exist_and_writable"] = 'Checando se o arquivo [+MGR_DIR+]/includes/config.inc.php existe e est liberado pra escrita: '; $_lang["checking_if_export_exists"] = 'Checando se o diretrio assets/export directory exists: '; $_lang["checking_if_export_writable"] = 'Checando se o diretrio assets/export est liberado pra escrita: '; $_lang["checking_if_images_exist"] = 'Checando se o diretrio assets/images existe: '; @@ -46,7 +46,7 @@ $_lang["checking_sessions"] = 'Checando se as sees esto configuradas apropiadamente: '; $_lang["checking_table_prefix"] = 'Verificando Prefixo de Tabela `'; $_lang["chunks"] = 'Chunks'; -$_lang["config_permissions_note"] = 'Para novas instalaes de Linux/Unix, crie um arquivo vazio chamado config.inc.php no diretrio '.MGR_DIR.'/includes/ com as permisses de 0666.'; +$_lang["config_permissions_note"] = 'Para novas instalaes de Linux/Unix, crie um arquivo vazio chamado config.inc.php no diretrio [+MGR_DIR+]/includes/ com as permisses de 0666.'; $_lang["connection_screen_collation"] = 'Collation:'; $_lang["connection_screen_connection_information"] = 'Informao de Conexo'; $_lang["connection_screen_database_connection_information"] = 'Informao da Base de Dados.'; @@ -149,7 +149,7 @@ $_lang["table_prefix_not_exist"] = ' - Prefixo de Table no existe nesta Base de Dados!'; $_lang["table_prefix_not_exist_note"] = 'No foi possvel instalar na base de dados selecionada, como no h tabelas com o prefixo que voc inseriu. Por favor, escolha outro prefixo de tabela e re-comee a atualizao.'; $_lang["templates"] = 'Templates'; -$_lang["to_log_into_content_manager"] = 'Para logar no gerenciador de contedo ('.MGR_DIR.'/index.php) voc pode clicar no boto Fechar.'; +$_lang["to_log_into_content_manager"] = 'Para logar no gerenciador de contedo ([+MGR_DIR+]/index.php) voc pode clicar no boto Fechar.'; $_lang["toggle"] = 'Detalhar'; $_lang["unable_install_chunk"] = 'No foi possivel instalar o chunk. Arquivo'; $_lang["unable_install_module"] = 'No foi possivel instalar o module. Arquivo'; From 3dd5464825c4e65d93ed3c10517dc0ef729e3e9e Mon Sep 17 00:00:00 2001 From: yama Date: Mon, 2 Sep 2013 11:18:37 +0900 Subject: [PATCH 421/530] Add install/nederlands-utf8.inc.php --- install/lang/nederlands-utf8.inc.php | 194 +++++++++++++++++++++++++++ 1 file changed, 194 insertions(+) create mode 100644 install/lang/nederlands-utf8.inc.php diff --git a/install/lang/nederlands-utf8.inc.php b/install/lang/nederlands-utf8.inc.php new file mode 100644 index 0000000000..c3c5318a76 --- /dev/null +++ b/install/lang/nederlands-utf8.inc.php @@ -0,0 +1,194 @@ +/assets/cache en /assets/cache/rss mappen bestaan: '; +$_lang["checking_if_cache_file_writable"] = 'Nakijken of /assets/cache/siteCache.idx.php bestand schrijfbaar is:'; +$_lang["checking_if_cache_file2_writable"] = 'Nakijken of /assets/cache/sitePublishing.idx.php bestand schrijfbaar is: '; +$_lang["checking_if_cache_writable"] = 'Checking if /assets/cache and /assets/cache/rss directories are writable: '; +$_lang["checking_if_config_exist_and_writable"] = 'Checking if /[+MGR_DIR+]/includes/config.inc.php exists and is writable: '; +$_lang["checking_if_export_exists"] = 'Checking if /assets/export directory exists: '; +$_lang["checking_if_export_writable"] = 'Checking if /assets/export directory is writable: '; +$_lang["checking_if_images_exist"] = 'Checking if /assets/images, /assets/files, /assets/flash, /assets/media, /assets/backup and /assets/.thumbs directories exists: '; +$_lang["checking_if_images_writable"] = 'Checking if /assets/images, /assets/files, /assets/flash, /assets/media, /assets/backup and /assets/.thumbs directories are writable: '; +$_lang["checking_mysql_strict_mode"] = 'Checking MySQL for strict sql_mode: '; +$_lang["checking_mysql_version"] = 'Versie van MYSQL nakijken:'; +$_lang["checking_php_version"] = 'PHP versie nakijken:'; +$_lang["checking_registerglobals"] = 'Kijken of Register_Globals uit staat geschakeld:'; +$_lang["checking_registerglobals_note"] = 'This configuration makes your site much more susceptible to Cross Site Scripting (XSS) attacks. You should speak to your host about disabling this setting, usually by one of three ways: modifying the global php.ini file, adding rules to a .htaccess file in the root of your MODX install, or adding custom php.ini override files in every directory on your install (and there\'s a lot of them). You will still be able to install MODX, but consider yourself warned.'; //Look at changing this to provide a solution. +$_lang["checking_sessions"] = 'Checking if sessions are properly configured: '; +$_lang["checking_table_prefix"] = 'Checking table prefix `'; +$_lang["chunks"] = 'Chunks'; +$_lang["config_permissions_note"] = 'For new Linux/Unix installs, please create a blank file named config.inc.php in the /[+MGR_DIR+]/includes/ directory with file permissions set to 0666.'; +$_lang["connection_screen_collation"] = 'Collation:'; +$_lang["connection_screen_connection_method"] = 'Connection method:'; +$_lang["connection_screen_database_connection_information"] = 'Database informatie'; +$_lang["connection_screen_database_connection_note"] = 'Enter the database name to use or which you wish to create for this MODX install. If no database exists, the installer will attempt to create one. This may fail depending on the MySQL user permissions.'; +$_lang["connection_screen_database_host"] = 'Database host:'; +$_lang["connection_screen_database_info"] = 'Database Information'; +$_lang["connection_screen_database_login"] = 'Database login name:'; +$_lang["connection_screen_database_name"] = 'Database name:'; +$_lang["connection_screen_database_pass"] = 'Database password:'; +$_lang["connection_screen_database_test_connection"] = 'Create or test selection of your database.'; +$_lang["connection_screen_default_admin_email"] = 'Administrator email:'; +$_lang["connection_screen_default_admin_login"] = 'Administrator username:'; +$_lang["connection_screen_default_admin_note"] = 'Now you\'ll need to enter some details for the main administrator account. You can fill in your own name here, and a password you\'re not likely to forget. You\'ll need these to log into Admin once setup is complete.'; +$_lang["connection_screen_default_admin_password"] = 'Administrator password:'; +$_lang["connection_screen_default_admin_password_confirm"] = 'Confirm password:'; +$_lang["connection_screen_default_admin_user"] = 'Default Admin User'; +$_lang["connection_screen_defaults"] = 'Default Manager Settings'; +$_lang["connection_screen_server_connection_information"] = 'Server connection and login information'; +$_lang["connection_screen_server_connection_note"] = 'Enter the database host (server name or IP address), the username and password before testing the connection.'; +$_lang["connection_screen_server_test_connection"] = 'Test database server connection and view collations.'; +$_lang["connection_screen_table_prefix"] = 'Table prefix:'; +$_lang["creating_database_connection"] = 'Creating connection to the database: '; +$_lang["database_alerts"] = 'Database Alerts!'; +$_lang["database_connection_failed"] = 'Database connection failed!'; +$_lang["database_connection_failed_note"] = 'Please check the database login details and try again.'; +$_lang["database_use_failed"] = 'Database could not be selected!'; +$_lang["database_use_failed_note"] = 'Please check the database permissions for the specified user and try again.'; +$_lang["default_language"] = 'Default Manager Language'; +$_lang["default_language_description"] = 'This is the default language that will be used in the MODX Manager back end control panel.'; +$_lang["during_execution_of_sql"] = ' during the execution of SQL statement '; +$_lang["encoding"] = 'iso-8859-1'; //charset encoding for html header +$_lang["error"] = 'error'; +$_lang["errors"] = 'errors'; +$_lang["failed"] = 'FAILED!'; +$_lang["help"] = 'Help!'; +$_lang["help_link"] = 'http://forums.modx.com/'; +$_lang["help_title"] = 'Installation assistance in the MODX forums'; +$_lang["iagree_box"] = 'I agree to the terms of the MODX license. For translations of the GPL version 2 license, please visit the GNU Operating System website.'; +$_lang["install"] = 'Install'; +$_lang["install_overwrite"] = 'Install/Overwrite'; +$_lang["install_results"] = 'Install results'; +$_lang["install_update"] = 'Install/Update'; +$_lang["installation_error_occured"] = 'The following errors had occurred during installation'; +$_lang["installation_install_new_copy"] = 'Install a new copy of '; +$_lang["installation_install_new_note"] = 'Please note this option may overwrite any data inside your database.'; +$_lang["installation_mode"] = 'Installation Mode'; +$_lang["installation_new_installation"] = 'New Installation'; +$_lang["installation_note"] = 'Note: After logging into the manager you should edit and save your System Configuration settings before browsing the site by choosing Tools -> System Configuration in the MODX Manager.'; +$_lang["installation_successful"] = 'Installation was successful!'; +$_lang["installation_upgrade_advanced"] = 'Advanced Upgrade'; +$_lang["installation_upgrade_advanced_note"] = 'For advanced database admins or moving to servers with a different database connection character set.
    You will need to know your full database name, user, password and connection/collation details.'; +$_lang["installation_upgrade_existing"] = 'Upgrade Existing Install'; +$_lang["installation_upgrade_existing_note"] = 'Upgrade your current files and database.'; +$_lang["installed"] = 'Installed'; +$_lang["installing_demo_site"] = 'Installing demo site: '; +$_lang["language_code"] = 'en'; // for html element e.g. +$_lang["loading"] = 'Loading...'; +$_lang["modules"] = 'Modules'; +$_lang["modx_footer1"] = '© 2005-2013 the MODX Content Management Framework (CMF) project. All rights reserved. MODX is licensed under the GNU GPL.'; +$_lang["modx_footer2"] = 'MODX is free software. We encourage you to be creative and make use of MODX in any way you see fit. Just make sure that if you do make changes and decide to redistribute your modified MODX, that you keep the source code free!'; +$_lang["modx_install"] = 'MODX » Install'; +$_lang["modx_requires_php"] = ', and MODX requires PHP 4.2.0 or later'; +$_lang["mysql_5051"] = ' MySQL server version is 5.0.51!'; +$_lang["mysql_5051_warning"] = 'There are known issues with MySQL 5.0.51. It is recommended that you upgrade before continuing.'; +$_lang["mysql_version_is"] = ' Your MySQL version is: '; +$_lang["no"] = 'No'; +$_lang["none"] = 'None'; +$_lang["not_found"] = 'not found'; +$_lang["ok"] = 'OK!'; +$_lang["optional_items"] = 'Optional Items'; +$_lang["optional_items_note"] = 'Please choose your installation options and click Install:'; +$_lang["php_security_notice"] = 'Security notice

    While MODX will work on your PHP version, usage of MODX on this version is not recommended. Your version of PHP is vulnerable to numerous security holes. Please upgrade to PHP version is 4.3.8 or higher, which patches these holes. It is recommended you upgrade to this version for the security of your own website.

    '; +$_lang["please_correct_error"] = '. Please correct the error'; +$_lang["please_correct_errors"] = '. Please correct the errors'; +$_lang["plugins"] = 'Plugins'; +$_lang["preinstall_validation"] = 'Pre-install validation'; +$_lang["recommend_setting_change_title"] = 'Recommended Setting Change'; +$_lang["recommend_setting_change_validate_referer_confirmation"] = 'Setting change: Validate HTTP_REFERER headers?'; +$_lang["recommend_setting_change_validate_referer_description"] = 'Your site is not configured to validate the HTTP_REFERER of incoming requests to the Manager. We strongly recommend enabling this setting to reduce the risk of a CSRF (Cross Site Request Forgery) attack.'; +$_lang["remove_install_folder_auto"] = 'Remove the install folder and files from my website
     (This operation requires delete permission to the granted to the install folder).'; +$_lang["remove_install_folder_manual"] = 'Please remember to remove the "install" folder before you log into the Content Manager.'; +$_lang["retry"] = 'Retry'; +$_lang["running_database_updates"] = 'Running database updates: '; +$_lang["sample_web_site"] = 'Sample Web Site'; +$_lang["sample_web_site_note"] = 'Please note that this will overwrite existing documents and resources.'; +$_lang["session_problem"] = 'A problem was detected with your server sessions. Please consult your server admin to correct this problem.'; +$_lang["session_problem_try_again"] = 'Try again?'; +$_lang["setup_cannot_continue"] = 'Unfortunately, Setup cannot continue at the moment, due to the above '; +$_lang["setup_couldnt_install"] = 'MODX setup couldn\'t install/alter some tables inside the selected database.'; +$_lang["setup_database"] = 'Setup will now attempt to setup the database:
    '; +$_lang["setup_database_create_connection"] = 'Creating connection to the database: '; +$_lang["setup_database_create_connection_failed"] = 'Database connection failed!'; +$_lang["setup_database_create_connection_failed_note"] = 'Please check the database login details and try again.'; +$_lang["setup_database_creating_tables"] = 'Creating database tables: '; +$_lang["setup_database_creation"] = 'Creating database `'; +$_lang["setup_database_creation_failed"] = 'Database creation failed!'; +$_lang["setup_database_creation_failed_note"] = ' - Setup could not create the database!'; +$_lang["setup_database_creation_failed_note2"] = 'Setup could not create the database, and no existing database with the same name was found. It is likely that your hosting provider\'s security does not allow external scripts to create a database. Please create a database according to your hosting provider\'s procedure, and run Setup again.'; +$_lang["setup_database_selection"] = 'Selecting database `'; +$_lang["setup_database_selection_failed"] = 'Database selection failed...'; +$_lang["setup_database_selection_failed_note"] = 'The database does not exist. Setup will attempt to create it.'; +$_lang["snippets"] = 'Snippets'; +$_lang["some_tables_not_updated"] = 'Some tables were not updated. This might be due to previous modifications.'; +$_lang["status_checking_database"] = 'Checking database: '; +$_lang["status_connecting"] = ' Connection to host: '; +$_lang["status_failed"] = 'failed!'; +$_lang["status_failed_could_not_create_database"] = 'failed - could not create database'; +$_lang["status_failed_database_collation_does_not_match"] = 'failed - database collation mismatch; use SET NAMES or choose %s'; +$_lang["status_failed_table_prefix_already_in_use"] = 'failed - table prefix already in use!'; +$_lang["status_passed"] = 'passed - database selected'; +$_lang["status_passed_database_created"] = 'passed - database created'; +$_lang["status_passed_server"] = 'passed - collations now available'; +$_lang["strict_mode"] = ' MySQL server strict sql_mode is enabled!'; +$_lang["strict_mode_error"] = 'Certain features of MODX may not work properly unless the STRICT_TRANS_TABLES sql_mode is disabled. You can set the MySQL mode by editing the my.cnf file or contact your server administrator.'; +$_lang["summary_setup_check"] = 'Setup has carried out a number of checks to see if everything\'s ready to start the setup.'; +$_lang["system_configuration"] = 'System Configuration'; +$_lang["system_configuration_validate_referer_description"] = 'The Validate HTTP_REFERER headers setting is recommended and can protect your site from CSRF attacks, but in some server configurations, can make your manager inaccessible.'; +$_lang["table_prefix_already_inuse"] = ' - Table prefix is already in use in this database!'; +$_lang["table_prefix_already_inuse_note"] = 'Setup couldn\'t install into the selected database, as it already contains tables with the prefix you specified. Please choose a new table prefix, and run Setup again.'; +$_lang["table_prefix_not_exist"] = ' - Table prefix does not exist in this database!'; +$_lang["table_prefix_not_exist_note"] = 'Setup couldn\'t install into the selected database, as it does not contain existing tables with the prefix you specified to be upgraded. Please choose an existing table prefix, and run Setup again.'; +$_lang["templates"] = 'Templates'; +$_lang["to_log_into_content_manager"] = 'To log into the Content Manager ([+MGR_DIR+]/index.php) you can click on the `Close` button.'; +$_lang["toggle"] = 'Toggle'; +$_lang['tvs'] = 'Template Variables'; +$_lang["unable_install_chunk"] = 'Unable to install chunk. File'; +$_lang["unable_install_module"] = 'Unable to install module. File'; +$_lang["unable_install_plugin"] = 'Unable to install plugin. File'; +$_lang["unable_install_snippet"] = 'Unable to install snippet. File'; +$_lang["unable_install_template"] = 'Unable to install template. File'; +$_lang["upgrade_note"] = 'Note: Before browsing your site you should log into the manager with an administrative account, then review and save your System Configuration settings.'; +$_lang["upgraded"] = 'Upgraded'; +$_lang["validate_referer_title"] = 'Validate HTTP_REFERER headers?'; +$_lang["visit_forum"] = ', visit the MODX Forums.'; +$_lang["warning"] = 'WARNING!'; +$_lang["welcome_message_start"] = 'First, choose the type of installation to perform:'; +$_lang["welcome_message_text"] = 'This program will guide you through the rest of the installation.'; +$_lang["welcome_message_welcome"] = 'Welcome to the MODX installation program.'; +$_lang["writing_config_file"] = 'Writing configuration file: '; +$_lang["yes"] = 'Yes'; +$_lang["you_running_php"] = ' - You are running on PHP '; +?> \ No newline at end of file From af83cab13aecaff59496f3a364d9105992a590f0 Mon Sep 17 00:00:00 2001 From: yama Date: Mon, 2 Sep 2013 11:28:57 +0900 Subject: [PATCH 422/530] Replace [[ListIndexer]] to [[Ditto]] --- install/assets/templates/modx_host.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/assets/templates/modx_host.tpl b/install/assets/templates/modx_host.tpl index bad13f0056..6908630307 100644 --- a/install/assets/templates/modx_host.tpl +++ b/install/assets/templates/modx_host.tpl @@ -39,7 +39,7 @@ [[Ditto? &parents=`2` &display=`2` &total=`20` &removeChunk=`Comments` &tpl=`nl_sidebar`]]

    Most Recent:

    - [[ListIndexer?LIn_root=0]]
    +
      [[Ditto?parents=0&display=5&tpl='@CODE:
    • [+pagetitle+] [+date+]
    • ']]

    Login:

    [!WebLogin? &tpl=`WebLoginSideBar` &loginhomeid=`[(site_start)]`!]

    Meta:

    From c9e18f2bf02ca280318dc67dd0fe64248b733629 Mon Sep 17 00:00:00 2001 From: yama Date: Mon, 2 Sep 2013 11:29:54 +0900 Subject: [PATCH 423/530] Fix modxcms.com -> modx.com --- install/assets/templates/modx_host.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/assets/templates/modx_host.tpl b/install/assets/templates/modx_host.tpl index 6908630307..de5f81eec6 100644 --- a/install/assets/templates/modx_host.tpl +++ b/install/assets/templates/modx_host.tpl @@ -45,7 +45,7 @@

    Meta:

    Valid XHTML

    Valid css

    -

    MODx

    +

    MODX

    From e599f490d38242c85b758a85d3522b846936d4a9 Mon Sep 17 00:00:00 2001 From: yama Date: Mon, 2 Sep 2013 12:13:42 +0900 Subject: [PATCH 424/530] Fix Ditto DebugConsole --- .../snippets/ditto/debug/debug.templates.php | 19 +++++++------------ .../ditto/debug/modxDebugConsole.class.php | 5 +++-- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/assets/snippets/ditto/debug/debug.templates.php b/assets/snippets/ditto/debug/debug.templates.php index 579ead9084..ecac661b6a 100644 --- a/assets/snippets/ditto/debug/debug.templates.php +++ b/assets/snippets/ditto/debug/debug.templates.php @@ -6,19 +6,16 @@ [+title+] - - - - - + + + -
     [+title+]
    -
    +
    [+content+] @@ -26,7 +23,7 @@ TPL; $dbg_templates["links"] = << [+open_dbg_console+]
    + [+open_dbg_console+]
    [+save_dbg_console+]

    TPL; @@ -37,9 +34,7 @@ $dbg_templates["tab"] = <<

    [+title+]

    - + [+tab_content+]
    TPL; - -?> \ No newline at end of file diff --git a/assets/snippets/ditto/debug/modxDebugConsole.class.php b/assets/snippets/ditto/debug/modxDebugConsole.class.php index 1bf3093726..fe9429fbea 100644 --- a/assets/snippets/ditto/debug/modxDebugConsole.class.php +++ b/assets/snippets/ditto/debug/modxDebugConsole.class.php @@ -27,7 +27,7 @@ function render($cTabs,$title,$base_path) { } $placeholders = array( "[+ditto_base_url+]" => $base_path, - "[+base_url+]" => MODX_MANAGER_URL, + "[+base_url+]" => $modx->config["site_url"].MGR_DIR . '/', "[+theme+]" => $modx->config["manager_theme"], "[+title+]" => $title, "[+content+]" => $content, @@ -116,7 +116,8 @@ function makeTab($title,$content) { // Make all MODx tags safe for the output // --------------------------------------------------- function makeMODxSafe($value) { - $value = (strpos($value,"<") !== FALSE) ? "
    ".htmlentities($value)."
    " : $value; + global $modx; + $value = (strpos($value,"<") !== FALSE) ? "
    ".htmlentities($value,ENT_NOQUOTES,$modx->config["modx_charset"])."
    " : $value; $value = str_replace("[","[",$value); $value = str_replace("]","]",$value); $value = str_replace("{","{",$value); From 0b669950c017be8dbf03a212d1b2d94bf7b22118 Mon Sep 17 00:00:00 2001 From: yama Date: Mon, 2 Sep 2013 12:15:20 +0900 Subject: [PATCH 425/530] Fix - Sample contents --- install/setup.data.sql | 56 ++++++++++++++++-------------------------- 1 file changed, 21 insertions(+), 35 deletions(-) diff --git a/install/setup.data.sql b/install/setup.data.sql index 3bee75733f..5e8cc1fd8b 100644 --- a/install/setup.data.sql +++ b/install/setup.data.sql @@ -30,61 +30,47 @@ REPLACE INTO `{PREFIX}documentgroup_names` VALUES ('1','Site Admin Pages','0','0 # -REPLACE INTO `{PREFIX}site_content` VALUES (1, 'document', 'text/html', 'Home', 'Welcome to MODX', 'Introduction to MODX', 'index', '', 1, 0, 0, 0, 0, 'Create and do amazing things with MODX', '

    Install Successful!

    \r\n

    You have successfully installed and configured MODX. We hope you find this site an adequate starting configuration for many small business, organization or personal websites; just change the template and content, and you''ll be good to go! This site is preconfigured with a variety of options we hope are helpful, relevant and just plain cool for many marketing or personal sites:

    \r\n
      \r\n
    • Simple Blog. When logged into your site, you''ll be able to create new entries from the front end. This can also be turned into a News publishing or PR publishing system. View example blog
    • \r\n
    • Easy Comments. When logged into your site, your registered site users can comment on your posts. View example
    • \r\n
    • RSS Feeds. Your site visitors can stay up to date using your site feeds. View RSS feed
    • \r\n
    • Automatic User Registration. Those that wish to comment on blogs must first create an account. This comes pre-configured with a "Captcha" anti-robot registration feature. View registration form
    • \r\n
    • QuickEdit. When you''re logged into the manager, you can edit a page directly from the front end! More about CMS features
    • \r\n
    • Integrated Site Search. Allows visitors to search only the pages you wish them to search. Uses Ajax to display results without loading a new page.
    • \r\n
    • Powerful Navigation Builder. Duplicate or build virtually any navigation system with our dynamic menu builder code. The menu above, for example. More about menu features
    • \r\n
    • Mootools enabled. You''re on your way to Web 2.0 and AJAX goodness. More about Ajax features
    • \r\n
    • Custom "page not found (404)" page. Help visitors who go astray to find what they''re looking for. View 404 page
    • \r\n
    • Contact Us form. A highly configurable contact form you should customize to point to the right email address. Comes pre-configured to prevent mail-form-injection so your site does not become a source for spam. View form
    • \r\n
    • Newest documents list. Shows your visitor the most recently added pages (configurable).
    • \r\n
    • Customizable Content Manager. Preview uploaded images, hide or rename fields and lots more. See ManagerManager''s documentation for details and instructions. Quick start: ManagerManager by default will look for "rules" in a Chunk named "mm_rules". Simply copy or rename the Chunk named "mm_demo_rules" to "mm_rules" and try it out!
    • \r\n
    \r\n

    To log into the MODX Control Panel and start customizing this site, point your browser to [(site_manager_url)].

    ', 1, 4, 1, 1, 1, 1, 1144904400, 1, 1160262629, 0, 0, 0, 0, 0, 'Home', 0, 0, 0, 0, 0, 0, 0); - - -REPLACE INTO `{PREFIX}site_content` VALUES (2, 'document', 'text/html', 'Blog', 'My Blog', '', 'blog', '', 1, 0, 0, 0, 1, '', '[[Ditto? &parents=`2` &display=`2` &removeChunk=`Comments` &tpl=`ditto_blog` &paginate=`1` &extenders=`summary,dateFilter` &paginateAlwaysShowLinks=`1` &tagData=`documentTags`]]\r\n\r\n

    Showing [+start+] - [+stop+] of [+total+] Articles

    \r\n\r\n
    [+previous+] [+pages+] [+next+]
    \r\n\r\n
     
    \r\n\r\n[[Reflect? &config=`wordpress` &dittoSnippetParameters=`parents:2` &id=`wp` &getDocuments=`1`]]', 1, 4, 2, 0, 0, 1, 1144904400, 1, 1159818696, 0, 0, 0, 0, 0, 'Blog', 0, 0, 0, 0, 0, 0, 0); - - -REPLACE INTO `{PREFIX}site_content` VALUES (4, 'document', 'text/html', '[*loginName*]', 'Login to Enable to Comments', '', 'login', '', 1, 0, 0, 0, 0, '', '

    In order to comment on blog entries, you must be a registered user of [(site_name)]. If you haven''t already registered, you can request an account.

    \r\n
    [!WebLogin? &tpl=`WebLoginSideBar` &loginhomeid=`2`!]
    ', 1, 4, 11, 0, 0, 1, 1144904400, 1, 1144904400, 0, 0, 0, 0, 0, '[*loginName*]', 0, 0, 0, 0, 0, 0, 1); - - -REPLACE INTO `{PREFIX}site_content` VALUES (5, 'document', 'text/html', 'Request an Account', 'Sign Up for Full Site Privileges', '', 'request-an-account', '', 1, 0, 0, 0, 0, '', '[[WebSignup? &tpl=`FormSignup` &groups=`Registered Users`]]', 1, 4, 3, 0, 0, 1, 1144904400, 1, 1158320704, 0, 0, 0, 0, 0, '', 0, 0, 0, 0, 0, 0, 1); - - -REPLACE INTO `{PREFIX}site_content` VALUES (6, 'document', 'text/html', 'Contact Us', 'Contact [(site_name)]', '', 'contact-us', '', 1, 0, 0, 0, 0, '', '[!eForm? &formid=`ContactForm` &subject=`[+subject+]` &to=`[(emailsender)]` &ccsender=`1` &tpl=`ContactForm` &report=`ContactFormReport` &invalidClass=`invalidValue` &requiredClass=`requiredValue` &cssStyle=`ContactStyles` &gotoid=`46` !]\r\n', 0, 4, 14, 1, 0, 1, 1144904400, 1, 1159303922, 0, 0, 0, 0, 0, 'Contact us', 0, 0, 0, 0, 0, 0, 0); - - -REPLACE INTO `{PREFIX}site_content` VALUES (7, 'document', 'text/html', '404 - Document Not Found', 'Uh oh ... it''s a 404! (Page Not Found)', '', 'doc-not-found', '', 1, 0, 0, 0, 0, '', '

    Looks like you tried to go somewhere that does not exist... perhaps you need to login or you''d like one of the following pages instead:

    \r\n\r\n[[Wayfinder? &startId=`0` &showDescription=`1`]]\r\n\r\n

    Want to find it the old fashioned way? Use the site search at the top of this site to find what you seek.

    \r\n\r\n', 1, 4, 4, 0, 1, 1, 1144904400, 1, 1159301173, 0, 0, 0, 0, 0, '', 0, 0, 0, 0, 0, 0, 1); - - -REPLACE INTO `{PREFIX}site_content` VALUES (8, 'document', 'text/html', 'Search Results', 'Your Search Results', '', 'search-results', '', 1, 0, 0, 0, 0, '', '[!AjaxSearch? &showInputForm=`0` &ajaxSearch=`0`!]', 0, 4, 5, 0, 0, 1, 1144904400, 1, 1158613055, 0, 0, 0, 0, 0, '', 1, 0, 0, 0, 0, 0, 1); - - -REPLACE INTO `{PREFIX}site_content` VALUES (9, 'document', 'text/html', 'Mini-Blog HOWTO', 'How to Start Posting with MODX Mini-Blogs', '', 'article-1126081344', '', 1, 0, 0, 2, 1, '', '

    Setting up a mini-blog is relatively simple. Here''s what you need to do to get started with making new posts:

    \r\n
      \r\n
    1. Login to the MODX Control Panel.
    2. \r\n
    3. Press the plus-sign next to the Blog(2) container resource to see the blog entries posted there.
    4. \r\n
    5. To make a new Blog entry, simply right-click the Blog container document and choose the "Create Resource here" menu option. To edit an existing blog article, right click the entry and choose the "Edit Resource" menu option.
    6. \r\n \r\n
    7. Write or edit the content and press save, making sure the document is published.
    8. \r\n
    9. Everything else is automatic; you''re done!
    10. \r\n
    \r\n{{Comments}}', 1, 4, 0, 1, 1, -1, 1144904400, 1, 1160171764, 0, 0, 0, 0, 0, '', 0, 0, 0, 0, 0, 0, 1); - - -REPLACE INTO `{PREFIX}site_content` VALUES (11, 'document', 'text/xml', 'RSS Feed', '[(site_name)] RSS Feed', '', 'feed.rss', '', 1, 0, 0, 0, 0, '', '[[Ditto? &parents=`2` &format=`rss` &display=`20` &total=`20` &removeChunk=`Comments`]]', 0, 0, 6, 0, 0, 1, 1144904400, 1, 1160062859, 0, 0, 0, 0, 0, '', 0, 0, 0, 0, 0, 0, 1); +# Dumping data for table `modx_site_content` +# -REPLACE INTO `{PREFIX}site_content` VALUES (14, 'document', 'text/html', 'Content Management', 'Ways to manage content', '', 'cms', '', 1, 0, 0, 15, 0, '', '

    Manage your content in the backend

    \r\n

    The Manager is a skinnable feature-packed tool for admin users. You can add extra users and limit what functions they can access. MODX''s Manager makes creating content and managing templates and reusable elements easy. Modules can be added to work with other datasets or make management tasks easier.

    \r\n

    Manage your content in the frontend

    \r\n

    The QuickEdit bar lets manager users edit content whilst browsing the site. Most content fields and template variables can be edited quickly and easily.

    \r\n

    Enable web users to add content

    \r\n

    Custom data entry is easy to code using the MODX API - so you can design forms and collect whatever information you need.

    ', 0, 4, 3, 1, 1, 1, 1144904400, 1, 1158331927, 0, 0, 0, 0, 0, 'Manage Content', 0, 0, 0, 0, 0, 0, 0); +REPLACE INTO `{PREFIX}site_content` VALUES ('1','document','text/html','Home','Welcome to MODX','Introduction to MODX','index','','1','0','0','0','0','Create and do amazing things with MODX','

    Install Successful!

    \n

    You have successfully installed and configured MODX. We hope you find this site an adequate starting configuration for many small business, organization or personal websites; just change the template and content, and you\'ll be good to go! This site is preconfigured with a variety of options we hope are helpful, relevant and just plain cool for many marketing or personal sites:

    \n
      \n
    • Simple Blog. When logged into your site, you\'ll be able to create new entries from the front end. This can also be turned into a News publishing or PR publishing system. View example blog
    • \n
    • Easy Comments. When logged into your site, your registered site users can comment on your posts. View example
    • \n
    • RSS Feeds. Your site visitors can stay up to date using your site feeds. View RSS feed
    • \n
    • Automatic User Registration. Those that wish to comment on blogs must first create an account. This comes pre-configured with a \"Captcha\" anti-robot registration feature. View registration form
    • \n
    • QuickEdit. When you\'re logged into the manager, you can edit a page directly from the front end! More about CMS features
    • \n
    • Integrated Site Search. Allows visitors to search only the pages you wish them to search. Uses Ajax to display results without loading a new page.
    • \n
    • Powerful Navigation Builder. Duplicate or build virtually any navigation system with our dynamic menu builder code. The menu above, for example. More about menu features
    • \n
    • Mootools enabled. You\'re on your way to Web 2.0 and AJAX goodness. More about Ajax features
    • \n
    • Custom \"page not found (404)\" page. Help visitors who go astray to find what they\'re looking for. View 404 page
    • \n
    • Contact Us form. A highly configurable contact form you should customize to point to the right email address. Comes pre-configured to prevent mail-form-injection so your site does not become a source for spam. View form
    • \n
    • Newest documents list. Shows your visitor the most recently added pages (configurable).
    • \n
    • Customizable Content Manager. Preview uploaded images, hide or rename fields and lots more. See ManagerManager\'s documentation for details and instructions. Quick start: ManagerManager by default will look for \"rules\" in a Chunk named \"mm_rules\". Simply copy or rename the Chunk named \"mm_demo_rules\" to \"mm_rules\" and try it out!
    • \n
    \n

    To log into the MODX Control Panel and start customizing this site, point your browser to [(site_manager_url)].

    ','1','4','0','1','1','1','1144904400','1','1378084284','0','0','0','0','0','Home','0','0','0','0','0','0','0'); +REPLACE INTO `{PREFIX}site_content` VALUES ('2','document','text/html','Blog','My Blog','','blog','','1','0','0','0','1','','[[Ditto? &parents=`2` &display=`2` &removeChunk=`Comments` &tpl=`ditto_blog` &paginate=`1` &extenders=`summary,dateFilter` &paginateAlwaysShowLinks=`1` &tagData=`documentTags`]]\n\n

    Showing [+start+] - [+stop+] of [+total+] Articles

    \n\n
    [+previous+] [+pages+] [+next+]
    \n\n
     
    \n\n[[Reflect? &config=`wordpress` &dittoSnippetParameters=`parents:2` &id=`wp` &getDocuments=`1`]]','1','4','1','0','0','1','1144904400','1','1159818696','0','0','0','0','0','Blog','0','0','0','0','0','0','0'); -REPLACE INTO `{PREFIX}site_content` VALUES (15, 'document', 'text/html', 'MODX Features', 'MODX Features', '', 'features', '', 1, 0, 0, 0, 1, '', '[[Wayfinder?startId=`[*id*]` &outerClass=`topnav`]]', 1, 4, 7, 1, 1, 1, 1144904400, 1, 1158452722, 0, 0, 0, 1144777367, 1, 'Features', 0, 0, 0, 0, 0, 0, 0); +REPLACE INTO `{PREFIX}site_content` VALUES ('4','document','text/html','[*loginName*]','Login to Enable to Comments','','login','','1','0','0','0','0','','

    In order to comment on blog entries, you must be a registered user of [(site_name)]. If you haven\'t already registered, you can request an account.

    \n
    [!WebLogin? &tpl=`WebLoginSideBar` &loginhomeid=`2`!]
    ','1','4','9','0','0','1','1144904400','1','1144904400','0','0','0','0','0','[*loginName*]','0','0','0','0','0','0','1'); +REPLACE INTO `{PREFIX}site_content` VALUES ('5','document','text/html','Request an Account','Sign Up for Full Site Privileges','','request-an-account','','1','0','0','0','0','','[[WebSignup? &tpl=`FormSignup` &groups=`Registered Users`]]','1','4','7','0','0','1','1144904400','1','1158320704','0','0','0','0','0','','0','0','0','0','0','0','1'); -REPLACE INTO `{PREFIX}site_content` VALUES (16, 'document', 'text/html', 'Ajax', 'Ajax and Web 2.0 ready', '', 'ajax', '', 1, 1159264800, 0, 15, 0, '', 'Ajax ready out-of-the-box\r\n

    MODX empowers users to build engaging sites today, with its pre-integrated Mootools javascript library.

    \r\n\r\n

    Check out the Ajax-powered search in this example site. The libraries are also used with QuickEdit, our front-end editing tool.

    \r\n\r\n

    Smart integration means the scripts are only included in the document head when needed - no unnecessary bloat on simple pages!

    \r\n\r\nWeb 2.0 today\r\n

    MODX makes child''s play of building content managed sites with validating, accessible CSS layouts - so web standards compliance is easy. (You can create a site with excessively nested tables too, if you really want to).

    \r\n', 1, 4, 1, 1, 1, 1, 1144904400, 1, 1159307504, 0, 0, 0, 0, 0, 'Ajax', 0, 0, 0, 0, 0, 0, 0); +REPLACE INTO `{PREFIX}site_content` VALUES ('6','document','text/html','Contact Us','Contact [(site_name)]','','contact-us','','1','0','0','0','0','','[!eForm? &formid=`ContactForm` &subject=`[+subject+]` &to=`[(emailsender)]` &ccsender=`1` &tpl=`ContactForm` &report=`ContactFormReport` &invalidClass=`invalidValue` &requiredClass=`requiredValue` &cssStyle=`ContactStyles` &gotoid=`46` !]\n','0','4','5','1','0','1','1144904400','1','1159303922','0','0','0','0','0','Contact us','0','0','0','0','0','0','0'); +REPLACE INTO `{PREFIX}site_content` VALUES ('7','document','text/html','404 - Document Not Found','Uh oh ... it\'s a 404! (Page Not Found)','','doc-not-found','','1','0','0','0','0','','

    Looks like you tried to go somewhere that does not exist... perhaps you need to login or you\'d like one of the following pages instead:

    \n\n[[Wayfinder? &startId=`0` &showDescription=`1`]]\n\n

    Want to find it the old fashioned way? Use the site search at the top of this site to find what you seek.

    \n\n','1','4','12','0','1','1','1144904400','1','1159301173','0','0','0','0','0','','0','0','0','0','0','0','1'); -REPLACE INTO `{PREFIX}site_content` VALUES (18, 'document', 'text/html', 'Just a pretend, older post', 'This post should in fact be archived', '', 'article-1128398162', '', 1, 0, 0, 2, 0, '', '

    Not so exciting, after all, eh?

    \r\n', 1, 4, 2, 1, 1, -1, 1144904400, 1, 1159306886, 0, 0, 0, 0, 0, '', 0, 0, 0, 0, 0, 0, 1); +REPLACE INTO `{PREFIX}site_content` VALUES ('8','document','text/html','Search Results','Your Search Results','','search-results','','1','0','0','0','0','','[!AjaxSearch? &showInputForm=`0` &ajaxSearch=`0`!]','0','4','10','0','0','1','1144904400','1','1158613055','0','0','0','0','0','','1','0','0','0','0','0','1'); +REPLACE INTO `{PREFIX}site_content` VALUES ('9','document','text/html','Mini-Blog HOWTO','How to Start Posting with MODX Mini-Blogs','','article-1126081344','','1','0','0','2','0','','

    Setting up a mini-blog is relatively simple. Here\'s what you need to do to get started with making new posts:

    \n
      \n
    1. Login to the MODX Control Panel.
    2. \n
    3. Press the plus-sign next to the Blog(2) container resource to see the blog entries posted there.
    4. \n
    5. To make a new Blog entry, simply right-click the Blog container document and choose the \"Create Resource here\" menu option. To edit an existing blog article, right click the entry and choose the \"Edit Resource\" menu option.
    6. \n\n
    7. Write or edit the content and press save, making sure the document is published.
    8. \n
    9. Everything else is automatic; you\'re done!
    10. \n
    \n{{Comments}}','1','4','0','1','1','-1','1144904400','1','1378084370','0','0','0','0','0','','0','0','0','0','0','0','1'); -REPLACE INTO `{PREFIX}site_content` VALUES (22, 'document', 'text/html', 'Menus and Lists', 'Flexible Menus and Lists', '', 'menus', '', 1, 1159178400, 0, 15, 0, '', '

    Your documents - listed how you want them

    \r\n

    MODX''s document data structure has been designed to allow many different routines to redisplay the information in ways that suit your needs, such as a dynamic menu in your template.

    \r\n

    Since the last release of MODX, the community has produced many great snippets - reusable functions that you can call in your content or template. Two of the most widely useful are Ditto and Wayfinder.

    \r\n

    Wayfinder - the menu builder

    \r\n

    Allows you to template every part of the menu. On this site, Wayfinder is being used to generate the drop-down menus, but many types of menus and sitemaps are possible.

    \r\n

    Ditto - the document lister

    \r\n

    Uses include listing the most recent blog posts, producing a site map, listing related documents (using a TV filter) and generating an RSS feed. You could even write a menu with it. On this site, Ditto is being used for the blog posts list on the Blog page, and the list on the right of some templates.

    \r\n

    Unlimited Customization

    \r\n

    If you can''t quite get your desired effect using templating and the many options of Ditto and Wayfinder, you can write your own routine, or look for other snippets in the MODX repository. MODX''s fields for Menu Title, summaries, menu position etc can be used via the API to produce anything you can imagine.

    ', 1, 4, 2, 1, 1, 1, 1144904400, 1, 1160148522, 0, 0, 0, 0, 0, 'Menus and Lists', 0, 0, 0, 0, 0, 0, 0); +REPLACE INTO `{PREFIX}site_content` VALUES ('11','document','text/xml','RSS Feed','[(site_name)] RSS Feed','','feed.rss','','1','0','0','0','0','','[[Ditto? &parents=`2` &format=`rss` &display=`20` &total=`20` &removeChunk=`Comments`]]','0','0','11','0','0','1','1144904400','1','1160062859','0','0','0','0','0','','0','0','0','0','0','0','1'); +REPLACE INTO `{PREFIX}site_content` VALUES ('14','document','text/html','Content Management','Ways to manage content','','cms','','1','0','0','15','0','','

    Manage your content in the backend

    \n

    The Manager is a skinnable feature-packed tool for admin users. You can add extra users and limit what functions they can access. MODX\'s Manager makes creating content and managing templates and reusable elements easy. Modules can be added to work with other datasets or make management tasks easier.

    \n

    Manage your content in the frontend

    \n

    The QuickEdit bar lets manager users edit content whilst browsing the site. Most content fields and template variables can be edited quickly and easily.

    \n

    Enable web users to add content

    \n

    Custom data entry is easy to code using the MODX API - so you can design forms and collect whatever information you need.

    ','0','4','3','1','1','1','1144904400','1','1378086298','0','0','0','1378086298','1','Manage Content','0','0','0','0','0','0','0'); -REPLACE INTO `{PREFIX}site_content` VALUES (24, 'document', 'text/html', 'Extendable by design', 'Extendable by design', '', 'extendable', '', 1, 1159092732, 0, 15, 0, '', '

    The MODX community has created many add-ons which can be found in the Repository, from image galleries and e-commerce to smaller utilities.

    \r\n\r\n

    Template Variables with Bindings

    \r\n

    TVs - Template Variables - are powerful extra fields that you can use with your documents. As an example of an advanced template element that returns a different thing dependent on code or data, we created an @BINDING for the name of the Login menu item. This changes the menu name from Login to Logout based on your logged in state. The @BINDING as follows was placed in the default value as:\r\n@EVAL if ($modx->getLoginUserID()) return ''Logout''; else return ''Login'';

    \r\n\r\n

    Using Scriptaculous

    \r\n

    We used some simple effects to highlight various things on the front/home page to demonstrate how easy it is to create a useful way to draw attention to things. To see them in action on the home page, click the Integrated Site Search, Related Links or Newest Documents headers.

    \r\n\r\n

    Custom Forms

    \r\n

    To demonstrate how to link to custom forms, we customized the calls to the Webuser Registration system and the Login system.

    \r\n\r\n

    And more

    \r\n

    Rich Text Editor for blog entries. To make it easier to format blog posts with simple text formatting, we modified the blog to use a custom RTE-enabled Template Variable (TV).

    \r\n\r\n

    Smart-Summary logic. When splitting the full blog/news posts you simply insert a "<!-- splitter -->" where you want the break to occur. In addition, if that leaves any important tags open, it will try to match them and close them so it doesn''t mess up your site layout with unclosed OL, UL or DIV tags.

    ', 1, 4, 4, 1, 1, 2, 1144904400, 1, 1159309971, 0, 0, 0, 0, 0, 'Extendability', 0, 0, 0, 0, 0, 0, 0); +REPLACE INTO `{PREFIX}site_content` VALUES ('15','document','text/html','MODX Features','MODX Features','','features','','1','0','0','0','1','','[[Wayfinder?startId=`[*id*]` &outerClass=`topnav`]]','1','4','2','1','1','1','1144904400','1','1158452722','0','0','0','1144777367','1','Features','0','0','0','0','0','0','0'); +REPLACE INTO `{PREFIX}site_content` VALUES ('16','document','text/html','Ajax','Ajax and Web 2.0 ready','','ajax','','1','1159264800','0','15','0','','Ajax ready out-of-the-box\n

    MODX empowers users to build engaging sites today, with its pre-integrated Mootools javascript library.

    \n\n

    Check out the Ajax-powered search in this example site. The libraries are also used with QuickEdit, our front-end editing tool.

    \n\n

    Smart integration means the scripts are only included in the document head when needed - no unnecessary bloat on simple pages!

    \n\nWeb 2.0 today\n

    MODX makes child\'s play of building content managed sites with validating, accessible CSS layouts - so web standards compliance is easy. (You can create a site with excessively nested tables too, if you really want to).

    \n','1','4','1','1','1','1','1144904400','1','1159307504','0','0','0','0','0','Ajax','0','0','0','0','0','0','0'); -REPLACE INTO `{PREFIX}site_content` VALUES (32, 'document', 'text/html', 'Design', 'Site Design', '', 'design', '', 1, 0, 0, 0, 0, '', '

    Credits

    \r\n

    The default site''s themes are based off of validating XHTML/CSS designs by Andreas Viklund, ziworks | Web Solutions and MODxHost.

    ', 1, 4, 10, 1, 1, 2, 1144904400, 1, 1160112322, 0, 0, 0, 1144912754, 1, 'Design', 0, 0, 0, 0, 0, 0, 0); +REPLACE INTO `{PREFIX}site_content` VALUES ('18','document','text/html','Just a pretend, older post','This post should in fact be archived','','article-1128398162','','1','0','0','2','0','','

    Not so exciting, after all, eh?

    \n','1','4','2','1','1','-1','1144904400','1','1159306886','0','0','0','0','0','','0','0','0','0','0','0','1'); +REPLACE INTO `{PREFIX}site_content` VALUES ('22','document','text/html','Menus and Lists','Flexible Menus and Lists','','menus','','1','1159178400','0','15','0','','

    Your documents - listed how you want them

    \n

    MODX\'s document data structure has been designed to allow many different routines to redisplay the information in ways that suit your needs, such as a dynamic menu in your template.

    \n

    Since the last release of MODX, the community has produced many great snippets - reusable functions that you can call in your content or template. Two of the most widely useful are Ditto and Wayfinder.

    \n

    Wayfinder - the menu builder

    \n

    Allows you to template every part of the menu. On this site, Wayfinder is being used to generate the drop-down menus, but many types of menus and sitemaps are possible.

    \n

    Ditto - the document lister

    \n

    Uses include listing the most recent blog posts, producing a site map, listing related documents (using a TV filter) and generating an RSS feed. You could even write a menu with it. On this site, Ditto is being used for the blog posts list on the Blog page, and the list on the right of some templates.

    \n

    Unlimited Customization

    \n

    If you can\'t quite get your desired effect using templating and the many options of Ditto and Wayfinder, you can write your own routine, or look for other snippets in the MODX repository. MODX\'s fields for Menu Title, summaries, menu position etc can be used via the API to produce anything you can imagine.

    ','1','4','2','1','1','1','1144904400','1','1160148522','0','0','0','0','0','Menus and Lists','0','0','0','0','0','0','0'); -REPLACE INTO `{PREFIX}site_content` VALUES (33, 'document', 'text/html', 'Getting Help', 'Getting Help with MODX', '', 'geting-help', '', 1, 0, 0, 0, 0, '', '

    The team behind MODX strives to constantly add to and refine the documentation to help you get up to speed with MODX:

    \r\n
      \r\n
    • For basic instructions on integrating custom templates into MODX, please see the Designer''s Guide.
    • \r\n
    • For an introduction to working in MODX from the content editors perspectve, see the Content Editor''s Guide.
    • \r\n
    • For a detailed overview of the backend "manager" and setting up Users and Groups, please peruse the Administration Guide.
    • \r\n
    • For developers, architecture and API documentation can be found in the Developer''s Guide.
    • \r\n
    • And if someone has installed this site for you, but you''re curious as to the steps they went through, please see the Getting Started Guide.
    • \r\n
    \r\n\r\n

    And don''t forget, you can always learn and ask questions at the MODX forums. \r\n', 1, 4, 8, 1, 1, 2, 1144904400, 2, 1144904400, 0, 0, 0, 0, 0, 'Getting Help', 0, 0, 0, 0, 0, 0, 0); +REPLACE INTO `{PREFIX}site_content` VALUES ('24','document','text/html','Extendable by design','Extendable by design','','extendable','','1','1159092732','0','15','0','','

    The MODX community has created many add-ons which can be found in the Repository, from image galleries and e-commerce to smaller utilities.

    \n\n

    Template Variables with Bindings

    \n

    TVs - Template Variables - are powerful extra fields that you can use with your documents. As an example of an advanced template element that returns a different thing dependent on code or data, we created an @BINDING for the name of the Login menu item. This changes the menu name from Login to Logout based on your logged in state. The @BINDING as follows was placed in the default value as:\n@EVAL if ($modx->getLoginUserID()) return \'Logout\'; else return \'Login\';

    \n\n

    Using Scriptaculous

    \n

    We used some simple effects to highlight various things on the front/home page to demonstrate how easy it is to create a useful way to draw attention to things. To see them in action on the home page, click the Integrated Site Search, Related Links or Newest Documents headers.

    \n\n

    Custom Forms

    \n

    To demonstrate how to link to custom forms, we customized the calls to the Webuser Registration system and the Login system.

    \n\n

    And more

    \n

    Rich Text Editor for blog entries. To make it easier to format blog posts with simple text formatting, we modified the blog to use a custom RTE-enabled Template Variable (TV).

    \n\n

    Smart-Summary logic. When splitting the full blog/news posts you simply insert a \"<!-- splitter -->\" where you want the break to occur. In addition, if that leaves any important tags open, it will try to match them and close them so it doesn\'t mess up your site layout with unclosed OL, UL or DIV tags.

    ','1','4','4','1','1','2','1144904400','1','1159309971','0','0','0','0','0','Extendability','0','0','0','0','0','0','0'); +REPLACE INTO `{PREFIX}site_content` VALUES ('32','document','text/html','Design','Site Design','','design','','1','0','0','0','0','','

    Credits

    \n

    The default site\'s themes are based off of validating XHTML/CSS designs by Andreas Viklund, ziworks | Web Solutions and MODxHost.

    ','1','4','4','1','1','2','1144904400','1','1160112322','0','0','0','1144912754','1','Design','0','0','0','0','0','0','0'); -REPLACE INTO `{PREFIX}site_content` VALUES (37, 'document', 'text/html', '[*loginName*]', 'The page you''re trying to reach requires a login', '', 'blog-login', '', 1, 0, 0, 0, 0, '', '

    In order to add a blog entry, you must be logged in as a Site Admin webuser. Also, commenting on posts requires a login. Contact the site owner for permissions to create new post, or create a web user account to automatically receive commenting privileges. If you already have an account, please login below.

    \r\n\r\n[!WebLogin? &tpl=`WebLoginSideBar` &loginhomeid=`3`!]', 1, 4, 12, 0, 0, 1, 1144904400, 1, 1158599931, 0, 0, 0, 0, 0, '', 0, 0, 0, 0, 0, 0, 1); +REPLACE INTO `{PREFIX}site_content` VALUES ('33','document','text/html','Getting Help','Getting Help with MODX','','geting-help','','1','0','0','0','0','','

    The team behind MODX strives to constantly add to and refine the documentation to help you get up to speed with MODX:

    \n
      \n
    • For basic instructions on integrating custom templates into MODX, please see the Designer\'s Guide.
    • \n
    • For an introduction to working in MODX from the content editors perspectve, see the Content Editor\'s Guide.
    • \n
    • For a detailed overview of the backend "manager" and setting up Users and Groups, please peruse the Administration Guide.
    • \n
    • For developers, architecture and API documentation can be found in the Developer\'s Guide.
    • \n
    • And if someone has installed this site for you, but you\'re curious as to the steps they went through, please see the Getting Started Guide.
    • \n
    \n\n

    And don\'t forget, you can always learn and ask questions at the MODX forums. \n','1','4','3','1','1','2','1144904400','2','1144904400','0','0','0','0','0','Getting Help','0','0','0','0','0','0','0'); +REPLACE INTO `{PREFIX}site_content` VALUES ('37','document','text/html','[*loginName*]','The page you\'re trying to reach requires a login','','blog-login','','1','0','0','0','0','','

    In order to add a blog entry, you must be logged in as a Site Admin webuser. Also, commenting on posts requires a login. Contact the site owner for permissions to create new post, or create a web user account to automatically receive commenting privileges. If you already have an account, please login below.

    \n\n[!WebLogin? &tpl=`WebLoginSideBar` &loginhomeid=`3`!]','1','4','8','0','0','1','1144904400','1','1158599931','0','0','0','0','0','','0','0','0','0','0','0','1'); -REPLACE INTO `{PREFIX}site_content` VALUES (46, 'document', 'text/html', 'Thank You', '', '', 'thank-you', '', 1, 0, 0, 0, 0, '', '

    Thank You!

    \r\n

    We do appreciate your feedback. Your comments have been submitted to our office and hopefully someone will bother to actually read it. You should also receive a copy of the message in your inbox.

    \r\n

    Please be assured that we will do our best not to ignore you, but if today is a Monday please try again in a few days.

    \r\n', 1, 4, 13, 1, 1, 1, 1159302141, 1, 1159302892, 0, 0, 0, 1159302182, 1, '', 0, 0, 0, 0, 0, 0, 1); +REPLACE INTO `{PREFIX}site_content` VALUES ('46','document','text/html','Thank You','','','thank-you','','1','0','0','0','0','','

    Thank You!

    \n

    We do appreciate your feedback. Your comments have been submitted to our office and hopefully someone will bother to actually read it. You should also receive a copy of the message in your inbox.

    \n

    Please be assured that we will do our best not to ignore you, but if today is a Monday please try again in a few days.

    \n','1','4','6','1','1','1','1159302141','1','1159302892','0','0','0','1159302182','1','','0','0','0','0','0','0','1'); # From d92512469ae8000d45618ac16439b67a808dcaba Mon Sep 17 00:00:00 2001 From: yama Date: Mon, 2 Sep 2013 13:31:11 +0900 Subject: [PATCH 426/530] Bug #10153 Can not update block user status when login http://tracker.modx.com/issues/10153 --- manager/processors/login.processor.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/manager/processors/login.processor.php b/manager/processors/login.processor.php index 7d05f4be71..3dbf0aa471 100755 --- a/manager/processors/login.processor.php +++ b/manager/processors/login.processor.php @@ -93,10 +93,11 @@ } // blocked due to number of login errors. if($failedlogins>=$failed_allowed && $blockeduntildate>time()) { - @session_destroy(); - session_unset(); - jsAlert($e->errors[902]); - return; + $modx->db->update('blocked=1','[+prefix+]user_attributes',"internalKey='{$internalKey}'"); + @session_destroy(); + session_unset(); + jsAlert($e->errors[902]); + return; } // blocked due to number of login errors, but get to try again From 97b592665c70ee0fa74ffa631abf3134ad8da59e Mon Sep 17 00:00:00 2001 From: yama Date: Mon, 2 Sep 2013 14:44:11 +0900 Subject: [PATCH 427/530] Fix - Generate base_url in config.inc.php --- install/instprocessor.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/install/instprocessor.php b/install/instprocessor.php index e212c1ab14..0bd8afc33b 100755 --- a/install/instprocessor.php +++ b/install/instprocessor.php @@ -242,10 +242,19 @@ function parseProperties($propertyString) { } else { $script_name= $_SERVER[\'SCRIPT_NAME\']; } - $a= explode("/".MGR_DIR, str_replace("\\\\", "/", dirname($script_name))); + $script_name = str_replace("\\\\", "/", dirname($script_name)); + if(strpos($script_name,MGR_DIR)!==false) + $separator = MGR_DIR; + elseif(strpos($script_name,\'/assets/\')!==false) + $separator = \'assets\'; + else $separator = \'\'; + + if($separator!==\'\') $a= explode(\'/\'.$separator, $script_name); + else $a = array($script_name); + if (count($a) > 1) array_pop($a); - $url= implode(MGR_DIR, $a); + $url= implode($separator, $a); reset($a); $a= explode(MGR_DIR, str_replace("\\\\", "/", dirname(__FILE__))); if (count($a) > 1) From 26b991620e42f0d6bc65df0b16b8a78e7df8f485 Mon Sep 17 00:00:00 2001 From: yama Date: Mon, 2 Sep 2013 14:44:52 +0900 Subject: [PATCH 428/530] Refactor #10156 Improvement $modx->getDocuments() parameter value http://tracker.modx.com/issues/10156 --- manager/includes/document.parser.class.inc.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/manager/includes/document.parser.class.inc.php b/manager/includes/document.parser.class.inc.php index 7d2c333b14..f0930709f2 100755 --- a/manager/includes/document.parser.class.inc.php +++ b/manager/includes/document.parser.class.inc.php @@ -2050,6 +2050,13 @@ function getDocumentChildren($parentid= 0, $published= 1, $deleted= 0, $fields= * @return array|boolean Result array with documents, or false */ function getDocuments($ids= array (), $published= 1, $deleted= 0, $fields= "*", $where= '', $sort= "menuindex", $dir= "ASC", $limit= "") { + if(is_string($ids)) + { + if(strpos($ids,',')!==false) + $ids = explode(',', $ids); + else + $ids = array($ids); + } if (count($ids) == 0) { return false; } else { From 61cae46bcc319c850868262442f46bd46cd77f7b Mon Sep 17 00:00:00 2001 From: yama Date: Mon, 2 Sep 2013 14:45:53 +0900 Subject: [PATCH 429/530] Fix - TinyMCE template button in toolbar --- assets/plugins/tinymce/functions.php | 2 +- assets/plugins/tinymce/js/get_template.php | 18 +++++++++++++----- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/assets/plugins/tinymce/functions.php b/assets/plugins/tinymce/functions.php index ea347e1184..d6f00c2da7 100644 --- a/assets/plugins/tinymce/functions.php +++ b/assets/plugins/tinymce/functions.php @@ -108,7 +108,7 @@ function checked($cond = false) function get_mce_settings() { - global $modx, $_lang; + global $modx, $_lang, $settings, $usersettings; $params = $this->params; $mce_path = $params['mce_path']; diff --git a/assets/plugins/tinymce/js/get_template.php b/assets/plugins/tinymce/js/get_template.php index dc2baa4d4e..9cedf7e898 100644 --- a/assets/plugins/tinymce/js/get_template.php +++ b/assets/plugins/tinymce/js/get_template.php @@ -52,7 +52,7 @@ { $tbl_site_htmlsnippets = $modx->getFullTableName('site_htmlsnippets'); $cid = $_GET['chunk']; - $rs = $modx->db->select('snippet', $tbl_site_htmlsnippets, "`id`='{$cid}' AND published=1"); + $rs = $modx->db->select('snippet', $tbl_site_htmlsnippets, "`id`='{$cid}'"); $content = $modx->db->getValue($rs); if($content) $output = $content; } @@ -60,18 +60,17 @@ { $list = array(); $tpl = "['[+title+]', '[+site_url+]assets/plugins/tinymce/js/get_template.php?[+target+]', '[+description+]']"; - $ph['site_url'] = $modx->config['site_url']; + $ph['site_url'] = MODX_SITE_URL; if(isset($ids) && !empty($ids)) { $docs = $modx->getDocuments($ids, 1, 0, $fields= 'id,pagetitle,menutitle,description,content'); - foreach($docs as $i=>$a) { $ph['title'] = ($docs[$i]['menutitle']!=='') ? $docs[$i]['menutitle'] : $docs[$i]['pagetitle']; $ph['target'] = 'docid=' . $docs[$i]['id']; $ph['description'] = $docs[$i]['description']; - $list[] = $modx->parsePlaceholder($tpl,$ph); + $list[] = parsePlaceholder($tpl,$ph); } } @@ -102,7 +101,7 @@ $ph['title'] = $row['name']; $ph['target'] = 'chunk=' . $row['id']; $ph['description'] = $row['description']; - $list[] = $modx->parsePlaceholder($tpl,$ph); + $list[] = parsePlaceholder($tpl,$ph); } } @@ -116,3 +115,12 @@ header('expires: 0'); echo $output; } + +function parsePlaceholder($tpl,$ph) { + foreach($ph as $k=>$v) { + $k = "[+{$k}+]"; + if(strpos($tpl,$k)!==false) + $tpl = str_replace($k,$v,$tpl); + } + return $tpl; +} \ No newline at end of file From 727186bcfccaa79ac445ec3a91ce29ee702886c8 Mon Sep 17 00:00:00 2001 From: Dmi3yy Date: Mon, 2 Sep 2013 09:07:29 +0300 Subject: [PATCH 430/530] fix css warning --- manager/media/style/MODxRE/login.tpl | 30 ++++++++++++++-------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/manager/media/style/MODxRE/login.tpl b/manager/media/style/MODxRE/login.tpl index 31f705864f..236ec0ca6f 100644 --- a/manager/media/style/MODxRE/login.tpl +++ b/manager/media/style/MODxRE/login.tpl @@ -19,9 +19,9 @@ background: #FEFEFE; padding: 25px 0 0 20px; overflow: hidden; - -webkit-box-shadow: 0px 0px 5px rgba(50, 50, 50, 0.2); - -moz-box-shadow: 0px 0px 5px rgba(50, 50, 50, 0.2); - box-shadow: 0px 0px 5px rgba(50, 50, 50, 0.2); + -webkit-box-shadow: 0 0 5px rgba(50, 50, 50, 0.2); + -moz-box-shadow: 0 0 5px rgba(50, 50, 50, 0.2); + box-shadow: 0 0 5px rgba(50, 50, 50, 0.2); -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; @@ -49,15 +49,15 @@ -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; - -webkit-box-shadow: 0px 0px 5px rgba(188, 188, 188, 0.2); - -moz-box-shadow: 0px 0px 5px rgba(188, 188, 188, 0.2); - box-shadow: 0px 0px 5px rgba(188, 188, 188, 0.2); + -webkit-box-shadow: 0 0 5px rgba(188, 188, 188, 0.2); + -moz-box-shadow: 0 0 5px rgba(188, 188, 188, 0.2); + box-shadow: 0 0 5px rgba(188, 188, 188, 0.2); } .sectionBody .text:focus { border: 1px solid #DECBA5; - -webkit-box-shadow: 0px 0px 5px rgba(222, 203, 165, 0.5); - -moz-box-shadow: 0px 0px 5px rgba(222, 203, 165, 0.5); - box-shadow: 0px 0px 5px rgba(222, 203, 165, 0.5); + -webkit-box-shadow: 0 0 5px rgba(222, 203, 165, 0.5); + -moz-box-shadow: 0 0 5px rgba(222, 203, 165, 0.5); + box-shadow: 0 0 5px rgba(222, 203, 165, 0.5); } #rememberme { float: left; @@ -102,15 +102,15 @@ -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; - -webkit-box-shadow: 0px 0px 5px rgba(188, 188, 188, 0.2); - -moz-box-shadow: 0px 0px 5px rgba(188, 188, 188, 0.2); - box-shadow: 0px 0px 5px rgba(188, 188, 188, 0.2); + -webkit-box-shadow: 0 0 5px rgba(188, 188, 188, 0.2); + -moz-box-shadow: 0 0 5px rgba(188, 188, 188, 0.2); + box-shadow: 0 0 5px rgba(188, 188, 188, 0.2); } #FMP-email:focus { border: 1px solid #DECBA5; - -webkit-box-shadow: 0px 0px 5px rgba(222, 203, 165, 0.5); - -moz-box-shadow: 0px 0px 5px rgba(222, 203, 165, 0.5); - box-shadow: 0px 0px 5px rgba(222, 203, 165, 0.5); + -webkit-box-shadow: 0 0 5px rgba(222, 203, 165, 0.5); + -moz-box-shadow: 0 0 5px rgba(222, 203, 165, 0.5); + box-shadow: 0 0 5px rgba(222, 203, 165, 0.5); } #FMP-email_button { border: 0 none; From be123c71a87684c8debd5dcc7e8039ed586d7ab7 Mon Sep 17 00:00:00 2001 From: Dmi3yy Date: Mon, 2 Sep 2013 10:42:31 +0300 Subject: [PATCH 431/530] fix category for phpthumb --- install/assets/snippets/phpthumb.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/assets/snippets/phpthumb.tpl b/install/assets/snippets/phpthumb.tpl index e4bade1492..8a235c0410 100644 --- a/install/assets/snippets/phpthumb.tpl +++ b/install/assets/snippets/phpthumb.tpl @@ -8,7 +8,7 @@ * @version 1.1 * @license http://www.gnu.org/copyleft/gpl.html GNU Public License (GPL) * @internal @properties - * @internal @modx_category add + * @internal @modx_category Content * @internal @installset base, sample * @author Bumkaka */ From 20b6cc110a99a8492c7f57a05e388cb0b97dac09 Mon Sep 17 00:00:00 2001 From: Dmi3yy Date: Mon, 2 Sep 2013 12:04:47 +0300 Subject: [PATCH 432/530] fix % in KCFinder translate --- manager/media/browser/mcpuk/config.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manager/media/browser/mcpuk/config.php b/manager/media/browser/mcpuk/config.php index 4d2a924cbf..ecb6169c04 100644 --- a/manager/media/browser/mcpuk/config.php +++ b/manager/media/browser/mcpuk/config.php @@ -68,11 +68,11 @@ 'filenameChangeChars' => array("а"=>"a","б"=>"b","в"=>"v","г"=>"g","д"=>"d","е"=>"e","ё"=>"yo","ж"=>"zh","з"=>"z","и"=>"i","й"=>"j","к"=>"k","л"=>"l","м"=>"m","н"=>"n","о"=>"o","п"=>"p","р"=>"r","с"=>"s","т"=>"t","у"=>"u","ф"=>"f","х"=>"h","ц"=>"c","ч"=>"ch","ш"=>"sh","щ"=>"shh","ы"=>"i","э"=>"e","ю"=>"yu","я"=>"ya", "А"=>"A","Б"=>"B","В"=>"V","Г"=>"G","Д"=>"D","Е"=>"E","Ё"=>"Yo","Ж"=>"Zh", "З"=>"Z","И"=>"I","Й"=>"J","К"=>"K","Л"=>"L","М"=>"M","Н"=>"N","О"=>"O","П"=>"P","Р"=>"R","С"=>"S","Т"=>"T","У"=>"U","Ф"=>"F","Х"=>"H","Ц"=>"C","Ч"=>"Ch","Ш"=>"Sh","Щ"=>"Shh","Ы"=>"I","Э"=>"E","Ю"=>"Yu","Я"=>"Ya", - "ь"=>"","Ь"=>"","ъ"=>"","Ъ"=>""," "=>"-","№"=>"N","+"=>"-",":"=>"-",";"=>"-","!"=>"-","?"=>"-","&"=>"and","\'" =>"", "=" =>"-", "[" =>"(", "]" =>")"), + "ь"=>"","Ь"=>"","ъ"=>"","Ъ"=>""," "=>"-","№"=>"N","+"=>"-",":"=>"-",";"=>"-","!"=>"-","?"=>"-","&"=>"and","\'" =>"", "=" =>"-", "[" =>"(", "]" =>")", "%" => ""), 'dirnameChangeChars' => array("а"=>"a","б"=>"b","в"=>"v","г"=>"g","д"=>"d","е"=>"e","ё"=>"yo","ж"=>"zh","з"=>"z","и"=>"i","й"=>"j","к"=>"k","л"=>"l","м"=>"m","н"=>"n","о"=>"o","п"=>"p","р"=>"r","с"=>"s","т"=>"t","у"=>"u","ф"=>"f","х"=>"h","ц"=>"c","ч"=>"ch","ш"=>"sh","щ"=>"shh","ы"=>"i","э"=>"e","ю"=>"yu","я"=>"ya", "А"=>"A","Б"=>"B","В"=>"V","Г"=>"G","Д"=>"D","Е"=>"E","Ё"=>"Yo","Ж"=>"Zh", "З"=>"Z","И"=>"I","Й"=>"J","К"=>"K","Л"=>"L","М"=>"M","Н"=>"N","О"=>"O","П"=>"P","Р"=>"R","С"=>"S","Т"=>"T","У"=>"U","Ф"=>"F","Х"=>"H","Ц"=>"C","Ч"=>"Ch","Ш"=>"Sh","Щ"=>"Shh","Ы"=>"I","Э"=>"E","Ю"=>"Yu","Я"=>"Ya", - "ь"=>"","Ь"=>"","ъ"=>"","Ъ"=>""," "=>"-","№"=>"N","+"=>"-",":"=>"-",";"=>"-","!"=>"-","?"=>"-","&"=>"and","\'" =>"", "=" =>"-", "[" =>"(", "]" =>")"), + "ь"=>"","Ь"=>"","ъ"=>"","Ъ"=>""," "=>"-","№"=>"N","+"=>"-",":"=>"-",";"=>"-","!"=>"-","?"=>"-","&"=>"and","\'" =>"", "=" =>"-", "[" =>"(", "]" =>")", "%" => ""), 'mime_magic' => "", From 65373d6eb13d883ea5168828ff8755bd0b58ee3f Mon Sep 17 00:00:00 2001 From: yama Date: Mon, 2 Sep 2013 19:52:42 +0900 Subject: [PATCH 433/530] Small fix - MODxRE/style.css --- manager/media/style/MODxRE/style.css | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/manager/media/style/MODxRE/style.css b/manager/media/style/MODxRE/style.css index bc7a99d5a4..c2299a74ad 100644 --- a/manager/media/style/MODxRE/style.css +++ b/manager/media/style/MODxRE/style.css @@ -274,7 +274,7 @@ optgroup option { } form select { - background: #FFF; + background: #F9F9F9; border-color: #AAAAAA #DEDEDE #DEDEDE #AAAAAA; border-style: solid; border-width: 1px; @@ -1780,8 +1780,10 @@ input:focus.DatePicker, #mutate input:focus.DatePicker, #userPane input:focus.Da /* Custom */ /* normalize some td paddings */ #tabTemplate tbody td, -.sectionBody td { +.sectionBody td, +.sectionBody th { padding: 1px 5px; + text-align:left; } /* replace warning red color in tabs */ strong[style*='color:#EF1D1D'] { @@ -1792,3 +1794,5 @@ strong[style*='color:#EF1D1D'] { } #tabEvents table, #tabEvents td {padding:2px;} + +code {font-size:inherit;font-family: 'Courier New','Courier', monospace;background-color:#eee;border:1px solid #ccc;padding:1px 2px;} From 9ad3afeb2aea15e693d82b6cdeec8e77450f6acf Mon Sep 17 00:00:00 2001 From: yama Date: Mon, 2 Sep 2013 19:54:44 +0900 Subject: [PATCH 434/530] Fix - Elements edit screen tab fields (Templates and TVs) --- manager/actions/mutate_templates.dynamic.php | 64 +++++++------- manager/actions/mutate_tmplvars.dynamic.php | 91 ++++++++++---------- 2 files changed, 75 insertions(+), 80 deletions(-) diff --git a/manager/actions/mutate_templates.dynamic.php b/manager/actions/mutate_templates.dynamic.php index 71ecdc917f..ed28c7e350 100644 --- a/manager/actions/mutate_templates.dynamic.php +++ b/manager/actions/mutate_templates.dynamic.php @@ -132,9 +132,36 @@ function deletedocument() { ' . $_lang['template_msg'] . '
    '; ?> - - + + + + + + + + + + + + + + +hasPermission('save_role')):?> + + + +
    ::
    :
    : +
    :
    @@ -181,40 +208,11 @@ function deletedocument() { } echo $tvList; ?>
    -
    -

    - - - - - - - - - - - - - - - - - -
    :
    : -
    :
    class="inputBox">
    invokeEvent("OnTempFormRender",array("id" => $id)); if(is_array($evtOut)) echo implode("",$evtOut); ?> -
    +
    + diff --git a/manager/actions/mutate_tmplvars.dynamic.php b/manager/actions/mutate_tmplvars.dynamic.php index b202d60a7d..219531f821 100644 --- a/manager/actions/mutate_tmplvars.dynamic.php +++ b/manager/actions/mutate_tmplvars.dynamic.php @@ -294,17 +294,44 @@ function decode(s){

    - - + + - - + + + + + + + + + + + +hasPermission('save_role')):?> + + + + + + + - - + - - + + - - + + - - + - - + + - - + +
    :[* *]   :[* *]   
    ::
    : +
    :
    :
    :  :  
    : " onmouseover="this.src='';" onmouseout="this.src='';" alt="" onclick="alert(this.alt);" style="cursor:help" />: " onmouseover="this.src='';" onmouseout="this.src='';" alt="" onclick="alert(this.alt);" style="cursor:help" />
    :  " onmouseover="this.src='';" onmouseout="this.src='';" alt="" onclick="alert(this.alt);" style="cursor:help" />:  " onmouseover="this.src='';" onmouseout="this.src='';" alt="" onclick="alert(this.alt);" style="cursor:help" />
    :   + :  
    <?php echo $_lang['tmplvars_reset_params']; ?>
     
    <?php echo $_lang['tmplvars_reset_params']; ?>
     
    :  :  
    @@ -376,43 +403,13 @@ function decode(s){

    -
    - - - - - - - - - - - - - - - - -
    :
    : -
    :
    -
    -

    - +
    db->select('id,templatename,tmplvarid',$from); From b04cdc0066a340abd420d3e3036b96d1fa325c36 Mon Sep 17 00:00:00 2001 From: yama Date: Mon, 2 Sep 2013 21:30:52 +0900 Subject: [PATCH 435/530] Fix - Elements edit screen tab fields (remain) --- .../actions/mutate_htmlsnippet.dynamic.php | 68 +++++++-------- manager/actions/mutate_plugin.dynamic.php | 86 +++++++++---------- manager/actions/mutate_snippet.dynamic.php | 72 ++++++++-------- 3 files changed, 107 insertions(+), 119 deletions(-) diff --git a/manager/actions/mutate_htmlsnippet.dynamic.php b/manager/actions/mutate_htmlsnippet.dynamic.php index 23dc1f1388..045c497659 100644 --- a/manager/actions/mutate_htmlsnippet.dynamic.php +++ b/manager/actions/mutate_htmlsnippet.dynamic.php @@ -163,8 +163,36 @@ function deletedocument() {

    - - + + + + + + + + + + + + + +hasPermission('save_role')):?> + + +
    {{ }} 
    {{ }} 
    +
    +
    @@ -191,42 +219,6 @@ function deletedocument() {
    - -
    -

    - -
    - - - - - - - - - - - - - - -
    -
    class="inputBox" value="on" /> -
    -
    -
    -

    - +
    + + + + + + + + + + + + + + + + +hasPermission('save_role')):?> - - + +
    : 
    :  
    :   +
    :
    : 
    @@ -331,9 +358,12 @@ function decode(s){

    + + + - - + - + - - + + - - + +
    ":$_lang['plugin_disabled']; ?>
    :  :  
     



    :
    :
        
    @@ -435,42 +465,6 @@ function echoEventRows(&$evtnames) {
    - -
    -

    - - - - - - - - - - - - - - - - - - - - -
    ":$_lang['plugin_disabled']; ?>
    :  
    :   -
    :
    value="on" class="inputBox">
    -
    -
    diff --git a/manager/actions/mutate_snippet.dynamic.php b/manager/actions/mutate_snippet.dynamic.php index 0ae491a2c2..5ce2d6a75e 100644 --- a/manager/actions/mutate_snippet.dynamic.php +++ b/manager/actions/mutate_snippet.dynamic.php @@ -307,11 +307,38 @@ function decode(s){

    - +
    + + + + + + + + + + + + + + + + +hasPermission('save_role')):?> - - + +
    :[[  ]] 
    +
    :
    :[[  ]] 
    @@ -332,33 +359,8 @@ function decode(s){ - - - - - - - - - - - - - - - - - + - + - - + + - - + +
    class="inputBox">
    -
    :
     



    ::
        
    From b07f40cbd8362fe94cb14001236a1fab2285db12 Mon Sep 17 00:00:00 2001 From: yama Date: Mon, 2 Sep 2013 21:31:12 +0900 Subject: [PATCH 436/530] Fix - tinymce/functions.php --- assets/plugins/tinymce/functions.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/assets/plugins/tinymce/functions.php b/assets/plugins/tinymce/functions.php index d6f00c2da7..b0a4b5b3b6 100644 --- a/assets/plugins/tinymce/functions.php +++ b/assets/plugins/tinymce/functions.php @@ -50,7 +50,7 @@ function get_lang($lang) function get_skin_names() { - global $modx,$_lang; + global $modx, $_lang, $usersettings, $settings; $params = $this->params; $mce_path = $params['mce_path']; @@ -108,8 +108,8 @@ function checked($cond = false) function get_mce_settings() { - global $modx, $_lang, $settings, $usersettings; - $params = $this->params; + global $modx, $_lang, $usersettings, $settings; + $params = & $this->params; $mce_path = $params['mce_path']; switch ($modx->manager->action) @@ -132,7 +132,6 @@ function get_mce_settings() $mce_settings = $settings; break; } - $params['theme'] = $mce_settings['tinymce_editor_theme']; $params['mce_editor_skin'] = $mce_settings['mce_editor_skin']; $params['mce_entermode'] = $mce_settings['mce_entermode']; @@ -232,7 +231,7 @@ function get_mce_settings() function get_mce_script() { global $modx, $_lang; - $params = $this->params; + $params = & $this->params; $mce_path = $params['mce_path']; $mce_url = $params['mce_url']; From 57da0cfe8d27890c28664bffe529542ceff01544 Mon Sep 17 00:00:00 2001 From: Dmi3yy Date: Mon, 2 Sep 2013 16:22:15 +0300 Subject: [PATCH 437/530] fix translit in kcfinder --- manager/media/browser/mcpuk/config.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/manager/media/browser/mcpuk/config.php b/manager/media/browser/mcpuk/config.php index ecb6169c04..e41817674a 100644 --- a/manager/media/browser/mcpuk/config.php +++ b/manager/media/browser/mcpuk/config.php @@ -67,12 +67,12 @@ ), 'filenameChangeChars' => array("а"=>"a","б"=>"b","в"=>"v","г"=>"g","д"=>"d","е"=>"e","ё"=>"yo","ж"=>"zh","з"=>"z","и"=>"i","й"=>"j","к"=>"k","л"=>"l","м"=>"m","н"=>"n","о"=>"o","п"=>"p","р"=>"r","с"=>"s","т"=>"t","у"=>"u","ф"=>"f","х"=>"h","ц"=>"c","ч"=>"ch","ш"=>"sh","щ"=>"shh","ы"=>"i","э"=>"e","ю"=>"yu","я"=>"ya", - "А"=>"A","Б"=>"B","В"=>"V","Г"=>"G","Д"=>"D","Е"=>"E","Ё"=>"Yo","Ж"=>"Zh", "З"=>"Z","И"=>"I","Й"=>"J","К"=>"K","Л"=>"L","М"=>"M","Н"=>"N","О"=>"O","П"=>"P","Р"=>"R","С"=>"S","Т"=>"T","У"=>"U","Ф"=>"F","Х"=>"H","Ц"=>"C","Ч"=>"Ch","Ш"=>"Sh","Щ"=>"Shh","Ы"=>"I","Э"=>"E","Ю"=>"Yu","Я"=>"Ya", - "ь"=>"","Ь"=>"","ъ"=>"","Ъ"=>""," "=>"-","№"=>"N","+"=>"-",":"=>"-",";"=>"-","!"=>"-","?"=>"-","&"=>"and","\'" =>"", "=" =>"-", "[" =>"(", "]" =>")", "%" => ""), + "А"=>"A","Б"=>"B","В"=>"V","Г"=>"G","Д"=>"D","Е"=>"E","Ё"=>"Yo","Ж"=>"Zh", "З"=>"Z","И"=>"I","Й"=>"J","К"=>"K","Л"=>"L","М"=>"M","Н"=>"N","О"=>"O","П"=>"P","Р"=>"R","С"=>"S","Т"=>"T","У"=>"U","Ф"=>"F","Х"=>"H","Ц"=>"C","Ч"=>"Ch","Ш"=>"Sh","Щ"=>"Shh","Ы"=>"I","Э"=>"E","Ю"=>"Yu","Я"=>"Ya", + "ь"=>"","Ь"=>"","ъ"=>"","Ъ"=>""," "=>"-","№"=>"N","+"=>"-",":"=>"-",";"=>"-","!"=>"-","?"=>"-","&"=>"and","\'" =>"", "=" =>"-","%"=>'-',"ї"=>"yi","Ї"=>"yi","є"=>"ye","Є"=>"ye","і"=>"i","І"=>"i","ґ"=>"g","Ґ"=>"g"), 'dirnameChangeChars' => array("а"=>"a","б"=>"b","в"=>"v","г"=>"g","д"=>"d","е"=>"e","ё"=>"yo","ж"=>"zh","з"=>"z","и"=>"i","й"=>"j","к"=>"k","л"=>"l","м"=>"m","н"=>"n","о"=>"o","п"=>"p","р"=>"r","с"=>"s","т"=>"t","у"=>"u","ф"=>"f","х"=>"h","ц"=>"c","ч"=>"ch","ш"=>"sh","щ"=>"shh","ы"=>"i","э"=>"e","ю"=>"yu","я"=>"ya", - "А"=>"A","Б"=>"B","В"=>"V","Г"=>"G","Д"=>"D","Е"=>"E","Ё"=>"Yo","Ж"=>"Zh", "З"=>"Z","И"=>"I","Й"=>"J","К"=>"K","Л"=>"L","М"=>"M","Н"=>"N","О"=>"O","П"=>"P","Р"=>"R","С"=>"S","Т"=>"T","У"=>"U","Ф"=>"F","Х"=>"H","Ц"=>"C","Ч"=>"Ch","Ш"=>"Sh","Щ"=>"Shh","Ы"=>"I","Э"=>"E","Ю"=>"Yu","Я"=>"Ya", - "ь"=>"","Ь"=>"","ъ"=>"","Ъ"=>""," "=>"-","№"=>"N","+"=>"-",":"=>"-",";"=>"-","!"=>"-","?"=>"-","&"=>"and","\'" =>"", "=" =>"-", "[" =>"(", "]" =>")", "%" => ""), + "А"=>"A","Б"=>"B","В"=>"V","Г"=>"G","Д"=>"D","Е"=>"E","Ё"=>"Yo","Ж"=>"Zh", "З"=>"Z","И"=>"I","Й"=>"J","К"=>"K","Л"=>"L","М"=>"M","Н"=>"N","О"=>"O","П"=>"P","Р"=>"R","С"=>"S","Т"=>"T","У"=>"U","Ф"=>"F","Х"=>"H","Ц"=>"C","Ч"=>"Ch","Ш"=>"Sh","Щ"=>"Shh","Ы"=>"I","Э"=>"E","Ю"=>"Yu","Я"=>"Ya", + "ь"=>"","Ь"=>"","ъ"=>"","Ъ"=>""," "=>"-","№"=>"N","+"=>"-",":"=>"-",";"=>"-","!"=>"-","?"=>"-","&"=>"and","\'" =>"", "=" =>"-","%"=>'-',"ї"=>"yi","Ї"=>"yi","є"=>"ye","Є"=>"ye","і"=>"i","І"=>"i","ґ"=>"g","Ґ"=>"g"), 'mime_magic' => "", From 0db04252af34c7296b8adcb5eb18be763762f8ab Mon Sep 17 00:00:00 2001 From: yama Date: Tue, 3 Sep 2013 00:48:35 +0900 Subject: [PATCH 438/530] Feature #10160 email notifies of system error http://tracker.modx.com/issues/10160 --- manager/actions/mutate_settings.dynamic.php | 24 ++++++++++++++++ .../includes/document.parser.class.inc.php | 19 ++++++++----- .../extenders/dbapi.mysql.class.inc.php | 28 ++++++++++++++++++- manager/includes/lang/english.inc.php | 4 +++ manager/includes/lang/japanese-utf8.inc.php | 4 +++ 5 files changed, 71 insertions(+), 8 deletions(-) diff --git a/manager/actions/mutate_settings.dynamic.php b/manager/actions/mutate_settings.dynamic.php index b97834eb16..8720688ea6 100644 --- a/manager/actions/mutate_settings.dynamic.php +++ b/manager/actions/mutate_settings.dynamic.php @@ -853,6 +853,18 @@ function confirmLangChange(el, lkey, elupd){
    +
    + + + + +
    +
    +
    +
    +$modx->config['emailsender']));?> + +
      @@ -1794,3 +1806,15 @@ function form_radio($name,$value,$checked=false,$add='',$disabled=false) { function wrap_label($str='',$object) { return ""; } + +function parsePlaceholder($tpl='', $ph=array()) +{ + if(empty($ph) || empty($tpl)) return $tpl; + + foreach($ph as $k=>$v) + { + $k = "[+{$k}+]"; + $tpl = str_replace($k, $v, $tpl); + } + return $tpl; +} \ No newline at end of file diff --git a/manager/includes/document.parser.class.inc.php b/manager/includes/document.parser.class.inc.php index f0930709f2..06476a1abf 100755 --- a/manager/includes/document.parser.class.inc.php +++ b/manager/includes/document.parser.class.inc.php @@ -1774,16 +1774,21 @@ function logEvent($evtid, $type, $msg, $source= 'Parser') { $LoginUserID = $this->getLoginUserID(); if ($LoginUserID == '') $LoginUserID = 0; $evtid= intval($evtid); - $type=(int)$type; - if ($type < 1) { - $type= 1; - } - elseif ($type > 3) { - $type= 3; // Types: 1 = information, 2 = warning, 3 = error - } + $type = intval($type); + if ($type < 1) $type= 1; // Types: 1 = information, 2 = warning, 3 = error + if (3 < $type) $type= 3; $sql= "INSERT INTO " . $this->getFullTableName("event_log") . " (eventid,type,createdon,source,description,user) " . "VALUES($evtid,$type," . time() . ",'$source','$msg','" . $LoginUserID . "')"; $ds= @$this->db->query($sql); + if(!$this->db->conn) $source = 'DB connect error'; + if(isset($this->config['send_errormail']) && $this->config['send_errormail'] !== '0') + { + if($this->config['send_errormail'] <= $type) + { + $subject = 'Error mail from ' . $this->config['site_name']; + $this->sendmail($subject,$source); + } + } if (!$ds) { echo "Error while inserting event log into database."; exit(); diff --git a/manager/includes/extenders/dbapi.mysql.class.inc.php b/manager/includes/extenders/dbapi.mysql.class.inc.php index 5c6cad63cc..13fa51d32a 100644 --- a/manager/includes/extenders/dbapi.mysql.class.inc.php +++ b/manager/includes/extenders/dbapi.mysql.class.inc.php @@ -86,7 +86,33 @@ function connect($host = '', $dbase = '', $uid = '', $pwd = '', $persist = 0) { $charset = $this->config['charset']; $connection_method = $this->config['connection_method']; $tstart = $modx->getMicroTime(); - if (!$this->conn = ($persist ? mysql_pconnect($host, $uid, $pwd) : mysql_connect($host, $uid, $pwd, true))) { + $safe_count = 0; + while(!$this->conn && $safe_count<3) + { + if($persist!=0) $this->conn = mysql_pconnect($host, $uid, $pwd); + else $this->conn = mysql_connect($host, $uid, $pwd, true); + + if(!$this->conn) + { + if(isset($modx->config['send_errormail']) && $modx->config['send_errormail'] !== '0') + { + if($modx->config['send_errormail'] <= 2) + { + $logtitle = 'Failed to create the database connection!'; + $request_uri = $_SERVER['REQUEST_URI']; + $request_uri = htmlspecialchars($request_uri, ENT_QUOTES); + $ua = htmlspecialchars($_SERVER['HTTP_USER_AGENT'], ENT_QUOTES); + $referer = htmlspecialchars($_SERVER['HTTP_REFERER'], ENT_QUOTES); + $subject = 'Missing to create the database connection! from ' . $modx->config['site_name']; + $msg = "{$logtitle}
    {$request_uri}
    {$ua}
    {$referer}"; + $modx->sendmail($subject,$msg); + } + } + sleep(1); + $safe_count++; + } + } + if (!$this->conn) { $modx->messageQuit("Failed to create the database connection!"); exit; } else { diff --git a/manager/includes/lang/english.inc.php b/manager/includes/lang/english.inc.php index 1f84d2f499..20c8f93481 100755 --- a/manager/includes/lang/english.inc.php +++ b/manager/includes/lang/english.inc.php @@ -1223,3 +1223,7 @@ $_lang["export_site.static.php5"] = 'Replace string (after)'; $_lang["export_site.static.php6"] = 'Target'; $_lang["export_site.static.php7"] = 'Files cannot be outputted to [+rb_base_url+]'; + +$_lang["mutate_settings.dynamic.php6"] = 'email notifies system error.'; +$_lang["mutate_settings.dynamic.php7"] = 'not notify'; +$_lang["mutate_settings.dynamic.php8"] = 'It notifies to [(emailsender)]([+emailsender+]) at the time of error generating. The details of the contents of the error should check an event log.'; diff --git a/manager/includes/lang/japanese-utf8.inc.php b/manager/includes/lang/japanese-utf8.inc.php index c8ee537fc7..aff5e49873 100755 --- a/manager/includes/lang/japanese-utf8.inc.php +++ b/manager/includes/lang/japanese-utf8.inc.php @@ -1200,3 +1200,7 @@ $_lang["user_street"] = '番地'; $_lang["user_city"] = '市区町村'; $_lang["user_other"] = 'その他'; + +$_lang["mutate_settings.dynamic.php6"] = 'システムエラーを
    メールで通知する'; +$_lang["mutate_settings.dynamic.php7"] = '通知しない'; +$_lang["mutate_settings.dynamic.php8"] = 'エラー発生時に[(emailsender)]([+emailsender+])に通知します。エラーの内容の詳細はイベントログを確認してください。'; From 796c1b8c9331e792f752fca6a7ebf1f786a07a2e Mon Sep 17 00:00:00 2001 From: yama Date: Tue, 3 Sep 2013 01:00:29 +0900 Subject: [PATCH 439/530] Fix --- manager/actions/mutate_settings.dynamic.php | 2 +- manager/includes/config_check.inc.php | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/manager/actions/mutate_settings.dynamic.php b/manager/actions/mutate_settings.dynamic.php index 8720688ea6..638fda21bc 100644 --- a/manager/actions/mutate_settings.dynamic.php +++ b/manager/actions/mutate_settings.dynamic.php @@ -854,7 +854,7 @@ function confirmLangChange(el, lkey, elupd){
    - + diff --git a/manager/includes/config_check.inc.php b/manager/includes/config_check.inc.php index 0043e2bc41..1be9a81ad1 100755 --- a/manager/includes/config_check.inc.php +++ b/manager/includes/config_check.inc.php @@ -143,17 +143,18 @@ function checkSiteCache() { if ($warningspresent==1) { +if(!isset($modx->config['send_errormail'])) $modx->config['send_errormail']='3'; $config_check_results = "

    ".$_lang['configcheck_notok']."

    "; for ($i=0;$ilogEvent(0,2,$warnings[$i][1],$_lang['configcheck_configinc']); + if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,3,$warnings[$i][1],$_lang['configcheck_configinc']); break; case $_lang['configcheck_installer'] : $warnings[$i][1] = $_lang['configcheck_installer_msg']; - if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,2,$warnings[$i][1],$_lang['configcheck_installer']); + if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,3,$warnings[$i][1],$_lang['configcheck_installer']); break; case $_lang['configcheck_cache'] : $warnings[$i][1] = $_lang['configcheck_cache_msg']; @@ -165,7 +166,7 @@ function checkSiteCache() { break; case $_lang['configcheck_sysfiles_mod']: $warnings[$i][1] = $_lang["configcheck_sysfiles_mod_msg"]; - if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,2,$warnings[$i][1],$_lang['configcheck_sysfiles_mod']); + if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,3,$warnings[$i][1],$_lang['configcheck_sysfiles_mod']); break; case $_lang['configcheck_lang_difference'] : $warnings[$i][1] = $_lang['configcheck_lang_difference_msg']; From c471867d9bb107d04f9b719eb424fa33b2104570 Mon Sep 17 00:00:00 2001 From: yama Date: Tue, 3 Sep 2013 14:56:38 +0900 Subject: [PATCH 440/530] Fix - TinyMCE documentDirty check --- assets/plugins/tinymce/functions.php | 2 +- assets/plugins/tinymce/settings/toolbar.settings.inc.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/assets/plugins/tinymce/functions.php b/assets/plugins/tinymce/functions.php index b0a4b5b3b6..ad24aa956e 100644 --- a/assets/plugins/tinymce/functions.php +++ b/assets/plugins/tinymce/functions.php @@ -435,7 +435,7 @@ function build_mce_init($plugins,$buttons1,$buttons2,$buttons3,$buttons4) $ph['date_format'] = $modx->toDateFormat(null, 'formatOnly'); $ph['time_format'] = '%H:%M:%S'; $ph['entity_encoding'] = $params['entity_encoding']; - $ph['onchange_callback'] = "'OnChangeHandler'"; + $ph['onchange_callback'] = 'false'; $ph['terminate'] = (!empty($params['customparams'])) ? ',' : ''; $ph['customparams'] = rtrim($params['customparams'], ','); $content_css[] = "{$mce_url}style/content.css"; diff --git a/assets/plugins/tinymce/settings/toolbar.settings.inc.php b/assets/plugins/tinymce/settings/toolbar.settings.inc.php index cf62c9f172..d06578d1ce 100644 --- a/assets/plugins/tinymce/settings/toolbar.settings.inc.php +++ b/assets/plugins/tinymce/settings/toolbar.settings.inc.php @@ -5,18 +5,18 @@ $set['simple']['b4'] = ''; $set['simple']['b4'] = ''; -$set['creative']['p'] = 'autolink,inlinepopups,autosave,advlist,layer,style,fullscreen,advimage,advhr,paste,advlink,media,contextmenu,table,youtubeIframe'; +$set['creative']['p'] = 'save,autolink,inlinepopups,autosave,advlist,layer,style,fullscreen,advimage,advhr,paste,advlink,media,contextmenu,table,youtubeIframe'; $set['creative']['b1'] = 'undo,undo,redo,|,bold,forecolor,backcolor,strikethrough,formatselect,styleselect,fontsizeselect,code'; $set['creative']['b2'] = 'image,media,youtubeIframe,link,unlink,anchor,|,bullist,numlist,|,blockquote,outdent,indent,|,justifyleft,justifycenter,justifyright,|,advhr,|,styleprops,removeformat,|,pastetext,pasteword'; $set['creative']['b3'] = 'insertlayer,absolute,moveforward,movebackward,|,tablecontrols,|,fullscreen,help'; $set['creative']['b4'] = ''; -$set['logic']['p'] = 'autolink,inlinepopups,autosave,advlist,xhtmlxtras,style,fullscreen,advimage,paste,advlink,media,contextmenu,table,youtubeIframe'; +$set['logic']['p'] = 'save,autolink,inlinepopups,autosave,advlist,xhtmlxtras,style,fullscreen,advimage,paste,advlink,media,contextmenu,table,youtubeIframe'; $set['logic']['b1'] = 'undo,redo,|,bold,forecolor,backcolor,strikethrough,formatselect,styleselect,fontsizeselect,code,|,fullscreen,help'; $set['logic']['b2'] = 'image,media,youtubeIframe,link,unlink,anchor,|,bullist,numlist,|,blockquote,outdent,indent,|,justifyleft,justifycenter,justifyright,|,table,|,hr,|,styleprops,removeformat,|,pastetext,pasteword'; $set['logic']['b3'] = 'charmap,sup,sub,|,cite,ins,del,abbr,acronym,attribs'; -$set['legacy']['p'] = 'autosave,advlist,style,advimage,advlink,searchreplace,print,contextmenu,paste,fullscreen,nonbreaking,xhtmlxtras,visualchars,media,youtubeIframe'; +$set['legacy']['p'] = 'save,autosave,advlist,style,advimage,advlink,searchreplace,print,contextmenu,paste,fullscreen,nonbreaking,xhtmlxtras,visualchars,media,youtubeIframe'; $set['legacy']['b1'] = 'undo,redo,selectall,|,pastetext,pasteword,|,search,replace,|,nonbreaking,hr,charmap,|,image,link,unlink,anchor,media,youtubeIframe,|,cleanup,removeformat,|,fullscreen,print,code,help'; $set['legacy']['b2'] = 'bold,italic,underline,strikethrough,sub,sup,|,blockquote,|,bullist,numlist,outdent,indent,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,|,styleprops'; $set['legacy']['b3'] = ''; @@ -34,7 +34,7 @@ $set['full']['b3'] = 'tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen'; $set['full']['b4'] = 'insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft'; -$set['default']['p'] = 'template,visualblocks,autolink,inlinepopups,autosave,save,advlist,style,fullscreen,advimage,paste,advlink,media,contextmenu,table,youtubeIframe'; +$set['default']['p'] = 'visualblocks,template,autolink,inlinepopups,autosave,save,advlist,style,fullscreen,advimage,paste,advlink,media,contextmenu,table,youtubeIframe'; $set['default']['b1'] = 'undo,redo,|,bold,forecolor,backcolor,strikethrough,formatselect,fontsizeselect,pastetext,pasteword,code,template,|,fullscreen,help'; $set['default']['b2'] = 'image,media,youtubeIframe,link,unlink,anchor,|,justifyleft,justifycenter,justifyright,|,bullist,numlist,|,blockquote,outdent,indent,|,table,hr,|,visualblocks,styleprops,removeformat'; $set['default']['b3'] = ''; From af0c5a4556e35ae31f0fde53b1d357a3821e350b Mon Sep 17 00:00:00 2001 From: yama Date: Tue, 3 Sep 2013 14:57:44 +0900 Subject: [PATCH 441/530] Fix - Login box width issue for example, German language --- manager/media/style/MODxRE/login.tpl | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/manager/media/style/MODxRE/login.tpl b/manager/media/style/MODxRE/login.tpl index 236ec0ca6f..9eedb12eef 100644 --- a/manager/media/style/MODxRE/login.tpl +++ b/manager/media/style/MODxRE/login.tpl @@ -6,6 +6,7 @@