public static function buildPublicLink($type, $data = null, array $extraParams = array(), $skipPrepend = false) { // the type MUST BE canonical:$type // NOTE: this is the opposite with api links if (strpos($type, 'full:') === 0) { // replace full: with canonical: $type = str_replace('full:', 'canonical:', $type); } elseif (strpos($type, 'canonical:') === false) { // enforce canonical: $type = 'canonical:' . $type; } return parent::buildPublicLink($type, $data, $extraParams, $skipPrepend); }
public static function buildPublicLink($type, $data = null, array $extraParams = array(), $skipPrepend = false) { // the type MUST BE canonical:$type // NOTE: this is the opposite with api links if (strpos($type, 'full:') === 0) { // replace full: with canonical: $type = str_replace('full:', 'canonical:', $type); } elseif (strpos($type, 'canonical:') === false) { // enforce canonical: $type = 'canonical:' . $type; } $session = bdApi_Data_Helper_Core::safeGetSession(); if (!empty($session)) { // auto appends locale param from session if (!isset($extraParams['locale'])) { $locale = $session->get('requestLocale'); if (!empty($locale)) { $timestamp = time() + 86400; $extraParams['_apiLanguageId'] = sprintf('%s %s', $timestamp, bdApi_Crypt::encryptTypeOne($session->get('languageId'), $timestamp)); } } } return parent::buildPublicLink($type, $data, $extraParams, $skipPrepend); }