Major Feature #1708
Class for usage in FE-Plugins
| Status: | Closed | Start date: | 2008-10-14 | |
|---|---|---|---|---|
| Priority: | Should have | Due date: | ||
| Assignee: | Thomas Allmer | % Done: | 100% |
|
| Category: | v1.0 | |||
| Target version: | - | |||
| Votes: | 0 |
Description
I need a class to use this rte in FE-plugins, similar to the pi2 of htmlArea RTE. There is more information in this document:
History
Updated by Thomas Allmer over 4 years ago
- Category set to v1.2
- Status changed from New to Accepted
Schwemer Marcus wrote:
I need a class to use this rte in FE-plugins, similar to the pi2 of htmlArea RTE. There is more information in this document: http://typo3.org/documentation/document-library/extension-manuals/rtehtmlarea_api_manual/1.7.4/view/5/1/
marked as 1.2 Features.
PS: generally said if you want to see a features faster you could sponsor it.
Updated by Thomas Allmer over 4 years ago
- Priority changed from Must have to Won't have this time
Updated by Peter Klein over 4 years ago
A little note:
If you are going to implement this feature, it might be an idea to look at Stefan Galinski's implementation of TinyMCE.
http://typo3.org/extensions/repository/view/tinymce/current/
It has an API for use in FE, which should be easy to port to your version of TinyMCE.
--
Peter Klein
Updated by Marcus Schwemer over 4 years ago
Thomas Allmer wrote:
Schwemer Marcus wrote:
I need a class to use this rte in FE-plugins, similar to the pi2 of htmlArea RTE. There is more information in this document: http://typo3.org/documentation/document-library/extension-manuals/rtehtmlarea_api_manual/1.7.4/view/5/1/
marked as 1.2 Features.
PS: generally said if you want to see a features faster you could sponsor it.
The class is nearly ready. It needs just some more testing ny me and a small feature. :-)
I will post add it here in a couple of days.
Just to make sure that there is no double work done.
Updated by Marcus Schwemer over 4 years ago
- File class.tx_tinymcerte_pi1.php added
Marcus Schwemer wrote:
I need a class to use this rte in FE-plugins, similar to the pi2 of htmlArea RTE. There is more information in this document:
Here is the current version.
I used the same function call like rtehtmlarea_pi2 to make as easy as possible for extension authors to provide access to both rtes. The only thing is to test whether tinymce_rte is loaded or not. If yes, require the class and make an instance of it. Example:
// setup RTE if enabled
if(!$this->RTEObj && $this->conf['RTEenabled'] && t3lib_extMgm::isLoaded('rtehtmlarea')) {
require_once(t3lib_extMgm::extPath('rtehtmlarea').'pi2/class.tx_rtehtmlarea_pi2.php');
$this->RTEObj = t3lib_div::makeInstance('tx_rtehtmlarea_pi2');
} elseif (!$this->RTEObj && $this->conf['RTEenabled'] && t3lib_extMgm::isLoaded('tinymce_rte')) {
require_once(t3lib_extMgm::extPath('tinymce_rte').'pi1/class.tx_tinymcerte_pi1.php');
$this->RTEObj = t3lib_div::makeInstance('tx_tinymcerte_pi1');
} else {
$this->RTEObj = 0;
}
You can configure it via PageTS and TS-Setup. First the default-PageTS is loaded, then the values from "RTE.default.FE.init" and then the TSSetup configuration. Each extension using it, can configure it. The configuration is done in "plugin.tx_myext_piX.tinymce_rte.init" using the same format like PageTS. The arrays are merged in this order.
If you like, I can provide a test page with a modified wec_discussion.
Updated by Peter Klein over 4 years ago
Marcus Schwemer wrote:
Here is the current version.
Great work. I noticed a few modifications that is required in order to get it to work with 0.0.9+
1) The language code should be processed similar to the code listed here (used in 0.0.9+):
See: http://forge.typo3.org/issues/show/1707#note-3
2) The "$this->parseConfig($config)" part must not be enclosed in curly brackets.
See: http://forge.typo3.org/issues/show/1749#note-2
--
Peter
Updated by Marcus Schwemer over 4 years ago
- File class.tx_tinymcerte_pi1.php added
Peter Klein wrote:
1) The language code should be processed similar to the code listed here (used in 0.0.9+): See: http://forge.typo3.org/issues/show/1707#note-3
2) The "$this->parseConfig($config)" part must not be enclosed in curly brackets. See: http://forge.typo3.org/issues/show/1749#note-2
Thanks for your hints. I updated the file accordingly. It is attached.
Updated by Peter Klein over 4 years ago
Another thing that should be done, is making the inline Javascript's XHTML compatible.
Basically you just need to wrap the javascript part in some pseudo/comment tags, like this:
<script type="text/javascript"> /* <![CDATA[ */ // content of your Javascript goes here /* ]]> */ </script>
A good explanation on why, can be found here:
http://javascript.about.com/library/blxhtml.htm
(Maybe it's a good idea to do the same for the BE javascript's, but since the BE is not XHTML valid anyway it's not that important as the FE)
--
Peter
Updated by Marcus Schwemer over 4 years ago
- File class.tx_tinymcerte_pi1.php added
Peter Klein wrote:
Another thing that should be done, is making the inline Javascript's XHTML compatible. Basically you just need to wrap the javascript part in some pseudo/comment tags, like this:
Done. :-)
Other things that changed:
- fixed XCLASS statement
- added some phpdoc comments to functions
- removed left-over code
Updated by Marcus Schwemer over 4 years ago
- File class.tx_tinymcerte_pi1.php added
Some little improvements:
- use TYPO3 functions to get location of js- and lang-files
- code cleanup for readability
Would be happy to see this in one of the next releases. :-)
Marcus
Updated by Thomas Allmer over 4 years ago
- Category changed from v1.2 to v1.0
- Assignee set to Thomas Allmer
- Priority changed from Won't have this time to Should have
- % Done changed from 0 to 50
Marcus Schwemer wrote:
Would be happy to see this in one of the next releases. :-)
hey,
sorry for not participating in this discussion so far.
It's really great what you put up there and some sort of this code will be released within the next version.
Although I think there are a few things that could be solved cleaner, but this also would include some changes to the main class...
so if you want you could get the latest svn version modify all you need and give us a patch/diff.
I suppose you already have a extension using this code...
if you could provide it as a zip/tar whatever that would be great.
We will also create a testinstallation for people who just want to try tinymce_rte.
if we could include a FE use of it that would be great :)
again thx for your efforts.
Updated by Marcus Schwemer over 4 years ago
- File feature_1708-v0.2.diff added
- File feature_1708_example_wec_discussion-v0.1.diff added
Thomas Allmer wrote:
sorry for not participating in this discussion so far.
No problem.
It's really great what you put up there and some sort of this code will be released within the next version.
Thanks.
Although I think there are a few things that could be solved cleaner, but this also would include some changes to the main class...
What are you thinking about?
so if you want you could get the latest svn version modify all you need and give us a patch/diff.
It is attached. It includes the file contents of the previous file(s) and a default configuration for "RTE.default.FE.init" to "static/pageTSConfig.ts".
I suppose you already have a extension using this code...
I patched trunk of wec_discussion. But these are just a few lines of code, like I wrote some postings above. I attach the patch too.
Updated by Marcus Schwemer over 4 years ago
Here is a test for the current version:
Updated by Thomas Allmer over 4 years ago
- Status changed from Accepted to Resolved
- % Done changed from 50 to 100
Marcus Schwemer wrote:
Thomas Allmer wrote:
Although I think there are a few things that could be solved cleaner, but this also would include some changes to the main class...
What are you thinking about?
as it turned out there was a way easier solution than I thought...
in short, just copy the whole RTE.default to RTE.default.FE and call the drawRTE class with this config.
it needed a few changes in the base class but works great, and so if we change anything in the main class we don't have to change it in the FE class
again thx for you efforts you brought me on the right track :)
I also used your diff on the wec_dicussion.
There will be a FE function in the next version, if you may want to try it out see the latest svn version.
If you need any additional options for the FE feel free to comment.
Updated by Thomas Allmer over 4 years ago
- Status changed from Resolved to Closed