Umzug zu gitlab
							
								
								
									
										113
									
								
								classes/DcaHelper.php
									
									
									
									
									
										Normal 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, $type) | ||||
| 						   ->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
									
								
							
							
						
						| @@ -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.min.css||static'; | ||||
| 			switch ($GLOBALS['TL_CONFIG']['rating_type']) { | ||||
| 				case 'hearts' : | ||||
| 					$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/heart.min.css||static'; | ||||
| 					break; | ||||
| 				default: | ||||
| 					$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/star.min.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.min.css||static'; | ||||
| 					switch ($GLOBALS['TL_CONFIG']['rating_type']) { | ||||
| 						case 'hearts' : | ||||
| 							$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/heart.min.css||static'; | ||||
| 							break; | ||||
| 						default: | ||||
| 							$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/star.min.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'], $objFiles->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.min.css||static'; | ||||
| 			switch ($GLOBALS['TL_CONFIG']['rating_type']) { | ||||
| 				case 'hearts' : | ||||
| 					$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/heart.min.css||static'; | ||||
| 					break; | ||||
| 				default: | ||||
| 					$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/star.min.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
									
								
							
							
						
						| @@ -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 | ||||
|  | ||||
| ?> | ||||
							
								
								
									
										797
									
								
								classes/RateItBackendModule.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @@ -0,0 +1,797 @@ | ||||
| <?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 .= '&'.$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->query($cntSql)->fetchRow(); | ||||
|  | ||||
| 		$arrRatingItems = $this->Database->query($sql)->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
									
								
							
							
						
						| @@ -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
									
								
							
							
						
						| @@ -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.min.css||static'; | ||||
| 				switch ($GLOBALS['TL_CONFIG']['rating_type']) { | ||||
| 					case 'hearts' : | ||||
| 						$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/heart.min.css||static'; | ||||
| 						break; | ||||
| 					default: | ||||
| 						$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/star.min.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
									
								
							
							
						
						| @@ -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
									
								
							
							
						
						| @@ -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&table=tl_module&act=edit&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.min.css||static'; | ||||
| 		switch ($this->strType) { | ||||
| 			case 'hearts' : | ||||
| 				$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/heart.min.css||static'; | ||||
| 				break; | ||||
| 			default: | ||||
| 				$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/star.min.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
									
								
							
							
						
						| @@ -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
									
								
							
							
						
						| @@ -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.min.css||static'; | ||||
| 			switch ($GLOBALS['TL_CONFIG']['rating_type']) { | ||||
| 				case 'hearts' : | ||||
| 					$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/heart.min.css||static'; | ||||
| 					break; | ||||
| 				default: | ||||
| 					$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/star.min.css||static'; | ||||
| 			} | ||||
| 		} | ||||
| 	} | ||||
| } | ||||
| ?> | ||||
							
								
								
									
										119
									
								
								classes/RateItPage.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @@ -0,0 +1,119 @@ | ||||
| <?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 generatePage($objPage, $objLayout, $objPageType) { | ||||
| 		if ($objPage->addRating) { | ||||
| 			$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(); | ||||
| 				 | ||||
| 				$objTemplate = $objPageType->Template; | ||||
| 				if ($objTemplate) { | ||||
| 					if ($objPage->rateit_position == 'after') { | ||||
| 						$objTemplate->main .= $rating; | ||||
| 					} else { | ||||
| 						$objTemplate->main = $rating.$objTemplate->main; | ||||
| 					} | ||||
| 				} | ||||
| 			} | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	private function includeCss() { | ||||
| 		$included = false; | ||||
| 		$strHeadTags = ''; | ||||
| 		if (is_array($GLOBALS['TL_CSS'])) { | ||||
| 			foreach ($GLOBALS['TL_CSS'] as $script) { | ||||
| 				if ($this->startsWith($script, 'system/modules/rateit/public/css/rateit') === true) { | ||||
| 					$included = true; | ||||
| 					break; | ||||
| 				} | ||||
| 			} | ||||
| 		} | ||||
|  | ||||
| 	    if (!$included) { | ||||
| 	    	$strHeadTags = '<link rel="stylesheet" href="'.$this->addStaticUrlTo('system/modules/rateit/public/css/rateit.min.css').'">'; | ||||
| 	    	switch ($GLOBALS['TL_CONFIG']['rating_type']) { | ||||
| 	    		case 'hearts' : | ||||
| 	    			$strHeadTags .= '<link rel="stylesheet" href="'.$this->addStaticUrlTo('system/modules/rateit/public/css/heart.min.css').'">'; | ||||
| 	    			break; | ||||
| 	    		default: | ||||
| 	    			$strHeadTags .= '<link rel="stylesheet" href="'.$this->addStaticUrlTo('system/modules/rateit/public/css/star.min.css').'">'; | ||||
| 	    	} | ||||
| 	    } | ||||
| 		return $strHeadTags; | ||||
| 	} | ||||
| 	 | ||||
| 	private function includeJs() { | ||||
| 		$included = false; | ||||
| 		$strHeadTags = ''; | ||||
| 		if (is_array($GLOBALS['TL_JAVASCRIPT'])) { | ||||
| 			foreach ($GLOBALS['TL_JAVASCRIPT'] as $script) { | ||||
| 				if ($this->startsWith($script, 'system/modules/rateit/public/js/rateit') === true) { | ||||
| 					$included = true; | ||||
| 					break; | ||||
| 				} | ||||
| 			} | ||||
| 		} | ||||
|  | ||||
| 	    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; | ||||
| 	} | ||||
| 	 | ||||
| 	function startsWith($haystack, $needle) { | ||||
| 	    // search backwards starting from haystack length characters from the end | ||||
| 	    return $needle === "" || strrpos($haystack, $needle, -strlen($haystack)) !== FALSE; | ||||
| 	} | ||||
| } | ||||
| ?> | ||||
							
								
								
									
										96
									
								
								classes/RateItRating.php
									
									
									
									
									
										Normal 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(); | ||||
| 	} | ||||
| } | ||||
|  | ||||
| ?> | ||||
							
								
								
									
										142
									
								
								classes/RateItTopRatingsModule.php
									
									
									
									
									
										Normal 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&table=tl_module&act=edit&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.min.css||static'; | ||||
| 		switch ($GLOBALS['TL_CONFIG']['rating_type']) { | ||||
| 			case 'hearts' : | ||||
| 				$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/heart.min.css||static'; | ||||
| 				break; | ||||
| 			default: | ||||
| 				$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/star.min.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
									
								
							
							
						
						
							
								
								
									
										47
									
								
								composer.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @@ -0,0 +1,47 @@ | ||||
| { | ||||
| 	"name":"cgo-it/rate-it", | ||||
| 	"description":"RateIt extension for the Contao Open Source CMS", | ||||
| 	"keywords":["contao", "rating", "rateit", "bewertung"], | ||||
| 	"type":"contao-module", | ||||
| 	"license":"LGPL-3.0+", | ||||
| 	"authors":[ | ||||
| 		{ | ||||
| 			"name":"cgo IT", | ||||
| 			"email":"info@cgo-it.de", | ||||
| 			"homepage":"https://cgo-it.de", | ||||
| 			"role":"Developer" | ||||
| 		} | ||||
| 	], | ||||
| 	"support": { | ||||
| 		"email": "info@cgo-it.de", | ||||
| 		"issues": "https://bitbucket.org/cgo-it/contao-rate-it/issues?status=new&status=open", | ||||
| 		"forum": "https://community.contao.org/de/showthread.php?38471-Rate-It", | ||||
| 		"source": "https://bitbucket.org/cgo-it/contao-rate-it/src" | ||||
| 	}, | ||||
| 	"require":{ | ||||
| 		"php":">=5.3", | ||||
| 		"contao/core":">=3.0", | ||||
| 		"contao-community-alliance/composer-plugin": "~2.0", | ||||
| 		"leounglaub/contao-simple-ajax":"3.2.x-dev", | ||||
| 		"cgo-it/xls_export":"3.0.0" | ||||
| 	}, | ||||
| 	"replace": { | ||||
| 		"cgo-it/rate-it": "<3.4.3" | ||||
| 	}, | ||||
|     "conflict": { | ||||
| 			"contao/core": "2.11.*" | ||||
| 	}, | ||||
| 	"extra":{ | ||||
| 		"contao": { | ||||
| 			"sources":{ | ||||
| 				"":"system/modules/rateit" | ||||
| 			}, | ||||
| 			"transifex":{ | ||||
| 				"project": "rateit", | ||||
| 				"prefix": "core-", | ||||
| 				"languages_cto": "languages", | ||||
| 				"languages_tx": "languages" | ||||
| 			} | ||||
| 		} | ||||
| 	} | ||||
| } | ||||
							
								
								
									
										7
									
								
								config/autoload.ini
									
									
									
									
									
										Normal 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
									
								
							
							
						
						| @@ -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
									
								
							
							
						
						| @@ -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']['generatePage'][]           = array('rateit\\RateItPage', 'generatePage'); | ||||
| $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
									
								
							
							
						
						| @@ -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
									
								
							
							
						
						| @@ -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'); | ||||
| 	} | ||||
| } | ||||
| ?> | ||||
							
								
								
									
										176
									
								
								dca/tl_content.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @@ -0,0 +1,176 @@ | ||||
| <?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'; | ||||
| 			 | ||||
| 			// Alle vorherigen Bilder erst mal auf inaktiv setzen | ||||
| 			$this->Database->prepare("UPDATE tl_rateit_items SET active='' WHERE rkey LIKE ? AND typ=?")->execute($dc->activeRecord->id.'|%', $type); | ||||
| 			 | ||||
| 			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, $objFiles->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") { | ||||
| 			$this->Database->prepare("DELETE FROM tl_rateit_ratings WHERE pid IN (SELECT `id` FROM tl_rateit_items WHERE rkey LIKE ? AND typ=?)") | ||||
| 			               ->execute($dc->activeRecord->id.'|%', 'galpic'); | ||||
| 			$this->Database->prepare("DELETE FROM tl_rateit_items WHERE rkey LIKE ? AND typ=?")->execute($dc->activeRecord->id.'|%', '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
									
								
							
							
						
						| @@ -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
									
								
							
							
						
						| @@ -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', 'news4ward'), | ||||
|   '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
									
								
							
							
						
						| @@ -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'); | ||||
| 	} | ||||
| } | ||||
| ?> | ||||
							
								
								
									
										101
									
								
								dca/tl_page.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @@ -0,0 +1,101 @@ | ||||
| <?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 | ||||
|  */ | ||||
| $GLOBALS['TL_DCA']['tl_page']['palettes']['__selector__'][] = 'addRating'; | ||||
| 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; | ||||
| } | ||||
|  | ||||
| /** | ||||
|  * Add subpalettes to tl_page | ||||
|  */ | ||||
| $GLOBALS['TL_DCA']['tl_page']['subpalettes']['addRating']  = 'rateit_position'; | ||||
|  | ||||
| // 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 ''", | ||||
|   'eval'           		   => array('tl_class'=>'w50 m12', 'submitOnChange'=>true) | ||||
| ); | ||||
|  | ||||
| $GLOBALS['TL_DCA']['tl_page']['fields']['rateit_position'] = array | ||||
| ( | ||||
|   'label'                  => &$GLOBALS['TL_LANG']['tl_page']['rateit_position'], | ||||
|   'default'                => 'before', | ||||
|   'exclude'                => true, | ||||
|   'inputType'              => 'select', | ||||
|   'options'                => array('after', 'before'), | ||||
|   'reference'              => &$GLOBALS['TL_LANG']['tl_page'], | ||||
|   'sql' 						   => "varchar(6) NOT NULL default ''", | ||||
|   'eval'                   => array('mandatory'=>true, 'tl_class'=>'w50') | ||||
| ); | ||||
|  | ||||
| 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
									
								
							
							
						
						| @@ -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
									
								
							
							
						
						| @@ -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
									
								
							
							
						
						| @@ -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(); | ||||
| 	} | ||||
| } | ||||
| ?> | ||||
							
								
								
									
										75
									
								
								languages/de/default.xlf
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @@ -0,0 +1,75 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2"> | ||||
|   <file datatype="php" date="2015-06-18T07:01:15+02:00" original="default" source-language="en" target-language="de"> | ||||
|     <body> | ||||
|       <trans-unit id="FMD.rateit.0"> | ||||
|         <source>Rate It</source> | ||||
|         <target>Rate It</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="FMD.rateit.1"> | ||||
|         <source>Enables users to leave ratings for articles, pages, news and FAQs.</source> | ||||
|         <target>Bietet Benutzern die Möglichkeit Bewertungen für Artikel, Seiten, News und FAQs abzugeben.</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="FMD.rateit_top_ratings.0"> | ||||
|         <source>Rate It - Best/Most ratings</source> | ||||
|         <target>Rate It - Beste/Meiste Bewertungen</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="FMD.rateit_top_ratings.1"> | ||||
|         <source>List of the x best ratings.</source> | ||||
|         <target>Auflistung der x besten Bewertungen als Liste.</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="CTE.rateit.0"> | ||||
|         <source>Rate It</source> | ||||
|         <target>Rate It</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="CTE.rateit.1"> | ||||
|         <source>Enables users to leave ratings for articles, pages, news and FAQs.</source> | ||||
|         <target>Bietet Benutzern die Möglichkeit Bewertungen für Artikel, Seiten, News und FAQs abzugeben.</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="rateit.rating_label.0"> | ||||
|         <source>vote</source> | ||||
|         <target>Stimme</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="rateit.rating_label.1"> | ||||
|         <source>votes</source> | ||||
|         <target>Stimmen</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="rateit.heart"> | ||||
|         <source>heart</source> | ||||
|         <target>Herz</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="rateit.hearts"> | ||||
|         <source>hearts</source> | ||||
|         <target>Herzen</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="rateit.star"> | ||||
|         <source>star</source> | ||||
|         <target>Stern</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="rateit.stars"> | ||||
|         <source>stars</source> | ||||
|         <target>Sterne</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="rateit.error.invalid_id"> | ||||
|         <source>ERROR: Invalid ID for rating given.</source> | ||||
|         <target>FEHLER: Ungültige ID für Rating angegeben.</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="rateit.error.invalid_rating"> | ||||
|         <source>ERROR: Invalid rating given.</source> | ||||
|         <target>FEHLER: Ungültiges Rating angegeben.</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="rateit.error.invalid_type"> | ||||
|         <source>ERROR: Invalid type for rating given.</source> | ||||
|         <target>FEHLER: Ungültiger Typ für Rating angegeben.</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="rateit.error.duplicate_vote"> | ||||
|         <source>ERROR: You may not vote more than once.</source> | ||||
|         <target>FEHLER: Sie dürfen nicht mehrfach abstimmen.</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="rateit.error.duplicate_rkey"> | ||||
|         <source>The unique identifier "% s" already exists for a rating. Please choose a different identifier.</source> | ||||
|         <target>Der eindeutige Bezeichner "%s" für ein Rating existiert bereits. Bitte wählen Sie einen anderen Bezeichner.</target> | ||||
|       </trans-unit> | ||||
|     </body> | ||||
|   </file> | ||||
| </xliff> | ||||
							
								
								
									
										15
									
								
								languages/de/modules.xlf
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @@ -0,0 +1,15 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2"> | ||||
|   <file datatype="php" date="2015-06-18T07:01:15+02:00" original="modules" source-language="en" target-language="de"> | ||||
|     <body> | ||||
|       <trans-unit id="MOD.rateit.0"> | ||||
|         <source>Rate It</source> | ||||
|         <target>Rate It</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="MOD.rateit.1"> | ||||
|         <source>View ratings for articles, pages, news and faqs</source> | ||||
|         <target>Bewertungen für Artikel, Seiten, News und FAQs ansehen</target> | ||||
|       </trans-unit> | ||||
|     </body> | ||||
|   </file> | ||||
| </xliff> | ||||
							
								
								
									
										303
									
								
								languages/de/rateit_backend.xlf
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @@ -0,0 +1,303 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2"> | ||||
|   <file datatype="php" date="2015-06-18T07:01:15+02:00" original="rateit_backend" source-language="en" target-language="de"> | ||||
|     <body> | ||||
|       <trans-unit id="tl_rateit.goback"> | ||||
|         <source>Back</source> | ||||
|         <target>Zurück</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.noratingsfound"> | ||||
|         <source>No matching ratings found.</source> | ||||
|         <target>Keine entsprechenden Bewertungen gefunden.</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.showdetails"> | ||||
|         <source>Detailview</source> | ||||
|         <target>Detailanzeige</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.byorder"> | ||||
|         <source>By %s</source> | ||||
|         <target>Nach %s</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.seltyp.0"> | ||||
|         <source>Type</source> | ||||
|         <target>Typ</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.seltyp.1"> | ||||
|         <source>Please choose the rating type.</source> | ||||
|         <target>Bitte wählen Sie den Bewertungs-Typ.</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.selactive.0"> | ||||
|         <source>Active/Inactive</source> | ||||
|         <target>Aktiv/Inaktiv</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.selactive.1"> | ||||
|         <source>Please choose whether you want to display only active or inactive ratings.</source> | ||||
|         <target>Bitte wählen Sie, ob Sie nur aktive bzw. inaktive Bewertungen anzeigen wollen.</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.typ.0"> | ||||
|         <source>Type</source> | ||||
|         <target>Typ</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.typ.1"> | ||||
|         <source>Rating type (rating for an "article", a "page", a "news" or a "faq")</source> | ||||
|         <target>Typ des Ratings (Rating für eine "Seite" oder einen "Artikel")</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.title.0"> | ||||
|         <source>Title</source> | ||||
|         <target>Titel</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.title.1"> | ||||
|         <source>Title of the article, page, news or faq, on which the rating is included.</source> | ||||
|         <target>Titel der Seite oder des Artikels, auf der/dem das Rating eingebunden ist.</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.createdat.0"> | ||||
|         <source>activated since</source> | ||||
|         <target>aktiviert seit</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.createdat.1"> | ||||
|         <source>Day from which this rating has been enabled in the format "%s"</source> | ||||
|         <target>Tag ab dem dieses Bewertung aktiviert gewesen ist im Format %s</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.status.0"> | ||||
|         <source>Status</source> | ||||
|         <target>Status</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.status.1"> | ||||
|         <source>Indicates whether this rating is currently enabled or not.</source> | ||||
|         <target>Gibt an, ob diese Bewertung derzeit aktiviert ist oder nicht.</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.rating.0"> | ||||
|         <source>Rating</source> | ||||
|         <target>Bewertung</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.rating.1"> | ||||
|         <source>actual rating</source> | ||||
|         <target>aktueller Bewertungsstand</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.overall_rating.0"> | ||||
|         <source>Overall rating</source> | ||||
|         <target>Gesamtbewertung</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.overall_rating.1"> | ||||
|         <source>actual overall rating</source> | ||||
|         <target>aktueller Gesamt-Bewertungsstand</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.totalratings.0"> | ||||
|         <source>Total votes</source> | ||||
|         <target>Anzahl Bewertungen</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.totalratings.1"> | ||||
|         <source>Number of votes for this rating</source> | ||||
|         <target>Anzahl der abgegebenen Stimmen für diese Bewertung</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.ratingfmt"> | ||||
|         <source>%s/%d (%d Votes)</source> | ||||
|         <target>%s/%d (%d Stimmen)</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.ratingviewfmt"> | ||||
|         <source>%s/%d</source> | ||||
|         <target>%s/%d</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.ratingstatisticsfmt"> | ||||
|         <source>Rating %s: %d of %d votes (corresponds %s%%)</source> | ||||
|         <target>Bewertung %s: %d von %d abgegebenen Bewertungen (entspricht %s%%)</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.statistics.0"> | ||||
|         <source>Statistics</source> | ||||
|         <target>Statistik</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.statistics.1"> | ||||
|         <source>Statistics</source> | ||||
|         <target>Statistik</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.rating_chart_legend.0"> | ||||
|         <source>Distribution of ratings</source> | ||||
|         <target>Verteilung der Bewertungen</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.rating_chart_legend.1"> | ||||
|         <source>Count of ratings</source> | ||||
|         <target>Anzahl Bewertungen</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.rating_chart_legend.2"> | ||||
|         <source>Rating</source> | ||||
|         <target>Bewertung</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.rating_chart_legend.3"> | ||||
|         <source>Count</source> | ||||
|         <target>Anzahl</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.month_chart_legend.0"> | ||||
|         <source>Ratings per month</source> | ||||
|         <target>abgegebene Bewertungen pro Monat</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.month_chart_legend.1"> | ||||
|         <source>Ratings per month</source> | ||||
|         <target>abgegebene Bewertungen pro Monat</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.month_chart_legend.2"> | ||||
|         <source>Average rating</source> | ||||
|         <target>durchschn. Bewertung</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.month_chart_legend.3"> | ||||
|         <source>Month</source> | ||||
|         <target>Monat</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.month_chart_legend.4"> | ||||
|         <source>Count</source> | ||||
|         <target>Anzahl</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.ratings.0"> | ||||
|         <source>Ratings</source> | ||||
|         <target>Abgegebene Bewertungen</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.ratings.1"> | ||||
|         <source>List of all ratings</source> | ||||
|         <target>Liste aller abgegebenen Bewertungen</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.ip.0"> | ||||
|         <source>IP address</source> | ||||
|         <target>IP-Adresse</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.member.0"> | ||||
|         <source>Frontend member</source> | ||||
|         <target>Frontend Benutzer</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.createdatdetail.0"> | ||||
|         <source>Valuation Point</source> | ||||
|         <target>Bewertungszeitpunkt</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.vote.0"> | ||||
|         <source>vote</source> | ||||
|         <target>Stimme</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.vote.1"> | ||||
|         <source>votes</source> | ||||
|         <target>Stimmen</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.clearratings"> | ||||
|         <source>Reset selected ratings</source> | ||||
|         <target>Markierte Bewertungen zurücksetzen</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit_type_options.page"> | ||||
|         <source>Page</source> | ||||
|         <target>Seite</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit_type_options.article"> | ||||
|         <source>Article</source> | ||||
|         <target>Artikel</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit_type_options.news"> | ||||
|         <source>News</source> | ||||
|         <target>Nachricht</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit_type_options.faq"> | ||||
|         <source>FAQ</source> | ||||
|         <target>FAQ</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit_type_options.ce"> | ||||
|         <source>Content element</source> | ||||
|         <target>Inhaltselement</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit_type_options.module"> | ||||
|         <source>Module</source> | ||||
|         <target>Modul</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit_type_options.galpic"> | ||||
|         <source>Gallery picture</source> | ||||
|         <target>Galerie-Bild</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit_type_options.news4ward"> | ||||
|         <source>Blog entry</source> | ||||
|         <target>Beitrag</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit_order_options.rating desc"> | ||||
|         <source>Rating</source> | ||||
|         <target>Bewertung</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit_order_options.title"> | ||||
|         <source>Title</source> | ||||
|         <target>Titel</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit_order_options.typ"> | ||||
|         <source>Type</source> | ||||
|         <target>Typ</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit_order_options.createdat"> | ||||
|         <source>Activation date</source> | ||||
|         <target>Aktivierungsdatum</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit_active_options.0"> | ||||
|         <source>inactive</source> | ||||
|         <target>inaktiv</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit_active_options.1"> | ||||
|         <source>active</source> | ||||
|         <target>aktiv</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.xls_sheetname_ratings"> | ||||
|         <source>Ratings</source> | ||||
|         <target>Bewertungen</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.xls_sheetname_rating"> | ||||
|         <source>Rating</source> | ||||
|         <target>Bewertung</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.xls_headers.rkey"> | ||||
|         <source>Rating-Key</source> | ||||
|         <target>Rating-Key</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.xls_headers.typ"> | ||||
|         <source>Type</source> | ||||
|         <target>Typ</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.xls_headers.title"> | ||||
|         <source>Title</source> | ||||
|         <target>Titel</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.xls_headers.createdat"> | ||||
|         <source>Activation date</source> | ||||
|         <target>Aktivierungszeitpunkt</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.xls_headers.active"> | ||||
|         <source>Active</source> | ||||
|         <target>Aktiv</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.xls_headers.rating"> | ||||
|         <source>Rating</source> | ||||
|         <target>Bewertung</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.xls_headers.stars"> | ||||
|         <source>Max. Rating</source> | ||||
|         <target>Max. Bewertung</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.xls_headers.percent"> | ||||
|         <source>Rating in percent</source> | ||||
|         <target>Bewertung in Prozent</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.xls_headers.totalRatings"> | ||||
|         <source>Total votes</source> | ||||
|         <target>Anzahl Bewertungen</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.xls_headers_detail.ip"> | ||||
|         <source>IP address</source> | ||||
|         <target>IP Adresse</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.xls_headers_detail.member"> | ||||
|         <source>Frontend member</source> | ||||
|         <target>Frontend Benutzer</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.xls_headers_detail.rating"> | ||||
|         <source>Rating</source> | ||||
|         <target>Bewertung</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.xls_headers_detail.percent"> | ||||
|         <source>Rating in percent</source> | ||||
|         <target>Bewertung in Prozent</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.xls_headers_detail.createdat"> | ||||
|         <source>Valuation Point</source> | ||||
|         <target>Bewertungszeitpunkt</target> | ||||
|       </trans-unit> | ||||
|     </body> | ||||
|   </file> | ||||
| </xliff> | ||||
							
								
								
									
										51
									
								
								languages/de/tl_article.xlf
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @@ -0,0 +1,51 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2"> | ||||
|   <file datatype="php" date="2015-06-18T07:01:15+02:00" original="tl_article" source-language="en" target-language="de"> | ||||
|     <body> | ||||
|       <trans-unit id="tl_article.rateit_legend"> | ||||
|         <source>Rate It-Settings</source> | ||||
|         <target>Rate It-Einstellungen</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_article.addRating.0"> | ||||
|         <source>activate rating</source> | ||||
|         <target>Rating aktivieren</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_article.addRating.1"> | ||||
|         <source>Enables the rating for this article</source> | ||||
|         <target>Aktiviert das Rating für diesen Artikel</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_article.rateit_position.0"> | ||||
|         <source>position</source> | ||||
|         <target>Position</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_article.rateit_position.1"> | ||||
|         <source>position of the rating (before or above) the article.</source> | ||||
|         <target>Position des Rating (ober- oder unterhalb) des Artikels.</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_article.rateit_template.0"> | ||||
|         <source>Template</source> | ||||
|         <target>Template</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_article.rateit_template.1"> | ||||
|         <source>Here you can select the template for the article's rating.</source> | ||||
|         <target>Hier können Sie das Template für die Bewertung des Artikels auswählen.</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_article.before.0"> | ||||
|         <source>above</source> | ||||
|         <target>oberhalb</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_article.before.1"> | ||||
|         <source>Display the text above the article</source> | ||||
|         <target>Anzeige des Texts oberhalb des Artikels</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_article.after.0"> | ||||
|         <source>below</source> | ||||
|         <target>unterhalb</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_article.after.1"> | ||||
|         <source>Display the text below the article</source> | ||||
|         <target>Anzeige des Texts unterhalb des Artikels</target> | ||||
|       </trans-unit> | ||||
|     </body> | ||||
|   </file> | ||||
| </xliff> | ||||
							
								
								
									
										27
									
								
								languages/de/tl_content.xlf
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @@ -0,0 +1,27 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2"> | ||||
|   <file datatype="php" date="2015-06-18T07:01:15+02:00" original="tl_content" source-language="en" target-language="de"> | ||||
|     <body> | ||||
|       <trans-unit id="tl_content.rateit_legend"> | ||||
|         <source>Rate It-Settings</source> | ||||
|         <target>Rate It-Einstellungen</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_content.rateit_title.0"> | ||||
|         <source>Rating title</source> | ||||
|         <target>Titel der Bewertung</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_content.rateit_title.1"> | ||||
|         <source>Rating title (shown in backend).</source> | ||||
|         <target>Titel der Bewertung (wird im Backend angezeigt).</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_content.rateit_active.0"> | ||||
|         <source>Active</source> | ||||
|         <target>Aktiv</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_content.rateit_active.1"> | ||||
|         <source>Active means that the review is visible to the front-end users.</source> | ||||
|         <target>Aktiv bedeutet, dass die Bewertung sichtbar für den Frontend-Nutzer ist.</target> | ||||
|       </trans-unit> | ||||
|     </body> | ||||
|   </file> | ||||
| </xliff> | ||||
							
								
								
									
										43
									
								
								languages/de/tl_faq.xlf
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @@ -0,0 +1,43 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2"> | ||||
|   <file datatype="php" date="2015-06-18T07:01:15+02:00" original="tl_faq" source-language="en" target-language="de"> | ||||
|     <body> | ||||
|       <trans-unit id="tl_faq.rating_legend"> | ||||
|         <source>Rate It-Settings</source> | ||||
|         <target>Rate It-Einstellungen</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_faq.addRating.0"> | ||||
|         <source>activate rating</source> | ||||
|         <target>Rating aktivieren</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_faq.addRating.1"> | ||||
|         <source>Enables the rating for this news article</source> | ||||
|         <target>Aktiviert das Rating für diese FAQ</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_faq.rateit_position.0"> | ||||
|         <source>position</source> | ||||
|         <target>Position</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_faq.rateit_position.1"> | ||||
|         <source>position of the rating (before or above) the FAQ entry.</source> | ||||
|         <target>Position des Rating (ober- oder unterhalb) des FAQ-Beitrags.</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_faq.before.0"> | ||||
|         <source>above</source> | ||||
|         <target>oberhalb</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_faq.before.1"> | ||||
|         <source>Display the text above the FAQ entry</source> | ||||
|         <target>Anzeige des Texts oberhalb des FAQ-Beitrags</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_faq.after.0"> | ||||
|         <source>below</source> | ||||
|         <target>unterhalb</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_faq.after.1"> | ||||
|         <source>Display the text below the FAQ entry</source> | ||||
|         <target>Anzeige des Texts unterhalb des FAQ-Beitrags</target> | ||||
|       </trans-unit> | ||||
|     </body> | ||||
|   </file> | ||||
| </xliff> | ||||
							
								
								
									
										99
									
								
								languages/de/tl_module.xlf
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @@ -0,0 +1,99 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2"> | ||||
|   <file datatype="php" date="2015-06-18T07:01:15+02:00" original="tl_module" source-language="en" target-language="de"> | ||||
|     <body> | ||||
|       <trans-unit id="tl_module.rateit_legend"> | ||||
|         <source>Rate It-Settings</source> | ||||
|         <target>Rate It-Einstellungen</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_module.rateit_title.0"> | ||||
|         <source>Rating title</source> | ||||
|         <target>Titel der Bewertung</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_module.rateit_title.1"> | ||||
|         <source>Rating title (shown in backend).</source> | ||||
|         <target>Titel der Bewertung (wird im Backend angezeigt).</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_module.rateit_active.0"> | ||||
|         <source>Active</source> | ||||
|         <target>Aktiv</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_module.rateit_active.1"> | ||||
|         <source>Active means that the review is visible to the front-end users.</source> | ||||
|         <target>Aktiv bedeutet, dass die Bewertung sichtbar für den Frontend-Nutzer ist.</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_module.rateit_types.0"> | ||||
|         <source>Types</source> | ||||
|         <target>Typen</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_module.rateit_types.1"> | ||||
|         <source>Select the types for which you would like the best ratings to be displayed.</source> | ||||
|         <target>Art der Bewertung</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_module.rateit_count.0"> | ||||
|         <source>Max. count</source> | ||||
|         <target>Max. Anzahl</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_module.rateit_count.1"> | ||||
|         <source>Max. count of displayed values.</source> | ||||
|         <target>Max. Anzahl anzuzeigender Einträge.</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_module.rateit_toptype.0"> | ||||
|         <source>List type</source> | ||||
|         <target>Art der Liste</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_module.rateit_toptype.1"> | ||||
|         <source>The x best voted entries oder the x most voted entries.</source> | ||||
|         <target>Die x bestbewerteten Einträge oder die x meistbewerteten Einträge.</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_module.rateit_template.0"> | ||||
|         <source>Template</source> | ||||
|         <target>Template</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_module.rateit_template.1"> | ||||
|         <source>Here you can select the template for the article's rating.</source> | ||||
|         <target>Hier können Sie das Template für die Bewertung des Artikels auswählen.</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_module.rateit_types.page"> | ||||
|         <source>Page</source> | ||||
|         <target>Seite</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_module.rateit_types.article"> | ||||
|         <source>Article</source> | ||||
|         <target>Artikel</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_module.rateit_types.ce"> | ||||
|         <source>Content Element</source> | ||||
|         <target>Inhaltselement</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_module.rateit_types.module"> | ||||
|         <source>Module</source> | ||||
|         <target>Modul</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_module.rateit_types.news"> | ||||
|         <source>News</source> | ||||
|         <target>Nachrichten</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_module.rateit_types.faq"> | ||||
|         <source>FAQ</source> | ||||
|         <target>FAQ</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_module.rateit_types.galpic"> | ||||
|         <source>Gallery Picture</source> | ||||
|         <target>Galeriebild</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_module.rateit_types.news4ward"> | ||||
|         <source>Blog entry</source> | ||||
|         <target>Beitrag</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_module.rateit_toptype.best"> | ||||
|         <source>Best votes</source> | ||||
|         <target>Beste Bewertungen</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_module.rateit_toptype.most"> | ||||
|         <source>Most votes</source> | ||||
|         <target>Meiste Bewertungen</target> | ||||
|       </trans-unit> | ||||
|     </body> | ||||
|   </file> | ||||
| </xliff> | ||||
							
								
								
									
										43
									
								
								languages/de/tl_news.xlf
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @@ -0,0 +1,43 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2"> | ||||
|   <file datatype="php" date="2015-06-18T07:01:15+02:00" original="tl_news" source-language="en" target-language="de"> | ||||
|     <body> | ||||
|       <trans-unit id="tl_news.rating_legend"> | ||||
|         <source>Rate It-Settings</source> | ||||
|         <target>Rate It-Einstellungen</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_news.addRating.0"> | ||||
|         <source>activate rating</source> | ||||
|         <target>Rating aktivieren</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_news.addRating.1"> | ||||
|         <source>Enables the rating for this news article</source> | ||||
|         <target>Aktiviert das Rating für diese Nachricht</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_news.rateit_position.0"> | ||||
|         <source>position</source> | ||||
|         <target>Position</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_news.rateit_position.1"> | ||||
|         <source>position of the rating (before or above) the news entry.</source> | ||||
|         <target>Position des Rating (ober- oder unterhalb) des News-Beitrags.</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_news.before.0"> | ||||
|         <source>above</source> | ||||
|         <target>oberhalb</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_news.before.1"> | ||||
|         <source>Display the text above the news entry</source> | ||||
|         <target>Anzeige des Texts oberhalb des News-Beitrags</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_news.after.0"> | ||||
|         <source>below</source> | ||||
|         <target>unterhalb</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_news.after.1"> | ||||
|         <source>Display the text below the news entry</source> | ||||
|         <target>Anzeige des Texts unterhalb des News-Beitrags</target> | ||||
|       </trans-unit> | ||||
|     </body> | ||||
|   </file> | ||||
| </xliff> | ||||
							
								
								
									
										43
									
								
								languages/de/tl_page.xlf
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @@ -0,0 +1,43 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2"> | ||||
|   <file datatype="php" date="2015-06-18T07:01:15+02:00" original="tl_page" source-language="en" target-language="de"> | ||||
|     <body> | ||||
|       <trans-unit id="tl_page.rateit_legend"> | ||||
|         <source>Rate It-Settings</source> | ||||
|         <target>Rate It-Einstellungen</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_page.addRating.0"> | ||||
|         <source>activate rating</source> | ||||
|         <target>Rating aktivieren</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_page.addRating.1"> | ||||
|         <source>Enables the rating for this page</source> | ||||
|         <target>Aktiviert das Rating für diese Seite</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_page.rateit_position.0"> | ||||
|         <source>position</source> | ||||
|         <target>Position</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_page.rateit_position.1"> | ||||
|         <source>position of the rating (before or above) the page.</source> | ||||
|         <target>Position des Rating (ober- oder unterhalb) der Seite.</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_page.before.0"> | ||||
|         <source>above</source> | ||||
|         <target>oberhalb</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_page.before.1"> | ||||
|         <source>Display the text above the page</source> | ||||
|         <target>Anzeige des Texts oberhalb der Seite</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_page.after.0"> | ||||
|         <source>below</source> | ||||
|         <target>unterhalb</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_page.after.1"> | ||||
|         <source>Display the text below the page</source> | ||||
|         <target>Anzeige des Texts unterhalb der Seite</target> | ||||
|       </trans-unit> | ||||
|     </body> | ||||
|   </file> | ||||
| </xliff> | ||||
							
								
								
									
										135
									
								
								languages/de/tl_settings.xlf
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @@ -0,0 +1,135 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2"> | ||||
|   <file datatype="php" date="2015-06-18T07:01:15+02:00" original="tl_settings" source-language="en" target-language="de"> | ||||
|     <body> | ||||
|       <trans-unit id="tl_settings.rateit"> | ||||
|         <source>Rate It</source> | ||||
|         <target>Rate It</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_settings.rateit_legend"> | ||||
|         <source>Rate It-Settings</source> | ||||
|         <target>Rate It-Einstellungen</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_settings.rating_type.0"> | ||||
|         <source>Type</source> | ||||
|         <target>Typ</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_settings.rating_type.1"> | ||||
|         <source>Type of representation. Possible options are the "hearts" or "stars".</source> | ||||
|         <target>Art der Darstellung. Mögliche Optionen sind "Herzen" oder "Sterne".</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_settings.rating_count.0"> | ||||
|         <source>Number of hearts/stars</source> | ||||
|         <target>Anzahl der Herzen/Sterne</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_settings.rating_count.1"> | ||||
|         <source>Number of hearts/stars which are shown.</source> | ||||
|         <target>Anzahl der Herzen/Sterne die dargestellt werden.</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_settings.rating_textposition.0"> | ||||
|         <source>Text position</source> | ||||
|         <target>Textposition</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_settings.rating_textposition.1"> | ||||
|         <source>Specifies whether the text should appear above or below the hearts or stars.</source> | ||||
|         <target>Gibt an, ob der Text ober- oder unterhalb der Herzen bzw. Sterne erscheinen soll.</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_settings.rating_listsize.0"> | ||||
|         <source>number of entries</source> | ||||
|         <target>Anzahl Einträge</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_settings.rating_listsize.1"> | ||||
|         <source>Number of entries displayed per page in the representation of ratings in the backend.</source> | ||||
|         <target>Anzahl der angezeigten Einträge pro Seite in der Darstellung der Bewertungen im Backend.</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_settings.allow_duplicate_ratings.0"> | ||||
|         <source>Allow Duplicate votes</source> | ||||
|         <target>Doppelte Bewertungen zulassen</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_settings.allow_duplicate_ratings.1"> | ||||
|         <source>The same ip address may vote more than once for the same rating?</source> | ||||
|         <target>Darf mit der gleichen IP-Adresse mehrfach für das gleiche Rating abstimmen?</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_settings.allow_duplicate_ratings_for_members.0"> | ||||
|         <source>Allow Duplicate votes for members</source> | ||||
|         <target>Doppelte Bewertungen für Mitglieder zulassen</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_settings.allow_duplicate_ratings_for_members.1"> | ||||
|         <source>A logged in frontend user may vote more than once for the same rating?</source> | ||||
|         <target>Darf ein angemeldeter Frontendbenutzer mehrfach für das gleiche Rating abstimmen?</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_settings.rating_template.0"> | ||||
|         <source>Template</source> | ||||
|         <target>Template</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_settings.rating_template.1"> | ||||
|         <source>Here you can select the template for the rating.</source> | ||||
|         <target>Hier können Sie das Template für die Bewertung auswählen.</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_settings.rating_description.0"> | ||||
|         <source>Label</source> | ||||
|         <target>Beschriftung</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_settings.rating_description.1"> | ||||
|         <source>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</source> | ||||
|         <target>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</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_settings.hearts.0"> | ||||
|         <source>hearts</source> | ||||
|         <target>Herzen</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_settings.hearts.1"> | ||||
|         <source>Illustration with hearts</source> | ||||
|         <target>Darstellung mit Herzen</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_settings.stars.0"> | ||||
|         <source>stars</source> | ||||
|         <target>Sterne</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_settings.stars.1"> | ||||
|         <source>Illustration with stars</source> | ||||
|         <target>Darstellung mit Sternen</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_settings.1.0"> | ||||
|         <source>1</source> | ||||
|         <target>1</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_settings.1.1"> | ||||
|         <source>1</source> | ||||
|         <target>1</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_settings.5.0"> | ||||
|         <source>5</source> | ||||
|         <target>5</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_settings.5.1"> | ||||
|         <source>5</source> | ||||
|         <target>5</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_settings.10.0"> | ||||
|         <source>10</source> | ||||
|         <target>10</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_settings.10.1"> | ||||
|         <source>10</source> | ||||
|         <target>10</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_settings.before.0"> | ||||
|         <source>above</source> | ||||
|         <target>oberhalb</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_settings.before.1"> | ||||
|         <source>Display the text above the hearts/stars</source> | ||||
|         <target>Anzeige des Texts oberhalb der Herzen/Sterne</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_settings.after.0"> | ||||
|         <source>below</source> | ||||
|         <target>unterhalb</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_settings.after.1"> | ||||
|         <source>Display the text below the heart / star</source> | ||||
|         <target>Anzeige des Texts unterhalb der Herzen/Sterne</target> | ||||
|       </trans-unit> | ||||
|     </body> | ||||
|   </file> | ||||
| </xliff> | ||||
							
								
								
									
										75
									
								
								languages/en/default.xlf
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @@ -0,0 +1,75 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2"> | ||||
|   <file datatype="php" date="2015-06-18T07:01:15+02:00" original="default" source-language="en" target-language="en"> | ||||
|     <body> | ||||
|       <trans-unit id="FMD.rateit.0"> | ||||
|         <source>Rate It</source> | ||||
|         <target>Rate It</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="FMD.rateit.1"> | ||||
|         <source>Enables users to leave ratings for articles, pages, news and FAQs.</source> | ||||
|         <target>Enables users to leave ratings for articles, pages, news and FAQs.</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="FMD.rateit_top_ratings.0"> | ||||
|         <source>Rate It - Best/Most ratings</source> | ||||
|         <target>Rate It - Best/Most ratings</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="FMD.rateit_top_ratings.1"> | ||||
|         <source>List of the x best ratings.</source> | ||||
|         <target>List of the x best ratings.</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="CTE.rateit.0"> | ||||
|         <source>Rate It</source> | ||||
|         <target>Rate It</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="CTE.rateit.1"> | ||||
|         <source>Enables users to leave ratings for articles, pages, news and FAQs.</source> | ||||
|         <target>Enables users to leave ratings for articles, pages, news and FAQs.</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="rateit.rating_label.0"> | ||||
|         <source>vote</source> | ||||
|         <target>vote</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="rateit.rating_label.1"> | ||||
|         <source>votes</source> | ||||
|         <target>votes</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="rateit.heart"> | ||||
|         <source>heart</source> | ||||
|         <target>heart</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="rateit.hearts"> | ||||
|         <source>hearts</source> | ||||
|         <target>hearts</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="rateit.star"> | ||||
|         <source>star</source> | ||||
|         <target>star</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="rateit.stars"> | ||||
|         <source>stars</source> | ||||
|         <target>stars</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="rateit.error.invalid_id"> | ||||
|         <source>ERROR: Invalid ID for rating given.</source> | ||||
|         <target>ERROR: Invalid ID for rating given.</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="rateit.error.invalid_rating"> | ||||
|         <source>ERROR: Invalid rating given.</source> | ||||
|         <target>ERROR: Invalid rating given.</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="rateit.error.invalid_type"> | ||||
|         <source>ERROR: Invalid type for rating given.</source> | ||||
|         <target>ERROR: Invalid type for rating given.</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="rateit.error.duplicate_vote"> | ||||
|         <source>ERROR: You may not vote more than once.</source> | ||||
|         <target>ERROR: You may not vote more than once.</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="rateit.error.duplicate_rkey"> | ||||
|         <source>The unique identifier "% s" already exists for a rating. Please choose a different identifier.</source> | ||||
|         <target>The unique identifier "% s" already exists for a rating. Please choose a different identifier.</target> | ||||
|       </trans-unit> | ||||
|     </body> | ||||
|   </file> | ||||
| </xliff> | ||||
							
								
								
									
										15
									
								
								languages/en/modules.xlf
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @@ -0,0 +1,15 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2"> | ||||
|   <file datatype="php" date="2015-06-18T07:01:15+02:00" original="modules" source-language="en" target-language="en"> | ||||
|     <body> | ||||
|       <trans-unit id="MOD.rateit.0"> | ||||
|         <source>Rate It</source> | ||||
|         <target>Rate It</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="MOD.rateit.1"> | ||||
|         <source>View ratings for articles, pages, news and faqs</source> | ||||
|         <target>View ratings for articles, pages, news and faqs</target> | ||||
|       </trans-unit> | ||||
|     </body> | ||||
|   </file> | ||||
| </xliff> | ||||
							
								
								
									
										303
									
								
								languages/en/rateit_backend.xlf
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @@ -0,0 +1,303 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2"> | ||||
|   <file datatype="php" date="2015-06-18T07:01:15+02:00" original="rateit_backend" source-language="en" target-language="en"> | ||||
|     <body> | ||||
|       <trans-unit id="tl_rateit.goback"> | ||||
|         <source>Back</source> | ||||
|         <target>Back</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.noratingsfound"> | ||||
|         <source>No matching ratings found.</source> | ||||
|         <target>No matching ratings found.</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.showdetails"> | ||||
|         <source>Detailview</source> | ||||
|         <target>Detailview</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.byorder"> | ||||
|         <source>By %s</source> | ||||
|         <target>By %s</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.seltyp.0"> | ||||
|         <source>Type</source> | ||||
|         <target>Type</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.seltyp.1"> | ||||
|         <source>Please choose the rating type.</source> | ||||
|         <target>Please choose the rating type.</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.selactive.0"> | ||||
|         <source>Active/Inactive</source> | ||||
|         <target>Active/Inactive</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.selactive.1"> | ||||
|         <source>Please choose whether you want to display only active or inactive ratings.</source> | ||||
|         <target>Please choose whether you want to display only active or inactive ratings.</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.typ.0"> | ||||
|         <source>Type</source> | ||||
|         <target>Type</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.typ.1"> | ||||
|         <source>Rating type (rating for an "article", a "page", a "news" or a "faq")</source> | ||||
|         <target>Rating type (rating for an "article", a "page", a "news" or a "faq")</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.title.0"> | ||||
|         <source>Title</source> | ||||
|         <target>Title</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.title.1"> | ||||
|         <source>Title of the article, page, news or faq, on which the rating is included.</source> | ||||
|         <target>Title of the article, page, news or faq, on which the rating is included.</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.createdat.0"> | ||||
|         <source>activated since</source> | ||||
|         <target>activated since</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.createdat.1"> | ||||
|         <source>Day from which this rating has been enabled in the format "%s"</source> | ||||
|         <target>Day from which this rating has been enabled in the format "%s"</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.status.0"> | ||||
|         <source>Status</source> | ||||
|         <target>Status</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.status.1"> | ||||
|         <source>Indicates whether this rating is currently enabled or not.</source> | ||||
|         <target>Indicates whether this rating is currently enabled or not.</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.rating.0"> | ||||
|         <source>Rating</source> | ||||
|         <target>Rating</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.rating.1"> | ||||
|         <source>actual rating</source> | ||||
|         <target>actual rating</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.overall_rating.0"> | ||||
|         <source>Overall rating</source> | ||||
|         <target>Overall rating</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.overall_rating.1"> | ||||
|         <source>actual overall rating</source> | ||||
|         <target>actual overall rating</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.totalratings.0"> | ||||
|         <source>Total votes</source> | ||||
|         <target>Total votes</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.totalratings.1"> | ||||
|         <source>Number of votes for this rating</source> | ||||
|         <target>Number of votes for this rating</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.ratingfmt"> | ||||
|         <source>%s/%d (%d Votes)</source> | ||||
|         <target>%s/%d (%d Votes)</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.ratingviewfmt"> | ||||
|         <source>%s/%d</source> | ||||
|         <target>%s/%d</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.ratingstatisticsfmt"> | ||||
|         <source>Rating %s: %d of %d votes (corresponds %s%%)</source> | ||||
|         <target>Rating %s: %d of %d votes (corresponds %s%%)</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.statistics.0"> | ||||
|         <source>Statistics</source> | ||||
|         <target>Statistics</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.statistics.1"> | ||||
|         <source>Statistics</source> | ||||
|         <target>Statistics</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.rating_chart_legend.0"> | ||||
|         <source>Distribution of ratings</source> | ||||
|         <target>Distribution of ratings</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.rating_chart_legend.1"> | ||||
|         <source>Count of ratings</source> | ||||
|         <target>Count of ratings</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.rating_chart_legend.2"> | ||||
|         <source>Rating</source> | ||||
|         <target>Rating</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.rating_chart_legend.3"> | ||||
|         <source>Count</source> | ||||
|         <target>Count</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.month_chart_legend.0"> | ||||
|         <source>Ratings per month</source> | ||||
|         <target>Ratings per month</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.month_chart_legend.1"> | ||||
|         <source>Ratings per month</source> | ||||
|         <target>Ratings per month</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.month_chart_legend.2"> | ||||
|         <source>Average rating</source> | ||||
|         <target>Average rating</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.month_chart_legend.3"> | ||||
|         <source>Month</source> | ||||
|         <target>Month</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.month_chart_legend.4"> | ||||
|         <source>Count</source> | ||||
|         <target>Count</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.ratings.0"> | ||||
|         <source>Ratings</source> | ||||
|         <target>Ratings</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.ratings.1"> | ||||
|         <source>List of all ratings</source> | ||||
|         <target>List of all ratings</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.ip.0"> | ||||
|         <source>IP address</source> | ||||
|         <target>IP address</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.member.0"> | ||||
|         <source>Frontend member</source> | ||||
|         <target>Frontend member</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.createdatdetail.0"> | ||||
|         <source>Valuation Point</source> | ||||
|         <target>Valuation Point</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.vote.0"> | ||||
|         <source>vote</source> | ||||
|         <target>vote</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.vote.1"> | ||||
|         <source>votes</source> | ||||
|         <target>votes</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.clearratings"> | ||||
|         <source>Reset selected ratings</source> | ||||
|         <target>Reset selected ratings</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit_type_options.page"> | ||||
|         <source>Page</source> | ||||
|         <target>Page</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit_type_options.article"> | ||||
|         <source>Article</source> | ||||
|         <target>Article</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit_type_options.news"> | ||||
|         <source>News</source> | ||||
|         <target>News</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit_type_options.faq"> | ||||
|         <source>FAQ</source> | ||||
|         <target>FAQ</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit_type_options.ce"> | ||||
|         <source>Content element</source> | ||||
|         <target>Content element</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit_type_options.module"> | ||||
|         <source>Module</source> | ||||
|         <target>Module</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit_type_options.galpic"> | ||||
|         <source>Gallery picture</source> | ||||
|         <target>Gallery picture</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit_type_options.news4ward"> | ||||
|         <source>Blog entry</source> | ||||
|         <target>Blog entry</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit_order_options.rating desc"> | ||||
|         <source>Rating</source> | ||||
|         <target>Rating</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit_order_options.title"> | ||||
|         <source>Title</source> | ||||
|         <target>Title</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit_order_options.typ"> | ||||
|         <source>Type</source> | ||||
|         <target>Type</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit_order_options.createdat"> | ||||
|         <source>Activation date</source> | ||||
|         <target>Activation date</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit_active_options.0"> | ||||
|         <source>inactive</source> | ||||
|         <target>inactive</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit_active_options.1"> | ||||
|         <source>active</source> | ||||
|         <target>active</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.xls_sheetname_ratings"> | ||||
|         <source>Ratings</source> | ||||
|         <target>Ratings</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.xls_sheetname_rating"> | ||||
|         <source>Rating</source> | ||||
|         <target>Rating</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.xls_headers.rkey"> | ||||
|         <source>Rating-Key</source> | ||||
|         <target>Rating-Key</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.xls_headers.typ"> | ||||
|         <source>Type</source> | ||||
|         <target>Type</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.xls_headers.title"> | ||||
|         <source>Title</source> | ||||
|         <target>Title</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.xls_headers.createdat"> | ||||
|         <source>Activation date</source> | ||||
|         <target>Activation date</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.xls_headers.active"> | ||||
|         <source>Active</source> | ||||
|         <target>Active</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.xls_headers.rating"> | ||||
|         <source>Rating</source> | ||||
|         <target>Rating</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.xls_headers.stars"> | ||||
|         <source>Max. Rating</source> | ||||
|         <target>Max. Rating</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.xls_headers.percent"> | ||||
|         <source>Rating in percent</source> | ||||
|         <target>Rating in percent</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.xls_headers.totalRatings"> | ||||
|         <source>Total votes</source> | ||||
|         <target>Total votes</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.xls_headers_detail.ip"> | ||||
|         <source>IP address</source> | ||||
|         <target>IP address</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.xls_headers_detail.member"> | ||||
|         <source>Frontend member</source> | ||||
|         <target>Frontend member</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.xls_headers_detail.rating"> | ||||
|         <source>Rating</source> | ||||
|         <target>Rating</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.xls_headers_detail.percent"> | ||||
|         <source>Rating in percent</source> | ||||
|         <target>Rating in percent</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_rateit.xls_headers_detail.createdat"> | ||||
|         <source>Valuation Point</source> | ||||
|         <target>Valuation Point</target> | ||||
|       </trans-unit> | ||||
|     </body> | ||||
|   </file> | ||||
| </xliff> | ||||
							
								
								
									
										51
									
								
								languages/en/tl_article.xlf
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @@ -0,0 +1,51 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2"> | ||||
|   <file datatype="php" date="2015-06-18T07:01:15+02:00" original="tl_article" source-language="en" target-language="en"> | ||||
|     <body> | ||||
|       <trans-unit id="tl_article.rateit_legend"> | ||||
|         <source>Rate It-Settings</source> | ||||
|         <target>Rate It-Settings</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_article.addRating.0"> | ||||
|         <source>activate rating</source> | ||||
|         <target>activate rating</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_article.addRating.1"> | ||||
|         <source>Enables the rating for this article</source> | ||||
|         <target>Enables the rating for this article</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_article.rateit_position.0"> | ||||
|         <source>position</source> | ||||
|         <target>position</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_article.rateit_position.1"> | ||||
|         <source>position of the rating (before or above) the article.</source> | ||||
|         <target>position of the rating (before or above) the article.</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_article.rateit_template.0"> | ||||
|         <source>Template</source> | ||||
|         <target>Template</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_article.rateit_template.1"> | ||||
|         <source>Here you can select the template for the article's rating.</source> | ||||
|         <target>Here you can select the template for the article's rating.</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_article.before.0"> | ||||
|         <source>above</source> | ||||
|         <target>above</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_article.before.1"> | ||||
|         <source>Display the text above the article</source> | ||||
|         <target>Display the text above the article</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_article.after.0"> | ||||
|         <source>below</source> | ||||
|         <target>below</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_article.after.1"> | ||||
|         <source>Display the text below the article</source> | ||||
|         <target>Display the text below the article</target> | ||||
|       </trans-unit> | ||||
|     </body> | ||||
|   </file> | ||||
| </xliff> | ||||
							
								
								
									
										27
									
								
								languages/en/tl_content.xlf
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @@ -0,0 +1,27 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2"> | ||||
|   <file datatype="php" date="2015-06-18T07:01:15+02:00" original="tl_content" source-language="en" target-language="en"> | ||||
|     <body> | ||||
|       <trans-unit id="tl_content.rateit_legend"> | ||||
|         <source>Rate It-Settings</source> | ||||
|         <target>Rate It-Settings</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_content.rateit_title.0"> | ||||
|         <source>Rating title</source> | ||||
|         <target>Rating title</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_content.rateit_title.1"> | ||||
|         <source>Rating title (shown in backend).</source> | ||||
|         <target>Rating title (shown in backend).</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_content.rateit_active.0"> | ||||
|         <source>Active</source> | ||||
|         <target>Active</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_content.rateit_active.1"> | ||||
|         <source>Active means that the review is visible to the front-end users.</source> | ||||
|         <target>Active means that the review is visible to the front-end users.</target> | ||||
|       </trans-unit> | ||||
|     </body> | ||||
|   </file> | ||||
| </xliff> | ||||
							
								
								
									
										43
									
								
								languages/en/tl_faq.xlf
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @@ -0,0 +1,43 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2"> | ||||
|   <file datatype="php" date="2015-06-18T07:01:15+02:00" original="tl_faq" source-language="en" target-language="en"> | ||||
|     <body> | ||||
|       <trans-unit id="tl_faq.rating_legend"> | ||||
|         <source>Rate It-Settings</source> | ||||
|         <target>Rate It-Settings</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_faq.addRating.0"> | ||||
|         <source>activate rating</source> | ||||
|         <target>activate rating</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_faq.addRating.1"> | ||||
|         <source>Enables the rating for this news article</source> | ||||
|         <target>Enables the rating for this news article</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_faq.rateit_position.0"> | ||||
|         <source>position</source> | ||||
|         <target>position</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_faq.rateit_position.1"> | ||||
|         <source>position of the rating (before or above) the FAQ entry.</source> | ||||
|         <target>position of the rating (before or above) the FAQ entry.</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_faq.before.0"> | ||||
|         <source>above</source> | ||||
|         <target>above</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_faq.before.1"> | ||||
|         <source>Display the text above the FAQ entry</source> | ||||
|         <target>Display the text above the FAQ entry</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_faq.after.0"> | ||||
|         <source>below</source> | ||||
|         <target>below</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_faq.after.1"> | ||||
|         <source>Display the text below the FAQ entry</source> | ||||
|         <target>Display the text below the FAQ entry</target> | ||||
|       </trans-unit> | ||||
|     </body> | ||||
|   </file> | ||||
| </xliff> | ||||
							
								
								
									
										99
									
								
								languages/en/tl_module.xlf
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @@ -0,0 +1,99 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2"> | ||||
|   <file datatype="php" date="2015-06-18T07:01:15+02:00" original="tl_module" source-language="en" target-language="en"> | ||||
|     <body> | ||||
|       <trans-unit id="tl_module.rateit_legend"> | ||||
|         <source>Rate It-Settings</source> | ||||
|         <target>Rate It-Settings</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_module.rateit_title.0"> | ||||
|         <source>Rating title</source> | ||||
|         <target>Rating title</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_module.rateit_title.1"> | ||||
|         <source>Rating title (shown in backend).</source> | ||||
|         <target>Rating title (shown in backend).</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_module.rateit_active.0"> | ||||
|         <source>Active</source> | ||||
|         <target>Active</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_module.rateit_active.1"> | ||||
|         <source>Active means that the review is visible to the front-end users.</source> | ||||
|         <target>Active means that the review is visible to the front-end users.</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_module.rateit_types.0"> | ||||
|         <source>Types</source> | ||||
|         <target>Types</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_module.rateit_types.1"> | ||||
|         <source>Select the types for which you would like the best ratings to be displayed.</source> | ||||
|         <target>Select the types for which you would like the best ratings to be displayed.</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_module.rateit_count.0"> | ||||
|         <source>Max. count</source> | ||||
|         <target>Max. count</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_module.rateit_count.1"> | ||||
|         <source>Max. count of displayed values.</source> | ||||
|         <target>Max. count of displayed values.</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_module.rateit_toptype.0"> | ||||
|         <source>List type</source> | ||||
|         <target>List type</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_module.rateit_toptype.1"> | ||||
|         <source>The x best voted entries oder the x most voted entries.</source> | ||||
|         <target>The x best voted entries oder the x most voted entries.</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_module.rateit_template.0"> | ||||
|         <source>Template</source> | ||||
|         <target>Template</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_module.rateit_template.1"> | ||||
|         <source>Here you can select the template for the article's rating.</source> | ||||
|         <target>Here you can select the template for the article's rating.</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_module.rateit_types.page"> | ||||
|         <source>Page</source> | ||||
|         <target>Page</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_module.rateit_types.article"> | ||||
|         <source>Article</source> | ||||
|         <target>Article</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_module.rateit_types.ce"> | ||||
|         <source>Content Element</source> | ||||
|         <target>Content Element</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_module.rateit_types.module"> | ||||
|         <source>Module</source> | ||||
|         <target>Module</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_module.rateit_types.news"> | ||||
|         <source>News</source> | ||||
|         <target>News</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_module.rateit_types.faq"> | ||||
|         <source>FAQ</source> | ||||
|         <target>FAQ</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_module.rateit_types.galpic"> | ||||
|         <source>Gallery Picture</source> | ||||
|         <target>Gallery Picture</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_module.rateit_types.news4ward"> | ||||
|         <source>Blog entry</source> | ||||
|         <target>Blog entry</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_module.rateit_toptype.best"> | ||||
|         <source>Best votes</source> | ||||
|         <target>Best votes</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_module.rateit_toptype.most"> | ||||
|         <source>Most votes</source> | ||||
|         <target>Most votes</target> | ||||
|       </trans-unit> | ||||
|     </body> | ||||
|   </file> | ||||
| </xliff> | ||||
							
								
								
									
										43
									
								
								languages/en/tl_news.xlf
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @@ -0,0 +1,43 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2"> | ||||
|   <file datatype="php" date="2015-06-18T07:01:15+02:00" original="tl_news" source-language="en" target-language="en"> | ||||
|     <body> | ||||
|       <trans-unit id="tl_news.rating_legend"> | ||||
|         <source>Rate It-Settings</source> | ||||
|         <target>Rate It-Settings</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_news.addRating.0"> | ||||
|         <source>activate rating</source> | ||||
|         <target>activate rating</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_news.addRating.1"> | ||||
|         <source>Enables the rating for this news article</source> | ||||
|         <target>Enables the rating for this news article</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_news.rateit_position.0"> | ||||
|         <source>position</source> | ||||
|         <target>position</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_news.rateit_position.1"> | ||||
|         <source>position of the rating (before or above) the news entry.</source> | ||||
|         <target>position of the rating (before or above) the news entry.</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_news.before.0"> | ||||
|         <source>above</source> | ||||
|         <target>above</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_news.before.1"> | ||||
|         <source>Display the text above the news entry</source> | ||||
|         <target>Display the text above the news entry</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_news.after.0"> | ||||
|         <source>below</source> | ||||
|         <target>below</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_news.after.1"> | ||||
|         <source>Display the text below the news entry</source> | ||||
|         <target>Display the text below the news entry</target> | ||||
|       </trans-unit> | ||||
|     </body> | ||||
|   </file> | ||||
| </xliff> | ||||
							
								
								
									
										43
									
								
								languages/en/tl_page.xlf
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @@ -0,0 +1,43 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2"> | ||||
|   <file datatype="php" date="2015-06-18T07:01:15+02:00" original="tl_page" source-language="en" target-language="en"> | ||||
|     <body> | ||||
|       <trans-unit id="tl_page.rateit_legend"> | ||||
|         <source>Rate It-Settings</source> | ||||
|         <target>Rate It-Settings</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_page.addRating.0"> | ||||
|         <source>activate rating</source> | ||||
|         <target>activate rating</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_page.addRating.1"> | ||||
|         <source>Enables the rating for this page</source> | ||||
|         <target>Enables the rating for this page</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_page.rateit_position.0"> | ||||
|         <source>position</source> | ||||
|         <target>position</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_page.rateit_position.1"> | ||||
|         <source>position of the rating (before or above) the page.</source> | ||||
|         <target>position of the rating (before or above) the page.</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_page.before.0"> | ||||
|         <source>above</source> | ||||
|         <target>above</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_page.before.1"> | ||||
|         <source>Display the text above the page</source> | ||||
|         <target>Display the text above the page</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_page.after.0"> | ||||
|         <source>below</source> | ||||
|         <target>below</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_page.after.1"> | ||||
|         <source>Display the text below the page</source> | ||||
|         <target>Display the text below the page</target> | ||||
|       </trans-unit> | ||||
|     </body> | ||||
|   </file> | ||||
| </xliff> | ||||
							
								
								
									
										135
									
								
								languages/en/tl_settings.xlf
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @@ -0,0 +1,135 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2"> | ||||
|   <file datatype="php" date="2015-06-18T07:01:15+02:00" original="tl_settings" source-language="en" target-language="en"> | ||||
|     <body> | ||||
|       <trans-unit id="tl_settings.rateit"> | ||||
|         <source>Rate It</source> | ||||
|         <target>Rate It</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_settings.rateit_legend"> | ||||
|         <source>Rate It-Settings</source> | ||||
|         <target>Rate It-Settings</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_settings.rating_type.0"> | ||||
|         <source>Type</source> | ||||
|         <target>Type</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_settings.rating_type.1"> | ||||
|         <source>Type of representation. Possible options are the "hearts" or "stars".</source> | ||||
|         <target>Type of representation. Possible options are the "hearts" or "stars".</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_settings.rating_count.0"> | ||||
|         <source>Number of hearts/stars</source> | ||||
|         <target>Number of hearts/stars</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_settings.rating_count.1"> | ||||
|         <source>Number of hearts/stars which are shown.</source> | ||||
|         <target>Number of hearts/stars which are shown.</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_settings.rating_textposition.0"> | ||||
|         <source>Text position</source> | ||||
|         <target>Text position</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_settings.rating_textposition.1"> | ||||
|         <source>Specifies whether the text should appear above or below the hearts or stars.</source> | ||||
|         <target>Specifies whether the text should appear above or below the hearts or stars.</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_settings.rating_listsize.0"> | ||||
|         <source>number of entries</source> | ||||
|         <target>number of entries</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_settings.rating_listsize.1"> | ||||
|         <source>Number of entries displayed per page in the representation of ratings in the backend.</source> | ||||
|         <target>Number of entries displayed per page in the representation of ratings in the backend.</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_settings.allow_duplicate_ratings.0"> | ||||
|         <source>Allow Duplicate votes</source> | ||||
|         <target>Allow Duplicate votes</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_settings.allow_duplicate_ratings.1"> | ||||
|         <source>The same ip address may vote more than once for the same rating?</source> | ||||
|         <target>The same ip address may vote more than once for the same rating?</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_settings.allow_duplicate_ratings_for_members.0"> | ||||
|         <source>Allow Duplicate votes for members</source> | ||||
|         <target>Allow Duplicate votes for members</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_settings.allow_duplicate_ratings_for_members.1"> | ||||
|         <source>A logged in frontend user may vote more than once for the same rating?</source> | ||||
|         <target>A logged in frontend user may vote more than once for the same rating?</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_settings.rating_template.0"> | ||||
|         <source>Template</source> | ||||
|         <target>Template</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_settings.rating_template.1"> | ||||
|         <source>Here you can select the template for the rating.</source> | ||||
|         <target>Here you can select the template for the rating.</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_settings.rating_description.0"> | ||||
|         <source>Label</source> | ||||
|         <target>Label</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_settings.rating_description.1"> | ||||
|         <source>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</source> | ||||
|         <target>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</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_settings.hearts.0"> | ||||
|         <source>hearts</source> | ||||
|         <target>hearts</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_settings.hearts.1"> | ||||
|         <source>Illustration with hearts</source> | ||||
|         <target>Illustration with hearts</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_settings.stars.0"> | ||||
|         <source>stars</source> | ||||
|         <target>stars</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_settings.stars.1"> | ||||
|         <source>Illustration with stars</source> | ||||
|         <target>Illustration with stars</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_settings.1.0"> | ||||
|         <source>1</source> | ||||
|         <target>1</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_settings.1.1"> | ||||
|         <source>1</source> | ||||
|         <target>1</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_settings.5.0"> | ||||
|         <source>5</source> | ||||
|         <target>5</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_settings.5.1"> | ||||
|         <source>5</source> | ||||
|         <target>5</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_settings.10.0"> | ||||
|         <source>10</source> | ||||
|         <target>10</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_settings.10.1"> | ||||
|         <source>10</source> | ||||
|         <target>10</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_settings.before.0"> | ||||
|         <source>above</source> | ||||
|         <target>above</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_settings.before.1"> | ||||
|         <source>Display the text above the hearts/stars</source> | ||||
|         <target>Display the text above the hearts/stars</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_settings.after.0"> | ||||
|         <source>below</source> | ||||
|         <target>below</target> | ||||
|       </trans-unit> | ||||
|       <trans-unit id="tl_settings.after.1"> | ||||
|         <source>Display the text below the heart / star</source> | ||||
|         <target>Display the text below the heart / star</target> | ||||
|       </trans-unit> | ||||
|     </body> | ||||
|   </file> | ||||
| </xliff> | ||||
							
								
								
									
										7
									
								
								public/.htaccess
									
									
									
									
									
										Normal 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> | ||||
							
								
								
									
										136
									
								
								public/css/backend.css
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @@ -0,0 +1,136 @@ | ||||
| /** | ||||
|  * 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.type-news4ward { background-color:#ffe011; } | ||||
| .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
									
								
							
							
						
						| @@ -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; | ||||
| } | ||||
							
								
								
									
										1
									
								
								public/css/heart.min.css
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						| @@ -0,0 +1 @@ | ||||
| .mbrateItRating .wrapper,.rateItRating .wrapper{background:url("../images/heart.gif")}div.mbrateItRating div.rateItRating-hover,div.mbrateItRating div.rateItRating-selected,div.rateItRating div.rateItRating-hover,div.rateItRating div.rateItRating-selected{background:url("../images/heart.gif") left} | ||||
							
								
								
									
										65
									
								
								public/css/rateit.css
									
									
									
									
									
										Normal 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; | ||||
| } | ||||
							
								
								
									
										1
									
								
								public/css/rateit.min.css
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						| @@ -0,0 +1 @@ | ||||
| .rateItRating{position:relative;display:inline-block}.mbrateItRating{position:relative;opacity:1}.mbrateItRating .wrapper,.rateItRating .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.mbrateItRating div.rateItRating-hover,div.mbrateItRating div.rateItRating-selected,div.rateItRating div.rateItRating-hover,div.rateItRating div.rateItRating-selected{position:absolute}.rateItRating .ratingText{color:#000}.mbrateItRating .mbratingText{display:inline-block;color:#ccc}.ratingText.ratingError{color:red}.mbrateItRating .mbratingText.loading,.rateItRating .ratingText.loading{background:url("../images/ajax-loading.gif") no-repeat}span.rating-microdata{display:none} | ||||
							
								
								
									
										11
									
								
								public/css/star.css
									
									
									
									
									
										Normal 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; | ||||
| } | ||||
							
								
								
									
										1
									
								
								public/css/star.min.css
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						| @@ -0,0 +1 @@ | ||||
| .mbrateItRating .wrapper,.rateItRating .wrapper{background:url("../images/star.gif")}div.mbrateItRating div.rateItRating-hover,div.mbrateItRating div.rateItRating-selected,div.rateItRating div.rateItRating-hover,div.rateItRating div.rateItRating-selected{background:url("../images/star.gif") left} | ||||
							
								
								
									
										
											BIN
										
									
								
								public/images/ajax-loading.gif
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 847 B | 
							
								
								
									
										
											BIN
										
									
								
								public/images/article.gif
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 392 B | 
							
								
								
									
										
											BIN
										
									
								
								public/images/exportEXCEL.gif
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 282 B | 
							
								
								
									
										
											BIN
										
									
								
								public/images/heart.gif
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 1.4 KiB | 
							
								
								
									
										
											BIN
										
									
								
								public/images/icon.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 722 B | 
							
								
								
									
										
											BIN
										
									
								
								public/images/info.gif
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 354 B | 
							
								
								
									
										
											BIN
										
									
								
								public/images/page.gif
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 625 B | 
							
								
								
									
										
											BIN
										
									
								
								public/images/star.gif
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 815 B | 
							
								
								
									
										22
									
								
								public/js/RateItBackend.js
									
									
									
									
									
										Normal 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
									
								
							
							
						
						| @@ -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 }; | ||||
| } | ||||
							
								
								
									
										8
									
								
								public/js/helper.min.js
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						| @@ -0,0 +1,8 @@ | ||||
|  | ||||
| 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};} | ||||
							
								
								
									
										2240
									
								
								public/js/jquery-ui-effects.custom.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
							
								
								
									
										6
									
								
								public/js/jquery-ui-effects.custom.min.js
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
							
								
								
									
										1148
									
								
								public/js/jquery/colorbox/colorbox-rateit.js
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
							
								
								
									
										80
									
								
								public/js/jquery/colorbox/colorbox-rateit.min.js
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						| @@ -0,0 +1,80 @@ | ||||
|  | ||||
| (function($,document,window){var | ||||
| defaults={html:false,photo:false,iframe:false,inline:false,transition:"elastic",speed:300,fadeOut:300,width:false,initialWidth:"600",innerWidth:false,maxWidth:false,height:false,initialHeight:"450",innerHeight:false,maxHeight:false,scalePhotos:true,scrolling:true,opacity:0.9,preloading:true,className:false,overlayClose:true,escKey:true,arrowKey:true,top:false,bottom:false,left:false,right:false,fixed:false,data:undefined,closeButton:true,fastIframe:true,open:false,reposition:true,loop:true,slideshow:false,slideshowAuto:true,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",photoRegex:/\.(gif|png|jp(e|g|eg)|bmp|ico|webp|jxr|svg)((#|\?).*)?$/i,retinaImage:false,retinaUrl:false,retinaSuffix:'@2x.$1',current:"image {current} of {total}",previous:"previous",next:"next",close:"close",xhrError:"This content failed to load.",imgError:"This image failed to load.",returnFocus:true,trapFocus:true,onOpen:false,onLoad:false,onComplete:false,onCleanup:false,onClosed:false,rel:function(){return this.rel;},href:function(){return $(this).attr('href');},title:function(){return this.title;},createImg:function(){var img=new Image();var attrs=$(this).data('cbox-img-attrs');if(typeof attrs==='object'){$.each(attrs,function(key,val){img[key]=val;});} | ||||
| return img;},createIframe:function(){var iframe=document.createElement('iframe');var attrs=$(this).data('cbox-iframe-attrs');if(typeof attrs==='object'){$.each(attrs,function(key,val){iframe[key]=val;});} | ||||
| if('frameBorder'in iframe){iframe.frameBorder=0;} | ||||
| if('allowTransparency'in iframe){iframe.allowTransparency="true";} | ||||
| iframe.name=(new Date()).getTime();iframe.allowFullScreen=true;return iframe;}},colorbox='colorbox',prefix='cbox',boxElement=prefix+'Element',event_open=prefix+'_open',event_load=prefix+'_load',event_complete=prefix+'_complete',event_cleanup=prefix+'_cleanup',event_closed=prefix+'_closed',event_purge=prefix+'_purge',$overlay,$box,$wrap,$content,$topBorder,$leftBorder,$rightBorder,$bottomBorder,$related,$window,$loaded,$loadingBay,$loadingOverlay,$title,$current,$slideshow,$next,$prev,$close,$rating,$ratingWrapper,$ratingSelected,$ratingHover,$ratingDescription,$groupControls,$events=$('<a/>'),settings,interfaceHeight,interfaceWidth,loadedHeight,loadedWidth,index,photo,open,active,closing,loadingTimer,publicMethod,div="div",requests=0,previousCSS={},init;function $tag(tag,id,css){var element=document.createElement(tag);if(id){element.id=prefix+id;} | ||||
| if(css){element.style.cssText=css;} | ||||
| return $(element);} | ||||
| function winheight(){return window.innerHeight?window.innerHeight:$(window).height();} | ||||
| function Settings(element,options){if(options!==Object(options)){options={};} | ||||
| this.cache={};this.el=element;this.value=function(key){var dataAttr;if(this.cache[key]===undefined){dataAttr=$(this.el).attr('data-cbox-'+key);if(dataAttr!==undefined){this.cache[key]=dataAttr;}else if(options[key]!==undefined){this.cache[key]=options[key];}else if(defaults[key]!==undefined){this.cache[key]=defaults[key];}} | ||||
| return this.cache[key];};this.get=function(key){var value=this.value(key);return $.isFunction(value)?value.call(this.el,this):value;};} | ||||
| function getIndex(increment){var | ||||
| max=$related.length,newIndex=(index+increment)%max;return(newIndex<0)?max+newIndex:newIndex;} | ||||
| function setSize(size,dimension){return Math.round((/%/.test(size)?((dimension==='x'?$window.width():winheight())/100):1)*parseInt(size,10));} | ||||
| function isImage(settings,url){return settings.get('photo')||settings.get('photoRegex').test(url);} | ||||
| function retinaUrl(settings,url){return settings.get('retinaUrl')&&window.devicePixelRatio>1?url.replace(settings.get('photoRegex'),settings.get('retinaSuffix')):url;} | ||||
| function trapFocus(e){if('contains'in $box[0]&&!$box[0].contains(e.target)&&e.target!==$overlay[0]){e.stopPropagation();$box.focus();}} | ||||
| function setClass(str){if(setClass.str!==str){$box.add($overlay).removeClass(setClass.str).addClass(str);setClass.str=str;}} | ||||
| function getRelated(rel){index=0;if(rel&&rel!==false&&rel!=='nofollow'){$related=$('.'+boxElement).filter(function(){var options=$.data(this,colorbox);var settings=new Settings(this,options);return(settings.get('rel')===rel);});index=$related.index(settings.el);if(index===-1){$related=$related.add(settings.el);index=$related.length-1;}}else{$related=$(settings.el);}} | ||||
| function trigger(event){$(document).trigger(event);$events.triggerHandler(event);} | ||||
| var slideshow=(function(){var active,className=prefix+"Slideshow_",click="click."+prefix,timeOut;function clear(){clearTimeout(timeOut);} | ||||
| function set(){if(settings.get('loop')||$related[index+1]){clear();timeOut=setTimeout(publicMethod.next,settings.get('slideshowSpeed'));}} | ||||
| function start(){$slideshow.html(settings.get('slideshowStop')).unbind(click).one(click,stop);$events.bind(event_complete,set).bind(event_load,clear);$box.removeClass(className+"off").addClass(className+"on");} | ||||
| function stop(){clear();$events.unbind(event_complete,set).unbind(event_load,clear);$slideshow.html(settings.get('slideshowStart')).unbind(click).one(click,function(){publicMethod.next();start();});$box.removeClass(className+"on").addClass(className+"off");} | ||||
| function reset(){active=false;$slideshow.hide();clear();$events.unbind(event_complete,set).unbind(event_load,clear);$box.removeClass(className+"off "+className+"on");} | ||||
| return function(){if(active){if(!settings.get('slideshow')){$events.unbind(event_cleanup,reset);reset();}}else{if(settings.get('slideshow')&&$related[1]){active=true;$events.one(event_cleanup,reset);if(settings.get('slideshowAuto')){start();}else{stop();} | ||||
| $slideshow.show();}}};}());function launch(element){var options;if(!closing){options=$(element).data(colorbox);settings=new Settings(element,options);getRelated(settings.get('rel'));if(!open){open=active=true;setClass(settings.get('className'));$box.css({visibility:'hidden',display:'block',opacity:''});$loaded=$tag(div,'LoadedContent','width:0; height:0; overflow:hidden; visibility:hidden');$content.css({width:'',height:''}).append($loaded);interfaceHeight=$topBorder.height()+$bottomBorder.height()+$content.outerHeight(true)-$content.height();interfaceWidth=$leftBorder.width()+$rightBorder.width()+$content.outerWidth(true)-$content.width();loadedHeight=$loaded.outerHeight(true);loadedWidth=$loaded.outerWidth(true);var initialWidth=setSize(settings.get('initialWidth'),'x');var initialHeight=setSize(settings.get('initialHeight'),'y');var maxWidth=settings.get('maxWidth');var maxHeight=settings.get('maxHeight');settings.w=(maxWidth!==false?Math.min(initialWidth,setSize(maxWidth,'x')):initialWidth)-loadedWidth-interfaceWidth;settings.h=(maxHeight!==false?Math.min(initialHeight,setSize(maxHeight,'y')):initialHeight)-loadedHeight-interfaceHeight;$loaded.css({width:'',height:settings.h});publicMethod.position();trigger(event_open);settings.get('onOpen');$groupControls.add($title).hide();$box.focus();if(settings.get('trapFocus')){if(document.addEventListener){document.addEventListener('focus',trapFocus,true);$events.one(event_closed,function(){document.removeEventListener('focus',trapFocus,true);});}} | ||||
| if(settings.get('returnFocus')){$events.one(event_closed,function(){$(settings.el).focus();});}} | ||||
| var opacity=parseFloat(settings.get('opacity'));$overlay.css({opacity:opacity===opacity?opacity:'',cursor:settings.get('overlayClose')?'pointer':'',visibility:'visible'}).show();if(settings.get('closeButton')){$close.html(settings.get('close')).appendTo($content);}else{$close.appendTo('<div/>');} | ||||
| load();}} | ||||
| function appendHTML(){if(!$box){init=false;$window=$(window);$box=$tag(div).attr({id:colorbox,'class':$.support.opacity===false?prefix+'IE':'',role:'dialog',tabindex:'-1'}).hide();$overlay=$tag(div,"Overlay").hide();$loadingOverlay=$([$tag(div,"LoadingOverlay")[0],$tag(div,"LoadingGraphic")[0]]);$wrap=$tag(div,"Wrapper");$content=$tag(div,"Content").append($title=$tag(div,"Title"),$rating=$tag(div,"mbRating").attr({"class":"mbrateItRating"}).css({'bottom':'-20px','position':'absolute'}).append($ratingWrapper=$tag(div,"mbrateItRating").attr({"class":"wrapper"}).append($ratingSelected=$tag(div).attr({"class":"rateItRating-selected","display":"block"}),$ratingHover=$tag(div).attr({"class":"rateItRating-hover"})),$ratingDescription=$tag(div,"mbRatingDescription").attr({"class":"mbratingText ratingText"}).css({'margin-left':'10px'})),$current=$tag(div,"Current"),$prev=$('<button type="button"/>').attr({id:prefix+'Previous'}),$next=$('<button type="button"/>').attr({id:prefix+'Next'}),$slideshow=$tag('button',"Slideshow"),$loadingOverlay);$close=$('<button type="button"/>').attr({id:prefix+'Close'});$wrap.append($tag(div).append($tag(div,"TopLeft"),$topBorder=$tag(div,"TopCenter"),$tag(div,"TopRight")),$tag(div,false,'clear:left').append($leftBorder=$tag(div,"MiddleLeft"),$content,$rightBorder=$tag(div,"MiddleRight")),$tag(div,false,'clear:left').append($tag(div,"BottomLeft"),$bottomBorder=$tag(div,"BottomCenter"),$tag(div,"BottomRight"))).find('div div').css({'float':'left'});$loadingBay=$tag(div,false,'position:absolute; width:9999px; visibility:hidden; display:none; max-width:none;');$groupControls=$next.add($prev).add($current).add($slideshow);} | ||||
| if(document.body&&!$box.parent().length){$(document.body).append($overlay,$box.append($wrap,$loadingBay));}} | ||||
| function addBindings(){function clickHandler(e){if(!(e.which>1||e.shiftKey||e.altKey||e.metaKey||e.ctrlKey)){e.preventDefault();launch(this);}} | ||||
| if($box){if(!init){init=true;$next.click(function(){publicMethod.next();});$prev.click(function(){publicMethod.prev();});$close.click(function(){publicMethod.close();});$overlay.click(function(){if(settings.get('overlayClose')){publicMethod.close();}});$(document).bind('keydown.'+prefix,function(e){var key=e.keyCode;if(open&&settings.get('escKey')&&key===27){e.preventDefault();publicMethod.close();} | ||||
| if(open&&settings.get('arrowKey')&&$related[1]&&!e.altKey){if(key===37){e.preventDefault();$prev.click();}else if(key===39){e.preventDefault();$next.click();}}});if($.isFunction($.fn.on)){$(document).on('click.'+prefix,'.'+boxElement,clickHandler);}else{$('.'+boxElement).live('click.'+prefix,clickHandler);}} | ||||
| return true;} | ||||
| return false;} | ||||
| if($[colorbox]){return;} | ||||
| $(appendHTML);publicMethod=$.fn[colorbox]=$[colorbox]=function(options,callback){var settings;var $obj=this;options=options||{};if($.isFunction($obj)){$obj=$('<a/>');options.open=true;} | ||||
| if(!$obj[0]){return $obj;} | ||||
| appendHTML();if(addBindings()){if(callback){options.onComplete=callback;} | ||||
| $obj.each(function(){var old=$.data(this,colorbox)||{};$.data(this,colorbox,$.extend(old,options));}).addClass(boxElement);settings=new Settings($obj[0],options);if(settings.get('open')){launch($obj[0]);}} | ||||
| return $obj;};publicMethod.position=function(speed,loadedCallback){var | ||||
| css,top=0,left=0,offset=$box.offset(),scrollTop,scrollLeft;$window.unbind('resize.'+prefix);$box.css({top:-9e4,left:-9e4});scrollTop=$window.scrollTop();scrollLeft=$window.scrollLeft();if(settings.get('fixed')){offset.top-=scrollTop;offset.left-=scrollLeft;$box.css({position:'fixed'});}else{top=scrollTop;left=scrollLeft;$box.css({position:'absolute'});} | ||||
| if(settings.get('right')!==false){left+=Math.max($window.width()-settings.w-loadedWidth-interfaceWidth-setSize(settings.get('right'),'x'),0);}else if(settings.get('left')!==false){left+=setSize(settings.get('left'),'x');}else{left+=Math.round(Math.max($window.width()-settings.w-loadedWidth-interfaceWidth,0)/2);} | ||||
| if(settings.get('bottom')!==false){top+=Math.max(winheight()-settings.h-loadedHeight-interfaceHeight-setSize(settings.get('bottom'),'y'),0);}else if(settings.get('top')!==false){top+=setSize(settings.get('top'),'y');}else{top+=Math.round(Math.max(winheight()-settings.h-loadedHeight-interfaceHeight,0)/2);} | ||||
| $box.css({top:offset.top,left:offset.left,visibility:'visible'});$wrap[0].style.width=$wrap[0].style.height="9999px";function modalDimensions(){$topBorder[0].style.width=$bottomBorder[0].style.width=$content[0].style.width=(parseInt($box[0].style.width,10)-interfaceWidth)+'px';$content[0].style.height=$leftBorder[0].style.height=$rightBorder[0].style.height=(parseInt($box[0].style.height,10)-interfaceHeight)+'px';} | ||||
| css={width:settings.w+loadedWidth+interfaceWidth,height:settings.h+loadedHeight+interfaceHeight,top:top,left:left};if(speed){var tempSpeed=0;$.each(css,function(i){if(css[i]!==previousCSS[i]){tempSpeed=speed;return;}});speed=tempSpeed;} | ||||
| previousCSS=css;if(!speed){$box.css(css);} | ||||
| $box.dequeue().animate(css,{duration:speed||0,complete:function(){modalDimensions();active=false;$wrap[0].style.width=(settings.w+loadedWidth+interfaceWidth)+"px";$wrap[0].style.height=(settings.h+loadedHeight+interfaceHeight)+"px";if(settings.get('reposition')){setTimeout(function(){$window.bind('resize.'+prefix,publicMethod.position);},1);} | ||||
| if($.isFunction(loadedCallback)){loadedCallback();}},step:modalDimensions});};publicMethod.resize=function(options){var scrolltop;if(open){options=options||{};if(options.width){settings.w=setSize(options.width,'x')-loadedWidth-interfaceWidth;} | ||||
| if(options.innerWidth){settings.w=setSize(options.innerWidth,'x');} | ||||
| $loaded.css({width:settings.w});if(options.height){settings.h=setSize(options.height,'y')-loadedHeight-interfaceHeight;} | ||||
| if(options.innerHeight){settings.h=setSize(options.innerHeight,'y');} | ||||
| if(!options.innerHeight&&!options.height){scrolltop=$loaded.scrollTop();$loaded.css({height:"auto"});settings.h=$loaded.height();} | ||||
| $loaded.css({height:settings.h});if(scrolltop){$loaded.scrollTop(scrolltop);} | ||||
| publicMethod.position(settings.get('transition')==="none"?0:settings.get('speed'));}};publicMethod.prep=function(object){if(!open){return;} | ||||
| var callback,speed=settings.get('transition')==="none"?0:settings.get('speed');$loaded.remove();$loaded=$tag(div,'LoadedContent').append(object);$rating.css('display','none');if(typeof arrRatings=='object'){for(var ri=0;ri<arrRatings.length;ri++){if(decodeURIComponent(object.src).endsWith(arrRatings[ri].URL)){$rating.css('display','block');if(arrRatings[ri].rated){$rating.attr('id','mb'+arrRatings[ri].rateItID);RateItRating.initMe($rating);$ratingWrapper.unbind();$ratingSelected.css('display','none');$ratingHover.css('width',arrRatings[ri].width);$ratingHover.css('display','block');$ratingDescription.text(arrRatings[ri].description);}else{$rating.attr('id','mb'+arrRatings[ri].rateItID);$ratingSelected.css('display','block');$ratingHover.css('display','none');$ratingDescription.text(arrRatings[ri].description);RateItRating.initMe($rating);} | ||||
| break;}}} | ||||
| function getWidth(){settings.w=settings.w||$loaded.width();settings.w=settings.mw&&settings.mw<settings.w?settings.mw:settings.w;return settings.w;} | ||||
| function getHeight(){settings.h=settings.h||$loaded.height();settings.h=settings.mh&&settings.mh<settings.h?settings.mh:settings.h;return settings.h;} | ||||
| $loaded.hide().appendTo($loadingBay.show()).css({width:getWidth(),overflow:settings.get('scrolling')?'auto':'hidden'}).css({height:getHeight()}).prependTo($content);$loadingBay.hide();$(photo).css({'float':'none'});setClass(settings.get('className'));callback=function(){var total=$related.length,iframe,complete;if(!open){return;} | ||||
| function removeFilter(){if($.support.opacity===false){$box[0].style.removeAttribute('filter');}} | ||||
| complete=function(){clearTimeout(loadingTimer);$loadingOverlay.hide();trigger(event_complete);settings.get('onComplete');};$title.html(settings.get('title')).show();$loaded.show();if(total>1){if(typeof settings.get('current')==="string"){$current.html(settings.get('current').replace('{current}',index+1).replace('{total}',total)).show();} | ||||
| $next[(settings.get('loop')||index<total-1)?"show":"hide"]().html(settings.get('next'));$prev[(settings.get('loop')||index)?"show":"hide"]().html(settings.get('previous'));slideshow();if(settings.get('preloading')){$.each([getIndex(-1),getIndex(1)],function(){var img,i=$related[this],settings=new Settings(i,$.data(i,colorbox)),src=settings.get('href');if(src&&isImage(settings,src)){src=retinaUrl(settings,src);img=document.createElement('img');img.src=src;}});}}else{$groupControls.hide();} | ||||
| if(settings.get('iframe')){iframe=settings.get('createIframe');if(!settings.get('scrolling')){iframe.scrolling="no";} | ||||
| $(iframe).attr({src:settings.get('href'),'class':prefix+'Iframe'}).one('load',complete).appendTo($loaded);$events.one(event_purge,function(){iframe.src="//about:blank";});if(settings.get('fastIframe')){$(iframe).trigger('load');}}else{complete();} | ||||
| if(settings.get('transition')==='fade'){$box.fadeTo(speed,1,removeFilter);}else{removeFilter();}};if(settings.get('transition')==='fade'){$box.fadeTo(speed,0,function(){publicMethod.position(0,callback);});}else{publicMethod.position(speed,callback);}};function load(){var href,setResize,prep=publicMethod.prep,$inline,request=++requests;active=true;photo=false;trigger(event_purge);trigger(event_load);settings.get('onLoad');settings.h=settings.get('height')?setSize(settings.get('height'),'y')-loadedHeight-interfaceHeight:settings.get('innerHeight')&&setSize(settings.get('innerHeight'),'y');settings.w=settings.get('width')?setSize(settings.get('width'),'x')-loadedWidth-interfaceWidth:settings.get('innerWidth')&&setSize(settings.get('innerWidth'),'x');settings.mw=settings.w;settings.mh=settings.h;if(settings.get('maxWidth')){settings.mw=setSize(settings.get('maxWidth'),'x')-loadedWidth-interfaceWidth;settings.mw=settings.w&&settings.w<settings.mw?settings.w:settings.mw;} | ||||
| if(settings.get('maxHeight')){settings.mh=setSize(settings.get('maxHeight'),'y')-loadedHeight-interfaceHeight;settings.mh=settings.h&&settings.h<settings.mh?settings.h:settings.mh;} | ||||
| href=settings.get('href');loadingTimer=setTimeout(function(){$loadingOverlay.show();},100);if(settings.get('inline')){var $target=$(href);$inline=$('<div>').hide().insertBefore($target);$events.one(event_purge,function(){$inline.replaceWith($target);});prep($target);}else if(settings.get('iframe')){prep(" ");}else if(settings.get('html')){prep(settings.get('html'));}else if(isImage(settings,href)){href=retinaUrl(settings,href);photo=settings.get('createImg');$(photo).addClass(prefix+'Photo').bind('error.'+prefix,function(){prep($tag(div,'Error').html(settings.get('imgError')));}).one('load',function(){if(request!==requests){return;} | ||||
| setTimeout(function(){var percent;if(settings.get('retinaImage')&&window.devicePixelRatio>1){photo.height=photo.height/window.devicePixelRatio;photo.width=photo.width/window.devicePixelRatio;} | ||||
| if(settings.get('scalePhotos')){setResize=function(){photo.height-=photo.height*percent;photo.width-=photo.width*percent;};if(settings.mw&&photo.width>settings.mw){percent=(photo.width-settings.mw)/photo.width;setResize();} | ||||
| if(settings.mh&&photo.height>settings.mh){percent=(photo.height-settings.mh)/photo.height;setResize();}} | ||||
| if(settings.h){photo.style.marginTop=Math.max(settings.mh-photo.height,0)/2+'px';} | ||||
| if($related[1]&&(settings.get('loop')||$related[index+1])){photo.style.cursor='pointer';$(photo).bind('click.'+prefix,function(){publicMethod.next();});} | ||||
| photo.style.width=photo.width+'px';photo.style.height=photo.height+'px';prep(photo);},1);});photo.src=href;}else if(href){$loadingBay.load(href,settings.get('data'),function(data,status){if(request===requests){prep(status==='error'?$tag(div,'Error').html(settings.get('xhrError')):$(this).contents());}});}} | ||||
| publicMethod.next=function(){if(!active&&$related[1]&&(settings.get('loop')||$related[index+1])){index=getIndex(1);launch($related[index]);}};publicMethod.prev=function(){if(!active&&$related[1]&&(settings.get('loop')||index)){index=getIndex(-1);launch($related[index]);}};publicMethod.close=function(){if(open&&!closing){closing=true;open=false;trigger(event_cleanup);settings.get('onCleanup');$window.unbind('.'+prefix);$overlay.fadeTo(settings.get('fadeOut')||0,0);$box.stop().fadeTo(settings.get('fadeOut')||0,0,function(){$box.hide();$overlay.hide();trigger(event_purge);$loaded.remove();setTimeout(function(){closing=false;trigger(event_closed);settings.get('onClosed');},1);});}};publicMethod.remove=function(){if(!$box){return;} | ||||
| $box.stop();$[colorbox].close();$box.stop(false,true).remove();$overlay.remove();closing=false;$box=null;$('.'+boxElement).removeData(colorbox).removeClass(boxElement);$(document).unbind('click.'+prefix).unbind('keydown.'+prefix);};publicMethod.element=function(){return $(settings.el);};publicMethod.settings=defaults;}(jQuery,document,window)); | ||||
							
								
								
									
										1025
									
								
								public/js/mootools/mediabox/mediabox-rateit-uncompressed.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
							
								
								
									
										1
									
								
								public/js/mootools/mediabox/mediabox-rateit.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
							
								
								
									
										75
									
								
								public/js/onReadyRateIt-uncompressed.js
									
									
									
									
									
										Normal 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(); | ||||
| 		}; | ||||
| 	} | ||||
| } | ||||
							
								
								
									
										1
									
								
								public/js/onReadyRateIt.js
									
									
									
									
									
										Normal 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=[] | ||||
							
								
								
									
										600
									
								
								public/js/rateit-uncompressed.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @@ -0,0 +1,600 @@ | ||||
| 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', '          '); | ||||
| 							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|news4ward)-(\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|news4ward)-(\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|news4ward)-(\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|news4ward)-(\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?do=rateit'}); | ||||
| 		}); | ||||
| 	} 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')); | ||||
| 					 | ||||
| 					jQuery.when(self.getBackgroundImage(el.data('wrapper'))).done(function(backgroundImageSize) { | ||||
| 						self.options.starwidth = backgroundImageSize[0]; | ||||
| 						self.options.starheight = backgroundImageSize[1] / 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('          '); | ||||
| 							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|news4ward)-(\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|news4ward)-(\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|news4ward)-(\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|news4ward)-(\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 dfd = jQuery.Deferred(); | ||||
| 				var backgroundImageSize = new Array(); | ||||
| 				var reg_imgFile = /url\s*\(["']?(.*)["']?\)/i; | ||||
| 				var string = this.getBackgroundImagePath(el); | ||||
| 				string = string.match(reg_imgFile)[1]; | ||||
| 				string = string.replace('\"', ''); | ||||
|  | ||||
| 				jQuery('<img/>') | ||||
| 				   .attr('src', string) | ||||
| 				   .load(function() { | ||||
| 					   backgroundImageSize.push(this.width); | ||||
| 					   backgroundImageSize.push(this.height); | ||||
| 					   dfd.resolve(backgroundImageSize); | ||||
| 				   }); | ||||
| 				return dfd.promise(); | ||||
| 			}, | ||||
| 	 | ||||
| 			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.min.js", | ||||
| 				  dataType: "script", | ||||
| 				  async: false, | ||||
| 				  cache: true | ||||
| 			}); | ||||
| 			RateItRating = Object.create(RateItRatings).initialize({url:'SimpleAjax.php?do=rateit'}); | ||||
| 		}); | ||||
| 		 | ||||
| 		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(); | ||||
| }); | ||||
							
								
								
									
										24
									
								
								public/js/rateit.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @@ -0,0 +1,24 @@ | ||||
|  | ||||
| var RateItRating;function doRateIt(){if(window.MooTools){var RateItRatings=new Class({Implements:Options,options:{step:0.1,readonly:false,resetable:false},initialize:function(options){this.setOptions(options);$$('.rateItRating').each(function(el){this.initMe(el);}.bind(this));},initMe:function(el){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;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);this.options.max=this.getRatableMaxValue(el.id);el.selected.setStyle('height',this.options.starheight);el.hover.setStyle('height',this.options.starheight);el.wrapper.setStyle('width',this.options.starwidth*this.options.max);el.wrapper.setStyle('height',this.options.starheight);this.fillVote(el.starPercent,el);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','          ');el.textEl.addClass('loading');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);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{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){var stars=id.match(/(\d*\|?\d*)-(page|article|ce|module|news|faq|galpic|news4ward)-(\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;}},getFillPercent:function(starPercent){return(starPercent/100)*(this.options.starwidth*this.options.max);},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|news4ward)-(\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|news4ward)-(\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|news4ward)-(\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?do=rateit'});});}else if(window.jQuery){(function(){RateItRatings={options:{step:0.1,readonly:false,resetable:false},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;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('selected',el.find('.rateItRating-selected'));el.data('hover',el.find('.rateItRating-hover'));jQuery.when(self.getBackgroundImage(el.data('wrapper'))).done(function(backgroundImageSize){self.options.starwidth=backgroundImageSize[0];self.options.starheight=backgroundImageSize[1]/3;});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')));self.options.max=self.getRatableMaxValue(el.data('id'));el.data('selected').css('height',self.options.starheight);el.data('hover').css('height',self.options.starheight);el.data('wrapper').css('width',self.options.starwidth*self.options.max);el.data('wrapper').css('height',self.options.starheight);self.fillVote(el.data('starPercent'),el);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('          ');el.data('textEl').addClass('loading');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){var stars=id.match(/(\d*\|?\d*)-(page|article|ce|module|news|faq|galpic|news4ward)-(\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;}},getFillPercent:function(starPercent){return(starPercent/100)*(this.options.starwidth*this.options.max);},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|news4ward)-(\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|news4ward)-(\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|news4ward)-(\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 dfd=jQuery.Deferred();var backgroundImageSize=new Array();var reg_imgFile=/url\s*\(["']?(.*)["']?\)/i;var string=this.getBackgroundImagePath(el);string=string.match(reg_imgFile)[1];string=string.replace('\"','');jQuery('<img/>').attr('src',string).load(function(){backgroundImageSize.push(this.width);backgroundImageSize.push(this.height);dfd.resolve(backgroundImageSize);});return dfd.promise();},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);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');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.min.js",dataType:"script",async:false,cache:true});RateItRating=Object.create(RateItRatings).initialize({url:'SimpleAjax.php?do=rateit'});});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();}); | ||||
							
								
								
									
										177
									
								
								public/php/rateit.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @@ -0,0 +1,177 @@ | ||||
| <?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() { | ||||
| 		if ($this->Input->get('do') == 'rateit') { | ||||
| 			$ip = $_SERVER['REMOTE_ADDR']; | ||||
| 	 | ||||
| 			$rkey = $this->Input->post('id'); | ||||
| 			$percent = $this->Input->post('vote'); | ||||
| 			$type = $this->Input->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' || $type === 'news4ward')) { | ||||
| 				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->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(); | ||||
| 	      } elseif (!isset($countUser) && ((!$this->allowDuplicates && $countIp == 0) || $this->allowDuplicates)) { | ||||
| 				// 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; | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| } | ||||
| ?> | ||||
							
								
								
									
										70
									
								
								templates/article_rateit_default.html5
									
									
									
									
									
										Normal 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; ?> | ||||
							
								
								
									
										71
									
								
								templates/article_rateit_default.xhtml
									
									
									
									
									
										Normal 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&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="16" height="16" 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="16" height="16" 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="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; ?> | ||||
							
								
								
									
										86
									
								
								templates/article_rateit_default_microdata.html5
									
									
									
									
									
										Normal 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; ?> | ||||
							
								
								
									
										87
									
								
								templates/article_rateit_default_microdata.xhtml
									
									
									
									
									
										Normal 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&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="16" height="16" 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="16" height="16" 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="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; ?> | ||||
							
								
								
									
										48
									
								
								templates/gallery_rateit_default.html5
									
									
									
									
									
										Normal 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> | ||||
							
								
								
									
										50
									
								
								templates/gallery_rateit_default.xhtml
									
									
									
									
									
										Normal 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> | ||||
							
								
								
									
										27
									
								
								templates/j_colorbox_rateit.html5
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @@ -0,0 +1,27 @@ | ||||
| <?php | ||||
|  | ||||
| // Add the colorbox style sheet and javascript | ||||
| $GLOBALS['TL_CSS'][] = 'assets/jquery/colorbox/'. COLORBOX .'/css/colorbox.min.css||static'; | ||||
| $GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/rateit/public/js/jquery/colorbox/colorbox-rateit.min.js|static'; | ||||
|  | ||||
| ?> | ||||
|  | ||||
| <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> | ||||
							
								
								
									
										26
									
								
								templates/j_colorbox_rateit.xhtml
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @@ -0,0 +1,26 @@ | ||||
| <?php | ||||
|  | ||||
| // Add the colorbox style sheet and javascript | ||||
| $GLOBALS['TL_CSS'][] = 'assets/jquery/colorbox/'. COLORBOX .'/css/colorbox.min.css||static'; | ||||
| $GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/rateit/public/js/jquery/colorbox/colorbox-rateit.min.js|static'; | ||||
|  | ||||
| ?> | ||||
|  | ||||
| <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> | ||||
							
								
								
									
										48
									
								
								templates/mod_article_list_rateit.html5
									
									
									
									
									
										Normal 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> | ||||
							
								
								
									
										46
									
								
								templates/mod_article_list_rateit.xhtml
									
									
									
									
									
										Normal 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> | ||||
							
								
								
									
										64
									
								
								templates/mod_article_rateit_default_microdata_teaser.html5
									
									
									
									
									
										Normal 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> | ||||
							
								
								
									
										64
									
								
								templates/mod_article_rateit_default_microdata_teaser.xhtml
									
									
									
									
									
										Normal 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> | ||||
							
								
								
									
										48
									
								
								templates/mod_article_rateit_default_teaser.html5
									
									
									
									
									
										Normal 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> | ||||
							
								
								
									
										48
									
								
								templates/mod_article_rateit_default_teaser.xhtml
									
									
									
									
									
										Normal 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> | ||||
							
								
								
									
										25
									
								
								templates/mod_rateit_top_ratings.html5
									
									
									
									
									
										Normal 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> | ||||
							
								
								
									
										25
									
								
								templates/mod_rateit_top_ratings.xhtml
									
									
									
									
									
										Normal 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> | ||||
							
								
								
									
										32
									
								
								templates/moo_mediabox_rateit.html5
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @@ -0,0 +1,32 @@ | ||||
| <?php | ||||
|  | ||||
| // Add the mediabox style sheet and javascript | ||||
| $GLOBALS['TL_CSS'][] = 'assets/mootools/mediabox/'. MEDIABOX .'/css/mediaboxAdvBlack21.css||static'; | ||||
| $GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/rateit/public/js/mootools/mediabox/mediabox-rateit.js|static'; | ||||
|  | ||||
| ?> | ||||
|  | ||||
| <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> | ||||
							
								
								
									
										33
									
								
								templates/moo_mediabox_rateit.xhtml
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @@ -0,0 +1,33 @@ | ||||
| <?php | ||||
|  | ||||
| // Add the mediabox style sheet | ||||
| $GLOBALS['TL_CSS'][] = 'assets/mootools/mediabox/'. MEDIABOX .'/css/mediaboxAdvBlack21.css||static'; | ||||
| $GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/rateit/public/js/mootools/mediabox/mediabox-rateit.js|static'; | ||||
|  | ||||
| ?> | ||||
|  | ||||
| <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> | ||||
							
								
								
									
										82
									
								
								templates/news_full_rateit.html5
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @@ -0,0 +1,82 @@ | ||||
|  | ||||
| <?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 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; ?> | ||||
							
								
								
									
										90
									
								
								templates/news_full_rateit.xhtml
									
									
									
									
									
										Normal 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; ?> | ||||
							
								
								
									
										99
									
								
								templates/news_full_rateit_microdata.html5
									
									
									
									
									
										Normal 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; ?> | ||||