Compare commits
10 Commits
Author | SHA1 | Date | |
---|---|---|---|
0f080a32be | |||
3ce491f16c | |||
a6f5648fbd | |||
65bbc92119 | |||
61b4ea3613 | |||
290ac55974 | |||
121168f005 | |||
8cc7a80182 | |||
b1934458fd | |||
0bcf4fbed4 |
@ -90,7 +90,7 @@ class DcaHelper extends \Backend
|
||||
}
|
||||
} else {
|
||||
$this->Database->prepare("UPDATE tl_rateit_items SET active='' WHERE rkey=? and typ=?")
|
||||
->execute($dc->activeRecord->id, $typ)
|
||||
->execute($dc->activeRecord->id, $type)
|
||||
->updatedId;
|
||||
|
||||
}
|
||||
|
@ -92,13 +92,13 @@ class RateItArticle extends RateItFrontend {
|
||||
|
||||
$GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/rateit/public/js/onReadyRateIt.js|static';
|
||||
$GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/rateit/public/js/rateit.js|static';
|
||||
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/rateit.css||static';
|
||||
$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.css||static';
|
||||
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/heart.min.css||static';
|
||||
break;
|
||||
default:
|
||||
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/star.css||static';
|
||||
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/star.min.css||static';
|
||||
}
|
||||
}
|
||||
|
||||
@ -150,13 +150,13 @@ class RateItArticle extends RateItFrontend {
|
||||
|
||||
$GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/rateit/public/js/onReadyRateIt.js|static';
|
||||
$GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/rateit/public/js/rateit.js|static';
|
||||
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/rateit.css||static';
|
||||
$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.css||static';
|
||||
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/heart.min.css||static';
|
||||
break;
|
||||
default:
|
||||
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/star.css||static';
|
||||
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/star.min.css||static';
|
||||
}
|
||||
}
|
||||
|
||||
@ -234,13 +234,13 @@ class RateItArticle extends RateItFrontend {
|
||||
|
||||
$GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/rateit/public/js/onReadyRateIt.js|static';
|
||||
$GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/rateit/public/js/rateit.js|static';
|
||||
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/rateit.css||static';
|
||||
$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.css||static';
|
||||
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/heart.min.css||static';
|
||||
break;
|
||||
default:
|
||||
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/star.css||static';
|
||||
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/star.min.css||static';
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -633,13 +633,9 @@ class rateitBackendModule extends \BackendModule
|
||||
|
||||
$cntSql = str_replace('%s', $where, $cntSql);
|
||||
|
||||
$count = $this->Database->prepare($cntSql)
|
||||
->execute()
|
||||
->fetchRow();
|
||||
$count = $this->Database->query($cntSql)->fetchRow();
|
||||
|
||||
$arrRatingItems = $this->Database->prepare($sql)
|
||||
->execute()
|
||||
->fetchAllAssoc();
|
||||
$arrRatingItems = $this->Database->query($sql)->fetchAllAssoc();
|
||||
$arrReturn = array();
|
||||
foreach ($arrRatingItems as $rating) {
|
||||
if ($rating['active'] != '1') $rating['active'] = '0';
|
||||
|
@ -56,13 +56,13 @@ class RateItFaq extends RateItFrontend {
|
||||
|
||||
$GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/rateit/public/js/onReadyRateIt.js|static';
|
||||
$GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/rateit/public/js/rateit.js|static';
|
||||
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/rateit.css||static';
|
||||
$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.css||static';
|
||||
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/heart.min.css||static';
|
||||
break;
|
||||
default:
|
||||
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/star.css||static';
|
||||
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/star.min.css||static';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -68,13 +68,13 @@ abstract class RateItHybrid extends RateItFrontend
|
||||
|
||||
$GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/rateit/public/js/onReadyRateIt.js|static';
|
||||
$GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/rateit/public/js/rateit.js|static';
|
||||
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/rateit.css||static';
|
||||
$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.css||static';
|
||||
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/heart.min.css||static';
|
||||
break;
|
||||
default:
|
||||
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/star.css||static';
|
||||
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/star.min.css||static';
|
||||
}
|
||||
|
||||
return parent::generate();
|
||||
|
@ -71,13 +71,13 @@ class RateItNews extends RateItFrontend {
|
||||
|
||||
$GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/rateit/public/js/onReadyRateIt.js|static';
|
||||
$GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/rateit/public/js/rateit.js|static';
|
||||
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/rateit.css||static';
|
||||
$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.css||static';
|
||||
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/heart.min.css||static';
|
||||
break;
|
||||
default:
|
||||
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/star.css||static';
|
||||
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/star.min.css||static';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -40,10 +40,8 @@ class RateItPage extends \Frontend {
|
||||
$this->loadDataContainer('settings');
|
||||
}
|
||||
|
||||
public function outputFrontendTemplate($strContent, $strTemplate) {
|
||||
global $objPage;
|
||||
|
||||
if ($objPage->addRating && !($strTemplate == $GLOBALS['TL_CONFIG']['rating_template'])) {
|
||||
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();
|
||||
@ -57,16 +55,16 @@ class RateItPage extends \Frontend {
|
||||
$rating .= $this->includeJs();
|
||||
$rating .= $this->includeCss();
|
||||
|
||||
$posMainDiv = strpos($strContent, '<div id="main">');
|
||||
$posInsideDiv = strpos($strContent, '<div class="inside">', $posMainDiv);
|
||||
|
||||
$return = substr($strContent, 0, $posInsideDiv).'<div class="inside">';
|
||||
$return .= $rating;
|
||||
$return .= substr($strContent, $posInsideDiv + strlen('<div id="inside">') + 3);
|
||||
$strContent = $return;
|
||||
$objTemplate = $objPageType->Template;
|
||||
if ($objTemplate) {
|
||||
if ($objPage->rateit_position == 'after') {
|
||||
$objTemplate->main .= $rating;
|
||||
} else {
|
||||
$objTemplate->main = $rating.$objTemplate->main;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return $strContent;
|
||||
}
|
||||
|
||||
private function includeCss() {
|
||||
|
@ -69,13 +69,13 @@ class RateItTopRatingsModule extends RateItFrontend
|
||||
|
||||
$GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/rateit/public/js/onReadyRateIt.js|static';
|
||||
$GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/rateit/public/js/rateit.js|static';
|
||||
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/rateit.css||static';
|
||||
$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.css||static';
|
||||
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/heart.min.css||static';
|
||||
break;
|
||||
default:
|
||||
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/star.css||static';
|
||||
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/star.min.css||static';
|
||||
}
|
||||
|
||||
return parent::generate();
|
||||
|
@ -22,11 +22,11 @@
|
||||
"php":">=5.3",
|
||||
"contao/core":">=3.0",
|
||||
"contao-community-alliance/composer-plugin": "~2.0",
|
||||
"cgo-it/simple_ajax":"1.0.1",
|
||||
"leounglaub/contao-simple-ajax":"3.2.x-dev",
|
||||
"cgo-it/xls_export":"3.0.0"
|
||||
},
|
||||
"replace": {
|
||||
"cgo-it/rate-it": "self.version"
|
||||
"cgo-it/rate-it": "<3.4.3"
|
||||
},
|
||||
"conflict": {
|
||||
"contao/core": "2.11.*"
|
||||
|
@ -33,7 +33,7 @@ use cgoIT\rateit\RateItBackend;
|
||||
/**
|
||||
* Hooks
|
||||
*/
|
||||
$GLOBALS['TL_HOOKS']['outputFrontendTemplate'][] = array('rateit\\RateItPage', 'outputFrontendTemplate');
|
||||
$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');
|
||||
|
@ -70,11 +70,14 @@ class tl_content_rateit extends rateit\DcaHelper {
|
||||
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 {
|
||||
@ -131,56 +134,9 @@ class tl_content_rateit extends rateit\DcaHelper {
|
||||
|
||||
public function delete(\DC_Table $dc) {
|
||||
if ($dc->activeRecord->type == "gallery") {
|
||||
if (version_compare(VERSION, '3.2', '>=')) {
|
||||
$objFiles = \FilesModel::findMultipleByUuids(deserialize($dc->activeRecord->multiSRC));
|
||||
} else {
|
||||
$objFiles = \FilesModel::findMultipleByIds(deserialize($dc->activeRecord->multiSRC));
|
||||
}
|
||||
|
||||
// Get all images
|
||||
while ($objFiles->next()) {
|
||||
// Single files
|
||||
if ($objFiles->type == 'file') {
|
||||
$objFile = new \File($objFiles->path, true);
|
||||
|
||||
if (!$objFile->isGdImage) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$rkey = $dc->activeRecord->id.'_'.$objFiles->id;
|
||||
$this->Database->prepare("DELETE FROM tl_rateit_items WHERE rkey=? and typ=?")
|
||||
->execute($rkey, 'galpic');
|
||||
}
|
||||
// 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;
|
||||
}
|
||||
|
||||
$rkey = $dc->activeRecord->id.'_'.$objSubfiles->id;
|
||||
$this->Database->prepare("DELETE FROM tl_rateit_items WHERE rkey=? and typ=?")
|
||||
->execute($rkey, 'galpic');
|
||||
}
|
||||
}
|
||||
}
|
||||
$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');
|
||||
|
@ -65,7 +65,7 @@ $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'),
|
||||
'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 ''"
|
||||
|
@ -39,6 +39,7 @@ $GLOBALS['TL_DCA']['tl_page']['config']['ondelete_callback'][] = array('tl_page_
|
||||
/**
|
||||
* 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
|
||||
@ -53,13 +54,31 @@ foreach ($GLOBALS['TL_DCA']['tl_page']['palettes'] as $keyPalette => $valuePalet
|
||||
$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'],
|
||||
'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 {
|
||||
|
@ -38,7 +38,7 @@ $GLOBALS['TL_LANG']['tl_module']['rateit_legend'] = 'Rate It-Einstellungen';
|
||||
*/
|
||||
$GLOBALS['TL_LANG']['tl_module']['rateit_title'] = array('Titel der Bewertung', 'Titel der Bewertung (wird im Backend angezeigt).');
|
||||
$GLOBALS['TL_LANG']['tl_module']['rateit_active'] = array('Aktiv', 'Aktiv bedeutet, dass die Bewertung sichtbar für den Frontend-Nutzer ist.');
|
||||
$GLOBALS['TL_LANG']['tl_module']['rateit_types'] = array('Seite', 'Artikel', 'Inhaltselement', 'Modul', 'Nachrichten', 'FAQ', 'Galeriebild');
|
||||
$GLOBALS['TL_LANG']['tl_module']['rateit_types'] = array('Typen', 'Art der Bewertung');
|
||||
$GLOBALS['TL_LANG']['tl_module']['rateit_count'] = array('Max. Anzahl', 'Max. Anzahl anzuzeigender Einträge.');
|
||||
$GLOBALS['TL_LANG']['tl_module']['rateit_toptype'] = array('Art der Liste', 'Die x bestbewerteten Einträge oder die x meistbewerteten Einträge.');
|
||||
$GLOBALS['TL_LANG']['tl_module']['rateit_template'] = array('Template', 'Hier können Sie das Template für die Bewertung des Artikels auswählen.');
|
||||
@ -50,6 +50,7 @@ $GLOBALS['TL_LANG']['tl_module']['rateit_types']['module'] = 'Modul';
|
||||
$GLOBALS['TL_LANG']['tl_module']['rateit_types']['news'] = 'Nachrichten';
|
||||
$GLOBALS['TL_LANG']['tl_module']['rateit_types']['faq'] = 'FAQ';
|
||||
$GLOBALS['TL_LANG']['tl_module']['rateit_types']['galpic'] = 'Galeriebild';
|
||||
$GLOBALS['TL_LANG']['tl_module']['rateit_types']['news4ward'] = 'Beitrag';
|
||||
|
||||
$GLOBALS['TL_LANG']['tl_module']['rateit_toptype']['best'] = 'Beste Bewertungen';
|
||||
$GLOBALS['TL_LANG']['tl_module']['rateit_toptype']['most'] = 'Meiste Bewertungen';
|
||||
|
@ -31,6 +31,10 @@
|
||||
|
||||
$GLOBALS['TL_LANG']['tl_page']['rateit_legend'] = 'Rate It-Einstellungen';
|
||||
|
||||
$GLOBALS['TL_LANG']['tl_page']['addRating'] = array('Rating aktivieren', 'Aktiviert das Rating für diese Seite');
|
||||
$GLOBALS['TL_LANG']['tl_page']['addRating'] = array('Rating aktivieren', 'Aktiviert das Rating für diese Seite');
|
||||
$GLOBALS['TL_LANG']['tl_page']['rateit_position'] = array('Position', 'Position des Rating (ober- oder unterhalb) der Seite.');
|
||||
|
||||
$GLOBALS['TL_LANG']['tl_page']['before'] = array('oberhalb', 'Anzeige des Texts oberhalb der Seite');
|
||||
$GLOBALS['TL_LANG']['tl_page']['after'] = array('unterhalb', 'Anzeige des Texts unterhalb der Seite');
|
||||
|
||||
?>
|
@ -50,6 +50,7 @@ $GLOBALS['TL_LANG']['tl_module']['rateit_types']['module'] = 'Module';
|
||||
$GLOBALS['TL_LANG']['tl_module']['rateit_types']['news'] = 'News';
|
||||
$GLOBALS['TL_LANG']['tl_module']['rateit_types']['faq'] = 'FAQ';
|
||||
$GLOBALS['TL_LANG']['tl_module']['rateit_types']['galpic'] = 'Gallery Picture';
|
||||
$GLOBALS['TL_LANG']['tl_module']['rateit_types']['news4ward'] = 'Blog entry';
|
||||
|
||||
$GLOBALS['TL_LANG']['tl_module']['rateit_toptype']['best'] = 'Best votes';
|
||||
$GLOBALS['TL_LANG']['tl_module']['rateit_toptype']['most'] = 'Most votes';
|
||||
|
@ -31,6 +31,10 @@
|
||||
|
||||
$GLOBALS['TL_LANG']['tl_page']['rateit_legend'] = 'Rate It-Settings';
|
||||
|
||||
$GLOBALS['TL_LANG']['tl_page']['addRating'] = array('activate rating', 'Enables the rating for this page');
|
||||
$GLOBALS['TL_LANG']['tl_page']['addRating'] = array('activate rating', 'Enables the rating for this page');
|
||||
$GLOBALS['TL_LANG']['tl_page']['rateit_position'] = array('position', 'position of the rating (before or above) the page.');
|
||||
|
||||
$GLOBALS['TL_LANG']['tl_page']['before'] = array('above', 'Display the text above the page');
|
||||
$GLOBALS['TL_LANG']['tl_page']['after'] = array('below', 'Display the text below the page');
|
||||
|
||||
?>
|
1
public/css/heart.min.css
vendored
Normal file
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}
|
1
public/css/rateit.min.css
vendored
Normal file
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}
|
1
public/css/star.min.css
vendored
Normal file
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}
|
8
public/js/helper.min.js
vendored
Normal file
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};}
|
@ -312,9 +312,10 @@ function doRateIt() {
|
||||
el.data('selected', el.find('.rateItRating-selected'));
|
||||
el.data('hover', el.find('.rateItRating-hover'));
|
||||
|
||||
var backgroundImage = self.getBackgroundImage(el.data('wrapper'));
|
||||
self.options.starwidth = backgroundImage.width;
|
||||
self.options.starheight = backgroundImage.height / 3; // da immer drei Sterne "übereinander" gebraucht werden
|
||||
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;
|
||||
}
|
||||
@ -498,13 +499,21 @@ function doRateIt() {
|
||||
},
|
||||
|
||||
getBackgroundImage: function(el) {
|
||||
var dfd = jQuery.Deferred();
|
||||
var backgroundImageSize = new Array();
|
||||
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;
|
||||
|
||||
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) {
|
||||
@ -565,7 +574,7 @@ function doRateIt() {
|
||||
});
|
||||
jQuery.ajax({
|
||||
type: "GET",
|
||||
url: "system/modules/rateit/public/js/helper.js",
|
||||
url: "system/modules/rateit/public/js/helper.min.js",
|
||||
dataType: "script",
|
||||
async: false,
|
||||
cache: true
|
||||
|
File diff suppressed because one or more lines are too long
@ -133,8 +133,19 @@ class RateIt extends \Frontend {
|
||||
->count();
|
||||
|
||||
// Die with an error if the insert fails (duplicate IP or duplicate member id for a vote).
|
||||
if (((!$this->allowDuplicates && $countIp == 0) || $this->allowDuplicates) ||
|
||||
((!$this->allowDuplicatesForMembers && (isset($countUser) ? $countUser == 0 : false)) || ($this->allowDuplicatesForMembers && isset($userId)))) {
|
||||
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(),
|
||||
@ -147,7 +158,7 @@ class RateIt extends \Frontend {
|
||||
->set($arrSet)
|
||||
->execute();
|
||||
} else {
|
||||
header(RETURN_AJAX_HEADER);
|
||||
header(RETURN_AJAX_HEADER);
|
||||
echo $GLOBALS['TL_LANG']['rateit']['error']['duplicate_vote'];
|
||||
exit;
|
||||
}
|
||||
|
@ -1,11 +1,11 @@
|
||||
<?php
|
||||
|
||||
// Add the colorbox style sheet
|
||||
// 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 src="system/modules/rateit/public/js/jquery/colorbox/colorbox-rateit.min.js"></script>
|
||||
<script>
|
||||
(function($) {
|
||||
$(document).ready(function() {
|
||||
|
@ -1,11 +1,11 @@
|
||||
<?php
|
||||
|
||||
// Add the colorbox style sheet
|
||||
// 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" src="system/modules/rateit/public/js/jquery/colorbox/colorbox-rateit.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
/* <![CDATA[ */
|
||||
(function($) {
|
||||
|
@ -1,11 +1,11 @@
|
||||
<?php
|
||||
|
||||
// Add the mediabox style sheet
|
||||
// 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 src="system/modules/rateit/public/js/mootools/mediabox/mediabox-rateit.js"></script>
|
||||
<script>
|
||||
(function($) {
|
||||
window.addEvent('domready', function() {
|
||||
|
@ -2,10 +2,10 @@
|
||||
|
||||
// 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" src="system/modules/rateit/public/js/mootools/mediabox/mediabox-rateit.js"></script>
|
||||
<script type="text/javascript">
|
||||
/* <![CDATA[ */
|
||||
(function($) {
|
||||
|
Reference in New Issue
Block a user