From 881adeeeda4763202bdde2a02ff2fcf0786620d8 Mon Sep 17 00:00:00 2001 From: Cameron Date: Mon, 29 Feb 2016 22:01:58 -0800 Subject: [PATCH] Added more missing data from page vars. Precaution for if mb_convert_encoding() is missing. TinyMce member template added. --- e107_handlers/e_parse_class.php | 7 +++++-- e107_plugins/tinymce4/templates/member.xml | 24 ++++++++++++++++++++++ page.php | 8 ++++++-- 3 files changed, 35 insertions(+), 4 deletions(-) create mode 100644 e107_plugins/tinymce4/templates/member.xml diff --git a/e107_handlers/e_parse_class.php b/e107_handlers/e_parse_class.php index 04982cb87..ee0ea9512 100644 --- a/e107_handlers/e_parse_class.php +++ b/e107_handlers/e_parse_class.php @@ -4157,8 +4157,11 @@ return; $doc = $this->domObj; libxml_use_internal_errors(true); // @$doc->loadHTML($html); - $html = mb_convert_encoding($html, 'HTML-ENTITIES', "UTF-8"); - @$doc->loadHTML($html); + if(function_exists('mb_convert_encoding')) + { + $html = mb_convert_encoding($html, 'HTML-ENTITIES', "UTF-8"); + } + @$doc->loadHTML($html); // $doc->encoding = 'UTF-8'; // $doc->resolveExternals = true; diff --git a/e107_plugins/tinymce4/templates/member.xml b/e107_plugins/tinymce4/templates/member.xml new file mode 100644 index 000000000..c449a5999 --- /dev/null +++ b/e107_plugins/tinymce4/templates/member.xml @@ -0,0 +1,24 @@ + + + advlist autolink autosave lists link image charmap print preview hr anchor pagebreak searchreplace wordcount visualchars fullscreen + insertdatetime media nonbreaking table contextmenu directionality emoticons template paste textcolor + edit view insert table tools + undo redo | removeformat | styleselect | bold italic underline forecolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image template | smileys | preview + e107 compat3x + false + i[*], bbcode[*] + [ + { + title: "Bootstrap table", + url: "{e_PLUGIN}tinymce4/snippets/bootstrap_table.htm", + description: "Adds a Bootstrap 3 table" + }, + { + title: "Example", + content: "Example Content", + description: "Adds an example." + } + ] + + { class: 'table table-striped table-bordered' } + diff --git a/page.php b/page.php index 2653d1d54..519db13d4 100644 --- a/page.php +++ b/page.php @@ -438,7 +438,7 @@ class pageClass //$bookId = $row['chapter_parent']; $bookSef = $this->getSef($row['chapter_parent']); $bookTitle = $this->getName($row['chapter_parent']); - + $urlData = array( 'chapter_id' => $row['chapter_id'], 'chapter_name' => $tp->toHtml($row['chapter_name']), @@ -490,10 +490,14 @@ class pageClass 'title' => $page['page_title'], 'text' => $tp->toHtml($page['page_text'],true) );*/ + $page['chapter_id'] = $page['page_chapter']; + $page['chapter_name'] = $this->getName($page['page_chapter']); $page['chapter_parent'] = $this->getParent($page['page_chapter']); $page['chapter_sef'] = $this->getSef($page['page_chapter']); // $chapter_sef; + + $page['book_id'] = $page['chapter_parent']; + $page['book_name'] = $this->getName($page['chapter_parent']); $page['book_sef'] = $bookSef; - $page['book_id'] = $this->getParent($page['chapter_parent']); // $this->page = $page; $this->batch->setVars($page);