Initialer Commit in GIT

This commit is contained in:
oetzi 2014-10-01 07:19:14 +02:00
parent f3ccccc47e
commit dd1558b954
113 changed files with 14242 additions and 0 deletions

113
classes/DcaHelper.php Normal file
View File

@ -0,0 +1,113 @@
<?php
/**
* Contao Open Source CMS
* Copyright (C) 2005-2011 Leo Feyer
*
* Formerly known as TYPOlight Open Source CMS.
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program. If not, please visit the Free
* Software Foundation website at <http://www.gnu.org/licenses/>.
*
* PHP version 5
* @copyright cgo IT, 2013
* @author Carsten Götzinger (info@cgo-it.de)
* @package rateit
* @license GNU/LGPL
* @filesource
*/
namespace cgoIT\rateit;
/**
* Class DcaHelper
*/
class DcaHelper extends \Backend
{
/**
* Constructor
*/
public function __construct() {
parent::__construct();
}
/**
* Return all navigation templates as array
* @param DataContainer
* @return array
*/
public function getRateItTemplates(\DataContainer $dc)
{
$intPid = $dc->activeRecord->pid;
if ($this->Input->get('act') == 'overrideAll')
{
$intPid = $this->Input->get('id');
}
return $this->getTemplateGroup('rateit_', $intPid);
}
/**
* Anlegen eines Datensatzes in der Tabelle tl_rateit_items, falls dieser noch nicht exisitiert.
* @param mixed
* @param object
* @return string
*/
public function insertOrUpdateRatingKey(\DC_Table $dc, $type, $ratingTitle) {
if ($dc->activeRecord->rateit_active || $dc->activeRecord->addRating) {
$actRecord = $this->Database->prepare("SELECT * FROM tl_rateit_items WHERE rkey=? and typ=?")
->execute($dc->activeRecord->id, $type)
->fetchAssoc();
if (!is_array($actRecord)) {
$arrSet = array('rkey' => $dc->activeRecord->id,
'tstamp' => time(),
'typ' => $type,
'createdat' => time(),
'title'=> $ratingTitle,
'active' => '1'
);
$insertRecord = $this->Database->prepare("INSERT INTO tl_rateit_items %s")
->set($arrSet)
->execute()
->insertId;
} else {
$this->Database->prepare("UPDATE tl_rateit_items SET active='1', title=? WHERE rkey=? and typ=?")
->execute($ratingTitle, $dc->activeRecord->id, $type)
->updatedId;
}
} else {
$this->Database->prepare("UPDATE tl_rateit_items SET active='' WHERE rkey=? and typ=?")
->execute($dc->activeRecord->id, $typ)
->updatedId;
}
return true;
}
/**
* Löschen eines Datensatzes aus der Tabelle tl_rateit_items.
* @param mixed
* @param object
* @return string
*/
public function deleteRatingKey(\DC_Table $dc, $type)
{
$this->Database->prepare("DELETE FROM tl_rateit_items WHERE rkey=? and typ=?")
->execute($dc->activeRecord->id, $type);
return true;
}
}
?>

274
classes/RateItArticle.php Normal file
View File

@ -0,0 +1,274 @@
<?php
/**
* Contao Open Source CMS
* Copyright (C) 2005-2011 Leo Feyer
*
* Formerly known as TYPOlight Open Source CMS.
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program. If not, please visit the Free
* Software Foundation website at <http://www.gnu.org/licenses/>.
*
* PHP version 5
* @copyright cgo IT, 2013
* @author Carsten Götzinger (info@cgo-it.de)
* @package rateit
* @license GNU/LGPL
* @filesource
*/
namespace cgoIT\rateit;
class RateItArticle extends RateItFrontend {
/**
* Initialize the controller
*/
public function __construct() {
parent::__construct();
}
public function parseTemplateRateIt($objTemplate) {
if ($objTemplate->type == 'article') {
$objTemplate = $this->doArticle($objTemplate);
} else if ($objTemplate->type == 'articleList') {
$objTemplate = $this->doArticleList($objTemplate);
} else if ($objTemplate->type == 'gallery') {
$objTemplate = $this->doGallery($objTemplate);
}
return $objTemplate;
}
private function doArticle($objTemplate) {
$arrArticle = $this->Database->prepare('SELECT * FROM tl_article WHERE ID=?')
->limit(1)
->execute($objTemplate->id)
->fetchAssoc();
if ($arrArticle['addRating']) {
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');
$stars = !$rating ? 0 : $this->percentToStars($rating['rating']);
$percent = round($rating['rating'], 0)."%";
$objTemplate->descriptionId = 'rateItRating-'.$ratingId.'-description';
$objTemplate->description = $this->getStarMessage($rating);
$objTemplate->rateItID = 'rateItRating-'.$ratingId.'-article-'.$stars.'_'.$this->intStars;
$objTemplate->rateit_class = 'rateItRating';
$objTemplate->itemreviewed = $rating['title'];
$objTemplate->actRating = $this->percentToStars($rating['rating']);
$objTemplate->maxRating = $this->intStars;
$objTemplate->votes = $rating[totalRatings];
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;
} else if ($arrArticle['rateit_position'] == 'after') {
$objTemplate->rateit_rating_after = true;
}
$GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/rateit/public/js/onReadyRateIt.js|static';
$GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/rateit/public/js/rateit.js|static';
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/rateit.css||static';
switch ($GLOBALS['TL_CONFIG']['rating_type']) {
case 'hearts' :
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/heart.css||static';
break;
default:
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/star.css||static';
}
}
return $objTemplate;
}
private function doArticleList($objTemplate) {
if ($objTemplate->rateit_active) {
$bolTemplateFixed = false;
$arrArticles = array();
foreach ($objTemplate->articles as $article) {
$arrArticle = $this->Database->prepare('SELECT * FROM tl_article WHERE ID=?')
->limit(1)
->execute($article['articleId'])
->fetchAssoc();
if ($arrArticle['addRating']) {
if (!$bolTemplateFixed) {
$objTemplate->setName($objTemplate->getName().'_rateit');
$bolTemplateFixed = true;
}
$ratingId = $arrArticle['id'];
$rating = $this->loadRating($ratingId, 'article');
$stars = !$rating ? 0 : $this->percentToStars($rating['rating']);
$percent = round($rating['rating'], 0)."%";
$article['descriptionId'] = 'rateItRating-'.$ratingId.'-description';
$article['description'] = $this->getStarMessage($rating);
$article['rateItID'] = 'rateItRating-'.$ratingId.'-article-'.$stars.'_'.$this->intStars;
$article['rateit_class'] = 'rateItRating';
$article['itemreviewed'] = $rating['title'];
$article['actRating'] = $this->percentToStars($rating['rating']);
$article['maxRating'] = $this->intStars;
$article['votes'] = $rating[totalRatings];
if ($this->strTextPosition == "before") {
$article['showBefore'] = true;
}
else if ($this->strTextPosition == "after") {
$article['showAfter'] = true;
}
if ($arrArticle['rateit_position'] == 'before') {
$article['rateit_rating_before'] = true;
} else if ($arrArticle['rateit_position'] == 'after') {
$article['rateit_rating_after'] = true;
}
$GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/rateit/public/js/onReadyRateIt.js|static';
$GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/rateit/public/js/rateit.js|static';
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/rateit.css||static';
switch ($GLOBALS['TL_CONFIG']['rating_type']) {
case 'hearts' :
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/heart.css||static';
break;
default:
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/star.css||static';
}
}
$arrArticles[] = $article;
}
$objTemplate->articles = $arrArticles;
}
return $objTemplate;
}
private function doGallery($objTemplate) {
$arrGallery = $this->Database->prepare('SELECT * FROM tl_content WHERE ID=?')
->limit(1)
->execute($objTemplate->id)
->fetchAssoc();
if ($arrGallery['rateit_active']) {
$arrRating = array();
if (version_compare(VERSION, '3.2', '>=')) {
$objFiles = \FilesModel::findMultipleByUuids(deserialize($arrGallery['multiSRC']));
} else {
$objFiles = \FilesModel::findMultipleByIds(deserialize($arrGallery['multiSRC']));
}
if ($objFiles !== null) {
// Get all images
while ($objFiles->next()) {
// Continue if the files has been processed or does not exist
if (isset($arrRating[$objFiles->path]) || !file_exists(TL_ROOT . '/' . $objFiles->path)) {
continue;
}
// Single files
if ($objFiles->type == 'file') {
$objFile = new \File($objFiles->path, true);
if (!$objFile->isGdImage) {
continue;
}
$this->addRatingForImage($arrRating, $arrGallery['id'], $objFile->id, $objFile->path);
}
// Folders
else {
if (version_compare(VERSION, '3.2', '>=')) {
$objSubfiles = \FilesModel::findByPid($objFiles->uuid);
} else {
$objSubfiles = \FilesModel::findByPid($objFiles->id);
}
if ($objSubfiles === null) {
continue;
}
while ($objSubfiles->next()) {
// Skip subfolders
if ($objSubfiles->type == 'folder') {
continue;
}
$objFile = new \File($objSubfiles->path, true);
if (!$objFile->isGdImage) {
continue;
}
$this->addRatingForImage($arrRating, $arrGallery['id'], $objSubfiles->id, $objSubfiles->path);
}
}
}
}
$objTemplate->arrRating = $arrRating;
$GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/rateit/public/js/onReadyRateIt.js|static';
$GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/rateit/public/js/rateit.js|static';
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/rateit.css||static';
switch ($GLOBALS['TL_CONFIG']['rating_type']) {
case 'hearts' :
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/heart.css||static';
break;
default:
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/star.css||static';
}
}
return $objTemplate;
}
private function addRatingForImage(&$arrRating, $galleryId, $picId, $picPath) {
$ratingId = $galleryId.'|'.$picId;
$rating = $this->loadRating($ratingId, 'galpic');
$stars = !$rating ? 0 : $this->percentToStars($rating['rating']);
$percent = round($rating['rating'], 0)."%";
$arrRating[$picPath] = array();
$arrRating[$picPath]['descriptionId'] = 'rateItRating-'.$ratingId.'-description';
$arrRating[$picPath]['description'] = $this->getStarMessage($rating);
$arrRating[$picPath]['rateItID'] = 'rateItRating-'.$ratingId.'-galpic-'.$stars.'_'.$this->intStars;
$arrRating[$picPath]['rateit_class'] = 'rateItRating';
$arrRating[$picPath]['itemreviewed'] = $rating['title'];
$arrRating[$picPath]['actRating'] = $this->percentToStars($rating['rating']);
$arrRating[$picPath]['maxRating'] = $this->intStars;
$arrRating[$picPath]['votes'] = $rating[totalRatings];
if ($this->strTextPosition == "before") {
$arrRating[$picPath]['showBefore'] = true;
}
else if ($this->strTextPosition == "after") {
$arrRating[$picPath]['showAfter'] = true;
}
}
}
?>

110
classes/RateItBackend.php Normal file
View File

@ -0,0 +1,110 @@
<?php
/**
* Contao Open Source CMS
* Copyright (C) 2005-2011 Leo Feyer
*
* Formerly known as TYPOlight Open Source CMS.
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program. If not, please visit the Free
* Software Foundation website at <http://www.gnu.org/licenses/>.
*
* PHP version 5
* @copyright cgo IT, 2013
* @author Carsten Götzinger (info@cgo-it.de)
* @package rateit
* @license GNU/LGPL
* @filesource
*/
namespace cgoIT\rateit;
class RateItBackend
{
const path = 'system/modules/rateit/';
/**
* Get a css file.
* @param string $file The basename if the file (without extension).
* @return string The file path.
*/
public static function css($file)
{
return self::path.'public/css/'. $file.'.css';
} // file
/**
* Get a js file.
* @param string $file The basename if the file (without extension).
* @return string The file path.
*/
public static function js($file)
{
return self::path.'public/js/'. $file.'.js';
} // file
/**
* Get image url from the theme.
* @param string $file The basename if the image (without extension).
* @return string The image path.
*/
public static function image($file)
{
$url = self::path.'public/images/';
if (is_file(TL_ROOT.'/'.$url.$file.'.png')) return $url.$file.'.png';
if (is_file(TL_ROOT.'/'.$url.$file.'.gif')) return $url.$file.'.gif';
return $url.'default.png';
} // image
/**
* Create a 'img' tag from theme icons.
* @param string $file The basename if the image (without extension).
* @param string $alt The 'alt' text.
* @param string $attributes Additional tag attributes.
* @return string The html code.
*/
public static function createImage($file, $alt='', $attributes='')
{
if ($alt=='') $alt = 'icon';
$img = self::image($file);
$size = getimagesize(TL_ROOT.'/'.$img);
return '<img'.((substr($img, -4) == '.png') ? ' class="pngfix"' : '').' src="'.$img.'" '.$size[3].' alt="'.specialchars($alt).'"'.(($attributes != '') ? ' '.$attributes : '').'>';
} // createImage
/**
* Create a list button (link button)
* @param string $file The basename if the image (without extension).
* @param string $link The URL of the link to create.
* @param string $text The alt/title text.
* @param string $confirm Optional confirmation text before redirecting to the link.
* @param boolean $popup Open the target in a new window.
* @return string The html code.
*/
public function createListButton($file, $link, $text, $confirm='', $popup=false)
{
$target = $popup ? ' target="_blank"' : '';
$onclick = ($confirm!='') ? ' onclick="if(!confirm(\''.$confirm.'\'))return false"' : '';
return '<a href="'.$link.'" title="'.$text.'"'.$target.$onclick.'>'.$this->createImage($file,$text).'</a>';
} // createListButton
public function createMainButton($file, $link, $text, $confirm='')
{
$onclick = ($confirm=='')
? ''
: ' onclick="if(!confirm(\''.$confirm.'\'))return false"';
return '<a href="'.$link.'" title="'.$text.'"'.$onclick.'>'.$this->createImage($file,$text).' '.$text.'</a>';
} // createMainButton
} // class RateItBackend
?>

View File

@ -0,0 +1,801 @@
<?php
/**
* Contao Open Source CMS
* Copyright (C) 2005-2011 Leo Feyer
*
* Formerly known as TYPOlight Open Source CMS.
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program. If not, please visit the Free
* Software Foundation website at <http://www.gnu.org/licenses/>.
*
* PHP version 5
* @copyright cgo IT, 2013
* @author Carsten Götzinger (info@cgo-it.de)
* @package rateit
* @license GNU/LGPL
* @filesource
*/
namespace cgoIT\rateit;
class rateitBackendModule extends \BackendModule
{
protected $strTemplate;
protected $actions = array();
protected $rateit;
protected $tl_root;
protected $tl_files;
protected $languages;
private $compiler;
private $action = '';
private $parameter = '';
private $arrExportHeader;
private $arrExportHeaderDetails;
/**
* Anzahl der Herzen/Sterne
* @var int
*/
protected $intStars = 5;
protected $label;
protected $labels;
/**
* Initialize the controller
*/
public function __construct($objElement=array()) {
parent::__construct($objElement);
$this->label = $GLOBALS['TL_CONFIG']['rating_type'] == 'hearts' ? $GLOBALS['TL_LANG']['rateit']['heart'] : $GLOBALS['TL_LANG']['rateit']['star'];
$this->labels = $GLOBALS['TL_CONFIG']['rating_type'] == 'hearts' ? $GLOBALS['TL_LANG']['rateit']['hearts'] : $GLOBALS['TL_LANG']['rateit']['stars'];
$this->actions = array(
// act[0] strTemplate compiler
array('', 'rateitbe_ratinglist', 'listRatings' ),
array('reset_ratings', '', 'resetRatings' ),
array('view', 'rateitbe_ratingview', 'viewRating' ),
array('export', '', 'exportRatings' ),
array('exportDetails', '', 'exportRatingDetails' ),
);
$this->loadLanguageFile('rateit_backend');
$this->arrExportHeader = &$GLOBALS['TL_LANG']['tl_rateit']['xls_headers'];
$this->arrExportHeaderDetails = &$GLOBALS['TL_LANG']['tl_rateit']['xls_headers_detail'];
}
/**
* Generate module:
* - Display a wildcard in the back end
* - Select the template and compiler in the front end
* @return string
*/
public function generate()
{
$this->rateit = new \stdClass();
$rateit = &$this->rateit;
$rateit->username = $this->BackendUser->username;
$rateit->isadmin = $this->BackendUser->isAdmin;
$this->strTemplate = $this->actions[0][1];
$this->compiler = $this->actions[0][2];
$act = \Input::get('act');
if (!$act) $act = \Input::post('act');
foreach ($this->actions as $action) {
if ($act == $action[0]) {
$this->parameter = $act;
$this->action = $action[0];
$this->strTemplate = $action[1];
$this->compiler = $action[2];
break;
}
}
$stars = intval($GLOBALS['TL_CONFIG']['rating_count']);
if ($stars > 0) {
$this->intStars = $stars;
}
return str_replace(array('{{', '}}'), array('[{]', '[}]'), parent::generate());
} // generate
/**
* Compile module: common initializations and forwarding to distinct function compiler
*/
protected function compile()
{
// hide module?
$compiler = $this->compiler;
if ($compiler=='hide') return;
// load other helpers
$this->tl_root = str_replace("\\",'/',TL_ROOT).'/';
$this->tl_files = str_replace("\\",'/',$GLOBALS['TL_CONFIG']['uploadPath']).'/';
$this->Template->rateit = $this->rateit;
// complete rateit initialization
$rateit = &$this->rateit;
$rateit->f_link = $this->createUrl(array($this->action => $this->parameter));
$rateit->f_action = $this->compiler;
$rateit->f_mode = $this->action;
$rateit->theme = new RateItBackend();
$rateit->backLink = $this->getReferer(true);
$rateit->homeLink = $this->createUrl();
// execute compiler
$this->$compiler($this->parameter);
} // compile
/**
* List the ratings
*/
protected function listRatings()
{
$rateit = &$this->Template->rateit;
$rateit->f_page = 0;
// returning from submit?
if ($this->filterPost('rateit_action') == $rateit->f_action) {
// get url parameters
$rateit->f_typ = trim(\Input::post('rateit_typ'));
$rateit->f_active = trim(\Input::post('rateit_active'));
$rateit->f_order = trim(\Input::post('rateit_order'));
$rateit->f_page = trim(\Input::post('rateit_page'));
$rateit->f_find = trim(\Input::post('rateit_find'));
$this->Session->set(
'rateit_settings',
array(
'rateit_typ' => $rateit->f_typ,
'rateit_order' => $rateit->f_order,
'rateit_page' => $rateit->f_page,
'rateit_find' => $rateit->f_find
)
);
} else {
$stg = $this->Session->get('rateit_settings');
if (is_array($stg)) {
$rateit->f_typ = trim($stg['rateit_typ']);
$rateit->f_active = trim($stg['rateit_active']);
$rateit->f_order = trim($stg['rateit_order']);
$rateit->f_page = trim($stg['rateit_page']);
$rateit->f_find = trim($stg['rateit_find']);
} // if
} // if
if ($rateit->f_order=='') $rateit->f_order = 'rating';
//if (!isset($rateit->f_active)) $rateit->f_active = '-1';
if (isset($GLOBALS['TL_CONFIG']['rating_listsize']))
$perpage = (int)trim($GLOBALS['TL_CONFIG']['rating_listsize']);
if (!isset($perpage) || $perpage < 0) $perpage = 10;
if ($rateit->f_page>=0 && $perpage>0) {
$options['first'] = $rateit->f_page * $perpage;
$options['limit'] = $perpage;
} // if
if ($rateit->f_typ != '') $options['typ'] = $rateit->f_typ;
if ($rateit->f_active != '') $options['active'] = $rateit->f_active == '0' ? '' : $rateit->f_active;
if ($rateit->f_find != '') $options['find'] = $rateit->f_find;
switch ($rateit->f_order) {
case 'title' : $options['order'] = 'title'; break;
case 'typ' : $options['order'] = 'typ'; break;
case 'createdat' : $options['order'] = 'createdat'; break;
default : $options['order'] = 'rating desc';
} // switch
$rateit->exportLink = $this->createUrl(array('act' => 'export'));
// query extensions
$rateit->ratingitems = $this->getRatingItems($options);
if ($rateit->f_page>=0 && $perpage>0 && count($rateit->ratingitems)==0) {
$rateit->f_page = 0;
$options['first'] = 0;
$rateit->ratingitems = $this->getRatingItems($options);
} // if
// add view links
foreach ($rateit->ratingitems as &$ext) {
$ext->viewLink = $this->createUrl(array('act' => 'view', 'rkey' => $ext->rkey, 'typ' => $ext->typ));
$totrecs = $ext->totcount;
} // foreach
// create pages list
$rateit->pages = array();
if ($perpage > 0) {
$first = 1;
while ($totrecs > 0) {
$cnt = $totrecs > $perpage ? $perpage : $totrecs;
$rateit->pages[] = $first . ' - ' . ($first+$cnt-1);
$first += $cnt;
$totrecs -= $cnt;
} // while
} // if
} // listRatings
/**
* Export all ratings as MS-Excel-File
*/
protected function exportRatings()
{
$this->import('String');
$rateit = &$this->Template->rateit;
$options['order'] = 'rating desc';
// query ratings
$rateit->ratingitems = $this->getRatingItems($options, true);
$xls = new \xlsexport();
$strXlsSheet = $GLOBALS['TL_LANG']['tl_rateit']['xls_sheetname_ratings'];
$xls->addworksheet($strXlsSheet);
$intRowCounter = -1;
$intColCounter = 0;
$intRowCounter++;
// Header setzen
foreach(array_values($this->arrExportHeader) as $header) {
$xls->setcell(array("sheetname" => $strXlsSheet,"row" => $intRowCounter, "col" => $intColCounter, "data" => $header, "fontweight" => XLSFONT_BOLD, "vallign" => XLSXF_VALLIGN_TOP, "fontfamily" => XLSFONT_FAMILY_NORMAL));
$xls->setcolwidth($strXlsSheet, $intColCounter, 0x1aff);
$intColCounter++;
}
$intRowCounter++;
// Werte setzen
foreach($rateit->ratingitems as $item) {
$arrItem = (array)$item;
$intColCounter = 0;
foreach(array_keys($this->arrExportHeader) as $key) {
$strVal = $arrItem[$key];
$strVal = $this->String->decodeEntities($strVal);
$strVal = preg_replace(array('/<br.*\/*>/si'), array("\n"), $strVal);
$strVal = $this->convertEncoding($strVal, $GLOBALS['TL_CONFIG']['characterSet'], 'CP1252');
$cellType = CELL_STRING;
switch ($key) {
case 'typ' :
$strVal = $GLOBALS['TL_LANG']['tl_rateit_type_options'][$strVal];
break;
case 'createdat' :
$strVal = $strVal ? date($GLOBALS['TL_CONFIG']['datimFormat'], $strVal) : '';
break;
case 'active' :
$strVal = $strVal == '1' ? 'Ja' : 'Nein';
break;
case 'rating' :
if (!isset($strVal) || empty($strVal)) {
$strVal = '0';
}
$cellType = CELL_FLOAT;
break;
case 'stars' :
case 'percent' :
case 'totalRatings' :
case 'rkey' :
$cellType = CELL_FLOAT;
break;
}
$xls->setcell(array("sheetname" => $strXlsSheet,"row" => $intRowCounter, "col" => $intColCounter, "data" => $strVal, "type" => $cellType, "vallign" => XLSXF_VALLIGN_TOP, "fontfamily" => XLSFONT_FAMILY_NORMAL));
$intColCounter++;
}
$intRowCounter++;
}
$xls->sendfile("export_rateit_" . date("Ymd_His") . ".xls");
exit;
} // exportRatings
/**
* Detailed view of one rating.
* @param string
*/
protected function viewRating()
{
$rateit = &$this->Template->rateit;
$rateit->f_page = 0;
// returning from submit?
if ($this->filterPost('rateit_action') == $rateit->f_action) {
// get url parameters
$rateit->f_page = trim(\Input::post('rateit_details_page'));
$this->Session->set(
'rateit_settings',
array(
'rateit_details_page' => $rateit->f_page
)
);
} else {
$stg = $this->Session->get('rateit_settings');
if (is_array($stg)) {
$rateit->f_page = trim($stg['rateit_details_page']);
} // if
} // if
$rkey = \Input::get('rkey');
if (strstr($rkey, '|')) {
$arrRkey = explode('|', $rkey);
foreach ($arrRkey as $key) {
if (!is_numeric($key)) {
$this->redirect($rateit->homeLink);
exit;
}
$id = $rkey;
}
} else {
if (is_numeric($rkey)) {
$id = $rkey;
} else {
$this->redirect($rateit->homeLink);
exit;
}
}
$typ = \Input::get('typ');
// compose base options
$options = array(
'rkey' => $rkey,
'typ' => $typ
);
$this->rateit->f_link = $this->createUrl(array('act' => 'view', 'rkey' => $rkey, 'typ' => $typ));
if (isset($GLOBALS['TL_CONFIG']['rating_listsize']))
$perpage = (int)trim($GLOBALS['TL_CONFIG']['rating_listsize']);
if (!isset($perpage) || $perpage < 0) $perpage = 10;
if ($rateit->f_page>=0 && $perpage>0) {
$options['first'] = $rateit->f_page * $perpage;
$options['limit'] = $perpage;
} // if
$rateit->ratingitems = $this->getRatingItems($options, true);
if (count($rateit->ratingitems)<1) $this->redirect($rateit->homeLink);
$ext = &$rateit->ratingitems[0];
$ext->ratings = $this->getRatings($ext, $options);
if ($rateit->f_page>=0 && $perpage>0 && count($ext->ratings)==0) {
$rateit->f_page = 0;
$options['first'] = 0;
$rateit->ratings = $this->getRatings($ext, $options);
} // if
if (count($ext->ratings) > 0) {
$totrecs = $ext->ratings[0]->totcount;
} else {
$totrecs = 0;
}
// create pages list
$rateit->pages = array();
if ($perpage > 0) {
$first = 1;
while ($totrecs > 0) {
$cnt = $totrecs > $perpage ? $perpage : $totrecs;
$rateit->pages[] = $first . ' - ' . ($first+$cnt-1);
$first += $cnt;
$totrecs -= $cnt;
} // while
} // if
$rateit->exportLink = $this->createUrl(array('act' => 'exportDetails', 'rkey' => $rkey, 'typ' => $typ));
$ext->statistics = $this->getRatingStatistics($ext->item_id);
$ext->ratingsChartData = $this->getRatingsChartData($ext->statistics);
$ext->monthsChartData = $this->getMonthsChartData($ext->item_id);
} // viewRating
protected function resetRatings()
{
$rateit = &$this->Template->rateit;
// nothing checked?
$ids0 = \Input::post('selectedids');
if (!is_array($ids0)) {
$this->redirect($rep->homeLink); return;
}
foreach ($ids0 as $id) {
list($rkey, $typ) = explode('__', $id);
$pid = $this->Database->prepare('SELECT id FROM tl_rateit_items WHERE rkey=? and typ=?')
->execute($rkey, $typ)
->fetchRow();
$this->Database->prepare('DELETE FROM tl_rateit_ratings WHERE pid=?')
->execute($pid[0]);
}
$this->redirect($rateit->homeLink);
} // resetRatings
/**
* Export the details of one rating as MS-Excel-File
*/
protected function exportRatingDetails()
{
$rkey = \Input::get('rkey');
if (!is_numeric($rkey))
$this->redirect($rateit->backLink);
$typ = \Input::get('typ');
$this->rateit->backLink = $this->createUrl(array('act' => 'view', 'rkey' => $rkey, 'typ' => $typ));
// compose base options
$options = array(
'rkey' => $rkey,
'typ' => $typ
);
$this->import('String');
$rateit = &$this->Template->rateit;
// query ratings
$rateit->ratingitems = $this->getRatingItems($options);
if (count($rateit->ratingitems)<1) $this->redirect($rateit->backLink);
$ext = &$rateit->ratingitems[0];
$ext->ratings = $this->getRatings($ext);
$ext->statistics = $this->getRatingStatistics($ext->item_id);
$xls = new \xlsexport();
$strXlsSheet = $GLOBALS['TL_LANG']['tl_rateit']['xls_sheetname_rating'];
$xls->addworksheet($strXlsSheet);
$intRowCounter = -1;
$intColCounter = 0;
$intRowCounter++;
// Header setzen
foreach(array_values($this->arrExportHeaderDetails) as $header) {
$xls->setcell(array("sheetname" => $strXlsSheet,"row" => $intRowCounter, "col" => $intColCounter, "data" => $header, "fontweight" => XLSFONT_BOLD, "vallign" => XLSXF_VALLIGN_TOP, "fontfamily" => XLSFONT_FAMILY_NORMAL));
$xls->setcolwidth($strXlsSheet, $intColCounter, 0x1aff);
$intColCounter++;
}
$intRowCounter++;
// Werte setzen
foreach($ext->ratings as $item) {
$arrItem = (array)$item;
$intColCounter = 0;
foreach(array_keys($this->arrExportHeaderDetails) as $key) {
$strVal = $arrItem[$key];
$strVal = $this->String->decodeEntities($strVal);
$strVal = preg_replace(array('/<br.*\/*>/si'), array("\n"), $strVal);
$strVal = $this->convertEncoding($strVal, $GLOBALS['TL_CONFIG']['characterSet'], 'CP1252');
$cellType = CELL_STRING;
switch ($key) {
case 'createdat' :
$strVal = $strVal ? date($GLOBALS['TL_CONFIG']['datimFormat'], $strVal) : '';
break;
case 'rating' :
if (!isset($strVal) || empty($strVal)) {
$strVal = '0';
}
$cellType = CELL_FLOAT;
break;
case 'stars' :
case 'percent' :
case 'totalRatings' :
case 'rkey' :
$cellType = CELL_FLOAT;
break;
}
$xls->setcell(array("sheetname" => $strXlsSheet,"row" => $intRowCounter, "col" => $intColCounter, "data" => $strVal, "type" => $cellType, "vallign" => XLSXF_VALLIGN_TOP, "fontfamily" => XLSFONT_FAMILY_NORMAL));
$intColCounter++;
}
$intRowCounter++;
}
$xls->sendfile("export_rateit_" . date("Ymd_His") . ".xls");
exit;
} // exportRatingDetails
/**
* Create url for hyperlink to the current page.
* @param array $aParams Assiciative array with key/value pairs as parameters.
* @return string The create link.
*/
protected function createUrl($aParams = null)
{
return $this->createPageUrl(\Input::get('do'), $aParams);
} // createUrl
/**
* Create url for hyperlink to an arbitrary page.
* @param string $aPage The page ID.
* @param array $aParams Assiciative array with key/value pairs as parameters.
* @return string The create link.
*/
protected function createPageUrl($aPage, $aParams = null)
{
$url = \Environment::get('script') . '?do='.$aPage;
if (is_array($aParams)) {
foreach ($aParams as $key => $val)
if ($val!='')
$url .= '&amp;'.$key .'='.$val;
}
return $url;
} // createPageUrl
/**
* Get post parameter and filter value.
* @param string $aKey The post key. When filtering html, remove all attribs and
* keep the plain tags.
* @param string $aMode '': no filtering
* 'nohtml': strip all html
* 'text': Keep tags p br ul li em
* @return string The filtered input.
*/
protected function filterPost($aKey, $aMode = '')
{
$v = trim(\Input::postRaw($aKey));
if ($v == '' || $aMode=='') return $v;
switch ($aMode) {
case 'nohtml':
$v = strip_tags($v);
break;
case 'text':
$v = strip_tags($v, rateit_TEXTTAGS);
break;
} // switch
$v = preg_replace('/<(\w+) .*>/U', '<$1>', $v);
return $v;
} // filterPost
protected function getRatingItems($aOptions, $noLimit=false) {
$sql = "SELECT i.id as item_id,
i.rkey AS rkey,
i.title as title,
i.typ as typ,
i.createdat as createdat,
i.active as active,
IFNULL(AVG(r.rating),0) AS rating,
COUNT( r.rating ) AS totalRatings
FROM tl_rateit_items i
LEFT OUTER JOIN tl_rateit_ratings r
ON (i.id = r.pid)
%w
GROUP BY rkey, title, item_id, typ, createdat, active
%o
%l";
$cntSql = "SELECT COUNT(*) FROM tl_rateit_items i %s";
$where = '';
$firstWhere = true;
$limit = '';
$order = '';
foreach ($aOptions as $k=>$v) {
if ($k == 'find') {
if (!$firstWhere) {
$where .= " AND";
}
$where .= " title like '%$v%'";
$firstWhere = false;
}
else if ($k != 'order' && $k != 'limit' && $k != 'first') {
if (!$firstWhere) {
$where .= " AND";
}
$where .= " $k='$v'";
$firstWhere = false;
} else {
if ($k == 'limit' && !$noLimit) {
$cntRows = $v;
} else if ($k == 'first' && !$noLimit) {
$first = $v;
}
}
}
if (isset($cntRows) && isset($first)) {
$limit = "LIMIT $first, $cntRows";
}
if (strlen($where) > 0) {
$where = "WHERE ".$where;
}
if (isset($aOptions['order']) && !empty($aOptions['order']))
$order = "ORDER BY ".$aOptions['order'];
$sql = str_replace('%o', $order, $sql);
$sql = str_replace('%w', $where, $sql);
$sql = str_replace('%l', $limit, $sql);
$cntSql = str_replace('%s', $where, $cntSql);
$count = $this->Database->prepare($cntSql)
->execute()
->fetchRow();
$arrRatingItems = $this->Database->prepare($sql)
->execute()
->fetchAllAssoc();
$arrReturn = array();
foreach ($arrRatingItems as $rating) {
if ($rating['active'] != '1') $rating['active'] = '0';
$rating['percent'] = $rating['rating'];
$rating['rating'] = $this->percentToStars($rating['percent']);
$rating['stars'] = $this->intStars;
$rating['totcount'] = $count[0];
$arrReturn[] = (object) $rating;
}
return $arrReturn;
} // getRatingItems
protected function getRatings($ext, $options = array()) {
// Gesamtanzahl (für Paging wichtig) ermitteln
$cntSql = "SELECT COUNT(*) FROM tl_rateit_ratings r WHERE r.pid=$ext->item_id";
$count = $this->Database->prepare($cntSql)
->execute()
->fetchRow();
foreach ($options as $k=>$v) {
if ($k == 'limit') {
$cntRows = $v;
} else if ($k == 'first') {
$first = $v;
}
}
if (isset($cntRows) && isset($first)) {
$limit = "LIMIT $first, $cntRows";
}
$sql = "SELECT id AS rating_id, ip_address AS ip, memberid, rating, createdat
FROM tl_rateit_ratings r
WHERE r.pid=$ext->item_id
ORDER BY createdat DESC
%l";
$sql = str_replace('%l', $limit, $sql);
$arrRatings = $this->Database->prepare($sql)
->execute()
->fetchAllAssoc();
$arrReturn = array();
foreach ($arrRatings as $rating) {
$rating['percent'] = $rating['rating'];
$rating['rating'] = $this->percentToStars($rating['percent']);
$rating['stars'] = $this->intStars;
$rating['totcount'] = $count[0];
if ($rating['memberid'] != null) {
$member = $this->Database->prepare("SELECT firstname, lastname FROM tl_member WHERE id=?")
->limit(1)
->execute($rating['memberid'])
->fetchAssoc();
$rating['member'] = $member['firstname']." ".$member['lastname'];
}
$arrReturn[] = (object) $rating;
}
return $arrReturn;
} // getRatings
protected function getRatingStatistics($item_id) {
$sql = "SELECT rating, count(*) as count
FROM tl_rateit_ratings r
WHERE r.pid=$item_id
GROUP BY rating
ORDER BY rating";
$arrRatingStatistics = $this->Database->prepare($sql)
->execute()
->fetchAllAssoc();
$arrReturn = array();
foreach ($arrRatingStatistics as $rating) {
$rating['percent'] = $rating['rating'];
$rating['rating'] = $this->percentToStars($rating['percent']);
$arrReturn[$rating['percent']] = (object) $rating;
}
return $arrReturn;
} // getRatings
protected function getRatingsChartData($statistics) {
$arr = array();
$arr['cols'] = array();
$arr['rows'] = array();
// Spalten anlegen
$arr['cols'][] = array('id'=>'rating', 'label'=>$GLOBALS['TL_LANG']['tl_rateit']['rating_chart_legend'][2], 'type'=>'string');
$arr['cols'][] = array('id'=>'count', 'label'=>$GLOBALS['TL_LANG']['tl_rateit']['rating_chart_legend'][3], 'type'=>'number');
// Zeilen anlegen
foreach($statistics as $obj) {
$arr['rows'][] = array('c'=>array(array('v'=>$obj->rating.' '.($obj->rating == 1 ? $this->label : $this->labels)), array('v'=>(int)$obj->count, 'f'=>$obj->count.' '.$GLOBALS['TL_LANG']['tl_rateit']['vote'][$obj->count == 1 ? 0 : 1])));
}
return json_encode($arr);
}
protected function getMonthsChartData($item_id) {
$sql = "SELECT count(*) AS anzahl, avg(rating) AS bewertung, month(date(FROM_UNIXTIME(createdat))) AS monat, year(date(FROM_UNIXTIME(createdat))) AS jahr
FROM tl_rateit_ratings r
WHERE r.pid=$item_id
GROUP BY monat, jahr
ORDER BY jahr DESC , monat DESC
LIMIT 0 , 12";
$arrResult = $this->Database->prepare($sql)
->execute()
->fetchAllAssoc();
$arrResult = array_reverse($arrResult);
$this->loadLanguageFile('default');
$arr = array();
$arr['cols'] = array();
$arr['rows'] = array();
// Spalten anlegen
$arr['cols'][] = array('id'=>'month', 'label'=>$GLOBALS['TL_LANG']['tl_rateit']['month_chart_legend'][3], 'type'=>'string');
$arr['cols'][] = array('id'=>'count', 'label'=>$GLOBALS['TL_LANG']['tl_rateit']['month_chart_legend'][4], 'type'=>'number');
$arr['cols'][] = array('id'=>'avg', 'label'=>$GLOBALS['TL_LANG']['tl_rateit']['month_chart_legend'][2], 'type'=>'number');
// Zeilen anlegen
foreach($arrResult as $result) {
$month = $GLOBALS['TL_LANG']['MONTHS'][$result['monat']-1].' '.$result['jahr'];
$avgValue = round((float)(($result['bewertung']*$this->intStars)/100), 1);
$arr['rows'][] = array('c'=>array(array('v'=>$month),
array('v'=>(int)$result['anzahl']),
array('v'=>$avgValue)));
}
return json_encode($arr);
}
protected function percentToStars($percent) {
$modifier = 100 / $this->intStars;
return round($percent / $modifier, 1);
}
/**
* Convert encoding
* @return String
* @param $strString String to convert
* @param $from charset to convert from
* @param $to charset to convert to
*/
public function convertEncoding($strString, $from, $to) {
if (USE_MBSTRING) {
@mb_substitute_character('none');
return @mb_convert_encoding($strString, $to, $from);
}
elseif (function_exists('iconv')) {
if (strlen($iconv = @iconv($from, $to . '//IGNORE', $strString))) {
return $iconv;
}
else {
return @iconv($from, $to, $strString);
}
}
return $strString;
}
} // class rateitBackendModule

51
classes/RateItCE.php Normal file
View File

@ -0,0 +1,51 @@
<?php
/**
* Contao Open Source CMS
* Copyright (C) 2005-2011 Leo Feyer
*
* Formerly known as TYPOlight Open Source CMS.
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program. If not, please visit the Free
* Software Foundation website at <http://www.gnu.org/licenses/>.
*
* PHP version 5
* @copyright cgo IT, 2013
* @author Carsten Götzinger (info@cgo-it.de)
* @package rateit
* @license GNU/LGPL
* @filesource
*/
namespace cgoIT\rateit;
/**
* Class RateItCE
*/
class RateItCE extends RateItHybrid
{
/**
* Initialize the controller
*/
public function __construct($objElement) {
parent::__construct($objElement);
}
protected function getType() {
return 'ce';
}
}
?>

159
classes/RateItFaq.php Normal file
View File

@ -0,0 +1,159 @@
<?php
/**
* Contao Open Source CMS
* Copyright (C) 2005-2011 Leo Feyer
*
* Formerly known as TYPOlight Open Source CMS.
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program. If not, please visit the Free
* Software Foundation website at <http://www.gnu.org/licenses/>.
*
* PHP version 5
* @copyright cgo IT, 2013
* @author Carsten Götzinger (info@cgo-it.de)
* @package rateit
* @license GNU/LGPL
* @filesource
*/
namespace cgoIT\rateit;
class RateItFaq extends RateItFrontend {
/**
* Initialize the controller
*/
public function __construct() {
parent::__construct();
}
public function getContentElementRateIt($objRow, $strBuffer) {
if ($objRow->type == 'module') {
$objModule = $this->Database->prepare("SELECT * FROM tl_module WHERE id=? AND type IN ('faqpage', 'faqreader')")
->limit(1)
->execute($objRow->module);
if ($objModule->numRows == 1) {
$this->faq_categories = deserialize($objModule->faq_categories);
if ($objModule->type == 'faqreader') {
$strBuffer = $this->generateForFaqReader($objModule, $strBuffer);
} else {
$strBuffer = $this->generateForFaqPage($objModule, $strBuffer);
}
$GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/rateit/public/js/onReadyRateIt.js|static';
$GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/rateit/public/js/rateit.js|static';
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/rateit.css||static';
switch ($GLOBALS['TL_CONFIG']['rating_type']) {
case 'hearts' :
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/heart.css||static';
break;
default:
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/star.css||static';
}
}
}
return $strBuffer;
}
private function generateForFaqPage($objModule, $strBuffer) {
$objFaq = $this->Database
->execute("SELECT *, author AS authorId, (SELECT headline FROM tl_faq_category WHERE tl_faq_category.id=tl_faq.pid) AS category, (SELECT name FROM tl_user WHERE tl_user.id=tl_faq.author) AS author FROM tl_faq WHERE pid IN(" . implode(',', array_map('intval', $this->faq_categories)) . ")" . (!BE_USER_LOGGED_IN ? " AND published=1" : ""));
if ($objFaq->numRows < 1) {
return $strBuffer;
}
$htmlBuffer = new \simple_html_dom();
$htmlBuffer->load($strBuffer);
$arrFaqs = $objFaq->fetchAllAssoc();
foreach ($arrFaqs as $arrFaq) {
$rating = $this->generateSingle($arrFaq, $strBuffer);
$h3 = $htmlBuffer->find('#'.$arrFaq['alias']);
if (is_array($h3) && count($h3) == 1) {
$section = $h3[0]->parent();
if ($arrFaq['rateit_position'] == 'before') {
$section->innertext = $rating.$section->innertext;
} else if ($arrFaq['rateit_position'] == 'after') {
$section->innertext = $section->innertext.$rating;
}
}
}
$strBuffer = $htmlBuffer->save();
// Aufräumen
$htmlBuffer->clear();
unset($htmlBuffer);
return $strBuffer;
}
private function generateForFaqReader($objModule, $strBuffer) {
// Set the item from the auto_item parameter
if ($GLOBALS['TL_CONFIG']['useAutoItem'] && isset($_GET['auto_item'])) {
$this->Input->setGet('items', $this->Input->get('auto_item'));
}
// Do not index or cache the page if no FAQ has been specified
if (!$this->Input->get('items')) {
return $strBuffer;
}
$objFaq = $this->Database->prepare("SELECT *, author AS authorId, (SELECT title FROM tl_faq_category WHERE tl_faq_category.id=tl_faq.pid) AS category, (SELECT name FROM tl_user WHERE tl_user.id=tl_faq.author) AS author FROM tl_faq WHERE pid IN(" . implode(',', array_map('intval', $this->faq_categories)) . ") AND (id=? OR alias=?)" . (!BE_USER_LOGGED_IN ? " AND published=1" : ""))
->limit(1)
->execute((is_numeric($this->Input->get('items')) ? $this->Input->get('items') : 0), $this->Input->get('items'));
if ($objFaq->numRows == 1) {
$arrFaq = $objFaq->fetchAssoc();
$rating = $this->generateSingle($arrFaq, $strBuffer);
}
if ($arrFaq['rateit_position'] == 'before') {
$strBuffer = $rating.$strBuffer;
} else if ($arrFaq['rateit_position'] == 'after') {
$strBuffer = $strBuffer.$rating;
}
return $strBuffer;
}
private function generateSingle($arrFaq, $strBuffer) {
$rating = '';
if ($arrFaq['addRating']) {
$actRecord = $this->Database->prepare("SELECT * FROM tl_rateit_items WHERE rkey=? and typ='faq'")
->execute($arrFaq['id'])
->fetchAssoc();
if ($actRecord['active']) {
$this->import('rateit\\RateItRating', 'RateItRating');
$this->RateItRating->rkey = $arrFaq['id'];
$this->RateItRating->ratingType = 'faq';
$this->RateItRating->generate();
$rating = $this->RateItRating->output();
}
}
return $rating;
}
}
?>

157
classes/RateItFrontend.php Normal file
View File

@ -0,0 +1,157 @@
<?php
/**
* Contao Open Source CMS
* Copyright (C) 2005-2011 Leo Feyer
*
* Formerly known as TYPOlight Open Source CMS.
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program. If not, please visit the Free
* Software Foundation website at <http://www.gnu.org/licenses/>.
*
* PHP version 5
* @copyright cgo IT, 2013
* @author Carsten Götzinger (info@cgo-it.de)
* @package rateit
* @license GNU/LGPL
* @filesource
*/
namespace cgoIT\rateit;
/**
* Class RateItFrontend
*/
class RateItFrontend extends \Hybrid
{
/**
* Primary key
* @var string
*/
protected $strPk = 'id';
/**
* Typ
* @var string
*/
protected $strType = 'hearts';
/**
* Template
* @var string
*/
protected $strTemplate = 'rateit_default';
/**
* Anzahl der Herzen/Sterne
* @var int
*/
protected $intStars = 5;
/**
* Textposition
* @var string
*/
protected $strTextPosition = 'after';
/**
* Initialize the controller
*/
public function __construct($objElement=array()) {
if (!empty($objElement)) {
if ($objElement instanceof \Model) {
$this->strTable = $objElement->getTable();
}
elseif ($objElement instanceof \Model\Collection) {
$this->strTable = $objElement->current()->getTable();
}
$this->strKey = $this->strPk;
}
$stars = intval($GLOBALS['TL_CONFIG']['rating_count']);
if ($stars > 0) {
$this->intStars = $stars;
}
parent::__construct($objElement);
}
/**
* Display a wildcard in the back end
* @return string
*/
public function generate() {
return parent::generate();
$this->loadLanguageFile('default');
$this->strType = $GLOBALS['TL_CONFIG']['rating_type'];
$stars = intval($GLOBALS['TL_CONFIG']['rating_count']);
if ($stars > 0) {
$this->intStars = $stars;
}
$this->strTemplate = $GLOBALS['TL_CONFIG']['rating_template'];
$this->strTextPosition = $GLOBALS['TL_CONFIG']['rating_textposition'];
}
/**
* Generate the module/content element
*/
protected function compile() {
}
public function getStarMessage($rating) {
$this->loadLanguageFile('default');
$stars = $this->percentToStars($rating['rating']);
preg_match('/^.*\[(.+)\|(.+)\].*$/i', $GLOBALS['TL_CONFIG']['rating_description'], $labels);
if (!is_array($labels) || !count($labels) == 2 || !count($labels) == 3) {
$label = ($rating[totalRatings] > 1 || $rating[totalRatings] == 0) || !$rating ? $GLOBALS['TL_LANG']['rateit']['rating_label'][1] : $GLOBALS['TL_LANG']['rateit']['rating_label'][0];
$description = '%current%/%max% %type% (%count% ['.$GLOBALS['TL_LANG']['tl_rateit']['vote'][0].'|'.$GLOBALS['TL_LANG']['tl_rateit']['vote'][1].'])';
} else {
$label = count($labels) == 2 ? $labels[1] : ($rating[totalRatings] > 1 || $rating[totalRatings] == 0) || !$rating ? $labels[2] : $labels[1];
$description = $GLOBALS['TL_CONFIG']['rating_description'];
}
$actValue = $rating === false ? 0 : $rating[totalRatings];
$type = $GLOBALS['TL_CONFIG']['rating_type'] == 'hearts' ? $GLOBALS['TL_LANG']['rateit']['hearts'] : $GLOBALS['TL_LANG']['rateit']['stars'];
// return str_replace('.', ',', $stars)."/$this->intStars ".$type." ($actValue $label)";
$description = str_replace('%current%', str_replace('.', ',', $stars), $description);
$description = str_replace('%max%', $this->intStars, $description);
$description = str_replace('%type%', $type, $description);
$description = str_replace('%count%', $actValue, $description);
$description = preg_replace('/^(.*)(\[.*\])(.*)$/i', "\\1$label\\3", $description);
return $description;
}
public function loadRating($rkey, $typ) {
$SQL_GET_RATINGS = "SELECT i.rkey AS rkey,
i.title AS title,
IFNULL(AVG(r.rating),0) AS rating,
COUNT( r.rating ) AS totalRatings
FROM tl_rateit_items i
LEFT OUTER JOIN tl_rateit_ratings r
ON ( i.id = r.pid ) WHERE i.rkey = ? and typ=? and active='1'
GROUP BY i.rkey;";
$result = $this->Database->prepare($SQL_GET_RATINGS)
->execute($rkey, $typ)
->fetchAssoc();
return $result;
}
protected function percentToStars($percent) {
$modifier = 100 / $this->intStars;
return round($percent / $modifier, 1);
}
}
?>

116
classes/RateItHybrid.php Normal file
View File

@ -0,0 +1,116 @@
<?php
/**
* Contao Open Source CMS
* Copyright (C) 2005-2011 Leo Feyer
*
* Formerly known as TYPOlight Open Source CMS.
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program. If not, please visit the Free
* Software Foundation website at <http://www.gnu.org/licenses/>.
*
* PHP version 5
* @copyright cgo IT, 2013
* @author Carsten Götzinger (info@cgo-it.de)
* @package rateit
* @license GNU/LGPL
* @filesource
*/
namespace cgoIT\rateit;
/**
* Class RateItHybrid
*/
abstract class RateItHybrid extends RateItFrontend
{
//protected $intStars = 5;
/**
* Initialize the controller
*/
public function __construct($objElement) {
parent::__construct($objElement);
}
/**
* Display a wildcard in the back end
* @return string
*/
public function generate() {
if (TL_MODE == 'BE') {
$objTemplate = new \BackendTemplate('be_wildcard');
$objTemplate->wildcard = '### Rate IT ###';
$objTemplate->title = $this->rateit_title;
$objTemplate->id = $this->id;
$objTemplate->link = $this->name;
$objTemplate->href = 'contao/main.php?do=themes&amp;table=tl_module&amp;act=edit&amp;id=' . $this->id;
return $objTemplate->parse();
}
$this->strTemplate = $GLOBALS['TL_CONFIG']['rating_template'];
$this->strType = $GLOBALS['TL_CONFIG']['rating_type'];
$this->strTextPosition = $GLOBALS['TL_CONFIG']['rating_textposition'];
$GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/rateit/public/js/onReadyRateIt.js|static';
$GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/rateit/public/js/rateit.js|static';
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/rateit.css||static';
switch ($this->strType) {
case 'hearts' :
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/heart.css||static';
break;
default:
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/star.css||static';
}
return parent::generate();
}
/**
* Generate the module/content element
*/
protected function compile() {
$this->Template = new \FrontendTemplate($this->strTemplate);
$this->Template->setData($this->arrData);
$rating = $this->loadRating($this->getParent()->id, $this->getType());
$ratingId = $this->getParent()->id;
$stars = !$rating ? 0 : $this->percentToStars($rating['rating']);
$percent = round($rating['rating'], 0)."%";
$this->Template->descriptionId = 'rateItRating-'.$ratingId.'-description';
$this->Template->description = $this->getStarMessage($rating);
$this->Template->id = 'rateItRating-'.$ratingId.'-'.$this->getType().'-'.$stars.'_'.$this->intStars;
$this->Template->rateit_class = 'rateItRating';
$this->Template->itemreviewed = $rating['title'];
$this->Template->actRating = $this->percentToStars($rating['rating']);
$this->Template->maxRating = $this->intStars;
$this->Template->votes = $rating[totalRatings];
if ($this->strTextPosition == "before") {
$this->Template->showBefore = true;
}
else if ($this->strTextPosition == "after") {
$this->Template->showAfter = true;
}
return parent::compile();
}
}
?>

51
classes/RateItModule.php Normal file
View File

@ -0,0 +1,51 @@
<?php
/**
* Contao Open Source CMS
* Copyright (C) 2005-2011 Leo Feyer
*
* Formerly known as TYPOlight Open Source CMS.
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program. If not, please visit the Free
* Software Foundation website at <http://www.gnu.org/licenses/>.
*
* PHP version 5
* @copyright cgo IT, 2013
* @author Carsten Götzinger (info@cgo-it.de)
* @package rateit
* @license GNU/LGPL
* @filesource
*/
namespace cgoIT\rateit;
/**
* Class RateItModule
*/
class RateItModule extends RateItHybrid
{
/**
* Initialize the controller
*/
public function __construct($objElement) {
parent::__construct($objElement);
}
protected function getType() {
return 'module';
}
}
?>

85
classes/RateItNews.php Normal file
View File

@ -0,0 +1,85 @@
<?php
/**
* Contao Open Source CMS
* Copyright (C) 2005-2011 Leo Feyer
*
* Formerly known as TYPOlight Open Source CMS.
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program. If not, please visit the Free
* Software Foundation website at <http://www.gnu.org/licenses/>.
*
* PHP version 5
* @copyright cgo IT, 2013
* @author Carsten Götzinger (info@cgo-it.de)
* @package rateit
* @license GNU/LGPL
* @filesource
*/
namespace cgoIT\rateit;
class RateItNews extends RateItFrontend {
/**
* Initialize the controller
*/
public function __construct() {
parent::__construct();
}
public function parseArticle($objTemplate, $objArticle, $caller) {
if (strpos(get_class($caller), "ModuleNews") !== false &&
$objArticle['addRating']) {
$ratingId = $objTemplate->id;
$rating = $this->loadRating($ratingId, 'news');
$stars = !$rating ? 0 : $this->percentToStars($rating['rating']);
$percent = round($rating['rating'], 0)."%";
$objTemplate->descriptionId = 'rateItRating-'.$ratingId.'-description';
$objTemplate->description = $this->getStarMessage($rating);
$objTemplate->id = 'rateItRating-'.$ratingId.'-news-'.$stars.'_'.$this->intStars;
$objTemplate->rateit_class = 'rateItRating';
$objTemplate->itemreviewed = $rating['title'];
$objTemplate->actRating = $this->percentToStars($rating['rating']);
$objTemplate->maxRating = $this->intStars;
$objTemplate->votes = $rating[totalRatings];
if ($this->strTextPosition == "before") {
$objTemplate->showBefore = true;
}
else if ($this->strTextPosition == "after") {
$objTemplate->showAfter = true;
}
if ($objArticle['rateit_position'] == 'before') {
$objTemplate->rateit_rating_before = true;
} else if ($objArticle['rateit_position'] == 'after') {
$objTemplate->rateit_rating_after = true;
}
$GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/rateit/public/js/onReadyRateIt.js|static';
$GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/rateit/public/js/rateit.js|static';
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/rateit.css||static';
switch ($GLOBALS['TL_CONFIG']['rating_type']) {
case 'hearts' :
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/heart.css||static';
break;
default:
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/star.css||static';
}
}
}
}
?>

110
classes/RateItPage.php Normal file
View File

@ -0,0 +1,110 @@
<?php
/**
* Contao Open Source CMS
* Copyright (C) 2005-2011 Leo Feyer
*
* Formerly known as TYPOlight Open Source CMS.
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program. If not, please visit the Free
* Software Foundation website at <http://www.gnu.org/licenses/>.
*
* PHP version 5
* @copyright cgo IT, 2013
* @author Carsten Götzinger (info@cgo-it.de)
* @package rateit
* @license GNU/LGPL
* @filesource
*/
namespace cgoIT\rateit;
class RateItPage extends \Frontend {
/**
* Initialize the controller
*/
public function __construct() {
parent::__construct();
$this->loadDataContainer('settings');
}
public function outputFrontendTemplate($strContent, $strTemplate) {
global $objPage;
if ($objPage->addRating && !($strTemplate == $GLOBALS['TL_CONFIG']['rating_template'])) {
$actRecord = $this->Database->prepare("SELECT * FROM tl_rateit_items WHERE rkey=? and typ='page'")
->execute($objPage->id)
->fetchAssoc();
if ($actRecord['active']) {
$this->import('rateit\\RateItRating', 'RateItRating');
$this->RateItRating->rkey = $objPage->id;
$this->RateItRating->generate();
$rating = $this->RateItRating->output();
$rating .= $this->includeJs();
$rating .= $this->includeCss();
$posMainDiv = strpos($strContent, '<div id="main">');
$posInsideDiv = strpos($strContent, '<div class="inside">', $posMainDiv);
$return = substr($strContent, 0, $posInsideDiv).'<div class="inside">';
$return .= $rating;
$return .= substr($strContent, $posInsideDiv + strlen('<div id="inside">') + 3);
$strContent = $return;
}
}
return $strContent;
}
private function includeCss() {
$included = false;
$strHeadTags = '';
foreach ($GLOBALS['TL_CSS'] as $script) {
if ($script == 'system/modules/rateit/public/css/rateit.css') {
$included = true;
}
}
if (!$included) {
$strHeadTags = '<link rel="stylesheet" href="'.$this->addStaticUrlTo('system/modules/rateit/public/css/rateit.css').'">';
switch ($GLOBALS['TL_CONFIG']['rating_type']) {
case 'hearts' :
$strHeadTags .= '<link rel="stylesheet" href="'.$this->addStaticUrlTo('system/modules/rateit/public/css/heart.css').'">';
break;
default:
$strHeadTags .= '<link rel="stylesheet" href="'.$this->addStaticUrlTo('system/modules/rateit/public/css/star.css').'">';
}
}
return $strHeadTags;
}
private function includeJs() {
$included = false;
$strHeadTags = '';
foreach ($GLOBALS['TL_JAVASCRIPT'] as $script) {
if ($script == 'system/modules/rateit/public/js/rateit.js') {
$included = true;
}
}
if (!$included) {
$strHeadTags = '<script' . (($objPage->outputFormat == 'xhtml') ? ' type="text/javascript"' : '') . ' src="' . $this->addStaticUrlTo('system/modules/rateit/public/js/onReadyRateIt.js') . '"></script>' . "\n";
$strHeadTags .= '<script' . (($objPage->outputFormat == 'xhtml') ? ' type="text/javascript"' : '') . ' src="' . $this->addStaticUrlTo('system/modules/rateit/public/js/rateit.js') . '"></script>' . "\n";
}
return $strHeadTags;
}
}
?>

96
classes/RateItRating.php Normal file
View File

@ -0,0 +1,96 @@
<?php
/**
* Contao Open Source CMS
* Copyright (C) 2005-2011 Leo Feyer
*
* Formerly known as TYPOlight Open Source CMS.
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program. If not, please visit the Free
* Software Foundation website at <http://www.gnu.org/licenses/>.
*
* PHP version 5
* @copyright cgo IT, 2013
* @author Carsten Götzinger (info@cgo-it.de)
* @package rateit
* @license GNU/LGPL
* @filesource
*/
namespace cgoIT\rateit;
class RateItRating extends RateItFrontend {
/**
* RatingKey
* @var int
*/
public $rkey = 0;
public $ratingType = 'page';
/**
* Initialize the controller
*/
public function __construct($objElement=array()) {
parent::__construct($objElement);
}
/**
* Display a wildcard in the back end
* @return string
*/
public function generate() {
parent::generate();
}
/**
* Compile
*/
protected function compile()
{
$this->loadLanguageFile('default');
$this->Template = new \FrontendTemplate($this->strTemplate);
$this->Template->setData($this->arrData);
$rating = $this->loadRating($this->rkey, $this->ratingType);
$ratingId = $this->rkey;
$stars = !$rating ? 0 : $this->percentToStars($rating['rating']);
$percent = round($rating['rating'], 0)."%";
$this->Template->descriptionId = 'rateItRating-'.$ratingId.'-description';
$this->Template->description = $this->getStarMessage($rating);
$this->Template->id = 'rateItRating-'.$ratingId.'-'.$this->ratingType.'-'.$stars.'_'.$this->intStars;
$this->Template->class = 'rateItRating';
$this->Template->itemreviewed = $rating['title'];
$this->Template->actRating = $this->percentToStars($rating['rating']);
$this->Template->maxRating = $this->intStars;
$this->Template->votes = $rating[totalRatings];
if ($this->strTextPosition == "before") {
$this->Template->showBefore = true;
}
else if ($this->strTextPosition == "after") {
$this->Template->showAfter = true;
}
return $this->Template->parse();
}
public function output() {
return $this->compile();
}
}
?>

View File

@ -0,0 +1,142 @@
<?php
/**
* Contao Open Source CMS
* Copyright (C) 2005-2011 Leo Feyer
*
* Formerly known as TYPOlight Open Source CMS.
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program. If not, please visit the Free
* Software Foundation website at <http://www.gnu.org/licenses/>.
*
* PHP version 5
* @copyright cgo IT, 2013
* @author Carsten Götzinger (info@cgo-it.de)
* @package rateit
* @license GNU/LGPL
* @filesource
*/
namespace cgoIT\rateit;
/**
* Class RateItTopRatingsModule
*/
class RateItTopRatingsModule extends RateItFrontend
{
//protected $intStars = 5;
/**
* Initialize the controller
*/
public function __construct($objElement) {
parent::__construct($objElement);
$this->strKey = "rateit_top_ratings";
}
/**
* Display a wildcard in the back end
* @return string
*/
public function generate() {
if (TL_MODE == 'BE') {
$objTemplate = new \BackendTemplate('be_wildcard');
$objTemplate->wildcard = '### Rate IT Best/Most Ratings ###';
$objTemplate->title = $this->name;
$objTemplate->id = $this->id;
$objTemplate->link = $this->name;
$objTemplate->href = 'contao/main.php?do=themes&amp;table=tl_module&amp;act=edit&amp;id=' . $this->id;
return $objTemplate->parse();
}
$this->strTemplate = $this->rateit_template;
$this->arrTypes = deserialize($this->rateit_types);
$GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/rateit/public/js/onReadyRateIt.js|static';
$GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/rateit/public/js/rateit.js|static';
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/rateit.css||static';
switch ($GLOBALS['TL_CONFIG']['rating_type']) {
case 'hearts' :
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/heart.css||static';
break;
default:
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/star.css||static';
}
return parent::generate();
}
/**
* Generate the module/content element
*/
protected function compile() {
$this->Template = new \FrontendTemplate($this->strTemplate);
$this->Template->setData($this->arrData);
$this->import("\\Database", "Database");
$arrResult = $this->Database->prepare("SELECT i.id AS item_id,
i.rkey AS rkey,
i.title AS title,
i.typ AS typ,
i.createdat AS createdat,
i.active AS active,
IFNULL(AVG(r.rating),0) AS best,
COUNT( r.rating ) AS most
FROM tl_rateit_items i
LEFT OUTER JOIN tl_rateit_ratings r
ON (i.id = r.pid)
WHERE
typ IN ('".implode("', '", $this->arrTypes)."')
GROUP BY rkey, title, item_id, typ, createdat, active
ORDER BY ".$this->rateit_toptype." DESC")
->limit($this->rateit_count)
->execute()
->fetchAllAssoc();
$objReturn = array();
foreach ($arrResult as $result) {
$return = new \stdClass();
$return->title = $result['title'];
$return->typ = $result['typ'];
// ID ermitteln
$stars = $this->percentToStars($result['best']);
$return->rateItID = 'rateItRating-'.$result['rkey'].'-'.$result['typ'].'-'.
$stars.'_'.intval($GLOBALS['TL_CONFIG']['rating_count']);
$return->descriptionId = 'rateItRating-'.$result['rkey'].'-description';
$return->rateit_class = 'rateItRating';
// Beschriftung ermitteln
$rating = array();
$rating['totalRatings'] = $result['most'];
$rating['rating'] = $result['best'];
$return->description = $this->getStarMessage($rating);
$return->rating = $result['best'];
$return->count = $result['most'];
$return->rel = 'not-rateable';
$objReturn[] = $return;
}
$this->Template->arrRatings = $objReturn;
}
}
?>

1721
classes/extern/simple_html_dom.php vendored Normal file

File diff suppressed because it is too large Load Diff

7
config/autoload.ini Normal file
View File

@ -0,0 +1,7 @@
;;
; Configure what you want the autoload creator to register
;;
register_namespaces = true
register_classes = true
register_templates = true

73
config/autoload.php Normal file
View File

@ -0,0 +1,73 @@
<?php
/**
* Contao Open Source CMS
*
* Copyright (c) 2005-2014 Leo Feyer
*
* @package Rateit
* @link https://contao.org
* @license http://www.gnu.org/licenses/lgpl-3.0.html LGPL
*/
/**
* Register the namespaces
*/
ClassLoader::addNamespaces(array
(
'cgoIT',
));
/**
* Register the classes
*/
ClassLoader::addClasses(array
(
// Classes
'cgoIT\rateit\DcaHelper' => 'system/modules/rateit/classes/DcaHelper.php',
'cgoIT\rateit\RateItArticle' => 'system/modules/rateit/classes/RateItArticle.php',
'cgoIT\rateit\RateItBackend' => 'system/modules/rateit/classes/RateItBackend.php',
'cgoIT\rateit\RateItCE' => 'system/modules/rateit/classes/RateItCE.php',
'cgoIT\rateit\RateItFaq' => 'system/modules/rateit/classes/RateItFaq.php',
'cgoIT\rateit\RateItFrontend' => 'system/modules/rateit/classes/RateItFrontend.php',
'cgoIT\rateit\RateItHybrid' => 'system/modules/rateit/classes/RateItHybrid.php',
'cgoIT\rateit\RateItModule' => 'system/modules/rateit/classes/RateItModule.php',
'cgoIT\rateit\RateItNews' => 'system/modules/rateit/classes/RateItNews.php',
'cgoIT\rateit\RateItPage' => 'system/modules/rateit/classes/RateItPage.php',
'cgoIT\rateit\RateItRating' => 'system/modules/rateit/classes/RateItRating.php',
'cgoIT\rateit\RateItBackendModule' => 'system/modules/rateit/classes/RateItBackendModule.php',
'cgoIT\rateit\RateItTopRatingsModule' => 'system/modules/rateit/classes/RateItTopRatingsModule.php',
'cgoIT\rateit\RateIt' => 'system/modules/rateit/public/php/rateit.php',
'simple_html_dom' => 'system/modules/rateit/classes/extern/simple_html_dom.php',
));
/**
* Register the templates
*/
TemplateLoader::addFiles(array
(
'article_rateit_default' => 'system/modules/rateit/templates',
'article_rateit_default_microdata' => 'system/modules/rateit/templates',
'gallery_rateit_default' => 'system/modules/rateit/templates',
'j_colorbox_rateit' => 'system/modules/rateit/templates',
'mod_article_list_rateit' => 'system/modules/rateit/templates',
'mod_article_rateit_default_microdata_teaser' => 'system/modules/rateit/templates',
'mod_article_rateit_default_teaser' => 'system/modules/rateit/templates',
'mod_rateit_top_ratings' => 'system/modules/rateit/templates',
'moo_mediabox_rateit' => 'system/modules/rateit/templates',
'news_full_rateit' => 'system/modules/rateit/templates',
'news_full_rateit_microdata' => 'system/modules/rateit/templates',
'news_latest_rateit' => 'system/modules/rateit/templates',
'news_latest_rateit_microdata' => 'system/modules/rateit/templates',
'news_short_rateit' => 'system/modules/rateit/templates',
'news_short_rateit_microdata' => 'system/modules/rateit/templates',
'news_simple_rateit' => 'system/modules/rateit/templates',
'news_simple_rateit_microdata' => 'system/modules/rateit/templates',
'rateitbe_ratinglist' => 'system/modules/rateit/templates',
'rateitbe_ratingview' => 'system/modules/rateit/templates',
'rateit_default' => 'system/modules/rateit/templates',
'rateit_microdata' => 'system/modules/rateit/templates',
));

65
config/config.php Normal file
View File

@ -0,0 +1,65 @@
<?php
use cgoIT\rateit\RateItBackend;
/**
* Contao Open Source CMS
* Copyright (C) 2005-2011 Leo Feyer
*
* Formerly known as TYPOlight Open Source CMS.
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program. If not, please visit the Free
* Software Foundation website at <http://www.gnu.org/licenses/>.
*
* PHP version 5
* @copyright cgo IT, 2013
* @author Carsten Götzinger (info@cgo-it.de)
* @package rateit
* @license GNU/LGPL
* @filesource
*/
/**
* Hooks
*/
$GLOBALS['TL_HOOKS']['outputFrontendTemplate'][] = array('rateit\\RateItPage', 'outputFrontendTemplate');
$GLOBALS['TL_HOOKS']['simpleAjax'][] = array('rateit\\RateIt', 'doVote');
$GLOBALS['TL_HOOKS']['parseArticles'][] = array('rateit\\RateItNews', 'parseArticle');
$GLOBALS['TL_HOOKS']['getContentElement'][] = array('rateit\\RateItFaq', 'getContentElementRateIt');
$GLOBALS['TL_HOOKS']['parseTemplate'][] = array('rateit\\RateItArticle', 'parseTemplateRateIt');
/**
* Back end modules
*/
array_insert($GLOBALS['BE_MOD']['content'], count($GLOBALS['BE_MOD']['content']),
array('rateit' => array (
'callback' => 'rateit\\RateItBackendModule',
'icon' => rateit\RateItBackend::image('icon'),
'stylesheet' => rateit\RateItBackend::css('backend'),
'javascript' => rateit\RateItBackend::js('RateItBackend')
)
));
/**
* frontend moduls
*/
$GLOBALS['FE_MOD']['application']['rateit'] = 'rateit\\RateItModule';
$GLOBALS['FE_MOD']['application']['rateit_top_ratings'] = 'rateit\\RateItTopRatingsModule';
/**
* content elements
*/
$GLOBALS['TL_CTE']['includes']['rateit'] = 'rateit\\RateItCE';
?>

88
config/runonce.php Normal file
View File

@ -0,0 +1,88 @@
<?php
/**
* Contao Open Source CMS
* Copyright (C) 2005-2011 Leo Feyer
*
* Formerly known as TYPOlight Open Source CMS.
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program. If not, please visit the Free
* Software Foundation website at <http://www.gnu.org/licenses/>.
*
* PHP version 5
* @copyright cgo IT, 2013
* @author Carsten Götzinger (info@cgo-it.de)
* @package rateit
* @license GNU/LGPL
* @filesource
*
*/
// Be silenced
@error_reporting(0);
@ini_set("display_errors", 0);
/**
* Runonce Job
*/
class runonceJob extends \Backend
{
public function __construct()
{
parent::__construct();
}
/**
* Run job
*/
public function run()
{
if (!isset($GLOBALS['TL_CONFIG']['rating_type']))
{
$this->Config->add("\$GLOBALS['TL_CONFIG']['rating_type']", 'hearts');
}
if (!isset($GLOBALS['TL_CONFIG']['rating_count']))
{
$this->Config->add("\$GLOBALS['TL_CONFIG']['rating_count']", 5);
}
if (!isset($GLOBALS['TL_CONFIG']['rating_textposition']))
{
$this->Config->add("\$GLOBALS['TL_CONFIG']['rating_textposition']", 'after');
}
if (!isset($GLOBALS['TL_CONFIG']['rating_listsize']))
{
$this->Config->add("\$GLOBALS['TL_CONFIG']['rating_listsize']", 10);
}
if (!isset($GLOBALS['TL_CONFIG']['rating_template']))
{
$this->Config->add("\$GLOBALS['TL_CONFIG']['rating_template']", 'rateit_default');
}
if (!isset($GLOBALS['TL_CONFIG']['rating_description']))
{
$this->Config->add("\$GLOBALS['TL_CONFIG']['rating_description']", '%current%/%max% %type% (%count% [Stimme|Stimmen])');
}
}
}
// Run once
$objRunonceJob = new runonceJob();
$objRunonceJob->run();
?>

116
dca/tl_article.php Normal file
View File

@ -0,0 +1,116 @@
<?php
/**
* Contao Open Source CMS
* Copyright (C) 2005-2010 Leo Feyer
*
* Formerly known as TYPOlight Open Source CMS.
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program. If not, please visit the Free
* Software Foundation website at <http://www.gnu.org/licenses/>.
*
* PHP version 5
* @copyright cgo IT, 2013
* @author Carsten Götzinger (info@cgo-it.de)
* @package rateit
* @license GNU/LGPL
* @filesource
*/
/**
* Extend tl_article
*/
$GLOBALS['TL_DCA']['tl_article']['config']['onsubmit_callback'][] = array('tl_article_rating','insert');
$GLOBALS['TL_DCA']['tl_article']['config']['ondelete_callback'][] = array('tl_article_rating','delete');
/**
* Palettes
*/
$GLOBALS['TL_DCA']['tl_article']['palettes']['__selector__'][] = 'addRating';
$GLOBALS['TL_DCA']['tl_article']['palettes']['default'] = $GLOBALS['TL_DCA']['tl_article']['palettes']['default'].';{rateit_legend:hide},addRating';
/**
* Add subpalettes to tl_article
*/
$GLOBALS['TL_DCA']['tl_article']['subpalettes']['addRating'] = 'rateit_position,rateit_template';
// Fields
$GLOBALS['TL_DCA']['tl_article']['fields']['addRating'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_article']['addRating'],
'exclude' => true,
'inputType' => 'checkbox',
'sql' => "char(1) NOT NULL default ''",
'eval' => array('tl_class'=>'w50 m12', 'submitOnChange'=>true)
);
$GLOBALS['TL_DCA']['tl_article']['fields']['rateit_position'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_article']['rateit_position'],
'default' => 'before',
'exclude' => true,
'inputType' => 'select',
'options' => array('after', 'before'),
'reference' => &$GLOBALS['TL_LANG']['tl_article'],
'sql' => "varchar(6) NOT NULL default ''",
'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'=>true, 'tl_class'=>'w50')
);
class tl_article_rating extends rateit\DcaHelper {
/**
* Constructor
*/
public function __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) {
return $this->insertOrUpdateRatingKey($dc, 'article', $dc->activeRecord->title);
}
public function delete(\DC_Table $dc)
{
return $this->deleteRatingKey($dc, 'article');
}
}
?>

212
dca/tl_content.php Normal file
View File

@ -0,0 +1,212 @@
<?php
/**
* Contao Open Source CMS
* Copyright (C) 2005-2011 Leo Feyer
*
* Formerly known as TYPOlight Open Source CMS.
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program. If not, please visit the Free
* Software Foundation website at <http://www.gnu.org/licenses/>.
*
* PHP version 5
* @copyright cgo IT, 2013
* @author Carsten Götzinger (info@cgo-it.de)
* @package rateit
* @license GNU/LGPL
* @filesource
*/
$GLOBALS['TL_DCA']['tl_content']['config']['onsubmit_callback'][] = array('tl_content_rateit','insert');
$GLOBALS['TL_DCA']['tl_content']['config']['ondelete_callback'][] = array('tl_content_rateit','delete');
/**
* palettes
*/
$GLOBALS['TL_DCA']['tl_content']['palettes']['rateit'] = '{type_legend},type,rateit_title;{rateit_legend},rateit_active;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space';
$GLOBALS['TL_DCA']['tl_content']['palettes']['gallery'] = $GLOBALS['TL_DCA']['tl_content']['palettes']['gallery'].';{rateit_legend},rateit_active';
/**
* fields
*/
$GLOBALS['TL_DCA']['tl_content']['fields']['rateit_title'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_content']['rateit_title'],
'default' => '',
'exclude' => true,
'inputType' => 'text',
'sql' => "varchar(255) NOT NULL default ''",
'eval' => array('mandatory'=>true, 'maxlength'=>255)
);
$GLOBALS['TL_DCA']['tl_content']['fields']['rateit_active'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_content']['rateit_active'],
'exclude' => true,
'inputType' => 'checkbox',
'sql' => "char(1) NOT NULL default ''",
'eval' => array('tl_class'=>'w50')
);
/**
* Class tl_content_rateit
*/
class tl_content_rateit extends rateit\DcaHelper {
/**
* Constructor
*/
public function __construct() {
parent::__construct();
}
public function insert(\DC_Table $dc) {
if ($dc->activeRecord->type == "gallery") {
$type = 'galpic';
if (version_compare(VERSION, '3.2', '>=')) {
$objFiles = \FilesModel::findMultipleByUuids(deserialize($dc->activeRecord->multiSRC));
} else {
$objFiles = \FilesModel::findMultipleByIds(deserialize($dc->activeRecord->multiSRC));
}
if ($objFiles !== null) {
// Get all images
while ($objFiles->next()) {
// Single files
if ($objFiles->type == 'file') {
$objFile = new \File($objFiles->path, true);
if (!$objFile->isGdImage) {
continue;
}
$this->insertOrUpdateRatingItemGallery($dc, $type, $objFile->name, $objFile->id, ($dc->activeRecord->rateit_active ? '1' : ''));
}
// Folders
else {
if (version_compare(VERSION, '3.2', '>=')) {
$objSubfiles = \FilesModel::findByPid($objFiles->uuid);
} else {
$objSubfiles = \FilesModel::findByPid($objFiles->id);
}
if ($objSubfiles === null) {
continue;
}
while ($objSubfiles->next()) {
// Skip subfolders
if ($objSubfiles->type == 'folder') {
continue;
}
$objFile = new \File($objSubfiles->path, true);
if (!$objFile->isGdImage) {
continue;
}
$this->insertOrUpdateRatingItemGallery($dc, $type, $objSubfiles->name, $objSubfiles->id, ($dc->activeRecord->rateit_active ? '1' : ''));
}
}
}
}
return true;
} else {
return $this->insertOrUpdateRatingKey($dc, 'ce', $dc->activeRecord->rateit_title);
}
}
public function delete(\DC_Table $dc) {
if ($dc->activeRecord->type == "gallery") {
$objFiles = \FilesModel::findMultipleByUuids(deserialize($dc->activeRecord->multiSRC));
// Get all images
while ($objFiles->next()) {
// Single files
if ($objFiles->type == 'file') {
$objFile = new \File($objFiles->path, true);
if (!$objFile->isGdImage) {
continue;
}
$rkey = $dc->activeRecord->id.'_'.$objFile->id;
$this->Database->prepare("DELETE FROM tl_rateit_items WHERE rkey=? and typ=?")
->execute($rkey, 'galpic');
}
// Folders
else {
$objSubfiles = \FilesModel::findByPid($objFiles->uuid);
if ($objSubfiles === null) {
continue;
}
while ($objSubfiles->next()) {
// Skip subfolders
if ($objSubfiles->type == 'folder') {
continue;
}
$objFile = new \File($objSubfiles->path, true);
if (!$objFile->isGdImage) {
continue;
}
$rkey = $dc->activeRecord->id.'_'.$objFile->id;
$this->Database->prepare("DELETE FROM tl_rateit_items WHERE rkey=? and typ=?")
->execute($rkey, 'galpic');
}
}
}
return true;
} else {
return $this->deleteRatingKey($dc, 'ce');
}
}
private function insertOrUpdateRatingItemGallery(\DC_Table &$dc, $type, $strName, $imgId, $active) {
$rkey = $dc->activeRecord->id.'|'.$imgId;
$headline = deserialize($dc->activeRecord->headline);
$title = $dc->activeRecord->id;
if (is_array($headline) && array_key_exists('value', $headline) && strlen($headline['value']) > 0) {
$title = $headline['value'];
}
$ratingTitle = $title.' - '.$strName;
$actRecord = $this->Database->prepare("SELECT * FROM tl_rateit_items WHERE rkey=? and typ=?")
->execute($rkey, $type)
->fetchAssoc();
if (!is_array($actRecord)) {
$arrSet = array('rkey' => $rkey,
'tstamp' => time(),
'typ' => $type,
'createdat' => time(),
'title'=> $ratingTitle,
'active' => $active
);
$insertRecord = $this->Database->prepare("INSERT INTO tl_rateit_items %s")
->set($arrSet)
->execute()
->insertId;
} else {
$this->Database->prepare("UPDATE tl_rateit_items SET active=?, title=? WHERE rkey=? and typ=?")
->execute($active, $ratingTitle, $rkey, $type)
->updatedId;
}
}
}
?>

89
dca/tl_faq.php Normal file
View File

@ -0,0 +1,89 @@
<?php
/**
* Contao Open Source CMS
* Copyright (C) 2005-2010 Leo Feyer
*
* Formerly known as TYPOlight Open Source CMS.
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program. If not, please visit the Free
* Software Foundation website at <http://www.gnu.org/licenses/>.
*
* PHP version 5
* @copyright cgo IT, 2013
* @author Carsten Götzinger (info@cgo-it.de)
* @package rateit
* @license GNU/LGPL
* @filesource
*/
/**
* Extend tl_article
*/
$GLOBALS['TL_DCA']['tl_faq']['config']['onsubmit_callback'][] = array('tl_faq_rating','insert');
$GLOBALS['TL_DCA']['tl_faq']['config']['ondelete_callback'][] = array('tl_faq_rating','delete');
/**
* Palettes
*/
$GLOBALS['TL_DCA']['tl_faq']['palettes']['__selector__'][] = 'addRating';
$GLOBALS['TL_DCA']['tl_faq']['palettes']['default'] = $GLOBALS['TL_DCA']['tl_faq']['palettes']['default'].';{rating_legend:hide},addRating';
/**
* Add subpalettes to tl_article
*/
$GLOBALS['TL_DCA']['tl_faq']['subpalettes']['addRating'] = 'rateit_position';
// Fields
$GLOBALS['TL_DCA']['tl_faq']['fields']['addRating'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_faq']['addRating'],
'exclude' => true,
'inputType' => 'checkbox',
'sql' => "char(1) NOT NULL default ''",
'eval' => array('tl_class'=>'w50 m12', 'submitOnChange'=>true)
);
$GLOBALS['TL_DCA']['tl_faq']['fields']['rateit_position'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_faq']['rateit_position'],
'default' => 'before',
'exclude' => true,
'inputType' => 'select',
'options' => array('after', 'before'),
'reference' => &$GLOBALS['TL_LANG']['tl_faq'],
'sql' => "varchar(6) NOT NULL default ''",
'eval' => array('mandatory'=>true, 'tl_class'=>'w50')
);
class tl_faq_rating extends rateit\DcaHelper {
/**
* Constructor
*/
public function __construct() {
parent::__construct();
}
public function insert(\DC_Table $dc) {
return $this->insertOrUpdateRatingKey($dc, 'faq', $dc->activeRecord->question);
}
public function delete(\DC_Table $dc)
{
return $this->deleteRatingKey($dc, 'faq');
}
}
?>

140
dca/tl_module.php Normal file
View File

@ -0,0 +1,140 @@
<?php
/**
* Contao Open Source CMS
* Copyright (C) 2005-2011 Leo Feyer
*
* Formerly known as TYPOlight Open Source CMS.
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program. If not, please visit the Free
* Software Foundation website at <http://www.gnu.org/licenses/>.
*
* PHP version 5
* @copyright cgo IT, 2013
* @author Carsten Götzinger (info@cgo-it.de)
* @package rateit
* @license GNU/LGPL
* @filesource
*/
$GLOBALS['TL_DCA']['tl_module']['config']['onsubmit_callback'][] = array('tl_module_rateit','insert');
$GLOBALS['TL_DCA']['tl_module']['config']['ondelete_callback'][] = array('tl_module_rateit','delete');
/**
* palettes
*/
$GLOBALS['TL_DCA']['tl_module']['palettes']['rateit'] = '{title_legend},name,rateit_title,type;{rateit_legend},rateit_active;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space';
$GLOBALS['TL_DCA']['tl_module']['palettes']['rateit_top_ratings'] = '{title_legend},name,headline,type;{rateit_legend},rateit_types,rateit_toptype,rateit_count,rateit_template;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space';
$GLOBALS['TL_DCA']['tl_module']['palettes']['articleList'] = $GLOBALS['TL_DCA']['tl_module']['palettes']['articleList'].';{rateit_legend},rateit_active';
/**
* fields
*/
$GLOBALS['TL_DCA']['tl_module']['fields']['rateit_title'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_module']['rateit_title'],
'default' => '',
'exclude' => true,
'inputType' => 'text',
'sql' => "varchar(255) NOT NULL default ''",
'eval' => array('mandatory'=>true, 'maxlength'=>255, 'tl_class'=>'w50')
);
$GLOBALS['TL_DCA']['tl_module']['fields']['rateit_active'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_module']['rateit_active'],
'exclude' => true,
'inputType' => 'checkbox',
'sql' => "char(1) NOT NULL default ''",
'eval' => array('tl_class'=>'w50 m12')
);
$GLOBALS['TL_DCA']['tl_module']['fields']['rateit_types'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_module']['rateit_types'],
'exclude' => true,
'inputType' => 'checkboxWizard',
'options' => array('page', 'article', 'ce', 'module', 'news', 'faq', 'galpic'),
'eval' => array('multiple'=>true, 'mandatory'=>true),
'reference' => &$GLOBALS['TL_LANG']['tl_module']['rateit_types'],
'sql' => "varchar(255) NOT NULL default ''"
);
$GLOBALS['TL_DCA']['tl_module']['fields']['rateit_toptype'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_module']['rateit_toptype'],
'exclude' => true,
'default' => 'best',
'inputType' => 'select',
'options' => array('best', 'most'),
'eval' => array('mandatory'=>true, 'tl_class'=>'w50'),
'reference' => &$GLOBALS['TL_LANG']['tl_module']['rateit_toptype'],
'sql' => "varchar(10) NOT NULL default ''"
);
$GLOBALS['TL_DCA']['tl_module']['fields']['rateit_count'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_module']['rateit_count'],
'default' => '10',
'exclude' => true,
'inputType' => 'text',
'eval' => array('mandatory'=>true, 'maxlength'=>3, 'rgxp'=>'digit', 'tl_class'=>'w50'),
'sql' => "varchar(3) NOT NULL default ''"
);
$GLOBALS['TL_DCA']['tl_module']['fields']['rateit_template'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_module']['rateit_template'],
'default' => 'mod_rateit_top_ratings',
'exclude' => true,
'inputType' => 'select',
'options_callback' => array('tl_module_rateit', 'getRateItTopModuleTemplates'),
'eval' => array('mandatory'=>true, 'tl_class'=>'w50'),
'sql' => "varchar(255) NOT NULL default ''"
);
/**
* Class tl_module_rateit
*/
class tl_module_rateit extends rateit\DcaHelper {
/**
* Constructor
*/
public function __construct() {
parent::__construct();
}
public function insert(\DC_Table $dc) {
return $this->insertOrUpdateRatingKey($dc, 'module', $dc->activeRecord->rateit_title);
}
public function delete(\DC_Table $dc)
{
return $this->deleteRatingKey($dc, 'module');
}
public function getRateItTopModuleTemplates(\DataContainer $dc)
{
$intPid = $dc->activeRecord->pid;
if ($this->Input->get('act') == 'overrideAll')
{
$intPid = $this->Input->get('id');
}
return $this->getTemplateGroup('mod_rateit_top', $intPid);
}
}
?>

89
dca/tl_news.php Normal file
View File

@ -0,0 +1,89 @@
<?php
/**
* Contao Open Source CMS
* Copyright (C) 2005-2010 Leo Feyer
*
* Formerly known as TYPOlight Open Source CMS.
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program. If not, please visit the Free
* Software Foundation website at <http://www.gnu.org/licenses/>.
*
* PHP version 5
* @copyright cgo IT, 2013
* @author Carsten Götzinger (info@cgo-it.de)
* @package rateit
* @license GNU/LGPL
* @filesource
*/
/**
* Extend tl_article
*/
$GLOBALS['TL_DCA']['tl_news']['config']['onsubmit_callback'][] = array('tl_news_rating','insert');
$GLOBALS['TL_DCA']['tl_news']['config']['ondelete_callback'][] = array('tl_news_rating','delete');
/**
* Palettes
*/
$GLOBALS['TL_DCA']['tl_news']['palettes']['__selector__'][] = 'addRating';
$GLOBALS['TL_DCA']['tl_news']['palettes']['default'] = $GLOBALS['TL_DCA']['tl_news']['palettes']['default'].';{rating_legend:hide},addRating';
/**
* Add subpalettes to tl_article
*/
$GLOBALS['TL_DCA']['tl_news']['subpalettes']['addRating'] = 'rateit_position';
// Fields
$GLOBALS['TL_DCA']['tl_news']['fields']['addRating'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_news']['addRating'],
'exclude' => true,
'inputType' => 'checkbox',
'sql' => "char(1) NOT NULL default ''",
'eval' => array('tl_class'=>'w50 m12', 'submitOnChange'=>true)
);
$GLOBALS['TL_DCA']['tl_news']['fields']['rateit_position'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_news']['rateit_position'],
'default' => 'before',
'exclude' => true,
'inputType' => 'select',
'options' => array('after', 'before'),
'reference' => &$GLOBALS['TL_LANG']['tl_news'],
'sql' => "varchar(6) NOT NULL default ''",
'eval' => array('mandatory'=>true, 'tl_class'=>'w50')
);
class tl_news_rating extends rateit\DcaHelper {
/**
* Constructor
*/
public function __construct() {
parent::__construct();
}
public function insert(\DC_Table $dc) {
return $this->insertOrUpdateRatingKey($dc, 'news', $dc->activeRecord->headline);
}
public function delete(\DC_Table $dc)
{
return $this->deleteRatingKey($dc, 'news');
}
}
?>

82
dca/tl_page.php Normal file
View File

@ -0,0 +1,82 @@
<?php
/**
* Contao Open Source CMS
* Copyright (C) 2005-2010 Leo Feyer
*
* Formerly known as TYPOlight Open Source CMS.
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program. If not, please visit the Free
* Software Foundation website at <http://www.gnu.org/licenses/>.
*
* PHP version 5
* @copyright cgo IT, 2013
* @author Carsten Götzinger (info@cgo-it.de)
* @package rateit
* @license GNU/LGPL
* @filesource
*/
/**
* Extend tl_page
*/
$GLOBALS['TL_DCA']['tl_page']['config']['onsubmit_callback'][] = array('tl_page_rateit','insert');
$GLOBALS['TL_DCA']['tl_page']['config']['ondelete_callback'][] = array('tl_page_rateit','delete');
/**
* Palettes
*/
foreach ($GLOBALS['TL_DCA']['tl_page']['palettes'] as $keyPalette => $valuePalette)
{
// Skip if we have a array or the palettes for subselections
if (is_array($valuePalette) || $keyPalette == "__selector__" || $keyPalette == "root" || $keyPalette == "forward" || $keyPalette == "redirect")
{
continue;
}
$valuePalette .= ';{rateit_legend:hide},addRating';
// Write new entry back in the palette
$GLOBALS['TL_DCA']['tl_page']['palettes'][$keyPalette] = $valuePalette;
}
// Fields
$GLOBALS['TL_DCA']['tl_page']['fields']['addRating'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_page']['addRating'],
'exclude' => true,
'inputType' => 'checkbox',
'sql' => "char(1) NOT NULL default ''",
);
class tl_page_rateit extends rateit\DcaHelper {
/**
* Constructor
*/
public function __construct() {
parent::__construct();
}
public function insert(\DC_Table $dc) {
return $this->insertOrUpdateRatingKey($dc, 'page', $dc->activeRecord->title);
}
public function delete(\DC_Table $dc)
{
return $this->deleteRatingKey($dc, 'page');
}
}
?>

69
dca/tl_rateit_items.php Normal file
View File

@ -0,0 +1,69 @@
<?php
/**
* Contao Open Source CMS
* Copyright (C) 2005-2010 Leo Feyer
*
* Formerly known as TYPOlight Open Source CMS.
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program. If not, please visit the Free
* Software Foundation website at <http://www.gnu.org/licenses/>.
*
* PHP version 5
* @copyright cgo IT, 2014
* @author Carsten Götzinger (info@cgo-it.de)
* @package rateit
* @license GNU/LGPL
* @filesource
*/
/**
* Table tl_rateit_items
*/
$GLOBALS['TL_DCA']['tl_rateit_items'] = array (
'config' => array (
'dataContainer' => 'Table',
'ctable' => array('tl_rateit_ratings'),
'switchToEdit' => false,
'sql' => array (
'keys' => array (
'id' => 'primary'
)
)
),
'fields' => array (
'id' => array (
'sql' => "int(10) unsigned NOT NULL auto_increment"
),
'tstamp' => array (
'sql' => "int(10) unsigned NOT NULL default '0'"
),
'title' => array (
'sql' => "varchar(513) NOT NULL default ''"
),
'rkey' => array (
'sql' => "varchar(32) NOT NULL default ''"
),
'typ' => array (
'sql' => "varchar(32) NOT NULL default ''"
),
'createdat' => array (
'sql' => "int(10) NOT NULL default '0'"
),
'active' => array (
'sql' => "char(1) NOT NULL default ''"
)
)
);

72
dca/tl_rateit_ratings.php Normal file
View File

@ -0,0 +1,72 @@
<?php
/**
* Contao Open Source CMS
* Copyright (C) 2005-2010 Leo Feyer
*
* Formerly known as TYPOlight Open Source CMS.
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program. If not, please visit the Free
* Software Foundation website at <http://www.gnu.org/licenses/>.
*
* PHP version 5
* @copyright cgo IT, 2014
* @author Carsten Götzinger (info@cgo-it.de)
* @package rateit
* @license GNU/LGPL
* @filesource
*/
/**
* Table tl_rateit_items
*/
$GLOBALS['TL_DCA']['tl_rateit_ratings'] = array (
'config' => array (
'dataContainer' => 'Table',
'ptable' => 'tl_rateit_items',
'switchToEdit' => false,
'sql' => array (
'keys' => array (
'id' => 'primary',
'pid' => 'index',
)
)
),
'fields' => array (
'id' => array (
'sql' => "int(10) unsigned NOT NULL auto_increment"
),
'tstamp' => array (
'sql' => "int(10) unsigned NOT NULL default '0'"
),
'pid' => array (
'foreignKey' => 'tl_rateit_items.id',
'sql' => "int(10) unsigned NOT NULL default '0'",
'relation' => array('type'=>'belongsTo', 'load'=>'lazy')
),
'ip_address' => array (
'sql' => "varchar(50) NULL"
),
'memberid' => array (
'sql' => "int(10) unsigned NULL"
),
'rating' => array (
'sql' => "int(10) unsigned NOT NULL default '0'"
),
'createdat' => array (
'sql' => "int(10) NOT NULL default '0'"
)
)
);

133
dca/tl_settings.php Normal file
View File

@ -0,0 +1,133 @@
<?php
/**
* Contao Open Source CMS
* Copyright (C) 2005-2011 Leo Feyer
*
* Formerly known as TYPOlight Open Source CMS.
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program. If not, please visit the Free
* Software Foundation website at <http://www.gnu.org/licenses/>.
*
* PHP version 5
* @copyright cgo IT, 2012-2013
* @author Carsten Götzinger (info@cgo-it.de)
* @package aeo
* @license GNU/LGPL
* @filesource
*/
/**
* palettes
*/
$GLOBALS['TL_DCA']['tl_settings']['palettes']['default'] .= ';{rateit_legend:hide},rating_type,rating_count,rating_textposition,rating_listsize,rating_allow_duplicate_ratings,rating_allow_duplicate_ratings_for_members,rating_template,rating_description';
/**
* fields
*/
$GLOBALS['TL_DCA']['tl_settings']['fields']['rating_type'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_settings']['rating_type'],
'default' => 'hearts',
'exclude' => true,
'inputType' => 'select',
'options' => array('hearts', 'stars'),
'reference' => &$GLOBALS['TL_LANG']['tl_settings'],
'eval' => array('mandatory'=>true, 'tl_class'=>'w50')
);
$GLOBALS['TL_DCA']['tl_settings']['fields']['rating_count'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_settings']['rating_count'],
'default' => '5',
'exclude' => true,
'inputType' => 'select',
'options' => array('1', '5', '10'),
'reference' => &$GLOBALS['TL_LANG']['tl_settings'],
'eval' => array('mandatory'=>true, 'tl_class'=>'w50')
);
$GLOBALS['TL_DCA']['tl_settings']['fields']['rating_textposition'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_settings']['rating_textposition'],
'default' => 'after',
'exclude' => true,
'inputType' => 'select',
'options' => array('after', 'before'),
'reference' => &$GLOBALS['TL_LANG']['tl_settings'],
'eval' => array('mandatory'=>true, 'tl_class'=>'w50')
);
$GLOBALS['TL_DCA']['tl_settings']['fields']['rating_listsize'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_settings']['rating_listsize'],
'exclude' => true,
'default' => 10,
'inputType' => 'text',
'eval' => array('mandatory'=>false, 'maxlength'=>4, 'tl_class'=>'w50')
);
$GLOBALS['TL_DCA']['tl_settings']['fields']['rating_allow_duplicate_ratings'] = array
(
'exclude' => true,
'label' => &$GLOBALS['TL_LANG']['tl_settings']['allow_duplicate_ratings'],
'inputType' => 'checkbox',
'eval' => array('tl_class'=>'w50 m12')
);
$GLOBALS['TL_DCA']['tl_settings']['fields']['rating_allow_duplicate_ratings_for_members'] = array
(
'exclude' => true,
'label' => &$GLOBALS['TL_LANG']['tl_settings']['allow_duplicate_ratings_for_members'],
'inputType' => 'checkbox',
'eval' => array('tl_class'=>'w50 m12')
);
$GLOBALS['TL_DCA']['tl_settings']['fields']['rating_template'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_settings']['rating_template'],
'default' => 'rateit_default',
'exclude' => true,
'inputType' => 'select',
'options_callback' => array('tl_settings_rateit', 'getRateItTemplates'),
'eval' => array('mandatory'=>true, 'tl_class'=>'w50')
);
$GLOBALS['TL_DCA']['tl_settings']['fields']['rating_description'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_settings']['rating_description'],
'exclude' => true,
'default' => '%current%/%max% %type% (%count% [Stimme|Stimmen])',
'inputType' => 'text',
'eval' => array('mandatory'=>true, 'allowHtml'=>true, 'tl_class'=>'w50')
);
class tl_settings_rateit extends rateit\DcaHelper
{
public function getUserFullName() {
$this->import('jicw\\JICWHelper', 'JICWHelper');
return $this->JICWHelper->getUserFullName();
}
public function getUserEmail() {
$this->import('jicw\\JICWHelper', 'JICWHelper');
return $this->JICWHelper->getUserEmail();
}
public function getInstalledModules() {
$this->import('jicw\\JICWHelper', 'JICWHelper');
return $this->JICWHelper->getInstalledModules();
}
}
?>

56
languages/de/default.php Normal file
View File

@ -0,0 +1,56 @@
<?php
/**
* Contao Open Source CMS
* Copyright (C) 2005-2011 Leo Feyer
*
* Formerly known as TYPOlight Open Source CMS.
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program. If not, please visit the Free
* Software Foundation website at <http://www.gnu.org/licenses/>.
*
* PHP version 5
* @copyright cgo IT, 2013
* @author Carsten Götzinger (info@cgo-it.de)
* @package rateit
* @license GNU/LGPL
* @filesource
*/
/**
* front end modules
*/
$GLOBALS['TL_LANG']['FMD']['rateit'] = array('Rate It', 'Bietet Benutzern die Möglichkeit Bewertungen für Artikel, Seiten, News und FAQs abzugeben.');
$GLOBALS['TL_LANG']['FMD']['rateit_top_ratings'] = array('Rate It - Beste/Meiste Bewertungen', 'Auflistung der x besten Bewertungen als Liste.');
/**
* content Elements
*/
$GLOBALS['TL_LANG']['CTE']['rateit'] = array('Rate It', 'Bietet Benutzern die Möglichkeit Bewertungen für Artikel, Seiten, News und FAQs abzugeben.');
$GLOBALS['TL_LANG']['rateit']['rating_label'] = array('Stimme', 'Stimmen');
$GLOBALS['TL_LANG']['rateit']['heart'] = 'Herz';
$GLOBALS['TL_LANG']['rateit']['hearts'] = 'Herzen';
$GLOBALS['TL_LANG']['rateit']['star'] = 'Stern';
$GLOBALS['TL_LANG']['rateit']['stars'] = 'Sterne';
/**
* Fehler
*/
$GLOBALS['TL_LANG']['rateit']['error']['invalid_id'] = 'ERROR: Ungültige ID für Rating angegeben.';
$GLOBALS['TL_LANG']['rateit']['error']['invalid_rating'] = 'ERROR: Ungültiges Rating angegeben.';
$GLOBALS['TL_LANG']['rateit']['error']['invalid_type'] = 'ERROR: Ungültiger Typ für Rating angegeben.';
$GLOBALS['TL_LANG']['rateit']['error']['duplicate_vote'] = 'ERROR: Sie dürfen nicht mehrfach abstimmen.';
$GLOBALS['TL_LANG']['rateit']['error']['duplicate_rkey'] = 'Der eindeutige Bezeichner "%s" für ein Rating existiert bereits. Bitte wählen Sie einen anderen Bezeichner.';
?>

34
languages/de/modules.php Normal file
View File

@ -0,0 +1,34 @@
<?php
/**
* Contao Open Source CMS
* Copyright (C) 2005-2011 Leo Feyer
*
* Formerly known as TYPOlight Open Source CMS.
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program. If not, please visit the Free
* Software Foundation website at <http://www.gnu.org/licenses/>.
*
* PHP version 5
* @copyright cgo IT, 2013
* @author Carsten Götzinger (info@cgo-it.de)
* @package rateit
* @license GNU/LGPL
* @filesource
*/
// Back end modules
$GLOBALS['TL_LANG']['MOD']['rateit'] = array('Rate It', 'Bewertungen für Artikel, Seiten, News und FAQs ansehen');
?>

View File

@ -0,0 +1,85 @@
<?php
/**
* Contao Open Source CMS
*
* Copyright (C) 2005-2012 Leo Feyer
*
* Core translations are managed using Transifex. To create a new translation
* or to help to maintain an existing one, please register at transifex.com.
*
* @link http://help.transifex.com/intro/translating.html
* @link https://www.transifex.com/projects/p/contao/language/de/
*
* @license http://www.gnu.org/licenses/lgpl-3.0.html LGPL
*/
$GLOBALS['TL_LANG']['tl_rateit']['goback'] = 'Zurück';
$GLOBALS['TL_LANG']['tl_rateit']['noratingsfound'] = 'Keine entsprechenden Bewertungen gefunden.';
$GLOBALS['TL_LANG']['tl_rateit']['showdetails'] = 'Detailanzeige';
$GLOBALS['TL_LANG']['tl_rateit']['byorder'] = 'Nach %s';
$GLOBALS['TL_LANG']['tl_rateit']['seltyp'][0] = 'Typ';
$GLOBALS['TL_LANG']['tl_rateit']['seltyp'][1] = 'Bitte wählen Sie den Bewertungs-Typ.';
$GLOBALS['TL_LANG']['tl_rateit']['selactive'][0] = 'Aktiv/Inaktiv';
$GLOBALS['TL_LANG']['tl_rateit']['selactive'][1] = 'Bitte wählen Sie, ob Sie nur aktive bzw. inaktive Bewertungen anzeigen wollen.';
$GLOBALS['TL_LANG']['tl_rateit']['typ'][0] = 'Typ';
$GLOBALS['TL_LANG']['tl_rateit']['typ'][1] = 'Typ des Ratings (Rating für eine "Seite" oder einen "Artikel")';
$GLOBALS['TL_LANG']['tl_rateit']['title'][0] = 'Titel';
$GLOBALS['TL_LANG']['tl_rateit']['title'][1] = 'Titel der Seite oder des Artikels, auf der/dem das Rating eingebunden ist.';
$GLOBALS['TL_LANG']['tl_rateit']['createdat'][0] = 'aktiviert seit';
$GLOBALS['TL_LANG']['tl_rateit']['createdat'][1] = 'Tag ab dem dieses Bewertung aktiviert gewesen ist im Format %s';
$GLOBALS['TL_LANG']['tl_rateit']['status'][0] = 'Status';
$GLOBALS['TL_LANG']['tl_rateit']['status'][1] = 'Gibt an, ob diese Bewertung derzeit aktiviert ist oder nicht.';
$GLOBALS['TL_LANG']['tl_rateit']['rating'][0] = 'Bewertung';
$GLOBALS['TL_LANG']['tl_rateit']['rating'][1] = 'aktueller Bewertungsstand';
$GLOBALS['TL_LANG']['tl_rateit']['overall_rating'][0] = 'Gesamtbewertung';
$GLOBALS['TL_LANG']['tl_rateit']['overall_rating'][1] = 'aktueller Gesamt-Bewertungsstand';
$GLOBALS['TL_LANG']['tl_rateit']['totalratings'][0] = 'Anzahl Bewertungen';
$GLOBALS['TL_LANG']['tl_rateit']['totalratings'][1] = 'Anzahl der abgegebenen Stimmen für diese Bewertung';
$GLOBALS['TL_LANG']['tl_rateit']['ratingfmt'] = '%s/%d (%d Stimmen)';
$GLOBALS['TL_LANG']['tl_rateit']['ratingviewfmt'] = '%s/%d';
$GLOBALS['TL_LANG']['tl_rateit']['ratingstatisticsfmt'] = 'Bewertung %s: %d von %d abgegebenen Bewertungen (entspricht %s%%)';
$GLOBALS['TL_LANG']['tl_rateit']['statistics'][0] = 'Statistik';
$GLOBALS['TL_LANG']['tl_rateit']['statistics'][1] = 'Statistik';
$GLOBALS['TL_LANG']['tl_rateit']['rating_chart_legend'][0] = 'Verteilung der Bewertungen';
$GLOBALS['TL_LANG']['tl_rateit']['rating_chart_legend'][1] = 'Anzahl Bewertungen';
$GLOBALS['TL_LANG']['tl_rateit']['rating_chart_legend'][2] = 'Bewertung';
$GLOBALS['TL_LANG']['tl_rateit']['rating_chart_legend'][3] = 'Anzahl';
$GLOBALS['TL_LANG']['tl_rateit']['month_chart_legend'][0] = 'abgegebene Bewertungen pro Monat';
$GLOBALS['TL_LANG']['tl_rateit']['month_chart_legend'][1] = 'abgegebene Bewertungen pro Monat';
$GLOBALS['TL_LANG']['tl_rateit']['month_chart_legend'][2] = 'durchschn. Bewertung';
$GLOBALS['TL_LANG']['tl_rateit']['month_chart_legend'][3] = 'Monat';
$GLOBALS['TL_LANG']['tl_rateit']['month_chart_legend'][4] = 'Anzahl';
$GLOBALS['TL_LANG']['tl_rateit']['ratings'][0] = 'Abgegebene Bewertungen';
$GLOBALS['TL_LANG']['tl_rateit']['ratings'][1] = 'Liste aller abgegebenen Bewertungen';
$GLOBALS['TL_LANG']['tl_rateit']['ip'][0] = 'IP-Adresse';
$GLOBALS['TL_LANG']['tl_rateit']['member'][0] = 'Frontend Benutzer';
$GLOBALS['TL_LANG']['tl_rateit']['createdatdetail'][0] = 'Bewertungszeitpunkt';
$GLOBALS['TL_LANG']['tl_rateit']['vote'][0] = 'Stimme';
$GLOBALS['TL_LANG']['tl_rateit']['vote'][1] = 'Stimmen';
$GLOBALS['TL_LANG']['tl_rateit']['clearratings'] = 'Markierte Bewertungen zurücksetzen';
$GLOBALS['TL_LANG']['tl_rateit_type_options']['page'] = 'Seite';
$GLOBALS['TL_LANG']['tl_rateit_type_options']['article'] = 'Artikel';
$GLOBALS['TL_LANG']['tl_rateit_type_options']['news'] = 'Nachricht';
$GLOBALS['TL_LANG']['tl_rateit_type_options']['faq'] = 'FAQ';
$GLOBALS['TL_LANG']['tl_rateit_type_options']['ce'] = 'Inhaltselement';
$GLOBALS['TL_LANG']['tl_rateit_type_options']['module'] = 'Modul';
$GLOBALS['TL_LANG']['tl_rateit_type_options']['galpic'] = 'Galerie-Bild';
$GLOBALS['TL_LANG']['tl_rateit_order_options']['rating desc'] = 'Bewertung';
$GLOBALS['TL_LANG']['tl_rateit_order_options']['title'] = 'Titel';
$GLOBALS['TL_LANG']['tl_rateit_order_options']['typ'] = 'Typ';
$GLOBALS['TL_LANG']['tl_rateit_order_options']['createdat'] = 'Aktivierungsdatum';
$GLOBALS['TL_LANG']['tl_rateit_active_options']['0'] = 'inaktiv';
$GLOBALS['TL_LANG']['tl_rateit_active_options']['1'] = 'aktiv';
$GLOBALS['TL_LANG']['tl_rateit']['xls_sheetname_ratings'] = 'Bewertungen';
$GLOBALS['TL_LANG']['tl_rateit']['xls_sheetname_rating'] = 'Bewertung';
$GLOBALS['TL_LANG']['tl_rateit']['xls_headers'] = array('rkey'=>'Rating-Key', 'typ'=>'Typ', 'title'=>'Titel',
'createdat'=>'Aktivierungszeitpunkt', 'active'=>'Aktiv',
'rating'=>'Bewertung', 'stars'=>'Max. Bewertung',
'percent'=>'Bewertung in Prozent', 'totalRatings'=>'Anzahl Bewertungen');
$GLOBALS['TL_LANG']['tl_rateit']['xls_headers_detail'] = array('ip'=>'IP Adresse', 'member'=>'Frontend Benutzer', 'rating'=>'Bewertung', 'percent'=>'Bewertung in Prozent',
'createdat'=>'Bewertungszeitpunkt');

View File

@ -0,0 +1,40 @@
<?php
/**
* Contao Open Source CMS
* Copyright (C) 2005-2011 Leo Feyer
*
* Formerly known as TYPOlight Open Source CMS.
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program. If not, please visit the Free
* Software Foundation website at <http://www.gnu.org/licenses/>.
*
* PHP version 5
* @copyright cgo IT, 2013
* @author Carsten Götzinger (info@cgo-it.de)
* @package rateit
* @license GNU/LGPL
* @filesource
*/
$GLOBALS['TL_LANG']['tl_article']['rateit_legend'] = 'Rate It-Einstellungen';
$GLOBALS['TL_LANG']['tl_article']['addRating'] = array('Rating aktivieren', 'Aktiviert das Rating für diesen Artikel');
$GLOBALS['TL_LANG']['tl_article']['rateit_position'] = array('Position', 'Position des Rating (ober- oder unterhalb) des Artikels.');
$GLOBALS['TL_LANG']['tl_article']['rateit_template'] = array('Template', 'Hier können Sie das Template für die Bewertung des Artikels auswählen.');
$GLOBALS['TL_LANG']['tl_article']['before'] = array('oberhalb', 'Anzeige des Texts oberhalb des Artikels');
$GLOBALS['TL_LANG']['tl_article']['after'] = array('unterhalb', 'Anzeige des Texts unterhalb des Artikels');
?>

View File

@ -0,0 +1,41 @@
<?php if (!defined('TL_ROOT')) die('You cannot access this file directly!');
/**
* Contao Open Source CMS
* Copyright (C) 2005-2011 Leo Feyer
*
* Formerly known as TYPOlight Open Source CMS.
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program. If not, please visit the Free
* Software Foundation website at <http://www.gnu.org/licenses/>.
*
* PHP version 5
* @copyright cgo IT, 2013
* @author Carsten Götzinger (info@cgo-it.de)
* @package rateit
* @license GNU/LGPL
* @filesource
*/
/**
* legends
*/
$GLOBALS['TL_LANG']['tl_content']['rateit_legend'] = 'Rate It-Einstellungen';
/**
* fields
*/
$GLOBALS['TL_LANG']['tl_content']['rateit_title'] = array('Titel der Bewertung', 'Titel der Bewertung (wird im Backend angezeigt).');
$GLOBALS['TL_LANG']['tl_content']['rateit_active'] = array('Aktiv', 'Aktiv bedeutet, dass die Bewertung sichtbar für den Frontend-Nutzer ist.');
?>

38
languages/de/tl_faq.php Normal file
View File

@ -0,0 +1,38 @@
<?php
/**
* Contao Open Source CMS
* Copyright (C) 2005-2011 Leo Feyer
*
* Formerly known as TYPOlight Open Source CMS.
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program. If not, please visit the Free
* Software Foundation website at <http://www.gnu.org/licenses/>.
*
* PHP version 5
* @copyright cgo IT, 2013
* @author Carsten Götzinger (info@cgo-it.de)
* @package rateit
* @license GNU/LGPL
* @filesource
*/
$GLOBALS['TL_LANG']['tl_faq']['rating_legend'] = 'Rate It-Einstellungen';
$GLOBALS['TL_LANG']['tl_faq']['addRating'] = array('Rating aktivieren', 'Aktiviert das Rating für diese FAQ');
$GLOBALS['TL_LANG']['tl_faq']['rateit_position'] = array('Position', 'Position des Rating (ober- oder unterhalb) des FAQ-Beitrags.');
$GLOBALS['TL_LANG']['tl_faq']['before'] = array('oberhalb', 'Anzeige des Texts oberhalb des FAQ-Beitrags');
$GLOBALS['TL_LANG']['tl_faq']['after'] = array('unterhalb', 'Anzeige des Texts unterhalb des FAQ-Beitrags');
?>

View File

@ -0,0 +1,56 @@
<?php if (!defined('TL_ROOT')) die('You cannot access this file directly!');
/**
* Contao Open Source CMS
* Copyright (C) 2005-2011 Leo Feyer
*
* Formerly known as TYPOlight Open Source CMS.
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program. If not, please visit the Free
* Software Foundation website at <http://www.gnu.org/licenses/>.
*
* PHP version 5
* @copyright cgo IT, 2013
* @author Carsten Götzinger (info@cgo-it.de)
* @package rateit
* @license GNU/LGPL
* @filesource
*/
/**
* legends
*/
$GLOBALS['TL_LANG']['tl_module']['rateit_legend'] = 'Rate It-Einstellungen';
/**
* fields
*/
$GLOBALS['TL_LANG']['tl_module']['rateit_title'] = array('Titel der Bewertung', 'Titel der Bewertung (wird im Backend angezeigt).');
$GLOBALS['TL_LANG']['tl_module']['rateit_active'] = array('Aktiv', 'Aktiv bedeutet, dass die Bewertung sichtbar für den Frontend-Nutzer ist.');
$GLOBALS['TL_LANG']['tl_module']['rateit_types'] = array('Seite', 'Artikel', 'Inhaltselement', 'Modul', 'Nachrichten', 'FAQ', 'Galeriebild');
$GLOBALS['TL_LANG']['tl_module']['rateit_count'] = array('Max. Anzahl', 'Max. Anzahl anzuzeigender Einträge.');
$GLOBALS['TL_LANG']['tl_module']['rateit_toptype'] = array('Art der Liste', 'Die x bestbewerteten Einträge oder die x meistbewerteten Einträge.');
$GLOBALS['TL_LANG']['tl_module']['rateit_template'] = array('Template', 'Hier können Sie das Template für die Bewertung des Artikels auswählen.');
$GLOBALS['TL_LANG']['tl_module']['rateit_types']['page'] = 'Seite';
$GLOBALS['TL_LANG']['tl_module']['rateit_types']['article'] = 'Artikel';
$GLOBALS['TL_LANG']['tl_module']['rateit_types']['ce'] = 'Inhaltselement';
$GLOBALS['TL_LANG']['tl_module']['rateit_types']['module'] = 'Modul';
$GLOBALS['TL_LANG']['tl_module']['rateit_types']['news'] = 'Nachrichten';
$GLOBALS['TL_LANG']['tl_module']['rateit_types']['faq'] = 'FAQ';
$GLOBALS['TL_LANG']['tl_module']['rateit_types']['galpic'] = 'Galeriebild';
$GLOBALS['TL_LANG']['tl_module']['rateit_toptype']['best'] = 'Beste Bewertungen';
$GLOBALS['TL_LANG']['tl_module']['rateit_toptype']['most'] = 'Meiste Bewertungen';
?>

40
languages/de/tl_news.php Normal file
View File

@ -0,0 +1,40 @@
<?php
/**
* Contao Open Source CMS
* Copyright (C) 2005-2011 Leo Feyer
*
* Formerly known as TYPOlight Open Source CMS.
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program. If not, please visit the Free
* Software Foundation website at <http://www.gnu.org/licenses/>.
*
* PHP version 5
* @copyright cgo IT, 2013
* @author Carsten Götzinger (info@cgo-it.de)
* @package rateit
* @license GNU/LGPL
* @filesource
*/
$GLOBALS['TL_LANG']['tl_news']['rating_legend'] = 'Rate It-Einstellungen';
$GLOBALS['TL_LANG']['tl_news']['addRating'] = array('Rating aktivieren', 'Aktiviert das Rating für diese Nachricht');
$GLOBALS['TL_LANG']['tl_news']['rateit_position'] = array('Position', 'Position des Rating (ober- oder unterhalb) des News-Beitrags.');
$GLOBALS['TL_LANG']['tl_news']['before'] = array('oberhalb', 'Anzeige des Texts oberhalb des News-Beitrags');
$GLOBALS['TL_LANG']['tl_news']['after'] = array('unterhalb', 'Anzeige des Texts unterhalb des News-Beitrags');
?>

36
languages/de/tl_page.php Normal file
View File

@ -0,0 +1,36 @@
<?php
/**
* Contao Open Source CMS
* Copyright (C) 2005-2011 Leo Feyer
*
* Formerly known as TYPOlight Open Source CMS.
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program. If not, please visit the Free
* Software Foundation website at <http://www.gnu.org/licenses/>.
*
* PHP version 5
* @copyright cgo IT, 2013
* @author Carsten Götzinger (info@cgo-it.de)
* @package rateit
* @license GNU/LGPL
* @filesource
*/
$GLOBALS['TL_LANG']['tl_page']['rateit_legend'] = 'Rate It-Einstellungen';
$GLOBALS['TL_LANG']['tl_page']['addRating'] = array('Rating aktivieren', 'Aktiviert das Rating für diese Seite');
?>

View File

@ -0,0 +1,64 @@
<?php if (!defined('TL_ROOT')) die('You can not access this file directly!');
/**
* Contao Open Source CMS
* Copyright (C) 2005-2011 Leo Feyer
*
* Formerly known as TYPOlight Open Source CMS.
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program. If not, please visit the Free
* Software Foundation website at <http://www.gnu.org/licenses/>.
*
* PHP version 5
* @copyright cgo IT, 2012-2013
* @author Carsten Götzinger (info@cgo-it.de)
* @package aeo
* @license GNU/LGPL
* @filesource
*/
/**
* Name
*/
$GLOBALS['TL_LANG']['tl_settings']['rateit'] = "Rate It";
/**
* legends
*/
$GLOBALS['TL_LANG']['tl_settings']['rateit_legend'] = 'Rate It-Einstellungen';
/**
* fields
*/
$GLOBALS['TL_LANG']['tl_settings']['rating_type'] = array('Typ', 'Art der Darstellung. Mögliche Optionen sind "Herzen" oder "Sterne".');
$GLOBALS['TL_LANG']['tl_settings']['rating_count'] = array('Anzahl der Herzen/Sterne', 'Anzahl der Herzen/Sterne die dargestellt werden.');
$GLOBALS['TL_LANG']['tl_settings']['rating_textposition'] = array('Textposition', 'Gibt an, ob der Text ober- oder unterhalb der Herzen bzw. Sterne erscheinen soll.');
$GLOBALS['TL_LANG']['tl_settings']['rating_listsize'] = array('Anzahl Einträge', 'Anzahl der angezeigten Einträge pro Seite in der Darstellung der Bewertungen im Backend.');
$GLOBALS['TL_LANG']['tl_settings']['allow_duplicate_ratings'] = array('Doppelte Bewertungen zulassen', 'Darf mit der gleichen IP-Adresse mehrfach für das gleiche Rating abstimmen?');
$GLOBALS['TL_LANG']['tl_settings']['allow_duplicate_ratings_for_members'] = array('Doppelte Bewertungen für Mitglieder zulassen', 'Darf ein angemeldeter Frontendbenutzer mehrfach für das gleiche Rating abstimmen?');
$GLOBALS['TL_LANG']['tl_settings']['rating_template'] = array('Template', 'Hier können Sie das Template für die Bewertung auswählen.');
$GLOBALS['TL_LANG']['tl_settings']['rating_description'] = array('Beschriftung', 'Beschriftung für die einzelnen Ratings. Variablen werden dabei entsprechend ersetzt.<br>verfügbare Variablen:<br>%current% - aktuelle Bewertung<br>%max% - max. mögliche Bewertung<br>%type% - Art der Bewertung (Herzen/Sterne)<br>%count% - Anzahl abgegebener Stimmen<br>[Singular|Plural] - Text für abgegebene Stimmen<br><br>Beispiele:<br><br>%current%/%max% (%count% [Stimme|Stimmen]) liefert 3,7/5 Sterne (7 Stimmen)<br>%count% [Like|Likes] liefert 1 Like bzw. 4 Likes');
/**
* options
*/
$GLOBALS['TL_LANG']['tl_settings']['hearts'] = array('Herzen', 'Darstellung mit Herzen');
$GLOBALS['TL_LANG']['tl_settings']['stars'] = array('Sterne', 'Darstellung mit Sternen');
$GLOBALS['TL_LANG']['tl_settings']['1'] = array('1', '1');
$GLOBALS['TL_LANG']['tl_settings']['5'] = array('5', '5');
$GLOBALS['TL_LANG']['tl_settings']['10'] = array('10', '10');
$GLOBALS['TL_LANG']['tl_settings']['before'] = array('oberhalb', 'Anzeige des Texts oberhalb der Herzen/Sterne');
$GLOBALS['TL_LANG']['tl_settings']['after'] = array('unterhalb', 'Anzeige des Texts unterhalb der Herzen/Sterne');
?>

56
languages/en/default.php Normal file
View File

@ -0,0 +1,56 @@
<?php
/**
* Contao Open Source CMS
* Copyright (C) 2005-2011 Leo Feyer
*
* Formerly known as TYPOlight Open Source CMS.
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program. If not, please visit the Free
* Software Foundation website at <http://www.gnu.org/licenses/>.
*
* PHP version 5
* @copyright cgo IT, 2013
* @author Carsten Götzinger (info@cgo-it.de)
* @package rateit
* @license GNU/LGPL
* @filesource
*/
/**
* front end modules
*/
$GLOBALS['TL_LANG']['FMD']['rateit'] = array('Rate It', 'Enables users to leave ratings for articles, pages, news and FAQs.');
$GLOBALS['TL_LANG']['FMD']['rateit_top_ratings'] = array('Rate It - Best/Most ratings', 'List of the x best ratings.');
/**
* content Elements
*/
$GLOBALS['TL_LANG']['CTE']['rateit'] = array('Rate It', 'Enables users to leave ratings for articles, pages, news and FAQs.');
$GLOBALS['TL_LANG']['rateit']['rating_label'] = array('vote', 'votes');
$GLOBALS['TL_LANG']['rateit']['heart'] = 'heart';
$GLOBALS['TL_LANG']['rateit']['hearts'] = 'hearts';
$GLOBALS['TL_LANG']['rateit']['star'] = 'star';
$GLOBALS['TL_LANG']['rateit']['stars'] = 'stars';
/**
* Fehler
*/
$GLOBALS['TL_LANG']['rateit']['error']['invalid_id'] = 'ERROR: Invalid ID for rating given.';
$GLOBALS['TL_LANG']['rateit']['error']['invalid_rating'] = 'ERROR: Invalid rating given.';
$GLOBALS['TL_LANG']['rateit']['error']['invalid_type'] = 'ERROR: Invalid type for rating given.';
$GLOBALS['TL_LANG']['rateit']['error']['duplicate_vote'] = 'ERROR: You may not vote more than once.';
$GLOBALS['TL_LANG']['rateit']['error']['duplicate_rkey'] = 'The unique identifier "% s" already exists for a rating. Please choose a different identifier.';
?>

34
languages/en/modules.php Normal file
View File

@ -0,0 +1,34 @@
<?php
/**
* Contao Open Source CMS
* Copyright (C) 2005-2011 Leo Feyer
*
* Formerly known as TYPOlight Open Source CMS.
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program. If not, please visit the Free
* Software Foundation website at <http://www.gnu.org/licenses/>.
*
* PHP version 5
* @copyright cgo IT, 2013
* @author Carsten Götzinger (info@cgo-it.de)
* @package rateit
* @license GNU/LGPL
* @filesource
*/
// Back end modules
$GLOBALS['TL_LANG']['MOD']['rateit'] = array('Rate It', 'View ratings for articles, pages, news and faqs');
?>

View File

@ -0,0 +1,85 @@
<?php
/**
* Contao Open Source CMS
*
* Copyright (C) 2005-2012 Leo Feyer
*
* Core translations are managed using Transifex. To create a new translation
* or to help to maintain an existing one, please register at transifex.com.
*
* @link http://help.transifex.com/intro/translating.html
* @link https://www.transifex.com/projects/p/contao/language/de/
*
* @license http://www.gnu.org/licenses/lgpl-3.0.html LGPL
*/
$GLOBALS['TL_LANG']['tl_rateit']['goback'] = 'Back';
$GLOBALS['TL_LANG']['tl_rateit']['noratingsfound'] = 'No matching ratings found.';
$GLOBALS['TL_LANG']['tl_rateit']['showdetails'] = 'Detailview';
$GLOBALS['TL_LANG']['tl_rateit']['byorder'] = 'By %s';
$GLOBALS['TL_LANG']['tl_rateit']['seltyp'][0] = 'Type';
$GLOBALS['TL_LANG']['tl_rateit']['seltyp'][1] = 'Please choose the rating type.';
$GLOBALS['TL_LANG']['tl_rateit']['selactive'][0] = 'Active/Inactive';
$GLOBALS['TL_LANG']['tl_rateit']['selactive'][1] = 'Please choose whether you want to display only active or inactive ratings.';
$GLOBALS['TL_LANG']['tl_rateit']['typ'][0] = 'Type';
$GLOBALS['TL_LANG']['tl_rateit']['typ'][1] = 'Rating type (rating for an "article", a "page", a "news" or a "faq")';
$GLOBALS['TL_LANG']['tl_rateit']['title'][0] = 'Title';
$GLOBALS['TL_LANG']['tl_rateit']['title'][1] = 'Title of the article, page, news or faq, on which the rating is included.';
$GLOBALS['TL_LANG']['tl_rateit']['createdat'][0] = 'activated since';
$GLOBALS['TL_LANG']['tl_rateit']['createdat'][1] = 'Day from which this rating has been enabled in the format "%s"';
$GLOBALS['TL_LANG']['tl_rateit']['status'][0] = 'Status';
$GLOBALS['TL_LANG']['tl_rateit']['status'][1] = 'Indicates whether this rating is currently enabled or not.';
$GLOBALS['TL_LANG']['tl_rateit']['rating'][0] = 'Rating';
$GLOBALS['TL_LANG']['tl_rateit']['rating'][1] = 'actual rating';
$GLOBALS['TL_LANG']['tl_rateit']['overall_rating'][0] = 'Overall rating';
$GLOBALS['TL_LANG']['tl_rateit']['overall_rating'][1] = 'actual overall rating';
$GLOBALS['TL_LANG']['tl_rateit']['totalratings'][0] = 'Total votes';
$GLOBALS['TL_LANG']['tl_rateit']['totalratings'][1] = 'Number of votes for this rating';
$GLOBALS['TL_LANG']['tl_rateit']['ratingfmt'] = '%s/%d (%d Votes)';
$GLOBALS['TL_LANG']['tl_rateit']['ratingviewfmt'] = '%s/%d';
$GLOBALS['TL_LANG']['tl_rateit']['ratingstatisticsfmt'] = 'Rating %s: %d of %d votes (corresponds %s%%)';
$GLOBALS['TL_LANG']['tl_rateit']['statistics'][0] = 'Statistics';
$GLOBALS['TL_LANG']['tl_rateit']['statistics'][1] = 'Statistics';
$GLOBALS['TL_LANG']['tl_rateit']['rating_chart_legend'][0] = 'Distribution of ratings';
$GLOBALS['TL_LANG']['tl_rateit']['rating_chart_legend'][1] = 'Count of ratings';
$GLOBALS['TL_LANG']['tl_rateit']['rating_chart_legend'][2] = 'Rating';
$GLOBALS['TL_LANG']['tl_rateit']['rating_chart_legend'][3] = 'Count';
$GLOBALS['TL_LANG']['tl_rateit']['month_chart_legend'][0] = 'Ratings per month';
$GLOBALS['TL_LANG']['tl_rateit']['month_chart_legend'][1] = 'Ratings per month';
$GLOBALS['TL_LANG']['tl_rateit']['month_chart_legend'][2] = 'Average rating';
$GLOBALS['TL_LANG']['tl_rateit']['month_chart_legend'][3] = 'Month';
$GLOBALS['TL_LANG']['tl_rateit']['month_chart_legend'][4] = 'Count';
$GLOBALS['TL_LANG']['tl_rateit']['ratings'][0] = 'Ratings';
$GLOBALS['TL_LANG']['tl_rateit']['ratings'][1] = 'List of all ratings';
$GLOBALS['TL_LANG']['tl_rateit']['ip'][0] = 'IP address';
$GLOBALS['TL_LANG']['tl_rateit']['member'][0] = 'Frontend member';
$GLOBALS['TL_LANG']['tl_rateit']['createdatdetail'][0] = 'Valuation Point';
$GLOBALS['TL_LANG']['tl_rateit']['vote'][0] = 'vote';
$GLOBALS['TL_LANG']['tl_rateit']['vote'][1] = 'votes';
$GLOBALS['TL_LANG']['tl_rateit']['clearratings'] = 'Reset selected ratings';
$GLOBALS['TL_LANG']['tl_rateit_type_options']['page'] = 'Page';
$GLOBALS['TL_LANG']['tl_rateit_type_options']['article'] = 'Article';
$GLOBALS['TL_LANG']['tl_rateit_type_options']['news'] = 'News';
$GLOBALS['TL_LANG']['tl_rateit_type_options']['faq'] = 'FAQ';
$GLOBALS['TL_LANG']['tl_rateit_type_options']['ce'] = 'Content element';
$GLOBALS['TL_LANG']['tl_rateit_type_options']['module'] = 'Module';
$GLOBALS['TL_LANG']['tl_rateit_type_options']['galpic'] = 'Gallery picture';
$GLOBALS['TL_LANG']['tl_rateit_order_options']['rating desc'] = 'Rating';
$GLOBALS['TL_LANG']['tl_rateit_order_options']['title'] = 'Title';
$GLOBALS['TL_LANG']['tl_rateit_order_options']['typ'] = 'Type';
$GLOBALS['TL_LANG']['tl_rateit_order_options']['createdat'] = 'Activation date';
$GLOBALS['TL_LANG']['tl_rateit_active_options']['0'] = 'inactive';
$GLOBALS['TL_LANG']['tl_rateit_active_options']['1'] = 'active';
$GLOBALS['TL_LANG']['tl_rateit']['xls_sheetname_ratings'] = 'Ratings';
$GLOBALS['TL_LANG']['tl_rateit']['xls_sheetname_rating'] = 'Rating';
$GLOBALS['TL_LANG']['tl_rateit']['xls_headers'] = array('rkey'=>'Rating-Key', 'typ'=>'Type', 'title'=>'Title',
'createdat'=>'Activation date', 'active'=>'Active',
'rating'=>'Rating', 'stars'=>'Max. Rating',
'percent'=>'Rating in percent', 'totalRatings'=>'Total votes');
$GLOBALS['TL_LANG']['tl_rateit']['xls_headers_detail'] = array('ip'=>'IP address', 'member'=>'Frontend member', 'rating'=>'Rating', 'percent'=>'Rating in percent',
'createdat'=>'Valuation Point');

View File

@ -0,0 +1,41 @@
<?php
/**
* Contao Open Source CMS
* Copyright (C) 2005-2011 Leo Feyer
*
* Formerly known as TYPOlight Open Source CMS.
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program. If not, please visit the Free
* Software Foundation website at <http://www.gnu.org/licenses/>.
*
* PHP version 5
* @copyright cgo IT, 2013
* @author Carsten Götzinger (info@cgo-it.de)
* @package rateit
* @license GNU/LGPL
* @filesource
*/
$GLOBALS['TL_LANG']['tl_article']['rateit_legend'] = 'Rate It-Settings';
$GLOBALS['TL_LANG']['tl_article']['addRating'] = array('activate rating', 'Enables the rating for this article');
$GLOBALS['TL_LANG']['tl_article']['rateit_position'] = array('position', 'position of the rating (before or above) the article.');
$GLOBALS['TL_LANG']['tl_article']['rateit_template'] = array('Template', 'Here you can select the template for the article\'s rating.');
$GLOBALS['TL_LANG']['tl_article']['before'] = array('above', 'Display the text above the article');
$GLOBALS['TL_LANG']['tl_article']['after'] = array('below', 'Display the text below the article');
?>

View File

@ -0,0 +1,41 @@
<?php if (!defined('TL_ROOT')) die('You cannot access this file directly!');
/**
* Contao Open Source CMS
* Copyright (C) 2005-2011 Leo Feyer
*
* Formerly known as TYPOlight Open Source CMS.
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program. If not, please visit the Free
* Software Foundation website at <http://www.gnu.org/licenses/>.
*
* PHP version 5
* @copyright cgo IT, 2013
* @author Carsten Götzinger (info@cgo-it.de)
* @package rateit
* @license GNU/LGPL
* @filesource
*/
/**
* legends
*/
$GLOBALS['TL_LANG']['tl_content']['rateit_legend'] = 'Rate It-Settings';
/**
* fields
*/
$GLOBALS['TL_LANG']['tl_content']['rateit_title'] = array('Rating title', 'Rating title (shown in backend).');
$GLOBALS['TL_LANG']['tl_content']['rateit_active'] = array('Active', 'Active means that the review is visible to the front-end users.');
?>

40
languages/en/tl_faq.php Normal file
View File

@ -0,0 +1,40 @@
<?php
/**
* Contao Open Source CMS
* Copyright (C) 2005-2011 Leo Feyer
*
* Formerly known as TYPOlight Open Source CMS.
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program. If not, please visit the Free
* Software Foundation website at <http://www.gnu.org/licenses/>.
*
* PHP version 5
* @copyright cgo IT, 2013
* @author Carsten Götzinger (info@cgo-it.de)
* @package rateit
* @license GNU/LGPL
* @filesource
*/
$GLOBALS['TL_LANG']['tl_faq']['rating_legend'] = 'Rate It-Settings';
$GLOBALS['TL_LANG']['tl_faq']['addRating'] = array('activate rating', 'Enables the rating for this news article');
$GLOBALS['TL_LANG']['tl_faq']['rateit_position'] = array('position', 'position of the rating (before or above) the FAQ entry.');
$GLOBALS['TL_LANG']['tl_faq']['before'] = array('above', 'Display the text above the FAQ entry');
$GLOBALS['TL_LANG']['tl_faq']['after'] = array('below', 'Display the text below the FAQ entry');
?>

View File

@ -0,0 +1,56 @@
<?php if (!defined('TL_ROOT')) die('You cannot access this file directly!');
/**
* Contao Open Source CMS
* Copyright (C) 2005-2011 Leo Feyer
*
* Formerly known as TYPOlight Open Source CMS.
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program. If not, please visit the Free
* Software Foundation website at <http://www.gnu.org/licenses/>.
*
* PHP version 5
* @copyright cgo IT, 2013
* @author Carsten Götzinger (info@cgo-it.de)
* @package rateit
* @license GNU/LGPL
* @filesource
*/
/**
* legends
*/
$GLOBALS['TL_LANG']['tl_module']['rateit_legend'] = 'Rate It-Settings';
/**
* fields
*/
$GLOBALS['TL_LANG']['tl_module']['rateit_title'] = array('Rating title', 'Rating title (shown in backend).');
$GLOBALS['TL_LANG']['tl_module']['rateit_active'] = array('Active', 'Active means that the review is visible to the front-end users.');
$GLOBALS['TL_LANG']['tl_module']['rateit_types'] = array('Types', 'Select the types for which you would like the best ratings to be displayed.');
$GLOBALS['TL_LANG']['tl_module']['rateit_count'] = array('Max. count', 'Max. count of displayed values.');
$GLOBALS['TL_LANG']['tl_module']['rateit_toptype'] = array('List type', 'The x best voted entries oder the x most voted entries.');
$GLOBALS['TL_LANG']['tl_module']['rateit_template'] = array('Template', 'Here you can select the template for the article\'s rating.');
$GLOBALS['TL_LANG']['tl_module']['rateit_types']['page'] = 'Page';
$GLOBALS['TL_LANG']['tl_module']['rateit_types']['article'] = 'Article';
$GLOBALS['TL_LANG']['tl_module']['rateit_types']['ce'] = 'Content Element';
$GLOBALS['TL_LANG']['tl_module']['rateit_types']['module'] = 'Module';
$GLOBALS['TL_LANG']['tl_module']['rateit_types']['news'] = 'News';
$GLOBALS['TL_LANG']['tl_module']['rateit_types']['faq'] = 'FAQ';
$GLOBALS['TL_LANG']['tl_module']['rateit_types']['galpic'] = 'Gallery Picture';
$GLOBALS['TL_LANG']['tl_module']['rateit_toptype']['best'] = 'Best votes';
$GLOBALS['TL_LANG']['tl_module']['rateit_toptype']['most'] = 'Most votes';
?>

40
languages/en/tl_news.php Normal file
View File

@ -0,0 +1,40 @@
<?php
/**
* Contao Open Source CMS
* Copyright (C) 2005-2011 Leo Feyer
*
* Formerly known as TYPOlight Open Source CMS.
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program. If not, please visit the Free
* Software Foundation website at <http://www.gnu.org/licenses/>.
*
* PHP version 5
* @copyright cgo IT, 2013
* @author Carsten Götzinger (info@cgo-it.de)
* @package rateit
* @license GNU/LGPL
* @filesource
*/
$GLOBALS['TL_LANG']['tl_news']['rating_legend'] = 'Rate It-Settings';
$GLOBALS['TL_LANG']['tl_news']['addRating'] = array('activate rating', 'Enables the rating for this news article');
$GLOBALS['TL_LANG']['tl_news']['rateit_position'] = array('position', 'position of the rating (before or above) the news entry.');
$GLOBALS['TL_LANG']['tl_news']['before'] = array('above', 'Display the text above the news entry');
$GLOBALS['TL_LANG']['tl_news']['after'] = array('below', 'Display the text below the news entry');
?>

36
languages/en/tl_page.php Normal file
View File

@ -0,0 +1,36 @@
<?php
/**
* Contao Open Source CMS
* Copyright (C) 2005-2011 Leo Feyer
*
* Formerly known as TYPOlight Open Source CMS.
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program. If not, please visit the Free
* Software Foundation website at <http://www.gnu.org/licenses/>.
*
* PHP version 5
* @copyright cgo IT, 2013
* @author Carsten Götzinger (info@cgo-it.de)
* @package rateit
* @license GNU/LGPL
* @filesource
*/
$GLOBALS['TL_LANG']['tl_page']['rateit_legend'] = 'Rate It-Settings';
$GLOBALS['TL_LANG']['tl_page']['addRating'] = array('activate rating', 'Enables the rating for this page');
?>

View File

@ -0,0 +1,64 @@
<?php if (!defined('TL_ROOT')) die('You can not access this file directly!');
/**
* Contao Open Source CMS
* Copyright (C) 2005-2011 Leo Feyer
*
* Formerly known as TYPOlight Open Source CMS.
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program. If not, please visit the Free
* Software Foundation website at <http://www.gnu.org/licenses/>.
*
* PHP version 5
* @copyright cgo IT, 2012-2013
* @author Carsten Götzinger (info@cgo-it.de)
* @package aeo
* @license GNU/LGPL
* @filesource
*/
/**
* Name
*/
$GLOBALS['TL_LANG']['tl_settings']['rateit'] = "Rate It";
/**
* legends
*/
$GLOBALS['TL_LANG']['tl_settings']['rateit_legend'] = 'Rate It-Settings';
/**
* fields
*/
$GLOBALS['TL_LANG']['tl_settings']['rating_type'] = array('Type', 'Type of representation. Possible options are the "hearts" or "stars".');
$GLOBALS['TL_LANG']['tl_settings']['rating_count'] = array('Number of hearts/stars', 'Number of hearts/stars which are shown.');
$GLOBALS['TL_LANG']['tl_settings']['rating_textposition'] = array('Text position', 'Specifies whether the text should appear above or below the hearts or stars.');
$GLOBALS['TL_LANG']['tl_settings']['rating_listsize'] = array('number of entries', 'Number of entries displayed per page in the representation of ratings in the backend.');
$GLOBALS['TL_LANG']['tl_settings']['allow_duplicate_ratings'] = array('Allow Duplicate votes', 'The same ip address may vote more than once for the same rating?');
$GLOBALS['TL_LANG']['tl_settings']['allow_duplicate_ratings_for_members'] = array('Allow Duplicate votes for members', 'A logged in frontend user may vote more than once for the same rating?');
$GLOBALS['TL_LANG']['tl_settings']['rating_template'] = array('Template', 'Here you can select the template for the rating.');
$GLOBALS['TL_LANG']['tl_settings']['rating_description'] = array('Label', 'Label for ratings. Variables are replaced<br>available variables: <br>%current% - current rating<br>%max% - max. possible rating<br>%type% - type of rating (hearts/stars)<br>%count% - number of votes<br>[singular|plural] - Text for votes<br><br>examples:<br >%current%/%max% (%count% [vote|votes]) returns 3.7/5 stars (7 votes)<br>%count% [Like|Likes] returns 1 Like or 4 Likes');
/**
* options
*/
$GLOBALS['TL_LANG']['tl_settings']['hearts'] = array('hearts', 'Illustration with hearts');
$GLOBALS['TL_LANG']['tl_settings']['stars'] = array('stars', 'Illustration with stars');
$GLOBALS['TL_LANG']['tl_settings']['1'] = array('1', '1');
$GLOBALS['TL_LANG']['tl_settings']['5'] = array('5', '5');
$GLOBALS['TL_LANG']['tl_settings']['10'] = array('10', '10');
$GLOBALS['TL_LANG']['tl_settings']['before'] = array('above', 'Display the text above the hearts/stars');
$GLOBALS['TL_LANG']['tl_settings']['after'] = array('below', 'Display the text below the heart / star');
?>

7
public/.htaccess Normal file
View File

@ -0,0 +1,7 @@
<IfModule !mod_authz_core.c>
Order allow,deny
Allow from all
</IfModule>
<IfModule mod_authz_core.c>
Require all granted
</IfModule>

135
public/css/backend.css Normal file
View File

@ -0,0 +1,135 @@
/**
* Contao Open Source CMS
* Copyright (C) 2005-2011 Leo Feyer
*
* Formerly known as TYPOlight Open Source CMS.
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program. If not, please visit the Free
* Software Foundation website at <http://www.gnu.org/licenses/>.
*
* PHP version 5
* @copyright cgo IT, 2013
* @author Carsten Götzinger (info@cgo-it.de)
* @package rateit
* @license GNU/LGPL
* @filesource
*/
/* General */
.mod_rateit .nowrap { white-space:nowrap; }
.mod_rateit .middle, .mod_rateit .middle * { vertical-align:middle; }
.mod_rateit table.nested { width:100%; margin:0; border:0; }
.mod_rateit table td.nopadding { vertical-align:top; padding:0px !important;}
/* Rating list */
/*.rating_container { margin:12px; }*/
.mod_rateit table
{
width:100%;
margin:6px 0;
border-top:1px solid #ddd;
border-bottom:1px solid #ddd;
}
.mod_rateit table th, .mod_rateit table td
{
padding:3px 6px;
background-color:#f9f9f9;
text-align:left;
line-height:1;
}
.mod_rateit table th.selectall {
background-color:#fff;
}
.mod_rateit table.rating-selectall {
border:0px;
}
.mod_rateit table th { background-color:#fbf7f1; }
.mod_rateit table tr.title th
{
padding:6px;
background-color:#f0f0f0;
border-bottom:1px solid #ddd;
}
.mod_rateit table tr.title span.leftblock
{
padding-top:2px;
display:block;
float:left;
}
.mod_rateit table tr.title span.leftblock a { color:#8ab858 !important; }
.mod_rateit table tr.title span.rightblock { display:block; float:right; }
.mod_rateit table tr.info th, .mod_rateit table tr.info td { border-top:1px solid #fff; font-size:10px; }
.mod_rateit table .listcol1, .mod_rateit table .listcol3, .mod_rateit table .viewcol1, .mod_rateit table .viewcol3 { width:23%; }
.mod_rateit table .listcol2, .mod_rateit table .viewcol2 { width:27%; }
/* Details view */
.mod_rateit_view tr.spacer td
{
background-color:#fff;
border-top:1px solid #ddd;
border-bottom:1px solid #ddd;
line-height:4px;
}
/* Status colors */
.mod_rateit table.rating td.active-0 { background-color:#ffe0e0; }
.mod_rateit table.rating td.type-ce { background-color:#e0e0ff; }
.mod_rateit table.rating td.type-module { background-color:#ffe0e0; }
.mod_rateit table.rating td.type-news { background-color:#aae0e0; }
.mod_rateit table.rating td.type-faq { background-color:#ffe0aa; }
.mod_rateit table.rating td.type-article { background-color:#ffcce0; }
.mod_rateit table.rating td.type-galpic { background-color:#ffe066; }
.mod_rateit table.rating td.active-1, .mod_rateit table.rating td.type-page { background-color:#e0ffe0; }
.mod_rateit table.rating td.
/* Rating-Statistics */
.mod_rateit table th.statistics { float:left; }
/* Rating */
.mod_rateit div.ratebarframe
{
width:60px;
float:left;
background-color:#ffe0e0;
border:1px solid #999;
font-size:1px;
line-height:1px;
}
.mod_rateit div.ratebar
{
width:10%;
height:12px;
background-color:#c0ffc0;
font-size:1px;
}
.mod_rateit div.ratebartext { margin-left:65px; }
.mod_rateit a.header_export_excel{
padding:2px 0 3px 20px;
background-image:url("../images/exportEXCEL.gif");
background-position:left center;
background-repeat:no-repeat;
}
.mod_rateit div.chart {
width: 100%;
}
.mod_rateit .w50 {
width: 48%;
}
.mod_rateit .h100 {
height: 100%;
}

11
public/css/heart.css Normal file
View File

@ -0,0 +1,11 @@
.rateItRating .wrapper, .mbrateItRating .wrapper {
background: url('../images/heart.gif');
}
div.rateItRating div.rateItRating-hover, div.mbrateItRating div.rateItRating-hover {
background: url('../images/heart.gif') left;
}
div.rateItRating div.rateItRating-selected, div.mbrateItRating div.rateItRating-selected {
background: url('../images/heart.gif') left;
}

65
public/css/rateit.css Normal file
View File

@ -0,0 +1,65 @@
.rateItRating {
position: relative;
display: inline-block;
}
.mbrateItRating {
position: relative;
opacity: 1;
}
.rateItRating .wrapper, .mbrateItRating .wrapper {
cursor: pointer;
position: relative;
diplay: inline-block;
height: 16px;
}
.rateItRating[rel="not-rateable"] {
float: right;
}
.rateItRating[rel="not-rateable"] .wrapper {
cursor: default;
}
div.mod_rateit_top_ratings ul {
padding: 0;
}
div.mod_rateit_top_ratings li {
list-style-type: none;
}
div.mod_rateit_top_ratings div.rateItTitle {
display: inline-block;
max-width: 40%;
min-height: 30px;
}
div.rateItRating div.rateItRating-hover, div.rateItRating div.rateItRating-selected,
div.mbrateItRating div.rateItRating-hover, div.mbrateItRating div.rateItRating-selected {
position: absolute;
}
.rateItRating .ratingText {
color: #000;
}
.mbrateItRating .mbratingText {
display: inline-block;
color: #ccc;
}
.ratingText.ratingError {
color: #f00;
}
.rateItRating .ratingText.loading, .mbrateItRating .mbratingText.loading {
background: url('../images/ajax-loading.gif') no-repeat;
/*text-indent: -999em;*/
}
span.rating-microdata {
display: none;
}

11
public/css/star.css Normal file
View File

@ -0,0 +1,11 @@
.rateItRating .wrapper, .mbrateItRating .wrapper {
background: url("../images/star.gif");
}
div.rateItRating div.rateItRating-hover, div.mbrateItRating div.rateItRating-hover {
background: url("../images/star.gif") left;
}
div.rateItRating div.rateItRating-selected, div.mbrateItRating div.rateItRating-selected {
background: url("../images/star.gif") left;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 847 B

BIN
public/images/article.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 392 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 282 B

BIN
public/images/heart.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
public/images/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 722 B

BIN
public/images/info.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 354 B

BIN
public/images/page.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 625 B

BIN
public/images/star.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 815 B

View File

@ -0,0 +1,22 @@
var RateItBackend =
{
/**
* Add the interactive help
*/
addInteractiveHelp: function() {
// Links and input elements
['div.statisticsbar[title]'].each(function(el) {
new Tips.Contao($$(el).filter(function(i) {
return i.title != '';
}), {
offset: {x:0, y:26}
});
});
}
};
//Initialize the back end script
window.addEvent('domready', function() {
RateItBackend.addInteractiveHelp();
});

114
public/js/helper.js Normal file
View File

@ -0,0 +1,114 @@
if (typeof Object.create !== 'function') {
Object.create = function (o) {
function F() {}
F.prototype = o;
return new F();
};
}
function $tryCatch() {
for (var i = 0, l = arguments.length; i < l; i++){
try {
return arguments[i]();
} catch(e){}
}
return null;
};
var Browser = {
Engine: {name: 'unknown', version: 0},
Platform: {name: (window.orientation != undefined) ? 'ipod' : (navigator.platform.match(/mac|win|linux/i) || ['other'])[0].toLowerCase()},
Features: {xpath: !!(document.evaluate), air: !!(window.runtime), query: !!(document.querySelector)},
Plugins: {},
Engines: {
presto: function(){
return (!window.opera) ? false : ((arguments.callee.caller) ? 960 : ((document.getElementsByClassName) ? 950 : 925));
},
trident: function(){
return (!window.ActiveXObject) ? false : ((window.XMLHttpRequest) ? ((document.querySelectorAll) ? 6 : 5) : 4);
},
webkit: function(){
return (navigator.taintEnabled) ? false : ((Browser.Features.xpath) ? ((Browser.Features.query) ? 525 : 420) : 419);
},
gecko: function(){
return (!document.getBoxObjectFor && window.mozInnerScreenX == null) ? false : ((document.getElementsByClassName) ? 19 : 18);
}
}
};
Browser.Platform[Browser.Platform.name] = true;
Browser.detect = function(){
for (var engine in this.Engines){
var version = this.Engines[engine]();
if (version){
this.Engine = {name: engine, version: version};
this.Engine[engine] = this.Engine[engine + version] = true;
break;
}
}
return {name: engine, version: version};
};
Browser.detect();
Browser.Request = function(){
return $tryCatch(function(){
return new XMLHttpRequest();
}, function(){
return new ActiveXObject('MSXML2.XMLHTTP');
}, function(){
return new ActiveXObject('Microsoft.XMLHTTP');
});
};
Browser.Features.xhr = !!(Browser.Request());
Browser.Plugins.Flash = (function(){
var version = ($tryCatch(function(){
return navigator.plugins['Shockwave Flash'].description;
}, function(){
return new ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version');
}) || '0 r0').match(/\d+/g);
return {version: parseInt(version[0] || 0 + '.' + version[1], 10) || 0, build: parseInt(version[2], 10) || 0};
})();
function $exec(text){
if (!text) return text;
if (window.execScript){
window.execScript(text);
} else {
var script = document.createElement('script');
script.setAttribute('type', 'text/javascript');
script[(Browser.Engine.webkit && Browser.Engine.version < 420) ? 'innerText' : 'text'] = text;
document.head.appendChild(script);
document.head.removeChild(script);
}
return text;
};
function getPosition(element) {
var xPosition = 0;
var yPosition = 0;
while(element) {
xPosition += (element.offsetLeft - element.scrollLeft + element.clientLeft);
yPosition += (element.offsetTop - element.scrollTop + element.clientTop);
element = element.offsetParent;
}
return { x: xPosition, y: yPosition };
}

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,75 @@
var readyListRateIt = [];
function onReadyRateIt(handler) {
function executeHandlers() {
for ( var i = 0; i < readyListRateIt.length; i++) {
readyListRateIt[i]();
}
}
if (!readyListRateIt.length) { // set handler on first run
bindReady(executeHandlers);
}
readyListRateIt.push(handler);
}
function bindReady(handler) {
var called = false;
function ready() {
if (called)
return
called = true;
handler();
}
if (document.addEventListener) { // native event
document.addEventListener("DOMContentLoaded", ready, false);
} else if (document.attachEvent) { // IE
try {
var isFrame = window.frameElement != null;
} catch (e) {
}
// IE, the document is not inside a frame
if (document.documentElement.doScroll && !isFrame) {
function tryScroll() {
if (called)
return;
try {
document.documentElement.doScroll("left");
ready();
} catch (e) {
setTimeout(tryScroll, 10);
}
}
tryScroll();
}
// IE, the document is inside a frame
document.attachEvent("onreadystatechange", function() {
if (document.readyState === "complete") {
ready();
}
});
}
// Old browsers
if (window.addEventListener)
window.addEventListener('load', ready, false);
else if (window.attachEvent)
window.attachEvent('onload', ready);
else {
var fn = window.onload; // very old browser, copy old onload
window.onload = function() { // replace by new onload and call the
// old one
fn && fn();
ready();
};
}
}

View File

@ -0,0 +1 @@
function onReadyRateIt(e){function t(){for(var e=0;e<readyListRateIt.length;e++){readyListRateIt[e]()}}if(!readyListRateIt.length){bindReady(t)}readyListRateIt.push(e)}function bindReady(e){function n(){if(t)return;t=true;e()}var t=false;if(document.addEventListener){document.addEventListener("DOMContentLoaded",n,false)}else if(document.attachEvent){try{var r=window.frameElement!=null}catch(i){}if(document.documentElement.doScroll&&!r){function s(){if(t)return;try{document.documentElement.doScroll("left");n()}catch(e){setTimeout(s,10)}}s()}document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){n()}})}if(window.addEventListener)window.addEventListener("load",n,false);else if(window.attachEvent)window.attachEvent("onload",n);else{var o=window.onload;window.onload=function(){o&&o();n()}}}var readyListRateIt=[]

View File

@ -0,0 +1,591 @@
var RateItRating;
function doRateIt() {
if (window.MooTools) {
var RateItRatings = new Class({
Implements: Options,
options: {
step: 0.1, /* Schrittweite */
readonly: false, /* Bewertungen zulassen */
resetable: false /* Nicht zurücksetzbar */
},
initialize: function(options) {
this.setOptions(options);
$$('.rateItRating').each(function(el) {
this.initMe(el);
}.bind(this));
},
initMe: function(el) {
//Does this if the browser is NOT IE6. IE6 users don't deserve fancy ratings. >:(
if (!Browser.ie || Browser.version > 6) {
el.id = el.getAttribute('id');
el.rateable = el.getAttribute('rel') == 'not-rateable' ? false : true;
el.wrapper = el.getElement('.wrapper');
el.textEl = el.getElement('.ratingText');
el.selected = el.wrapper.getElement('.rateItRating-selected');
el.hover = el.wrapper.getElement('.rateItRating-hover');
el.widthFx = new Fx.Tween(el.selected, {property:'width', link:'chain'});
var backgroundImage = this.getBackgroundImage(el.wrapper);
this.options.starwidth = backgroundImage.width;
this.options.starheight = backgroundImage.height / 3; // da immer drei Sterne "übereinander" gebraucht werden
if (this.options.starwidth === undefined || this.options.starwidth < 16) {
this.options.starwidth = 16;
}
if (this.options.starheight === undefined || this.options.starheight < 16) {
this.options.starheight = 16;
}
this.setBackgroundPosition(el.selected, -1 * this.options.starheight);
this.setBackgroundPosition(el.hover, -1 * 2 * this.options.starheight);
el.starPercent = this.getStarPercent(el.id);
el.ratableId = this.getRatableId(el.id);
el.ratableType = this.getRatableType(el.id);
// Maximalwert (=Anzahl Sterne) ermitteln
this.options.max = this.getRatableMaxValue(el.id);
// Höhe für selected und hover einstellen
el.selected.setStyle('height', this.options.starheight);
el.hover.setStyle('height', this.options.starheight);
// Wrapper-Größe so anpassen, dass alle Sterne angezeigt werden
el.wrapper.setStyle('width', this.options.starwidth * this.options.max);
el.wrapper.setStyle('height', this.options.starheight);
// Breite des rateItRating-selected divs setzen
this.fillVote(el.starPercent, el);
// Breite f<>r rateItRating-selected div ermitteln
el.currentFill = this.getFillPercent(el.starPercent);
if (el.rateable) {
el.mouseCrap = function(e) {
var fill = e.event.layerX;
if (!fill) {
fill = e.event.offsetX;
}
var fillPercent = this.getVotePercent(fill);
var nextStep = Math.ceil((fillPercent / 100) * this.options.max);
var w = nextStep * this.options.starwidth;
if (el.hover.getStyle('width').toInt() != w) {
el.selected.setStyle('display', 'none');
el.hover.setStyle('width', Math.min(w, this.options.starwidth * this.options.max));
el.hover.setStyle('display', 'block');
}
var newFill = nextStep / this.options.max * 100;
this.fillVote(newFill, el);
}.bind(this);
el.wrapper.addEvent('mouseenter', function(e) {
el.wrapper.addEvent('mousemove', el.mouseCrap);
});
el.wrapper.addEvent('mouseleave', function(e) {
el.removeEvent('mousemove');
el.hover.setStyle('width', 0);
el.hover.setStyle('display', 'none');
el.selected.setStyle('display', 'block');
el.widthFx.start(el.currentFill);
});
el.wrapper.addEvent('click', function(e) {
el.currentFill = el.newFill;
el.wrapper.removeEvents();
el.textEl.oldTxt = el.textEl.get('text');
el.textEl.set('html', '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;');
el.textEl.addClass('loading');
// falls aus LightBox, entsprechendes ursprüngliches Rating aktualisieren
if (typeof($('.mbrateItRating')) != 'undefined' && el.id.indexOf('mb') == 0) {
var mbid = el.id;
mbid = mbid.replace('mb', '');
if (typeof(arrRatings) == 'object') {
for (var ri = 0; ri < arrRatings.length; ri++) {
if (arrRatings[ri].rateItID == mbid) {
arrRatings[ri].rated = true;
arrRatings[ri].width = el.hover.getStyle('width');
break;
}
}
}
if (typeof($(mbid)) != 'undefined') {
var origWrapper = $(mbid).getElement('.wrapper');
origWrapper.removeEvents();
origWrapper.getElement('.rateItRating-selected').setStyle('display', 'none');
origWrapper.getElement('.rateItRating-hover').setStyle('width', el.hover.getStyle('width'));
origWrapper.getElement('.rateItRating-hover').setStyle('display', 'block');
}
} else {
if (typeof(arrRatings) == 'object') {
for (var ri = 0; ri < arrRatings.length; ri++) {
if (arrRatings[ri].rateItID == el.id) {
arrRatings[ri].rated = true;
arrRatings[ri].width = el.hover.getStyle('width');
break;
}
}
}
}
var votePercent = this.getVotePercent(el.newFill);
if (this.options.url != null) {
new Request({
url:this.options.url,
onComplete:el.updateText
})
.post({vote:votePercent,id:el.ratableId,type:el.ratableType});
}
}.bind(this));
el.updateText = function(text) {
error = text.split('ERROR:')[1];
el.textEl.removeClass('loading');
if (error) { el.showError(error); return false; }
el.textEl.set('text', text);
// falls aus LightBox, entsprechendes ursprüngliches Rating aktualisieren
if (typeof($('.mbrateItRating')) != 'undefined' && el.id.indexOf('mb') == 0) {
var mbid = el.getAttribute('id');
mbid = mbid.replace('mb', '');
if (typeof(arrRatings) == 'object') {
for (var ri = 0; ri < arrRatings.length; ri++) {
if (arrRatings[ri].rateItID == mbid) {
arrRatings[ri].description = text;
break;
}
}
}
if (typeof($(mbid)) != 'undefined') {
$(mbid).getElement('.ratingText').set('text', text);
}
} else {
if (typeof(arrRatings) == 'object') {
for (var ri = 0; ri < arrRatings.length; ri++) {
if (arrRatings[ri].rateItID == el.id) {
arrRatings[ri].description = text;
break;
}
}
}
}
};
}
el.showError = function(error) {
el.textEl.addClass('ratingError');
el.textEl.set('text', error);
(function() {
el.textEl.set('text', el.textEl.oldTxt);
el.textEl.removeClass('ratingError');
}).delay(2000);
};
} else {
//Replaces all the fancy with a text description of the votes for IE6.
//If you want IE6 users to have something fancier to look at, add it here.
el.getElement('.ratingText').inject(el, 'before');
el.remove();
}
},
fillVote: function(percent, el) {
el.newFill = this.getFillPercent(percent);
if (this.getVotePercent(el.newFill) > 100) { el.newFill = this.getFillPercent(100); }
el.selected.setStyle('width', el.newFill);
},
getStarPercent: function(id) {
/* Format = anyStringHere-<id>-<float(currentStars)>_(scale);
* Example: RateItRatings-5-3_5 //Primary key id = 5, 3/5 stars. */
var stars = id.match(/(\d*\|?\d*)-(page|article|ce|module|news|faq|galpic)-(\d*\.?\d+)_(\d*\.?\d+)$/);
if (stars != null) {
var score = stars[3].toFloat();
var scale = stars[4].toFloat();
var percent = (score / scale) * 100;
return percent;
} else {
return 0;
}
},
// Ermittelt die Breite des rateItRating-selected divs
getFillPercent: function (starPercent) {
return (starPercent / 100) * (this.options.starwidth * this.options.max);
},
// Aus der Breite des rateItRating-selected divs die Prozentzahl ermitteln
getVotePercent: function(actVote) {
var starsWidth = this.options.starwidth * this.options.max;
var percent = (actVote / starsWidth * 100).round(2);
return percent;
},
getRatableId: function(id) {
var stars = id.match(/(\d*\|?\d*)-(page|article|ce|module|news|faq|galpic)-(\d*\.?\d+)_(\d*\.?\d+)$/);
return stars != null ? stars[1] : '';
},
getRatableType: function(id) {
var stars = id.match(/(\d*\|?\d*)-(page|article|ce|module|news|faq|galpic)-(\d*\.?\d+)_(\d*\.?\d+)$/);
return stars != null ? stars[2] : '';
},
getRatableMaxValue: function(id) {
var stars = id.match(/(\d*\|?\d*)-(page|article|ce|module|news|faq|galpic)-(\d*\.?\d+)_(\d*\.?\d+)$/);
return stars != null ? stars[4].toInt() : 0;
},
setBackgroundPosition: function(el, pos) {
el.setStyle('background-position', '0% ' + pos + 'px');
},
getBackgroundImagePath: function(el) {
return el.getStyle('background-image');
},
getBackgroundImage: function(el) {
var reg_imgFile = /url\s*\(["']?(.*)["']?\)/i;
var dummy = document.createElement('img');
var string = this.getBackgroundImagePath(el);
string = string.match(reg_imgFile)[1];
string = string.replace('\"', '');
dummy.src = string;
return dummy;
}
});
window.addEvent('domready', function(e) {
RateItRating = new RateItRatings({url:'SimpleAjax.php'});
});
} else if (window.jQuery) {
// the rateit plugin as an Object
(function() {
RateItRatings = {
options: {
step: 0.1, /* Schrittweite */
readonly: false, /* Bewertungen zulassen */
resetable: false /* Nicht zurücksetzbar */
},
// this should be called first before doing anything else
initialize: function(options) {
if (typeof options == 'object' && typeof options['url'] != 'undefined')
this.options.url = options['url'];
var self = this;
jQuery('.rateItRating').each(function(i, element) {
self.initMe(element);
});
return this;
},
initMe: function(element) {
var self = this;
//Does this if the browser is NOT IE6. IE6 users don't deserve fancy ratings. >:(
if (!Browser.Engine.trident4) {
var el = jQuery(element);
el.data('id', el.attr('id'));
el.data('rateable', el.attr('rel') == 'not-rateable' ? false : true);
el.data('wrapper', el.find('.wrapper'));
el.data('textEl', el.find('.ratingText'));
// el.data('offset', getPosition(element).x);
el.data('selected', el.find('.rateItRating-selected'));
el.data('hover', el.find('.rateItRating-hover'));
var backgroundImage = self.getBackgroundImage(el.data('wrapper'));
self.options.starwidth = backgroundImage.width;
self.options.starheight = backgroundImage.height / 3; // da immer drei Sterne "übereinander" gebraucht werden
if (self.options.starwidth === undefined || self.options.starwidth < 16) {
self.options.starwidth = 16;
}
if (self.options.starheight === undefined || self.options.starheight < 16) {
self.options.starheight = 16;
}
self.setBackgroundPosition(el.data('selected'), -1 * self.options.starheight);
self.setBackgroundPosition(el.data('hover'), -1 * 2 * self.options.starheight);
el.data('starPercent', self.getStarPercent(el.data('id')));
el.data('ratableId', self.getRatableId(el.data('id')));
el.data('ratableType', self.getRatableType(el.data('id')));
// Maximalwert (=Anzahl Sterne) ermitteln
self.options.max = self.getRatableMaxValue(el.data('id'));
// Höhe für selected und hover einstellen
el.data('selected').css('height', self.options.starheight);
el.data('hover').css('height', self.options.starheight);
// Wrapper-Größe so anpassen, dass alle Sterne angezeigt werden
el.data('wrapper').css('width', self.options.starwidth * self.options.max);
el.data('wrapper').css('height', self.options.starheight);
// Breite des rateItRating-selected divs setzen
self.fillVote(el.data('starPercent'), el);
// Breite für rateItRating-selected div ermitteln
el.data('currentFill', self.getFillPercent(el.data('starPercent')));
if (el.data('rateable')) {
el.data('wrapper').mouseenter(function(event) {
el.data('selected').hide(500, "easeInOutQuad");
el.data('hover').show();
el.data('wrapper').mousemove({'el': el, 'self': self}, self.mouseCrap);
});
el.data('wrapper').mouseleave(function(event) {
el.data('wrapper').unbind('mousemove');
el.data('hover').hide();
el.data('selected').show();
el.data('selected').animate({width: el.data('currentFill')}, 500);
});
el.data('wrapper').click(function(event) {
el.data('currentFill', el.data('newFill'));
el.data('wrapper').unbind();
el.data('oldTxt', el.data('textEl').text());
el.data('textEl').html('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;');
el.data('textEl').addClass('loading');
// falls aus LightBox, entsprechendes ursprüngliches Rating aktualisieren
if (typeof(jQuery('.mbrateItRating')) != 'undefined' && el.data('id').indexOf('mb') == 0) {
var mbid = el.data('id');
mbid = mbid.replace('mb', '');
if (typeof(arrRatings) == 'object') {
for (var ri = 0; ri < arrRatings.length; ri++) {
if (arrRatings[ri].rateItID == mbid) {
arrRatings[ri].rated = true;
arrRatings[ri].width = el.data('hover').css('width');
break;
}
}
}
if (typeof(jQuery('#' + jEscape(mbid))) != 'undefined') {
var origWrapper = jQuery('#' + jEscape(mbid)).find('.wrapper');
origWrapper.unbind();
origWrapper.find('.rateItRating-selected').css('display', 'none');
origWrapper.find('.rateItRating-hover').css('width', el.data('hover').css('width'));
origWrapper.find('.rateItRating-hover').css('display', 'block');
}
} else {
if (typeof(arrRatings) == 'object') {
for (var ri = 0; ri < arrRatings.length; ri++) {
if (arrRatings[ri].rateItID == el.data('id')) {
arrRatings[ri].rated = true;
arrRatings[ri].width = el.data('hover').css('width');
break;
}
}
}
}
var votePercent = self.getVotePercent(el.data('newFill'));
if (self.options.url != null) {
jQuery.ajax({
url: self.options.url,
type: 'post',
data: {'vote': votePercent, 'id': el.data('ratableId'), 'type': el.data('ratableType')}
}).done(function(data) {
el.data('updateText')(el, data);
});
}
});
}
el.data('updateText', self.updateText);
} else {
alert("Ich bin ein IE6");
}
},
fillVote: function(percent, el) {
el.data('newFill', this.getFillPercent(percent));
if (this.getVotePercent(el.data('newFill')) > 100) { el.data('newFill', this.getFillPercent(100)); }
el.data('selected').css('width', el.data('newFill'));
},
mouseCrap: function(event) {
var el = event.data['el'];
var self = event.data['self'];
var fill = event.originalEvent.layerX;
if (!fill) {
fill = event.originalEvent.offsetX;
}
var fillPercent = self.getVotePercent(fill);
var nextStep = Math.ceil((fillPercent / 100) * self.options.max);
var w = nextStep * self.options.starwidth;
if (parseInt(el.data('hover').css('width')) != w) {
el.data('selected').css('display', 'none');
el.data('hover').css('width', Math.min(w, self.options.starwidth * self.options.max));
el.data('hover').css('display', 'block');
}
var newFill = nextStep / self.options.max * 100;
self.fillVote(newFill, el);
},
getStarPercent: function(id) {
/* Format = anyStringHere-<id>-<float(currentStars)>_(scale);
* Example: RateItRatings-5-3_5 //Primary key id = 5, 3/5 stars. */
var stars = id.match(/(\d*\|?\d*)-(page|article|ce|module|news|faq|galpic)-(\d*\.?\d+)_(\d*\.?\d+)$/);
if (stars != null) {
var score = parseFloat(stars[3]);
var scale = parseFloat(stars[4]);
var percent = (score / scale) * 100;
return percent;
} else {
return 0;
}
},
// Ermittelt die Breite des rateItRating-selected divs
getFillPercent: function (starPercent) {
return (starPercent / 100) * (this.options.starwidth * this.options.max);
},
// Aus der Breite des rateItRating-selected divs die Prozentzahl ermitteln
getVotePercent: function(actVote) {
var starsWidth = this.options.starwidth * this.options.max;
var percent = (actVote / starsWidth * 100).toFixed(2);
return percent;
},
getRatableId: function(id) {
var stars = id.match(/(\d*\|?\d*)-(page|article|ce|module|news|faq|galpic)-(\d*\.?\d+)_(\d*\.?\d+)$/);
return stars != null ? stars[1] : '';
},
getRatableType: function(id) {
var stars = id.match(/(\d*\|?\d*)-(page|article|ce|module|news|faq|galpic)-(\d*\.?\d+)_(\d*\.?\d+)$/);
return stars != null ? stars[2] : '';
},
getRatableMaxValue: function(id) {
var stars = id.match(/(\d*\|?\d*)-(page|article|ce|module|news|faq|galpic)-(\d*\.?\d+)_(\d*\.?\d+)$/);
return stars != null ? parseInt(stars[4]) : 0;
},
setBackgroundPosition: function(el, pos) {
el.css('background-position', '0% ' + pos + 'px');
},
getBackgroundImagePath: function(el) {
return el.css("background-image");
},
getBackgroundImage: function(el) {
var reg_imgFile = /url\s*\(["']?(.*)["']?\)/i;
var dummy = document.createElement('img');
var string = this.getBackgroundImagePath(el);
string = string.match(reg_imgFile)[1];
string = string.replace('\"', '');
dummy.src = string;
return dummy;
},
updateText: function(el, text) {
error = text.split('ERROR:')[1];
el.data('textEl').removeClass('loading');
if (error) { this.RateItRating.showError(el, error); return false; }
el.data('textEl').text(text);
// falls aus LightBox, entsprechendes ursprüngliches Rating aktualisieren
if (typeof(jQuery('.mbrateItRating')) != 'undefined' && el.data('id').indexOf('mb') == 0) {
var mbid = el.attr('id');
mbid = mbid.replace('mb', '');
if (typeof(arrRatings) == 'object') {
for (var ri = 0; ri < arrRatings.length; ri++) {
if (arrRatings[ri].rateItID == mbid) {
arrRatings[ri].description = text;
break;
}
}
}
if (typeof(jQuery('#' + jEscape(mbid))) != 'undefined') {
jQuery('#' + jEscape(mbid)).find('.ratingText').text(text);
}
} else {
if (typeof(arrRatings) == 'object') {
for (var ri = 0; ri < arrRatings.length; ri++) {
if (arrRatings[ri].rateItID == el.data('id')) {
arrRatings[ri].description = text;
break;
}
}
}
}
},
showError: function(el, error) {
el.data('textEl').addClass('ratingError');
//oldTxt = el.data('textEl').text();
el.data('textEl').text(error);
setTimeout(function() {
el.data('textEl').text(el.data('oldTxt'));
el.data('textEl').removeClass('ratingError');
}, 2000);
}
};
})(jQuery);
jQuery(document).ready(function() {
jQuery.ajax({
type: "GET",
url: "system/modules/rateit/public/js/jquery-ui-effects.custom.min.js",
dataType: "script",
async: false,
cache: true
});
jQuery.ajax({
type: "GET",
url: "system/modules/rateit/public/js/helper.js",
dataType: "script",
async: false,
cache: true
});
RateItRating = Object.create(RateItRatings).initialize({url:'SimpleAjax.php'});
});
var jEscape = function(jquery) {
jquery = jquery.replace(new RegExp("\\$", "g"), "\\$");
jquery = jquery.replace(new RegExp("\~", "g"), "\\~");
jquery = jquery.replace(new RegExp("\\[", "g"), "\\[");
jquery = jquery.replace(new RegExp("\\]", "g"), "\\]");
jquery = jquery.replace(new RegExp("\\|", "g"), "\\|");
jquery = jquery.replace(new RegExp("\\.", "g"), "\\.");
jquery = jquery.replace(new RegExp("#", "g"), "\\#");
return jquery;
};
}
}
onReadyRateIt(function() {
doRateIt();
});

1
public/js/rateit.js Normal file

File diff suppressed because one or more lines are too long

164
public/php/rateit.php Normal file
View File

@ -0,0 +1,164 @@
<?php
/**
* Contao Open Source CMS
* Copyright (C) 2005-2011 Leo Feyer
*
* Formerly known as TYPOlight Open Source CMS.
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program. If not, please visit the Free
* Software Foundation website at <http://www.gnu.org/licenses/>.
*
* PHP version 5
* @copyright cgo IT, 2013
* @author Carsten Götzinger (info@cgo-it.de)
* @package rateit
* @license GNU/LGPL
* @filesource
*/
namespace cgoIT\rateit;
define(RETURN_AJAX_HEADER, 'Content-Type: text/html');
class RateIt extends \Frontend {
var $allowDuplicates = false;
/**
* Initialize the controller
*/
public function __construct() {
parent::__construct();
$this->loadLanguageFile('default');
$this->allowDuplicates = $GLOBALS['TL_CONFIG']['rating_allow_duplicate_ratings'];
$this->allowDuplicatesForMembers = $GLOBALS['TL_CONFIG']['rating_allow_duplicate_ratings_for_members'];
}
/**
* doVote
*
* This is the function in charge of handling a vote and saving it to the
* database.
*
* NOTE: This method is meant to be called as part of an AJAX request. As
* such, it unitlizes the die() function to display its errors. THIS
* WOULD BE A VERY BAD FUNCTION TO CALL FROM WITHIN ANOTHER PAGE.
*
* @param integer id - The id of key to register a rating for.
* @param integer percent - The rating in percentages.
*/
function doVote() {
$ip = $_SERVER['REMOTE_ADDR'];
$rkey = $_POST['id'];
$percent = $_POST['vote'];
$type = $_POST['type'];
//Make sure that the ratable ID is a number and not something crazy.
if (strstr($rkey, '|')) {
$arrRkey = explode('|', $rkey);
foreach ($arrRkey as $key) {
if (!is_numeric($key)) {
header(RETURN_AJAX_HEADER);
echo $GLOBALS['TL_LANG']['rateit']['error']['invalid_rating'];
exit;
}
$id = $rkey;
}
} else {
if (is_numeric($rkey)) {
$id = $rkey;
} else {
header(RETURN_AJAX_HEADER);
echo $GLOBALS['TL_LANG']['rateit']['error']['invalid_rating'];
exit;
}
}
//Make sure the percent is a number and under 100.
if (is_numeric($percent) && $percent < 101) {
$rating = $percent;
} else {
header(RETURN_AJAX_HEADER);
echo $GLOBALS['TL_LANG']['rateit']['error']['invalid_rating'];
exit;
}
//Make sure that the ratable type is 'page' or 'ce' or 'module'
if (!($type === 'page' || $type === 'article' || $type === 'ce' || $type === 'module' || $type === 'news' || $type === 'faq' || $type === 'galpic')) {
header(RETURN_AJAX_HEADER);
echo $GLOBALS['TL_LANG']['rateit']['error']['invalid_type'];
exit;
}
$strHash = sha1(session_id() . (!$GLOBALS['TL_CONFIG']['disableIpCheck'] ? \Environment::get('ip') : '') . 'FE_USER_AUTH');
// FrontendUser auslesen
if (FE_USER_LOGGED_IN) {
$objUser = $this->Database->prepare("SELECT pid FROM tl_session WHERE hash=?")
->limit(1)
->execute($strHash);
if ($objUser->numRows) {
$userId = $objUser->pid;
}
}
$ratableKeyId = $this->Database->prepare('SELECT id FROM tl_rateit_items WHERE rkey=? and typ=?')
->execute($id, $type)
->fetchAssoc();
$canVote = false;
if (isset($userId)) {
$countUser = $this->Database->prepare('SELECT * FROM tl_rateit_ratings WHERE pid=? and memberid=?')
->execute($ratableKeyId['id'], $userId)
->count();
}
$countIp = $this->Database->prepare('SELECT * FROM tl_rateit_ratings WHERE pid=? and ip_address=?')
->execute($ratableKeyId['id'], $ip)
->count();
// Die with an error if the insert fails (duplicate IP or duplicate member id for a vote).
if (((!$this->allowDuplicates && $countIp == 0) || $this->allowDuplicates) ||
((!$this->allowDuplicatesForMembers && (isset($countUser) ? $countUser == 0 : false)) || ($this->allowDuplicatesForMembers && isset($userId)))) {
// Insert the data.
$arrSet = array('pid' => $ratableKeyId['id'],
'tstamp' => time(),
'ip_address' => $ip,
'memberid' => isset($userId) ? $userId : null,
'rating' => $rating,
'createdat'=> time()
);
$this->Database->prepare('INSERT INTO tl_rateit_ratings %s')
->set($arrSet)
->execute();
} else {
header(RETURN_AJAX_HEADER);
echo $GLOBALS['TL_LANG']['rateit']['error']['duplicate_vote'];
exit;
}
$this->import('rateit\\RateItFrontend', 'RateItFrontend');
$rating = $this->RateItFrontend->loadRating($id, $type);
header(RETURN_AJAX_HEADER);
echo $this->RateItFrontend->getStarMessage($rating);
exit;
}
}
?>

View File

@ -0,0 +1,70 @@
<?php if ($this->rateit_rating_before): ?>
<!-- indexer::stop -->
<div id="<?php echo $this->rateItID; ?>" 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>
<!-- indexer::continue -->
<?php endif; ?>
<div class="<?php echo $this->class; ?> block"<?php echo $this->cssID; ?><?php if ($this->style): ?> style="<?php echo $this->style; ?>"<?php endif; ?>>
<?php if ($this->printable): ?>
<!-- indexer::stop -->
<div class="pdf_link">
<?php if ($this->printButton): ?>
<a href="<?php echo $this->print; ?>" rel="nofollow" title="<?php echo $this->printTitle; ?>" onclick="window.print();return false"><img src="<?php echo TL_FILES_URL; ?>assets/contao/images/print.gif" width="16" height="16" alt=""></a>
<?php endif; ?>
<?php if ($this->pdfButton): ?>
<a href="<?php echo $this->href; ?>" rel="nofollow" title="<?php echo $this->pdfTitle; ?>"><img src="<?php echo TL_FILES_URL; ?>assets/contao/images/pdf.gif" width="16" height="16" alt=""></a>
<?php endif; ?>
<?php if ($this->facebookButton): ?>
<a href="share/?p=facebook[&]u=<?php echo $this->encUrl; ?>[&]t=<?php echo $this->encTitle; ?>" rel="nofollow" title="<?php echo $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"><img src="<?php echo TL_FILES_URL; ?>assets/contao/images/facebook.gif" width="24" height="24" alt=""></a>
<?php endif; ?>
<?php if ($this->twitterButton): ?>
<a href="share/?p=twitter[&]u=<?php echo $this->encUrl; ?>[&]t=<?php echo $this->encTitle; ?>" rel="nofollow" title="<?php echo $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"><img src="<?php echo TL_FILES_URL; ?>assets/contao/images/twitter.gif" width="24" height="24" alt=""></a>
<?php endif; ?>
<?php if ($this->gplusButton): ?>
<a href="share/?p=gplus[&]u=<?php echo $this->encUrl; ?>[&]t=<?php echo $this->encTitle; ?>" rel="nofollow" title="<?php echo $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"><img src="<?php echo TL_FILES_URL; ?>assets/contao/images/gplus.gif" width="24" height="24" alt=""></a>
<?php endif; ?>
</div>
<!-- indexer::continue -->
<?php endif; ?>
<?php echo implode($this->elements); ?>
<?php if ($this->backlink): ?>
<!-- indexer::stop -->
<p class="back"><a href="<?php echo $this->backlink; ?>" title="<?php echo $this->back; ?>"><?php echo $this->back; ?></a></p>
<!-- indexer::continue -->
<?php endif; ?>
</div>
<?php if ($this->rateit_rating_after): ?>
<!-- indexer::stop -->
<div id="<?php echo $this->rateItID; ?>" 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>
<!-- indexer::continue -->
<?php endif; ?>

View File

@ -0,0 +1,71 @@
<?php if ($this->rateit_rating_before): ?>
<!-- indexer::stop -->
<div id="<?php echo $this->rateItID; ?>" 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>
<!-- indexer::continue -->
<?php endif; ?>
<div class="<?php echo $this->class; ?> block"<?php echo $this->cssID; ?><?php if ($this->style): ?> style="<?php echo $this->style; ?>"<?php endif; ?>>
<?php if ($this->printable): ?>
<!-- indexer::stop -->
<div class="pdf_link">
<?php if ($this->printButton): ?>
<a href="<?php echo $this->print; ?>" rel="nofollow" title="<?php echo $this->printTitle; ?>" onclick="window.print();return false"><img src="<?php echo TL_FILES_URL; ?>assets/contao/images/print.gif" width="16" height="16" alt="" /></a>
<?php endif; ?>
<?php if ($this->pdfButton): ?>
<a href="<?php echo $this->href; ?>" rel="nofollow" title="<?php echo $this->pdfTitle; ?>"><img src="<?php echo TL_FILES_URL; ?>assets/contao/images/pdf.gif" width="16" height="16" alt="" /></a>
<?php endif; ?>
<?php if ($this->facebookButton): ?>
<a href="share/?p=facebook&amp;u=<?php echo $this->encUrl; ?>&amp;t=<?php echo $this->encTitle; ?>" rel="nofollow" title="<?php echo $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"><img src="<?php echo TL_FILES_URL; ?>assets/contao/images/facebook.gif" width="16" height="16" alt="" /></a>
<?php endif; ?>
<?php if ($this->twitterButton): ?>
<a href="share/?p=twitter&amp;u=<?php echo $this->encUrl; ?>&amp;t=<?php echo $this->encTitle; ?>" rel="nofollow" title="<?php echo $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"><img src="<?php echo TL_FILES_URL; ?>assets/contao/images/twitter.gif" width="16" height="16" alt="" /></a>
<?php endif; ?>
<?php if ($this->gplusButton): ?>
<a href="share/?p=gplus&amp;u=<?php echo $this->encUrl; ?>&amp;t=<?php echo $this->encTitle; ?>" rel="nofollow" title="<?php echo $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"><img src="<?php echo TL_FILES_URL; ?>assets/contao/images/gplus.gif" width="16" height="16" alt="" /></a>
<?php endif; ?>
</div>
<!-- indexer::continue -->
<?php endif; ?>
<?php echo implode($this->elements); ?>
<?php if ($this->backlink): ?>
<!-- indexer::stop -->
<p class="back"><a href="<?php echo $this->backlink; ?>" title="<?php echo $this->back; ?>"><?php echo $this->back; ?></a></p>
<!-- indexer::continue -->
<?php endif; ?>
</div>
<?php if ($this->rateit_rating_after): ?>
<!-- indexer::stop -->
<div id="<?php echo $this->rateItID; ?>" 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>
<!-- indexer::continue -->
<?php endif; ?>

View File

@ -0,0 +1,86 @@
<?php if ($this->rateit_rating_before): ?>
<!-- indexer::stop -->
<div itemtype="http://data-vocabulary.org/Review-aggregate" itemscope="" class="rating-microdata">
<div id="<?php echo $this->rateItID; ?>" 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="itemreviewed"><?php echo $this->itemreviewed; ?></span>
<span class="rating-microdata" itemtype="http://data-vocabulary.org/Rating" itemscope="" itemprop="rating">
<span itemprop="average"><?php echo $this->actRating; ?></span>
<span itemprop="best"><?php echo $this->maxRating; ?></span>
</span>
<span class="rating-microdata" itemprop="votes"><?php echo $this->votes; ?></span>
</div>
<!-- indexer::continue -->
<?php endif; ?>
<div class="<?php echo $this->class; ?> block"<?php echo $this->cssID; ?><?php if ($this->style): ?> style="<?php echo $this->style; ?>"<?php endif; ?>>
<?php if ($this->printable): ?>
<!-- indexer::stop -->
<div class="pdf_link">
<?php if ($this->printButton): ?>
<a href="<?php echo $this->print; ?>" rel="nofollow" title="<?php echo $this->printTitle; ?>" onclick="window.print();return false"><img src="<?php echo TL_FILES_URL; ?>assets/contao/images/print.gif" width="16" height="16" alt=""></a>
<?php endif; ?>
<?php if ($this->pdfButton): ?>
<a href="<?php echo $this->href; ?>" rel="nofollow" title="<?php echo $this->pdfTitle; ?>"><img src="<?php echo TL_FILES_URL; ?>assets/contao/images/pdf.gif" width="16" height="16" alt=""></a>
<?php endif; ?>
<?php if ($this->facebookButton): ?>
<a href="share/?p=facebook[&]u=<?php echo $this->encUrl; ?>[&]t=<?php echo $this->encTitle; ?>" rel="nofollow" title="<?php echo $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"><img src="<?php echo TL_FILES_URL; ?>assets/contao/images/facebook.gif" width="24" height="24" alt=""></a>
<?php endif; ?>
<?php if ($this->twitterButton): ?>
<a href="share/?p=twitter[&]u=<?php echo $this->encUrl; ?>[&]t=<?php echo $this->encTitle; ?>" rel="nofollow" title="<?php echo $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"><img src="<?php echo TL_FILES_URL; ?>assets/contao/images/twitter.gif" width="24" height="24" alt=""></a>
<?php endif; ?>
<?php if ($this->gplusButton): ?>
<a href="share/?p=gplus[&]u=<?php echo $this->encUrl; ?>[&]t=<?php echo $this->encTitle; ?>" rel="nofollow" title="<?php echo $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"><img src="<?php echo TL_FILES_URL; ?>assets/contao/images/gplus.gif" width="24" height="24" alt=""></a>
<?php endif; ?>
</div>
<!-- indexer::continue -->
<?php endif; ?>
<?php echo implode($this->elements); ?>
<?php if ($this->backlink): ?>
<!-- indexer::stop -->
<p class="back"><a href="<?php echo $this->backlink; ?>" title="<?php echo $this->back; ?>"><?php echo $this->back; ?></a></p>
<!-- indexer::continue -->
<?php endif; ?>
</div>
<?php if ($this->rateit_rating_after): ?>
<!-- indexer::stop -->
<div itemtype="http://data-vocabulary.org/Review-aggregate" itemscope="" class="rating-microdata">
<div id="<?php echo $this->rateItID; ?>" 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="itemreviewed"><?php echo $this->itemreviewed; ?></span>
<span class="rating-microdata" itemtype="http://data-vocabulary.org/Rating" itemscope="" itemprop="rating">
<span itemprop="average"><?php echo $this->actRating; ?></span>
<span itemprop="best"><?php echo $this->maxRating; ?></span>
</span>
<span class="rating-microdata" itemprop="votes"><?php echo $this->votes; ?></span>
</div>
<!-- indexer::continue -->
<?php endif; ?>

View File

@ -0,0 +1,87 @@
<?php if ($this->rateit_rating_before): ?>
<!-- indexer::stop -->
<div itemtype="http://data-vocabulary.org/Review-aggregate" itemscope="" class="rating-microdata">
<div id="<?php echo $this->rateItID; ?>" 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="itemreviewed"><?php echo $this->itemreviewed; ?></span>
<span class="rating-microdata" itemtype="http://data-vocabulary.org/Rating" itemscope="" itemprop="rating">
<span itemprop="average"><?php echo $this->actRating; ?></span>
<span itemprop="best"><?php echo $this->maxRating; ?></span>
</span>
<span class="rating-microdata" itemprop="votes"><?php echo $this->votes; ?></span>
</div>
<!-- indexer::continue -->
<?php endif; ?>
<div class="<?php echo $this->class; ?> block"<?php echo $this->cssID; ?><?php if ($this->style): ?> style="<?php echo $this->style; ?>"<?php endif; ?>>
<?php if ($this->printable): ?>
<!-- indexer::stop -->
<div class="pdf_link">
<?php if ($this->printButton): ?>
<a href="<?php echo $this->print; ?>" rel="nofollow" title="<?php echo $this->printTitle; ?>" onclick="window.print();return false"><img src="<?php echo TL_FILES_URL; ?>assets/contao/images/print.gif" width="16" height="16" alt="" /></a>
<?php endif; ?>
<?php if ($this->pdfButton): ?>
<a href="<?php echo $this->href; ?>" rel="nofollow" title="<?php echo $this->pdfTitle; ?>"><img src="<?php echo TL_FILES_URL; ?>assets/contao/images/pdf.gif" width="16" height="16" alt="" /></a>
<?php endif; ?>
<?php if ($this->facebookButton): ?>
<a href="share/?p=facebook&amp;u=<?php echo $this->encUrl; ?>&amp;t=<?php echo $this->encTitle; ?>" rel="nofollow" title="<?php echo $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"><img src="<?php echo TL_FILES_URL; ?>assets/contao/images/facebook.gif" width="16" height="16" alt="" /></a>
<?php endif; ?>
<?php if ($this->twitterButton): ?>
<a href="share/?p=twitter&amp;u=<?php echo $this->encUrl; ?>&amp;t=<?php echo $this->encTitle; ?>" rel="nofollow" title="<?php echo $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"><img src="<?php echo TL_FILES_URL; ?>assets/contao/images/twitter.gif" width="16" height="16" alt="" /></a>
<?php endif; ?>
<?php if ($this->gplusButton): ?>
<a href="share/?p=gplus&amp;u=<?php echo $this->encUrl; ?>&amp;t=<?php echo $this->encTitle; ?>" rel="nofollow" title="<?php echo $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"><img src="<?php echo TL_FILES_URL; ?>assets/contao/images/gplus.gif" width="16" height="16" alt="" /></a>
<?php endif; ?>
</div>
<!-- indexer::continue -->
<?php endif; ?>
<?php echo implode($this->elements); ?>
<?php if ($this->backlink): ?>
<!-- indexer::stop -->
<p class="back"><a href="<?php echo $this->backlink; ?>" title="<?php echo $this->back; ?>"><?php echo $this->back; ?></a></p>
<!-- indexer::continue -->
<?php endif; ?>
</div>
<?php if ($this->rateit_rating_after): ?>
<!-- indexer::stop -->
<div itemtype="http://data-vocabulary.org/Review-aggregate" itemscope="" class="rating-microdata">
<div id="<?php echo $this->rateItID; ?>" 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="itemreviewed"><?php echo $this->itemreviewed; ?></span>
<span class="rating-microdata" itemtype="http://data-vocabulary.org/Rating" itemscope="" itemprop="rating">
<span itemprop="average"><?php echo $this->actRating; ?></span>
<span itemprop="best"><?php echo $this->maxRating; ?></span>
</span>
<span class="rating-microdata" itemprop="votes"><?php echo $this->votes; ?></span>
</div>
<!-- indexer::continue -->
<?php endif; ?>

View File

@ -0,0 +1,48 @@
<ul>
<?php foreach ($this->body as $class=>$row): ?>
<?php foreach ($row as $col): ?>
<?php if ($col->addImage): ?>
<li class="<?php echo $class; ?> <?php echo $col->class; ?>">
<figure class="image_container"<?php if ($col->margin): ?> style="<?php echo $col->margin; ?>"<?php endif; ?>>
<?php if ($col->href): ?>
<a href="<?php echo $col->href; ?>"<?php echo $col->attributes; ?> title="<?php echo $col->alt; ?>"><img src="<?php echo $col->src; ?>"<?php echo $col->imgSize; ?> alt="<?php echo $col->alt; ?>"></a>
<?php else: ?>
<img src="<?php echo $col->src; ?>"<?php echo $col->imgSize; ?> alt="<?php echo $col->alt; ?>">
<?php endif; ?>
<?php if ($col->caption): ?>
<figcaption class="caption" style="width:<?php echo $col->arrSize[0]; ?>px"><?php echo $col->caption; ?></figcaption>
<?php endif; ?>
</figure>
<!-- indexer::stop -->
<div id="<?php echo $this->arrRating[$col->singleSRC]['rateItID']; ?>" class="<?php echo $this->arrRating[$col->singleSRC]['rateit_class']; ?>">
<?php if ($this->arrRating[$col->singleSRC]['showBefore']) : ?>
<div id="<?php echo $this->arrRating[$col->singleSRC]['descriptionId']; ?>" class="ratingText"><?php echo $this->arrRating[$col->singleSRC]['description']; ?></div>
<?php endif; ?>
<div class="wrapper">
<div class="rateItRating-selected" style="display: block;"></div>
<div class="rateItRating-hover"></div>
</div>
<?php if ($this->arrRating[$col->singleSRC]['showAfter']) : ?>
<div id="<?php echo $this->arrRating[$col->singleSRC]['descriptionId']; ?>" class="ratingText"><?php echo $this->arrRating[$col->singleSRC]['description']; ?></div>
<?php endif; ?>
</div>
<!-- indexer::continue -->
</li>
<?php endif; ?>
<?php endforeach; ?>
<?php endforeach; ?>
</ul>
<script>
var arrRatings = new Array();
<?php $i = 0; ?>
<?php foreach ($this->arrRating as $url=>$rating): ?>
arrRatings[<?php echo $i;?>] = new Object();
arrRatings[<?php echo $i;?>]["URL"] = "<?php echo $url; ?>";
arrRatings[<?php echo $i;?>]["rated"] = false;
<?php foreach ($rating as $key=>$value): ?>
arrRatings[<?php echo $i;?>]["<?php echo $key; ?>"] = "<?php echo $value; ?>";
<?php endforeach; ?>
<?php $i = $i + 1; ?>
<?php endforeach; ?>
</script>

View File

@ -0,0 +1,50 @@
<ul>
<?php foreach ($this->body as $class=>$row): ?>
<?php foreach ($row as $col): ?>
<?php if ($col->addImage): ?>
<li class="<?php echo $class; ?> <?php echo $col->class; ?>">
<div class="image_container"<?php if ($col->margin): ?> style="<?php echo $col->margin; ?>"<?php endif; ?>>
<?php if ($col->href): ?>
<a href="<?php echo $col->href; ?>"<?php echo $col->attributes; ?> title="<?php echo $col->alt; ?>"><img src="<?php echo $col->src; ?>"<?php echo $col->imgSize; ?> alt="<?php echo $col->alt; ?>" /></a>
<?php else: ?>
<img src="<?php echo $col->src; ?>"<?php echo $col->imgSize; ?> alt="<?php echo $col->alt; ?>" />
<?php endif; ?>
<?php if ($col->caption): ?>
<div class="caption" style="width:<?php echo $col->arrSize[0]; ?>px"><?php echo $col->caption; ?></div>
<?php endif; ?>
</div>
<!-- indexer::stop -->
<div id="<?php echo $this->arrRating[$col->singleSRC]['rateItID']; ?>" class="<?php echo $this->arrRating[$col->singleSRC]['rateit_class']; ?>">
<?php if ($this->arrRating[$col->singleSRC]['showBefore']) : ?>
<div id="<?php echo $this->arrRating[$col->singleSRC]['descriptionId']; ?>" class="ratingText"><?php echo $this->arrRating[$col->singleSRC]['description']; ?></div>
<?php endif; ?>
<div class="wrapper">
<div class="rateItRating-selected" style="display: block;"></div>
<div class="rateItRating-hover"></div>
</div>
<?php if ($this->arrRating[$col->singleSRC]['showAfter']) : ?>
<div id="<?php echo $this->arrRating[$col->singleSRC]['descriptionId']; ?>" class="ratingText"><?php echo $this->arrRating[$col->singleSRC]['description']; ?></div>
<?php endif; ?>
</div>
<!-- indexer::continue -->
</li>
<?php endif; ?>
<?php endforeach; ?>
<?php endforeach; ?>
</ul>
<script type="text/javascript">
/* <![CDATA[ */
var arrRatings = new Array();
<?php $i = 0; ?>
<?php foreach ($this->arrRating as $url=>$rating): ?>
arrRatings[<?php echo $i;?>] = new Object();
arrRatings[<?php echo $i;?>]["URL"] = "<?php echo $url; ?>";
arrRatings[<?php echo $i;?>]["rated"] = false;
<?php foreach ($rating as $key=>$value): ?>
arrRatings[<?php echo $i;?>]["<?php echo $key; ?>"] = "<?php echo $value; ?>";
<?php endforeach; ?>
<?php $i = $i + 1; ?>
<?php endforeach; ?>
/* ]]> */
</script>

View File

@ -0,0 +1,27 @@
<?php
// Add the colorbox style sheet
$GLOBALS['TL_CSS'][] = 'assets/jquery/colorbox/'. COLORBOX .'/css/colorbox.min.css||static';
?>
<script src="system/modules/rateit/public/js/jquery/colorbox/colorbox-rateit.min.js"></script>
<script>
(function($) {
$(document).ready(function() {
$('a[data-lightbox]').map(function() {
$(this).colorbox({
// Put custom options here
loop: false,
rel: $(this).attr('data-lightbox'),
maxWidth: '95%',
maxHeight: '95%'
});
});
});
String.prototype.endsWith = function(suffix) {
return this.indexOf(suffix, this.length - suffix.length) !== -1;
};
})(jQuery);
</script>

View File

@ -0,0 +1,26 @@
<?php
// Add the colorbox style sheet
$GLOBALS['TL_CSS'][] = 'assets/jquery/colorbox/'. COLORBOX .'/css/colorbox.min.css||static';
?>
<script type="text/javascript" src="system/modules/rateit/public/js/jquery/colorbox/colorbox-rateit.min.js"></script>
<script type="text/javascript">
/* <![CDATA[ */
(function($) {
$(document).ready(function() {
$('a[rel^=lightbox]').colorbox({
// Put custom options here
loop: false,
maxWidth: '95%',
maxHeight: '95%'
});
});
String.prototype.endsWith = function(suffix) {
return this.indexOf(suffix, this.length - suffix.length) !== -1;
};
})(jQuery);
/* ]]> */
</script>

View File

@ -0,0 +1,48 @@
<div class="<?php echo $this->class; ?> block"<?php echo $this->cssID; ?><?php if ($this->style): ?> style="<?php echo $this->style; ?>"<?php endif; ?>>
<?php if ($this->headline): ?>
<<?php echo $this->hl; ?>><?php echo $this->headline; ?></<?php echo $this->hl; ?>>
<?php endif; ?>
<ul>
<?php foreach ($this->articles as $article): ?>
<li>
<?php if ($article['rateit_rating_before']): ?>
<!-- indexer::stop -->
<div id="<?php echo $article['rateItID']; ?>" class="<?php echo $article['rateit_class']; ?>">
<?php if ($article['showBefore']) : ?>
<div id="<?php echo $article['descriptionId']; ?>" class="ratingText"><?php echo $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="<?php echo $article['descriptionId']; ?>" class="ratingText"><?php echo $article['description']; ?></div>
<?php endif; ?>
</div>
<!-- indexer::continue -->
<?php endif; ?>
<a href="<?php echo $this->request; ?>#<?php echo $article['id']; ?>" title="<?php echo $article['title']; ?>"><?php echo $article['link']; ?></a>
<?php if ($article['rateit_rating_after']): ?>
<!-- indexer::stop -->
<div id="<?php echo $article['rateItID']; ?>" class="<?php echo $article['rateit_class']; ?>">
<?php if ($article['showBefore']) : ?>
<div id="<?php echo $article['descriptionId']; ?>" class="ratingText"><?php echo $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="<?php echo $article['descriptionId']; ?>" class="ratingText"><?php echo $article['description']; ?></div>
<?php endif; ?>
</div>
<!-- indexer::continue -->
<?php endif; ?>
</li>
<?php endforeach; ?>
</ul>
</div>

View File

@ -0,0 +1,46 @@
<div class="<?php echo $this->class; ?> block"<?php echo $this->cssID; ?><?php if ($this->style): ?> style="<?php echo $this->style; ?>"<?php endif; ?>>
<?php if ($this->headline): ?>
<<?php echo $this->hl; ?>><?php echo $this->headline; ?></<?php echo $this->hl; ?>>
<?php endif; ?>
<ul>
<?php foreach ($this->articles as $article): ?>
<?php if ($article['rateit_rating_before']): ?>
<!-- indexer::stop -->
<div id="<?php echo $article['rateItID']; ?>" class="<?php echo $article['rateit_class']; ?>">
<?php if ($article['showBefore']) : ?>
<div id="<?php echo $article['descriptionId']; ?>" class="ratingText"><?php echo $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="<?php echo $article['descriptionId']; ?>" class="ratingText"><?php echo $article['description']; ?></div>
<?php endif; ?>
</div>
<!-- indexer::continue -->
<?php endif; ?>
<li><a href="<?php echo $this->request; ?>#<?php echo $article['id']; ?>" title="<?php echo $article['title']; ?>"><?php echo $article['link']; ?></a></li>
<?php if ($article['rateit_rating_after']): ?>
<!-- indexer::stop -->
<div id="<?php echo $article['rateItID']; ?>" class="<?php echo $article['rateit_class']; ?>">
<?php if ($article['showBefore']) : ?>
<div id="<?php echo $article['descriptionId']; ?>" class="ratingText"><?php echo $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="<?php echo $article['descriptionId']; ?>" class="ratingText"><?php echo $article['description']; ?></div>
<?php endif; ?>
</div>
<!-- indexer::continue -->
<?php endif; ?>
<?php endforeach; ?>
</ul>
</div>

View File

@ -0,0 +1,64 @@
<article class="<?php echo $this->class; ?> block"<?php echo $this->cssID; ?><?php if ($this->style): ?> style="<?php echo $this->style; ?>"<?php endif; ?>>
<?php if ($this->rateit_rating_before): ?>
<!-- indexer::stop -->
<div itemtype="http://data-vocabulary.org/Review-aggregate" itemscope="" class="rating-microdata">
<div id="<?php echo $this->rateItID; ?>" 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="itemreviewed"><?php echo $this->itemreviewed; ?></span>
<span class="rating-microdata" itemtype="http://data-vocabulary.org/Rating" itemscope="" itemprop="rating">
<span itemprop="average"><?php echo $this->actRating; ?></span>
<span itemprop="best"><?php echo $this->maxRating; ?></span>
</span>
<span class="rating-microdata" itemprop="votes"><?php echo $this->votes; ?></span>
</div>
<!-- indexer::continue -->
<?php endif; ?>
<div class="ce_text block">
<h2><?php echo $this->headline; ?></h2>
<div class="teaser">
<?php echo $this->teaser; ?>
<p class="more"><a href="<?php echo $this->href; ?>" title="<?php echo $this->readMore; ?>"><?php echo $this->more; ?> <span class="invisible"><?php echo $this->headline; ?></span></a></p>
</div>
</div>
<?php if ($this->rateit_rating_after): ?>
<!-- indexer::stop -->
<div itemtype="http://data-vocabulary.org/Review-aggregate" itemscope="" class="rating-microdata">
<div id="<?php echo $this->rateItID; ?>" 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="itemreviewed"><?php echo $this->itemreviewed; ?></span>
<span class="rating-microdata" itemtype="http://data-vocabulary.org/Rating" itemscope="" itemprop="rating">
<span itemprop="average"><?php echo $this->actRating; ?></span>
<span itemprop="best"><?php echo $this->maxRating; ?></span>
</span>
<span class="rating-microdata" itemprop="votes"><?php echo $this->votes; ?></span>
</div>
<!-- indexer::continue -->
<?php endif; ?>
</article>

View File

@ -0,0 +1,64 @@
<div class="<?php echo $this->class; ?> block"<?php echo $this->cssID; ?><?php if ($this->style): ?> style="<?php echo $this->style; ?>"<?php endif; ?>>
<?php if ($this->rateit_rating_before): ?>
<!-- indexer::stop -->
<div itemtype="http://data-vocabulary.org/Review-aggregate" itemscope="" class="rating-microdata">
<div id="<?php echo $this->rateItID; ?>" 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="itemreviewed"><?php echo $this->itemreviewed; ?></span>
<span class="rating-microdata" itemtype="http://data-vocabulary.org/Rating" itemscope="" itemprop="rating">
<span itemprop="average"><?php echo $this->actRating; ?></span>
<span itemprop="best"><?php echo $this->maxRating; ?></span>
</span>
<span class="rating-microdata" itemprop="votes"><?php echo $this->votes; ?></span>
</div>
<!-- indexer::continue -->
<?php endif; ?>
<div class="ce_text block">
<h2><?php echo $this->headline; ?></h2>
<div class="teaser">
<?php echo $this->teaser; ?>
<p class="more"><a href="<?php echo $this->href; ?>" title="<?php echo $this->readMore; ?>"><?php echo $this->more; ?> <span class="invisible"><?php echo $this->headline; ?></span></a></p>
</div>
</div>
<?php if ($this->rateit_rating_after): ?>
<!-- indexer::stop -->
<div itemtype="http://data-vocabulary.org/Review-aggregate" itemscope="" class="rating-microdata">
<div id="<?php echo $this->rateItID; ?>" 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="itemreviewed"><?php echo $this->itemreviewed; ?></span>
<span class="rating-microdata" itemtype="http://data-vocabulary.org/Rating" itemscope="" itemprop="rating">
<span itemprop="average"><?php echo $this->actRating; ?></span>
<span itemprop="best"><?php echo $this->maxRating; ?></span>
</span>
<span class="rating-microdata" itemprop="votes"><?php echo $this->votes; ?></span>
</div>
<!-- indexer::continue -->
<?php endif; ?>
</div>

View File

@ -0,0 +1,48 @@
<article class="<?php echo $this->class; ?> block"<?php echo $this->cssID; ?><?php if ($this->style): ?> style="<?php echo $this->style; ?>"<?php endif; ?>>
<?php if ($this->rateit_rating_before): ?>
<!-- indexer::stop -->
<div id="<?php echo $this->rateItID; ?>" 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>
<!-- indexer::continue -->
<?php endif; ?>
<div class="ce_text block">
<h2><?php echo $this->headline; ?></h2>
<div class="teaser">
<?php echo $this->teaser; ?>
<p class="more"><a href="<?php echo $this->href; ?>" title="<?php echo $this->readMore; ?>"><?php echo $this->more; ?> <span class="invisible"><?php echo $this->headline; ?></span></a></p>
</div>
</div>
<?php if ($this->rateit_rating_after): ?>
<!-- indexer::stop -->
<div id="<?php echo $this->rateItID; ?>" 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>
<!-- indexer::continue -->
<?php endif; ?>
</article>

View File

@ -0,0 +1,48 @@
<div class="<?php echo $this->class; ?> block"<?php echo $this->cssID; ?><?php if ($this->style): ?> style="<?php echo $this->style; ?>"<?php endif; ?>>
<?php if ($this->rateit_rating_before): ?>
<!-- indexer::stop -->
<div id="<?php echo $this->rateItID; ?>" 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>
<!-- indexer::continue -->
<?php endif; ?>
<div class="ce_text block">
<h2><?php echo $this->headline; ?></h2>
<div class="teaser">
<?php echo $this->teaser; ?>
<p class="more"><a href="<?php echo $this->href; ?>" title="<?php echo $this->readMore; ?>"><?php echo $this->more; ?> <span class="invisible"><?php echo $this->headline; ?></span></a></p>
</div>
</div>
<?php if ($this->rateit_rating_after): ?>
<!-- indexer::stop -->
<div id="<?php echo $this->rateItID; ?>" 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>
<!-- indexer::continue -->
<?php endif; ?>
</div>

View File

@ -0,0 +1,25 @@
<div class="<?php echo $this->class; ?> block"<?php echo $this->cssID; ?><?php if ($this->style): ?> style="<?php echo $this->style; ?>"<?php endif; ?>>
<?php if ($this->headline): ?>
<<?php echo $this->hl; ?>><?php echo $this->headline; ?></<?php echo $this->hl; ?>>
<?php endif; ?>
<ul>
<?php foreach ($this->arrRatings as $rating): ?>
<li>
<!-- indexer::stop -->
<div class="rateItTitle"><?php echo $rating->title; ?></div>
<div id="<?php echo $rating->rateItID; ?>" class="<?php echo $rating->rateit_class; ?>" rel="<?php echo $rating->rel; ?>">
<div class="wrapper">
<div class="rateItRating-selected" style="display: block;"></div>
<div class="rateItRating-hover"></div>
</div>
<div id="<?php echo $rating->descriptionId; ?>" class="ratingText"><?php echo $rating->description; ?></div>
</div>
<!-- indexer::continue -->
</li>
<?php endforeach; ?>
</ul>
</div>

View File

@ -0,0 +1,25 @@
<div class="<?php echo $this->class; ?> block"<?php echo $this->cssID; ?><?php if ($this->style): ?> style="<?php echo $this->style; ?>"<?php endif; ?>>
<?php if ($this->headline): ?>
<<?php echo $this->hl; ?>><?php echo $this->headline; ?></<?php echo $this->hl; ?>>
<?php endif; ?>
<ul>
<?php foreach ($this->arrRatings as $rating): ?>
<li>
<!-- indexer::stop -->
<div class="rateItTitle"><?php echo $rating->title; ?></div>
<div id="<?php echo $rating->rateItID; ?>" class="<?php echo $rating->rateit_class; ?>" rel="<?php echo $rating->rel; ?>">
<div class="wrapper">
<div class="rateItRating-selected" style="display: block;"></div>
<div class="rateItRating-hover"></div>
</div>
<div id="<?php echo $rating->descriptionId; ?>" class="ratingText"><?php echo $rating->description; ?></div>
</div>
<!-- indexer::continue -->
</li>
<?php endforeach; ?>
</ul>
</div>

View File

@ -0,0 +1,32 @@
<?php
// Add the mediabox style sheet
$GLOBALS['TL_CSS'][] = 'assets/mootools/mediabox/'. MEDIABOX .'/css/mediaboxAdvBlack21.css||static';
?>
<script src="system/modules/rateit/public/js/mootools/mediabox/mediabox-rateit.js"></script>
<script>
(function($) {
window.addEvent('domready', function() {
var links = $$('a').filter(function(el) {
return el.getAttribute('data-lightbox') != null;
});
$$(links).mediabox({
// Put custom options here
}, function(el) {
return [el.href, el.title, el.getAttribute('data-lightbox')];
}, function(el) {
var data = this.getAttribute('data-lightbox').split(' ');
return (this == el) || (data[0] && el.getAttribute('data-lightbox').match(data[0]));
});
$('mbImage').addEvent('swipe', function(e) {
(e.direction == 'left') ? $('mbNextLink').fireEvent('click') : $('mbPrevLink').fireEvent('click');
});
});
String.prototype.endsWith = function(suffix) {
return this.indexOf(suffix, this.length - suffix.length) !== -1;
};
})(document.id);
</script>

View File

@ -0,0 +1,33 @@
<?php
// Add the mediabox style sheet
$GLOBALS['TL_CSS'][] = 'assets/mootools/mediabox/'. MEDIABOX .'/css/mediaboxAdvBlack21.css||static';
?>
<script type="text/javascript" src="system/modules/rateit/public/js/mootools/mediabox/mediabox-rateit.js"></script>
<script type="text/javascript">
/* <![CDATA[ */
(function($) {
window.addEvent('domready', function() {
var links = $$('a').filter(function(el) {
return el.rel && el.rel.test(/^lightbox/i);
});
$$(links).mediabox({
/* Put custom options here */
}, null, function(el) {
var rel0 = this.rel.replace(/[[]|]/gi,' ');
var relsize = rel0.split(' ');
return (this == el) || ((this.rel.length > 8) && el.rel.match(relsize[1]));
});
$('mbImage').addEvent('swipe', function(e) {
(e.direction == 'left') ? $('mbNextLink').fireEvent('click') : $('mbPrevLink').fireEvent('click');
});
});
String.prototype.endsWith = function(suffix) {
return this.indexOf(suffix, this.length - suffix.length) !== -1;
};
})(document.id);
/* ]]> */
</script>

View File

@ -0,0 +1,90 @@
<?php if ($this->rateit_rating_before): ?>
<!-- indexer::stop -->
<div id="<?php echo $this->id; ?>" 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>
<!-- indexer::continue -->
<?php endif; ?>
<div class="layout_full block<?php echo $this->class; ?>">
<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://data-vocabulary.org/Review-aggregate" itemscope="" class="rating-microdata">
<div id="<?php echo $this->id; ?>" 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="itemreviewed"><?php echo $this->itemreviewed; ?></span>
<span class="rating-microdata" itemtype="http://data-vocabulary.org/Rating" itemscope="" itemprop="rating">
<span itemprop="average"><?php echo $this->actRating; ?></span>
<span itemprop="best"><?php echo $this->maxRating; ?></span>
</span>
<span class="rating-microdata" itemprop="votes"><?php echo $this->votes; ?></span>
</div>
<!-- indexer::continue -->
<?php endif; ?>

View File

@ -0,0 +1,90 @@
<?php if ($this->rateit_rating_before): ?>
<!-- indexer::stop -->
<div id="<?php echo $this->id; ?>" 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>
<!-- indexer::continue -->
<?php endif; ?>
<div class="layout_full block<?php echo $this->class; ?>">
<h1><?php echo $this->newsHeadline; ?></h1>
<?php if ($this->hasMetaFields): ?>
<p class="info"><?php echo $this->date; ?> <?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): ?>
<div 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): ?>
<div class="caption" style="width:<?php echo $this->arrSize[0]; ?>px"><?php echo $this->caption; ?></div>
<?php endif; ?>
</div>
<?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://data-vocabulary.org/Review-aggregate" itemscope="" class="rating-microdata">
<div id="<?php echo $this->id; ?>" 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="itemreviewed"><?php echo $this->itemreviewed; ?></span>
<span class="rating-microdata" itemtype="http://data-vocabulary.org/Rating" itemscope="" itemprop="rating">
<span itemprop="average"><?php echo $this->actRating; ?></span>
<span itemprop="best"><?php echo $this->maxRating; ?></span>
</span>
<span class="rating-microdata" itemprop="votes"><?php echo $this->votes; ?></span>
</div>
<!-- indexer::continue -->
<?php endif; ?>

View File

@ -0,0 +1,99 @@
<?php if ($this->rateit_rating_before): ?>
<!-- indexer::stop -->
<div itemtype="http://data-vocabulary.org/Review-aggregate" itemscope="" class="rating-microdata">
<div id="<?php echo $this->id; ?>" 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="itemreviewed"><?php echo $this->itemreviewed; ?></span>
<span class="rating-microdata" itemtype="http://data-vocabulary.org/Rating" itemscope="" itemprop="rating">
<span itemprop="average"><?php echo $this->actRating; ?></span>
<span itemprop="best"><?php echo $this->maxRating; ?></span>
</span>
<span class="rating-microdata" itemprop="votes"><?php echo $this->votes; ?></span>
</div>
<!-- indexer::continue -->
<?php endif; ?>
<div class="layout_full block<?php echo $this->class; ?>">
<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://data-vocabulary.org/Review-aggregate" itemscope="" class="rating-microdata">
<div id="<?php echo $this->id; ?>" 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="itemreviewed"><?php echo $this->itemreviewed; ?></span>
<span class="rating-microdata" itemtype="http://data-vocabulary.org/Rating" itemscope="" itemprop="rating">
<span itemprop="average"><?php echo $this->actRating; ?></span>
<span itemprop="best"><?php echo $this->maxRating; ?></span>
</span>
<span class="rating-microdata" itemprop="votes"><?php echo $this->votes; ?></span>
</div>
<!-- indexer::continue -->
<?php endif; ?>

View File

@ -0,0 +1,99 @@
<?php if ($this->rateit_rating_before): ?>
<!-- indexer::stop -->
<div itemtype="http://data-vocabulary.org/Review-aggregate" itemscope="" class="rating-microdata">
<div id="<?php echo $this->id; ?>" 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="itemreviewed"><?php echo $this->itemreviewed; ?></span>
<span class="rating-microdata" itemtype="http://data-vocabulary.org/Rating" itemscope="" itemprop="rating">
<span itemprop="average"><?php echo $this->actRating; ?></span>
<span itemprop="best"><?php echo $this->maxRating; ?></span>
</span>
<span class="rating-microdata" itemprop="votes"><?php echo $this->votes; ?></span>
</div>
<!-- indexer::continue -->
<?php endif; ?>
<div class="layout_full block<?php echo $this->class; ?>">
<h1><?php echo $this->newsHeadline; ?></h1>
<?php if ($this->hasMetaFields): ?>
<p class="info"><?php echo $this->date; ?> <?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): ?>
<div 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): ?>
<div class="caption" style="width:<?php echo $this->arrSize[0]; ?>px"><?php echo $this->caption; ?></div>
<?php endif; ?>
</div>
<?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://data-vocabulary.org/Review-aggregate" itemscope="" class="rating-microdata">
<div id="<?php echo $this->id; ?>" 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="itemreviewed"><?php echo $this->itemreviewed; ?></span>
<span class="rating-microdata" itemtype="http://data-vocabulary.org/Rating" itemscope="" itemprop="rating">
<span itemprop="average"><?php echo $this->actRating; ?></span>
<span itemprop="best"><?php echo $this->maxRating; ?></span>
</span>
<span class="rating-microdata" itemprop="votes"><?php echo $this->votes; ?></span>
</div>
<!-- indexer::continue -->
<?php endif; ?>

View File

@ -0,0 +1,69 @@
<?php if ($this->rateit_rating_before): ?>
<!-- indexer::stop -->
<div id="<?php echo $this->id; ?>" 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>
<!-- indexer::continue -->
<?php endif; ?>
<div class="layout_latest block<?php echo $this->class; ?>">
<?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->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; ?>
<h2><?php echo $this->text ? $this->linkHeadline : $this->newsHeadline; ?></h2>
<div class="teaser">
<?php echo $this->teaser; ?>
</div>
<?php if ($this->text): ?>
<p class="more"><?php echo $this->more; ?></p>
<?php endif; ?>
</div>
<?php if ($this->rateit_rating_after): ?>
<!-- indexer::stop -->
<div itemtype="http://data-vocabulary.org/Review-aggregate" itemscope="" class="rating-microdata">
<div id="<?php echo $this->id; ?>" 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="itemreviewed"><?php echo $this->itemreviewed; ?></span>
<span class="rating-microdata" itemtype="http://data-vocabulary.org/Rating" itemscope="" itemprop="rating">
<span itemprop="average"><?php echo $this->actRating; ?></span>
<span itemprop="best"><?php echo $this->maxRating; ?></span>
</span>
<span class="rating-microdata" itemprop="votes"><?php echo $this->votes; ?></span>
</div>
<!-- indexer::continue -->
<?php endif; ?>

View File

@ -0,0 +1,69 @@
<?php if ($this->rateit_rating_before): ?>
<!-- indexer::stop -->
<div id="<?php echo $this->id; ?>" 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>
<!-- indexer::continue -->
<?php endif; ?>
<div class="layout_latest block<?php echo $this->class; ?>">
<?php if ($this->hasMetaFields): ?>
<p class="info"><?php echo $this->date; ?> <?php echo $this->author; ?> <?php echo $this->commentCount; ?></p>
<?php endif; ?>
<?php if ($this->addImage): ?>
<div 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): ?>
<div class="caption" style="width:<?php echo $this->arrSize[0]; ?>px"><?php echo $this->caption; ?></div>
<?php endif; ?>
</div>
<?php endif; ?>
<h2><?php echo $this->text ? $this->linkHeadline : $this->newsHeadline; ?></h2>
<div class="teaser">
<?php echo $this->teaser; ?>
</div>
<?php if ($this->text): ?>
<p class="more"><?php echo $this->more; ?></p>
<?php endif; ?>
</div>
<?php if ($this->rateit_rating_after): ?>
<!-- indexer::stop -->
<div itemtype="http://data-vocabulary.org/Review-aggregate" itemscope="" class="rating-microdata">
<div id="<?php echo $this->id; ?>" 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="itemreviewed"><?php echo $this->itemreviewed; ?></span>
<span class="rating-microdata" itemtype="http://data-vocabulary.org/Rating" itemscope="" itemprop="rating">
<span itemprop="average"><?php echo $this->actRating; ?></span>
<span itemprop="best"><?php echo $this->maxRating; ?></span>
</span>
<span class="rating-microdata" itemprop="votes"><?php echo $this->votes; ?></span>
</div>
<!-- indexer::continue -->
<?php endif; ?>

View File

@ -0,0 +1,77 @@
<?php if ($this->rateit_rating_before): ?>
<!-- indexer::stop -->
<div itemtype="http://data-vocabulary.org/Review-aggregate" itemscope="" class="rating-microdata">
<div id="<?php echo $this->id; ?>" 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="itemreviewed"><?php echo $this->itemreviewed; ?></span>
<span class="rating-microdata" itemtype="http://data-vocabulary.org/Rating" itemscope="" itemprop="rating">
<span itemprop="average"><?php echo $this->actRating; ?></span>
<span itemprop="best"><?php echo $this->maxRating; ?></span>
</span>
<span class="rating-microdata" itemprop="votes"><?php echo $this->votes; ?></span>
</div>
<!-- indexer::continue -->
<?php endif; ?>
<div class="layout_latest block<?php echo $this->class; ?>">
<?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->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; ?>
<h2><?php echo $this->text ? $this->linkHeadline : $this->newsHeadline; ?></h2>
<div class="teaser">
<?php echo $this->teaser; ?>
</div>
<?php if ($this->text): ?>
<p class="more"><?php echo $this->more; ?></p>
<?php endif; ?>
</div>
<?php if ($this->rateit_rating_after): ?>
<!-- indexer::stop -->
<div itemtype="http://data-vocabulary.org/Review-aggregate" itemscope="" class="rating-microdata">
<div id="<?php echo $this->id; ?>" 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="itemreviewed"><?php echo $this->itemreviewed; ?></span>
<span class="rating-microdata" itemtype="http://data-vocabulary.org/Rating" itemscope="" itemprop="rating">
<span itemprop="average"><?php echo $this->actRating; ?></span>
<span itemprop="best"><?php echo $this->maxRating; ?></span>
</span>
<span class="rating-microdata" itemprop="votes"><?php echo $this->votes; ?></span>
</div>
<!-- indexer::continue -->
<?php endif; ?>

View File

@ -0,0 +1,77 @@
<?php if ($this->rateit_rating_before): ?>
<!-- indexer::stop -->
<div itemtype="http://data-vocabulary.org/Review-aggregate" itemscope="" class="rating-microdata">
<div id="<?php echo $this->id; ?>" 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="itemreviewed"><?php echo $this->itemreviewed; ?></span>
<span class="rating-microdata" itemtype="http://data-vocabulary.org/Rating" itemscope="" itemprop="rating">
<span itemprop="average"><?php echo $this->actRating; ?></span>
<span itemprop="best"><?php echo $this->maxRating; ?></span>
</span>
<span class="rating-microdata" itemprop="votes"><?php echo $this->votes; ?></span>
</div>
<!-- indexer::continue -->
<?php endif; ?>
<div class="layout_latest block<?php echo $this->class; ?>">
<?php if ($this->hasMetaFields): ?>
<p class="info"><?php echo $this->date; ?> <?php echo $this->author; ?> <?php echo $this->commentCount; ?></p>
<?php endif; ?>
<?php if ($this->addImage): ?>
<div 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): ?>
<div class="caption" style="width:<?php echo $this->arrSize[0]; ?>px"><?php echo $this->caption; ?></div>
<?php endif; ?>
</div>
<?php endif; ?>
<h2><?php echo $this->text ? $this->linkHeadline : $this->newsHeadline; ?></h2>
<div class="teaser">
<?php echo $this->teaser; ?>
</div>
<?php if ($this->text): ?>
<p class="more"><?php echo $this->more; ?></p>
<?php endif; ?>
</div>
<?php if ($this->rateit_rating_after): ?>
<!-- indexer::stop -->
<div itemtype="http://data-vocabulary.org/Review-aggregate" itemscope="" class="rating-microdata">
<div id="<?php echo $this->id; ?>" 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="itemreviewed"><?php echo $this->itemreviewed; ?></span>
<span class="rating-microdata" itemtype="http://data-vocabulary.org/Rating" itemscope="" itemprop="rating">
<span itemprop="average"><?php echo $this->actRating; ?></span>
<span itemprop="best"><?php echo $this->maxRating; ?></span>
</span>
<span class="rating-microdata" itemprop="votes"><?php echo $this->votes; ?></span>
</div>
<!-- indexer::continue -->
<?php endif; ?>

View File

@ -0,0 +1,55 @@
<?php if ($this->rateit_rating_before): ?>
<!-- indexer::stop -->
<div id="<?php echo $this->id; ?>" 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>
<!-- indexer::continue -->
<?php endif; ?>
<div class="layout_short block<?php echo $this->class; ?>">
<?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; ?>
<h2><?php echo $this->text ? $this->linkHeadline : $this->newsHeadline; ?></h2>
<div class="teaser">
<?php echo $this->teaser; ?>
</div>
<?php if ($this->text): ?>
<p class="more"><?php echo $this->more; ?></p>
<?php endif; ?>
</div>
<?php if ($this->rateit_rating_after): ?>
<!-- indexer::stop -->
<div itemtype="http://data-vocabulary.org/Review-aggregate" itemscope="" class="rating-microdata">
<div id="<?php echo $this->id; ?>" 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="itemreviewed"><?php echo $this->itemreviewed; ?></span>
<span class="rating-microdata" itemtype="http://data-vocabulary.org/Rating" itemscope="" itemprop="rating">
<span itemprop="average"><?php echo $this->actRating; ?></span>
<span itemprop="best"><?php echo $this->maxRating; ?></span>
</span>
<span class="rating-microdata" itemprop="votes"><?php echo $this->votes; ?></span>
</div>
<!-- indexer::continue -->
<?php endif; ?>

Some files were not shown because too many files have changed in this diff Show More