1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-04 13:47:31 +02:00

Issue #2584 - Allowing for custom TinyMce snippets.

This commit is contained in:
Cameron
2017-04-28 12:05:19 -07:00
parent 61e4582b85
commit 6dbe1c01da

View File

@@ -932,7 +932,12 @@ class wysiwyg
private function getSnippets() private function getSnippets()
{ {
$files = e107::getFile()->get_files(e_PLUGIN."tinymce4/snippets");
$customPath = THEME."templates/tinymce/snippets";
$path = is_dir($customPath) ? $customPath : e_PLUGIN."tinymce4/snippets";
$files = e107::getFile()->get_files($path);
$ret = array(); $ret = array();
foreach($files as $f) foreach($files as $f)
@@ -942,7 +947,8 @@ class wysiwyg
preg_match('/<!--[^\w]*Title:[\s]([^\r\n]*)[\s]*Info: ?([^\r\n]*)/is', $content, $m); preg_match('/<!--[^\w]*Title:[\s]([^\r\n]*)[\s]*Info: ?([^\r\n]*)/is', $content, $m);
if(!empty($m[1])) if(!empty($m[1]))
{ {
$url = e_PLUGIN_ABS."tinymce4/snippets/".$f['fname']; // $url = e_PLUGIN_ABS."tinymce4/snippets/".$f['fname'];
$url =$path."/".$f['fname'];
$ret[] = array('title'=>trim($m[1]), 'url'=>$url, 'description'=>trim($m[2])); $ret[] = array('title'=>trim($m[1]), 'url'=>$url, 'description'=>trim($m[2]));
} }
} }