Hi all. I have defined a profile into "tinymce settings" called "newsimple". I want link it with some textarea.
I know that there is some type of "hook" |phptemplate_tinymce_theme()|:
function phptemplate_tinymce_theme($init, $textarea_name, $theme_name, $is_running) { dpm("Textarea: $textarea_name"); switch ($textarea_name) { case 'comment': case 'message': case 'log': //Segnalazione problema manuale case 'submitted-segnalazione-testo': case 'access-page': unset($init); break; default: break; }
//Descrizione manuale. if (arg(0) == 'node' && arg(1) == 'add' && (arg(2) == 'manuali-file' || arg(2) == 'manuali-link') && $textarea_name == 'body') { //unset($init); $init['theme'] = 'newsimple'; foreach ($init as $k => $v) { if (strstr($k, 'theme_advanced_')) unset($init[$k]); } } dpr($init); return $init; }
This code come from Drupal,org, but does not works: it's like that the 'newsimple' theme is not found from this function so no tinymce is displayed. Where is my error ?
Tnx M.
Some print/drupal_set_message() debug statements would verify this. But my function is named
Function nameofyourtheme_tinymce_theme.
Dave
________________________________
From: support-bounces@drupal.org [mailto:support-bounces@drupal.org] On Behalf Of Davide Michel 'ZioBudda' Morelli Sent: Thursday, January 10, 2008 8:57 AM To: support@drupal.org Subject: [support] Definy theme for tinymce textarea.
Hi all. I have defined a profile into "tinymce settings" called "newsimple". I want link it with some textarea.
I know that there is some type of "hook" phptemplate_tinymce_theme():
function phptemplate_tinymce_theme($init, $textarea_name, $theme_name, $is_running) { dpm("Textarea: $textarea_name"); switch ($textarea_name) { case 'comment': case 'message': case 'log': //Segnalazione problema manuale case 'submitted-segnalazione-testo': case 'access-page': unset($init); break; default: break; }
//Descrizione manuale. if (arg(0) == 'node' && arg(1) == 'add' && (arg(2) == 'manuali-file' || arg(2) == 'manuali-link') && $textarea_name == 'body') { //unset($init); $init['theme'] = 'newsimple'; foreach ($init as $k => $v) { if (strstr($k, 'theme_advanced_')) unset($init[$k]); } } dpr($init); return $init; }
This code come from Drupal,org, but does not works: it's like that the 'newsimple' theme is not found from this function so no tinymce is displayed. Where is my error ?
Tnx M.
Metzler, David ha scritto:
Some print/drupal_set_message() debug statements would verify this. But my function is named
Function nameofyourtheme_tinymce_theme.
Wait, my phptemplate_tinymce_theme() function works: I can unset the tinymce for some textarea like 'comment' or 'log' . I want to know how to set which profile use for the 'log' textarea (for example)
M.