public static function getURL($pageId, $language = null)
{
$pageId = (int) $pageId;
$language = $language !== null ? (string) $language : LANGUAGE;
// init URL
$url = FrontendModel::getContainer()->getParameter('site.multilanguage') ? '/' . $language . '/' : '/';
// get the menuItems
$keys = self::getKeys($language);
// get the URL, if it doesn't exist return 404
if (!isset($keys[$pageId])) {
return self::getURL(404, $language);
} else {
$url .= $keys[$pageId];
}
// return the URL
return urldecode($url);
}
/** * Execute the action */ public function execute() { parent::execute(); //--Get the id $id = $this->URL->getParameter(1); //--check if the id is not empty if (empty($id)) { $this->redirect(FrontendNavigation::getURL(404)); } //--Explode the id $ids = explode("-", $id); //--check if the id contains 2 elements if (count($ids) != 2) { $this->redirect(FrontendNavigation::getURL(404)); } //--Get the ids and decrypt $send_id = (int) FrontendMailengineModel::decryptId($ids[0]); $user_id = (int) FrontendMailengineModel::decryptId($ids[1]); //--check if the ids are integers if ($send_id <= 0) { $this->redirect(FrontendNavigation::getURL(404)); } if ($user_id > 0) { $data = array(); $data["send_id"] = $send_id; $data["user_id"] = $user_id; //--Add open-mail to the database FrontendMailengineModel::insertMailOpen($data); } //--Create an empty image $this->createImage(); //--Stop the script die; }