This commit is contained in:
2025-04-01 00:38:54 +02:00
parent d4d4c0c09d
commit 87da06293a
22351 changed files with 5168854 additions and 7538 deletions

View File

@@ -0,0 +1,32 @@
<?php
/**
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license See the license of this module in file LICENSE.txt, thank you.
*/
if (!defined('_PS_VERSION_')) {exit;}
class Context extends ContextCore
{
public function getMobileDetect()
{
if ($this->mobile_detect === null) {
if (!Module::isEnabled('pagecache') || !file_exists(_PS_MODULE_DIR_ . 'pagecache/pagecache.php')) {
return parent::getMobileDetect();
} else {
require_once _PS_MODULE_DIR_ . 'pagecache/pagecache.php';
if ($this->mobile_detect === null) {
if (PageCache::isCacheWarmer()) {
$this->mobile_detect = new JprestaUtilsMobileDetect();
} else {
return parent::getMobileDetect();
}
}
}
}
return $this->mobile_detect;
}
}

View File

@@ -0,0 +1,36 @@
<?php
/**
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license See the license of this module in file LICENSE.txt, thank you.
*/
if (!defined('_PS_VERSION_')) {exit;}
class Hook extends HookCore
{
public static function coreCallHook($module, $method, $params)
{
if (!Module::isEnabled('pagecache') || !file_exists(_PS_MODULE_DIR_ . 'pagecache/pagecache.php')) {
return parent::coreCallHook($module, $method, $params);
}
else {
require_once _PS_MODULE_DIR_ . 'pagecache/pagecache.php';
return PageCache::execHook(PageCache::HOOK_TYPE_MODULE, $module, $method, $params);
}
}
public static function coreRenderWidget($module, $hook_name, $params)
{
if (!Module::isEnabled('pagecache') || !file_exists(_PS_MODULE_DIR_ . 'pagecache/pagecache.php')) {
return parent::coreRenderWidget($module, $hook_name, $params);
}
else {
require_once _PS_MODULE_DIR_ . 'pagecache/pagecache.php';
return PageCache::execHook(PageCache::HOOK_TYPE_WIDGET, $module, $hook_name, $params);
}
}
}

View File

@@ -0,0 +1,29 @@
<?php
/**
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license See the license of this module in file LICENSE.txt, thank you.
*/
if (!defined('_PS_VERSION_')) {exit;}
class Media extends MediaCore
{
public static function clearCache()
{
if (Module::isEnabled('pagecache') && file_exists(_PS_MODULE_DIR_ . 'pagecache/pagecache.php')) {
foreach (array(_PS_THEME_DIR_ . 'cache', _PS_THEME_DIR_ . 'assets/cache') as $dir) {
if (file_exists($dir) && count(array_diff(scandir($dir), array('..', '.', 'index.php'))) > 0) {
PageCache::clearCache('Media::clearCache');
break;
}
}
}
if (is_callable('parent::clearCache')) {
parent::clearCache();
}
}
}

View File

@@ -0,0 +1,61 @@
<?php
/**
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license See the license of this module in file LICENSE.txt, thank you.
*/
if (!defined('_PS_VERSION_')) {exit;}
class FrontController extends FrontControllerCore
{
protected function displayAjax()
{
if (!Tools::getIsset('page_cache_dynamics_mods')) {
if (is_callable('parent::displayAjax')) {
// The displayAjax is overrided, we call it
return parent::displayAjax();
}
else {
return;
}
}
$this->initHeader();
$this->assignGeneralPurposeVariables();
require_once _PS_MODULE_DIR_ . 'pagecache/pagecache.php';
$result = PageCache::execDynamicHooks($this);
if (Tools::version_compare(_PS_VERSION_,'1.6','>')) {
$this->context->smarty->assign(array(
'js_def' => PageCache::getJsDef($this),
));
$result['js'] = $this->context->smarty->fetch(_PS_ALL_THEMES_DIR_.'javascript.tpl');
}
$this->context->cookie->write();
// Most of configurations to compress requests do not include 'application/json' so we use 'text/html'
header('Content-Type: text/html');
header('Cache-Control: no-cache');
header('X-Robots-Tag: noindex');
$json = json_encode($result);
if ($json === false) {
header("HTTP/1.1 500 Internal Server Error");
die(json_last_error_msg());
}
die($json);
}
public function isRestrictedCountry()
{
return $this->restrictedCountry;
}
public function geolocationManagementPublic($default_country)
{
$ret = $this->geolocationManagement($default_country);
if (!$ret) {
return $default_country;
}
return $ret;
}
}

View File

@@ -0,0 +1,21 @@
<?php
/**
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license See the license of this module in file LICENSE.txt, thank you.
*/
if (!defined('_PS_VERSION_')) {exit;}
abstract class ProductListingFrontController extends ProductListingFrontControllerCore
{
protected function doProductSearch($template, $params = array(), $locale = null)
{
if (!Tools::getIsset('page_cache_dynamics_mods')) {
return parent::doProductSearch($template, $params, $locale);
}
}
}

View File

@@ -0,0 +1,19 @@
<?php
/**
* This file protect the directory
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license See the license of this module in file LICENSE.txt, thank you.
*/
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("Location: ../");
exit;

View File

@@ -0,0 +1,19 @@
<?php
/**
* This file protect the directory
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license See the license of this module in file LICENSE.txt, thank you.
*/
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("Location: ../");
exit;

View File

@@ -0,0 +1,19 @@
<?php
/**
* This file protect the directory
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license See the license of this module in file LICENSE.txt, thank you.
*/
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("Location: ../");
exit;

View File

@@ -0,0 +1,19 @@
<?php
/**
* This file protect the directory
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license See the license of this module in file LICENSE.txt, thank you.
*/
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("Location: ../");
exit;

View File

@@ -0,0 +1,19 @@
<?php
/**
* This file protect the directory
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license See the license of this module in file LICENSE.txt, thank you.
*/
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("Location: ../");
exit;

View File

@@ -0,0 +1,19 @@
<?php
/**
* This file protect the directory
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license See the license of this module in file LICENSE.txt, thank you.
*/
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("Location: ../");
exit;

View File

@@ -0,0 +1,98 @@
<?php
/**
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license See the license of this module in file LICENSE.txt, thank you.
*/
if (!defined('_PS_VERSION_')) {
exit;
}
/**
* Implements getJprestaModelObjectClassName() and getJprestaModelObjectId() to enable the HTML cache provided by the
* module Page Cache Ultimate created by jpresta.com
*/
class af_producttagsprotagsModuleFrontControllerOverride extends af_producttagsprotagsModuleFrontController
{
/**
* @return string The ObjectModel class name to be used by Page Cache Ultimate module to refresh the cache of pages generated by this controller
*/
public static function getJprestaModelObjectClassName()
{
// A fake class to enable the cache
return 'AdvancedTagsModel';
}
/**
* @return int|null The ID of the current ObjectModel (if any) to be used by Page Cache Ultimate module to refresh the cache of pages generated by this controller
*/
public function getJprestaModelObjectId()
{
$tag = AdvancedTagsModel::getTagByLinkRewrite(Tools::getValue('tagName'), $this->context->language->id);
if (empty($tag)) {
$tag_name = str_replace('-', ' ', Tools::getValue('tagName'));
$tag_id = AdvancedTagsModel::getIdTagByName($tag_name, $this->context->language->id);
} else {
$tag_id = $tag['adtag_id_tag'];
}
if (!$tag_id) {
$tag_id = null;
}
return $tag_id;
}
/**
* List all URLs generated by this controller for the current shop context and the specified language.
* This is used by the Jresta-Cache-Warmer service to generate the cache of these pages.
* @param $id_lang int ID of the language
* @return string[] All URLs to warmup
*/
public static function getJprestaAllURLs($id_lang) {
$context = Context::getContext();
$links = [];
$afsp = Module::getInstanceByName('af_producttagspro');
if ($afsp) {
if (Group::isFeatureActive()) {
$groups = FrontController::getCurrentCustomerGroups();
$tags = JPresta\SpeedPack\JprestaUtils::dbSelectRows('
SELECT t.name, adTag.`adtag_link_rewrite`
FROM `' . _DB_PREFIX_ . 'tag_count` pt
LEFT JOIN `' . _DB_PREFIX_ . 'tag` t ON (t.id_tag = pt.id_tag)
LEFT JOIN `' . _DB_PREFIX_ . 'af_advanced_tags` adTag ON (adTag.adtag_id_tag = t.id_tag)
WHERE (adTag.`adtag_is_show` = 1 OR adTag.`adtag_is_show` IS NULL) AND pt.`id_group` ' . (count($groups) ? 'IN (' . implode(',', $groups) . ')' : '= 1') . '
AND pt.`id_lang` = ' . (int) $id_lang . ' AND pt.`id_shop` = ' . (int) $context->shop->id);
} else {
$tags = JPresta\SpeedPack\JprestaUtils::dbSelectRows('
SELECT t.name
FROM `' . _DB_PREFIX_ . 'tag_count` pt
LEFT JOIN `' . _DB_PREFIX_ . 'tag` t ON (t.id_tag = pt.id_tag)
LEFT JOIN `' . _DB_PREFIX_ . 'af_advanced_tags` adTag ON (adTag.adtag_id_tag = t.id_tag)
WHERE (adTag.`adtag_is_show` = 1 OR adTag.`adtag_is_show` IS NULL) AND pt.id_group = 0 AND pt.`id_lang` = ' . (int) $id_lang . ' AND pt.`id_shop` = ' . (int) $context->shop->id);
}
foreach ($tags as $tag) {
$links[] = $afsp->getUrlFrontTag($tag['name'], isset($tag['adtag_link_rewrite']) ? $tag['adtag_link_rewrite'] : null, $id_lang);
}
}
return $links;
}
/**
* An estimated number of URLs that will be returned by self::getJprestaAllURLs() for the current shop context.
* Since we don't have the id_lang parameter we recommend to return the number of URLs for the language that have
* the most URLs.
* @return int The estimated number of URLs to warmup for the current shop context
*/
public static function getJprestaAllURLsCount() {
$queryCountPages = '
SELECT COUNT(*)
FROM `' . _DB_PREFIX_ . 'tag_count` pt
LEFT JOIN `' . _DB_PREFIX_ . 'tag` t ON (t.id_tag = pt.id_tag)
LEFT JOIN `' . _DB_PREFIX_ . 'af_advanced_tags` adTag ON (adTag.adtag_id_tag = t.id_tag)
WHERE (adTag.`adtag_is_show` = 1 OR adTag.`adtag_is_show` IS NULL) AND pt.id_group = '.(Group::isFeatureActive() ? 1 : 0).' AND pt.`id_lang` = ' . (int) Configuration::get('PS_LANG_DEFAULT') . ' AND pt.`id_shop` = ' . (int) Shop::getContextShopID();
return (int) JPresta\SpeedPack\JprestaUtils::dbGetValue($queryCountPages);
}
}

View File

@@ -0,0 +1,19 @@
<?php
/**
* This file protect the directory
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license See the license of this module in file LICENSE.txt, thank you.
*/
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("Location: ../");
exit;

View File

@@ -0,0 +1,19 @@
<?php
/**
* This file protect the directory
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license See the license of this module in file LICENSE.txt, thank you.
*/
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("Location: ../");
exit;

View File

@@ -0,0 +1,19 @@
<?php
/**
* This file protect the directory
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license See the license of this module in file LICENSE.txt, thank you.
*/
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("Location: ../");
exit;

View File

@@ -0,0 +1,69 @@
<?php
/**
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license See the license of this module in file LICENSE.txt, thank you.
*/
if (!defined('_PS_VERSION_')) {
exit;
}
/**
* Implements getJprestaModelObjectClassName() and getJprestaModelObjectId() to enable the HTML cache provided by the
* module Page Cache Ultimate created by jpresta.com
*/
class Af_SeopagesSeopageModuleFrontControllerOverride extends Af_SeopagesSeopageModuleFrontController
{
/**
* @return string The ObjectModel class name to be used by Page Cache Ultimate module to refresh the cache of pages generated by this controller
*/
public static function getJprestaModelObjectClassName()
{
// A fake class to enable the cache
return 'AfSeoPage';
}
/**
* @return int|null The ID of the current ObjectModel (if any) to be used by Page Cache Ultimate module to refresh the cache of pages generated by this controller
*/
public function getJprestaModelObjectId()
{
return null;
}
/**
* List all URLs generated by this controller for the current shop context and the specified language.
* This is used by the Jresta-Cache-Warmer service to generate the cache of these pages.
* @param $id_lang int ID of the language
* @return string[] All URLs to warmup
*/
public static function getJprestaAllURLs($id_lang) {
if (file_exists(_PS_MODULE_DIR_ . '/af_seopages/classes/SiteMap.php')) {
require_once _PS_MODULE_DIR_ . '/af_seopages/classes/SiteMap.php';
$afsp = Module::getInstanceByName('af_seopages');
if ($afsp) {
$sitemap = new SiteMap($afsp);
$links = $sitemap->getSitemapLinks($id_lang, (int)Shop::getContextShopID());
if (is_array($links)) {
return $links;
}
}
}
return [];
}
/**
* An estimated number of URLs that will be returned by self::getJprestaAllURLs() for the current shop context.
* Since we don't have the id_lang parameter we recommend to return the number of URLs for the language that have
* the most URLs.
* @return int The estimated number of URLs to warmup for the current shop context
*/
public static function getJprestaAllURLsCount() {
$queryCountPages = 'SELECT COUNT(DISTINCT p.id_seopage) FROM `'._DB_PREFIX_.'af_seopage` p INNER JOIN `'._DB_PREFIX_.'af_seopage_lang` l ON p.id_seopage = l.id_seopage WHERE p.active=1 AND l.id_shop=' . (int) Shop::getContextShopID();
return (int) JPresta\SpeedPack\JprestaUtils::dbGetValue($queryCountPages);
}
}

View File

@@ -0,0 +1,19 @@
<?php
/**
* This file protect the directory
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license See the license of this module in file LICENSE.txt, thank you.
*/
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("Location: ../");
exit;

View File

@@ -0,0 +1,19 @@
<?php
/**
* This file protect the directory
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license See the license of this module in file LICENSE.txt, thank you.
*/
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("Location: ../");
exit;

View File

@@ -0,0 +1,19 @@
<?php
/**
* This file protect the directory
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license See the license of this module in file LICENSE.txt, thank you.
*/
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("Location: ../");
exit;

View File

@@ -0,0 +1,36 @@
<?php
/**
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license See the license of this module in file LICENSE.txt, thank you.
*/
if (!defined('_PS_VERSION_')) {
exit;
}
class ConfiguratorProductModuleFrontControllerOverride extends ConfiguratorProductModuleFrontController
{
/**
* @return string
*/
public static function getJprestaModelObjectClassName()
{
return 'Product';
}
/**
* @return int|null
*/
public function getJprestaModelObjectId()
{
$id_product = (int)Tools::getValue('id_product');
if ($id_product && ($postObj = new Product($id_product)) && Validate::isLoadedObject($postObj)) {
return $id_product;
}
return null;
}
}

View File

@@ -0,0 +1,19 @@
<?php
/**
* This file protect the directory
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license See the license of this module in file LICENSE.txt, thank you.
*/
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("Location: ../");
exit;

View File

@@ -0,0 +1,19 @@
<?php
/**
* This file protect the directory
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license See the license of this module in file LICENSE.txt, thank you.
*/
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("Location: ../");
exit;

View File

@@ -0,0 +1,39 @@
<?php
/**
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license See the license of this module in file LICENSE.txt, thank you.
*/
if (!defined('_PS_VERSION_')) {
exit;
}
/**
* Implements getJprestaModelObjectClassName() and getJprestaModelObjectId() to enable the HTML cache provided by the
* module Page Cache Ultimate created by jpresta.com
*/
class Ets_blogBlogModuleFrontControllerOverride extends Ets_blogBlogModuleFrontController
{
/**
* @return string The ObjectModel class name to be used by Page Cache Ultimate module to refresh the cache of pages generated by this controller
*/
public static function getJprestaModelObjectClassName()
{
return 'Ets_blog_post';
}
/**
* @return int|null The ID of the current ObjectModel (if any) to be used by Page Cache Ultimate module to refresh the cache of pages generated by this controller
*/
public function getJprestaModelObjectId()
{
$id_post = (int)Tools::getValue('id_post');
if ($id_post && ($postObj = new Ets_blog_post($id_post)) && Validate::isLoadedObject($postObj)) {
return $id_post;
}
return null;
}
}

View File

@@ -0,0 +1,19 @@
<?php
/**
* This file protect the directory
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license See the license of this module in file LICENSE.txt, thank you.
*/
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("Location: ../");
exit;

View File

@@ -0,0 +1,19 @@
<?php
/**
* This file protect the directory
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license See the license of this module in file LICENSE.txt, thank you.
*/
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("Location: ../");
exit;

View File

@@ -0,0 +1,19 @@
<?php
/**
* This file protect the directory
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license See the license of this module in file LICENSE.txt, thank you.
*/
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("Location: ../");
exit;

View File

@@ -0,0 +1,39 @@
<?php
/**
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license See the license of this module in file LICENSE.txt, thank you.
*/
if (!defined('_PS_VERSION_')) {
exit;
}
/**
* This override is disabled by default because the views 'count' is updated each time and so clears the cache is soon as it is created.
* To work, this count should be disabled or directly done with an SQL query without using the ObjectModel function 'update'.
*/
class EverPsBlogauthorModuleFrontControllerOverride extends EverPsBlogauthorModuleFrontController
{
/**
* @return string The ObjectModel class name to be used by Page Cache Ultimate module to refresh the cache of pages generated by this controller
*/
public static function getJprestaModelObjectClassName()
{
return 'EverPsBlogAuthor';
}
/**
* @return int|null The ID of the current ObjectModel (if any) to be used by Page Cache Ultimate module to refresh the cache of pages generated by this controller
*/
public function getJprestaModelObjectId()
{
$id_object = (int)Tools::getValue('id_ever_author');
if ($id_object && ($postObj = new EverPsBlogAuthor($id_object)) && Validate::isLoadedObject($postObj)) {
return $id_object;
}
return null;
}
}

View File

@@ -0,0 +1,39 @@
<?php
/**
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license See the license of this module in file LICENSE.txt, thank you.
*/
if (!defined('_PS_VERSION_')) {
exit;
}
/**
* This override is disabled by default because the views 'count' is updated each time and so clears the cache is soon as it is created.
* To work, this count should be disabled or directly done with an SQL query without using the ObjectModel function 'update'.
*/
class EverPsBlogcategoryModuleFrontControllerOverride extends EverPsBlogcategoryModuleFrontController
{
/**
* @return string The ObjectModel class name to be used by Page Cache Ultimate module to refresh the cache of pages generated by this controller
*/
public static function getJprestaModelObjectClassName()
{
return 'EverPsBlogCategory';
}
/**
* @return int|null The ID of the current ObjectModel (if any) to be used by Page Cache Ultimate module to refresh the cache of pages generated by this controller
*/
public function getJprestaModelObjectId()
{
$id_object = (int)Tools::getValue('id_ever_category');
if ($id_object && ($postObj = new EverPsBlogCategory($id_object)) && Validate::isLoadedObject($postObj)) {
return $id_object;
}
return null;
}
}

View File

@@ -0,0 +1,19 @@
<?php
/**
* This file protect the directory
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license See the license of this module in file LICENSE.txt, thank you.
*/
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("Location: ../");
exit;

View File

@@ -0,0 +1,39 @@
<?php
/**
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license See the license of this module in file LICENSE.txt, thank you.
*/
if (!defined('_PS_VERSION_')) {
exit;
}
/**
* Implements getJprestaModelObjectClassName() and getJprestaModelObjectId() to enable the HTML cache provided by the
* module Page Cache Ultimate created by jpresta.com
*/
class EverPsBlogpostModuleFrontControllerOverride extends EverPsBlogpostModuleFrontController
{
/**
* @return string The ObjectModel class name to be used by Page Cache Ultimate module to refresh the cache of pages generated by this controller
*/
public static function getJprestaModelObjectClassName()
{
return 'EverPsBlogPost';
}
/**
* @return int|null The ID of the current ObjectModel (if any) to be used by Page Cache Ultimate module to refresh the cache of pages generated by this controller
*/
public function getJprestaModelObjectId()
{
$id_post = (int)Tools::getValue('id_ever_post');
if ($id_post && ($postObj = new EverPsBlogPost($id_post)) && Validate::isLoadedObject($postObj)) {
return $id_post;
}
return null;
}
}

View File

@@ -0,0 +1,39 @@
<?php
/**
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license See the license of this module in file LICENSE.txt, thank you.
*/
if (!defined('_PS_VERSION_')) {
exit;
}
/**
* This override is disabled by default because the views 'count' is updated each time and so clears the cache is soon as it is created.
* To work, this count should be disabled or directly done with an SQL query without using the ObjectModel function 'update'.
*/
class EverPsBlogtagModuleFrontControllerOverride extends EverPsBlogtagModuleFrontController
{
/**
* @return string The ObjectModel class name to be used by Page Cache Ultimate module to refresh the cache of pages generated by this controller
*/
public static function getJprestaModelObjectClassName()
{
return 'EverPsBlogTag';
}
/**
* @return int|null The ID of the current ObjectModel (if any) to be used by Page Cache Ultimate module to refresh the cache of pages generated by this controller
*/
public function getJprestaModelObjectId()
{
$id_object = (int)Tools::getValue('id_ever_tag');
if ($id_object && ($postObj = new EverPsBlogTag($id_object)) && Validate::isLoadedObject($postObj)) {
return $id_object;
}
return null;
}
}

View File

@@ -0,0 +1,19 @@
<?php
/**
* This file protect the directory
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license See the license of this module in file LICENSE.txt, thank you.
*/
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("Location: ../");
exit;

View File

@@ -0,0 +1,19 @@
<?php
/**
* This file protect the directory
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license See the license of this module in file LICENSE.txt, thank you.
*/
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("Location: ../");
exit;

View File

@@ -0,0 +1,123 @@
<?php
/**
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license See the license of this module in file LICENSE.txt, thank you.
*/
if (!defined('_PS_VERSION_')) {
exit;
}
/**
* Implements getJprestaModelObjectClassName() and getJprestaModelObjectId() to enable the HTML cache provided by the
* module Page Cache Ultimate created by jpresta.com
*/
class FaqsDisplayModuleFrontControllerOverride extends FaqsDisplayModuleFrontController
{
/**
* @return string The ObjectModel class name to be used by Page Cache Ultimate module to refresh the cache of pages generated by this controller
*/
public static function getJprestaModelObjectClassName()
{
$faqCategoryId = Tools::getValue("category");
$faqId = Tools::getValue("question");
if ($faqCategoryId && $faqId) {
return 'faqsPost';
}
else if ($faqCategoryId) {
return 'faqsCategory';
}
else {
return 'FakeFaqToEnableCache';
}
}
/**
* @return int|null The ID of the current ObjectModel (if any) to be used by Page Cache Ultimate module to refresh the cache of pages generated by this controller
*/
public function getJprestaModelObjectId()
{
$faqCategoryId = Tools::getValue("category");
$faqId = Tools::getValue("question");
if ($faqCategoryId && $faqId) {
$faq = faqsPost::getFaqsByUrl((int) Shop::getContextShopID(), Context::getContext()->language->id, $faqCategoryId, $faqId, true);
return $faq[0] ? (int) $faq[0]['id_gomakoil_faq'] : null;
}
else if ($faqCategoryId) {
$cat = faqsCategory::getCategoryByName((int) Shop::getContextShopID(), Context::getContext()->language->id, $faqCategoryId);
return $cat[0] ? (int) $cat[0]['id_gomakoil_faq_category'] : null;
}
else {
return null;
}
}
/**
* List all URLs generated by this controller for the current shop context and the specified language.
* This is used by the Jresta-Cache-Warmer service to generate the cache of these pages.
* @param $id_lang int ID of the language
* @return string[] All URLs to warmup
*/
public static function getJprestaAllURLs($id_lang)
{
$id_shop = (int)Shop::getContextShopID();
$links = [];
// URL of the root
$baseUrl = $links[] = Context::getContext()->link->getModuleLink('faqs', 'display', [], $id_shop, $id_lang);
// URLs of categories
$cats = JPresta\SpeedPack\JprestaUtils::dbSelectRows('
SELECT c.id_gomakoil_faq_category, cl.link_rewrite
FROM `' . _DB_PREFIX_ . 'gomakoil_faq_category` c
LEFT JOIN `' . _DB_PREFIX_ . 'gomakoil_faq_category_shop` cs ON (c.id_gomakoil_faq_category = cs.id_gomakoil_faq_category)
LEFT JOIN `' . _DB_PREFIX_ . 'gomakoil_faq_category_lang` cl ON (c.id_gomakoil_faq_category = cl.id_gomakoil_faq_category)
WHERE c.active=1 AND cs.id_shop=' . (int)$id_shop . ' AND cl.id_lang=' . (int)$id_lang);
foreach ($cats as $cat) {
if (!faqs::getRewriteSettings()) {
$links[] = $baseUrl . '&category=' . $cat['link_rewrite'];
} else {
$links[] = $baseUrl . $cat['link_rewrite'] . '.html';
}
// URLs of FAQs
$faqs = JPresta\SpeedPack\JprestaUtils::dbSelectRows('
SELECT fl.link_rewrite
FROM `' . _DB_PREFIX_ . 'gomakoil_faq` f
LEFT JOIN `' . _DB_PREFIX_ . 'gomakoil_faq_shop` fs ON (f.id_gomakoil_faq = fs.id_gomakoil_faq)
LEFT JOIN `' . _DB_PREFIX_ . 'gomakoil_faq_lang` fl ON (f.id_gomakoil_faq = fl.id_gomakoil_faq)
WHERE f.active=1 AND f.id_gomakoil_faq_category=' . (int)$cat['id_gomakoil_faq_category'] . ' AND fs.id_shop=' . (int)$id_shop . ' AND fl.id_lang=' . (int)$id_lang);
foreach ($faqs as $faq) {
if (!faqs::getRewriteSettings()) {
$links[] = $baseUrl . '&category=' . $cat['link_rewrite'] . '&question=' . $faq['link_rewrite'];
} else {
$links[] = $baseUrl . $cat['link_rewrite'] . '/' . $faq['link_rewrite'] . '.html';
}
}
}
return $links;
}
/**
* An estimated number of URLs that will be returned by self::getJprestaAllURLs() for the current shop context.
* Since we don't have the id_lang parameter we recommend to return the number of URLs for the language that have
* the most URLs.
* @return int The estimated number of URLs to warmup for the current shop context
*/
public static function getJprestaAllURLsCount() {
$queryCountPagesCat = '
SELECT COUNT(*)
FROM `' . _DB_PREFIX_ . 'gomakoil_faq_category` c
LEFT JOIN `' . _DB_PREFIX_ . 'gomakoil_faq_category_shop` cs ON (c.id_gomakoil_faq_category = cs.id_gomakoil_faq_category)
WHERE c.`active` = 1 AND cs.`id_shop` = ' . (int) Shop::getContextShopID();
$queryCountPagesFaq = '
SELECT COUNT(*)
FROM `' . _DB_PREFIX_ . 'gomakoil_faq` f
LEFT JOIN `' . _DB_PREFIX_ . 'gomakoil_faq_shop` fs ON (f.id_gomakoil_faq = fs.id_gomakoil_faq)
WHERE f.`active` = 1 AND fs.`id_shop` = ' . (int) Shop::getContextShopID();
$countPagesRoot = 1;
return (int) JPresta\SpeedPack\JprestaUtils::dbGetValue($queryCountPagesCat)
+ (int) JPresta\SpeedPack\JprestaUtils::dbGetValue($queryCountPagesFaq)
+ $countPagesRoot;
}
}

View File

@@ -0,0 +1,19 @@
<?php
/**
* This file protect the directory
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license See the license of this module in file LICENSE.txt, thank you.
*/
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("Location: ../");
exit;

View File

@@ -0,0 +1,19 @@
<?php
/**
* This file protect the directory
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license See the license of this module in file LICENSE.txt, thank you.
*/
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("Location: ../");
exit;

View File

@@ -0,0 +1,19 @@
<?php
/**
* This file protect the directory
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license See the license of this module in file LICENSE.txt, thank you.
*/
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("Location: ../");
exit;

View File

@@ -0,0 +1,63 @@
<?php
/**
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license See the license of this module in file LICENSE.txt, thank you.
*/
if (!defined('_PS_VERSION_')) {
exit;
}
/**
* Implements getJprestaModelObjectClassName() and getJprestaModelObjectId() to enable the HTML cache provided by the
* module Page Cache Ultimate created by jpresta.com
*/
class HiFaqFaqModuleFrontControllerOverride extends HiFaqFaqModuleFrontController
{
/**
* @return string The ObjectModel class name to be used by Page Cache Ultimate module to refresh the cache of pages generated by this controller
*/
public static function getJprestaModelObjectClassName()
{
return 'HiFAQCategory';
}
/**
* @return int|null The ID of the current ObjectModel (if any) to be used by Page Cache Ultimate module to refresh the cache of pages generated by this controller
*/
public function getJprestaModelObjectId()
{
// Root of FAQ
return null;
}
/**
* List all URLs generated by this controller for the current shop context and the specified language.
* This is used by the Jresta-Cache-Warmer service to generate the cache of these pages.
* @param $id_lang int ID of the language
* @return string[] All URLs to warmup
*/
public static function getJprestaAllURLs($id_lang) {
$urls = [];
$context = Context::getContext();
if (Configuration::get('PS_REWRITING_SETTINGS')) {
$urls[] = $context->link->getPageLink('module-hifaq-faq', null, $id_lang, ['type' => null]);
} else {
$urls[] = $context->link->getModuleLink('hifaq', 'faq', ['type' => null]);
}
return $urls;
}
/**
* An estimated number of URLs that will be returned by self::getJprestaAllURLs() for the current shop context.
* Since we don't have the id_lang parameter we recommend to return the number of URLs for the language that have
* the most URLs.
* @return int The estimated number of URLs to warmup for the current shop context
*/
public static function getJprestaAllURLsCount() {
return 1;
}
}

View File

@@ -0,0 +1,79 @@
<?php
/**
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license See the license of this module in file LICENSE.txt, thank you.
*/
if (!defined('_PS_VERSION_')) {
exit;
}
/**
* Implements getJprestaModelObjectClassName() and getJprestaModelObjectId() to enable the HTML cache provided by the
* module Page Cache Ultimate created by jpresta.com
*/
class HiFaqFaqCategoryModuleFrontControllerOverride extends HiFaqFaqCategoryModuleFrontController
{
/**
* @return string The ObjectModel class name to be used by Page Cache Ultimate module to refresh the cache of pages generated by this controller
*/
public static function getJprestaModelObjectClassName()
{
return 'HiFAQCategory';
}
/**
* @return int|null The ID of the current ObjectModel (if any) to be used by Page Cache Ultimate module to refresh the cache of pages generated by this controller
*/
public function getJprestaModelObjectId()
{
$id_category = HiFAQCategory::getIdByLinkRewrite(Tools::getValue('faqc_link_rewrite'));
if ($id_category) {
return (int) $id_category;
}
return null;
}
/**
* List all URLs generated by this controller for the current shop context and the specified language.
* This is used by the Jresta-Cache-Warmer service to generate the cache of these pages.
* @param $id_lang int ID of the language
* @return string[] All URLs to warmup
*/
public static function getJprestaAllURLs($id_lang) {
$urls = [];
$context = Context::getContext();
$sql = 'SELECT friendly_url
FROM `' . _DB_PREFIX_ . 'hifaqcategory` f
LEFT JOIN `' . _DB_PREFIX_ . 'hifaqcategory_lang` fl ON f.id=fl.id
LEFT JOIN `' . _DB_PREFIX_ . 'hifaqcategory_shop` fs ON f.id=fs.id
WHERE f.active=1 AND fl.id_lang=' . (int)$id_lang . ' AND fs.id_shop=' . (int)Shop::getContextShopID();
$faqs = JPresta\SpeedPack\JprestaUtils::dbSelectRows($sql);
foreach ($faqs as $faq) {
if (Configuration::get('PS_REWRITING_SETTINGS')) {
$urls[] = $context->link->getPageLink('module-hifaq-faqcategory', null, $id_lang, ['faqc_link_rewrite' => $faq['friendly_url']]);
} else {
$urls[] = $context->link->getModuleLink('hifaq', 'faqcategory', ['faqc_link_rewrite' => $faq['friendly_url']], null, $id_lang);
}
}
return $urls;
}
/**
* An estimated number of URLs that will be returned by self::getJprestaAllURLs() for the current shop context.
* Since we don't have the id_lang parameter we recommend to return the number of URLs for the language that have
* the most URLs.
* @return int The estimated number of URLs to warmup for the current shop context
*/
public static function getJprestaAllURLsCount() {
$sql = 'SELECT COUNT(*)
FROM `' . _DB_PREFIX_ . 'hifaqcategory` f
LEFT JOIN `' . _DB_PREFIX_ . 'hifaqcategory_lang` fl ON f.id=fl.id
LEFT JOIN `' . _DB_PREFIX_ . 'hifaqcategory_shop` fs ON f.id=fs.id
WHERE f.active=1 AND fl.id_lang=' . (int)Configuration::get('PS_LANG_DEFAULT') . ' AND fs.id_shop=' . (int)Shop::getContextShopID();
return (int) JPresta\SpeedPack\JprestaUtils::dbGetValue($sql);
}
}

View File

@@ -0,0 +1,79 @@
<?php
/**
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license See the license of this module in file LICENSE.txt, thank you.
*/
if (!defined('_PS_VERSION_')) {
exit;
}
/**
* Implements getJprestaModelObjectClassName() and getJprestaModelObjectId() to enable the HTML cache provided by the
* module Page Cache Ultimate created by jpresta.com
*/
class HiFaqFaqDetailsModuleFrontControllerOverride extends HiFaqFaqDetailsModuleFrontController
{
/**
* @return string The ObjectModel class name to be used by Page Cache Ultimate module to refresh the cache of pages generated by this controller
*/
public static function getJprestaModelObjectClassName()
{
return 'HiFAQItem';
}
/**
* @return int|null The ID of the current ObjectModel (if any) to be used by Page Cache Ultimate module to refresh the cache of pages generated by this controller
*/
public function getJprestaModelObjectId()
{
$faq = HiFAQItem::getDetails(Tools::getValue('faq_link_rewrite'));
if (isset($faq)) {
return (int) $faq['id_faq'];
}
return null;
}
/**
* List all URLs generated by this controller for the current shop context and the specified language.
* This is used by the Jresta-Cache-Warmer service to generate the cache of these pages.
* @param $id_lang int ID of the language
* @return string[] All URLs to warmup
*/
public static function getJprestaAllURLs($id_lang) {
$urls = [];
$context = Context::getContext();
$sql = 'SELECT friendly_url
FROM `' . _DB_PREFIX_ . 'hifaq` f
LEFT JOIN `' . _DB_PREFIX_ . 'hifaq_lang` fl ON f.id_faq=fl.id_faq
LEFT JOIN `' . _DB_PREFIX_ . 'hifaq_shop` fs ON f.id_faq=fs.id_faq
WHERE f.active=1 AND fl.id_lang=' . (int)$id_lang . ' AND fs.id_shop=' . (int)Shop::getContextShopID();
$faqs = JPresta\SpeedPack\JprestaUtils::dbSelectRows($sql);
foreach ($faqs as $faq) {
if (Configuration::get('PS_REWRITING_SETTINGS')) {
$urls[] = $context->link->getPageLink('module-hifaq-faqdetails', null, $id_lang, ['faq_link_rewrite' => $faq['friendly_url']]);
} else {
$urls[] = $context->link->getModuleLink('hifaq', 'faqdetails', [], null, $id_lang) . '&faq_link_rewrite=' . $faq['friendly_url'];
}
}
return $urls;
}
/**
* An estimated number of URLs that will be returned by self::getJprestaAllURLs() for the current shop context.
* Since we don't have the id_lang parameter we recommend to return the number of URLs for the language that have
* the most URLs.
* @return int The estimated number of URLs to warmup for the current shop context
*/
public static function getJprestaAllURLsCount() {
$sql = 'SELECT COUNT(*)
FROM `' . _DB_PREFIX_ . 'hifaq` f
LEFT JOIN `' . _DB_PREFIX_ . 'hifaq_lang` fl ON f.id_faq=fl.id_faq
LEFT JOIN `' . _DB_PREFIX_ . 'hifaq_shop` fs ON f.id_faq=fs.id_faq
WHERE f.active=1 AND fl.id_lang=' . (int)Configuration::get('PS_LANG_DEFAULT') . ' AND fs.id_shop=' . (int)Shop::getContextShopID();
return (int) JPresta\SpeedPack\JprestaUtils::dbGetValue($sql);
}
}

View File

@@ -0,0 +1,19 @@
<?php
/**
* This file protect the directory
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license See the license of this module in file LICENSE.txt, thank you.
*/
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("Location: ../");
exit;

View File

@@ -0,0 +1,19 @@
<?php
/**
* This file protect the directory
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license See the license of this module in file LICENSE.txt, thank you.
*/
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("Location: ../");
exit;

View File

@@ -0,0 +1,19 @@
<?php
/**
* This file protect the directory
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license See the license of this module in file LICENSE.txt, thank you.
*/
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("Location: ../");
exit;

View File

@@ -0,0 +1,19 @@
<?php
/**
* This file protect the directory
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license See the license of this module in file LICENSE.txt, thank you.
*/
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("Location: ../");
exit;

View File

@@ -0,0 +1,40 @@
<?php
/**
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license See the license of this module in file LICENSE.txt, thank you.
*/
if (!defined('_PS_VERSION_')) {
exit;
}
/**
* Implements getJprestaModelObjectClassName() and getJprestaModelObjectId() to enable the HTML cache provided by the
* module Page Cache Ultimate created by jpresta.com
*/
class PH_SimpleBlogAuthorModuleFrontControllerOverride extends PH_SimpleBlogAuthorModuleFrontController
{
/**
* @return string The ObjectModel class name to be used by Page Cache Ultimate module to refresh the cache of pages generated by this controller
*/
public static function getJprestaModelObjectClassName()
{
return 'SimpleBlogPostAuthor';
}
/**
* @return int|null The ID of the current ObjectModel (if any) to be used by Page Cache Ultimate module to refresh the cache of pages generated by this controller
*/
public function getJprestaModelObjectId()
{
$id = null;
$simpleBlogAuthor = SimpleBlogPostAuthor::getByRewrite(Tools::getValue('rewrite'));
if (Validate::isLoadedObject($simpleBlogAuthor)) {
$id = $simpleBlogAuthor->id;
}
return $id;
}
}

View File

@@ -0,0 +1,69 @@
<?php
/**
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license See the license of this module in file LICENSE.txt, thank you.
*/
if (!defined('_PS_VERSION_')) {
exit;
}
/**
* Implements getJprestaModelObjectClassName() and getJprestaModelObjectId() to enable the HTML cache provided by the
* module Page Cache Ultimate created by jpresta.com
*/
class PH_SimpleBlogCategoryModuleFrontControllerOverride extends PH_SimpleBlogCategoryModuleFrontController
{
/**
* @return string The ObjectModel class name to be used by Page Cache Ultimate module to refresh the cache of pages generated by this controller
*/
public static function getJprestaModelObjectClassName()
{
return 'SimpleBlogCategory';
}
/**
* @return int|null The ID of the current ObjectModel (if any) to be used by Page Cache Ultimate module to refresh the cache of pages generated by this controller
*/
public function getJprestaModelObjectId()
{
$id = null;
$sb_category = Tools::getValue('sb_category');
if ($sb_category) {
$simpleBlogCategory = SimpleBlogCategory::getByRewrite($sb_category, $this->context->language->id);
if (Validate::isLoadedObject($simpleBlogCategory)) {
$id = $simpleBlogCategory->id;
}
}
return $id;
}
/**
* List all URLs generated by this controller for the current shop context and the specified language.
* This is used by the Jresta-Cache-Warmer service to generate the cache of these pages.
* @param $id_lang int ID of the language
* @return string[] All URLs to warmup
*/
public static function getJprestaAllURLs($id_lang) {
$urls = [];
$categories = SimpleBlogCategory::getCategories($id_lang, true, true, (int) Shop::getContextShopID());
foreach ($categories as $category) {
$urls[] = $category['url'];
}
return $urls;
}
/**
* An estimated number of URLs that will be returned by self::getJprestaAllURLs() for the current shop context.
* Since we don't have the id_lang parameter we recommend to return the number of URLs for the language that have
* the most URLs.
* @return int The estimated number of URLs to warmup for the current shop context
*/
public static function getJprestaAllURLsCount() {
$queryCountCategories = 'SELECT count(*) FROM `'._DB_PREFIX_.'simpleblog_category` WHERE active=1';
return (int) JPresta\SpeedPack\JprestaUtils::dbGetValue($queryCountCategories);
}
}

View File

@@ -0,0 +1,19 @@
<?php
/**
* This file protect the directory
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license See the license of this module in file LICENSE.txt, thank you.
*/
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("Location: ../");
exit;

View File

@@ -0,0 +1,62 @@
<?php
/**
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license See the license of this module in file LICENSE.txt, thank you.
*/
if (!defined('_PS_VERSION_')) {
exit;
}
/**
* Implements getJprestaModelObjectClassName() and getJprestaModelObjectId() to enable the HTML cache provided by the
* module Page Cache Ultimate created by jpresta.com
*/
class PH_SimpleBlogListModuleFrontControllerOverride extends PH_SimpleBlogListModuleFrontController
{
/**
* @return string The ObjectModel class name to be used by Page Cache Ultimate module to refresh the cache of pages generated by this controller
*/
public static function getJprestaModelObjectClassName()
{
return 'SimpleBlogCategory';
}
/**
* @return int|null The ID of the current ObjectModel (if any) to be used by Page Cache Ultimate module to refresh the cache of pages generated by this controller
*/
public function getJprestaModelObjectId()
{
return null;
}
/**
* List all URLs generated by this controller for the current shop context and the specified language.
* This is used by the Jresta-Cache-Warmer service to generate the cache of these pages.
* @param $id_lang int ID of the language
* @return string[] All URLs to warmup
*/
public static function getJprestaAllURLs($id_lang) {
$urls = [];
$urls[] = Context::getContext()->link->getModuleLink(
'ph_simpleblog',
'list',
[],
null,
$id_lang);
return $urls;
}
/**
* An estimated number of URLs that will be returned by self::getJprestaAllURLs() for the current shop context.
* Since we don't have the id_lang parameter we recommend to return the number of URLs for the language that have
* the most URLs.
* @return int The estimated number of URLs to warmup for the current shop context
*/
public static function getJprestaAllURLsCount() {
return 1;
}
}

View File

@@ -0,0 +1,94 @@
<?php
/**
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license See the license of this module in file LICENSE.txt, thank you.
*/
if (!defined('_PS_VERSION_')) {
exit;
}
/**
* Implements getJprestaModelObjectClassName() and getJprestaModelObjectId() to enable the HTML cache provided by the
* module Page Cache Ultimate created by jpresta.com
*/
class PH_SimpleBlogSingleModuleFrontControllerOverride extends PH_SimpleBlogSingleModuleFrontController
{
public function init()
{
if ($_SERVER['REQUEST_METHOD'] === 'POST' && !Tools::getIsset('page_cache_dynamics_mods')) {
Hook::exec('actionJPrestaClearCache', [
'controller' => 'ph_simpleblog__single',
'id' => $this->getJprestaModelObjectId(),
'delete_linking_pages' => false,
'action_origin' => 'method-post'
]);
}
parent::init();
}
/**
* @return string The ObjectModel class name to be used by Page Cache Ultimate module to refresh the cache of pages generated by this controller
*/
public static function getJprestaModelObjectClassName()
{
return 'SimpleBlogPost';
}
/**
* @return int|null The ID of the current ObjectModel (if any) to be used by Page Cache Ultimate module to refresh the cache of pages generated by this controller
*/
public function getJprestaModelObjectId()
{
// Get Post by link_rewrite
$simpleblog_post_rewrite = Tools::getValue('rewrite');
if (!$simpleblog_post_rewrite || !Validate::isLinkRewrite($simpleblog_post_rewrite)) {
return null;
}
$simpleBlogPost = SimpleBlogPost::getByRewrite(
$simpleblog_post_rewrite,
(int) Context::getContext()->language->id,
Tools::getValue('sb_category')
);
return $simpleBlogPost ? $simpleBlogPost->id : null;
}
/**
* List all URLs generated by this controller for the current shop context and the specified language.
* This is used by the Jresta-Cache-Warmer service to generate the cache of these pages.
* @param $id_lang int ID of the language
* @return string[] All URLs to warmup
*/
public static function getJprestaAllURLs($id_lang) {
$urls = [];
$finder = new BlogPostsFinder();
$finder->setIdShop((int) Shop::getContextShopID());
$finder->setIdLang($id_lang);
$finder->setCheckForAccess(false);
$posts = $finder->findPosts();
foreach ($posts as $post) {
$urls[] = $post['url'];
}
return $urls;
}
/**
* An estimated number of URLs that will be returned by self::getJprestaAllURLs() for the current shop context.
* Since we don't have the id_lang parameter we recommend to return the number of URLs for the language that have
* the most URLs.
* @return int The estimated number of URLs to warmup for the current shop context
*/
public static function getJprestaAllURLsCount() {
$queryCountArticle = 'SELECT count(*) FROM `'._DB_PREFIX_.'simpleblog_post` sbp INNER JOIN `'._DB_PREFIX_.'simpleblog_post_shop` sbps ON sbp.id_simpleblog_post = sbps.id_simpleblog_post WHERE sbp.active=1 AND sbp.date_add <= \'' . SimpleBlogHelper::now(Configuration::get('PH_BLOG_TIMEZONE')) . '\' AND sbps.id_shop=' . (int) Shop::getContextShopID();
return (int) JPresta\SpeedPack\JprestaUtils::dbGetValue($queryCountArticle);
}
}

View File

@@ -0,0 +1,19 @@
<?php
/**
* This file protect the directory
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license See the license of this module in file LICENSE.txt, thank you.
*/
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("Location: ../");
exit;

View File

@@ -0,0 +1,19 @@
<?php
/**
* This file protect the directory
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license See the license of this module in file LICENSE.txt, thank you.
*/
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("Location: ../");
exit;

View File

@@ -0,0 +1,20 @@
<?php
/**
* This file protect the directory
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license You are just allowed to modify this copy for your own use. You must not redistribute it. License
* is permitted for one Prestashop instance only but you can install it on your test instances.
*/
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("Location: ../");
exit;

View File

@@ -0,0 +1,41 @@
<?php
/**
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license See the license of this module in file LICENSE.txt, thank you.
*/
if (!defined('_PS_VERSION_')) {
exit;
}
use AdvancedSearch\Models\Seo;
/**
* Implements getJprestaModelObjectClassName() and getJprestaModelObjectId() to enable the HTML cache provided by the
* module Page Cache Ultimate created by jpresta.com
*/
class pm_advancedsearch4seoModuleFrontControllerOverride extends pm_advancedsearch4seoModuleFrontController
{
/**
* @return string The ObjectModel class name to be used by Page Cache Ultimate module to refresh the cache of pages generated by this controller
*/
public static function getJprestaModelObjectClassName()
{
return 'AdvancedSearch\Models\Seo';
}
/**
* @return int|null The ID of the current ObjectModel (if any) to be used by Page Cache Ultimate module to refresh the cache of pages generated by this controller
*/
public function getJprestaModelObjectId()
{
$id_seo = (int)Tools::getValue('id_seo');
if ($id_seo && ($seoObj = new Seo($id_seo)) && Validate::isLoadedObject($seoObj)) {
return $id_seo;
}
return null;
}
}

View File

@@ -0,0 +1,20 @@
<?php
/**
* This file protect the directory
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license You are just allowed to modify this copy for your own use. You must not redistribute it. License
* is permitted for one Prestashop instance only but you can install it on your test instances.
*/
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("Location: ../");
exit;

View File

@@ -0,0 +1,20 @@
<?php
/**
* This file protect the directory
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license You are just allowed to modify this copy for your own use. You must not redistribute it. License
* is permitted for one Prestashop instance only but you can install it on your test instances.
*/
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("Location: ../");
exit;

View File

@@ -0,0 +1,101 @@
<?php
/**
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license See the license of this module in file LICENSE.txt, thank you.
*/
if (!defined('_PS_VERSION_')) {
exit;
}
class PrestaBlogBlogModuleFrontControllerOverride extends PrestaBlogBlogModuleFrontController
{
// Needed by creativeelements
private $news = array();
/**
* @return string The ObjectModel class name to be used by Page Cache Ultimate module to refresh the cache of pages generated by this controller
*/
public static function getJprestaModelObjectClassName()
{
return 'NewsClass';
}
/**
* @return int|null The ID of the current ObjectModel (if any) to be used by Page Cache Ultimate module to refresh the cache of pages generated by this controller
*/
public function getJprestaModelObjectId()
{
$id_post = (int)Tools::getValue('id');
if ($id_post && ($postObj = new NewsClass($id_post)) && Validate::isLoadedObject($postObj)) {
return $id_post;
}
return null;
}
/**
* List all URLs generated by this controller for the current shop context and the specified language.
* This is used by the Jresta-Cache-Warmer service to generate the cache of these pages.
* @param $id_lang int ID of the language
* @return string[] All URLs to warmup
*/
public static function getJprestaAllURLs($id_lang) {
$urls = [];
// Articles
$urlsInfos = NewsClass::getListe(
(int) $id_lang,
1,
0,
0,
null,
'n.`date`',
'desc',
date(
'Y-m-d H:i:s',
strtotime('-' . (int) Configuration::get('prestablog_sitemap_older') . ' months')
),
null,
null,
1,
(int) Configuration::get('prestablog_news_title_length'),
(int) Configuration::get('prestablog_news_intro_length')
);
foreach ($urlsInfos as $child) {
$urls[] = PrestaBlog::prestablogUrl(
[
'id' => (int) $child['id_prestablog_news'],
'seo' => $child['link_rewrite'],
'titre' => $child['title'],
'id_lang' => (int) $child['id_lang'],
]
);
}
// Categories
$urlsInfos = CategoriesClass::getListeNoArbo(1, (int) $id_lang);
foreach ($urlsInfos as $child) {
$urls[] = PrestaBlog::prestablogUrl([
'c' => (int)$child['id_prestablog_categorie'],
'titre' => ($child['link_rewrite'] != '' ? $child['link_rewrite'] : $child['title']),
'id_lang' => (int)$child['id_lang'],
]);
}
return $urls;
}
/**
* An estimated number of URLs that will be returned by self::getJprestaAllURLs() for the current shop context.
* Since we don't have the id_lang parameter we recommend to return the number of URLs for the language that have
* the most URLs.
* @return int The estimated number of URLs to warmup for the current shop context
*/
public static function getJprestaAllURLsCount() {
$queryCountArticle = 'SELECT count(*) FROM `'._DB_PREFIX_.'prestablog_news` WHERE actif=1 AND id_shop=' . (int) Shop::getContextShopID();
$queryCountCategories = 'SELECT count(*) FROM `'._DB_PREFIX_.'prestablog_categorie` WHERE actif=1 AND id_shop=' . (int) Shop::getContextShopID();
return (int) JPresta\SpeedPack\JprestaUtils::dbGetValue($queryCountArticle) + (int) JPresta\SpeedPack\JprestaUtils::dbGetValue($queryCountCategories);
}
}

View File

@@ -0,0 +1,19 @@
<?php
/**
* This file protect the directory
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license See the license of this module in file LICENSE.txt, thank you.
*/
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("Location: ../");
exit;

View File

@@ -0,0 +1,19 @@
<?php
/**
* This file protect the directory
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license See the license of this module in file LICENSE.txt, thank you.
*/
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("Location: ../");
exit;

View File

@@ -0,0 +1,19 @@
<?php
/**
* This file protect the directory
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license See the license of this module in file LICENSE.txt, thank you.
*/
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("Location: ../");
exit;

View File

@@ -0,0 +1,39 @@
<?php
/**
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license See the license of this module in file LICENSE.txt, thank you.
*/
if (!defined('_PS_VERSION_')) {
exit;
}
/**
* Implements getJprestaModelObjectClassName() and getJprestaModelObjectId() to enable the HTML cache provided by the
* module Page Cache Ultimate created by jpresta.com
*/
class StblogArticleModuleFrontControllerOverride extends StblogArticleModuleFrontController
{
/**
* @return string The ObjectModel class name to be used by Page Cache Ultimate module to refresh the cache of pages generated by this controller
*/
public static function getJprestaModelObjectClassName()
{
return 'StBlogClass';
}
/**
* @return int|null The ID of the current ObjectModel (if any) to be used by Page Cache Ultimate module to refresh the cache of pages generated by this controller
*/
public function getJprestaModelObjectId()
{
$id_post = (int)Tools::getValue('id_st_blog');
if ($id_post && ($postObj = new StBlogClass($id_post)) && Validate::isLoadedObject($postObj)) {
return $id_post;
}
return null;
}
}

View File

@@ -0,0 +1,39 @@
<?php
/**
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license See the license of this module in file LICENSE.txt, thank you.
*/
if (!defined('_PS_VERSION_')) {
exit;
}
/**
* Implements getJprestaModelObjectClassName() and getJprestaModelObjectId() to enable the HTML cache provided by the
* module Page Cache Ultimate created by jpresta.com
*/
class StblogCategoryModuleFrontControllerOverride extends StblogCategoryModuleFrontController
{
/**
* @return string The ObjectModel class name to be used by Page Cache Ultimate module to refresh the cache of pages generated by this controller
*/
public static function getJprestaModelObjectClassName()
{
return 'StBlogCategory';
}
/**
* @return int|null The ID of the current ObjectModel (if any) to be used by Page Cache Ultimate module to refresh the cache of pages generated by this controller
*/
public function getJprestaModelObjectId()
{
$id_post = (int)Tools::getValue('id_st_blog_category');
if ($id_post && ($postObj = new StBlogCategory($id_post)) && Validate::isLoadedObject($postObj)) {
return $id_post;
}
return null;
}
}

View File

@@ -0,0 +1,35 @@
<?php
/**
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license See the license of this module in file LICENSE.txt, thank you.
*/
if (!defined('_PS_VERSION_')) {
exit;
}
/**
* Implements getJprestaModelObjectClassName() and getJprestaModelObjectId() to enable the HTML cache provided by the
* module Page Cache Ultimate created by jpresta.com
*/
class StblogDefaultModuleFrontControllerOverride extends StblogDefaultModuleFrontController
{
/**
* @return string The ObjectModel class name to be used by Page Cache Ultimate module to refresh the cache of pages generated by this controller
*/
public static function getJprestaModelObjectClassName()
{
return 'StBlog';
}
/**
* @return int|null The ID of the current ObjectModel (if any) to be used by Page Cache Ultimate module to refresh the cache of pages generated by this controller
*/
public function getJprestaModelObjectId()
{
return null;
}
}

View File

@@ -0,0 +1,19 @@
<?php
/**
* This file protect the directory
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license See the license of this module in file LICENSE.txt, thank you.
*/
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("Location: ../");
exit;

View File

@@ -0,0 +1,19 @@
<?php
/**
* This file protect the directory
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license See the license of this module in file LICENSE.txt, thank you.
*/
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("Location: ../");
exit;

View File

@@ -0,0 +1,19 @@
<?php
/**
* This file protect the directory
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license See the license of this module in file LICENSE.txt, thank you.
*/
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("Location: ../");
exit;

View File

@@ -0,0 +1,35 @@
<?php
/**
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license See the license of this module in file LICENSE.txt, thank you.
*/
if (!defined('_PS_VERSION_')) {
exit;
}
/**
* Implements getJprestaModelObjectClassName() and getJprestaModelObjectId() to enable the HTML cache provided by the
* module Page Cache Ultimate created by jpresta.com
*/
class StblogArchivesDefaultModuleFrontControllerOverride extends StblogArchivesDefaultModuleFrontController
{
/**
* @return string The ObjectModel class name to be used by Page Cache Ultimate module to refresh the cache of pages generated by this controller
*/
public static function getJprestaModelObjectClassName()
{
return null;
}
/**
* @return int|null The ID of the current ObjectModel (if any) to be used by Page Cache Ultimate module to refresh the cache of pages generated by this controller
*/
public function getJprestaModelObjectId()
{
return null;
}
}

View File

@@ -0,0 +1,19 @@
<?php
/**
* This file protect the directory
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license See the license of this module in file LICENSE.txt, thank you.
*/
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("Location: ../");
exit;

View File

@@ -0,0 +1,19 @@
<?php
/**
* This file protect the directory
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license See the license of this module in file LICENSE.txt, thank you.
*/
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("Location: ../");
exit;

View File

@@ -0,0 +1,19 @@
<?php
/**
* This file protect the directory
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license See the license of this module in file LICENSE.txt, thank you.
*/
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("Location: ../");
exit;

View File

@@ -0,0 +1,38 @@
<?php
/**
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license See the license of this module in file LICENSE.txt, thank you.
*/
if (!defined('_PS_VERSION_'))
exit;
/**
* Implements getJprestaModelObjectClassName() and getJprestaModelObjectId() to enable the HTML cache provided by the
* module Page Cache Ultimate created by jpresta.com
*/
class Ybc_blogBlogModuleFrontControllerOverride extends Ybc_blogBlogModuleFrontController
{
/**
* @return string The ObjectModel class name to be used by Page Cache Ultimate module to refresh the cache of pages generated by this controller
*/
public static function getJprestaModelObjectClassName()
{
return 'Ybc_blog_post_class';
}
/**
* @return int|null The ID of the current ObjectModel (if any) to be used by Page Cache Ultimate module to refresh the cache of pages generated by this controller
*/
public function getJprestaModelObjectId()
{
$id_post = (int)Tools::getValue('id_post');
if (!$id_post && ($post_url_alias = Tools::getValue('post_url_alias')) && Validate::isLinkRewrite($post_url_alias)) {
$id_post = (int)Ybc_blog_post_class::getIDPostByUrlAlias($post_url_alias, $this->context->language->id);
}
return $id_post;
}
}

View File

@@ -0,0 +1,19 @@
<?php
/**
* This file protect the directory
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license See the license of this module in file LICENSE.txt, thank you.
*/
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("Location: ../");
exit;

View File

@@ -0,0 +1,19 @@
<?php
/**
* This file protect the directory
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license See the license of this module in file LICENSE.txt, thank you.
*/
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("Location: ../");
exit;

View File

@@ -0,0 +1,19 @@
<?php
/**
* This file protect the directory
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license See the license of this module in file LICENSE.txt, thank you.
*/
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("Location: ../");
exit;