Skip to content

Commit

Permalink
Run fullPaths() on update_col email, plus convert to new helper names…
Browse files Browse the repository at this point in the history
…pacing.
  • Loading branch information
cheesegrits committed Feb 19, 2018
1 parent 2325588 commit 3d824f7
Showing 1 changed file with 24 additions and 15 deletions.
39 changes: 24 additions & 15 deletions plugins/fabrik_list/update_col/update_col.php
Expand Up @@ -11,6 +11,8 @@
// No direct access
defined('_JEXEC') or die('Restricted access');

use Fabrik\Helpers\Pdf;
use Fabrik\Helpers\Worker;
use Joomla\Utilities\ArrayHelper;

// Require the abstract plugin class
Expand Down Expand Up @@ -236,7 +238,7 @@ public function process($opts = array())
if (!empty($preEval))
{
$res = FabrikHelperHTML::isDebug() ? eval($preEval) : @eval($preEval);
FabrikWorker::logEval($res, 'Caught exception on eval in updatecol::process() : %s');
Worker::logEval($res, 'Caught exception on eval in updatecol::process() : %s');

if ($res === false)
{
Expand Down Expand Up @@ -290,7 +292,7 @@ public function process($opts = array())
{
@trigger_error('');
$msg = @eval($postEval);
FabrikWorker::logEval($msg, 'Caught exception on eval in updatecol::process() : %s');
Worker::logEval($msg, 'Caught exception on eval in updatecol::process() : %s');

if (!empty($msg))
{
Expand Down Expand Up @@ -324,8 +326,7 @@ protected function sendEmails($ids)

if (!empty($emailColID) || !empty($emailTo))
{
$w = new FabrikWorker;
jimport('joomla.mail.helper');
$w = new Worker;
$aids = explode(',', $ids);
$message = $params->get('update_email_msg');
$subject = $params->get('update_email_subject');
Expand Down Expand Up @@ -353,7 +354,7 @@ protected function sendEmails($ids)
{
$email = trim($email);

if (!(JMailHelper::cleanAddress($email) && FabrikWorker::isEmail($email)))
if (!(JMailHelper::cleanAddress($email) && Worker::isEmail($email)))
{
$cleanTo = false;
}
Expand All @@ -372,11 +373,20 @@ protected function sendEmails($ids)
if ($eval)
{
$thisMessage = @eval($thisMessage);
FabrikWorker::logEval($thisMessage, 'Caught exception on eval in updatecol::process() : %s');
Worker::logEval($thisMessage, 'Caught exception on eval in updatecol::process() : %s');
}

$mail = JFactory::getMailer();
$res = $mail->sendMail($from, $fromName, $to, $thisSubject, $thisMessage, true);
Pdf::fullPaths($thisMessage);

$res = Worker::sendMail(
$from,
$fromName,
$to,
$thisSubject,
$thisMessage,
true
);


if ($res)
{
Expand Down Expand Up @@ -465,7 +475,7 @@ private function getEmailElement()
$params = $this->getParams();
$emailColID = $params->get('update_email_element', '');

return FabrikWorker::getPluginManager()->getElementPlugin($emailColID);
return Worker::getPluginManager()->getElementPlugin($emailColID);
}

/**
Expand Down Expand Up @@ -505,7 +515,7 @@ private function emailTo($row, $emailWhich)
if ($params->get('update_email_to_eval', '0') === '1')
{
$to = @eval($to);
FabrikWorker::logEval($to, 'Caught exception on eval in updatecol::emailTo() : %s');
Worker::logEval($to, 'Caught exception on eval in updatecol::emailTo() : %s');
}
}

Expand Down Expand Up @@ -540,7 +550,7 @@ private function _process(&$model, $col, $val, $eval = false)
if ($eval)
{
$val = @eval($val);
FabrikWorker::logEval($val, 'Caught exception on eval in updatecol::_process() : %s');
Worker::logEval($val, 'Caught exception on eval in updatecol::_process() : %s');
}

$model->updateRows($ids, $col, $val);
Expand Down Expand Up @@ -607,16 +617,15 @@ protected function userSelectForm()
$listRef = $model->getRenderContext();
$prefix = 'fabrik___update_col[list_' . $listRef . '][';
$elements = '<select class="inputbox key update_col_elements" size="1" name="' . $prefix . 'key][]">' . implode("\n", $options) . '</select>';
$j3 = FabrikWorker::j3();
$addImg = $j3 ? 'plus' : 'add.png';
$removeImg = $j3 ? 'remove' : 'del.png';
$addImg = 'plus';
$removeImg = 'remove';


$layout = $this->getLayout('form');
$layoutData = new stdClass;
$layoutData->listRef = $listRef;
$layoutData->renderOrder = $this->renderOrder;
$layoutData->j3 = $j3;
$layoutData->j3 = true;
$layoutData->addImg = FabrikHelperHTML::image($addImg, 'list', $model->getTmpl());
$layoutData->delImg = FabrikHelperHTML::image($removeImg, 'list', $model->getTmpl());
$layoutData->elements = $elements;
Expand Down

0 comments on commit 3d824f7

Please sign in to comment.