From 129146a92ca2d7a0d53006992d7036fed93e5ebc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carsten=20G=C3=B6tzinger?= Date: Thu, 15 Feb 2018 12:39:33 +0100 Subject: [PATCH] Verzicht auf article_rateit_* --- .../contao/classes/RateItArticle.php | 8 +-- src/Resources/contao/dca/tl_article.php | 2 +- .../contao/templates/mod_article.html5 | 62 +++++++++++++++++++ .../templates/mod_articlelist_rateit0.html5 | 47 ++++++++++++++ 4 files changed, 114 insertions(+), 5 deletions(-) create mode 100644 src/Resources/contao/templates/mod_article.html5 create mode 100644 src/Resources/contao/templates/mod_articlelist_rateit0.html5 diff --git a/src/Resources/contao/classes/RateItArticle.php b/src/Resources/contao/classes/RateItArticle.php index c65b3ad..2d88d36 100644 --- a/src/Resources/contao/classes/RateItArticle.php +++ b/src/Resources/contao/classes/RateItArticle.php @@ -57,11 +57,11 @@ class RateItArticle extends RateItFrontend { ->fetchAssoc(); if ($arrArticle['addRating']) { - if ($objTemplate->multiMode && $objTemplate->showTeaser) { + /*if ($objTemplate->multiMode && $objTemplate->showTeaser) { $objTemplate->setName('mod_'.$arrArticle['rateit_template'].'_teaser'); } else { $objTemplate->setName($arrArticle['rateit_template']); - } + }*/ $ratingId = $arrArticle['id']; $rating = $this->loadRating($ratingId, 'article'); @@ -77,12 +77,12 @@ class RateItArticle extends RateItFrontend { $objTemplate->maxRating = $this->intStars; $objTemplate->votes = $rating[totalRatings]; - if ($this->strTextPosition == "before") { + /*if ($this->strTextPosition == "before") { $objTemplate->showBefore = true; } else if ($this->strTextPosition == "after") { $objTemplate->showAfter = true; - } + }*/ if ($arrArticle['rateit_position'] == 'before') { $objTemplate->rateit_rating_before = true; diff --git a/src/Resources/contao/dca/tl_article.php b/src/Resources/contao/dca/tl_article.php index c39f6f0..46ceaab 100644 --- a/src/Resources/contao/dca/tl_article.php +++ b/src/Resources/contao/dca/tl_article.php @@ -78,7 +78,7 @@ $GLOBALS['TL_DCA']['tl_article']['fields']['rateit_template'] = array 'inputType' => 'select', 'options_callback' => array('tl_article_rating', 'getRateItArticleTemplates'), 'sql' => "varchar(255) NOT NULL default ''", - 'eval' => array('mandatory'=>true, 'tl_class'=>'w50') + 'eval' => array('mandatory'=>false, 'tl_class'=>'w50') ); class tl_article_rating extends DcaHelper { diff --git a/src/Resources/contao/templates/mod_article.html5 b/src/Resources/contao/templates/mod_article.html5 new file mode 100644 index 0000000..61927eb --- /dev/null +++ b/src/Resources/contao/templates/mod_article.html5 @@ -0,0 +1,62 @@ + +teaserOnly): ?> + + block('alias'); ?> +
cssID ?>style): ?> style="style ?>"> +
+

headline ?>

+
+ teaser ?> +

more ?>

+
+
+
+ endblock(); ?> + +noMarkup): ?> + + block('content'); ?> + elements) ?> + endblock(); ?> + + + +
cssID ?>style): ?> style="style ?>"> + printable): ?> + block('syndication'); ?> + + + + endblock(); ?> + + + block('content'); ?> + elements) ?> + endblock(); ?> + + backlink): ?> + block('backlink'); ?> + +

back ?>

+ + endblock(); ?> + +
+ + diff --git a/src/Resources/contao/templates/mod_articlelist_rateit0.html5 b/src/Resources/contao/templates/mod_articlelist_rateit0.html5 new file mode 100644 index 0000000..d0ba118 --- /dev/null +++ b/src/Resources/contao/templates/mod_articlelist_rateit0.html5 @@ -0,0 +1,47 @@ +extend('block_unsearchable'); ?> + +block('content'); ?> + + + +endblock(); ?>