/** * Prepares CSS cache to use. Main issue - replace url($resourcePath) construction with url($shopUrl/$resourcePath) * * @param string $filePath CSS cache file path * * @return string */ protected function prepareCSSCache($filePath) { return "\r\n" . '/***** AUTOGENERATED: ' . basename($filePath) . ' */' . str_replace('url(', 'url(' . \Includes\Utils\URLManager::getShopURL(str_replace(LC_DS, '/', dirname(substr($filePath, strlen(LC_DIR_ROOT)))), \XLite\Core\Request::getInstance()->isHTTPS(), array(), null, false) . '/', \Includes\Utils\FileManager::read($filePath)); }
/** * Get latest Snapshot URL * * @return string */ public static function getLatestSnapshotURL() { $params = array(self::PARAM_SAFE_MODE => true, self::PARAM_ACCESS_KEY => static::getAccessKey()); if (static::getLatestSnapshot()) { $latest = static::getLatestSnapshot(); $params[self::PARAM_RESTORE_DATE] = $latest['date']; } return \Includes\Utils\URLManager::getShopURL(\XLite\Core\Converter::buildURL('main', '', $params, \XLite::getAdminScript())); }
/** * getHTMLMessage * * @return string */ protected static function getHTMLMessage() { return '<table><tr><td><img src="' . \Includes\Utils\URLManager::getShopURL('skins/progress_indicator.gif') . '" alt="" /></td><td>' . static::getMessage() . '</td></tr></table>'; }
/** * Prepare resource URL * * @param string $url URL * @param string $outputType Output type * * @return string */ protected function prepareResourceURL($url, $outputType) { if ($url && self::WEB_PATH_OUTPUT_SHORT != $outputType) { $type = self::WEB_PATH_OUTPUT_FULL == $outputType ? \Includes\Utils\URLManager::URL_OUTPUT_SHORT : \Includes\Utils\URLManager::URL_OUTPUT_FULL; $url = \Includes\Utils\URLManager::getShopURL($url, \XLite\Core\Request::getInstance()->isHTTPS(), array(), $type, false); } return $url; }
/** * Get authorization grant redirect url * * @return string */ protected function getRedirectUrl() { return \Includes\Utils\URLManager::getShopURL(\XLite\Core\Converter::buildURL('social_login', 'login', array('auth_provider' => $this->getName())), \XLite\Core\Request::getInstance()->isHTTPS(), array(), null, false); }
/** * Check if LC is installed * * @return void */ public static function checkIsLCInstalled() { if (!\Includes\Utils\ConfigParser::getOptions(array('database_details', 'database'))) { $link = \Includes\Utils\URLManager::getShopURL('install.php'); $message = \Includes\Utils\ConfigParser::getInstallationLng() === 'ru' ? '<a href="' . $link . '">Запустите установку магазина</a>' : '<a href="' . $link . '">Click here</a> to run the installation wizard.'; static::showErrorPage(self::ERROR_NOT_INSTALLED, $message); } }
/** * Get return URL for Purchase operation * * @return string */ protected function getReturnURL() { return \Includes\Utils\URLManager::getShopURL(\XLite\Core\Converter::buildURL()); }
/** * Alters outbound URLs * * @param string &$path The outbound path to alter * @param array &$options A set of URL options * @param string $originalPath The original path, before being altered by any modules * * @return void */ public function translateOutboundURL(&$path, array &$options, $originalPath) { if (static::LANDING_LINK_PATH === $path) { $path = \Includes\Utils\URLManager::getShopURL('admin.php' . $this->getAdminAreaURLArgs()); $options['external'] = true; } elseif ($url = $this->getHandler()->getDrupalCleanURL($path, $options)) { $path = $url; } }
/** * Return full URL for the resource * * @param string $url Url part to add OPTIONAL * @param boolean $isSecure Use HTTP or HTTPS OPTIONAL * @param array $params Optional URL params OPTIONAL * * @return string */ public function getShopURL($url = '', $isSecure = null, array $params = array()) { return \Includes\Utils\URLManager::getShopURL($url, $isSecure, $params); }
/** * Get safe mode URL * * @param boolean $soft Soft reset flag OPTIONAL * * @return string */ public static function getResetURL($soft = false) { $params = array(self::PARAM_SAFE_MODE => true, self::PARAM_ACCESS_KEY => static::getAccessKey()); if ($soft) { $params[self::PARAM_SOFT_RESET] = true; } return \Includes\Utils\URLManager::getShopURL(\XLite\Core\Converter::buildURL('main', '', $params, \XLite::ADMIN_SELF)); }
/** * Check if LC is installed * * @return void */ public static function checkIsLCInstalled() { if (!\Includes\Utils\ConfigParser::getOptions(array('database_details', 'database'))) { $message = 'Probably LC is not installed. Try to run '; $url = '<strong>install.php</strong>'; $link = \Includes\Utils\URLManager::getShopURL('install.php'); if (\Includes\Utils\FileManager::isFile($link)) { $url = '<a href="' . $link . '">' . $url . '</a>'; } static::showErrorPage('ERROR_LC_NOT_INSTALLED', $message . $url, LC_ERROR_PAGE_MESSAGE); } }