Skip to content

Commit

Permalink
refs #514 : merged : with 2.0 tree.
Browse files Browse the repository at this point in the history
  • Loading branch information
inureyes committed Jun 14, 2011
2 parents 08c0675 + f559ab9 commit 455c3a9
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 57 deletions.
6 changes: 5 additions & 1 deletion library/model/common.module.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function getDefaultEditor() {
function& getAllEditors() { global $editorMappings; return $editorMappings; }

function getEditorInfo($editor) {
global $editorMappings, $pluginURL, $pluginName;
global $editorMappings, $configMappings, $pluginURL, $pluginName, $configVal;
$context = Model_Context::getInstance();
if (!isset($editorMappings[$editor])) {
reset($editorMappings);
Expand All @@ -24,6 +24,10 @@ function getEditorInfo($editor) {
if (isset($editorMappings[$editor]['plugin'])) {
$pluginURL = $context->getProperty('service.path').'/plugins/'.$editorMappings[$editor]['plugin'];
$pluginName = $editorMappings[$editor]['plugin'];
if( !empty( $configMappings[$pluginName]['config'] ) )
$configVal = getCurrentSetting($pluginName);
else
$configVal = null;
include_once ROOT . "/plugins/{$editorMappings[$editor]['plugin']}/index.php";
}
return $editorMappings[$editor];
Expand Down
1 change: 0 additions & 1 deletion library/model/common.plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,6 @@ function getPluginTableName() {
return $dbtables;
}


/***** Events and configuration handles *****/

function eventExists($event)
Expand Down
2 changes: 1 addition & 1 deletion library/view/ownerView.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function setEditor(select) {
}

function printOwnerEditorScript($entryId = false) {
global $pluginURL, $pluginName;
global $pluginURL, $pluginName, $configMappings;

$contentWidth = 500;
$context = Model_Context::getInstance();
Expand Down
21 changes: 8 additions & 13 deletions plugins/ED_tinyMCE/index.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<?php
function tinyMCE_handleconfig($configVal) {
$config = Setting::fetchConfigVal($configVal);
if (isset($config['defaultmode']) && $config['defaultmode'] != 'WYSIWYG' && $config['defaultmode'] != 'TEXTAREA') return false;
if (isset($config['paragraphdelim']) && $config['paragraphdelim'] != 'P' && $config['paragraphdelim'] != 'BR') return false;
if (isset($config['editormode']) && $config['editormode'] != 'simple' && $config['editormode'] != 'advanced') return false;
return true;
}
Expand All @@ -11,13 +9,8 @@ function tinyMCE_editorinit(&$editor) {
global $configVal, $entry, $pluginURL;
$context = Model_Context::getInstance();
$blogid = getBlogId();
if (is_null($configVal) || empty($configVal)) {
$config = array('paragraphdelim' => 'BR',
'defaultmode' => 'WYSIWYG',
'editormode' => 'advanced');
} else {
$config = Setting::fetchConfigVal($configVal);
}
$config = Setting::fetchConfigVal($configVal);
if(empty($config['editormode'])) $config['editormode'] = 'advanced';
ob_start();
?>
var editor = new tinymce.Editor('editWindow', {
Expand All @@ -40,10 +33,10 @@ function tinyMCE_editorinit(&$editor) {
?>
plugins : "autolink,lists,pagebreak,style,table,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,wordcount,advlist,TTMLsupport",
// Theme options
theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect,|,preview,fullscreen",
theme_advanced_buttons2 : "search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,|,insertdate,inserttime,|,forecolor,backcolor,|,code,cleanup",
theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl",
theme_advanced_buttons4 : "styleprops,|,cite,abbr,acronym,del,ins,|,visualchars,nonbreaking,pagebreak,restoredraft",
theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect,|,cite,abbr,acronym,del,ins,|,visualchars,nonbreaking,pagebreak,restoredraft,|,styleprops,|,code,cleanup,|,preview,fullscreen",
theme_advanced_buttons2 : "undo,redo,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,sub,sup,|,link,unlink,anchor,image,charmap,media,advhr,|,forecolor,backcolor,|,tablecontrols,|,hr,removeformat,visualaid,|,ltr,rtl",
theme_advanced_buttons3 : "",
theme_advanced_buttons4 : "",
<?php
}
?>
Expand All @@ -65,6 +58,8 @@ function tinyMCE_editorinit(&$editor) {
{title : 'Bold text', inline : 'b'}
],
forced_root_block : false,
width : "100%",
theme_advanced_toolbar_location : "external"
});
editor.initialize = function() {
this.render();
Expand Down
56 changes: 19 additions & 37 deletions plugins/ED_tinyMCE/index.xml
Original file line number Diff line number Diff line change
@@ -1,48 +1,46 @@
<?xml version="1.0" encoding="utf-8"?>
<plugin version="1.0">
<title xml:lang="en">tinyMCE WYSIWYG Editor</title>
<title xml:lang="ko">tinyMCE 위지윅 편집기</title>
<plugin version="1.1">
<title xml:lang="en">tinyMCE Editor</title>
<title xml:lang="ko">tinyMCE 편집기</title>
<link>http://needlworks.org/</link>
<version>1.9</version>
<description xml:lang="en">Provides an easy-to-use WYSIWYG editor interface.</description>
<description xml:lang="ko">사용하기 쉬운 위지윅 편집기 환경을 제공합니다.</description>
<description xml:lang="ko">사용하기 쉬운 편집기 환경을 제공합니다.</description>
<description xml:lang="ja">tinyMCE WYSIWYGに編集環境を転換</description>
<license>GPL</license>
<license>GPLv2</license>
<author xml:lang="en" link="http://forest.nubimaru.com/">inureyes</author>
<author xml:lang="ko" link="http://forest.nubimaru.com/"><![CDATA[inureyes]]></author>
<safety changeData="yes" exposeData="no" accessLocal="yes" accessRemote="no" accessRaw="yes" />
<requirements>
<textcube>1.8</textcube>
<textcube>1.9</textcube>
</requirements>
<binding>
<listener event="ShowAdminHeader">tinyMCE_adminheader</listener>

<editor xml:lang="en" id="tinyMCE" name="tinyMCE">
<initialize>tinyMCE_editorinit</initialize>
<!--<usedFor formatter="html" />-->
<usedFor formatter="html" />
<usedFor formatter="ttml" />
<usedFor formatter="markdown" />
<usedFor formatter="textile" />
<!--<usedFor formatter="markdown" />
<usedFor formatter="textile" />-->
</editor>
<editor xml:lang="ko" id="tinyMCE" name="tinyMCE">
<initialize>tinyMCE_editorinit</initialize>
<!--<usedFor formatter="html" />-->
<usedFor formatter="html" />
<usedFor formatter="ttml" />
<usedFor formatter="markdown" />
<usedFor formatter="textile" />
<!--usedFor formatter="markdown" />
<usedFor formatter="textile" />-->
</editor>
<editor xml:lang="ja" id="tinyMCE" name="tinyMCE">
<initialize>tinyMCE_editorinit</initialize>
<usedFor formatter="html" />
<usedFor formatter="ttml" />
<!--usedFor formatter="markdown" />
<usedFor formatter="textile" />-->
</editor>

<config xml:lang="ko" dataValHandler="tinyMCE_handleconfig">
<window width="500" height="525" />
<fieldset legend="기본 설정">
<field title="기본 작성 모드" type="select" name="defaultmode">
<op value="WYSIWYG" checked="checked"><![CDATA[위지윅 편집기]]></op>
<op value="TEXTAREA"><![CDATA[HTML 직접 편집]]></op>
</field>
<field title="문단을 구별하기 위하여 사용할 태그" type="select" name="paragraphdelim">
<op value="P"><![CDATA[&lt;p&gt;&lt;/p&gt;]]></op>
<op value="BR" checked="checked"><![CDATA[&lt;br /&gt;]]></op>
</field>
<field title="에디터 편집 모드" type="select" name="editormode">
<op value="simple" checked="checked"><![CDATA[간단]]></op>
<op value="advanced"><![CDATA[상세]]></op>
Expand All @@ -52,14 +50,6 @@
<config xml:lang="en" dataValHandler="tinyMCE_handleconfig">
<window width="500" height="525" />
<fieldset legend="Settings">
<field title="Default editor mode" type="select" name="defaultmode">
<op value="WYSIWYG" checked="checked"><![CDATA[WYSIWYG Editor]]></op>
<op value="TEXTAREA"><![CDATA[HTML editor]]></op>
</field>
<field title="Tag to separate paragraphs" type="select" name="paragraphdelim">
<op value="P"><![CDATA[&lt;p&gt;&lt;/p&gt;]]></op>
<op value="BR" checked="checked"><![CDATA[&lt;br /&gt;]]></op>
</field>
<field title="Editing mode" type="select" name="editormode">
<op value="simple" checked="checked"><![CDATA[Simple]]></op>
<op value="advanced"><![CDATA[Advanced]]></op>
Expand All @@ -69,14 +59,6 @@
<config xml:lang="ja" dataValHandler="tinyMCE_handleconfig">
<window width="500" height="525" />
<fieldset legend="Settings">
<field title="デフォルトモード" type="select" name="defaultmode">
<op value="WYSIWYG" checked="checked"><![CDATA[WYSIWYG Editor]]></op>
<op value="TEXTAREA"><![CDATA[HTML editor]]></op>
</field>
<field title="段落区分用のタグ" type="select" name="paragraphdelim">
<op value="P"><![CDATA[&lt;p&gt;&lt;/p&gt;]]></op>
<op value="BR" checked="checked"><![CDATA[&lt;br /&gt;]]></op>
</field>
<field title="Editing mode" type="select" name="editormode">
<op value="simple" checked="checked"><![CDATA[Simple]]></op>
<op value="advanced"><![CDATA[Advanced]]></op>
Expand Down
17 changes: 13 additions & 4 deletions skin/admin/canon/editor.css
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ h3
{
position : fixed;
top : 35px;

height : 40px;
z-index : 100;
width : 100%;
Expand Down Expand Up @@ -135,7 +134,7 @@ h3

#category-section
{
margin : 60px 20px 0 0;
margin : 80px 20px 0 0;
padding : 5px 3px 5px 5px;
width : 100%;
}
Expand Down Expand Up @@ -241,9 +240,8 @@ h3
width : 100%;
position : fixed;
top : 80px;
height : 31px;
height : 51px;
background-color : #fff;

color : #fff;
border-bottom : 1px solid #BBB;
z-index : 5;
Expand Down Expand Up @@ -922,3 +920,14 @@ dl#power-line
height : 30px !important;
z-index : 190;
}

.mceExternalToolbar {
position : fixed !important;
top : 80px !important;
height : 30px !important;
z-index : 100;
display:block;
border:0 !important;
}
.defaultSkin .mceExternalClose { display:none !important;}
.defaultSkin td.mceToolbar {background:transparent !important;}

0 comments on commit 455c3a9

Please sign in to comment.