function resume() { $cid = JRequest::getVar('cid', '', 'post', 'array'); if (!$cid) { $msg = JText::_('JM_INVALID_CAMPAIGNID'); $error = 'error'; } else { $error = ''; $params =& JComponentHelper::getParams('com_joomailermailchimpintegration'); $paramsPrefix = version_compare(JVERSION, '1.6.0', 'ge') ? 'params.' : ''; $MCapi = $params->get($paramsPrefix . 'MCapi'); $MC = new joomlamailerMCAPI($MCapi); $MCerrorHandler = new MCerrorHandler(); foreach ($cid as $c) { $result = $MC->campaignResume($c); if (!$result) { $msg = $MCerrorHandler->getErrorMsg($MC); $error = 'error'; break; } } if (!$error) { $msg = JText::_('JM_CAMPAIGNS_RESUMED'); $error = ''; } } $link = 'index.php?option=com_joomailermailchimpintegration&view=campaignlist&filter_status=' . JRequest::getVar('type', 'sent'); $this->setRedirect($link, $msg, $error); }