本文整理汇总了PHP中util::nlToP方法的典型用法代码示例。如果您正苦于以下问题:PHP util::nlToP方法的具体用法?PHP util::nlToP怎么用?PHP util::nlToP使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类util
的用法示例。
在下文中一共展示了util::nlToP方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: commonPreparation
/**
* Formatages des données d'un galleriesItemsRecordset communs aux listes et aux éléments.
*
* @param galleriesItemsRecordset $rs
* @return void
*/
protected function commonPreparation(galleriesItemsRecordset $rs)
{
# url élément
$rs->url = $rs->getItemUrl();
# url galerie
$rs->gallery_url = $rs->getGalleryUrl();
# récupération des images
$rs->image = $rs->getImagesInfo();
# contenu
if (!$this->config->enable_rte) {
$rs->content = util::nlToP($rs->content);
}
$rs->content = $this->okt->performCommonContentReplacements($rs->content);
}
示例2: newsCategory
/**
* Affichage de la liste des articles d'une rubrique.
*
*/
public function newsCategory($aMatches)
{
# module actuel
$this->okt->page->module = 'news';
$this->okt->page->action = 'category';
# si les rubriques ne sont pas actives -> 404
if (!$this->okt->news->config->categories['enable']) {
$this->serve404();
}
# récupération de la rubrique en fonction du slug
if (!empty($aMatches[0])) {
$sCategorySlug = $aMatches[0];
} else {
$this->serve404();
}
# récupération de la rubrique
$rsCategory = $this->okt->news->categories->getCategories(array('active' => 1, 'language' => $this->okt->user->language, 'slug' => $sCategorySlug));
if ($rsCategory->isEmpty()) {
$this->serve404();
}
# permission de lecture ?
if (!$this->okt->news->isPublicAccessible()) {
if ($this->okt->user->is_guest) {
http::redirect(html::escapeHTML(usersHelpers::getLoginUrl(newsHelpers::getCategoryUrl($rsCategory->slug))));
} else {
$this->serve404();
}
}
# is default route ?
$bIsDefaultRoute = $this->isDefaultRoute(__CLASS__, __FUNCTION__, $sCategorySlug);
# formatage description rubrique
if (!$this->okt->news->config->categories['rte']) {
$rsCategory->content = util::nlToP($rsCategory->content);
}
# initialisation paramètres
$aNewsParams = array('active' => 1, 'language' => $this->okt->user->language, 'category_id' => $rsCategory->id);
# initialisation des filtres
$this->okt->news->filtersStart('public');
# ré-initialisation filtres
if (!empty($_GET['init_news_filters'])) {
$this->okt->news->filters->initFilters();
http::redirect($this->okt->news->config->url);
}
# initialisation des filtres
$this->okt->news->filters->setPostsParams($aNewsParams);
$this->okt->news->filters->getFilters();
# initialisation de la pagination
$iNumFilteredPosts = $this->okt->news->getPostsCount($aNewsParams);
$oNewsPager = new publicPager($this->okt->news->filters->params->page, $iNumFilteredPosts, $this->okt->news->filters->params->nb_per_page);
$iNumPages = $oNewsPager->getNbPages();
$this->okt->news->filters->normalizePage($iNumPages);
$aNewsParams['limit'] = ($this->okt->news->filters->params->page - 1) * $this->okt->news->filters->params->nb_per_page . ',' . $this->okt->news->filters->params->nb_per_page;
# récupération des articles
$rsPostsList = $this->okt->news->getPosts($aNewsParams);
# meta description
if (!empty($rsCategory->meta_description)) {
$this->okt->page->meta_description = $rsCategory->meta_description;
} elseif (!empty($this->okt->news->config->meta_description[$this->okt->user->language])) {
$this->okt->page->meta_description = $this->okt->news->config->meta_description[$this->okt->user->language];
} else {
$this->okt->page->meta_description = util::getSiteMetaDesc();
}
# meta keywords
if (!empty($rsCategory->meta_keywords)) {
$this->okt->page->meta_keywords = $rsCategory->meta_keywords;
} elseif (!empty($this->okt->news->config->meta_keywords[$this->okt->user->language])) {
$this->okt->page->meta_keywords = $this->okt->news->config->meta_keywords[$this->okt->user->language];
} else {
$this->okt->page->meta_keywords = util::getSiteMetaKeywords();
}
# ajout du numéro de page au title
if ($this->okt->news->filters->params->page > 1) {
$this->okt->page->addTitleTag(sprintf(__('c_c_Page_%s'), $this->okt->news->filters->params->page));
}
# title tag
$this->okt->page->addTitleTag(!empty($rsCategory->title_tag) ? $rsCategory->title_tag : $rsCategory->title);
# fil d'ariane
if (!$bIsDefaultRoute) {
$this->okt->page->breadcrumb->add($this->okt->news->getName(), $this->okt->news->config->url);
# ajout de la hiérarchie des rubriques au fil d'ariane
$rsPath = $this->okt->news->categories->getPath($rsCategory->id, true, $this->okt->user->language);
while ($rsPath->fetch()) {
$this->okt->page->breadcrumb->add($rsPath->title, newsHelpers::getCategoryUrl($rsPath->slug));
}
}
# titre de la page
$this->okt->page->setTitle($rsCategory->title);
# titre SEO de la page
$this->okt->page->setTitleSeo($rsCategory->title_seo);
# raccourcis
$rsPostsList->numPages = $iNumPages;
$rsPostsList->pager = $oNewsPager;
# affichage du template
echo $this->okt->tpl->render($this->okt->news->getCategoryTplPath($rsCategory->tpl), array('rsPostsList' => $rsPostsList, 'rsCategory' => $rsCategory));
}
示例3: galleriesItem
/**
* Affichage d'un élément.
*
*/
public function galleriesItem($aMatches)
{
# récupération de l'élément en fonction du slug
if (!empty($aMatches[0])) {
$slug = $aMatches[0];
} else {
$this->serve404();
}
# récupération de l'élément
$rsItem = $this->okt->galleries->items->getItems(array('slug' => $slug, 'active' => 1, 'language' => $this->okt->user->language));
if ($rsItem->isEmpty()) {
$this->serve404();
}
# module actuel
$this->okt->page->module = 'galleries';
$this->okt->page->action = 'item';
//$rsItem->image = $rsItem->getImagesInfo();
if ($this->okt->galleries->config->enable_rte == '' && $rsItem->legend != '') {
$rsItem->legend = util::nlToP($rsItem->legend);
}
# title tag
$this->okt->page->addTitleTag($this->okt->galleries->getTitle());
if ($rsItem->title_tag == '') {
$rsItem->title_tag = $rsItem->title;
}
$this->okt->page->addTitleTag($rsItem->title_tag);
# meta description
if ($rsItem->meta_description != '') {
$this->okt->page->meta_description = $rsItem->meta_description;
} else {
if ($this->okt->galleries->config->meta_description[$this->okt->user->language] != '') {
$this->okt->page->meta_description = $this->okt->galleries->config->meta_description[$this->okt->user->language];
} else {
$this->okt->page->meta_description = util::getSiteMetaDesc();
}
}
# meta keywords
if ($rsItem->meta_keywords != '') {
$this->okt->page->meta_keywords = $rsItem->meta_keywords;
} else {
if ($this->okt->galleries->config->meta_keywords[$this->okt->user->language] != '') {
$this->okt->page->meta_keywords = $this->okt->galleries->config->meta_keywords[$this->okt->user->language];
} else {
$this->okt->page->meta_keywords = util::getSiteMetaKeywords();
}
}
# fil d'ariane
if (!$this->isDefaultRoute(__CLASS__, __FUNCTION__, $slug)) {
$this->okt->page->breadcrumb->add($this->okt->galleries->getName(), $this->okt->galleries->config->url);
$rsPath = $this->okt->galleries->tree->getPath($rsItem->gallery_id, true, $this->okt->user->language);
while ($rsPath->fetch()) {
$this->okt->page->addTitleTag($rsPath->title);
$this->okt->page->breadcrumb->add($rsPath->title, galleriesHelpers::getGalleryUrl($rsPath->slug));
}
$this->okt->page->breadcrumb->add($rsItem->title, $rsItem->getItemUrl());
}
# titre de la page
$this->okt->page->setTitle($rsItem->title);
# titre SEO de la page
$this->okt->page->setTitleSeo(!empty($rsItem->title_seo) ? $rsItem->title_seo : $rsItem->title);
# affichage du template
echo $this->okt->tpl->render('galleries/item/' . $this->okt->galleries->config->templates['item']['default'] . '/template', array('rsItem' => $rsItem));
}
示例4: while
$okt->page->addTitleTag($okt->galleries->getTitle());
# Ajout de la hiérarchie des rubriques au fil d'ariane et au title tag
$rsPath = $okt->galleries->getPath($rsItem->gallery_id, true);
while ($rsPath->fetch()) {
$okt->page->addTitleTag($rsPath->name);
$okt->page->breadcrumb->add($rsPath->name, $okt->page->getBaseUrl() . $okt->galleries->config->public_gallery_url . '/' . $rsPath->slug);
}
unset($rsPath);
if ($rsItem->title_tag == '') {
$rsItem->title_tag = $rsItem->title;
}
$okt->page->addTitleTag($rsItem->title_tag);
$okt->page->breadcrumb->add($rsItem->title, $rsItem->getItemUrl());
$rsItem->image = $rsItem->getImagesInfo();
if ($okt->galleries->config->enable_rte == '' && $rsItem->legend != '') {
$rsItem->legend = util::nlToP($rsItem->legend);
}
# meta description
if ($rsItem->meta_description != '') {
$okt->page->meta_description = $rsItem->meta_description;
} else {
if ($okt->galleries->config->meta_description != '') {
$okt->page->meta_description = $okt->galleries->config->meta_description;
} else {
$okt->page->meta_description = util::getSiteMetaDesc();
}
}
# meta keywords
if ($rsItem->meta_keywords != '') {
$okt->page->meta_keywords = $rsItem->meta_keywords;
} else {
示例5: publicPager
$okt->faq->filters->getFilters();
# initialisation de la pagination
$iNumFilteredQuestions = $okt->faq->getQuestions($aFaqParams, true);
$oFaqPager = new publicPager($okt->faq->filters->params->page, $iNumFilteredQuestions, $okt->faq->filters->params->nb_per_page);
$iNumPages = $oFaqPager->getNbPages();
$okt->faq->filters->normalizePage($iNumPages);
$aFaqParams['limit'] = ($okt->faq->filters->params->page - 1) * $okt->faq->filters->params->nb_per_page . ',' . $okt->faq->filters->params->nb_per_page;
# récupération des questions
$faqList = $okt->faq->getQuestions($aFaqParams);
$count_line = 0;
while ($faqList->fetch()) {
$faqList->odd_even = $count_line % 2 == 0 ? 'even' : 'odd';
$count_line++;
$faqList->url = $faqList->getQuestionUrl();
if (!$okt->faq->config->enable_rte) {
$faqList->content = util::nlToP($faqList->content);
}
if ($okt->faq->config->public_truncat_char > 0) {
$faqList->content = html::clean($faqList->content);
$faqList->content = text::cutString($faqList->content, $okt->faq->config->public_truncat_char);
}
}
unset($count_line);
# module actuel
$okt->page->module = 'faq';
$okt->page->action = 'list_questions';
# début du fil d'ariane
$okt->page->breadcrumb->add($okt->faq->getName(), $okt->faq->config->url);
# ajout du numéro de page au title
if ($okt->faq->filters->params->page > 1) {
$okt->page->addTitleTag(sprintf(__('c_c_Page_%s'), $okt->faq->filters->params->page));
示例6:
# est-ce qu'on demande une langue bien précise ?
$sUserLanguage = !empty($_GET['language']) ? $_GET['language'] : $okt->user->language;
if (empty($_GET['language']) || $sUserLanguage != $okt->user->language) {
$okt->user->setUserLang($sUserLanguage);
http::redirect($aLocalizedUrl[$sUserLanguage]);
}
# formatage des données
if ($faqQuestion->title_tag == '') {
$faqQuestion->title_tag = $faqQuestion->title;
}
# module actuel
$okt->page->module = 'faq';
$okt->page->action = 'question';
$faqQuestion->url = $faqQuestion->getQuestionUrl();
if (!$okt->faq->config->enable_rte) {
$faqQuestion->content = util::nlToP($faqQuestion->content);
}
# meta description
if ($faqQuestion->metadescription != '') {
$okt->page->meta_description = $faqQuestion->metadescription;
} else {
if ($okt->faq->config->meta_description[$okt->user->language] != '') {
$okt->page->meta_description = $okt->faq->config->meta_description[$okt->user->language];
} else {
$okt->page->meta_description = util::getSiteMetaDesc();
}
}
# meta keywords
if ($faqQuestion->meta_keywords != '') {
$okt->page->meta_keywords = $faqQuestion->meta_keywords;
} else {
示例7:
<?php
}
?>
</div>
<?php
}
?>
</div>
<?php
}
?>
<h2>Commentaire</h2>
<p><?php
echo util::nlToP(html::escapeHTML($aEstimateData['comment']));
?>
</p>
<p id="buttons">
<a href="<?php
echo util::escapeAttrHTML($okt->page->getBaseUrl() . $okt->estimate->config->public_summary_url[$okt->user->language]);
?>
?send=1" id="send_estimate">Valider et envoyer</a>
<a href="<?php
echo util::escapeAttrHTML($okt->estimate->config->url);
?>
" id="update_estimate">Modifier</a>
</p>
示例8: diaryEvent
/**
* Affichage d'un évènement
*
*/
public function diaryEvent($aMatches)
{
# récupération de l'élément en fonction du slug
if (!empty($aMatches[0])) {
$slug = $aMatches[0];
} else {
$this->serve404();
}
# récupération de l'évènement
$rsEvent = $this->okt->diary->getEvents(array('slug' => $slug, 'visibility' => 1));
if ($rsEvent->isEmpty()) {
$this->serve404();
}
# module actuel
$this->okt->page->module = 'diary';
$this->okt->page->action = 'event';
# meta description
if ($rsEvent->meta_description != '') {
$this->okt->page->meta_description = $rsEvent->meta_description;
} else {
if ($this->okt->diary->config->meta_description[$this->okt->user->language] != '') {
$this->okt->page->meta_description = $this->okt->diary->config->meta_description[$this->okt->user->language];
} else {
$this->okt->page->meta_description = util::getSiteMetaDesc();
}
}
# meta keywords
if ($rsEvent->meta_keywords != '') {
$this->okt->page->meta_keywords = $rsEvent->meta_keywords;
} else {
if ($this->okt->diary->config->meta_keywords[$this->okt->user->language] != '') {
$this->okt->page->meta_keywords = $this->okt->diary->config->meta_keywords[$this->okt->user->language];
} else {
$this->okt->page->meta_keywords = util::getSiteMetaKeywords();
}
}
# description
if (!$this->okt->diary->config->enable_rte) {
$rsEvent->description = util::nlToP($rsEvent->description);
}
# récupération des images
$rsEvent->images = $rsEvent->getImagesInfo();
# récupération des fichiers
$rsEvent->files = $rsEvent->getFilesInfo();
# title tag du module
$this->okt->page->addTitleTag($this->okt->diary->getTitle());
# fil d'ariane
if (!$this->isDefaultRoute(__CLASS__, __FUNCTION__, $slug)) {
$this->okt->page->breadcrumb->add($this->okt->diary->getName(), $this->okt->diary->config->url);
$this->okt->page->breadcrumb->add($rsEvent->title, $rsEvent->getEventUrl());
}
# title tag
$this->okt->page->addTitleTag($rsEvent->title_tag != '' ? $rsEvent->title_tag : $rsEvent->title);
# titre de la page
$this->okt->page->setTitle($rsEvent->title);
# titre SEO de la page
$this->okt->page->setTitleSeo(!empty($rsEvent->title_seo) ? $rsEvent->title_seo : $rsEvent->title);
# affichage du template
echo $this->okt->tpl->render('diary_event_tpl', array('rsEvent' => $rsEvent));
}
示例9: _e
echo html::escapeHTML($aAccessory['quantity']);
?>
</div>
</div>
<?php
}
?>
</div>
<?php
}
?>
</div>
<?php
}
?>
<h3><?php
_e('m_estimate_details_comment');
?>
</h3>
<p><?php
echo util::nlToP(html::escapeHTML($rsEstimate->content['comment']));
?>
</p>
<?php
# Pied-de-page
require OKT_ADMIN_FOOTER_FILE;
示例10: _e
if ($signaturesList->note) {
?>
<li class="note"><?php
_e('m_guestbook_note_colon');
?>
<?php
echo $signaturesList->note;
?>
</li>
<?php
}
?>
</ul>
<p class="msg"><?php
echo util::nlToP(html::escapeHTML($signaturesList->message));
?>
</p>
</div><!-- .signature -->
<?php
}
# fin : boucle sur les signatures à afficher
?>
</div><!-- #signatures-list -->
<?php
# debut : affichage pagination
if ($signaturesList->numPages > 1) {
?>
示例11: sprintf
if (!empty($i)) {
echo '<div class="two-cols page-line" id="page-line-' . $i . '">
<div class="col">' . '<p class="field"><label for="p_first_pages_' . $i . '_title">' . sprintf(__('i_pages_page_title_%s'), $i) . '</label>' . form::text(array('p_first_pages[' . $i . '][title]', 'p_first_pages_' . $i . '_title'), 80, 255, '') . '</p>' . '<p class="field"><label for="p_first_pages_' . $i . '_content">' . sprintf(__('i_pages_page_content_%s'), $i) . '</label>' . form::textarea(array('p_first_pages[' . $i . '][content]', 'p_first_pages_' . $i . '_content'), 78, 4, '') . '</p>' . '</div>' . '<p class="col field" style="padding-top: 1.5em;"><label for="p_page_home_' . $i . '">' . form::radio(array('p_page_home', 'p_page_home_' . $i), $i, $iPageHome == $i) . sprintf(__('i_pages_page_home_%s'), $i) . '</label></p>' . '</div>';
}
exit;
}
# formulaire envoyé
if (!empty($_POST['sended'])) {
if ($bHasPagesModule) {
$aFirstPages = !empty($_POST['p_first_pages']) && is_array($_POST['p_first_pages']) ? $_POST['p_first_pages'] : array();
$iPageHome = !empty($_POST['p_page_home']) ? intval($_POST['p_page_home']) : 0;
# création des premières pages
$aAddedPages = array();
foreach ($aFirstPages as $i => $aPageInfos) {
if (!empty($aPageInfos['title'])) {
$iNewId = $okt->pages->addPage($okt->pages->openPageCursor(array('active' => 1)), array('fr' => array('title' => $aPageInfos['title'], 'content' => !empty($aPageInfos['content']) ? util::nlToP($aPageInfos['content']) : __('i_pages_first_default_content'))), array());
if ($iPageHome == $i) {
$iPageHome = $iNewId;
$iPageHomeSlug = util::strToSlug($aPageInfos['title']);
}
}
}
# défintion d'une route par défaut
if (!empty($iPageHome)) {
try {
$okt->config->write(array('default_route' => array('class' => 'pagesController', 'method' => 'pagesItem', 'args' => $iPageHomeSlug)));
} catch (InvalidArgumentException $e) {
$okt->error->set(__('c_c_error_writing_configuration'));
$okt->error->set($e->getMessage());
}
}
示例12: commonPreparation
/**
* Formatages des données d'un newsRecordset communs aux listes et aux éléments.
*
* @param newsRecordset $rsPost
* @return void
*/
protected function commonPreparation(newsRecordset $rsPost)
{
# url post
$rsPost->url = $rsPost->getPostUrl();
# url rubrique
$rsPost->category_url = $rsPost->getCategoryUrl();
# author
$rsPost->author = $rsPost->getPostAuthor();
# récupération des images
$rsPost->images = $rsPost->getImagesInfo();
# récupération des fichiers
$rsPost->files = $rsPost->getFilesInfo();
# contenu
if (!$this->config->enable_rte) {
$rsPost->content = util::nlToP($rsPost->content);
}
# perform content replacements
templateReplacement::setStartString('');
templateReplacement::setEndString('');
$aReplacements = array_merge($this->okt->getCommonContentReplacementsVariables(), $this->okt->getImagesReplacementsVariables($rsPost->images));
$rsPost->content = templateReplacement::parse($rsPost->content, $aReplacements);
}
示例13: elseif
/**
* @ingroup okt_module_galleries
* @brief "controller" pour l'affichage public d'une galerie
*
*/
# inclusion du preprend public général
require_once __DIR__ . '/../../../../oktInc/public/prepend.php';
# récupération de la galerie en fonction du slug
$slug = !empty($_GET['slug']) ? $_GET['slug'] : null;
$rsGallery = $okt->galleries->tree->getGalleries(array('slug' => $slug, 'visibility' => 1));
if ($rsGallery->isEmpty()) {
$okt->page->serve404();
}
# formatage description
if (!$okt->galleries->config->enable_gal_rte && !empty($rsGallery->description)) {
$rsGallery->description = util::nlToP($rsGallery->description);
}
# un mot de passe ?
$bGalleryRequirePassword = false;
if ($rsGallery->password != '') {
# il y a un mot de passe en session
if (!empty($_SESSION['okt_gallery_password_' . $rsGallery->id])) {
if ($_SESSION['okt_gallery_password_' . $rsGallery->id] != $rsGallery->password) {
$okt->error->set('Le mot de passe ne correspond pas à celui de la galerie.');
$bGalleryRequirePassword = true;
}
} elseif (!empty($_POST['okt_gallery_password'])) {
$p_password = trim($_POST['okt_gallery_password']);
if ($p_password != $rsGallery->password) {
$okt->error->set('Le mot de passe ne correspond pas à celui de la galerie.');
$bGalleryRequirePassword = true;
示例14: catalogItem
/**
* Affichage d'un produit.
*
*/
public function catalogItem($aMatches)
{
# module actuel
$this->okt->page->module = 'catalog';
$this->okt->page->action = 'item';
# Récupération du produit en fonction du slug
if (!empty($aMatches[0])) {
$slug = $aMatches[0];
} else {
$this->serve404();
}
$product = $this->okt->catalog->getProds(array('slug' => $slug, 'visibility' => 1));
if ($product->isEmpty()) {
$this->serve404();
}
# route par défaut ?
$bIsDefaultRoute = $this->isDefaultRoute(__CLASS__, __FUNCTION__, $slug);
# Formatage des données
if ($product->title_tag == '') {
$product->title_tag = $product->title;
}
$product->url = $product->getProductUrl();
if (!$this->okt->catalog->config->rte_enable) {
$product->content = util::nlToP($product->content);
}
$product->category_url = $product->getCategoryUrl();
# meta description
if ($product->meta_description != '') {
$this->okt->page->meta_description = $product->meta_description;
} else {
if ($this->okt->catalog->config->meta_description != '') {
$this->okt->page->meta_description = $this->okt->catalog->config->meta_description;
} else {
$this->okt->page->meta_description = util::getSiteMetaDesc();
}
}
# meta keywords
if ($product->meta_keywords != '') {
$this->okt->page->meta_keywords = $product->meta_keywords;
} else {
if ($this->okt->catalog->config->meta_keywords != '') {
$this->okt->page->meta_keywords = $this->okt->catalog->config->meta_keywords;
} else {
$this->okt->page->meta_keywords = util::getSiteMetaKeywords();
}
}
# Récupération des images
$product->images = $product->getImagesInfo();
# Récupération des fichiers
$product->files = $product->getFilesInfo();
# Title tag du module
$this->okt->page->addTitleTag($this->okt->catalog->getTitle());
# Title tag de la catégorie
$this->okt->page->addTitleTag($product->category_name);
# Title tag du produit
$this->okt->page->addTitleTag($product->title_tag);
# titre de la page
$this->okt->page->setTitle($product->title);
# titre SEO de la page
$this->okt->page->setTitleSeo($product->title);
# fil d'ariane
if (!$bIsDefaultRoute) {
$this->okt->page->breadcrumb->add($this->okt->catalog->getName(), $this->okt->catalog->config->url);
if ($this->okt->catalog->config->categories_enable && $product->category_id) {
$rsPath = $this->okt->catalog->getPath($product->category_id, true);
while ($rsPath->fetch()) {
$this->okt->page->breadcrumb->add($rsPath->name, $this->okt->page->getBaseUrl() . $this->okt->catalog->config->public_catalog_url . '/' . $rsPath->slug);
}
unset($rsPath);
}
$this->okt->page->breadcrumb->add($product->title, $product->url);
}
# affichage du template
echo $this->okt->tpl->render('catalog_item_tpl', array('product' => $product));
}
示例15:
*/
# Inclusion du preprend public général
require_once __DIR__ . '/../../../../oktInc/public/prepend.php';
# Récupération de l’article en fonction du slug
$slug = !empty($_GET['slug']) ? $_GET['slug'] : null;
$product = $okt->catalog->getProds(array('slug' => $slug, 'visibility' => 1));
if ($product->isEmpty()) {
$okt->page->serve404();
}
# Formatage des données
if ($product->title_tag == '') {
$product->title_tag = $product->title;
}
$product->url = $product->getProductUrl();
if (!$okt->catalog->config->rte_enable) {
$product->content = util::nlToP($product->content);
}
$product->category_url = $product->getCategoryUrl();
# module actuel
$okt->page->module = 'catalog';
$okt->page->action = 'item';
# meta description
if ($product->meta_description != '') {
$okt->page->meta_description = $product->meta_description;
} else {
if ($okt->catalog->config->meta_description != '') {
$okt->page->meta_description = $okt->catalog->config->meta_description;
} else {
$okt->page->meta_description = util::getSiteMetaDesc();
}
}