news_full template

This commit is contained in:
Carsten Götzinger 2018-02-15 13:38:39 +01:00
parent ad82178c75
commit c6057936d7
8 changed files with 47 additions and 371 deletions

View File

@ -57,12 +57,6 @@ class RateItArticle extends RateItFrontend {
->fetchAssoc(); ->fetchAssoc();
if ($arrArticle['addRating']) { if ($arrArticle['addRating']) {
/*if ($objTemplate->multiMode && $objTemplate->showTeaser) {
$objTemplate->setName('mod_'.$arrArticle['rateit_template'].'_teaser');
} else {
$objTemplate->setName($arrArticle['rateit_template']);
}*/
$ratingId = $arrArticle['id']; $ratingId = $arrArticle['id'];
$rating = $this->loadRating($ratingId, 'article'); $rating = $this->loadRating($ratingId, 'article');
$stars = !$rating ? 0 : $this->percentToStars($rating['rating']); $stars = !$rating ? 0 : $this->percentToStars($rating['rating']);

View File

@ -70,17 +70,6 @@ $GLOBALS['TL_DCA']['tl_article']['fields']['rateit_position'] = array
'eval' => array('mandatory'=>true, 'tl_class'=>'w50') 'eval' => array('mandatory'=>true, 'tl_class'=>'w50')
); );
$GLOBALS['TL_DCA']['tl_article']['fields']['rateit_template'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_article']['rateit_template'],
'default' => 'rateit_default',
'exclude' => true,
'inputType' => 'select',
'options_callback' => array('tl_article_rating', 'getRateItArticleTemplates'),
'sql' => "varchar(255) NOT NULL default ''",
'eval' => array('mandatory'=>false, 'tl_class'=>'w50')
);
class tl_article_rating extends DcaHelper { class tl_article_rating extends DcaHelper {
/** /**
* Constructor * Constructor
@ -89,22 +78,6 @@ class tl_article_rating extends DcaHelper {
parent::__construct(); parent::__construct();
} }
/**
* Return all navigation templates as array
* @param DataContainer
* @return array
*/
public function getRateItArticleTemplates(\DataContainer $dc) {
$intPid = $dc->activeRecord->pid;
if ($this->Input->get('act') == 'overrideAll')
{
$intPid = $this->Input->get('id');
}
return $this->getTemplateGroup('article_rateit_', $intPid);
}
public function insert(\DC_Table $dc) { public function insert(\DC_Table $dc) {
return $this->insertOrUpdateRatingKey($dc, 'article', $dc->activeRecord->title); return $this->insertOrUpdateRatingKey($dc, 'article', $dc->activeRecord->title);
} }

View File

@ -1,41 +0,0 @@
<?php $this->extend('mod_article'); ?>
<?php $this->block('content'); ?>
<?php if ($this->rateit_rating_before): ?>
<!-- indexer::stop -->
<?php $this->block('rating'); ?>
<div id="<?= $this->rateItID ?>" class="<?= $this->class ?> <?= $this->rateit_class ?>">
<?php if ($this->showBefore) : ?>
<div id="<?= $this->descriptionId ?>" class="ratingText"><?= $this->description ?></div>
<?php endif; ?>
<div class="wrapper">
<div class="rateItRating-selected" style="display: block;"></div>
<div class="rateItRating-hover"></div>
</div>
<?php if ($this->showAfter) : ?>
<div id="<?= $this->descriptionId ?>" class="ratingText"><?= $this->description ?></div>
<?php endif; ?>
</div>
<?php $this->endblock(); ?>
<!-- indexer::continue -->
<?php endif; ?>
<?php $this->parent(); ?>
<?php if ($this->rateit_rating_after): ?>
<!-- indexer::stop -->
<?php $this->block('rating'); ?>
<div id="<?= $this->rateItID ?>" class="<?= $this->class ?> <?= $this->rateit_class ?>">
<?php if ($this->showBefore) : ?>
<div id="<?= $this->descriptionId ?>" class="ratingText"><?= $this->description ?></div>
<?php endif; ?>
<div class="wrapper">
<div class="rateItRating-selected" style="display: block;"></div>
<div class="rateItRating-hover"></div>
</div>
<?php if ($this->showAfter) : ?>
<div id="<?= $this->descriptionId ?>" class="ratingText"><?= $this->description ?></div>
<?php endif; ?>
</div>
<?php $this->endblock(); ?>
<!-- indexer::continue -->
<?php endif; ?>
<?php $this->endblock(); ?>

View File

@ -1,16 +0,0 @@
<?php $this->extend('article_rateit_default'); ?>
<?php $this->block('rating'); ?>
<!-- indexer::stop -->
<div itemtype="http://schema.org/CreativeWork" itemscope class="rating-microdata">
<?php $this->parent(); ?>
<span class="rating-microdata" itemprop="name"><?php echo $this->itemreviewed; ?></span>
<span class="rating-microdata" itemtype="http://schema.org/AggregateRating" itemscope itemprop="aggregateRating">
<span itemprop="ratingValue"><?php echo $this->actRating; ?></span>
<span itemprop="worstRating">0</span>
<span itemprop="bestRating"><?php echo $this->maxRating; ?></span>
<span itemprop="ratingCount"><?php echo $this->votes; ?></span>
</span>
</div>
<!-- indexer::continue -->
<?php $this->endblock(); ?>

View File

@ -1,62 +0,0 @@
<?php if ($this->teaserOnly): ?>
<?php $this->block('alias'); ?>
<article class="<?= $this->class ?> block"<?= $this->cssID ?><?php if ($this->style): ?> style="<?= $this->style ?>"<?php endif; ?>>
<div class="ce_text block">
<h2><?= $this->headline ?></h2>
<div class="teaser">
<?= $this->teaser ?>
<p class="more"><a href="<?= $this->href ?>" title="<?= $this->readMore ?>"><?= $this->more ?> <span class="invisible"><?= $this->headline ?></span></a></p>
</div>
</div>
</article>
<?php $this->endblock(); ?>
<?php elseif ($this->noMarkup): ?>
<?php $this->block('content'); ?>
<?= implode('', $this->elements) ?>
<?php $this->endblock(); ?>
<?php else: ?>
<div class="<?= $this->class ?> block"<?= $this->cssID ?><?php if ($this->style): ?> style="<?= $this->style ?>"<?php endif; ?>>
<?php if ($this->printable): ?>
<?php $this->block('syndication'); ?>
<!-- indexer::stop -->
<div class="syndication">
<?php if ($this->printButton): ?>
<a href="<?= $this->print ?>" class="print" rel="nofollow" title="<?= $this->printTitle ?>" onclick="window.print();return false"><?= Image::getHtml('assets/contao/images/print.svg') ?></a>
<?php endif; ?>
<?php if ($this->pdfButton): ?>
<a href="<?= $this->href ?>" class="pdf" rel="nofollow" title="<?= $this->pdfTitle ?>"><?= Image::getHtml('assets/contao/images/pdf.svg') ?></a>
<?php endif; ?>
<?php if ($this->facebookButton): ?>
<a href="<?= $this->route('contao_frontend_share', array('p'=>'facebook', 'u'=>$this->encUrl)) ?>" class="facebook" rel="nofollow" title="<?= $this->facebookTitle ?>" onclick="window.open(this.href,'','width=640,height=380,modal=yes,left=100,top=50,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no');return false"><?= Image::getHtml('assets/contao/images/facebook.svg') ?></a>
<?php endif; ?>
<?php if ($this->twitterButton): ?>
<a href="<?= $this->route('contao_frontend_share', array('p'=>'twitter', 'u'=> $this->encUrl, 't'=>$this->encTitle)) ?>" class="twitter" rel="nofollow" title="<?= $this->twitterTitle ?>" onclick="window.open(this.href,'','width=640,height=380,modal=yes,left=100,top=50,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no');return false"><?= Image::getHtml('assets/contao/images/twitter.svg') ?></a>
<?php endif; ?>
<?php if ($this->gplusButton): ?>
<a href="<?= $this->route('contao_frontend_share', array('p'=>'gplus', 'u'=> $this->encUrl)) ?>" class="gplus" rel="nofollow" title="<?= $this->gplusTitle ?>" onclick="window.open(this.href,'','width=600,height=200,modal=yes,left=100,top=50,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no');return false"><?= Image::getHtml('assets/contao/images/gplus.svg') ?></a>
<?php endif; ?>
</div>
<!-- indexer::continue -->
<?php $this->endblock(); ?>
<?php endif; ?>
<?php $this->block('content'); ?>
<?= implode('', $this->elements) ?>
<?php $this->endblock(); ?>
<?php if ($this->backlink): ?>
<?php $this->block('backlink'); ?>
<!-- indexer::stop -->
<p class="back"><a href="<?= $this->backlink ?>" title="<?= $this->back ?>"><?= $this->back ?></a></p>
<!-- indexer::continue -->
<?php $this->endblock(); ?>
<?php endif; ?>
</div>
<?php endif; ?>

View File

@ -1,47 +0,0 @@
<?php $this->extend('block_unsearchable'); ?>
<?php $this->block('content'); ?>
<ul>
<?php foreach ($this->articles as $article): ?>
<?php if ($article['rateit_rating_before']): ?>
<!-- indexer::stop -->
<?php $this->block('rating'); ?>
<div id="<?= $article['rateItID'] ?>" class="<?= $article['rateit_class'] ?>">
<?php if ($article['showBefore']) : ?>
<div id="<?= $article['descriptionId'] ?>" class="ratingText"><?= $article['description'] ?></div>
<?php endif; ?>
<div class="wrapper">
<div class="rateItRating-selected" style="display: block;"></div>
<div class="rateItRating-hover"></div>
</div>
<?php if ($article['showAfter']) : ?>
<div id="<?= $article['descriptionId'] ?>" class="ratingText"><?= $article['description'] ?></div>
<?php endif; ?>
</div>
<?php $this->endblock(); ?>
<!-- indexer::continue -->
<?php endif; ?>
<?php $this->parent(); ?>
<?php if ($article['rateit_rating_after']): ?>
<!-- indexer::stop -->
<?php $this->block('rating'); ?>
<div id="<?= $article['rateItID'] ?>" class="<?= $article['rateit_class'] ?>">
<?php if ($article['showBefore']) : ?>
<div id="<?= $article['descriptionId'] ?>" class="ratingText"><?= $article['description'] ?></div>
<?php endif; ?>
<div class="wrapper">
<div class="rateItRating-selected" style="display: block;"></div>
<div class="rateItRating-hover"></div>
</div>
<?php if ($article['showAfter']) : ?>
<div id="<?= $article['descriptionId'] ?>" class="ratingText"><?= $article['description'] ?></div>
<?php endif; ?>
</div>
<?php $this->endblock(); ?>
<!-- indexer::continue -->
<?php endif; ?>
<?php endforeach; ?>
</ul>
<?php $this->endblock(); ?>

View File

@ -1,82 +1,41 @@
<?php if ($this->rateit_rating_before): ?> <?php if ($this->rateit_rating_before): ?>
<!-- indexer::stop --> <!-- indexer::stop -->
<div id="<?php echo $this->ratingId; ?>" class="<?php echo $this->class; ?> <?php echo $this->rateit_class; ?>"> <?php $this->block('rating'); ?>
<div id="<?= $this->rateItID ?>" class="<?= $this->class ?> <?= $this->rateit_class ?>">
<?php if ($this->showBefore) : ?> <?php if ($this->showBefore) : ?>
<div id="<?php echo $this->descriptionId; ?>" class="ratingText"><?php echo $this->description; ?></div> <div id="<?= $this->descriptionId ?>" class="ratingText"><?= $this->description ?></div>
<?php endif; ?> <?php endif; ?>
<div class="wrapper"> <div class="wrapper">
<div class="rateItRating-selected" style="display: block;"></div> <div class="rateItRating-selected" style="display: block;"></div>
<div class="rateItRating-hover"></div> <div class="rateItRating-hover"></div>
</div> </div>
<?php if ($this->showAfter) : ?> <?php if ($this->showAfter) : ?>
<div id="<?php echo $this->descriptionId; ?>" class="ratingText"><?php echo $this->description; ?></div> <div id="<?= $this->descriptionId ?>" class="ratingText"><?= $this->description ?></div>
<?php endif; ?> <?php endif; ?>
</div> </div>
<?php $this->endblock(); ?>
<!-- indexer::continue --> <!-- indexer::continue -->
<?php endif; ?> <?php endif; ?>
<div class="layout_full block<?php echo $this->class; ?>"> <?php $this->insert('news_full', $this->arrData); ?>
<h1><?php echo $this->newsHeadline; ?></h1>
<?php if ($this->hasMetaFields): ?>
<p class="info"><time datetime="<?php echo $this->datetime; ?>"><?php echo $this->date; ?></time> <?php echo $this->author; ?> <?php echo $this->commentCount; ?></p>
<?php endif; ?>
<?php if ($this->hasSubHeadline): ?>
<h2><?php echo $this->subHeadline; ?></h2>
<?php endif; ?>
<div class="ce_text">
<?php if (!$this->addBefore): ?>
<?php echo $this->text; ?>
<?php endif; ?>
<?php if ($this->addImage): ?>
<figure class="image_container<?php echo $this->floatClass; ?>"<?php if ($this->margin || $this->float): ?> style="<?php echo trim($this->margin . $this->float); ?>"<?php endif; ?>>
<?php if ($this->href): ?>
<a href="<?php echo $this->href; ?>"<?php echo $this->attributes; ?> title="<?php echo $this->alt; ?>">
<?php endif; ?>
<img src="<?php echo $this->src; ?>"<?php echo $this->imgSize; ?> alt="<?php echo $this->alt; ?>">
<?php if ($this->href): ?>
</a>
<?php endif; ?>
<?php if ($this->caption): ?>
<figcaption class="caption" style="width:<?php echo $this->arrSize[0]; ?>px"><?php echo $this->caption; ?></figcaption>
<?php endif; ?>
</figure>
<?php endif; ?>
<?php if ($this->addBefore): ?>
<?php echo $this->text; ?>
<?php endif; ?>
</div>
<?php if ($this->enclosure): ?>
<div class="enclosure">
<?php foreach ($this->enclosure as $enclosure): ?>
<p><img src="<?php echo $enclosure['icon']; ?>" width="18" height="18" alt="<?php echo $enclosure['mime']; ?>" class="mime_icon"> <a href="<?php echo $enclosure['href']; ?>" title="<?php echo $enclosure['title']; ?>"><?php echo $enclosure['link']; ?> <span class="size">(<?php echo $enclosure['filesize']; ?>)</span></a></p>
<?php endforeach; ?>
</div>
<?php endif; ?>
</div> </div>
<?php if ($this->rateit_rating_after): ?> <?php if ($this->rateit_rating_after): ?>
<!-- indexer::stop --> <!-- indexer::stop -->
<div id="<?php echo $this->ratingId; ?>" class="<?php echo $this->class; ?> <?php echo $this->rateit_class; ?>"> <?php $this->block('rating'); ?>
<div id="<?= $this->rateItID ?>" class="<?= $this->class ?> <?= $this->rateit_class ?>">
<?php if ($this->showBefore) : ?> <?php if ($this->showBefore) : ?>
<div id="<?php echo $this->descriptionId; ?>" class="ratingText"><?php echo $this->description; ?></div> <div id="<?= $this->descriptionId ?>" class="ratingText"><?= $this->description ?></div>
<?php endif; ?> <?php endif; ?>
<div class="wrapper"> <div class="wrapper">
<div class="rateItRating-selected" style="display: block;"></div> <div class="rateItRating-selected" style="display: block;"></div>
<div class="rateItRating-hover"></div> <div class="rateItRating-hover"></div>
</div> </div>
<?php if ($this->showAfter) : ?> <?php if ($this->showAfter) : ?>
<div id="<?php echo $this->descriptionId; ?>" class="ratingText"><?php echo $this->description; ?></div> <div id="<?= $this->descriptionId ?>" class="ratingText"><?= $this->description ?></div>
<?php endif; ?> <?php endif; ?>
</div> </div>
<?php $this->endblock(); ?>
<!-- indexer::continue --> <!-- indexer::continue -->
<?php endif; ?> <?php endif; ?>

View File

@ -1,19 +1,9 @@
<?php $this->extend('news_full_rateit'); ?>
<?php if ($this->rateit_rating_before): ?> <?php $this->block('rating'); ?>
<!-- indexer::stop --> <!-- indexer::stop -->
<div itemtype="http://schema.org/CreativeWork" itemscope class="rating-microdata"> <div itemtype="http://schema.org/CreativeWork" itemscope class="rating-microdata">
<div id="<?php echo $this->ratingId; ?>" class="<?php echo $this->class; ?> <?php echo $this->rateit_class; ?>"> <?php $this->parent(); ?>
<?php if ($this->showBefore) : ?>
<div id="<?php echo $this->descriptionId; ?>" class="ratingText"><?php echo $this->description; ?></div>
<?php endif; ?>
<div class="wrapper">
<div class="rateItRating-selected" style="display: block;"></div>
<div class="rateItRating-hover"></div>
</div>
<?php if ($this->showAfter) : ?>
<div id="<?php echo $this->descriptionId; ?>" class="ratingText"><?php echo $this->description; ?></div>
<?php endif; ?>
</div>
<span class="rating-microdata" itemprop="name"><?php echo $this->itemreviewed; ?></span> <span class="rating-microdata" itemprop="name"><?php echo $this->itemreviewed; ?></span>
<span class="rating-microdata" itemtype="http://schema.org/AggregateRating" itemscope itemprop="aggregateRating"> <span class="rating-microdata" itemtype="http://schema.org/AggregateRating" itemscope itemprop="aggregateRating">
<span itemprop="ratingValue"><?php echo $this->actRating; ?></span> <span itemprop="ratingValue"><?php echo $this->actRating; ?></span>
@ -23,79 +13,5 @@
</span> </span>
</div> </div>
<!-- indexer::continue --> <!-- indexer::continue -->
<?php endif; ?>
<div class="layout_full block<?php echo $this->class; ?>"> <?php $this->endblock(); ?>
<h1><?php echo $this->newsHeadline; ?></h1>
<?php if ($this->hasMetaFields): ?>
<p class="info"><time datetime="<?php echo $this->datetime; ?>"><?php echo $this->date; ?></time> <?php echo $this->author; ?> <?php echo $this->commentCount; ?></p>
<?php endif; ?>
<?php if ($this->hasSubHeadline): ?>
<h2><?php echo $this->subHeadline; ?></h2>
<?php endif; ?>
<div class="ce_text">
<?php if (!$this->addBefore): ?>
<?php echo $this->text; ?>
<?php endif; ?>
<?php if ($this->addImage): ?>
<figure class="image_container<?php echo $this->floatClass; ?>"<?php if ($this->margin || $this->float): ?> style="<?php echo trim($this->margin . $this->float); ?>"<?php endif; ?>>
<?php if ($this->href): ?>
<a href="<?php echo $this->href; ?>"<?php echo $this->attributes; ?> title="<?php echo $this->alt; ?>">
<?php endif; ?>
<img src="<?php echo $this->src; ?>"<?php echo $this->imgSize; ?> alt="<?php echo $this->alt; ?>">
<?php if ($this->href): ?>
</a>
<?php endif; ?>
<?php if ($this->caption): ?>
<figcaption class="caption" style="width:<?php echo $this->arrSize[0]; ?>px"><?php echo $this->caption; ?></figcaption>
<?php endif; ?>
</figure>
<?php endif; ?>
<?php if ($this->addBefore): ?>
<?php echo $this->text; ?>
<?php endif; ?>
</div>
<?php if ($this->enclosure): ?>
<div class="enclosure">
<?php foreach ($this->enclosure as $enclosure): ?>
<p><img src="<?php echo $enclosure['icon']; ?>" width="18" height="18" alt="<?php echo $enclosure['mime']; ?>" class="mime_icon"> <a href="<?php echo $enclosure['href']; ?>" title="<?php echo $enclosure['title']; ?>"><?php echo $enclosure['link']; ?> <span class="size">(<?php echo $enclosure['filesize']; ?>)</span></a></p>
<?php endforeach; ?>
</div>
<?php endif; ?>
</div>
<?php if ($this->rateit_rating_after): ?>
<!-- indexer::stop -->
<div itemtype="http://schema.org/CreativeWork" itemscope class="rating-microdata">
<div id="<?php echo $this->ratingId; ?>" class="<?php echo $this->class; ?> <?php echo $this->rateit_class; ?>">
<?php if ($this->showBefore) : ?>
<div id="<?php echo $this->descriptionId; ?>" class="ratingText"><?php echo $this->description; ?></div>
<?php endif; ?>
<div class="wrapper">
<div class="rateItRating-selected" style="display: block;"></div>
<div class="rateItRating-hover"></div>
</div>
<?php if ($this->showAfter) : ?>
<div id="<?php echo $this->descriptionId; ?>" class="ratingText"><?php echo $this->description; ?></div>
<?php endif; ?>
</div>
<span class="rating-microdata" itemprop="name"><?php echo $this->itemreviewed; ?></span>
<span class="rating-microdata" itemtype="http://schema.org/AggregateRating" itemscope itemprop="aggregateRating">
<span itemprop="ratingValue"><?php echo $this->actRating; ?></span>
<span itemprop="worstRating">0</span>
<span itemprop="bestRating"><?php echo $this->maxRating; ?></span>
<span itemprop="ratingCount"><?php echo $this->votes; ?></span>
</span>
</div>
<!-- indexer::continue -->
<?php endif; ?>