36 lines
966 B
PHP
36 lines
966 B
PHP
<?php
|
|
require_once _PS_MODULE_DIR_.'cmsps/classes/CmsPsEdito.php';
|
|
|
|
class PostEditoControllerCore extends FrontController
|
|
{
|
|
public $php_self = 'postedito';
|
|
public $postedito;
|
|
|
|
public function canonicalRedirection($canonical_url = '') {
|
|
parent::canonicalRedirection($this->context->link->getPostEditoLink($this->postedito->id));
|
|
}
|
|
|
|
public function init() {
|
|
$id_post_edito = Tools::getValue('id_post_edito', 0);
|
|
$this->postedito = new CmsPsEdito($id_post_edito, $this->context->language->id);
|
|
|
|
if (!Validate::isLoadedObject($this->postedito)
|
|
|| !$this->postedito->active) {
|
|
header('HTTP/1.1 404 Not Found');
|
|
header('Status: 404 Not Found');
|
|
}
|
|
parent::init();
|
|
}
|
|
|
|
public function initContent() {
|
|
parent::initContent();
|
|
|
|
$this->context->smarty->assign(array(
|
|
// 'path' => Tools::getPath($this->postedito->id, '', FALSE, 'postedito'),
|
|
'post' => $this->postedito
|
|
));
|
|
|
|
// $this->setTemplate(_PS_THEME_DIR_.'postedito.tpl');
|
|
}
|
|
|
|
} |