31 lines
802 B
PHP
31 lines
802 B
PHP
<?php
|
|
class Link extends LinkCore
|
|
{
|
|
public function getGuideLink($guide_post, $alias = null, $ssl = false, $id_lang = NULL)
|
|
{
|
|
if (is_object($guide_post)) {
|
|
$id = (int)($guide_post->id);
|
|
$alias = $guide_post->link_rewrite;
|
|
}
|
|
else {
|
|
$id = (int)($guide_post);
|
|
}
|
|
|
|
if ($this->allow == 1) {
|
|
$url = __PS_BASE_URI__.$this->getLangLink((int)($id_lang)).'guide/';
|
|
$url .= $id.($alias?'-'.$alias:'');
|
|
}
|
|
else {
|
|
$url = $this->moduleGuideDir($ssl).'page.php?id_guide_post='.$id.'&id_lang='.$id_lang;
|
|
}
|
|
|
|
return $url;
|
|
}
|
|
|
|
private function moduleGuideDir($ssl)
|
|
{
|
|
$base = (($ssl AND Configuration::get('PS_SSL_ENABLED')) ? Tools::getShopDomainSsl(true) : Tools::getShopDomain(true));
|
|
|
|
return $base._MODULE_DIR_.'/'.Module::getModuleNameFromClass('AdminGuidePosts').'/';
|
|
}
|
|
} |