Skip to content

Commit

Permalink
Missing Editor breaks the script
Browse files Browse the repository at this point in the history
  • Loading branch information
dgrammatiko committed Nov 4, 2015
1 parent 7abe00f commit 1f43f48
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Expand Up @@ -19,6 +19,7 @@
$trashed = $this->state->get('filter.state') == -2 ? true : false;
$canOrder = $user->authorise('core.edit.state', 'com_modules');
$saveOrder = $listOrder == 'ordering';
$editor = JFactory::getApplication()->input->get('editor', '');

if ($saveOrder)
{
Expand Down Expand Up @@ -46,12 +47,12 @@
};
moduleIns = function(type, name) {
parent.window.jInsertEditorText("{loadmodule " + type + "," + name + "," + jQuery("#extra_class").val() + "}");
parent.window.jInsertEditorText("{loadmodule " + type + "," + name + "," + jQuery("#extra_class").val() + "}", "' . $editor . '");
parent.window.jModalClose();
}
modulePosIns = function(position) {
parent.window.jInsertEditorText("{loadposition " + position + "," + jQuery("#extra_class").val() + "}");
parent.window.jInsertEditorText("{loadposition " + position + "," + jQuery("#extra_class").val() + "}", "' . $editor . '");
parent.window.jModalClose();
}
');
Expand Down
6 changes: 3 additions & 3 deletions plugins/editors-xtd/module/module.php
Expand Up @@ -10,7 +10,7 @@
defined('_JEXEC') or die;

/**
* Editor Module buton
* Editor Module button
*
* @since 3.5
*/
Expand All @@ -30,13 +30,13 @@ class PlgButtonModule extends JPlugin
* @since 3.5
* @return array
*/
public function onDisplay()
public function onDisplay($name)
{
/*
* Use the built-in element view to select the module.
* Currently uses blank class.
*/
$link = 'index.php?option=com_modules&view=modules&layout=modal&tmpl=component&' . JSession::getFormToken() . '=1';
$link = 'index.php?option=com_modules&view=modules&layout=modal&tmpl=component&editor=' . $name . '&' . JSession::getFormToken() . '=1';

$button = new JObject;
$button->modal = true;
Expand Down

0 comments on commit 1f43f48

Please sign in to comment.