1<?php
2
3/**
4 * GrenSladaWritezor Edit page.
5 *
6 * @license    GNU General Public License Version 2 (http://www.gnu.org/licenses/gpl.html)
7 * @author     Stanford Ng <stng@theculprit.com>
8 */
9?>
10<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
11<html>
12	<head>
13    <title>GrenSladaWritezor :: Edit Page</title>
14		<script type="text/javascript" src="./fckeditor/fckeditor.js"></script>
15<script language="JavaScript">
16<!--
17
18    function saveAndClose(s) {
19
20        sText = opener.document.getElementById("wiki__text").value;
21        tagStart = sText.indexOf("<EMBEDDED_HTML>");
22        if(tagStart==-1) {
23            // --- No existing tag, just insert at the current cursor. ---
24            opener.insertTags('wiki__text', '<EMBEDDED_HTML>'+s+'</EMBEDDED_HTML>','','');
25        } else {
26            // --- Replace first EMBEDDED_HTML tag. ---
27            leftText = sText.substring(0, tagStart);
28            rightText = "";
29            tagEnd = sText.indexOf("</EMBEDDED_HTML>");
30            if(tagEnd > -1) {
31                rightText = sText.substring(tagEnd+"</EMBEDDED_HTML>".length);
32            }
33            opener.document.getElementById("wiki__text").value = leftText + '<EMBEDDED_HTML>' + s + '</EMBEDDED_HTML>' + rightText;
34        }
35        close();
36    }
37
38//-->
39</script>
40</head>
41<body>
42    <h2>GrenSladaWritezor :: Edit</h2>
43    <script type="text/javascript">
44<!--
45
46var oFCKeditor = new FCKeditor( 'GrenText' ) ;
47oFCKeditor.Config['CustomConfigurationsPath'] = '../../gren_toolbar_config.js' ;
48oFCKeditor.BasePath = './fckeditor/';
49oFCKeditor.ToolbarSet = 'GrenToolbar';
50sText = opener.document.getElementById("wiki__text").value;
51tagStart = sText.indexOf("<EMBEDDED_HTML>");
52if(tagStart>-1) {
53    tagStart = tagStart + "<EMBEDDED_HTML>".length;
54    tagEnd = sText.indexOf("</EMBEDDED_HTML>");
55    if(tagEnd == -1) {
56        sText = sText.substring(tagStart);
57    } else {
58        sText = sText.substring(tagStart,tagEnd);
59    }
60}
61oFCKeditor.Value		= sText;
62oFCKeditor.Height = "70%";
63oFCKeditor.Create() ;
64//-->
65    </script>
66    <a href="javascript:saveAndClose(FCKeditorAPI.GetInstance('GrenText').GetHTML());">Save</a>
67	</form>
68    <br>
69</body>
70</html>
71