1
0
mirror of https://github.com/e107inc/e107.git synced 2025-02-13 11:04:38 +01:00

105 lines
2.4 KiB
PHP
Raw Normal View History

2006-12-22 18:45:32 +00:00
<?php
/*
2009-11-17 10:46:35 +00:00
* e107 website system
*
2009-11-18 01:06:08 +00:00
* Copyright (C) 2008-2009 e107 Inc (e107.org)
2009-11-17 10:46:35 +00:00
* Released under the terms and conditions of the
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
*
*
*
2011-06-07 12:57:55 +00:00
* $URL$
* $Id$
2009-11-17 10:46:35 +00:00
*/
2006-12-22 18:45:32 +00:00
if (!defined('e107_INIT')) { exit; }
2012-04-30 20:35:59 +00:00
if(e_WYSIWYG || strpos(e_SELF,"tinymce/admin_config.php") )
2006-12-22 18:45:32 +00:00
{
if(e_PAGE != 'image.php')
{
e107::js('tinymce','tiny_mce.js','jquery');
2012-08-11 05:00:50 +00:00
e107::js('tinymce','wysiwyg.php','jquery',5);
}
else
{
e107::js('tinymce','tiny_mce_popup.js','jquery');
}
// <div><a href='#' class='e-wysiwyg-switch' onclick=\"tinyMCE.execCommand('mceToggleEditor',false,'".$tinyMceID."');expandit('".$toggleID."');\">Toggle WYSIWYG</a></div>
e107::js('inline',"
$(function() {
$('.e-wysiwyg').each(function() {
var id = $(this).attr('id'); // 'e-wysiwyg';
$('#'+id).after('<div><a href=\"#\" id=\"' + id + '\" class=\"e-wysiwyg-toggle\">Switch to BBCODE</a></div>');
// alert(id);
2012-06-09 04:42:32 +00:00
$('#bbcode-panel-'+id+'--preview').hide();
});
2012-08-11 05:00:50 +00:00
$('.e-wysiwyg').live('click',function(){
var id = $(this).attr('id'); // eg. news-body
$('#bbcode-panel-'+id+'--preview').hide();
$('#'+id).after('<div><a href=\"#\" id=\"' + id + '\" class=\"e-wysiwyg-toggle\">Switch to BBCODE</a></div>');
tinyMCE.execCommand('mceAddControl', false, id);
});
$('a.e-wysiwyg-toggle').toggle(function(){
var id = $(this).attr('id'); // eg. news-body
2012-06-09 04:42:32 +00:00
$('#bbcode-panel-'+id+'--preview').show();
$(this).text('Switch to WYSIWYG');
tinyMCE.execCommand('mceRemoveControl', false, id);
}, function () {
var id = $(this).attr('id');
2012-06-09 04:42:32 +00:00
$('#bbcode-panel-'+id+'--preview').hide();
$(this).text('Switch to BBCODE');
tinyMCE.execCommand('mceAddControl', false, id);
});
$('.e-dialog-save').click(function(){
var html = $('#html_holder').val();
// tinyMCE.execCommand('mceInsertContent',false,html);
tinyMCE.execCommand('mceInsertRawHTML',false,html);
tinyMCEPopup.close();
});
2012-08-11 05:00:50 +00:00
});
","jquery");
e107::css('inline',".e-wysiwyg { width:100% }","jquery");
// require_once(e_PLUGIN."tinymce/wysiwyg.php");
2009-10-12 06:38:01 +00:00
if(deftrue('TINYMCE_CONFIG'))
{
// $wy = new wysiwyg(TINYMCE_CONFIG);
2009-10-12 06:38:01 +00:00
}
else
{
// $wy = new wysiwyg();
2009-10-12 06:38:01 +00:00
}
2012-04-30 20:35:59 +00:00
if(!strpos(e_SELF,e_ADMIN_ABS."image.php"))
{
// $wy -> render();
2012-04-30 20:35:59 +00:00
}
2006-12-22 18:45:32 +00:00
}
2011-06-07 12:57:55 +00:00
2006-12-22 18:45:32 +00:00
2007-09-09 06:58:46 +00:00
?>