Skip to content

Commit

Permalink
Couple of fizes for list plugin - TinyMCE fix, plus routing for popup…
Browse files Browse the repository at this point in the history
… for SEF mode.
  • Loading branch information
cheesegrits committed Feb 21, 2018
1 parent 273a3d3 commit fc471f9
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 11 deletions.
2 changes: 1 addition & 1 deletion plugins/fabrik_list/email/email-min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 6 additions & 8 deletions plugins/fabrik_list/email/email.js
Expand Up @@ -21,7 +21,9 @@ define(['jquery', 'fab/list-plugin', 'fab/fabrik'], function (jQuery, FbListPlug
WFEditor.getContent('message');
}
else if (typeof tinymce !== 'undefined') {
tinyMCE.activeEditor.save();
if (tinyMCE.activeEditor) {
tinyMCE.activeEditor.save();
}
}
var url = Fabrik.liveSite + '/index.php';
if (self.options.additionalQS !== '') {
Expand Down Expand Up @@ -80,9 +82,8 @@ define(['jquery', 'fab/list-plugin', 'fab/fabrik'], function (jQuery, FbListPlug
},

buttonAction: function () {
var url = Fabrik.liveSite + '/index.php?option=com_fabrik&controller=list.email&task=popupwin&tmpl=component&ajax=1&id=' +
this.listid + '&renderOrder=' + this.options.renderOrder,
self = this;
var url = this.options.popupUrl;
var self = this;
this.listform.getElements('input[name^=ids]').each(function (id) {
if (id.get('value') !== false && id.checked !== false) {
url += '&ids[]=' + id.get('value');
Expand All @@ -94,10 +95,7 @@ define(['jquery', 'fab/list-plugin', 'fab/fabrik'], function (jQuery, FbListPlug
else {
url += '&checkAll=0';
}
url += '&format=partial';
if (this.options.additionalQS !== '') {
url += '&' + this.options.additionalQS;
}
url += '&task=popupwin';
var id = 'email-list-plugin';
this.windowopts = {
id : id,
Expand Down
21 changes: 19 additions & 2 deletions plugins/fabrik_list/email/models/email.php
Expand Up @@ -11,8 +11,8 @@
// No direct access
defined('_JEXEC') or die('Restricted access');

use Joomla\Utilities\ArrayHelper;
use Fabrik\Helpers\StringHelper;
use Joomla\Utilities\ArrayHelper;

require_once COM_FABRIK_FRONTEND . '/models/plugin-list.php';

Expand Down Expand Up @@ -113,6 +113,23 @@ public function onLoadJavascriptInstance($args)
$opts = $this->getElementJSOptions();
$opts->renderOrder = $this->renderOrder;
$opts->additionalQS = $w->parseMessageForPlaceHolder($params->get('list_email_additional_qs', ''));

$url = 'index.php?option=com_fabrik';
$url .= '&view=list';
$url .= '&controller=list.email';
//$url .= '&task=popupwin';
$url .= '&tmpl=component';
$url .= '&ajax=1';
$url .= '&id=' . $this->getModel()->getId();
$url .= '&renderOrder=' . $this->renderOrder;
$url .= '&format=partial';

if (!empty($opts->additionalQS))
{
$url .= '&' . $opts->additionalQS;
}

$opts->popupUrl = JRoute::_($url);
$opts = json_encode($opts);
$this->jsInstance = "new FbListEmail($opts)";

Expand Down Expand Up @@ -1115,7 +1132,7 @@ public function getEditor()

if ($params->get('wysiwyg', true))
{
$editor = JEditor::getInstance($this->config->get('editor'));
$editor = \JEditor::getInstance($this->config->get('editor'));

return $editor->display('message', $msg, '100%', '200px', 75, 10, true, 'message');
}
Expand Down

0 comments on commit fc471f9

Please sign in to comment.