Skip to content

Latest commit

 

History

History
1684 lines (807 loc) · 36.5 KB

class.FrontControllerCore.md

File metadata and controls

1684 lines (807 loc) · 36.5 KB

Class FrontControllerCore

2007-2015 PrestaShop

NOTICE OF LICENSE

This source file is subject to the Open Software License (OSL 3.0) that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://opensource.org/licenses/osl-3.0.php If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to [email protected] so we can send you a copy immediately.

DISCLAIMER

Do not edit or add to this file if you wish to upgrade PrestaShop to newer versions in the future. If you wish to customize PrestaShop for your needs please refer to http://www.prestashop.com for more information.

Contents

Properties

Methods

Properties

$auth

public mixed $auth = false

$authRedirection

public mixed $authRedirection = false

$cart

protected mixed $cart

$cookie

protected mixed $cookie

$currentCustomerGroups

protected mixed $currentCustomerGroups

$display_column_left

public mixed $display_column_left = true

$display_column_right

public mixed $display_column_right = true

$errors

public mixed $errors = array()

$guestAllowed

public mixed $guestAllowed = false

$initialized

public mixed $initialized = false

$iso

public mixed $iso

$link

protected mixed $link

$maintenance

protected mixed $maintenance = false

$n

public mixed $n

$nb_items_per_page

public mixed $nb_items_per_page

$orderBy

public mixed $orderBy

$orderWay

public mixed $orderWay

$p

public mixed $p

$restrictedCountry

protected mixed $restrictedCountry = false

$smarty

protected mixed $smarty

$ssl

public mixed $ssl = false

$ajax

public boolean $ajax = false

$content_only

protected string $content_only = false

$context

protected \Context $context

$controller_type

public mixed $controller_type

$css_files

public array $css_files = array()

$display_footer

protected string $display_footer

$display_header

protected boolean $display_header

$js_files

public array $js_files = array()

$json

protected mixed $json = false

$php_errors

public array $php_errors = array()

$php_self

public mixed $php_self

$redirect_after

protected mixed $redirect_after = null

$status

protected mixed $status = ''

$template

protected string $template

Methods

__construct

mixed FrontControllerCore::__construct()

addCSS

mixed FrontControllerCore::addCSS($css_uri, string $css_media_type, integer $offset, boolean $check_path)

Add one or several CSS for front, checking if css files are overriden in theme/css/modules/ directory

Arguments

  • $css_uri mixed
  • $css_media_type string
  • $offset integer
  • $check_path boolean

addColorsToProductList

mixed FrontControllerCore::addColorsToProductList($products)

Arguments

  • $products mixed

addJS

mixed FrontControllerCore::addJS($js_uri, boolean $check_path)

Add one or several JS files for front, checking if js files are overriden in theme/js/modules/ directory

Arguments

  • $js_uri mixed
  • $check_path boolean

addJquery

void ControllerCore::addJquery($version, $folder, $minifier)

Add a new javascript file in page header.

Arguments

  • $version mixed
  • $folder mixed
  • $minifier mixed

addJqueryPlugin

mixed ControllerCore::addJqueryPlugin($name, null $folder, boolean $css)

Add a new javascript file in page header.

Arguments

  • $name mixed
  • $folder null
  • $css boolean

addJqueryUI

void ControllerCore::addJqueryUI($component, $theme, $check_dependencies)

Add a new javascript file in page header.

Arguments

  • $component mixed
  • $theme mixed
  • $check_dependencies mixed

addMedia

mixed FrontControllerCore::addMedia($media_uri, $css_media_type, $offset, $remove, $check_path)

Arguments

  • $media_uri mixed
  • $css_media_type mixed
  • $offset mixed
  • $remove mixed
  • $check_path mixed

ajaxDie

mixed ControllerCore::ajaxDie($value, $controller, $method)

Arguments

  • $value mixed
  • $controller mixed
  • $method mixed

canonicalRedirection

mixed FrontControllerCore::canonicalRedirection($canonical_url)

Arguments

  • $canonical_url mixed

checkAccess

boolean FrontControllerCore::checkAccess()

checkLiveEditAccess

mixed FrontControllerCore::checkLiveEditAccess()

display

mixed FrontControllerCore::display()

displayContent

mixed FrontControllerCore::displayContent()

1.4 retrocompatibility

displayFooter

mixed FrontControllerCore::displayFooter($display)

Arguments

  • $display mixed

displayHeader

mixed FrontControllerCore::displayHeader($display)

Arguments

  • $display mixed

displayMaintenancePage

mixed FrontControllerCore::displayMaintenancePage()

displayRestrictedCountryPage

mixed FrontControllerCore::displayRestrictedCountryPage()

geolocationManagement

mixed FrontControllerCore::geolocationManagement($default_country)

Arguments

  • $default_country mixed

getColorsListCacheId

mixed FrontControllerCore::getColorsListCacheId($id_product)

Arguments

  • $id_product mixed

getController

mixed ControllerCore::getController(string $class_name, boolean $auth, boolean $ssl)

Get an instance of a controller

Arguments

  • $class_name string
  • $auth boolean
  • $ssl boolean

getCurrentCustomerGroups

mixed FrontControllerCore::getCurrentCustomerGroups()

getLayout

boolean|string FrontControllerCore::getLayout()

Returns the layout corresponding to the current page by using the override system Ex: On the url: http://localhost/index.php?id_product=1&controller=product, this method will check if the layout exists in the following files (in that order), and return the first found:

  • /themes/default/override/layout-product-1.tpl
  • /themes/default/override/layout-product.tpl
  • /themes/default/layout.tpl

getLiveEditFooter

mixed FrontControllerCore::getLiveEditFooter()

getOverrideTemplate

boolean FrontControllerCore::getOverrideTemplate()

Returns the template corresponding to the current page.

By default this method return false but could easily be overridden in a specific controller

getOverrideThemeDir

mixed FrontControllerCore::getOverrideThemeDir()

getTemplatePath

mixed FrontControllerCore::getTemplatePath($template)

Arguments

  • $template mixed

getThemeDir

mixed FrontControllerCore::getThemeDir()

init

mixed FrontControllerCore::init()

initContent

mixed FrontControllerCore::initContent()

initCursedPage

mixed FrontControllerCore::initCursedPage()

initFooter

mixed FrontControllerCore::initFooter()

initHeader

mixed FrontControllerCore::initHeader()

initLogoAndFavicon

array FrontControllerCore::initLogoAndFavicon()

Return an array with specific logo and favicon, if mobile device

isCached

mixed ControllerCore::isCached($template, $cacheId, $compileId)

Arguments

  • $template mixed
  • $cacheId mixed
  • $compileId mixed

isInWhitelistForGeolocation

mixed FrontControllerCore::isInWhitelistForGeolocation()

isTokenValid

boolean FrontControllerCore::isTokenValid()

Check if token is valid

isXmlHttpRequest

boolean ControllerCore::isXmlHttpRequest()

myErrorHandler

mixed ControllerCore::myErrorHandler($errno, $errstr, $errfile, $errline)

Arguments

  • $errno mixed
  • $errstr mixed
  • $errfile mixed
  • $errline mixed

pagination

mixed FrontControllerCore::pagination($total_products)

Arguments

  • $total_products mixed

postProcess

mixed FrontControllerCore::postProcess()

process

mixed FrontControllerCore::process()

productSort

mixed FrontControllerCore::productSort()

recoverCart

mixed FrontControllerCore::recoverCart()

redirect

mixed FrontControllerCore::redirect()

removeCSS

mixed FrontControllerCore::removeCSS($css_uri, $css_media_type, $check_path)

Arguments

  • $css_uri mixed
  • $css_media_type mixed
  • $check_path mixed

removeJS

mixed FrontControllerCore::removeJS($js_uri, $check_path)

Arguments

  • $js_uri mixed
  • $check_path mixed

removeMedia

mixed FrontControllerCore::removeMedia($media_uri, $css_media_type, $check_path)

Arguments

  • $media_uri mixed
  • $css_media_type mixed
  • $check_path mixed

run

mixed ControllerCore::run()

Start controller process (this method shouldn't be overriden !)

setMedia

mixed FrontControllerCore::setMedia()

setMobileMedia

mixed FrontControllerCore::setMobileMedia()

Specific medias for mobile device.

if autoload directory is present in the mobile theme, these files will not be loaded

setMobileTemplate

mixed FrontControllerCore::setMobileTemplate($template)

This checks if the template set is available for mobile themes, otherwise the front template is choosen.

Arguments

  • $template mixed

setTemplate

mixed FrontControllerCore::setTemplate($default_template)

This is overrided to manage is behaviour if a customer access to the site with mobile device.

Arguments

  • $default_template mixed

smartyOutputContent

mixed ControllerCore::smartyOutputContent($content)

Arguments

  • $content mixed

sslRedirection

mixed FrontControllerCore::sslRedirection()

useMobileTheme

mixed FrontControllerCore::useMobileTheme()

viewAccess

boolean FrontControllerCore::viewAccess()