mirror of
https://github.com/e107inc/e107.git
synced 2025-01-17 20:58:30 +01:00
TinyMce e_footer.php file added. Upgrade routine now refreshes the plugin addons correctly.
This commit is contained in:
parent
86c1bd3353
commit
ff6d84e5e1
@ -215,8 +215,9 @@ class e107Update
|
||||
|
||||
function updatePlugin($path)
|
||||
{
|
||||
e107::getPlugin()->install_plugin_xml($path, 'upgrade');
|
||||
e107::getMessage()->reset(E_MESSAGE_INFO);
|
||||
e107::getPlugin()->install_plugin_xml($path, 'upgrade');
|
||||
e107::getPlugin()->save_addon_prefs(); // Rebuild addon prefs.
|
||||
e107::getMessage()->reset(E_MESSAGE_INFO);
|
||||
e107::getMessage()->addSuccess(LAN_UPDATED." : ".$path);
|
||||
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ class e107plugin
|
||||
'e_linkgen',
|
||||
'e_list',
|
||||
|
||||
'e_meta',
|
||||
'e_meta', // @Deprecated
|
||||
'e_emailprint',
|
||||
'e_frontpage',
|
||||
'e_latest', // @Deprecated - see e_dashboard
|
||||
@ -248,19 +248,19 @@ class e107plugin
|
||||
{
|
||||
if($mode == 'boolean')
|
||||
{
|
||||
$mes->addDebug("Plugin Update(s) Required");
|
||||
$mes->addDebug("Plugin Update(s) Required in ".$path."_seup.php");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
$needed[$path] = $data;
|
||||
}
|
||||
|
||||
if($curVal < $fileVal)
|
||||
if($curVal < $fileVal) // check pref version against file version.
|
||||
{
|
||||
|
||||
if($mode == 'boolean')
|
||||
{
|
||||
$mes->addDebug("Plugin Update(s) Required");
|
||||
$mes->addDebug("Plugin Update(s) Required - different version");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -2565,6 +2565,8 @@ class e107plugin
|
||||
*/
|
||||
function save_addon_prefs($mode = 'upgrade')
|
||||
{
|
||||
e107::getMessage()->addDebug('Running save_addon_prefs('.$mode.')');
|
||||
|
||||
$sql = e107::getDb();
|
||||
$core = e107::getConfig('core');
|
||||
|
||||
|
185
e107_plugins/tinymce4/e_footer.php
Normal file
185
e107_plugins/tinymce4/e_footer.php
Normal file
@ -0,0 +1,185 @@
|
||||
<?php
|
||||
/*
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2008-2015 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
*/
|
||||
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
|
||||
$pref = e107::getPref();
|
||||
|
||||
if((e107::wysiwyg() === true && check_class($pref['post_html'])) || strpos(e_SELF,"tinymce4/admin_config.php") )
|
||||
{
|
||||
if(e_PAGE != 'image.php')
|
||||
{
|
||||
//e107::js('tinymce','tiny_mce.js','jquery');
|
||||
//e107::js('tinymce','wysiwyg.php','jquery',5);
|
||||
|
||||
e107::js('footer', "http://tinymce.cachefly.net/4.0/tinymce.min.js");
|
||||
e107::js('footer',e_PLUGIN.'tinymce4/wysiwyg.php','jquery',5);
|
||||
// e107::js('inline', "
|
||||
// tinymce.init({selector:'.e-wysiwyg'});
|
||||
// ");
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
// e107::js('tinymce','tiny_mce_popup.js','jquery');
|
||||
}
|
||||
|
||||
if(ADMIN)
|
||||
{
|
||||
$insert = "$('#'+id).after('<div>";
|
||||
// $insert .= "<a href=\"#\" id=\"' + id + '\" class=\"e-wysiwyg-toggle btn btn-inverse btn-mini\">Switch to bbcode<\/a>";
|
||||
|
||||
if(e_PAGE == 'mailout.php')
|
||||
{
|
||||
$insert .= " <a href=\"#\" class=\"btn btn-mini tinyInsert\" data-value=\"|USERNAME|\" >".LAN_MAILOUT_16."<\/a>";
|
||||
$insert .= "<a href=\"#\" class=\"btn btn-mini tinyInsert\" data-value=\"|DISPLAYNAME|\" >".LAN_MAILOUT_14."<\/a>";
|
||||
$insert .= "<a href=\"#\" class=\"btn btn-mini tinyInsert\" data-value=\"|SIGNUP_LINK|\" >".LAN_MAILOUT_17."<\/a>";
|
||||
$insert .= "<a href=\"#\" class=\"btn btn-mini tinyInsert\" data-value=\"|USERID|\" >".LAN_MAILOUT_18."<\/a>";
|
||||
}
|
||||
|
||||
$insert .= "</div>');";
|
||||
|
||||
define("SWITCH_TO_BB",$insert);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
define("SWITCH_TO_BB","");
|
||||
}
|
||||
|
||||
// print_a($_POST);
|
||||
|
||||
// <div><a href='#' class='e-wysiwyg-switch' onclick=\"tinyMCE.execCommand('mceToggleEditor',false,'".$tinyMceID."');expandit('".$toggleID."');\">Toggle WYSIWYG</a></div>
|
||||
|
||||
|
||||
e107::js('footer-inline',"
|
||||
|
||||
<!---- TinyMCE Footer Inline Code -->
|
||||
|
||||
$(function() {
|
||||
|
||||
|
||||
$('.e-wysiwyg').each(function() {
|
||||
|
||||
var id = $(this).attr('id'); // 'e-wysiwyg';
|
||||
console.log(id);
|
||||
".SWITCH_TO_BB."
|
||||
// alert(id);
|
||||
$('#bbcode-panel-'+id+'--preview').hide();
|
||||
|
||||
});
|
||||
|
||||
$('.tinyInsert').click(function() {
|
||||
|
||||
var val = $(this).attr('data-value');
|
||||
top.tinymce.activeEditor.execCommand('mceInsertContent',0,val);
|
||||
return false;
|
||||
});
|
||||
|
||||
/*
|
||||
$('img.tinyInsertEmote').live('click',function() {
|
||||
|
||||
var src = $(this).attr('src');
|
||||
// alert(src);
|
||||
// var html = '<img src=\''+src +'\' alt=\'emote\' />';
|
||||
tinyMCE.execCommand('mceInsertRawHTML',false, 'hi there');
|
||||
;
|
||||
$('.mceContentBody', window.top.document).tinymce().execCommand('mceInsertContent',false,src);
|
||||
|
||||
// tinyMCE.selectedInstance.execCommand('mceInsertContent',0,src);
|
||||
|
||||
$('#uiModal').modal('hide');
|
||||
return true;
|
||||
});*/
|
||||
|
||||
|
||||
|
||||
|
||||
// When new tab is added - convert textarea to TinyMce.
|
||||
$('.e-tabs-add').on('click',function(){
|
||||
|
||||
alert('New Page Added'); // added for delay - quick and dirty work-around. XXX fixme
|
||||
|
||||
var idt = $(this).attr('data-target'); // eg. news-body
|
||||
var ct = parseInt($('#e-tab-count').val());
|
||||
var id = idt + '-' + ct;
|
||||
$('#bbcode-panel-'+id+'--preview').hide();
|
||||
".SWITCH_TO_BB."
|
||||
top.tinymce.activeEditor.execCommand('mceAddControl', false, id);
|
||||
});
|
||||
|
||||
|
||||
$('a.e-wysiwyg-toggle').toggle(function(){
|
||||
var id = $(this).attr('id'); // eg. news-body
|
||||
$('#bbcode-panel-'+id+'--preview').show();
|
||||
$(this).text('Switch to wysiwyg');
|
||||
tinymce.activeEditor.execCommand('mceRemoveControl', false, id);
|
||||
}, function () {
|
||||
var id = $(this).attr('id');
|
||||
$('#bbcode-panel-'+id+'--preview').hide();
|
||||
$(this).text('Switch to bbcode');
|
||||
tinymce.activeEditor.execCommand('mceAddControl', false, id);
|
||||
});
|
||||
|
||||
|
||||
$('.e-dialog-save').on('click', function(){
|
||||
|
||||
// var html = $('#html_holder').val();
|
||||
|
||||
var s = $('#bbcode_holder').val();
|
||||
|
||||
var p = $.ajax({
|
||||
type: 'POST',
|
||||
url: '".e_PLUGIN_ABS. "tinymce4/plugins/e107/parser.php', // parse bbcode value
|
||||
data: { content: s, mode: 'tohtml' },
|
||||
async : false,
|
||||
|
||||
dataType: 'html',
|
||||
success: function(html) {
|
||||
return html;
|
||||
}
|
||||
}).responseText;
|
||||
|
||||
html = p;
|
||||
// alert(html);
|
||||
|
||||
if(html === undefined)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// tinyMCE.execCommand('mceInsertContent',false,html);
|
||||
top.tinymce.activeEditor.execCommand('mceInsertRawHTML',false,html);
|
||||
top.tinymce.activeEditor.windowManager.close();
|
||||
|
||||
});
|
||||
|
||||
// $('.e-dialog-close').click(function(){
|
||||
|
||||
// top.tinymce.activeEditor.windowManager.close();
|
||||
// });
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
","jquery", 1);
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<e107Plugin name="TinyMce4" version="1.0" date="2014-01-15" compatibility="2.0" installRequired="false">
|
||||
<e107Plugin name="TinyMce4" version="1.1" date="2014-01-15" compatibility="2.0" installRequired="false">
|
||||
<author name="e107 Inc." url="http://e107.org" />
|
||||
<description>Experimental TinyMce4 CDN version</description>
|
||||
<description>TinyMce4 CDN version</description>
|
||||
<category>misc</category>
|
||||
</e107Plugin>
|
Loading…
x
Reference in New Issue
Block a user