• R/O
  • HTTP
  • SSH
  • HTTPS

nucleus-plugins: Commit

Nucleus CMS日本語版用プラグインのうち、日本語版開発者がサポートしているもの


Commit MetaInfo

Revisionc817f22b3c6a46e0c3c92ad099842a9c2b670ff0 (tree)
Time2008-02-24 14:44:57
Authorkmorimatsu <kmorimatsu@1ca2...>
Commiterkmorimatsu

Log Message

Ver 0.5.9.2

git-svn-id: https://svn.sourceforge.jp/svnroot/nucleus-jp/plugin@609 1ca29b6e-896d-4ea0-84a5-967f57386b96

Change Summary

Incremental Difference

--- /dev/null
+++ b/trunk/NP_MitasNom/NP_MitasNom.php
@@ -0,0 +1,532 @@
1+<?php
2+/*
3+ * NP_MitasNom ver 0.5.9.2
4+ * Written by Katsumi
5+ * This library is GPL
6+ */
7+class NP_MitasNom extends NucleusPlugin {
8+ var $actionplugin=false;
9+ var $bconvertbreaks;
10+ function getName() {
11+ $this->_checkVersion();
12+ return 'NP_MitasNom';
13+ }
14+ function getMinNucleusVersion() { return 220; }
15+ function getAuthor() { return 'Katsumi'; }
16+ function getVersion() { return '0.5.9.2'; }
17+ function getURL() {return 'http://japan.nucleuscms.org/wiki/plugins:mitasnom';}
18+ function getDescription() { return $this->translated('WYSIWYG HTML editor plagin using FCKeditor'); }
19+ function supportsFeature($what) { return (int)($what=='SqlTablePrefix'); }
20+ function install() {
21+ // Install, upgrade options, and Refresh member options.
22+ // Note: createOption() is overrided (see below).
23+ $this->createOption('version','version','text',$this->getVersion(),'access=hidden');
24+ $this->createOption('width',$this->translated('Width'),'text','100%');
25+ $this->createOption('height',$this->translated('Height'),'text','400');
26+ $this->createOption('toolbar',$this->translated('Toolbar'),'select','Default','Default|Default|Full|Full|Basic|Basic|Custom|Custom');
27+ $this->createOption('toolbar_custom',$this->translated('Custom Toolbar'), 'textarea',
28+ "['Source','DocProps','-','Save','NewPage','Preview','-','Templates'],\n".
29+ "['Cut','Copy','Paste','PasteText','PasteWord','-','Print','SpellCheck'],\n".
30+ "['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],\n".
31+ "['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'],\n".
32+ "['OrderedList','UnorderedList','-','Outdent','Indent'],\n".
33+ "['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],\n".
34+ "['Link','Unlink','Anchor'],\n".
35+ "['Image','Flash','Table','Rule','Smiley','SpecialChar','PageBreak','UniversalKey'],\n".
36+ "['Form','Checkbox','Radio','TextField','Textarea','Select','Button','ImageButton','HiddenField'],'/',\n".
37+ "['Style','FontFormat','FontName','FontSize'],\n".
38+ "['TextColor','BGColor'],\n".
39+ "['About']");
40+ $this->createOption('addremovetoolbar',$this->translated('Add new toolbar to the menu / Delete toolbar from the menu'),'text','');
41+ $this->createOption('returnafterbr',$this->translated('"<br />" => "<br />\n" conversion?'),'yesno','yes');
42+ $this->createOption('returnafterbrbr',$this->translated('"<br /><br />" => "<br />\n<br />\n" conversion?'),'yesno','no');
43+ $this->createOption('dialogwidth',$this->translated('Width of Popup dialog'),'text','500');
44+ $this->createOption('dialogheight',$this->translated('Height of Popup dialog'),'text','450');
45+ $this->createOption('protectedsource',$this->translated('Protected Sources'), 'textarea',
46+ '/<script[\s\S]*?\/script>/gi'."\n".
47+ '/<%[\s\S]*?%>/g');
48+ //$this->createOption('additionalpsource',$this->translated('Additional Protected Sources'), 'textarea','');
49+ $this->createOption('usemembersettings',$this->translated('Use member-specific settings?'),'yesno','no');
50+ $this->createOption('useimagemanager',$this->translated('Use Image-Manager plugin instead of media.php?'),'yesno','no');
51+ $this->createOption('usehttps',$this->translated('Use secure server (https) for edititing item?'),'yesno','no');
52+ $this->createOption('usep',$this->translated('Use P tag instead of BR for enter key (IE only)?'),'yesno','no');
53+ }
54+ function getEventList() { return array('EditItemFormExtras','AddItemFormExtras','PrepareItemForEdit',
55+ 'PreAddItem','PreUpdateItem',
56+ 'PreItem','PostPluginOptionsUpdate','PrePluginOptionsEdit'); }
57+
58+ // SkinVar is currently used for showing link to create item
59+ function doSkinVar($skinType,$type,$text='') {
60+ global $blogid,$CONF,$member;
61+ switch (strtolower($type)) {
62+ case 'newitem':
63+ default:
64+ if (!$member->isLoggedIn()) return;
65+ if (!$text) $text=$this->translated('New Item with WYSIWYG');
66+ $url=$CONF['ActionURL'].'?action=plugin&name=MitasNom&type=createitem&blogid='.$blogid;
67+ $url=htmlspecialchars($url);
68+ if ($this->getOption('usehttps')=='yes') $url=preg_replace('/^http:/','https:',$url);
69+ echo "<a href=\"$url\">$text</a>\n";
70+ break;
71+ }
72+ }
73+
74+ // TemplateVar is currently used for showing link to edit item
75+ function doTemplateVar(&$item,$type,$text='') {
76+ global $CONF,$member;
77+ switch (strtolower($type)) {
78+ case 'edititem':
79+ default:
80+ if (!$text) $text=$text=$this->translated('Edit Item with WYSIWYG');
81+ $itemid=$item->itemid;
82+ $url=htmlspecialchars($url);
83+ if ($this->getOption('usehttps')=='yes') $url=preg_replace('/^http:/','https:',$url);
84+ $url=$CONF['ActionURL'].'?action=plugin&name=MitasNom&type=itemedit&itemid='.$itemid;
85+ echo "<a href=\"$url\">$text</a>\n";
86+ break;
87+ }
88+ }
89+
90+ // Action is used to show item-editing/newitem-creating window.
91+ function doAction($type){
92+ global $DIR_LIBS,$member,$manager,$CONF,$blogid,$itemid;
93+ if (!$member->isLoggedIn()) return _NOTLOGGEDIN;
94+ if (!strstr('createitem itemedit',$type)) return _BADACTION;
95+
96+ // Resolve itemid and blogid
97+ if (!$blogid && $itemid) $blogid=getBlogIDFromItemID($itemid);
98+ if (!$blogid) return _BADACTION;
99+ if (!$member->teamRights($blogid)) return _ERROR_DISALLOWED;
100+ $blog=&$manager->getBlog($blogid);
101+ $convBreaks=false;
102+ if ($blog) if ($blog->convertBreaks()) $convBreaks=true;
103+
104+ // Get editing HTML
105+ $this->actionplugin=true;
106+ include($DIR_LIBS . 'ADMIN.php');
107+ $a=new ADMIN();
108+ switch ($type) {
109+ case 'createitem':
110+ ob_start();
111+ $a->action_createitem();
112+ $buff=ob_get_contents();
113+ ob_end_clean();
114+ break;
115+ case 'itemedit':
116+ ob_start();
117+ $a->action_itemedit();
118+ $buff=ob_get_contents();
119+ ob_end_clean();
120+ break;
121+ default:
122+ return _BADACTION;
123+ }
124+
125+ // Return if not valid editing HTML
126+ // These codes must be changed when non-compatible Nucleus version comes out.
127+ if (!preg_match('/<head>/',$buff)) return _ERRORMSG;
128+ if (!preg_match('/<div class="jsbuttonbar">/',$buff)) return _ERRORMSG;
129+ if (!preg_match('/<textarea([^>]*)inputbody([^>]*)>([^>]*)<\/textarea>/',$buff)) return _ERRORMSG;
130+ if (!preg_match('/<textarea([^>]*)inputmore([^>]*)>([^>]*)<\/textarea>/',$buff)) return _ERRORMSG;
131+
132+ // Create NucleusFCKeditor instances
133+ if (!class_exists('NucleusFCKeditor')) include ($this->getDirectory().'fckclass.php');
134+ $body='';
135+ $more='';
136+ if ($type=='itemedit') {
137+ if (preg_match ('/<textarea([^>]*)inputbody([^>]*)>([^>]*)<\/textarea>/',$buff,$matches))
138+ $body=$matches[3];
139+ $body=$this->unhtmlentities($body);
140+ if (preg_match ('/<textarea([^>]*)inputmore([^>]*)>([^>]*)<\/textarea>/',$buff,$matches))
141+ $more=$matches[3];
142+ $more=$this->unhtmlentities($more);
143+ }
144+ if ($convBreaks) {
145+ $body=addBreaks($body);
146+ $more=addBreaks($more);
147+ }
148+ $FCKedit1=new NucleusFCKEditor('body',$this,$body);
149+ $FCKedit2=new NucleusFCKEditor('more',$this,$more);
150+ $buff1=$FCKedit1->CreateHtml();
151+ $buff2=$FCKedit2->CreateHtml();
152+
153+ // Replace texts of editing page
154+ // These codes must be changed when non-compatible Nucleus version comes out.
155+ $buff=preg_replace ('/<head>/','<head><base href="'.$CONF['AdminURL'].'">', $buff,1);
156+ $buff=preg_replace ('/<div class="jsbuttonbar">/','<div class="jsbuttonbar" style="DISPLAY: none;">', $buff,2);
157+ $buff=preg_replace ('/<textarea([^>]*)inputbody([^>]*)>([^>]*)<\/textarea>/',$buff1, $buff,1);
158+ $buff=preg_replace ('/<textarea([^>]*)inputmore([^>]*)>([^>]*)<\/textarea>/',$buff2, $buff,1);
159+ echo $buff;
160+ }
161+
162+ // Solve <%image%> tag for showing items
163+ function event_PreItem(&$data) {
164+ $item=&$data['item'];
165+ $pattern=$this->_patternBeforeEdit();
166+ $replace=$this->_replaceBeforeEdit($item->authorid);
167+ for ($i=0;$i<1;$i++){
168+ $item->body=preg_replace($pattern[$i],$replace[$i],$item->body);
169+ $item->more=preg_replace($pattern[$i],$replace[$i],$item->more);
170+ }
171+ }
172+
173+ // NP_MitasNom option in editing dialog.
174+ // This is more compatible to newer Nucleus version,
175+ // unless 'id="inputbody"' and 'id="inputmore"' changed.
176+ function event_AddItemFormExtras(&$data) { return $this->event_EditItemFormExtras($data); }
177+ function event_EditItemFormExtras(&$data) {
178+ global $DIR_LIBS,$member,$manager,$CONF,$blogid,$itemid;
179+ // Resolve itemid and blogid
180+ if (!$blogid && $itemid) $blogid=getBlogIDFromItemID($itemid);
181+ if (!$blogid) return _BADACTION;
182+ if (!$member->teamRights($blogid)) return _ERROR_DISALLOWED;
183+ $blog=&$manager->getBlog($blogid);
184+ $convBreaks=false;
185+ if ($blog) if ($blog->convertBreaks()) $convBreaks=true;
186+ $authorid=$member->getID();
187+ if ($itemid) {
188+ $item=&$manager->getItem($itemid,1,1);
189+ $authorid=$item['authorid'];
190+ }
191+
192+ if ($this->actionplugin) {
193+ echo '<input type="hidden" name="mitasnom_wysiwyged" id="mitasnom_wysiwyged" value="full"/>';
194+ return;
195+ } else echo '<input type="hidden" name="mitasnom_wysiwyged" id="mitasnom_wysiwyged" value=""/>';
196+ $dwidth=$this->this_getOption('dialogwidth');
197+ $dheight=$this->this_getOption('dialogheight');
198+ $mURL=$CONF['MediaURL'].$member->getID().'/';
199+?>
200+<h3>NP_MitasNom</h3>
201+<script type="text/javascript">
202+//<![CDATA[
203+function WYSIWYGpopup(textId){
204+ window.open('plugins/mitasnom/popup.php?blogid=<?php echo (int)$blogid; ?>&id='+textId,'name',
205+<?php echo "'status=yes,toolbar=no,scrollbars=yes,resizable=yes,width=$dwidth,height=$dheight,top=0,left=0');\n"; ?>
206+}
207+function convBreaks(T) {
208+ T=T+'';
209+ T=T.replace(/\x0D\x0A/g,"\x0A");
210+ T=T.replace(/\x0D/g,"\x0A");
211+ T=T.replace(/\x0A/g,"<br />\x0A");
212+ return T;
213+}
214+function rmvBreaks(T) {
215+ T=T+'';
216+ T=T.replace(/\x0A/g,'');
217+ T=T.replace(/\x0D/g,'');
218+ T=T.replace(/<br \/>/g,'\n');
219+ <?php
220+ if ($this->this_getOption('returnafterbrbr')!='yes')
221+ echo 'while (T.match(/\n\n/g)) T=T.replace(/\n\n/g,"\n<br />");'."\n";
222+ echo 'while (T.match(/<br \/>\n/g)) T=T.replace(/<br \/>\n/g,"<br /><br />");'."\n";
223+ ?>
224+ T=T.replace(/\n<br \/>/g,'<br />\n');
225+ return T;
226+}
227+function WYSIWYGgettext(id){
228+ var T=document.getElementById(id).value+'';
229+<?php
230+ if ($convBreaks) echo "\tT=convBreaks(T);\n";
231+ $replacearray=$this->_replaceBeforeEdit($authorid);
232+ foreach($this->_patternBeforeEdit() as $key => $pattern) {
233+ $replace=$replacearray[$key];
234+ echo "\tT=T.replace($pattern"."g,'$replace');\n";
235+ }
236+?>
237+ return T;
238+}
239+function WYSIWYGsettext(id,T){
240+<?php
241+ if ($convBreaks) echo "\tT=rmvBreaks(T);\n";
242+ $replacearray=$this->_replaceAfterEdit();
243+ foreach($this->_patternAfterEdit() as $key => $pattern) {
244+ $replace=$replacearray[$key];
245+ echo "\tT=T.replace($pattern"."g,'$replace');\n";
246+ }
247+?>
248+ document.getElementById(id).value=T;
249+ document.getElementById('mitasnom_wysiwyged').value='image';
250+}
251+//]]>
252+</script>
253+<p>
254+<a href="javascript:WYSIWYGpopup('inputbody');" title="Edit by HTML editor"><?php echo $this->translated('WYSIWYG:body'); ?></a>&nbsp;&nbsp;
255+<a href="javascript:WYSIWYGpopup('inputmore');" title="Edit by HTML editor"><?php echo $this->translated('WYSIWYG:more'); ?></a>
256+</p>
257+<?php
258+ }
259+
260+ //<%image%>, <%popup%> conversion
261+ function event_PrepareItemForEdit(&$data) {
262+ global $CONF,$member;
263+ if (!$this->actionplugin) return;
264+ $item=&$data['item'];
265+ $pattern=$this->_patternBeforeEdit();
266+ $replace=$this->_replaceBeforeEdit($item['authorid']);
267+ $item['body']=preg_replace($pattern,$replace,$item['body']);
268+ $item['more']=preg_replace($pattern,$replace,$item['more']);
269+ }
270+
271+ // Creates Nucleus-specific tags (<%image%> <%popup%>) from general HTML tags.
272+ function event_PreAddItem(&$item) { return $this->event_PreUpdateItem($item); }
273+ function event_PreUpdateItem(&$item) {
274+ if (!requestVar('mitasnom_wysiwyged')) return;
275+ $body=&$item['body'];
276+ $more=&$item['more'];
277+ $blog=&$item['blog'];
278+ $body=$this->_restoreImgPopup($body);
279+ $more=$this->_restoreImgPopup($more);
280+ if (requestVar('mitasnom_wysiwyged')!='full') return;
281+ if ($blog->convertBreaks()) {
282+ $body=removeBreaks($body);
283+ $more=removeBreaks($more);
284+ }
285+ if ($this->this_getOption('returnafterbr')=='yes') {
286+ $body=$this->_addEnterAfterBr($body);
287+ $more=$this->_addEnterAfterBr($more);
288+ }
289+ $pattern=$this->_patternAfterEdit();
290+ $replace=$this->_replaceAfterEdit();
291+ $body=preg_replace($pattern,$replace,$body);
292+ $more=preg_replace($pattern,$replace,$more);
293+ }
294+ function _addEnterAfterBr(&$data){
295+ // <br/> => <br/>\n conversion
296+ $ret='';
297+ $data=str_replace(array("\r","\n"),'',$data);
298+ while ($data) {
299+ if (($i=strpos($data,'<br />'))===false) break;
300+ $ret.=substr($data,0,$i+6);
301+ $data=substr($data,$i+6);
302+ if (substr($data,0,1)=="\x0D" || substr($data,0,1)=="\x0A") continue;
303+ if (substr($data,0,6)!='<br />' || $this->this_getOption('returnafterbrbr')=='yes') $ret.="\n";
304+ }
305+ return $ret.$data;
306+ }
307+ function _restoreImgPopup(&$data){
308+ global $CONF,$member,$DIR_MEDIA;
309+ //$mURL=$CONF['MediaURL'].$member->getID().'/';
310+ $mURL=$CONF['MediaURL'];
311+ $pattern='/<img [^>]*?src="'.str_replace('/','\/',$mURL).'[^"]*?"[^>]*? \/>/';
312+ if (preg_match_all ( $pattern, $data, $matches,PREG_SET_ORDER)) {
313+ foreach($matches as $match){
314+ $subject=$match[0];
315+ $src=$width=$height=$alt='';
316+ $prop=array();
317+ foreach(explode('" ',substr($subject,5)) as $value) {
318+ $i=strpos($value,'=');
319+ $j=strpos($value,'"');
320+ if ($i===false || $j===false) continue;
321+ $key=substr($value,0,$i);
322+ $value=substr($value,$j+1);
323+ switch ($key) {
324+ case 'src':
325+ if (preg_match('/src="'.str_replace('/','\/',$mURL).'([^"]*?)"/',$subject,$match)) $src=$match[1];
326+ break;
327+ case 'width':
328+ $width=$value;
329+ break;
330+ case 'height':
331+ $height=$value;
332+ break;
333+ default:
334+ $prop[$key]=$value;
335+ break;
336+ }
337+ }
338+ if (!$prop['title']) $prop['title']=$prop['alt'];
339+ if (!$prop['alt']) $prop['alt']=$prop['title'];
340+ foreach ($prop as $key => $value) {
341+ if (!$alt) $alt.=' ';
342+ $alt.=$key.'="'.$value.'"';
343+ }
344+ $data=str_replace($subject,"<%image($src|$width|$height|$alt)%>",$data);
345+ }
346+ }
347+ $pattern='/<a [\s\S]*?href="'.str_replace('/','\/',$mURL).'[^"]*?"[\s\S]*?<\/a>/';
348+ if (preg_match_all ( $pattern, $data, $matches,PREG_SET_ORDER)) {
349+ $i=0;
350+ foreach($matches as $match){
351+ $subject=$match[0];
352+ if (preg_match('/href="'.str_replace('/','\/',$mURL).'([^"]*?)"/',$subject,$match)) $href=$match[1];
353+ else $href='';
354+ if (preg_match('/title="width=([^\|]*?)\|height=([^"]*?)"/',$subject,$match)) {
355+ $width=$match[1];
356+ $height=$match[2];
357+ } else {
358+ $old_level = error_reporting(0);
359+ $size = @GetImageSize($DIR_MEDIA.$href);
360+ error_reporting($old_level);
361+ $width = ($height = 0);
362+ if ($size) {
363+ $width = $size[0];
364+ $height = $size[1];
365+ }
366+ }
367+ if (preg_match('/>([^<]*?)<\/a>/',$subject,$match)) $alt=$match[1];
368+ else $alt='';
369+ if (!$width) $width=100;
370+ if (!$height) $height=100;
371+ if ($alt) $data=str_replace($subject,"<%popup($href|$width|$height|$alt)%>",$data);
372+ }
373+ }
374+ return $data;
375+ }
376+
377+ //Replacement for <%image%>, <%popup%>
378+ function _patternBeforeEdit(){
379+ return array( '/<%image\(([0-9]*?)\/([^\|]*?)\|([0-9]*?)\|([0-9]*?)\|([^\)]*?)alt="([^"]*?)"([^\)]*?)\)%>/',
380+ '/<%image\(([^\|\/]*?)\|([0-9]*?)\|([0-9]*?)\|([^\)]*?)alt="([^"]*?)"([^\)]*?)\)%>/',
381+ '/<%image\(([^\|]*?)\|([0-9]*?)\|([0-9]*?)\|([^\)]*?)alt="([^"]*?)"([^\)]*?)\)%>/',
382+ '/<%image\(([0-9]*?)\/([^\|]*?)\|([0-9]*?)\|([0-9]*?)\|([^\)]*?)\)%>/',
383+ '/<%image\(([^\|\/]*?)\|([0-9]*?)\|([0-9]*?)\|([^\)]*?)\)%>/',
384+ '/<%image\(([^\|]*?)\|([0-9]*?)\|([0-9]*?)\|([^\)]*?)\)%>/',
385+ '/<%popup\(([0-9]*?)\/([^\|]*?)\|([0-9]*?)\|([0-9]*?)\|([^\)]*?)\)%>/',
386+ '/<%popup\(([^\|\/]*?)\|([0-9]*?)\|([0-9]*?)\|([^\)]*?)\)%>/',
387+ '/<%popup\(([^\|]*?)\|([0-9]*?)\|([0-9]*?)\|([^\)]*?)\)%>/',
388+ '/<%([^%]*?)%>/');
389+ }
390+ function _replaceBeforeEdit($authorid) {
391+ global $CONF;
392+ $mURL=$CONF['MediaURL'].$authorid.'/';
393+ return array( '<img src="'.$CONF['MediaURL'].'$1/$2" width="$3" height="$4" $5 alt="$6"$7 />',
394+ '<img src="'.$mURL.'$1" width="$2" height="$3" $4 alt="$5"$6 />',
395+ '<img src="'.$CONF['MediaURL'].'$1" width="$2" height="$3" $4 alt="$5"$6 />',
396+ '<img src="'.$CONF['MediaURL'].'$1/$2" width="$3" height="$4" alt="$5" title="$5" />',
397+ '<img src="'.$mURL.'$1" width="$2" height="$3" alt="$4" title="$4" />',
398+ '<img src="'.$CONF['MediaURL'].'$1" width="$2" height="$3" alt="$4" title="$4" />',
399+ '<a href="'.$CONF['MediaURL'].'$1/$2" title="width=$3|height=$4">$5</a>',
400+ '<a href="'.$mURL.'$1" title="width=$2|height=$3">$4</a>',
401+ '<a href="'.$CONF['MediaURL'].'$1" title="width=$2|height=$3">$4</a>',
402+ '<mitasnom title="nucleustag"></mitasnom><%$1%>');
403+ }
404+ function _patternAfterEdit(){
405+ return array( '/<mitasnom title="nucleustag"><\/mitasnom>/');
406+ }
407+ function _replaceAfterEdit() {
408+ return array( '');
409+ }
410+
411+ // Show information when editing plugin option
412+ var $errormessage;
413+ function event_PrePluginOptionsEdit($data){
414+ if ($this->errormessage) echo "<h4>".$this->errormessage."</h4>";
415+ }
416+ function returnWithMessage($text) { $this->errormessage=$text;}
417+
418+ // Customize toolbar menu
419+ function event_PostPluginOptionsUpdate($data) {
420+ $plugid=$data['plugid'];
421+ if ($plugid!=$this->GetID()) return;
422+ $this->install();// Refresh member option settings.
423+ if (!($name=$this->getOption('addremovetoolbar'))) return;
424+ $name=ereg_replace("[^0-9a-zA-Z]","",$name);
425+ $this->setOption('addremovetoolbar','');
426+ if (!($toolbar=$this->getOption('toolbar_custom')))
427+ return $this->returnWithMessage($this->translated('Toolbar definition is empty'));
428+ if (strstr(' default full basic custom ',strtolower($name)))
429+ return $this->returnWithMessage($this->translated('Default, Full, Basic and Custom toolbars cannot be removed.'));
430+ $ret=$this->getOption('toolbar_'.strtolower($name));//$ret=$this->getOption('toolbar_'.$this);
431+ if (!($oid=$this->this_getOid('toolbar'))) return;
432+ if (!($extra=$this->this_getExtra($oid))) return;
433+ if (strstr(strtolower($extra),strtolower($name))) {
434+ //delete
435+ $extra=eregi_replace("\|$name\|$name","",$extra);
436+ sql_query('UPDATE ' . sql_table('plugin_option_desc') .
437+ ' SET oextra = "'.addslashes($extra). '" WHERE oid=' . (int)$oid);
438+ $this->deleteOption('toolbar_'.strtolower($name));
439+ $this->returnWithMessage($name.$this->translated(' toolbar is deleted.'));
440+ } else {
441+ //add
442+ $extra=str_replace("|Custom|Custom","|$name|$name|Custom|Custom",$extra);
443+ sql_query('UPDATE ' . sql_table('plugin_option_desc') .
444+ ' SET oextra = "'.addslashes($extra). '" WHERE oid=' . (int)$oid);
445+ $this->createOption('toolbar_'.strtolower($name), $name.$this->translated(' Toolbar'), 'textarea', $toolbar);
446+ $this->returnWithMessage($name.$this->translated(' toolbar is added.'));
447+ }
448+ }
449+
450+ // Member specific stuff
451+ function this_getOption($name) {
452+ global $member;
453+ if ($this->getOption('usemembersettings')!='yes') return $this->getOption($name);
454+ if (!$this->_useMemberSpecificOption($name)) return $this->getOption($name);
455+ return $this->getMemberOption($member->getID(), $name);
456+ }
457+ function _useMemberSpecificOption($name) {
458+ foreach ($this->_allMemberSpecificOptions() as $value) if ($name==$value) return true;
459+ return false;
460+ }
461+ function _allMemberSpecificOptions() {
462+ return array('width','height','toolbar','returnafterbr','returnafterbrbr',
463+ 'dialogwidth','dialogheight','additionalpsource');
464+ }
465+
466+ // SQL stuff
467+ function this_getOid($name,$context='global'){
468+ $query = 'SELECT oid, oname FROM ' . sql_table('plugin_option_desc') .
469+ ' WHERE opid=' . intval($this->plugid).
470+ ' and ocontext="'.addslashes($context).'"';
471+ $res = sql_query($query);
472+ while ($o = mysql_fetch_object($res)) if ($o->oname==$name) return $o->oid;
473+ return null;
474+ }
475+ function this_getExtra($oid){
476+ $query = 'SELECT oextra FROM ' . sql_table('plugin_option_desc') . ' WHERE oid=' . intval($oid);
477+ $res = sql_query($query);
478+ if ($o = mysql_fetch_object($res)) return $o->oextra;
479+ return null;
480+ }
481+
482+ // Uppgrading stuff
483+ function _checkVersion(){
484+ if (!$this->this_getOid('version')) $this->install();
485+ else if ($this->getVersion()!=$this->getOption('version')) $this->install();
486+ $this->setOption('version',$this->getVersion());
487+ }
488+
489+ // Overrided function
490+ function createOption($name, $desc, $type, $defValue = '', $typeExtras = '') {
491+ if (!$this->this_getOid($name)) parent::createOption($name, $desc, $type, $defValue, $typeExtras);
492+ if ($this->_useMemberSpecificOption($name)) {
493+ if ($this->getOption('usemembersettings')=='yes') {
494+ if (!$this->this_getOid($name,'member')) {
495+ if ($name=='toolbar') {
496+ $typeExtras=quickQuery(
497+ 'SELECT oextra as result FROM '.sql_table('plugin_option_desc').
498+ ' WHERE opid='.(int)$this->getID().' AND oname="toolbar"');
499+ }
500+ if (($Extras=$typeExtras)=='access=hidden') $Extras='';
501+ $Extras=str_replace('|Custom|Custom','',$Extras);
502+ $Extras=str_replace('|Full|Full','',$Extras);
503+ $this->createMemberOption($name, $desc, $type,$this->getOption($name), $Extras);
504+ }
505+ } else {
506+ if ($this->this_getOid($name,'member'))
507+ $this->deleteMemberOption($name);
508+ }
509+ }
510+ return 1;
511+ }
512+
513+ // Language stuff
514+ var $langArray;
515+ function translated($english){
516+ if (!is_array($this->langArray)) {
517+ $this->langArray=array();
518+ $language=$this->getDirectory().'language/'.ereg_replace( '[\\|/]', '', getLanguageName()).'.php';
519+ if (file_exists($language)) include($language);
520+ }
521+ if (!($ret=$this->langArray[$english])) $ret=$english;
522+ return $ret;
523+ }
524+
525+ // General function (found on PHP help page) follows
526+ function unhtmlentities($string) {
527+ $trans_tbl = get_html_translation_table (HTML_ENTITIES);
528+ $trans_tbl = array_flip ($trans_tbl);
529+ return strtr ($string, $trans_tbl);
530+ }
531+}
532+?>
\ No newline at end of file
--- /dev/null
+++ b/trunk/NP_MitasNom/mitasnom/config.php
@@ -0,0 +1,64 @@
1+<?php
2+/*
3+ * NP_MitasNom
4+ * Written by Katsumi
5+ * This library is GPL
6+ */
7+
8+ $strRel = '../../../';
9+ require($strRel . 'config.php');
10+
11+ // create the admin area page
12+ if (!$member->isLoggedIn()) exit('Not logged in.');
13+ include($DIR_LIBS . 'PLUGINADMIN.php');
14+ $oPluginAdmin = new PluginAdmin('MitasNom');
15+ $p=&$oPluginAdmin->plugin;
16+
17+ // Setting media dialog stuff
18+ $MediaURL=$CONF['MediaURL'];
19+ echo "FCKConfig.NucleusMediaDir='$MediaURL';\n";
20+ $NucleusMediaWindowWidth=trim($p->this_getOption('dialogwidth'));
21+ $NucleusMediaWindowHeight=trim($p->this_getOption('dialogheight'));
22+ if ($p->this_getOption('useimagemanager')=='yes') {
23+ $NucleusMediaWindowURL=$CONF['AdminURL'].'plugins/imagemanager/manager.php';
24+ echo "FCKConfig.NucleusUseImageManager=true;\n";
25+
26+ } else {
27+ $NucleusMediaWindowURL=$CONF['AdminURL'].'media.php';
28+ echo "FCKConfig.NucleusUseImageManager=false;\n";
29+ }
30+ if ($p->this_getOption('usep')=='yes') echo "FCKConfig.UseBROnCarriageReturn=false;\n";
31+
32+ echo "FCKConfig.LinkBrowserWindowWidth='$NucleusMediaWindowWidth';\n";
33+ echo "FCKConfig.LinkBrowserWindowHeight='$NucleusMediaWindowHeight';\n";
34+ echo "FCKConfig.LinkBrowserURL='$NucleusMediaWindowURL';\n";
35+ echo "FCKConfig.ImageBrowserWindowWidth='$NucleusMediaWindowWidth';\n";
36+ echo "FCKConfig.ImageBrowserWindowHeight='$NucleusMediaWindowHeight';\n";
37+ echo "FCKConfig.ImageBrowserURL='$NucleusMediaWindowURL';\n";
38+ echo "FCKConfig.FlashBrowserWindowWidth='$NucleusMediaWindowWidth';\n";
39+ echo "FCKConfig.FlashBrowserWindowHeight='$NucleusMediaWindowHeight';\n";
40+ echo "FCKConfig.FlashBrowserURL='$NucleusMediaWindowURL';\n";
41+
42+ // ProtectedSource
43+ $ProtectedSources="/\\x0A/g\n";
44+ $ProtectedSources.=$p->getOption('protectedsource')."\n";
45+ $ProtectedSources.=$p->this_getOption('additionalpsource');
46+ $ProtectedSources=str_replace("\n","\x0A",$ProtectedSources);
47+ $ProtectedSources=str_replace("\x0D","\x0A",$ProtectedSources);
48+ foreach ( explode ("\x0A",$ProtectedSources) as $value)
49+ if ($value) echo "FCKConfig.ProtectedSource.Add($value);\n";
50+
51+ // Custom toolbar
52+ $toolbar=$p->this_getOption('toolbar');
53+ switch (strtolower($toolbar)) {
54+ case 'default':
55+ case 'full':
56+ case 'basic':
57+ break;
58+ default:
59+ echo 'FCKConfig.ToolbarSets["'.$toolbar.'"] = ['.
60+ $p->getOption('toolbar_'.strtolower($toolbar))."];\n";
61+ break;
62+ }
63+
64+?>
\ No newline at end of file
--- /dev/null
+++ b/trunk/NP_MitasNom/mitasnom/editor/dialog/common/fck_dialog_common.js
@@ -0,0 +1,176 @@
1+/*
2+ * FCKeditor - The text editor for internet
3+ * Copyright (C) 2003-2005 Frederico Caldeira Knabben
4+ *
5+ * Licensed under the terms of the GNU Lesser General Public License:
6+ * http://www.opensource.org/licenses/lgpl-license.php
7+ *
8+ * For further information visit:
9+ * http://www.fckeditor.net/
10+ *
11+ * "Support Open Source software. What about a donation today?"
12+ *
13+ * File Name: fck_dialog_common.js
14+ * Useful functions used by almost all dialog window pages.
15+ *
16+ * File Authors:
17+ * Frederico Caldeira Knabben (fredck@fckeditor.net)
18+ */
19+
20+/*
21+ * Modified for Nucleus Plugin by Katsumi
22+ * The license turned to GPL.
23+ */
24+
25+// Gets a element by its Id. Used for shorter coding.
26+function GetE( elementId )
27+{
28+ return document.getElementById( elementId ) ;
29+}
30+
31+function ShowE( element, isVisible )
32+{
33+ if ( typeof( element ) == 'string' )
34+ element = GetE( element ) ;
35+ element.style.display = isVisible ? '' : 'none' ;
36+}
37+
38+function SetAttribute( element, attName, attValue )
39+{
40+ if ( attValue == null || attValue.length == 0 )
41+ element.removeAttribute( attName, 0 ) ; // 0 : Case Insensitive
42+ else
43+ element.setAttribute( attName, attValue, 0 ) ; // 0 : Case Insensitive
44+}
45+
46+function GetAttribute( element, attName, valueIfNull )
47+{
48+ var oAtt = element.attributes[attName] ;
49+
50+ if ( oAtt == null || !oAtt.specified )
51+ return valueIfNull ? valueIfNull : '' ;
52+
53+ var oValue ;
54+
55+ if ( !( oValue = element.getAttribute( attName, 2 ) ) )
56+ oValue = oAtt.nodeValue ;
57+
58+ return ( oValue == null ? valueIfNull : oValue ) ;
59+}
60+
61+// Functions used by text fiels to accept numbers only.
62+function IsDigit( e )
63+{
64+ e = e || event ;
65+ var iCode = ( e.keyCode || e.charCode ) ;
66+
67+ event.returnValue =
68+ (
69+ ( iCode >= 48 && iCode <= 57 ) // Numbers
70+ || (iCode >= 37 && iCode <= 40) // Arrows
71+ || iCode == 8 // Backspace
72+ || iCode == 46 // Delete
73+ ) ;
74+
75+ return event.returnValue ;
76+}
77+
78+String.prototype.trim = function()
79+{
80+ return this.replace( /(^\s*)|(\s*$)/g, '' ) ;
81+}
82+
83+String.prototype.startsWith = function( value )
84+{
85+ return ( this.substr( 0, value.length ) == value ) ;
86+}
87+
88+String.prototype.remove = function( start, length )
89+{
90+ var s = '' ;
91+
92+ if ( start > 0 )
93+ s = this.substring( 0, start ) ;
94+
95+ if ( start + length < this.length )
96+ s += this.substring( start + length , this.length ) ;
97+
98+ return s ;
99+}
100+
101+function OpenFileBrowser( url, width, height )
102+{
103+ // oEditor must be defined.
104+
105+ var iLeft = ( oEditor.FCKConfig.ScreenWidth - width ) / 2 ;
106+ var iTop = ( oEditor.FCKConfig.ScreenHeight - height ) / 2 ;
107+
108+ var sOptions = "toolbar=no,status=no,resizable=yes,dependent=yes" ;
109+ sOptions += ",width=" + width ;
110+ sOptions += ",height=" + height ;
111+ sOptions += ",left=" + iLeft ;
112+ sOptions += ",top=" + iTop ;
113+ sOptions += ",scrollbars=yes";
114+ // The "PreserveSessionOnFileBrowser" because the above code could be
115+ // blocked by popup blockers.
116+ if ( oEditor.FCKConfig.PreserveSessionOnFileBrowser && oEditor.FCKBrowserInfo.IsIE )
117+ {
118+ // The following change has been made otherwise IE will open the file
119+ // browser on a different server session (on some cases):
120+ // http://support.microsoft.com/default.aspx?scid=kb;en-us;831678
121+ // by Simone Chiaretta.
122+ var oWindow = oEditor.window.open( url, 'FCKBrowseWindow', sOptions ) ;
123+ if ( oWindow )
124+ oWindow.opener = window ;
125+ else
126+ alert( oEditor.FCKLang.BrowseServerBlocked ) ;
127+ }
128+ else { var oWindow =window.open( url, 'FCKBrowseWindow', sOptions ) ; }
129+ if ( oWindow ) {
130+ if (FCKConfig.NucleusUseImageManager) {// Image-Manager plugin
131+ SetImageManager_oWindow=oWindow;
132+ SetImageManager_timer=setInterval("SetImageManager()",1);// Check the window every 1 mili second.
133+ } else {//media.php
134+ oWindow.window.opener.includeImage=function(collection,filename,type,width,height)
135+ {
136+ if (this.GetE('txtUrl')) this.GetE('txtUrl').value=FCKConfig.NucleusMediaDir+collection+'/'+filename;
137+ if (this.GetE('txtWidth')) this.GetE('txtWidth').value=width;
138+ if (this.GetE('txtHeight')) this.GetE('txtHeight').value=height;
139+ //if (this.GetE('txtAttTitle')) this.GetE('txtAttTitle').value=filename;
140+ };
141+ oWindow.window.opener.includeOtherMedia=function(collection, filename)
142+ {
143+ if (this.GetE('txtUrl')) this.GetE('txtUrl').value=FCKConfig.NucleusMediaDir+collection+'/'+filename;
144+ };
145+ }
146+ }
147+}
148+
149+var SetImageManager_oWindow;
150+var SetImageManager_timer;
151+function SetImageManager(){
152+ var oWindow=SetImageManager_oWindow;
153+ if (!oWindow.window.onOK) return;
154+ clearInterval(SetImageManager_timer);
155+ oWindow.window.base_url=FCKConfig.NucleusMediaDir;
156+ oWindow.window.__dlg_close=function(val)
157+ {
158+ var sActualBrowser;
159+ try {
160+ sActualBrowser=oWindow.window.opener.sActualBrowser.toLowerCase();
161+ } catch(e) {
162+ sActualBrowser='';
163+ }
164+ if (val) switch (sActualBrowser){
165+ case "link":
166+ if (oWindow.window.opener.GetE('txtLnkUrl')) oWindow.window.opener.GetE('txtLnkUrl').value=val['f_url'];
167+ break;
168+ default:
169+ if (oWindow.window.opener.GetE('txtUrl')) oWindow.window.opener.GetE('txtUrl').value=val['f_url'];
170+ if (oWindow.window.opener.GetE('txtWidth')) oWindow.window.opener.GetE('txtWidth').value=val['f_width'];
171+ if (oWindow.window.opener.GetE('txtWidth')) oWindow.window.opener.GetE('txtHeight').value=val['f_height'];
172+ //if (oWindow.window.opener.GetE('txtAttTitle')) oWindow.window.opener.GetE('txtAttTitle').value=filename;
173+ }
174+ oWindow.close();
175+ };
176+}
\ No newline at end of file
Binary files /dev/null and b/trunk/NP_MitasNom/mitasnom/editor/plugins/nucleus/Thumbs.db differ
--- /dev/null
+++ b/trunk/NP_MitasNom/mitasnom/editor/plugins/nucleus/fckplugin.js
@@ -0,0 +1,26 @@
1+/*
2+ * NucleusTag plugin for FCKeditor
3+ * The license of this file is GPL.
4+ */
5+
6+// Nucleus Tag
7+var FCKNucleusTagProcessor = new Object() ;
8+FCKNucleusTagProcessor.ProcessDocument = function( document )
9+{
10+ var aLinks = document.getElementsByTagName( 'mitasnom' ) ;
11+ var oLink ;
12+ var i = aLinks.length - 1 ;
13+ while ( i >= 0 && ( oLink = aLinks[i--] ) ) {
14+ if (oLink.title=='nucleustag') {
15+ var oImg = FCKDocumentProcessors_CreateFakeImage( 'FCK__NucleusTag', oLink.cloneNode(true) ) ;
16+ oImg.setAttribute( '_fcknucleustag', 'true', 0 ) ;
17+ oLink.parentNode.insertBefore( oImg, oLink ) ;
18+ oLink.parentNode.removeChild( oLink ) ;
19+ }
20+ }
21+}
22+
23+FCKDocumentProcessors.addItem( FCKNucleusTagProcessor ) ;
24+
25+// Refresh the document
26+FCK.SetHTML( FCK.GetXHTML( FCKConfig.FormatSource ), true ) ;
Binary files /dev/null and b/trunk/NP_MitasNom/mitasnom/editor/plugins/nucleus/nucleus.gif differ
--- /dev/null
+++ b/trunk/NP_MitasNom/mitasnom/fckclass.php
@@ -0,0 +1,39 @@
1+<?php
2+/*
3+ * NP_MitasNom
4+ * Written by Katsumi
5+ * This library is GPL
6+ */
7+
8+if (!class_exists('FCKeditor')) include (dirname(__FILE__).'/fckeditor.php');
9+
10+class NucleusFCKeditor extends FCKeditor
11+{
12+ function NucleusFCKeditor($instanceName, &$plugin, $data='')
13+ {
14+ global $itemid,$blogid,$manager,$DIR_SKINS,$CONF;
15+
16+ $this->__construct( $instanceName ) ;
17+ if ($plugin->getOption('usehttps')=='yes') $this->BasePath=preg_replace('/^http:/','https:',$plugin->getAdminURL());
18+ else $this->BasePath=$plugin->getAdminURL();
19+ $this->Value=$data;
20+ $this->Width=trim($plugin->this_getOption('width'));
21+ $this->Height=trim($plugin->this_getOption('height'));
22+ $this->ToolbarSet=$plugin->this_getOption('toolbar');
23+
24+ // XML and CSS stuffs
25+ if (!$blogid && $itemid) $blogid=getBlogIDFromItemID($itemid);
26+ if (!$blogid) return;
27+ if (!($blog=&$manager->getBlog($blogid))) return;
28+ $skin=new SKIN($blog->getDefaultSkin());
29+ $styledir=$DIR_SKINS.$skin->getIncludePrefix().'mitasnom/';
30+ $styleURL=$CONF['SkinsURL'].$skin->getIncludePrefix().'mitasnom/';
31+ if (file_exists($styledir)) {
32+ if (file_exists($styledir.'fckstyles.xml'))
33+ $this->Config['StylesXmlPath']=$styleURL.'fckstyles.xml';
34+ if (file_exists($styledir.'fckstyles.css'))
35+ $this->Config['EditorAreaCSS']=$styleURL.'fckstyles.css';
36+ }
37+ }
38+}
39+?>
\ No newline at end of file
--- /dev/null
+++ b/trunk/NP_MitasNom/mitasnom/fckconfig.js
@@ -0,0 +1,191 @@
1+/*
2+ * FCKeditor - The text editor for internet
3+ * Copyright (C) 2003-2005 Frederico Caldeira Knabben
4+ *
5+ * Licensed under the terms of the GNU Lesser General Public License:
6+ * http://www.opensource.org/licenses/lgpl-license.php
7+ *
8+ * For further information visit:
9+ * http://www.fckeditor.net/
10+ *
11+ * "Support Open Source software. What about a donation today?"
12+ *
13+ * File Name: fckconfig.js
14+ * Editor configuration settings.
15+ * See the documentation for more info.
16+ *
17+ * File Authors:
18+ * Frederico Caldeira Knabben (fredck@fckeditor.net)
19+ */
20+
21+/*
22+ * fckconfig.js for Nucleus plugin.
23+ * Modified by Katsumi
24+ * The license of this library turned to GPL.
25+ */
26+
27+FCKConfig.EditorAreaCSS = FCKConfig.BasePath + 'css/fck_editorarea.css' ;
28+
29+FCKConfig.DocType = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">' ;
30+
31+FCKConfig.BaseHref = '' ;
32+
33+FCKConfig.FullPage = false ;
34+
35+FCKConfig.Debug = false ;
36+FCKConfig.AllowQueryStringDebug = true ;
37+
38+FCKConfig.SkinPath = FCKConfig.BasePath + 'skins/default/' ;
39+
40+FCKConfig.PluginsPath = FCKConfig.BasePath + 'plugins/' ;
41+
42+// FCKConfig.Plugins.Add( 'placeholder', 'de,en,fr,it,pl' ) ;
43+
44+//ProtectedSources are added in config.php
45+
46+//FCKConfig.ProtectedSource.Add( /<script[\s\S]*?\/script>/gi ) ; // <SCRIPT> tags.
47+//FCKConfig.ProtectedSource.Add( /<%[\s\S]*?%>/g ) ; // ASP style server side code <%...%>
48+//FCKConfig.ProtectedSource.Add( /<\?[\s\S]*?\?>/g ) ; // PHP style server side code <?...?>
49+//FCKConfig.ProtectedSource.Add( /(<asp:[^\>]+>[\s|\S]*?<\/asp:[^\>]+>)|(<asp:[^\>]+\/>)/gi ) ; // ASP.Net style tags <asp:control>
50+
51+FCKConfig.AutoDetectLanguage = true ;
52+FCKConfig.DefaultLanguage = 'en' ;
53+FCKConfig.ContentLangDirection = 'ltr' ;
54+
55+FCKConfig.EnableXHTML = true ; // Unsupported: Do not change.
56+FCKConfig.EnableSourceXHTML = true ; // Unsupported: Do not change.
57+
58+FCKConfig.ProcessHTMLEntities = true ;
59+FCKConfig.IncludeLatinEntities = true ;
60+FCKConfig.IncludeGreekEntities = true ;
61+
62+FCKConfig.FillEmptyBlocks = true ;
63+
64+FCKConfig.FormatSource = true ;
65+FCKConfig.FormatOutput = true ;
66+FCKConfig.FormatIndentator = ' ' ;
67+
68+FCKConfig.ForceStrongEm = true ;
69+FCKConfig.GeckoUseSPAN = true ;
70+FCKConfig.StartupFocus = false ;
71+FCKConfig.ForcePasteAsPlainText = false ;
72+FCKConfig.AutoDetectPasteFromWord = true ; // IE only.
73+FCKConfig.ForceSimpleAmpersand = false ;
74+FCKConfig.TabSpaces = 0 ;
75+FCKConfig.ShowBorders = true ;
76+FCKConfig.ToolbarStartExpanded = true ;
77+FCKConfig.ToolbarCanCollapse = true ;
78+FCKConfig.IEForceVScroll = false ;
79+FCKConfig.IgnoreEmptyParagraphValue = true ;
80+FCKConfig.PreserveSessionOnFileBrowser = false ;
81+FCKConfig.FloatingPanelsZIndex = 10000 ;
82+
83+FCKConfig.ToolbarSets["Default"] = [
84+ ['Source','Save','Preview'],
85+ ['Cut','Copy','Paste'],
86+ ['Find','Replace','RemoveFormat'],
87+ ['Link','Unlink','Anchor'],
88+ ['Image','Table','Smiley','SpecialChar'],
89+ ['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
90+ ['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'],
91+ ['Form','Checkbox','Radio','TextField','Textarea','Select','Button','ImageButton','HiddenField'],
92+ '/',
93+ ['Style','FontFormat'],
94+ ['TextColor','FontName','FontSize']
95+];
96+
97+FCKConfig.ToolbarSets["Full"] = [
98+ ['Source','DocProps','-','Save','NewPage','Preview','-','Templates'],
99+ ['Cut','Copy','Paste','PasteText','PasteWord','-','Print','SpellCheck'],
100+ ['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
101+ ['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'],
102+ ['OrderedList','UnorderedList','-','Outdent','Indent'],
103+ ['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
104+ ['Link','Unlink','Anchor'],
105+ ['Image','Flash','Table','Rule','Smiley','SpecialChar','PageBreak','UniversalKey'],
106+ ['Form','Checkbox','Radio','TextField','Textarea','Select','Button','ImageButton','HiddenField'],
107+ '/',
108+ ['Style','FontFormat','FontName','FontSize'],
109+ ['TextColor','BGColor'],
110+ ['About']
111+] ;
112+
113+FCKConfig.ToolbarSets["Basic"] = [
114+ ['Source','Save','Preview','-','Bold','Italic','RemoveFormat','-','Image','Link','Unlink']
115+] ;
116+
117+FCKConfig.ContextMenu = ['Generic','Link','Anchor','Image','Flash','Select','Textarea','Checkbox','Radio','TextField','HiddenField','ImageButton','Button','BulletedList','NumberedList','TableCell','Table','Form'] ;
118+
119+FCKConfig.FontColors = '000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,808080,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF' ;
120+
121+FCKConfig.FontNames = 'Arial;Comic Sans MS;Courier New;Tahoma;Times New Roman;Verdana' ;
122+FCKConfig.FontSizes = '1/xx-small;2/x-small;3/small;4/medium;5/large;6/x-large;7/xx-large' ;
123+FCKConfig.FontFormats = 'p;div;pre;address;h1;h2;h3;h4;h5;h6' ;
124+
125+FCKConfig.StylesXmlPath = FCKConfig.EditorPath + 'fckstyles.xml' ;
126+FCKConfig.TemplatesXmlPath = FCKConfig.EditorPath + 'fcktemplates.xml' ;
127+
128+FCKConfig.SpellChecker = 'ieSpell' ; // 'ieSpell' | 'SpellerPages'
129+FCKConfig.IeSpellDownloadUrl = 'http://www.iespell.com/rel/ieSpellSetup211325.exe' ;
130+
131+FCKConfig.MaxUndoLevels = 15 ;
132+
133+FCKConfig.DisableImageHandles = false ;
134+FCKConfig.DisableTableHandles = false ;
135+
136+FCKConfig.LinkDlgHideTarget = false ;
137+FCKConfig.LinkDlgHideAdvanced = false ;
138+
139+FCKConfig.ImageDlgHideLink = false ;
140+FCKConfig.ImageDlgHideAdvanced = false ;
141+
142+FCKConfig.FlashDlgHideAdvanced = false ;
143+
144+FCKConfig.SmileyPath = FCKConfig.BasePath + 'images/smiley/msn/' ;
145+FCKConfig.SmileyImages = ['regular_smile.gif','sad_smile.gif','wink_smile.gif','teeth_smile.gif','confused_smile.gif','tounge_smile.gif','embaressed_smile.gif','omg_smile.gif','whatchutalkingabout_smile.gif','angry_smile.gif','angel_smile.gif','shades_smile.gif','devil_smile.gif','cry_smile.gif','lightbulb.gif','thumbs_down.gif','thumbs_up.gif','heart.gif','broken_heart.gif','kiss.gif','envelope.gif'] ;
146+FCKConfig.SmileyColumns = 8 ;
147+FCKConfig.SmileyWindowWidth = 320 ;
148+FCKConfig.SmileyWindowHeight = 240 ;
149+
150+//Following options were Changed for Nucleus.
151+
152+FCKConfig.Plugins.Add('nucleus');
153+
154+//var _FileBrowserLanguage = 'php' ; // asp | aspx | cfm | lasso | perl | php | py
155+//var _QuickUploadLanguage = 'php' ; // asp | aspx | cfm | lasso | php
156+// extension to use for the default File Browser (Perl uses "cgi").
157+//var _FileBrowserExtension = _FileBrowserLanguage == 'perl' ? 'cgi' : _FileBrowserLanguage ;
158+
159+FCKConfig.UseBROnCarriageReturn = true ; // IE only.
160+
161+var NucleusMediaWindowWidth=500;
162+var NucleusMediaWindowHeight=450;
163+var NucleusMediaWindowURL="../../../../media.php";
164+var NucleusMediaDir="media/";
165+
166+FCKConfig.LinkBrowser = true ;
167+FCKConfig.LinkBrowserWindowWidth = NucleusMediaWindowWidth ;
168+FCKConfig.LinkBrowserWindowHeight = NucleusMediaWindowHeight ;
169+FCKConfig.LinkBrowserURL= NucleusMediaWindowURL ;
170+
171+FCKConfig.ImageBrowser = true ;
172+FCKConfig.ImageBrowserWindowWidth = NucleusMediaWindowWidth ;
173+FCKConfig.ImageBrowserWindowHeight = NucleusMediaWindowHeight ;
174+FCKConfig.ImageBrowserURL= NucleusMediaWindowURL;
175+
176+FCKConfig.FlashBrowser = true ;
177+FCKConfig.FlashBrowserWindowWidth = NucleusMediaWindowWidth ;
178+FCKConfig.FlashBrowserWindowHeight = NucleusMediaWindowHeight ;
179+FCKConfig.FlashBrowserURL= NucleusMediaWindowURL;
180+
181+FCKConfig.LinkUpload = false ;
182+FCKConfig.ImageUpload = false ;//Changed for Nucleus
183+FCKConfig.FlashUpload = false ;//Changed for Nucleus
184+
185+FCKConfig.NucleusMediaDir=NucleusMediaDir;
186+
187+FCKConfig.CustomConfigurationsPath = '../config.php' ;
188+
189+//Above options were Changed for Nucleus.
190+
191+if( window.console ) window.console.log( 'Config is loaded!' ) ; // @Packager.Compactor.RemoveLine
\ No newline at end of file
--- /dev/null
+++ b/trunk/NP_MitasNom/mitasnom/fckeditor.js
@@ -0,0 +1,192 @@
1+/*
2+ * FCKeditor - The text editor for internet
3+ * Copyright (C) 2003-2005 Frederico Caldeira Knabben
4+ *
5+ * Licensed under the terms of the GNU Lesser General Public License:
6+ * http://www.opensource.org/licenses/lgpl-license.php
7+ *
8+ * For further information visit:
9+ * http://www.fckeditor.net/
10+ *
11+ * "Support Open Source software. What about a donation today?"
12+ *
13+ * File Name: fckeditor.js
14+ * This is the integration file for JavaScript.
15+ *
16+ * It defines the FCKeditor class that can be used to create editor
17+ * instances in a HTML page in the client side. For server side
18+ * operations, use the specific integration system.
19+ *
20+ * File Authors:
21+ * Frederico Caldeira Knabben (fredck@fckeditor.net)
22+ */
23+
24+// FCKeditor Class
25+var FCKeditor = function( instanceName, width, height, toolbarSet, value )
26+{
27+ // Properties
28+ this.InstanceName = instanceName ;
29+ this.Width = width || '100%' ;
30+ this.Height = height || '200' ;
31+ this.ToolbarSet = toolbarSet || 'Default' ;
32+ this.Value = value || '' ;
33+ this.BasePath = '/fckeditor/' ;
34+ this.CheckBrowser = true ;
35+ this.DisplayErrors = true ;
36+ this.EnableSafari = false ; // This is a temporary property, while Safari support is under development.
37+ this.EnableOpera = false ; // This is a temporary property, while Opera support is under development.
38+
39+ this.Config = new Object() ;
40+
41+ // Events
42+ this.OnError = null ; // function( source, errorNumber, errorDescription )
43+}
44+
45+FCKeditor.prototype.Create = function()
46+{
47+ // Check for errors
48+ if ( !this.InstanceName || this.InstanceName.length == 0 )
49+ {
50+ this._ThrowError( 701, 'You must specify an instance name.' ) ;
51+ return ;
52+ }
53+
54+ document.write( '<div>' ) ;
55+
56+ if ( !this.CheckBrowser || this._IsCompatibleBrowser() )
57+ {
58+ document.write( '<input type="hidden" id="' + this.InstanceName + '" name="' + this.InstanceName + '" value="' + this._HTMLEncode( this.Value ) + '" style="display:none" />' ) ;
59+ document.write( this._GetConfigHtml() ) ;
60+ document.write( this._GetIFrameHtml() ) ;
61+ }
62+ else
63+ {
64+ var sWidth = this.Width.toString().indexOf('%') > 0 ? this.Width : this.Width + 'px' ;
65+ var sHeight = this.Height.toString().indexOf('%') > 0 ? this.Height : this.Height + 'px' ;
66+ document.write('<textarea name="' + this.InstanceName + '" rows="4" cols="40" style="WIDTH: ' + sWidth + '; HEIGHT: ' + sHeight + '">' + this._HTMLEncode( this.Value ) + '<\/textarea>') ;
67+ }
68+
69+ document.write( '</div>' ) ;
70+}
71+
72+FCKeditor.prototype.ReplaceTextarea = function()
73+{
74+ if ( !this.CheckBrowser || this._IsCompatibleBrowser() )
75+ {
76+ // We must check the elements firstly using the Id and then the name.
77+ var oTextarea = document.getElementById( this.InstanceName ) ;
78+ var colElementsByName = document.getElementsByName( this.InstanceName ) ;
79+ var i = 0;
80+ while ( oTextarea || i == 0 )
81+ {
82+ if ( oTextarea && oTextarea.tagName == 'TEXTAREA' )
83+ break ;
84+ oTextarea = colElementsByName[i++] ;
85+ }
86+
87+ if ( !oTextarea )
88+ {
89+ alert( 'Error: The TEXTAREA with id or name set to "' + this.InstanceName + '" was not found' ) ;
90+ return ;
91+ }
92+
93+ oTextarea.style.display = 'none' ;
94+ this._InsertHtmlBefore( this._GetConfigHtml(), oTextarea ) ;
95+ this._InsertHtmlBefore( this._GetIFrameHtml(), oTextarea ) ;
96+ }
97+}
98+
99+FCKeditor.prototype._InsertHtmlBefore = function( html, element )
100+{
101+ if ( element.insertAdjacentHTML ) // IE
102+ element.insertAdjacentHTML( 'beforeBegin', html ) ;
103+ else // Gecko
104+ {
105+ var oRange = document.createRange() ;
106+ oRange.setStartBefore( element ) ;
107+ var oFragment = oRange.createContextualFragment( html );
108+ element.parentNode.insertBefore( oFragment, element ) ;
109+ }
110+}
111+
112+FCKeditor.prototype._GetConfigHtml = function()
113+{
114+ var sConfig = '' ;
115+ for ( var o in this.Config )
116+ {
117+ if ( sConfig.length > 0 ) sConfig += '&amp;' ;
118+ sConfig += escape(o) + '=' + escape( this.Config[o] ) ;
119+ }
120+
121+ return '<input type="hidden" id="' + this.InstanceName + '___Config" value="' + sConfig + '" style="display:none" />' ;
122+}
123+
124+FCKeditor.prototype._GetIFrameHtml = function()
125+{
126+ var sFile = (/fcksource=true/i).test( window.top.location.search ) ? 'fckeditor.original.html' : 'fckeditor.html' ;
127+
128+ var sLink = this.BasePath + 'editor/' + sFile + '?InstanceName=' + this.InstanceName ;
129+ if (this.ToolbarSet) sLink += '&Toolbar=' + this.ToolbarSet ;
130+
131+ return '<iframe id="' + this.InstanceName + '___Frame" src="' + sLink + '" width="' + this.Width + '" height="' + this.Height + '" frameborder="no" scrolling="no"></iframe>' ;
132+}
133+
134+FCKeditor.prototype._IsCompatibleBrowser = function()
135+{
136+ var sAgent = navigator.userAgent.toLowerCase() ;
137+
138+ // Internet Explorer
139+ if ( sAgent.indexOf("msie") != -1 && sAgent.indexOf("mac") == -1 && sAgent.indexOf("opera") == -1 )
140+ {
141+ var sBrowserVersion = navigator.appVersion.match(/MSIE (.\..)/)[1] ;
142+ return ( sBrowserVersion >= 5.5 ) ;
143+ }
144+
145+ // Gecko
146+ if ( navigator.product == "Gecko" && navigator.productSub >= 20030210 )
147+ return true ;
148+
149+ // Opera
150+ if ( this.EnableOpera )
151+ {
152+ var aMatch = sAgent.match( /^opera\/(\d+\.\d+)/ ) ;
153+ if ( aMatch && aMatch[1] >= 9.0 )
154+ return true ;
155+ }
156+
157+ // Safari
158+ if ( this.EnableSafari && sAgent.indexOf( 'safari' ) != -1 )
159+ return ( sAgent.match( /safari\/(\d+)/ )[1] >= 312 ) ; // Build must be at least 312 (1.3)
160+
161+ return false ;
162+}
163+
164+FCKeditor.prototype._ThrowError = function( errorNumber, errorDescription )
165+{
166+ this.ErrorNumber = errorNumber ;
167+ this.ErrorDescription = errorDescription ;
168+
169+ if ( this.DisplayErrors )
170+ {
171+ document.write( '<div style="COLOR: #ff0000">' ) ;
172+ document.write( '[ FCKeditor Error ' + this.ErrorNumber + ': ' + this.ErrorDescription + ' ]' ) ;
173+ document.write( '</div>' ) ;
174+ }
175+
176+ if ( typeof( this.OnError ) == 'function' )
177+ this.OnError( this, errorNumber, errorDescription ) ;
178+}
179+
180+FCKeditor.prototype._HTMLEncode = function( text )
181+{
182+ if ( typeof( text ) != "string" )
183+ text = text.toString() ;
184+
185+ text = text.replace(/&/g, "&amp;") ;
186+ text = text.replace(/"/g, "&quot;") ;
187+ text = text.replace(/</g, "&lt;") ;
188+ text = text.replace(/>/g, "&gt;") ;
189+ text = text.replace(/'/g, "&#39;") ;
190+
191+ return text ;
192+}
\ No newline at end of file
--- /dev/null
+++ b/trunk/NP_MitasNom/mitasnom/fckeditor.php
@@ -0,0 +1,162 @@
1+<?php
2+/*
3+ * FCKeditor - The text editor for internet
4+ * Copyright (C) 2003-2005 Frederico Caldeira Knabben
5+ *
6+ * Licensed under the terms of the GNU Lesser General Public License:
7+ * http://www.opensource.org/licenses/lgpl-license.php
8+ *
9+ * For further information visit:
10+ * http://www.fckeditor.net/
11+ *
12+ * "Support Open Source software. What about a donation today?"
13+ *
14+ * File Name: fckeditor.php
15+ * This is the integration file for PHP.
16+ *
17+ * It defines the FCKeditor class that can be used to create editor
18+ * instances in PHP pages on server side.
19+ *
20+ * File Authors:
21+ * Frederico Caldeira Knabben (fredck@fckeditor.net)
22+ */
23+
24+class FCKeditor
25+{
26+ var $InstanceName ;
27+ var $BasePath ;
28+ var $Width ;
29+ var $Height ;
30+ var $ToolbarSet ;
31+ var $Value ;
32+ var $Config ;
33+
34+ // PHP 5 Constructor (by Marcus Bointon <coolbru@users.sourceforge.net>)
35+ function __construct( $instanceName )
36+ {
37+ $this->InstanceName = $instanceName ;
38+ $this->BasePath = '/FCKeditor/' ;
39+ $this->Width = '100%' ;
40+ $this->Height = '200' ;
41+ $this->ToolbarSet = 'Default' ;
42+ $this->Value = '' ;
43+
44+ $this->Config = array() ;
45+ }
46+
47+ // PHP 4 Contructor
48+ function FCKeditor( $instanceName )
49+ {
50+ $this->__construct( $instanceName ) ;
51+ }
52+
53+ function Create()
54+ {
55+ echo $this->CreateHtml() ;
56+ }
57+
58+ function CreateHtml()
59+ {
60+ $HtmlValue = htmlspecialchars( $this->Value ) ;
61+
62+ $Html = '<div>' ;
63+
64+ if ( $this->IsCompatible() )
65+ {
66+ if ( isset( $_GET['fcksource'] ) && $_GET['fcksource'] == "true" )
67+ $File = 'fckeditor.original.html' ;
68+ else
69+ $File = 'fckeditor.html' ;
70+
71+ $Link = "{$this->BasePath}editor/{$File}?InstanceName={$this->InstanceName}" ;
72+
73+ if ( $this->ToolbarSet != '' )
74+ $Link .= "&amp;Toolbar={$this->ToolbarSet}" ;
75+
76+ // Render the linked hidden field.
77+ $Html .= "<input type=\"hidden\" id=\"{$this->InstanceName}\" name=\"{$this->InstanceName}\" value=\"{$HtmlValue}\" style=\"display:none\" />" ;
78+
79+ // Render the configurations hidden field.
80+ $Html .= "<input type=\"hidden\" id=\"{$this->InstanceName}___Config\" value=\"" . $this->GetConfigFieldString() . "\" style=\"display:none\" />" ;
81+
82+ // Render the editor IFRAME.
83+ $Html .= "<iframe id=\"{$this->InstanceName}___Frame\" src=\"{$Link}\" width=\"{$this->Width}\" height=\"{$this->Height}\" frameborder=\"no\" scrolling=\"no\"></iframe>" ;
84+ }
85+ else
86+ {
87+ if ( strpos( $this->Width, '%' ) === false )
88+ $WidthCSS = $this->Width . 'px' ;
89+ else
90+ $WidthCSS = $this->Width ;
91+
92+ if ( strpos( $this->Height, '%' ) === false )
93+ $HeightCSS = $this->Height . 'px' ;
94+ else
95+ $HeightCSS = $this->Height ;
96+
97+ $Html .= "<textarea name=\"{$this->InstanceName}\" rows=\"4\" cols=\"40\" style=\"width: {$WidthCSS}; height: {$HeightCSS}\">{$HtmlValue}</textarea>" ;
98+ }
99+
100+ $Html .= '</div>' ;
101+
102+ return $Html ;
103+ }
104+
105+ function IsCompatible()
106+ {
107+ global $HTTP_USER_AGENT ;
108+
109+ if ( isset( $HTTP_USER_AGENT ) )
110+ $sAgent = $HTTP_USER_AGENT ;
111+ else
112+ $sAgent = $_SERVER['HTTP_USER_AGENT'] ;
113+
114+ if ( strpos($sAgent, 'MSIE') !== false && strpos($sAgent, 'mac') === false && strpos($sAgent, 'Opera') === false )
115+ {
116+ $iVersion = (float)substr($sAgent, strpos($sAgent, 'MSIE') + 5, 3) ;
117+ return ($iVersion >= 5.5) ;
118+ }
119+ else if ( strpos($sAgent, 'Gecko/') !== false )
120+ {
121+ $iVersion = (int)substr($sAgent, strpos($sAgent, 'Gecko/') + 6, 8) ;
122+ return ($iVersion >= 20030210) ;
123+ }
124+ else
125+ return false ;
126+ }
127+
128+ function GetConfigFieldString()
129+ {
130+ $sParams = '' ;
131+ $bFirst = true ;
132+
133+ foreach ( $this->Config as $sKey => $sValue )
134+ {
135+ if ( $bFirst == false )
136+ $sParams .= '&amp;' ;
137+ else
138+ $bFirst = false ;
139+
140+ if ( $sValue === true )
141+ $sParams .= $this->EncodeConfig( $sKey ) . '=true' ;
142+ else if ( $sValue === false )
143+ $sParams .= $this->EncodeConfig( $sKey ) . '=false' ;
144+ else
145+ $sParams .= $this->EncodeConfig( $sKey ) . '=' . $this->EncodeConfig( $sValue ) ;
146+ }
147+
148+ return $sParams ;
149+ }
150+
151+ function EncodeConfig( $valueToEncode )
152+ {
153+ $chars = array(
154+ '&' => '%26',
155+ '=' => '%3D',
156+ '"' => '%22' ) ;
157+
158+ return strtr( $valueToEncode, $chars ) ;
159+ }
160+}
161+
162+?>
\ No newline at end of file
--- /dev/null
+++ b/trunk/NP_MitasNom/mitasnom/fckstyles.xml
@@ -0,0 +1,47 @@
1+<?xml version="1.0" encoding="utf-8" ?>
2+<!--
3+ * FCKeditor - The text editor for internet
4+ * Copyright (C) 2003-2005 Frederico Caldeira Knabben
5+ *
6+ * Licensed under the terms of the GNU Lesser General Public License:
7+ * http://www.opensource.org/licenses/lgpl-license.php
8+ *
9+ * For further information visit:
10+ * http://www.fckeditor.net/
11+ *
12+ * "Support Open Source software. What about a donation today?"
13+ *
14+ * File Name: fckstyles.xml
15+ * This is the sample style definitions file. It makes the styles combo
16+ * completely customizable.
17+ * See FCKConfig.StylesXmlPath in the configuration file.
18+ *
19+ * File Authors:
20+ * Frederico Caldeira Knabben (fredck@fckeditor.net)
21+
22+ * Modified for Nucleus plugin by Katsumi
23+ * The license turned to GPL.
24+-->
25+<Styles>
26+ <Style name="Image on Left" element="img">
27+ <Attribute name="class" value="leftbox" />
28+ </Style>
29+ <Style name="Image on Right" element="img">
30+ <Attribute name="class" value="rightbox" />
31+ </Style>
32+ <Style name="Custom Bold" element="span">
33+ <Attribute name="style" value="font-weight: bold;" />
34+ </Style>
35+ <Style name="Custom Italic" element="em" />
36+ <Style name="Title" element="span">
37+ <Attribute name="class" value="Title" />
38+ </Style>
39+ <Style name="Code" element="span">
40+ <Attribute name="class" value="Code" />
41+ </Style>
42+ <Style name="Title H3" element="h3" />
43+ <Style name="Custom Ruler" element="hr">
44+ <Attribute name="size" value="1" />
45+ <Attribute name="color" value="#ff0000" />
46+ </Style>
47+</Styles>
\ No newline at end of file
--- /dev/null
+++ b/trunk/NP_MitasNom/mitasnom/fcktemplates.xml
@@ -0,0 +1,78 @@
1+<?xml version="1.0" encoding="utf-8" ?>
2+<Templates imagesBasePath="fck_template/images/">
3+ <Template title="Image and Title" image="template1.gif">
4+ <Description>One main image with a title and text that surround the image.</Description>
5+ <Html>
6+ <![CDATA[
7+ <img style="MARGIN-RIGHT: 10px" height="100" alt="" width="100" align="left"/>
8+ <h3>Type the title here</h3>
9+ Type the text here
10+ ]]>
11+ </Html>
12+ </Template>
13+ <Template title="Strange Template" image="template2.gif">
14+ <Description>A template that defines two colums, each one with a title, and some text.</Description>
15+ <Html>
16+ <![CDATA[
17+ <table cellspacing="0" cellpadding="0" width="100%" border="0">
18+ <tbody>
19+ <tr>
20+ <td width="50%">
21+ <h3>Title 1</h3>
22+ </td>
23+ <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </td>
24+ <td width="50%">
25+ <h3>Title 2</h3>
26+ </td>
27+ </tr>
28+ <tr>
29+ <td>Text 1</td>
30+ <td>&nbsp;</td>
31+ <td>Text 2</td>
32+ </tr>
33+ </tbody>
34+ </table>
35+ More text goes here.
36+ ]]>
37+ </Html>
38+ </Template>
39+ <Template title="Text and Table" image="template3.gif">
40+ <Description>A title with some text and a table.</Description>
41+ <Html>
42+ <![CDATA[
43+ <table align="left" width="80%" border="0" cellspacing="0" cellpadding="0"><tr><td>
44+ <h3>Title goes here</h3>
45+ <p>
46+ <table style="FLOAT: right" cellspacing="0" cellpadding="0" width="150" border="1">
47+ <tbody>
48+ <tr>
49+ <td align="center" colspan="3"><strong>Table title</strong></td>
50+ </tr>
51+ <tr>
52+ <td>&nbsp;</td>
53+ <td>&nbsp;</td>
54+ <td>&nbsp;</td>
55+ </tr>
56+ <tr>
57+ <td>&nbsp;</td>
58+ <td>&nbsp;</td>
59+ <td>&nbsp;</td>
60+ </tr>
61+ <tr>
62+ <td>&nbsp;</td>
63+ <td>&nbsp;</td>
64+ <td>&nbsp;</td>
65+ </tr>
66+ <tr>
67+ <td>&nbsp;</td>
68+ <td>&nbsp;</td>
69+ <td>&nbsp;</td>
70+ </tr>
71+ </tbody>
72+ </table>
73+ Type the text here</p>
74+ </td></tr></table>
75+ ]]>
76+ </Html>
77+ </Template>
78+</Templates>
--- /dev/null
+++ b/trunk/NP_MitasNom/mitasnom/index.php
@@ -0,0 +1 @@
1+<html><body>There is nothing to see here.</body></html>
\ No newline at end of file
--- /dev/null
+++ b/trunk/NP_MitasNom/mitasnom/language/japanese-euc.php
@@ -0,0 +1,26 @@
1+<?php
2+$this->langArray['WYSIWYG HTML editor plagin using FCKeditor']='FCKeditorを利用した、WYSIWYGタイプのHTMLエディター';
3+$this->langArray['Width']='表示する幅';
4+$this->langArray['Height']='表示する高さ';
5+$this->langArray['Toolbar']='使用するツールバー';
6+$this->langArray['Custom Toolbar']='カスタムツールバー';
7+$this->langArray['Add new toolbar to the menu / Delete toolbar from the menu']='ツールバーをメニューに追加 / もしくは、メニューから削除';
8+$this->langArray['"<br />" => "<br />\n" conversion?']='"<br />" を "<br />\n" に変換しますか?';
9+$this->langArray['"<br /><br />" => "<br />\n<br />\n" conversion?']='"<br /><br />"を "<br />\n<br />\n" に変換しますか?';
10+$this->langArray['Width of Popup dialog']='ポップアップウィンドウの幅';
11+$this->langArray['Height of Popup dialog']='ポップアップウィンドウの高さ';
12+$this->langArray['Protected Sources']='保護するソースコード';
13+$this->langArray['Additional Protected Sources']='保護するソースコード(追加分)';
14+$this->langArray['Use member-specific settings?']='メンバーごとの設定を用いますか?';
15+$this->langArray['New Item with WYSIWYG']='WYSIWYG で新しい記事';
16+$this->langArray['Edit Item with WYSIWYG']='WYSIWYG で編集';
17+$this->langArray['WYSIWYG:body']='WYSIWYG:本文';
18+$this->langArray['WYSIWYG:more']='WYSIWYG:続き';
19+$this->langArray['Toolbar definition is empty']='ツールバー設定が空白です';
20+$this->langArray['Default, Full, Basic and Custom toolbars cannot be removed.']='Default, Full, Basic 及び Custom ツールバーは削除できません';
21+$this->langArray[' Toolbar']=' ツールバー';
22+$this->langArray[' toolbar is added.']=' ツールバーを追加しました';
23+$this->langArray[' toolbar is deleted.']=' ツールバーを削除しました';
24+$this->langArray['Use Image-Manager plugin instead of media.php?']='media.php の代わりに Image-Manager プラグインを用いますか?';
25+$this->langArray['Use secure server (https) for edititing item?']='編集に、セキュアサーバ(https)を用いますか?';
26+?>
\ No newline at end of file
--- /dev/null
+++ b/trunk/NP_MitasNom/mitasnom/language/japanese-utf8.php
@@ -0,0 +1,26 @@
1+<?php
2+$this->langArray['WYSIWYG HTML editor plagin using FCKeditor']='FCKeditorを利用した、WYSIWYGタイプのHTMLエディター';
3+$this->langArray['Width']='表示する幅';
4+$this->langArray['Height']='表示する高さ';
5+$this->langArray['Toolbar']='使用するツールバー';
6+$this->langArray['Custom Toolbar']='カスタムツールバー';
7+$this->langArray['Add new toolbar to the menu / Delete toolbar from the menu']='ツールバーをメニューに追加 / もしくは、メニューから削除';
8+$this->langArray['"<br />" => "<br />\n" conversion?']='"<br />" を "<br />\n" に変換しますか?';
9+$this->langArray['"<br /><br />" => "<br />\n<br />\n" conversion?']='"<br /><br />"を "<br />\n<br />\n" に変換しますか?';
10+$this->langArray['Width of Popup dialog']='ポップアップウィンドウの幅';
11+$this->langArray['Height of Popup dialog']='ポップアップウィンドウの高さ';
12+$this->langArray['Protected Sources']='保護するソースコード';
13+$this->langArray['Additional Protected Sources']='保護するソースコード(追加分)';
14+$this->langArray['Use member-specific settings?']='メンバーごとの設定を用いますか?';
15+$this->langArray['New Item with WYSIWYG']='WYSIWYG で新しい記事';
16+$this->langArray['Edit Item with WYSIWYG']='WYSIWYG で編集';
17+$this->langArray['WYSIWYG:body']='WYSIWYG:本文';
18+$this->langArray['WYSIWYG:more']='WYSIWYG:続き';
19+$this->langArray['Toolbar definition is empty']='ツールバー設定が空白です';
20+$this->langArray['Default, Full, Basic and Custom toolbars cannot be removed.']='Default, Full, Basic 及び Custom ツールバーは削除できません';
21+$this->langArray[' Toolbar']=' ツールバー';
22+$this->langArray[' toolbar is added.']=' ツールバーを追加しました';
23+$this->langArray[' toolbar is deleted.']=' ツールバーを削除しました';
24+$this->langArray['Use Image-Manager plugin instead of media.php?']='media.php の代わりに Image-Manager プラグインを用いますか?';
25+$this->langArray['Use secure server (https) for edititing item?']='編集に、セキュアサーバ(https)を用いますか?';
26+?>
\ No newline at end of file
--- /dev/null
+++ b/trunk/NP_MitasNom/mitasnom/popup.php
@@ -0,0 +1,48 @@
1+<?php
2+/*
3+ * NP_MitasNom
4+ * Written by Katsumi
5+ * This library is GPL
6+ */
7+ $strRel = '../../../';
8+ require($strRel . 'config.php');
9+
10+ // create the admin area page
11+ if (!$member->isLoggedIn()) exit;
12+ include($DIR_LIBS . 'PLUGINADMIN.php');
13+ $oPluginAdmin = new PluginAdmin('MitasNom');
14+ $p=&$oPluginAdmin->plugin;
15+
16+ if (!class_exists('NucleusFCKeditor')) include (dirname(__FILE__).'/fckclass.php');
17+
18+ $id=htmlspecialchars(requestVar('id'),ENT_QUOTES);
19+ $blogid=(int)requestVar('blogid');
20+?><html>
21+<head>
22+<script type="text/javascript">
23+function getId(){
24+<?php echo "return '$id';\n"; ?>
25+}
26+function event_onload(){
27+ var id=getId();
28+ if (!id) return;
29+ document.getElementById('inputbody').value=window.opener.WYSIWYGgettext(id);
30+}
31+function event_onsubmit(){
32+ var id=getId();
33+ if (!id) return;
34+ window.opener.focus();
35+ window.opener.WYSIWYGsettext(id,document.getElementById('inputbody').value);
36+ window.close();
37+}
38+</script>
39+<body onload="event_onload();">
40+<form method="get" action="javascript:event_onsubmit();">
41+<?php
42+ $FCKedit=new NucleusFCKEditor('inputbody',$p);
43+ $FCKedit->Width='100%';
44+ $FCKedit->Height='100%';
45+ $FCKedit->Create();
46+?>
47+</form>
48+</body></html>
\ No newline at end of file
Show on old repository browser