tinymce,кое какие траблы...

Главные вкладки

Аватар пользователя MrAnderson MrAnderson 29 июня 2008 в 22:49

Здраствуйте!
У меня такая проблема скачал модуль tinymce для 5 друпала,закинул в modules,врубил сам модуль на сайте...но почему-то пизнаков работы его не вижу...не в комментариях,не в ответах над сообщением нету tinymce панели...в чём проблема...мб я что нить напорол...
PS зарание спасибо!

Комментарии

Аватар пользователя Ильич Рамирес Санчес Ильич Рамирес Санчес 29 июня 2008 в 23:54

в template.php в шаблоне добавить коду
<?php
function phptemplate_tinymce_theme($init, $textarea_name, $theme_name, $is_running) {
static $access, $integrated;
$init = theme_tinymce_theme($init, $textarea_name, $theme_name, $is_running);
switch ($textarea_name) {
// Disable tinymce for these textareas
case 'log': // book and page log
case 'img_assist_pages':
case 'caption': // signature
case 'pages':
case 'access_pages': //TinyMCE profile settings.
case 'user_mail_welcome_body': // user config settings
case 'user_mail_approval_body': // user config settings
case 'user_mail_pass_body': // user config settings
case 'synonyms': // taxonomy terms
case 'description': // taxonomy terms
unset($init);
break;
case 'signature':
case 'site_mission':
case 'site_footer':
case 'site_offline_message':
case 'page_help':
case 'user_registration_help':
case 'user_picture_guidelines':
$init['theme'] = 'simple';
foreach ($init as $k => $v) {
if (strstr($k, 'theme_advanced_')) unset($init[$k]);
}
break;
case 'teaser':
$init['height'] = '150px';
}
//$init['theme'] = 'advanced';
if (!isset($access)) {
$access = user_access('access imce');
}
if ($init && $access) {
$init['file_browser_callback'] = 'imceImageBrowser';
if (!isset($integrated)) {
$integrated = TRUE;
drupal_add_js("
function imceImageBrowser(field_name, url, type, win) {
tinyOpenerWin = win, tinyTargetField = field_name;
if (typeof tinyImceWin == 'undefined' || tinyImceWin.closed) {
tinyImceWin = window.open(Drupal.settings.basePath +'?q=imce', '', 'width=760,height=560,resizable=1');
tinyImceWin['imceOnLoad'] = function () {
tinyImceWin.imce.highlight(url.substr(url.lastIndexOf('/')+1));
tinyImceWin.imce.setSendTo(Drupal.t('Send to app', {'app': 'TinyMCE'}), function(file) {
window.focus();
tinyOpenerWin.focus();
$('#width', tinyOpenerWin.document).val(file.width);
$('#height', tinyOpenerWin.document).val(file.height);
$('#'+ tinyTargetField, tinyOpenerWin.document).val(file.url).focus();
});
$(window).unload(function() {if (tinyImceWin && !tinyImceWin.closed) tinyImceWin.close();});
}
}
else {
tinyImceWin.imce.highlight(url.substr(url.lastIndexOf('/')+1));
}
tinyImceWin.focus();
}
", 'inline');
}
}
return $init;
}

?>
[/code]
С разрешениями на разные типы компонентов редактирования на свой вкус