I somehow can't get tinymce into calendar the way I want to... And Christophs Wiki explanation is not fully understandable by me
- Code: Select all
init_editor(array('description'),'minimal');
svasti
init_editor(array('description'),'minimal');svasti wrote: And Christophs Wiki explanation is not fully understandable by me
svasti wrote:as calendar needs a very specific configuration (actually even two) together with a special skin.
include_once($pth['folder']['plugins'].'tinymce/init.php');
include_tinymce();
tinymce_filebrowser();
$config = '...';
tinymce_replace('CALENDAREDITOR-ID');
include_once($pth['folder']['plugins'].'tinymce/init.php');
init_tinymce(array('CALENDAREDITOR_CLASS'), 'calendar');
what about a CMSimple-academy? Just 1 week of learning the whole stuff? We all come and visit youcmb wrote:I hope these explanations somewhat clarify things.
init_editor(array('CLASSNAME'));svasti wrote:and calling the textareas by ID is kind of unpractical in my case
svasti wrote:what about a CMSimple-academy?
cmb wrote:Well, even that could be done without too much additional work. You might have a look at plugins/tinymce/init.js tinyMCE_instantiateByClasses(). That's basically what does the trick. And it even works, if the textareas have no IDs at all -- they're given a unique ID dynamically!
Why? You need in both cases a <textarea> and, if you need more than one editor at the page, unique selectors.svasti wrote:and calling the textareas by ID is kind of unpractical in my case, so I'd rather avoid that
'<textarea name="some_name" class="some_class ....">' . htmlspecialchars($some_content). '</textarea>'; '<textarea name="some_name" id="some_id" ....">' . htmlspecialchars($some_content). '</textarea>'; function init_editor($ids = array(), $config = false) '<textarea id="some_id" name="some_name" class="some_class ....">' . htmlspecialchars($some_content). '</textarea>'; Holger wrote:I've talked about that with Christoph and we've discussed if it would be a good idea to provide that code.
Holger wrote:But I really not see an advantage to initialize the editor by classes (and I'm happy that the default id "text" is still in the core ).
Holger wrote:what's the secret behind function editor_replace($elementID = false, $config = '')?
Holger wrote:So init_editor() will always create a working editor and $config only contains those settings, the plugin wants to overwrite.
function editor_test(){
$html = '<form>
<textarea id="my_id_1" name="my_teaser">Guten Tag!</textarea>
<textarea id="my_id_2" name="my_content">I need a fullblown editor</textarea>
</form>';
include_editor();
$html .= editor_replace('my_id_1');
$html .= editor_replace('my_id_2', 'theme : "advanced",
theme_advanced_toolbar_location : "top"');
return $html;
} Martin wrote:But still, you do not have to spread your editor configuration files to the plugins/<editors>/inits-folder.
Christoph wrote:Perhaps init_editor()'s specification should be slightly extended to allow a full path for $config. This way the plugin could keep the config in it's own folder.
Christoph wrote:Unfortunately it's not possible to call tinyMCE.init() more than once with different settings (at least not by ready() handlers). This was recognized while Gert developed the current version of Realblog_XH. It was not possible to have separate configs for the editors of the teaser resp. the full blog entry. To make this possible, we had to use tinymce.Editor().render(), what requires the textarea's ID. So I came up with the *_initializeByClasses() function (besides some further changes to avoid clashes, if the initialization is called more than once).
function editor_test_2()
{
$html = '<form>
<textarea id="my_teaser" name="my_teaser" class="my_teaser_class">Guten Tag!</textarea>
<textarea id="my_content" name="my_content" class="my_content_class">I need a fullblown editor</textarea>
</form>';
init_editor(array('my_teaser_class'), 'minimal');
init_editor(array('my_content_class'), 'full');
return $html;
} Users browsing this forum: No registered users and 2 guests