udpate
This commit is contained in:
@@ -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;
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
19
override/modules/af_producttagspro/controllers/index.php
Normal file
19
override/modules/af_producttagspro/controllers/index.php
Normal 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;
|
||||
19
override/modules/af_producttagspro/index.php
Normal file
19
override/modules/af_producttagspro/index.php
Normal 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;
|
||||
19
override/modules/af_seopages/controllers/front/index.php
Normal file
19
override/modules/af_seopages/controllers/front/index.php
Normal 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;
|
||||
69
override/modules/af_seopages/controllers/front/seopage.php
Normal file
69
override/modules/af_seopages/controllers/front/seopage.php
Normal 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);
|
||||
}
|
||||
}
|
||||
19
override/modules/af_seopages/controllers/index.php
Normal file
19
override/modules/af_seopages/controllers/index.php
Normal 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;
|
||||
19
override/modules/af_seopages/index.php
Normal file
19
override/modules/af_seopages/index.php
Normal 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;
|
||||
19
override/modules/configurator/controllers/front/index.php
Normal file
19
override/modules/configurator/controllers/front/index.php
Normal 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;
|
||||
36
override/modules/configurator/controllers/front/product.php
Normal file
36
override/modules/configurator/controllers/front/product.php
Normal 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;
|
||||
}
|
||||
|
||||
}
|
||||
19
override/modules/configurator/controllers/index.php
Normal file
19
override/modules/configurator/controllers/index.php
Normal 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;
|
||||
19
override/modules/configurator/index.php
Normal file
19
override/modules/configurator/index.php
Normal 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;
|
||||
10
override/modules/contactform/contactform.php
Normal file
10
override/modules/contactform/contactform.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
class ContactformOverride extends Contactform
|
||||
{
|
||||
public function sendMessage() {
|
||||
Hook::exec('actionContactFormSubmitBefore');
|
||||
if ( !sizeof($this->context->controller->errors)) {
|
||||
parent::sendMessage();
|
||||
}
|
||||
}
|
||||
}
|
||||
39
override/modules/ets_blog/controllers/front/blog.php
Normal file
39
override/modules/ets_blog/controllers/front/blog.php
Normal 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;
|
||||
}
|
||||
}
|
||||
19
override/modules/ets_blog/controllers/front/index.php
Normal file
19
override/modules/ets_blog/controllers/front/index.php
Normal 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;
|
||||
19
override/modules/ets_blog/controllers/index.php
Normal file
19
override/modules/ets_blog/controllers/index.php
Normal 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;
|
||||
19
override/modules/ets_blog/index.php
Normal file
19
override/modules/ets_blog/index.php
Normal 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;
|
||||
39
override/modules/everpsblog/controllers/front/author.php.off
Normal file
39
override/modules/everpsblog/controllers/front/author.php.off
Normal 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;
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
19
override/modules/everpsblog/controllers/front/index.php
Normal file
19
override/modules/everpsblog/controllers/front/index.php
Normal 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;
|
||||
39
override/modules/everpsblog/controllers/front/post.php
Normal file
39
override/modules/everpsblog/controllers/front/post.php
Normal 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;
|
||||
}
|
||||
}
|
||||
39
override/modules/everpsblog/controllers/front/tag.php.off
Normal file
39
override/modules/everpsblog/controllers/front/tag.php.off
Normal 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;
|
||||
}
|
||||
}
|
||||
19
override/modules/everpsblog/controllers/index.php
Normal file
19
override/modules/everpsblog/controllers/index.php
Normal 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;
|
||||
19
override/modules/everpsblog/index.php
Normal file
19
override/modules/everpsblog/index.php
Normal 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;
|
||||
123
override/modules/faqs/controllers/front/display.php
Normal file
123
override/modules/faqs/controllers/front/display.php
Normal 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;
|
||||
}
|
||||
}
|
||||
19
override/modules/faqs/controllers/front/index.php
Normal file
19
override/modules/faqs/controllers/front/index.php
Normal 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;
|
||||
19
override/modules/faqs/controllers/index.php
Normal file
19
override/modules/faqs/controllers/index.php
Normal 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;
|
||||
19
override/modules/faqs/index.php
Normal file
19
override/modules/faqs/index.php
Normal 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;
|
||||
63
override/modules/hifaq/controllers/front/faq.php
Normal file
63
override/modules/hifaq/controllers/front/faq.php
Normal 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;
|
||||
}
|
||||
}
|
||||
79
override/modules/hifaq/controllers/front/faqcategory.php
Normal file
79
override/modules/hifaq/controllers/front/faqcategory.php
Normal 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);
|
||||
}
|
||||
}
|
||||
79
override/modules/hifaq/controllers/front/faqdetails.php
Normal file
79
override/modules/hifaq/controllers/front/faqdetails.php
Normal 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);
|
||||
}
|
||||
}
|
||||
19
override/modules/hifaq/controllers/front/index.php
Normal file
19
override/modules/hifaq/controllers/front/index.php
Normal 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;
|
||||
19
override/modules/hifaq/controllers/index.php
Normal file
19
override/modules/hifaq/controllers/index.php
Normal 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;
|
||||
19
override/modules/hifaq/index.php
Normal file
19
override/modules/hifaq/index.php
Normal 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;
|
||||
35
override/modules/index.php
Normal file
35
override/modules/index.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/**
|
||||
* 2007-2018 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:
|
||||
* https://opensource.org/licenses/OSL-3.0
|
||||
* 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 license@prestashop.com 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.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2018 PrestaShop SA
|
||||
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
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;
|
||||
40
override/modules/ph_simpleblog/controllers/front/author.php
Normal file
40
override/modules/ph_simpleblog/controllers/front/author.php
Normal 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;
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
19
override/modules/ph_simpleblog/controllers/front/index.php
Normal file
19
override/modules/ph_simpleblog/controllers/front/index.php
Normal 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;
|
||||
62
override/modules/ph_simpleblog/controllers/front/list.php
Normal file
62
override/modules/ph_simpleblog/controllers/front/list.php
Normal 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;
|
||||
}
|
||||
}
|
||||
94
override/modules/ph_simpleblog/controllers/front/single.php
Normal file
94
override/modules/ph_simpleblog/controllers/front/single.php
Normal 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);
|
||||
}
|
||||
}
|
||||
19
override/modules/ph_simpleblog/controllers/index.php
Normal file
19
override/modules/ph_simpleblog/controllers/index.php
Normal 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;
|
||||
19
override/modules/ph_simpleblog/index.php
Normal file
19
override/modules/ph_simpleblog/index.php
Normal 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;
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
20
override/modules/pm_advancedsearch4/controllers/index.php
Normal file
20
override/modules/pm_advancedsearch4/controllers/index.php
Normal 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;
|
||||
20
override/modules/pm_advancedsearch4/index.php
Normal file
20
override/modules/pm_advancedsearch4/index.php
Normal 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;
|
||||
101
override/modules/prestablog/controllers/front/blog.php
Normal file
101
override/modules/prestablog/controllers/front/blog.php
Normal 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);
|
||||
}
|
||||
}
|
||||
19
override/modules/prestablog/controllers/front/index.php
Normal file
19
override/modules/prestablog/controllers/front/index.php
Normal 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;
|
||||
19
override/modules/prestablog/controllers/index.php
Normal file
19
override/modules/prestablog/controllers/index.php
Normal 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;
|
||||
19
override/modules/prestablog/index.php
Normal file
19
override/modules/prestablog/index.php
Normal 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;
|
||||
39
override/modules/stblog/controllers/front/article.php
Normal file
39
override/modules/stblog/controllers/front/article.php
Normal 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;
|
||||
}
|
||||
}
|
||||
39
override/modules/stblog/controllers/front/category.php
Normal file
39
override/modules/stblog/controllers/front/category.php
Normal 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;
|
||||
}
|
||||
}
|
||||
35
override/modules/stblog/controllers/front/default.php
Normal file
35
override/modules/stblog/controllers/front/default.php
Normal 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;
|
||||
}
|
||||
}
|
||||
19
override/modules/stblog/controllers/front/index.php
Normal file
19
override/modules/stblog/controllers/front/index.php
Normal 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;
|
||||
19
override/modules/stblog/controllers/index.php
Normal file
19
override/modules/stblog/controllers/index.php
Normal 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;
|
||||
19
override/modules/stblog/index.php
Normal file
19
override/modules/stblog/index.php
Normal 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;
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
19
override/modules/stblogarchives/controllers/front/index.php
Normal file
19
override/modules/stblogarchives/controllers/front/index.php
Normal 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;
|
||||
19
override/modules/stblogarchives/controllers/index.php
Normal file
19
override/modules/stblogarchives/controllers/index.php
Normal 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;
|
||||
19
override/modules/stblogarchives/index.php
Normal file
19
override/modules/stblogarchives/index.php
Normal 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;
|
||||
38
override/modules/ybc_blog/controllers/front/blog.php
Normal file
38
override/modules/ybc_blog/controllers/front/blog.php
Normal 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;
|
||||
}
|
||||
}
|
||||
19
override/modules/ybc_blog/controllers/front/index.php
Normal file
19
override/modules/ybc_blog/controllers/front/index.php
Normal 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;
|
||||
19
override/modules/ybc_blog/controllers/index.php
Normal file
19
override/modules/ybc_blog/controllers/index.php
Normal 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;
|
||||
19
override/modules/ybc_blog/index.php
Normal file
19
override/modules/ybc_blog/index.php
Normal 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;
|
||||
Reference in New Issue
Block a user