diff --git a/src/administrator/components/com_kunena/controllers/plugin.php b/src/administrator/components/com_kunena/controllers/plugin.php index b857d56891..356856cb2a 100644 --- a/src/administrator/components/com_kunena/controllers/plugin.php +++ b/src/administrator/components/com_kunena/controllers/plugin.php @@ -556,6 +556,9 @@ public function save($key = null, $urlVar = null) ) ); + $editor = KunenaBbcodeEditor::getInstance(); + $editor->initializeHMVC(); + // Redirect the user and adjust session state based on the chosen task. switch ($task) { diff --git a/src/administrator/components/com_kunena/controllers/plugins.php b/src/administrator/components/com_kunena/controllers/plugins.php index 99afd947dd..bcb8b30d00 100644 --- a/src/administrator/components/com_kunena/controllers/plugins.php +++ b/src/administrator/components/com_kunena/controllers/plugins.php @@ -136,6 +136,9 @@ public function publish() } } + $editor = KunenaBbcodeEditor::getInstance(); + $editor->initializeHMVC(); + $extension = $this->input->get('extension'); $extensionURL = ($extension) ? '&extension=' . $extension : ''; $this->setRedirect(JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_list . $extensionURL, false)); @@ -248,6 +251,9 @@ public function checkin() } else { + $editor = KunenaBbcodeEditor::getInstance(); + $editor->initializeHMVC(); + // Checkin succeeded. $message = JText::plural($this->text_prefix . '_N_ITEMS_CHECKED_IN', count($ids)); $this->setRedirect(JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_list, false), $message); @@ -255,4 +261,18 @@ public function checkin() return true; } } + + /** + * Regenerate editor file + * + * @since 5.0.2 + */ + public function resync() + { + $editor = KunenaBbcodeEditor::getInstance(); + $editor->initializeHMVC(); + + $message = 'Sync done'; + $this->setRedirect(JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_list, false), $message); + } } diff --git a/src/administrator/components/com_kunena/views/plugins/view.html.php b/src/administrator/components/com_kunena/views/plugins/view.html.php index 664d4cef95..52e0c4484c 100644 --- a/src/administrator/components/com_kunena/views/plugins/view.html.php +++ b/src/administrator/components/com_kunena/views/plugins/view.html.php @@ -66,6 +66,8 @@ protected function setToolbar() JToolbarHelper::divider(); JToolbarHelper::checkin('checkin'); JToolbarHelper::spacer(); + JToolbarHelper::custom('resync', 'refresh.png', 'refresh_f2.png', 'JTOOLBAR_REBUILD', false); + JToolbarHelper::spacer(); $help_url = 'https://www.kunena.org/docs/'; JToolBarHelper::help('COM_KUNENA', false, $help_url); } diff --git a/src/libraries/kunena/bbcode/editor.php b/src/libraries/kunena/bbcode/editor.php index 11a40d28fe..e3905a6266 100644 --- a/src/libraries/kunena/bbcode/editor.php +++ b/src/libraries/kunena/bbcode/editor.php @@ -173,11 +173,6 @@ public function initialize() $template = KunenaFactory::getTemplate(); $this->isHMVC = $template->isHmvc(); - - if ($this->isHMVC) - { - $this->initializeHMVC(); - } } /**