瀏覽代碼

Changes to TinyMCE

tags/rls1
kenn408k 6 年之前
父節點
當前提交
36e8102685
共有 2 個檔案被更改,包括 34 行新增7 行删除
  1. 1
    7
      classes/design.class.php
  2. 33
    0
      js/tiny.php

+ 1
- 7
classes/design.class.php 查看文件

@@ -163,13 +163,7 @@ class Design {
163 163
 
164 164
         <!-- WYSIWYG -->
165 165
         <script src="' . Config::$sys_url . 'js/tinymce/tinymce.min.js" referrerpolicy="origin"></script>
166
-        <script>
167
-  tinymce.init({
168
-    selector: \'.editor\',
169
-    menubar: false,
170
-    height: \'400px\'
171
-  });
172
-  </script>
166
+        <script src="' . Config::$sys_url . 'js/tiny.php" referrerpolicy="origin"></script>
173 167
         ';
174 168
         }
175 169
 

+ 33
- 0
js/tiny.php 查看文件

@@ -0,0 +1,33 @@
1
+<?php
2
+/*
3
+ *  Made by DFiNE (Kenneth Hedahl)
4
+ *  Copyright DIS (www.dfine.net)
5
+ *  -----------------------------
6
+ */
7
+
8
+mb_internal_encoding("utf-8"); // Internal encoding set to UTF-8, should fix some charset issues.
9
+
10
+session_start(); // Start PHP session, so we can handle session-data on all pages.
11
+
12
+require_once("../include.php"); // Our includes.
13
+
14
+if (isset($_SESSION['user'])) {
15
+    if (User::checkLevel("75")) {
16
+        ?>
17
+
18
+        tinymce.init({
19
+        selector: '.editor',
20
+        plugins: 'image',
21
+        toolbar: "undo redo | styleselect | bold italic | image | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent",
22
+        menubar: false,
23
+        image_list: [
24
+        {title: 'My image 1', value: 'https://www.tinymce.com/my1.gif'},
25
+        {title: 'My image 2', value: 'http://www.moxiecode.com/my2.gif'}
26
+        ],
27
+        height: '400px'
28
+        });
29
+
30
+
31
+        <?php
32
+    }
33
+}

Loading…
取消
儲存