Skip to content
Browse files

Part 1 of 3: Renaming extension

git-svn-id: http://svn.ez.no/svn/extensions/eztinymce/trunk@2726 49f50cf4-cce6-0310-bc1e-a21d999f3d8f
  • Loading branch information...
0 parents commit 02d172b4050356169f8055df4ff85563c88a808d @andrerom andrerom committed
Showing with 20,880 additions and 0 deletions.
  1. +96 −0 FAQ
  2. +179 −0 INSTALL
  3. +340 −0 LICENSE
  4. +22 −0 TODO
  5. +352 −0 autoloads/ezoepacker.php
  6. +9 −0 autoloads/eztemplateautoload.php
  7. +129 −0 changelog.txt
  8. +394 −0 classes/ezajaxcontent.php
  9. BIN design/standard/images/ezdhtml/anchor.gif
  10. BIN design/standard/images/ezdhtml/anchor_image.gif
  11. BIN design/standard/images/ezdhtml/bold.gif
  12. BIN design/standard/images/ezdhtml/bullist.gif
  13. BIN design/standard/images/ezdhtml/center.gif
  14. BIN design/standard/images/ezdhtml/copy.gif
  15. BIN design/standard/images/ezdhtml/customtag.gif
  16. BIN design/standard/images/ezdhtml/customtag_insert.gif
  17. BIN design/standard/images/ezdhtml/cut.gif
  18. BIN design/standard/images/ezdhtml/delcol.gif
  19. BIN design/standard/images/ezdhtml/delrow.gif
  20. BIN design/standard/images/ezdhtml/ezicon.gif
  21. BIN design/standard/images/ezdhtml/file.gif
  22. BIN design/standard/images/ezdhtml/find.gif
  23. BIN design/standard/images/ezdhtml/form.gif
  24. BIN design/standard/images/ezdhtml/help.gif
  25. BIN design/standard/images/ezdhtml/image.gif
  26. BIN design/standard/images/ezdhtml/indent.gif
  27. BIN design/standard/images/ezdhtml/inscol.gif
  28. BIN design/standard/images/ezdhtml/insrow.gif
  29. BIN design/standard/images/ezdhtml/italic.gif
  30. BIN design/standard/images/ezdhtml/link.gif
  31. BIN design/standard/images/ezdhtml/literal.gif
  32. BIN design/standard/images/ezdhtml/media.gif
  33. BIN design/standard/images/ezdhtml/mergecell.gif
  34. BIN design/standard/images/ezdhtml/mrgcell.gif
  35. BIN design/standard/images/ezdhtml/numlist.gif
  36. BIN design/standard/images/ezdhtml/object.gif
  37. BIN design/standard/images/ezdhtml/object_insert.gif
  38. BIN design/standard/images/ezdhtml/object_insert.png
  39. BIN design/standard/images/ezdhtml/objectimage.gif
  40. BIN design/standard/images/ezdhtml/paste.gif
  41. BIN design/standard/images/ezdhtml/redo.gif
  42. BIN design/standard/images/ezdhtml/reduce_indent.gif
  43. BIN design/standard/images/ezdhtml/special.gif
  44. BIN design/standard/images/ezdhtml/splitcell.gif
  45. BIN design/standard/images/ezdhtml/spltcell.gif
  46. BIN design/standard/images/ezdhtml/strike.gif
  47. BIN design/standard/images/ezdhtml/table.gif
  48. BIN design/standard/images/ezdhtml/underline.gif
  49. BIN design/standard/images/ezdhtml/undo.gif
  50. +93 −0 design/standard/javascript/classes/AddOnManager.js
  51. +425 −0 design/standard/javascript/classes/ControlManager.js
  52. +91 −0 design/standard/javascript/classes/Developer.js
  53. +2,293 −0 design/standard/javascript/classes/Editor.js
  54. +936 −0 design/standard/javascript/classes/EditorCommands.js
  55. +389 −0 design/standard/javascript/classes/EditorManager.js
  56. +509 −0 design/standard/javascript/classes/ForceBlocks.js
  57. +367 −0 design/standard/javascript/classes/Popup.js
  58. +176 −0 design/standard/javascript/classes/UndoManager.js
  59. +165 −0 design/standard/javascript/classes/WindowManager.js
  60. +212 −0 design/standard/javascript/classes/adapter/jquery/adapter.js
  61. +2,992 −0 design/standard/javascript/classes/adapter/jquery/jquery.js
  62. +38 −0 design/standard/javascript/classes/adapter/prototype/adapter.js
  63. +4,152 −0 design/standard/javascript/classes/adapter/prototype/prototype.js
  64. +1,627 −0 design/standard/javascript/classes/dom/DOMUtils.js
  65. +206 −0 design/standard/javascript/classes/dom/Element.js
  66. +264 −0 design/standard/javascript/classes/dom/Event.js
  67. +294 −0 design/standard/javascript/classes/dom/ScriptLoader.js
  68. +640 −0 design/standard/javascript/classes/dom/Selection.js
  69. +930 −0 design/standard/javascript/classes/dom/Serializer.js
  70. +200 −0 design/standard/javascript/classes/dom/StringWriter.js
  71. +151 −0 design/standard/javascript/classes/dom/XMLWriter.js
  72. BIN design/standard/javascript/classes/firebug/errorIcon.png
  73. +209 −0 design/standard/javascript/classes/firebug/firebug.css
  74. +22 −0 design/standard/javascript/classes/firebug/firebug.html
  75. +681 −0 design/standard/javascript/classes/firebug/firebug.js
  76. BIN design/standard/javascript/classes/firebug/infoIcon.png
  77. BIN design/standard/javascript/classes/firebug/warningIcon.png
  78. +482 −0 design/standard/javascript/classes/tinymce.js
  79. +65 −0 design/standard/javascript/classes/ui/Button.js
  80. +162 −0 design/standard/javascript/classes/ui/ColorSplitButton.js
  81. +56 −0 design/standard/javascript/classes/ui/Container.js
  82. +174 −0 design/standard/javascript/classes/ui/Control.js
  83. +358 −0 design/standard/javascript/classes/ui/DropMenu.js
Sorry, we could not display the entire diff because too many files (424) changed.
96 FAQ
@@ -0,0 +1,96 @@
+eZ Online Editor MCE extension 1.0 FAQ
+
+1. eZ Online Editor MCE is not activated in eZ Publish
+==================================================
+
+You will need to check if the extension is properly activated in site.ini.
+Open 'settings/override/site.ini.append(.php)' and find the 'ExtensionSettings'
+section. Under it you should have an entry that says:
+
+ActiveExtensions[]=ezoe
+
+Make sure there are no spaces before or after the name.
+
+You should also consider checking the debug output of eZ Publish to see what is
+going wrong.
+
+
+2. After installation, I only get Disable editor/Enable editor button when
+ editing an article, no any other changes.
+==========================================================================
+
+A. Make sure you have correct apache rewrite rule. Have you restarted apache
+ after changes?
+
+ Example of the rewrite rule for Apache:
+ Rewriterule ^/extension/[^/]+/design/[^/]+/(stylesheets|images|javascripts?)/.* - [L]
+
+B. Make sure you are using one of the following web browsers:
+ Internet Explorer 6.0 or higher,
+ Mozilla 1.7 or higher,
+ Firefox 1.0 or higher,
+ Netscape 8.0 or higher.
+ Safari 3.0 or higher.
+ Opera 9.2 or higher.
+
+ (It is always recommended to use the latest available version of the browser)
+
+ Make sure that Javascript support is enabled in your web browser.
+
+ Note: Safari and Opera is not well tested at this time, so if you experience
+ problems or unexpected result. Please try again in Firefox or Internet
+ Explorer and report the issue to us so we can fix it!
+
+
+
+3. After installation, I see nothing have been changed when editing an article.
+===============================================================================
+
+A. Check your installation path. The correct path should like following:
+ eZ Publish Root - kernel
+ - lib
+ - doc
+ - bin
+ - design
+ - ...
+ - extension - ezoe - modules
+ - design
+ - ezxmltext
+ - settings
+ - ...
+B. Have you changed ActiveExtensions[] to ActiveExtensions[]=ezoe
+ in site.ini?
+
+C. Make sure you have cleared all the caches (both eZ Publish and browser).
+
+
+4. When I insert an image into the editor, it does not show the image.
+===============================================================================
+
+Check the 'extension/ezoe/settings/site.ini.append.php' file, find line
+
+ImageClassID[]=your_image_class_id
+
+under [MediaClassSettings]. Is the image class id correct?
+
+Note: The ImageClassID setting is deprecated. Use the ImageClassIdentifiers
+setting instead in the same [MediaClassSettings] section.
+
+
+5. When I insert an image into the editor, it disappears after storing.
+=======================================================================
+
+Are you trying to insert image right before or after heading?
+Note that images/objects can't be saved in the same line as heading.
+
+Make sure you have permission to store the image in the placment you choose!
+Make sure the upload limit of the image size is set high enough both in php settings,
+apache settings and on the image class in eZ Publish ( it is 2Mb by default )
+
+
+6. I click right mouse button on the selection, but see no 'Properties' there.
+==============================================================================
+
+This feature is removed to allow users to use the browsers built in spell checker.
+Click on the tag name in the 'Path:' to edit the tag properties!
+
179 INSTALL
@@ -0,0 +1,179 @@
+eZ Online Editor MCE extension 1.0 INSTALL
+
+
+What is the eZ Online Editor MCE extension?
+=======================================
+
+ eZ Publish Online Editor MCE for eZ XML fields.
+
+
+Requirements
+============
+
+The following requirements exists for using eZ Online Editor MCE extension:
+
+o eZ Publish version:
+
+ Make sure you use eZ Publish version 4.0 or higher.
+
+o PHP version:
+
+ as indicated in your eZ Publish version requirements
+
+o Web Browser:
+
+ Make sure you have one of the following web browsers:
+
+ Internet Explorer 6.0 or higher,
+ Mozilla 1.7 or higher,
+ Firefox 1.0 or higher,
+ Netscape 8.0 or higher.
+ Safari 3.0 or higher.
+ Opera 9.2 or higher.
+
+ Make sure that Javascript support is enabled in your web browser.
+
+ Note: Safari and Opera is not well tested at this time, so if you experience
+ problems or unexpected result. Please try again in Firefox or Internet
+ Explorer and report the issue to us so we can fix it!
+
+
+Getting eZ Publish
+==================
+
+You can download a version of eZ Publish from ez.no, you will find the
+various versions at:
+http://ez.no/download/ez_publish
+
+NOTE: You will need eZ Publish 4.0 or higher.
+
+Information on the installation of eZ Publish can be found at:
+http://ez.no/doc
+
+
+Installing eZ Online Editor MCE extension
+=========================================
+
+1. Download the ezoe package.
+
+ Windows users should download the "zip" package. Linux/UNIX/OS X users may
+ download any package format as long as the necessary unpacking tools are
+ available.
+
+2. Copy the downloaded package into the 'extension' directory of your
+ eZ Publish installation.
+
+3. Unpack the files in the distribution.
+
+ Windows users should unzip the files. The 'ezoe' directory will be created
+ inside the 'extension' directory.
+
+ Linux users may use of the following commands depending on the file type:
+ [tar.gz]:
+ $ tar -zxvf ezoe-extension-[ExtensionVersion].tar.gz
+ [bz2]:
+ $ tar -jxvf ezoe-extension-[ExtensionVersion].bz2
+ [zip]:
+ $ unzip ezoe-extension-[ExtensionVersion].zip
+
+4. Enable the ezoe extension in eZ Publish.
+
+ To enable ezoe for all of your siteaccesses, log in to your eZ Publish
+ administration interface, click on the 'Setup' tab, and then click
+ 'Extensions' on the left. You will see the list of available extensions.
+ Select the 'ezoe' item and click the 'Apply changes' button.
+ Aternatively, you can also edit the file 'site.ini.append.php' located
+ in the 'settings/override' directory. Add the following line under
+ the [ExtensionSettings] section:
+
+ ActiveExtensions[]=ezoe
+
+ Create the file and/or the section if they do not exist.
+
+ To enable ezoe for only a single siteaccess, open the 'site.ini.append.php'
+ file located in the 'settings/siteaccess/your_siteaccess' directory.
+ Add the following line under the [ExtensionSettings] section:
+
+ ActiveAccessExtensions[]=ezoe
+
+ Create the file and/or the section if they do not exist.
+
+5. Set the Image class
+
+ In eZ Publish, images are usually stored as Image objects. ezoe allows you
+ to insert various objects into XML fields. ezoe uses the IDs of the image
+ classes to determine whether the inserted object is an image or not.
+
+ To check your Image Class ID, log in to your eZ Publish administration
+ interface, access the 'Setup' tab, and then click 'Classes' on the left.
+ You will see the list of class groups. Select the 'Media' group and find
+ the image class. The default ID of this class is 5 in a standard
+ eZ Publish installation. If your Image class ID is not 5, open the
+ 'site.ini.append.php' file located in the 'extension/ezoe/settings/'
+ directory. Search for the following line under the [MediaClassSettings]
+ section:
+
+ ImageClassID[]=5
+
+ Replace '5' with the value of the image class that your installation
+ is using.
+
+ If you have created different/additional image class, you can add these
+ by extending the 'ImageClassID[]' configuration array. Add the following
+ line under the [MediaClassSettings] section:
+
+ ImageClassID[]=your_id
+
+ Note: The ImageClassID setting is deprecated. Use the ImageClassIdentifiers
+ setting instead in the same [MediaClassSettings] section.
+
+6. Clear all the eZ Publish caches.
+
+ Log in to your eZ Publish administration interface, select the 'Setup' tab,
+ and then click the 'Clear all caches' button. If you use eZ Publish 3.6
+ or higher, you can also use the developer toolbar (if enabled) located
+ in the right hand side. Simply select 'All caches' from the drop-down list
+ and click the 'Clear' button.
+
+ The other way to clear all caches is to remove the contents of 'var/cache/'
+ and/or 'var/your_siteaccess/cache/' directory. This can either be done
+ manually or by making use of a script.
+
+ Linux users may launch the following script:
+
+ $ ./bin/shell/clearcache.sh --clear-all
+
+ If you have PHP CLI installed, you can also do the following (this script
+ should also work on Windows):
+
+ $ ./bin/php/ezcache.php --clear-all
+
+7. Clear the browser caches
+
+ Browsers usually cache visited pages in a folder somewhere. The next time
+ the same pages are visited, they are loaded faster because some of the
+ information already exists on the local storage device. If you already have
+ ezoe installed and you're upgrading it then you will have to clear the
+ browser's cache.
+
+
+Troubleshooting
+===============
+
+1. Read the FAQ
+ ------------
+
+ Some problems are more common than others. The most common ones are listed
+ in the FAQ file.
+
+2. Documentation
+ ------------
+
+ http://ez.no/doc/extensions/online_editor
+
+3. Support
+ -------
+
+ If you have find any problems not handled by this document, FAQ and online
+ documentation you can contact eZ system trough the support system:
+ http://ez.no/services/support
340 LICENSE
@@ -0,0 +1,340 @@
+ 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
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) 19yy <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) 19yy name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
22 TODO
@@ -0,0 +1,22 @@
+
+
+0.9 (Community Beta)
+Ajax Browse support for links
+Fix indenting / outdenting
+ 1. BLOCKQUOTE tag is added if you indent first list element
+ 2. indeting / outending multiple li's
+Repports on classification removed on p / li / ul on publish or when you try to edit again
+
+
+1.0
+Compress theme and plugins for faster download OR
+Look into using ezpacker from ezcore extensions for preloading and packing javascript files togheter
+ set theme / plugin name to -<name> to avoid TinyMCE from loading them
+ this will also allow plugin loading from external extensions
+ Load content.css from [StylesheetSettings]EditorCSSFileList[]
+Override TinyMCE translations and use it for all js strings (fixes fullscreen description text++)
+
+
+1.1
+Let skin be loadable from external extentions
+Custimizable formats selector (custom tags and classes)
352 autoloads/ezoepacker.php
@@ -0,0 +1,352 @@
+<?php
+//
+// Definition of eZOEPacker class
+//
+// Created on: <23-Aug-2007 12:42:08 ar>
+//
+// ## BEGIN COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
+// SOFTWARE NAME: eZ Online Editor MCE
+// SOFTWARE RELEASE: 4.x
+// COPYRIGHT NOTICE: Copyright (C) 1999-2008 eZ systems AS
+// SOFTWARE LICENSE: GNU General Public License v2.0
+// NOTICE: >
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of version 2.0 of the GNU General
+// Public License as published by the Free Software Foundation.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of version 2.0 of the GNU General
+// Public License along with this program; if not, write to the Free
+// Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+// MA 02110-1301, USA.
+//
+//
+// ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
+//
+
+/*
+ Template operators for merging and packing css and javascript files.
+ Reduces page load time both in terms of reducing connections from clients
+ and bandwidth ( if packing is turned on ).
+
+ Packing has 4 levels: 0=off, 1=merge files, 2= 1 + remove whitespace, 3= 2+ remove more whitespace
+ Will be forced off when template DevelopmentMode is enabled
+ for developer productivity.
+
+ Recomended settings are 3 for css and 2 for javascript,
+ basicly since the optimizer isn't string safe.
+ eg: var str = ' My last name, and my brothers last name are: Olsen';
+ var str = ' My last name,and my brothers last name are:Olsen';
+
+ In case of css files, relative image paths will be replaced
+ by absolute paths, only '../images/' paths are supported
+ currently.
+
+ Function packFiles can be used static from php as well.
+*/
+
+//include_once( 'lib/ezfile/classes/ezfile.php' );
+//include_once( 'lib/ezutils/classes/ezuri.php' );
+//include_once( 'kernel/common/ezoverride.php' );
+
+class eZOEPacker
+{
+ function eZOEPacker()
+ {
+ }
+
+ function operatorList()
+ {
+ return array( 'ezscript', 'ezcss' );
+ }
+
+ function namedParameterPerOperator()
+ {
+ return true;
+ }
+
+ function namedParameterList()
+ {
+ return array( 'ezscript' => array( 'script_array' => array( 'type' => 'array',
+ 'required' => true,
+ 'default' => array() ),
+ 'type' => array( 'type' => 'string',
+ 'required' => false,
+ 'default' => 'text/javascript' ),
+ 'language' => array( 'type' => 'string',
+ 'required' => false,
+ 'default' => 'javascript' ),
+ 'pack_level' => array( 'type' => 'integer',
+ 'required' => false,
+ 'default' => 2 )),
+ 'ezcss' => array( 'css_array' => array( 'type' => 'array',
+ 'required' => true,
+ 'default' => array() ),
+ 'media' => array( 'type' => 'string',
+ 'required' => false,
+ 'default' => 'all' ),
+ 'type' => array( 'type' => 'string',
+ 'required' => false,
+ 'default' => 'text/css' ),
+ 'rel' => array( 'type' => 'string',
+ 'required' => false,
+ 'default' => 'stylesheet' ),
+ 'pack_level' => array( 'type' => 'integer',
+ 'required' => false,
+ 'default' => 3 ) ));
+ }
+
+ function modify( $tpl, $operatorName, $operatorParameters, $rootNamespace, $currentNamespace, &$operatorValue, $namedParameters )
+ {
+ $ret = '';
+ // Do not pack files if developmentMode is enabled
+ $ini = eZINI::instance( 'site.ini' );
+ if ($ini->variable('TemplateSettings', 'DevelopmentMode') === 'enabled')
+ {
+ $packLevel = 0;
+ }
+ else
+ {
+ $packLevel = (int) $namedParameters['pack_level'];
+ }
+
+
+ switch ( $operatorName )
+ {
+ case 'ezscript':
+ {
+ $ret = eZOEPacker::buildJavascriptTag($namedParameters['script_array'],
+ $namedParameters['type'],
+ $namedParameters['language'],
+ $packLevel );
+ } break;
+ case 'ezcss':
+ {
+ $ret = eZOEPacker::buildStylesheetTag($namedParameters['css_array'],
+ $namedParameters['media'],
+ $namedParameters['type'],
+ $namedParameters['rel'],
+ $packLevel );
+ } break;
+ }
+ $operatorValue = $ret;
+ }
+
+ // static :: Builds the xhtml tag for scripts
+ static function buildJavascriptTag( $scriptFiles, $type, $lang, $packLevel )
+ {
+ $ret = '';
+ $packedFiles = eZOEPacker::packFiles( $scriptFiles, 'javascript/', '.js', $packLevel );
+ foreach ( $packedFiles as $packedFile )
+ {
+ $ret .= $packedFile ? "<script language=\"$lang\" type=\"$type\" src=\"$packedFile\"></script>\n" : '';
+ }
+ return $ret;
+ }
+
+ // static :: Builds the xhtml tag for stylesheets
+ static function buildStylesheetTag( $cssFiles, $media, $type, $rel, $packLevel )
+ {
+ $ret = '';
+ $packedFiles = eZOEPacker::packFiles( $cssFiles, 'stylesheets/', '_' . $media . '.css', $packLevel );
+ foreach ( $packedFiles as $packedFile )
+ {
+ $ret .= $packedFile ? "<link rel=\"$rel\" type=\"$type\" href=\"$packedFile\" media=\"$media\" />\n" : '';
+ }
+ return $ret;
+ }
+
+ /* static ::
+ Merges a collection of files togheter and returns array of paths to the files.
+ The name of the cached file is a md5 hash consistant of the file paths
+ of the valid files in $file_array and the highest timestamp of those files
+ And if template debug is turned off it also packs the files by removing
+ unnecesery whitespace and comments
+ */
+ static function packFiles( $fileArray, $path = '', $fileExtension = '.js', $packLevel = 2 )
+ {
+ if ( !$fileArray )
+ {
+ return array();
+ }
+
+ $cacheName = '';
+ $lastmodified = 0;
+ $validFiles = array();
+ $validWWWFiles = array();
+ $sys = eZSys::instance();
+ $wwwDir = $sys->wwwDir() . '/';
+ $bases = eZTemplateDesignResource::allDesignBases();
+
+ while( count( $fileArray ) > 0 )
+ {
+ $file = array_shift( $fileArray );
+ if ( $file && is_array( $file ) )
+ {
+ $fileArray = array_merge($fileArray, $file);
+ continue;
+ }
+ else if ( !$file )
+ {
+ continue;
+ }
+
+ // is it a absolute path or relative ?
+ if ( strpos( $file, 'var/' ) === 0 )
+ {
+ if ( substr( $file, 0, 2 ) === '//' || preg_match( "#^[a-zA-Z0-9]+:#", $file ) )
+ $file = '/';
+ else if ( strlen( $file ) > 0 && $file[0] !== '/' )
+ $file = '/' . $file;
+
+ eZURI::transformURI( $file, true, 'relative' );
+ }
+ else
+ {
+ $file = $path . $file;
+ $triedFiles = array();
+ $match = eZTemplateDesignResource::fileMatch( $bases, '', $file, $triedFiles );
+
+ if ( $match === false )
+ {
+ eZDebug::writeWarning( "Could not find: $file", "eZOEPacker::packFiles()" );
+ continue;
+ }
+ $file = htmlspecialchars( $wwwDir . $match['path'] );
+ }
+
+ // get file time and abort if it return false
+ $file = str_replace( '//' . $wwwDir, '', '//' . $file );
+ $fileTime = @filemtime( $file );
+
+ if ( $fileTime === false )
+ {
+ eZDebug::writeWarning( "Could not find: $file", "eZOEPacker::packFiles()" );
+ continue;
+ }
+
+ // calculate last modified file and store
+ $lastmodified = max( $lastmodified, $fileTime);
+ $validFiles[] = $file;
+ $validWWWFiles[] = $wwwDir . $file;
+ $cacheName .= $file . '_';
+ }
+
+ if ( $packLevel === 0 ) return $validWWWFiles;
+
+ if ( !$validFiles )
+ {
+ eZDebug::writeWarning( "Could not find any: " . var_export( $fileArray, true ), "eZOEPacker::packFiles()" );
+ return array();
+ }
+
+ // return cache file path if it exists
+ $cacheName = md5( $cacheName . $packLevel ) . $fileExtension;
+ $cacheDir = $sys->cacheDirectory() . '/' . $path;
+ if ( file_exists( $cacheDir . $cacheName ) )
+ {
+ if ( $lastmodified <= @filemtime( $cacheDir . $cacheName ) )
+ {
+ return array( $wwwDir . $cacheDir . $cacheName );
+ }
+ }
+
+ // Merge file content and create new cache file
+ $content = '';
+ foreach ( $validFiles as $file )
+ {
+ $fileContent = @file_get_contents( $file );
+
+ if ( !trim( $fileContent ) )
+ {
+ $content .= "/* empty: $file */\n";
+ continue;
+ }
+
+ // we need to fix image paths if this is css file
+ if ( strpos($fileExtension, '.css') !== false )
+ {
+ $imgPath = explode('/', $file);
+ array_pop( $imgPath );//remove file
+ // replace sub image paths (used in style packages)
+ $imgFullPath = $wwwDir . implode('/',$imgPath) . '/images/';
+ $fileContent = str_replace('(images/', '('.$imgFullPath, $fileContent);
+ $fileContent = str_replace('("images/', '("'.$imgFullPath, $fileContent);
+ $fileContent = str_replace("('images/", "('".$imgFullPath, $fileContent);
+ // replace relative image paths ( used in designs )
+ array_pop( $imgPath );//remove stylesheets path
+ $imgFullPath = $wwwDir . implode('/',$imgPath) . '/images/';
+ $fileContent = str_replace('../images/', $imgFullPath, $fileContent);
+ }
+
+ $content .= "/* start: $file */\n";
+ $content .= $fileContent;
+ $content .= "\n/* end: $file */\n\n";
+ }
+
+ // Pack the file when development mode is turned off to save bandwidth
+ // the packer is targeted at being function safe, so not to aggressiv
+ if ( $packLevel > 1 )
+ {
+ // normalize line feeds
+ $content = str_replace(array("\r\n", "\r"), "\n", $content);
+
+ // remove multiline comments
+ $content = preg_replace('!(?:\n|\s|^)/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $content);
+
+ // remove whitespace form start and end of line + singelline comment + multiple linefeeds
+ $content = preg_replace(array('/\n\s+/', '/\s+\n/', '!\n//.+\n!', '!\n//\n!', '/\n+/'), "\n", $content);
+
+ if ( $packLevel > 2 )
+ {
+ // remove space around ':' and ','
+ $content = preg_replace(array('/:\s+/', '/\s+:/'), ':', $content);
+ $content = preg_replace(array('/,\s+/', '/\s+,/'), ',', $content);
+
+ // remove unnecesery line breaks
+ $content = str_replace(array(";\n", '; '), ';', $content);
+ $content = str_replace(array("}\n","\n}", ';}'), '}', $content);
+ $content = str_replace(array("{\n", "\n{", '{;'), '{', $content);
+
+ if ( strpos($fileExtension, '.css') !== false )
+ {
+ // optimize css
+ $content = str_replace(array(' 0em', ' 0px',' 0pt', ' 0pc'), ' 0', $content);
+ $content = str_replace(array(':0em', ':0px',':0pt', ':0pc'), ':0', $content);
+ $content = str_replace('0 0 0 0', '0', $content);
+
+ // these should use regex
+ $content = str_replace(array('#ffffff','#FFFFFF'), '#fff', $content);
+ $content = str_replace('#000000', '#000', $content);
+ }
+ else if ( strpos($fileExtension, '.js') !== false )
+ {
+ // optimize javascript ( these are not string safe and the reason
+ // why ezscript() has a default pack level of 1 )
+ $content = str_replace(' )}', ')}', $content);
+ $content = str_replace(array('( ', " (\n"), '(', $content);
+ $content = str_replace(array(' =', '= '), '=', $content);
+ $content = str_replace(array('+ ', ' +'), '+', $content);
+ $content = str_replace(array('- ', ' -'), '-', $content);
+ $content = str_replace(array('< ', ' <'), '<', $content);
+ $content = str_replace(array('> ', ' >'), '>', $content);
+ $content = str_replace( ' var', 'var', $content);
+ }
+ }
+ }
+
+ // save file and return path if sucsessfull
+ if( eZFile::create( $cacheName, $cacheDir, $content ) )
+ {
+ return array( $wwwDir . $cacheDir . $cacheName );
+ }
+
+ return array();
+ }
+}
+
+?>
9 autoloads/eztemplateautoload.php
@@ -0,0 +1,9 @@
+<?php
+
+$eZTemplateOperatorArray[] = array( 'script' => 'extension/ezoe/autoloads/ezoepacker.php',
+ 'class' => 'eZOEPacker',
+ 'operator_names' => array( 'ezoescript', 'ezoecss' ) );
+
+
+
+?>
129 changelog.txt
@@ -0,0 +1,129 @@
+eZ Online Editor MCE extension Changlog
+
+0.96
+* updated TinyMCE to 3.0.4.1
+
+
+0.95
+* fixed issue with new custom tags not being saved correctly
+* fixed js bug when you edit image
+* Preview align changes while you edit image properties
+* updated TinyMCE to 3.0.3
+* enabled safari plugin in TinyMCE, this 'fixes' bugs in Safari
+* Not Disable fullscreen button when you select a embed tag
+* fixed class disapearing on table on store when border=0
+* Added support for Skin Variants in ezoe.ini
+
+
+0.94
+* Fixed anchor insert
+* Preview of embed object tags while editing / inserting
+* Added th support (in cell properties popup)
+* made merge cell work like old OE (no popup, use ctrl key to select cells)
+* experimental support for indenting / outdenting added on lists
+
+
+0.93
+* Fixed link insert not working
+* Changed text size to 0.8em (same as admin design) and font type
+* Enabled undo support in tag popup's
+* Fixed window size on merge table cell popup
+
+
+0.92
+* Fixed browser resize issue
+* Made upload warning more human readable
+* Made toolbar groupable (some ie7 issues left)
+* Use i18n in editor and popups (some left)
+* added DevelopmentMode setting to ezoe.ini
+
+
+0.91
+* load plugins and buttons from ezoe.ini
+* Load skin from ezoe.ini
+* Make toolbar floating so it wraps on small browser windows / screens
+* Fixed empty paragraphs disappearing in Gecko
+
+
+0.9
+* added table cols / rows size selector when you create new table
+* added setting from ezdhtml/trunk: site.ini [MediaClassSettings]ImageClassIdentifiers
+ and marked ImageClassID as deprecated.
+* Added title attribute on embed tags (image / object) with object name
+* added input fields for specifying cols / rows on a table with keybord instead of mouse
+ (lets you define more then 5x5 tables)
+* added ajax lookup for validation of eznode and ezobject links (when typing in link dialogue window)
+
+
+0.8
+* link and anchor dialogue
+* table and table cell dialogue
+* made custom attributes work on em and strong tags without class
+* generate table xhtml with tbody and <br /> in empty cells to avoid browser bugs
+* skip duplicated custom attributes
+* removed some more unimportant gui buttons to trim editor space (width)
+ and organised the buttons more like old OE
+* added pagebreak and underline buttons, thy will show up if you enable custom tags with the same name!
+
+
+0.7
+* Modified browser support:
+ ie 6+, Opera 9.2+, WebKit 522+ (~ Safari 3+) and Mozilla 1.7+ (~ Firefox 1.0+)
+* added custom and literal buttons and commands
+* added general tag dialogue
+* added new setting 'CustomTagsDescription' on CustomTagSettings group
+ to be able to have better descriptive name on custom tags in the drop down
+* added dialogue for custom tags
+
+
+0.6
+* Changed internal HTML format for:
+ . Literals now use PRE tag instead of table
+ . Custom tags (blocks) now use Span tags instead of table
+ . Embed(-inline) tags (not images) now use Div tags instead of image with paper clip
+* Made view and class list reload when you click 'inline' in relations popup
+* custom attributes support and drop down support for custom attributes see content.ini.append
+* updated TinyMCE to 3.0 final
+* created new theme called ez based on advance theme to override path behaviour and theme
+* moved relations handling to new ez theme
+* made path show eZ xml tags instead of native html tag
+
+
+0.5
+* updated TinyMCE to 3.0rc2
+* added pixel size on size selection
+* Added optional Image filter attributes:
+ . GUIName : If you want to give the filter a more user friendly name in gui
+ . HideFromRelations : If you want to hide a specific filter from dropdown in editor
+* Added support for optional [MediaClassSettings]<content_type>ClassID for setting
+ class id/identifier filter for relation search and browse
+* added existing related images to upload dialogue
+* Added new ini setting for crop size alias [ImageSettings]DefaultCropAlias, uses DefaultEmbedAlias if not set
+* Completed lazy loading of image alias sizes in relations
+* Updated ez_core to 0.91 and added animation and accordion in popups for tabs
+
+
+0.4
+* update TinyMCE to 3.0beta3
+* update ezimage plugin to new TinyMCE api
+* Added support for existing relations
+* Added caption support for images when uploading
+
+
+0.3
+ * Converted code to PHP5
+ * Updated TinyMCE to 2.1.3
+ * cleaned json_content.php -> ezajaxcontent.php
+ * updated ez_core.js to version 0.81
+ * Forked OE's xml handlers so ezoe is standalone
+ * Fixed OE issue #011300
+ * Enabled support for all browsers (only disabled for IE < 6.0 for now)
+
+
+0.2 (only published on ez.no)
+ * Now uses Online editors xml handlers to do the xml -> html and back translation
+ and created a tinymce image extension based on advimage to handle images.
+
+
+0.1 (only published as proof of concept on ez.no)
+* intial testcase using javascript to translate tags to / from ez xml format
394 classes/ezajaxcontent.php
@@ -0,0 +1,394 @@
+<?php
+//
+// Created on: <5-Aug-2007 00:00:00 ar>
+//
+// ## BEGIN COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
+// SOFTWARE NAME: eZ Online Editor MCE extension for eZ Publish
+// SOFTWARE RELEASE: 1.x
+// COPYRIGHT NOTICE: Copyright (C) 2008 eZ Systems AS
+// SOFTWARE LICENSE: GNU General Public License v2.0
+// NOTICE: >
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of version 2.0 of the GNU General
+// Public License as published by the Free Software Foundation.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of version 2.0 of the GNU General
+// Public License along with this program; if not, write to the Free
+// Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+// MA 02110-1301, USA.
+//
+//
+// ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
+//
+
+// Simplifying and encoding content objects / nodes to json
+// using the php json extension included in php 5.2 and
+// higher or fallback to php version if not present
+
+
+class eZAjaxContent
+{
+ protected static $instance = null;
+ protected static $nativeJsonEncode = false;
+
+ // protected __construct, so new instance can only be created with getInstance()
+ protected function __construct()
+ {
+ }
+
+ // protected __clone, prevents cloning of object
+ protected function __clone()
+ {
+ }
+
+ /*
+ Static Singleton function to get a instance of this class
+ */
+ public static function getInstance()
+ {
+ if ( self::$instance === null )
+ {
+ self::$instance = new eZAjaxContent();
+ }
+ return self::$instance;
+ }
+
+ /*
+ Function for encoding content object(s) or node(s) to simplified json objects
+ TODO: add xml support
+ */
+ public static function encode( $obj, $params = array(), $type = 'json' )
+ {
+ if ( is_array( $obj ) )
+ {
+ $ret = array();
+ foreach ( $obj as $ob )
+ {
+ $ret[] = self::simplify( $ob, $params );
+ }
+ }
+ else
+ {
+ $ret = self::simplify( $obj, $params );
+ }
+ return self::jsonEncode( $ret );
+ }
+
+ /*
+ Function for simplifying a content object or node
+ */
+ public static function simplify( $obj, $params = array() )
+ {
+ if ( !$obj ) return array();
+
+ $params = array_merge( array(
+ 'dataMap' => array(), // collection of identifiers you want to load, load all with array('all')
+ 'fetchPath' => false, // fetch node path
+ 'fetchChildrenCount' => false,
+ 'dataMapType' => array(), //if you want to filter datamap by type
+ 'imagePreGenerateSizes' => array('small') //Pre generated images, loading all can be quite time consuming
+ ), $params );
+
+ if ( !isset( $params['imageSizes'] ) )// list of available image sizes
+ {
+ $imageIni = eZINI::instance( 'image.ini' );
+ $params['imageSizes'] = $imageIni->variable( 'AliasSettings', 'AliasList' );
+ }
+
+ if ( $params['imageSizes'] === null || !isset( $params['imageSizes'][0] ) )
+ $params['imageSizes'] = array();
+
+ if ( !isset( $params['imageDataTypes'] ) )
+ $params['imageDataTypes'] = array('ezimage');
+
+ if ( $obj instanceof eZContentObject)
+ {
+ $node = $obj->attribute( 'main_node' );
+ $contentObject = $obj;
+ }
+ elseif ( $obj instanceof eZContentObjectTreeNode )
+ {
+ $node = $obj;
+ $contentObject = $obj->attribute( 'object' );
+ }
+ else
+ {
+ return ''; // Other passed objects are not supported
+ }
+
+ $ret = array();
+ $attrtibuteArray = array();
+ $ret['name'] = $contentObject->attribute( 'name' );
+ $ret['contentobject_id'] = $ret['id'] = (int) $contentObject->attribute( 'id' );
+ $ret['main_node_id'] = (int)$contentObject->attribute( 'main_node_id' );
+ $ret['modified'] = $contentObject->attribute( 'modified' );
+ $ret['published'] = $contentObject->attribute( 'published' );
+ $ret['section_id'] = (int) $contentObject->attribute( 'section_id' );
+ $ret['current_language'] = $contentObject->attribute( 'current_language' );
+ $ret['owner_id'] = (int) $contentObject->attribute( 'owner_id' );
+ $ret['class_id'] = (int) $contentObject->attribute( 'contentclass_id' );
+ $ret['class_name'] = $contentObject->attribute( 'class_name' );
+
+ $class = $contentObject->attribute( 'content_class' );
+ $ret['class_identifier'] = $class->attribute( 'identifier' );
+ $ret['is_container'] = (int) $class->attribute( 'is_container' );
+
+ if ( $node instanceof eZContentObjectTreeNode )
+ {
+ $ret['node_id'] = (int) $node->attribute( 'node_id' );
+ $ret['parent_node_id'] = (int) $node->attribute( 'parent_node_id' );
+ $ret['url_alias'] = $node->attribute( 'url_alias' );
+ $ret['depth'] = (int) $node->attribute( 'depth' );
+ if ( $params['fetchPath'] )
+ {
+ $ret['path'] = array();
+ foreach ( $node->attribute( 'path' ) as $n )
+ {
+ $ret['path'][] = self::simplify( $n );
+ }
+ }
+ $ret['children_count'] = 0;
+ if ( $ret['is_container'] && $params['fetchChildrenCount'] )
+ {
+ $ret['children_count'] = (int) $node->attribute( 'children_count' );
+ }
+ }
+
+ $ret['image_attributes'] = array();
+
+ if ( is_array( $params['dataMap'] ) && is_array( $params['dataMapType'] ) )
+ {
+ $dataMap = $contentObject->attribute( 'data_map' );
+ foreach( $dataMap as $key => $atr )
+ {
+ $dataTypeString = $atr->attribute( 'data_type_string' );
+
+ if ( !in_array( 'all' ,$params['dataMap'], true )
+ && !in_array( $key ,$params['dataMap'], true )
+ && !in_array( $dataTypeString, $params['dataMapType'], true )
+ ) continue;
+ $attrtibuteArray[ $key ]['id'] = $atr->attribute( 'id' );
+ $attrtibuteArray[ $key ]['type'] = $dataTypeString;
+ $attrtibuteArray[ $key ]['identifier'] = $key;
+ $attrtibuteArray[ $key ]['content'] = $atr->toString();
+
+ // images
+ if ( in_array( $dataTypeString, $params['imageDataTypes'], true) !== false )
+ {
+ $content = $atr->attribute( 'content' );
+ $imageArray = array();
+ foreach( $params['imageSizes'] as $size )
+ {
+ $imageArray[ $size ] = false;
+ if ( in_array( $size, $params['imagePreGenerateSizes'] )
+ && $content->hasAttribute( $size ) )
+ $imageArray[ $size ] = $content->attribute( $size );
+ }
+
+ $imageArray['original'] = array( 'url' => $attrtibuteArray[ $key ]['content'] );
+ $attrtibuteArray[ $key ]['content'] = $imageArray;
+ $ret['image_attributes'][] = $key;
+ }
+ }
+ }
+ $ret['data_map'] = $attrtibuteArray;
+ return $ret;
+ }
+
+ /*
+ Wrapper function for encoding to json with native or php version
+ depending on what the system supports
+ */
+ public static function jsonEncode( $obj )
+ {
+ if ( function_exists( 'json_encode' ) === true )
+ return json_encode( $obj );
+
+ if ( self::$instance === null )
+ {
+ self::getInstance();
+ }
+ return self::$instance->phpJsonEncode( $obj );
+ }
+
+
+ /*
+ * @author Michal Migurski <mike-json@teczno.com>
+ * @author Matt Knapp <mdknapp[at]gmail[dot]com>
+ * @author Brett Stimmerman <brettstimmerman[at]gmail[dot]com>
+ * @copyright 2005 Michal Migurski
+ * @license http://www.freebsd.org/copyright/freebsd-license.html
+ * @link http://pear.php.net/pepr/pepr-proposal-show.php?id=198
+ */
+ protected function phpJsonEncode( $var )
+ {
+ switch (gettype($var)) {
+ case 'boolean':
+ return $var ? 'true' : 'false';
+
+ case 'NULL':
+ return 'null';
+
+ case 'integer':
+ return sprintf('%d', $var);
+
+ case 'double':
+ case 'float':
+ return sprintf('%f', $var);
+
+ case 'string':
+ // STRINGS ARE EXPECTED TO BE IN ASCII OR UTF-8 FORMAT
+ $ascii = '';
+ $strlen_var = strlen($var);
+
+ /*
+ * Iterate over every character in the string,
+ * escaping with a slash or encoding to UTF-8 where necessary
+ */
+ for ($c = 0; $c < $strlen_var; ++$c) {
+
+ $ord_var_c = ord($var{$c});
+
+ switch ($ord_var_c) {
+ case 0x08: $ascii .= '\b'; break;
+ case 0x09: $ascii .= '\t'; break;
+ case 0x0A: $ascii .= '\n'; break;
+ case 0x0C: $ascii .= '\f'; break;
+ case 0x0D: $ascii .= '\r'; break;
+
+ case 0x22:
+ case 0x2F:
+ case 0x5C:
+ // double quote, slash, slosh
+ $ascii .= '\\'.$var{$c};
+ break;
+
+ case (($ord_var_c >= 0x20) && ($ord_var_c <= 0x7F)):
+ // characters U-00000000 - U-0000007F (same as ASCII)
+ $ascii .= $var{$c};
+ break;
+
+ case (($ord_var_c & 0xE0) == 0xC0):
+ // characters U-00000080 - U-000007FF, mask 110XXXXX
+ // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+ $char = pack('C*', $ord_var_c, ord($var{$c+1}));
+ $c+=1;
+ $utf16 = mb_convert_encoding($char, 'UTF-16', 'UTF-8');
+ $ascii .= sprintf('\u%04s', bin2hex($utf16));
+ break;
+
+ case (($ord_var_c & 0xF0) == 0xE0):
+ // characters U-00000800 - U-0000FFFF, mask 1110XXXX
+ // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+ $char = pack('C*', $ord_var_c,
+ ord($var{$c+1}),
+ ord($var{$c+2}));
+ $c+=2;
+ $utf16 = mb_convert_encoding($char, 'UTF-16', 'UTF-8');
+ $ascii .= sprintf('\u%04s', bin2hex($utf16));
+ break;
+
+ case (($ord_var_c & 0xF8) == 0xF0):
+ // characters U-00010000 - U-001FFFFF, mask 11110XXX
+ // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+ $char = pack('C*', $ord_var_c,
+ ord($var{$c+1}),
+ ord($var{$c+2}),
+ ord($var{$c+3}));
+ $c+=3;
+ $utf16 = mb_convert_encoding($char, 'UTF-16', 'UTF-8');
+ $ascii .= sprintf('\u%04s', bin2hex($utf16));
+ break;
+
+ case (($ord_var_c & 0xFC) == 0xF8):
+ // characters U-00200000 - U-03FFFFFF, mask 111110XX
+ // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+ $char = pack('C*', $ord_var_c,
+ ord($var{$c+1}),
+ ord($var{$c+2}),
+ ord($var{$c+3}),
+ ord($var{$c+4}));
+ $c+=4;
+ $utf16 = mb_convert_encoding($char, 'UTF-16', 'UTF-8');
+ $ascii .= sprintf('\u%04s', bin2hex($utf16));
+ break;
+
+ case (($ord_var_c & 0xFE) == 0xFC):
+ // characters U-04000000 - U-7FFFFFFF, mask 1111110X
+ // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+ $char = pack('C*', $ord_var_c,
+ ord($var{$c+1}),
+ ord($var{$c+2}),
+ ord($var{$c+3}),
+ ord($var{$c+4}),
+ ord($var{$c+5}));
+ $c+=5;
+ $utf16 = mb_convert_encoding($char, 'UTF-16', 'UTF-8');
+ $ascii .= sprintf('\u%04s', bin2hex($utf16));
+ break;
+ }
+ }
+
+ return '"'.$ascii.'"';
+
+ case 'array':
+ /*
+ * As per JSON spec if any array key is not an integer
+ * we must treat the the whole array as an object. We
+ * also try to catch a sparsely populated associative
+ * array with numeric keys here because some JS engines
+ * will create an array with empty indexes up to
+ * max_index which can cause memory issues and because
+ * the keys, which may be relevant, will be remapped
+ * otherwise.
+ *
+ * As per the ECMA and JSON specification an object may
+ * have any string as a property. Unfortunately due to
+ * a hole in the ECMA specification if the key is a
+ * ECMA reserved word or starts with a digit the
+ * parameter is only accessible using ECMAScript's
+ * bracket notation.
+ */
+
+ // treat as a JSON object
+ if (is_array($var) && count($var) && (array_keys($var) !== range(0, sizeof($var) - 1))) {
+ return sprintf('{%s}', join(',', array_map(array($this, 'phpJsonEncodeNameValue'),
+ array_keys($var),
+ array_values($var))));
+ }
+
+ // treat it like a regular array
+ return sprintf('[%s]', join(',', array_map(array($this, 'phpJsonEncode'), $var)));
+
+ case 'object':
+ $vars = get_object_vars($var);
+ return sprintf('{%s}', join(',', array_map(array($this, 'phpJsonEncodeNameValue'),
+ array_keys($vars),
+ array_values($vars))));
+
+ default:
+ return '';
+ }
+ }
+
+ /** function name_value
+ * array-walking function for use in generating JSON-formatted name-value pairs
+ *
+ * @param string $name name of key to use
+ * @param mixed $value reference to an array element to be encoded
+ *
+ * @return string JSON-formatted name-value pair, like '"name":value'
+ * @access private
+ */
+ protected function phpJsonEncodeNameValue($name, $value)
+ {
+ return (sprintf("%s:%s", $this->phpJsonEncode(strval($name)), $this->phpJsonEncode($value)));
+ }
+}
+
+?>
BIN design/standard/images/ezdhtml/anchor.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN design/standard/images/ezdhtml/anchor_image.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN design/standard/images/ezdhtml/bold.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN design/standard/images/ezdhtml/bullist.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN design/standard/images/ezdhtml/center.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN design/standard/images/ezdhtml/copy.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN design/standard/images/ezdhtml/customtag.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN design/standard/images/ezdhtml/customtag_insert.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN design/standard/images/ezdhtml/cut.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN design/standard/images/ezdhtml/delcol.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN design/standard/images/ezdhtml/delrow.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN design/standard/images/ezdhtml/ezicon.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN design/standard/images/ezdhtml/file.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN design/standard/images/ezdhtml/find.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN design/standard/images/ezdhtml/form.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN design/standard/images/ezdhtml/help.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN design/standard/images/ezdhtml/image.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN design/standard/images/ezdhtml/indent.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN design/standard/images/ezdhtml/inscol.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN design/standard/images/ezdhtml/insrow.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN design/standard/images/ezdhtml/italic.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN design/standard/images/ezdhtml/link.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN design/standard/images/ezdhtml/literal.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN design/standard/images/ezdhtml/media.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN design/standard/images/ezdhtml/mergecell.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN design/standard/images/ezdhtml/mrgcell.gif
Diff not rendered.
BIN design/standard/images/ezdhtml/numlist.gif
Diff not rendered.
BIN design/standard/images/ezdhtml/object.gif
Diff not rendered.
BIN design/standard/images/ezdhtml/object_insert.gif
Diff not rendered.
BIN design/standard/images/ezdhtml/object_insert.png
Diff not rendered.
BIN design/standard/images/ezdhtml/objectimage.gif
Diff not rendered.
BIN design/standard/images/ezdhtml/paste.gif
Diff not rendered.
BIN design/standard/images/ezdhtml/redo.gif
Diff not rendered.
BIN design/standard/images/ezdhtml/reduce_indent.gif
Diff not rendered.
BIN design/standard/images/ezdhtml/special.gif
Diff not rendered.
BIN design/standard/images/ezdhtml/splitcell.gif
Diff not rendered.
BIN design/standard/images/ezdhtml/spltcell.gif
Diff not rendered.
BIN design/standard/images/ezdhtml/strike.gif
Diff not rendered.
BIN design/standard/images/ezdhtml/table.gif
Diff not rendered.
BIN design/standard/images/ezdhtml/underline.gif
Diff not rendered.
BIN design/standard/images/ezdhtml/undo.gif
Diff not rendered.
93 design/standard/javascript/classes/AddOnManager.js
@@ -0,0 +1,93 @@
+/**
+ * $Id: PluginManager.js 352 2007-11-05 17:03:49Z spocke $
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
+ */
+
+(function() {
+ var Dispatcher = tinymce.util.Dispatcher, each = tinymce.each;
+
+ /**#@+
+ * @class This class handles the loading of themes/plugins or other add-ons and their language packs.
+ * @member tinymce.AddOnManager
+ */
+ tinymce.create('tinymce.AddOnManager', {
+ items : [],
+ urls : {},
+ lookup : {},
+ onAdd : new Dispatcher(this),
+
+ /**#@+
+ * @method
+ */
+
+ /**
+ * Returns the specified add on by the short name.
+ *
+ * @param {String} n Add-on to look for.
+ * @return {tinymce.Theme/tinymce.Plugin} Theme or plugin add-on instance or undefined.
+ */
+ get : function(n) {
+ return this.lookup[n];
+ },
+
+ /**
+ * Loads a language pack for the specified add-on.
+ *
+ * @param {String} n Short name of the add-on.
+ */
+ requireLangPack : function(n) {
+ var u, s;
+
+ if (tinymce.EditorManager.settings) {
+ u = this.urls[n] + '/langs/' + tinymce.EditorManager.settings.language + '.js';
+ s = tinymce.EditorManager.settings;
+
+ if (s) {
+ if (!tinymce.dom.Event.domLoaded && !s.strict_mode)
+ tinymce.ScriptLoader.load(u);
+ else
+ tinymce.ScriptLoader.add(u);
+ }
+ }
+ },
+
+ /**
+ * Adds a instance of the add-on by it's short name.
+ *
+ * @param {String} id Short name/id for the add-on.
+ * @param {tinymce.Theme/tinymce.Plugin} o Theme or plugin to add.
+ * @return {tinymce.Theme/tinymce.Plugin} The same theme or plugin instance that got passed in.
+ */
+ add : function(id, o) {
+ this.items.push(o);
+ this.lookup[id] = o;
+ this.onAdd.dispatch(this, id, o);
+
+ return o;
+ },
+
+ /**
+ * Loads an add-on from a specific url.
+ *
+ * @param {String} n Short name of the add-on that gets loaded.
+ * @param {String} u URL to the add-on that will get loaded.
+ * @param {function} cb Optional callback to execute ones the add-on is loaded.
+ * @param {Object} s Optional scope to execute the callback in.
+ */
+ load : function(n, u, cb, s) {
+ if (u.indexOf('/') != 0 && u.indexOf('://') == -1)
+ u = tinymce.baseURL + '/' + u;
+
+ this.urls[n] = u.substring(0, u.lastIndexOf('/'));
+ tinymce.ScriptLoader.add(u, cb, s);
+ }
+
+ /**#@-*/
+ });
+
+ // Create plugin and theme managers
+ tinymce.PluginManager = new tinymce.AddOnManager();
+ tinymce.ThemeManager = new tinymce.AddOnManager();
+}());
425 design/standard/javascript/classes/ControlManager.js
@@ -0,0 +1,425 @@
+/**
+ * $Id: ControlManager.js 663 2008-03-03 17:39:17Z spocke $
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
+ */
+
+(function() {
+ // Shorten names
+ var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, extend = tinymce.extend;
+
+ /**#@+
+ * @class This class is responsible for managing UI control instances. It's both a factory and a collection for the controls.
+ * @member tinymce.ControlManager
+ */
+ tinymce.create('tinymce.ControlManager', {
+ /**
+ * Constructs a new control manager instance.
+ * Consult the Wiki for more details on this class.
+ *
+ * @constructor
+ * @param {tinymce.Editor} ed TinyMCE editor instance to add the control to.
+ * @param {Object} s Optional settings object for the control manager.
+ */
+ ControlManager : function(ed, s) {
+ var t = this, i;
+
+ s = s || {};
+ t.editor = ed;
+ t.controls = {};
+ t.onAdd = new tinymce.util.Dispatcher(t);
+ t.onPostRender = new tinymce.util.Dispatcher(t);
+ t.prefix = s.prefix || ed.id + '_';
+
+ t.onPostRender.add(function() {
+ each(t.controls, function(c) {
+ c.postRender();
+ });
+ });
+ },
+
+ /**#@+
+ * @method
+ */
+
+ /**
+ * Returns a control by id or undefined it it wasn't found.
+ *
+ * @param {String} id Control instance name.
+ * @return {tinymce.ui.Control} Control instance or undefined.
+ */
+ get : function(id) {
+ return this.controls[this.prefix + id] || this.controls[id];
+ },
+
+ /**
+ * Sets the active state of a control by id.
+ *
+ * @param {String} id Control id to set state on.
+ * @param {bool} s Active state true/false.
+ * @return {tinymce.ui.Control} Control instance that got activated or null if it wasn't found.
+ */
+ setActive : function(id, s) {
+ var c = null;
+
+ if (c = this.get(id))
+ c.setActive(s);
+
+ return c;
+ },
+
+ /**
+ * Sets the dsiabled state of a control by id.
+ *
+ * @param {String} id Control id to set state on.
+ * @param {bool} s Active state true/false.
+ * @return {tinymce.ui.Control} Control instance that got disabled or null if it wasn't found.
+ */
+ setDisabled : function(id, s) {
+ var c = null;
+
+ if (c = this.get(id))
+ c.setDisabled(s);
+
+ return c;
+ },
+
+ /**
+ * Adds a control to the control collection inside the manager.
+ *
+ * @param {tinymce.ui.Control} Control instance to add to collection.
+ * @return {tinymce.ui.Control} Control instance that got passed in.
+ */
+ add : function(c) {
+ var t = this;
+
+ if (c) {
+ t.controls[c.id] = c;
+ t.onAdd.dispatch(c, t);
+ }
+
+ return c;
+ },
+
+ /**
+ * Creates a control by name, when a control is created it will automatically add it to the control collection.
+ * It first ask all plugins for the specified control if the plugins didn't return a control then the default behavior
+ * will be used.
+ *
+ * @param {String} n Control name to create for example "separator".
+ * @return {tinymce.ui.Control} Control instance that got created and added.
+ */
+ createControl : function(n) {
+ var c, t = this, ed = t.editor;
+
+ each(ed.plugins, function(p) {
+ if (p.createControl) {
+ c = p.createControl(n, t);
+
+ if (c)
+ return false;
+ }
+ });
+
+ switch (n) {
+ case "|":
+ case "separator":
+ return t.createSeparator();
+ }
+
+ if (!c && ed.buttons && (c = ed.buttons[n]))
+ return t.createButton(n, c);
+
+ return t.add(c);
+ },
+
+ /**
+ * Creates a drop menu control instance by id.
+ *
+ * @param {String} id Unique id for the new dropdown instance. For example "some menu".
+ * @param {Object} s Optional settings object for the control.
+ * @return {tinymce.ui.Control} Control instance that got created and added.
+ */
+ createDropMenu : function(id, s) {
+ var t = this, ed = t.editor, c, bm, v;
+
+ s = extend({
+ 'class' : 'mceDropDown',
+ constrain : ed.settings.constrain_menus
+ }, s);
+
+ s['class'] = s['class'] + ' ' + ed.getParam('skin') + 'Skin';
+ if (v = ed.getParam('skin_variant'))
+ s['class'] += ' ' + ed.getParam('skin') + 'Skin' + v.substring(0, 1).toUpperCase() + v.substring(1);
+
+ id = t.prefix + id;
+ c = t.controls[id] = new tinymce.ui.DropMenu(id, s);
+ c.onAddItem.add(function(c, o) {
+ var s = o.settings;
+
+ s.title = ed.getLang(s.title, s.title);
+
+ if (!s.onclick) {
+ s.onclick = function(v) {
+ ed.execCommand(s.cmd, s.ui || false, s.value);
+ };
+ }
+ });
+
+ ed.onRemove.add(function() {
+ c.destroy();
+ });
+
+ // Fix for bug #1897785, #1898007
+ if (tinymce.isIE) {
+ c.onShowMenu.add(function() {
+ var s = ed.selection, n = s.getNode();
+
+ if (n.nodeName == 'IMG')
+ bm = s.getBookmark();
+ else
+ bm = 0;
+ });
+
+ c.onHideMenu.add(function() {
+ if (bm)
+ ed.selection.moveToBookmark(bm);
+ });
+ }
+
+ return t.add(c);
+ },
+
+ /**
+ * Creates a list box control instance by id. A list box is either a native select element or a DOM/JS based list box control. This
+ * depends on the use_native_selects settings state.
+ *
+ * @param {String} id Unique id for the new listbox instance. For example "styles".
+ * @param {Object} s Optional settings object for the control.
+ * @return {tinymce.ui.Control} Control instance that got created and added.
+ */
+ createListBox : function(id, s) {
+ var t = this, ed = t.editor, cmd, c;
+
+ if (t.get(id))
+ return null;
+
+ s.title = ed.translate(s.title);
+ s.scope = s.scope || ed;
+
+ if (!s.onselect) {
+ s.onselect = function(v) {
+ ed.execCommand(s.cmd, s.ui || false, v || s.value);
+ };
+ }
+
+ s = extend({
+ title : s.title,
+ 'class' : 'mce_' + id,
+ scope : s.scope,
+ control_manager : t
+ }, s);
+
+ id = t.prefix + id;
+
+ if (ed.settings.use_native_selects)
+ c = new tinymce.ui.NativeListBox(id, s);
+ else
+ c = new tinymce.ui.ListBox(id, s);
+
+ t.controls[id] = c;
+
+ // Fix focus problem in Safari
+ if (tinymce.isWebKit) {
+ c.onPostRender.add(function(c, n) {
+ // Store bookmark on mousedown
+ Event.add(n, 'mousedown', function() {
+ ed.bookmark = ed.selection.getBookmark('simple');
+ });
+
+ // Restore on focus, since it might be lost
+ Event.add(n, 'focus', function() {
+ ed.selection.moveToBookmark(ed.bookmark);
+ ed.bookmark = null;
+ });
+ });
+ }
+
+ if (c.hideMenu)
+ ed.onMouseDown.add(c.hideMenu, c);
+
+ return t.add(c);
+ },
+
+ /**
+ * Creates a button control instance by id.
+ *
+ * @param {String} id Unique id for the new button instance. For example "bold".
+ * @param {Object} s Optional settings object for the control.
+ * @return {tinymce.ui.Control} Control instance that got created and added.
+ */
+ createButton : function(id, s) {
+ var t = this, ed = t.editor, o, c;
+
+ if (t.get(id))
+ return null;
+
+ s.title = ed.translate(s.title);
+ s.scope = s.scope || ed;
+
+ if (!s.onclick && !s.menu_button) {
+ s.onclick = function() {
+ ed.execCommand(s.cmd, s.ui || false, s.value);
+ };
+ }
+
+ s = extend({
+ title : s.title,
+ 'class' : 'mce_' + id,
+ unavailable_prefix : ed.getLang('unavailable', ''),
+ scope : s.scope,
+ control_manager : t
+ }, s);
+
+ id = t.prefix + id;
+
+ if (s.menu_button) {
+ c = new tinymce.ui.MenuButton(id, s);
+ ed.onMouseDown.add(c.hideMenu, c);
+ } else
+ c = new tinymce.ui.Button(id, s);
+
+ return t.add(c);
+ },
+
+ /**
+ * Creates a menu button control instance by id.
+ *
+ * @param {String} id Unique id for the new menu button instance. For example "menu1".
+ * @param {Object} s Optional settings object for the control.
+ * @return {tinymce.ui.Control} Control instance that got created and added.
+ */
+ createMenuButton : function(id, s) {
+ s = s || {};
+ s.menu_button = 1;
+
+ return this.createButton(id, s);
+ },
+
+ /**
+ * Creates a split button control instance by id.
+ *
+ * @param {String} id Unique id for the new split button instance. For example "spellchecker".
+ * @param {Object} s Optional settings object for the control.
+ * @return {tinymce.ui.Control} Control instance that got created and added.
+ */
+ createSplitButton : function(id, s) {
+ var t = this, ed = t.editor, cmd, c;
+
+ if (t.get(id))
+ return null;
+
+ s.title = ed.translate(s.title);
+ s.scope = s.scope || ed;
+
+ if (!s.onclick) {
+ s.onclick = function(v) {
+ ed.execCommand(s.cmd, s.ui || false, v || s.value);
+ };
+ }
+
+ if (!s.onselect) {
+ s.onselect = function(v) {
+ ed.execCommand(s.cmd, s.ui || false, v || s.value);
+ };
+ }
+
+ s = extend({
+ title : s.title,
+ 'class' : 'mce_' + id,
+ scope : s.scope,
+ control_manager : t
+ }, s);
+
+ id = t.prefix + id;