Files
marianek.pl/templates_user/articles/article-full.php
Jacek Pyziak fc45bbf20e Add view classes for articles, banners, languages, menu, newsletter, containers, shop categories, clients, payment methods, products, and search
- Created `Articles` class for rendering article views including full articles, miniature lists, and news sections.
- Added `Banners` class for handling banner displays.
- Introduced `Languages` class for rendering language options.
- Implemented `Menu` class for rendering page and menu structures.
- Developed `Newsletter` class for newsletter rendering.
- Created `Scontainers` class for rendering specific containers.
- Added `ShopCategory` class for managing shop category views and pagination.
- Implemented `ShopClient` class for client-related views including address management and login forms.
- Created `ShopPaymentMethod` class for displaying payment methods in the basket.
- Added `ShopProduct` class for generating product URLs.
- Introduced `ShopSearch` class for rendering a simple search form.
- Added `.htaccess` file in the plugins directory to enhance security by restricting access to sensitive files and directories.
2026-02-21 23:00:54 +01:00

193 lines
8.6 KiB
PHP

<? global $lang;?>
<?
$text = $this -> article['language']['text'];
$text = \front\Views\Articles::generateHeadersIds( $text );
?>
<div class="article article-<?= $this -> article['id'];?>">
<?
$this -> article['language']['seo_link'] ? $url = $this -> article['language']['seo_link'] : $url = 'a-' . $this -> article['id'] . '-' . \Shared\Helpers\Helpers::seo( $this -> article['language']['title'] );
if ( $this -> article['show_title'] )
echo '<h3 class="article-title">' . $this -> article['language']['title'] . '</h3>';
if ( $this -> article['social_icons'] ):
?>
<div class="social-icons">
<a class="fb" href="http://www.facebook.com/sharer.php?u=http://www.<?= $_SERVER['SERVER_NAME'];?>/<?= $url;?>" onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;" title="facebook" target="_blank" rel="nofollow">
<img src="/images/system/logo-facebook.jpg" alt="facebook">
</a>
<a class="pinterest" href="http://pinterest.com/pin/create/button/?url=http://www.<?= $_SERVER['SERVER_NAME'];?>/<?= $url;?>" onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;" title="pinterest" target="_blank" rel="nofollow">
<img src="/images/system/logo-pinterest.jpg" alt="pinterest">
</a>
<a class="twitter" href="http://twitter.com/share?url=http://www.<?= $_SERVER['SERVER_NAME'];?>/<?= $url;?>" onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=450,width=600');return false;" title="twitter" target="_blank" rel="nofollow">
<img src="/images/system/logo-twitter.jpg" alt="twitter">
</a>
<a class="linkedin" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.<?= $_SERVER['SERVER_NAME'];?>/<?= $url;?>" onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=500,width=850');return false;" title="linked in" target="_blank" rel="nofollow">
<img src="/images/system/logo-linkedin.jpg" alt="linkedin">
</a>
<a class="gp" href="https://plus.google.com/share?url=http://www.<?= $_SERVER['SERVER_NAME'];?>/<?= $url;?>" onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;" title="google+" target="_blank" rel="nofollow">
<img src="/images/system/logo-google.jpg" alt="google+">
</a>
</div>
<?
endif;
if ( $this -> article['show_date_add'] )
echo '<div class="date-add">' . $lang['data-dodania'] . ': ' . $this -> article['date_add'] . '</div>';
if ( $this -> article['show_date_modify'] )
echo '<div class="date-add">' . $lang['data-modyfikacji'] . ': ' . $this -> article['date_modify'] . '</div>';
?>
<div class="entry">
<?= $this -> article['language']['entry'];?>
</div>
<? if ( $this -> article['show_table_of_contents'] ):?>
<? if ( $this -> article['language']['table_of_contents'] ):?>
<div class="table-of-contents">
<div class="title">
<?= \Shared\Helpers\Helpers::lang( 'spis-tresci' );?>
</div>
<?= $this -> article['language']['table_of_contents'];?>
</div>
<? else:?>
<div class="table-of-contents">
<div class="title">
<?= \Shared\Helpers\Helpers::lang( 'spis-tresci' );?>
</div>
<?= \front\Views\Articles::generateTableOfContents( $text );?>
</div>
<? endif;?>
<? endif;?>
<div class="text">
<?
/* artykuł wewnątrz innego artykułu */
preg_match_all( '/ARTYKUL:[0-9]*/', $this -> article['language']['text'], $articles_list );
if ( is_array( $articles_list[0] ) ) foreach( $articles_list[0] as $article_tmp )
{
$article_tmp = explode( ':', $article_tmp );
if ( $article_tmp[1] != $this -> article['id'] )
{
$nestedArticleRepo = new \Domain\Article\ArticleRepository( $GLOBALS['mdb'] );
$nestedArticle = $nestedArticleRepo->articleDetailsFrontend( (int)$article_tmp[1], $lang_id );
$text = str_replace( '[ARTYKUL:' . $article_tmp[1] . ']', $nestedArticle ? \front\Views\Articles::fullArticle( $nestedArticle ) : '', $text );
}
else
$text = str_replace( '[ARTYKUL:' . $article_tmp[1] . ']', '', $text );
}
/* galeria w innym miejscu niż na końcu */
if ( strpos( $this -> article['language']['text'], '[GALERIA]' ) !== false )
{
if ( is_array( $this -> article['images'] ) ):
$tpl = new \Shared\Tpl\Tpl;
$tpl -> article = $this -> article;
$tpl -> images = $this -> article['images'];
$gallery = $tpl -> render( 'articles/article-gallery' );
endif;
$text = preg_replace('/(<p(.*)>\[GALERIA\]<\/p>|<div(.*)>\[GALERIA\]<\/div>)/', $gallery, $text );
}
/* załączniki w innym miejscu niż na końcu */
if ( strpos( $this -> article['language']['text'], '[ZALACZNIKI]' ) !== false )
{
if ( is_array( $this -> article['files'] ) ):
$tpl = new \Shared\Tpl\Tpl;
$tpl -> article = $this -> article;
$tpl -> files = $this -> article['files'];
$files = $tpl -> render( 'articles/article-files' );
endif;
$text = preg_replace('/(<p(.*)>\[ZALACZNIKI\]<\/p>|<div(.*)>\[ZALACZNIKI\]<\/div>)/', $files, $text );
}
/* slider */
if ( strpos( $text, '[SLIDER]' ) !== false )
{
while ( strpos( $text, '[SLIDER]' ) !== false )
{
$text_tmp = explode( '[SLIDER]', $text );
$before = $text_tmp[0];
for ( $i = 1; $i < count( $text_tmp ); $i++ )
{
$temp = explode( '[/SLIDER]' , $text_tmp[$i] );
$code = $temp[0];
ob_start();
$images_tmp = explode( '|', $code );
if ( is_array( $images_tmp ) and !empty( $images_tmp ) ) foreach ( $images_tmp as $image_tmp )
{
$image = explode( ';', $image_tmp );
$images[] = $image;
}
$tpl = new \Shared\Tpl\Tpl;
$tpl -> images = $images;
$tpl -> article_id = $this -> article['id'];
$tpl -> i = $i;
echo $tpl -> render( 'articles/slider' );
$out .= ob_get_contents();
ob_end_clean();
$out .= $temp[1];
}
$text = $before . $out;
}
}
$dom = new DomDocument('1.0', 'UTF-8');
$dom -> loadHTML( '<?xml version="1.0" encoding="UTF-8"?>' . "\n" . $text );
$elements = $dom -> getElementsByTagName( 'img' );
foreach ( $elements as $element )
{
if ( strpos( $element -> getAttribute( 'class' ), 'zoom' ) !== false )
{
$element_tmp = $dom -> createElement( 'a', '' );
$element_tmp -> setAttribute( 'href', $element -> getAttribute( 'src' ) );
$element_tmp -> setAttribute( 'rel', 'article-' . $this -> article['id'] );
$element_tmp -> setAttribute( 'class', 'fancybox' );
$element_tmp_2 = $element -> cloneNode( false );
$element_tmp -> appendChild( $element_tmp_2 );
$element -> parentNode -> replaceChild( $element_tmp, $element );
}
}
echo $dom -> saveHTML();
?>
</div>
<?
if ( is_array( $this -> article['images'] ) and strpos( $this -> article['language']['text'], '[GALERIA]' ) === false ):
$tpl = new \Shared\Tpl\Tpl;
$tpl -> article = $this -> article;
$tpl -> images = $this -> article['images'];
echo $tpl -> render( 'articles/article-gallery' );
endif;
if ( is_array( $this -> article['files'] ) and strpos( $this -> article['language']['text'], '[ZALACZNIKI]' ) === false ):
$tpl = new \Shared\Tpl\Tpl;
$tpl -> article = $this -> article;
$tpl -> files = $this -> article['files'];
echo $tpl -> render( 'articles/article-files' );
endif;
?>
</div>
<link href="/libraries/fancyBox/jquery.fancybox.css" rel="stylesheet" type="text/css">
<link href="/libraries/fancyBox/helpers/jquery.fancybox-buttons.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="/libraries/fancyBox/jquery.fancybox.js"></script>
<script type="text/javascript" src="/libraries/fancyBox/helpers/jquery.fancybox-buttons.js"></script>
<script type="text/javascript">
$( document ).ready(function()
{
$( ".gallery a.image" ).fancybox({
closeBtn : false,
helpers : {
buttons : {}
}
});
});
</script>