function saveGeolocation($geoloc_action, $subid) { $config = acymailing_config(); $geoloc_config = $config->get('geolocation'); if (stripos($geoloc_config, $geoloc_action) === false) { return false; } $geo_element = new stdClass(); $geo_element->geolocation_subid = $subid; $geo_element->geolocation_type = $geoloc_action; $userHelper = acymailing_get('helper.user'); $geo_element->geolocation_ip = $userHelper->getIP(); if (empty($geo_element->geolocation_subid) || empty($geo_element->geolocation_ip)) { return false; } $geo_element = $this->getIpLocation($geo_element); if ($geo_element != false) { return parent::save($geo_element); } else { return false; } }
function save($element) { if (empty($element->tempid)) { if (empty($element->namekey)) { $element->namekey = time() . JFilterOutput::stringURLSafe($element->name); } } else { if (file_exists(ACYMAILING_TEMPLATE . 'css' . DS . 'template_' . intval($element->tempid) . '.css')) { jimport('joomla.filesystem.file'); if (!JFile::delete(ACYMAILING_TEMPLATE . 'css' . DS . 'template_' . intval($element->tempid) . '.css')) { echo acymailing_display('Could not delete the file ' . ACYMAILING_TEMPLATE . 'css' . DS . 'template_' . intval($element->tempid) . '.css', 'error'); } } } if (!empty($element->styles) and !is_string($element->styles)) { $element->styles = serialize($element->styles); } if (!empty($element->stylesheet)) { $element->stylesheet = preg_replace('#:(active|current|visited)#i', '', $element->stylesheet); } return parent::save($element); }
function save($element) { if (empty($element->tempid)) { if (empty($element->namekey)) { $element->namekey = time() . JFilterOutput::stringURLSafe($element->name); } } else { if (file_exists(ACYMAILING_MEDIA . 'css' . DS . 'template_' . intval($element->tempid) . '.css')) { jimport('joomla.filesystem.file'); if (!JFile::delete(ACYMAILING_MEDIA . 'css' . DS . 'template_' . intval($element->tempid) . '.css')) { echo acymailing::display('Could not delete the file ' . ACYMAILING_MEDIA . 'css' . DS . 'template_' . intval($element->tempid) . '.css', 'error'); } } } if (!empty($element->styles) and !is_string($element->styles)) { $element->styles = serialize($element->styles); } return parent::save($element); }
function save($element) { if (empty($element->tempid)) { if (empty($element->namekey)) { $element->namekey = time() . JFilterOutput::stringURLSafe($element->name); } } return parent::save($element); }