Ejemplo n.º 1
0
 /**
  * Get array of trusted domains
  *
  * @return array
  */
 public static function getTrustedDomains()
 {
     $result = parent::getTrustedDomains();
     if (!empty($_SERVER['HTTP_HOST'])) {
         $result[] = $_SERVER['HTTP_HOST'];
     }
     return $result;
 }
Ejemplo n.º 2
0
 /**
  * Returns additional link params
  *
  * @return array
  */
 protected function getAdditionalLinkParams()
 {
     $result = parent::getAdditionalLinkParams();
     if ($this->isInContextAvailable()) {
         $result['inContext'] = true;
         $result['cancelUrl'] = $this->isAjax() ? $this->getReferrerURL() : \XLite\Core\URLManager::getSelfURI();
     }
     return $result;
 }
Ejemplo n.º 3
0
 /**
  * Returns additional link params
  *
  * @return array
  */
 protected function getAdditionalLinkParams()
 {
     $result = parent::getAdditionalLinkParams();
     if ($this->isInContextAvailable()) {
         $result['inContext'] = true;
         $result['cancelUrl'] = $this->isAjax() ? $this->getReferrerURL() : \XLite\Core\URLManager::getSelfURI();
     }
     $result['product_id'] = $this->getParam(static::PARAM_PRODUCT_ID);
     $result['expressCheckout'] = true;
     return $result;
 }
Ejemplo n.º 4
0
 /**
  * getFormDefaultParams
  *
  * @return array
  */
 protected function getFormDefaultParams()
 {
     $list = parent::getFormDefaultParams();
     if (\XLite\Module\CDev\Paypal\Main::isExpressCheckoutEnabled()) {
         $list['expressCheckout'] = false;
         if (\XLite\Module\CDev\Paypal\Main::isInContextCheckoutAvailable()) {
             $list['inContext'] = true;
             $list['cancelUrl'] = $this->isAjax() ? $this->getReferrerURL() : \XLite\Core\URLManager::getSelfURI();
         }
     }
     return $list;
 }
Ejemplo n.º 5
0
 /**
  * Check - specified item is active or not
  *
  * @param array $item Menu item
  *
  * @return boolean
  */
 protected function isActiveItem(array $item)
 {
     $result = parent::isActiveItem($item);
     if (false === $item['controller']) {
         $result = \XLite::getInstance()->getShopURL($item['url']) === \XLite\Core\URLManager::getCurrentURL() ?: $result;
     } else {
         if (!is_array($item['controller'])) {
             $item['controller'] = array($item['controller']);
         }
         $controller = \XLite::getController();
         foreach ($item['controller'] as $controllerName) {
             if ($controller instanceof $controllerName) {
                 $result = true;
                 break;
             }
         }
     }
     return $result;
 }
Ejemplo n.º 6
0
 /**
  * Get Store URL
  *
  * @return string
  */
 protected function getStoreURL()
 {
     return \XLite\Core\URLManager::getShopURL(\XLite\Core\Converter::buildURL());
 }
Ejemplo n.º 7
0
 /**
  * Get store url without script part
  *
  * @return string
  */
 protected function getShopUrl()
 {
     $shopUrl = URLManager::getShopURL(Converter::buildURL());
     $shopUrl = preg_replace('/[^\\/]*.php$/', '', $shopUrl);
     return $shopUrl;
 }
Ejemplo n.º 8
0
 /**
  * Return URL parameters to use in AJAX popup
  *
  * @return array
  */
 protected function prepareURLParams()
 {
     return array('target' => 'pitney_bowes', 'widget' => 'XLite\\Module\\XC\\PitneyBowes\\View\\CredentialsRequest', 'returnUrl' => \XLite\Core\URLManager::getCurrentURL());
 }
Ejemplo n.º 9
0
 /**
  * getDefaultParams
  *
  * @return array
  */
 protected function getDefaultParams()
 {
     $params = parent::getDefaultParams();
     $params[\XLite\Controller\AController::RETURN_URL] = \XLite\Core\URLManager::getSelfURI() . '&mode=search_featured_products';
     return $params;
 }
Ejemplo n.º 10
0
 /**
  * Get popup url
  *
  * @return string
  */
 protected function getPopupUrl()
 {
     $params = array('inContext' => true, 'cancelUrl' => \XLite\Core\URLManager::getSelfURI());
     return \XLite::getInstance()->getShopURL($this->buildURL('checkout', 'start_express_checkout', $params));
 }
Ejemplo n.º 11
0
 /**
  * Return URL parameters to use in AJAX popup
  *
  * @return array
  */
 protected function prepareURLParams()
 {
     return array('target' => 'trial_notice', 'widget' => '\\XLite\\View\\ModulesManager\\TrialNotice', 'returnUrl' => \XLite\Core\URLManager::getCurrentURL());
 }
Ejemplo n.º 12
0
 /**
  * Get URL to test https connection
  *
  * @return string
  */
 protected function getTestURL()
 {
     return \XLite\Core\URLManager::getShopURL(static::CHECK_URI_SUFFIX, true);
 }
Ejemplo n.º 13
0
 /**
  * Register URLs that should be given instead of tags
  *
  * @return array
  */
 protected function getWebPreprocessingURL()
 {
     // Get URL of shop. If the HTTPS is used then it should be cleaned from ?xid=<xid> construction
     $url = \XLite\Core\URLManager::getShopURL(null, \XLite\Core\Request::getInstance()->isHTTPS(), array(), null, false);
     // We are cleaning URL from unnecessary here <xid> construction
     $url = preg_replace('/(\\?.*)/', '', $url);
     return array($url);
 }
Ejemplo n.º 14
0
 /**
  * Check and (if needed) set the return URL parameter
  *
  * @param array &$params Form params
  *
  * @return void
  */
 protected function setReturnURLParam(array &$params)
 {
     $index = \XLite\Controller\AController::RETURN_URL;
     if (!isset($params[$index])) {
         $params[$index] = \XLite\Core\URLManager::getSelfURI();
     }
 }
Ejemplo n.º 15
0
 /**
  * Get logo
  *
  * @return string
  */
 public static function getSignUpLogo()
 {
     $logo = \XLite\Core\Layout::getInstance()->getResourceWebPath('modules/CDev/Paypal/signup_logo.png', \XLite\Core\Layout::WEB_PATH_OUTPUT_URL, \XLite::ADMIN_INTERFACE);
     return \XLite\Core\URLManager::getShopURL($logo, true, array(), \XLite\Core\URLManager::URL_OUTPUT_FULL, false);
 }
Ejemplo n.º 16
0
 /**
  * Return structure of configuration for JS TinyMCE library
  *
  * @return array
  */
 protected function getTinyMCEConfiguration()
 {
     $layout = \XLite\Core\Layout::getInstance();
     $themeFiles = $this->getThemeFiles(false);
     $themeFiles = $themeFiles[static::RESOURCE_CSS];
     $themeFilesCSS = array();
     foreach ($themeFiles as $key => $file) {
         if (!is_array($file)) {
             $path = $layout->getResourceWebPath($file, \XLite\Core\Layout::WEB_PATH_OUTPUT_URL, \XLite::CUSTOMER_INTERFACE);
             if ($path) {
                 $themeFilesCSS[] = $this->getShopURL($path, null, array('t' => LC_START_TIME));
             }
         }
     }
     $contentCSS = implode(',', $themeFilesCSS);
     // Base is the web path to the tinymce library directory
     return array('contentCSS' => $contentCSS, 'shopURL' => \XLite\Core\URLManager::getShopURL(null, \XLite\Core\Request::getInstance()->isHTTPS(), array(), null, false), 'shopURLRoot' => \XLite\Model\Category::WEB_LC_ROOT, 'bodyClass' => $this->getParam(static::PARAM_STYLE), 'base' => dirname(\XLite\Singletons::$handler->layout->getResourceWebPath($this->getDir() . '/js/tinymce/tiny_mce.js', \XLite\Core\Layout::WEB_PATH_OUTPUT_URL)) . '/');
 }
Ejemplo n.º 17
0
 /**
  * Common data for all request types
  *
  * @return array
  */
 protected function getRequestCommonData()
 {
     $data = array(static::FIELD_VERSION_API => static::MP_API_VERSION, static::FIELD_SHOP_ID => $this->generateShopID(), static::FIELD_SHOP_DOMAIN => \Includes\Utils\ConfigParser::getOptions(array('host_details', 'http_host')), static::FIELD_SHOP_URL => \XLite\Core\URLManager::getShopURL(), static::FIELD_VERSION_CORE_CURRENT => $this->getVersionField(\XLite::getInstance()->getMajorVersion(), \XLite::getInstance()->getMinorVersion()), static::FIELD_XCN_LICENSE_KEY => \XLite::getXCNLicenseKey(), static::FIELD_INSTALLATION_LNG => \XLite::getInstallationLng());
     return $data;
 }
Ejemplo n.º 18
0
 /**
  * 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 \XLite\Core\URLManager::getShopURL($url, $isSecure, $params);
 }
Ejemplo n.º 19
0
 /**
  * Check for secure connection
  *
  * @return boolean
  */
 public function isHTTPS()
 {
     return \XLite\Core\URLManager::isHTTPS();
 }
Ejemplo n.º 20
0
 /**
  * Send headers
  *
  * @return void
  */
 public static function sendHeaders()
 {
     // send no-cache headers
     header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
     header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
     header('Cache-Control: no-store, no-cache, must-revalidate');
     header('Cache-Control: post-check=0, pre-check=0', false);
     header('Pragma: no-cache');
     header('Content-Type: text/html; charset=utf-8');
     if (\XLite::isAdminZone()) {
         header('X-Robots-Tag: noindex, nofollow');
     }
     foreach (\XLite\Core\URLManager::getAllowedDomains() as $domain) {
         header('Access-Control-Allow-Origin: ' . $domain, false);
     }
     $option = \XLite::getInstance()->getOptions(array('other', 'x_frame_options'));
     if (isset($option) && 'disabled' !== $option) {
         header('X-Frame-Options:' . $option);
     }
 }
Ejemplo n.º 21
0
 /**
  * Return URL parameters to use in AJAX popup
  *
  * @return array
  */
 protected function prepareURLParams()
 {
     $params = array('target' => 'activate_key', 'action' => 'view', 'widget' => '\\XLite\\View\\ModulesManager\\LicenseKey', 'returnUrl' => \XLite\Core\URLManager::getCurrentURL());
     if ($this->isModuleActivation()) {
         $params['isModule'] = true;
     }
     return $params;
 }