Anpassung Pfad zu public Ressourcen
This commit is contained in:
parent
9cef234103
commit
38d4df8232
@ -90,15 +90,15 @@ class RateItArticle extends RateItFrontend {
|
|||||||
$objTemplate->rateit_rating_after = true;
|
$objTemplate->rateit_rating_after = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
$GLOBALS['TL_JAVASCRIPT'][] = 'bundles/cgoitrateit/public/js/onReadyRateIt.js|static';
|
$GLOBALS['TL_JAVASCRIPT'][] = 'bundles/cgoitrateit/js/onReadyRateIt.js|static';
|
||||||
$GLOBALS['TL_JAVASCRIPT'][] = 'bundles/cgoitrateit/public/js/rateit.js|static';
|
$GLOBALS['TL_JAVASCRIPT'][] = 'bundles/cgoitrateit/js/rateit.js|static';
|
||||||
$GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/public/css/rateit.min.css||static';
|
$GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/css/rateit.min.css||static';
|
||||||
switch ($GLOBALS['TL_CONFIG']['rating_type']) {
|
switch ($GLOBALS['TL_CONFIG']['rating_type']) {
|
||||||
case 'hearts' :
|
case 'hearts' :
|
||||||
$GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/public/css/heart.min.css||static';
|
$GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/css/heart.min.css||static';
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/public/css/star.min.css||static';
|
$GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/css/star.min.css||static';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -148,15 +148,15 @@ class RateItArticle extends RateItFrontend {
|
|||||||
$article['rateit_rating_after'] = true;
|
$article['rateit_rating_after'] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
$GLOBALS['TL_JAVASCRIPT'][] = 'bundles/cgoitrateit/public/js/onReadyRateIt.js|static';
|
$GLOBALS['TL_JAVASCRIPT'][] = 'bundles/cgoitrateit/js/onReadyRateIt.js|static';
|
||||||
$GLOBALS['TL_JAVASCRIPT'][] = 'bundles/cgoitrateit/public/js/rateit.js|static';
|
$GLOBALS['TL_JAVASCRIPT'][] = 'bundles/cgoitrateit/js/rateit.js|static';
|
||||||
$GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/public/css/rateit.min.css||static';
|
$GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/css/rateit.min.css||static';
|
||||||
switch ($GLOBALS['TL_CONFIG']['rating_type']) {
|
switch ($GLOBALS['TL_CONFIG']['rating_type']) {
|
||||||
case 'hearts' :
|
case 'hearts' :
|
||||||
$GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/public/css/heart.min.css||static';
|
$GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/css/heart.min.css||static';
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/public/css/star.min.css||static';
|
$GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/css/star.min.css||static';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -232,15 +232,15 @@ class RateItArticle extends RateItFrontend {
|
|||||||
|
|
||||||
$objTemplate->arrRating = $arrRating;
|
$objTemplate->arrRating = $arrRating;
|
||||||
|
|
||||||
$GLOBALS['TL_JAVASCRIPT'][] = 'bundles/cgoitrateit/public/js/onReadyRateIt.js|static';
|
$GLOBALS['TL_JAVASCRIPT'][] = 'bundles/cgoitrateit/js/onReadyRateIt.js|static';
|
||||||
$GLOBALS['TL_JAVASCRIPT'][] = 'bundles/cgoitrateit/public/js/rateit.js|static';
|
$GLOBALS['TL_JAVASCRIPT'][] = 'bundles/cgoitrateit/js/rateit.js|static';
|
||||||
$GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/public/css/rateit.min.css||static';
|
$GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/css/rateit.min.css||static';
|
||||||
switch ($GLOBALS['TL_CONFIG']['rating_type']) {
|
switch ($GLOBALS['TL_CONFIG']['rating_type']) {
|
||||||
case 'hearts' :
|
case 'hearts' :
|
||||||
$GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/public/css/heart.min.css||static';
|
$GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/css/heart.min.css||static';
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/public/css/star.min.css||static';
|
$GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/css/star.min.css||static';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,15 +59,15 @@ class RateItFaq extends RateItFrontend {
|
|||||||
$strBuffer = $this->generateForFaqPage($objModule, $strBuffer);
|
$strBuffer = $this->generateForFaqPage($objModule, $strBuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
$GLOBALS['TL_JAVASCRIPT'][] = 'bundles/cgoitrateit/public/js/onReadyRateIt.js|static';
|
$GLOBALS['TL_JAVASCRIPT'][] = 'bundles/cgoitrateit/js/onReadyRateIt.js|static';
|
||||||
$GLOBALS['TL_JAVASCRIPT'][] = 'bundles/cgoitrateit/public/js/rateit.js|static';
|
$GLOBALS['TL_JAVASCRIPT'][] = 'bundles/cgoitrateit/js/rateit.js|static';
|
||||||
$GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/public/css/rateit.min.css||static';
|
$GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/css/rateit.min.css||static';
|
||||||
switch ($GLOBALS['TL_CONFIG']['rating_type']) {
|
switch ($GLOBALS['TL_CONFIG']['rating_type']) {
|
||||||
case 'hearts' :
|
case 'hearts' :
|
||||||
$GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/public/css/heart.min.css||static';
|
$GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/css/heart.min.css||static';
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/public/css/star.min.css||static';
|
$GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/css/star.min.css||static';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -66,15 +66,15 @@ abstract class RateItHybrid extends RateItFrontend
|
|||||||
$this->strType = $GLOBALS['TL_CONFIG']['rating_type'];
|
$this->strType = $GLOBALS['TL_CONFIG']['rating_type'];
|
||||||
$this->strTextPosition = $GLOBALS['TL_CONFIG']['rating_textposition'];
|
$this->strTextPosition = $GLOBALS['TL_CONFIG']['rating_textposition'];
|
||||||
|
|
||||||
$GLOBALS['TL_JAVASCRIPT'][] = 'bundles/cgoitrateit/public/js/onReadyRateIt.js|static';
|
$GLOBALS['TL_JAVASCRIPT'][] = 'bundles/cgoitrateit/js/onReadyRateIt.js|static';
|
||||||
$GLOBALS['TL_JAVASCRIPT'][] = 'bundles/cgoitrateit/public/js/rateit.js|static';
|
$GLOBALS['TL_JAVASCRIPT'][] = 'bundles/cgoitrateit/js/rateit.js|static';
|
||||||
$GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/public/css/rateit.min.css||static';
|
$GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/css/rateit.min.css||static';
|
||||||
switch ($this->strType) {
|
switch ($this->strType) {
|
||||||
case 'hearts' :
|
case 'hearts' :
|
||||||
$GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/public/css/heart.min.css||static';
|
$GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/css/heart.min.css||static';
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/public/css/star.min.css||static';
|
$GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/css/star.min.css||static';
|
||||||
}
|
}
|
||||||
|
|
||||||
return parent::generate();
|
return parent::generate();
|
||||||
|
@ -69,15 +69,15 @@ class RateItNews extends RateItFrontend {
|
|||||||
$objTemplate->rateit_rating_after = true;
|
$objTemplate->rateit_rating_after = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
$GLOBALS['TL_JAVASCRIPT'][] = 'bundles/cgoitrateit/public/js/onReadyRateIt.js|static';
|
$GLOBALS['TL_JAVASCRIPT'][] = 'bundles/cgoitrateit/js/onReadyRateIt.js|static';
|
||||||
$GLOBALS['TL_JAVASCRIPT'][] = 'bundles/cgoitrateit/public/js/rateit.js|static';
|
$GLOBALS['TL_JAVASCRIPT'][] = 'bundles/cgoitrateit/js/rateit.js|static';
|
||||||
$GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/public/css/rateit.min.css||static';
|
$GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/css/rateit.min.css||static';
|
||||||
switch ($GLOBALS['TL_CONFIG']['rating_type']) {
|
switch ($GLOBALS['TL_CONFIG']['rating_type']) {
|
||||||
case 'hearts' :
|
case 'hearts' :
|
||||||
$GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/public/css/heart.min.css||static';
|
$GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/css/heart.min.css||static';
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/public/css/star.min.css||static';
|
$GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/css/star.min.css||static';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -76,7 +76,7 @@ class RateItPage extends \Frontend {
|
|||||||
$strHeadTags = '';
|
$strHeadTags = '';
|
||||||
if (is_array($GLOBALS['TL_CSS'])) {
|
if (is_array($GLOBALS['TL_CSS'])) {
|
||||||
foreach ($GLOBALS['TL_CSS'] as $script) {
|
foreach ($GLOBALS['TL_CSS'] as $script) {
|
||||||
if ($this->startsWith($script, 'bundles/cgoitrateit/public/css/rateit') === true) {
|
if ($this->startsWith($script, 'bundles/cgoitrateit/css/rateit') === true) {
|
||||||
$included = true;
|
$included = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -84,13 +84,13 @@ class RateItPage extends \Frontend {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!$included) {
|
if (!$included) {
|
||||||
$strHeadTags = '<link rel="stylesheet" href="'.$this->addStaticUrlTo('bundles/cgoitrateit/public/css/rateit.min.css').'">';
|
$strHeadTags = '<link rel="stylesheet" href="'.$this->addStaticUrlTo('bundles/cgoitrateit/css/rateit.min.css').'">';
|
||||||
switch ($GLOBALS['TL_CONFIG']['rating_type']) {
|
switch ($GLOBALS['TL_CONFIG']['rating_type']) {
|
||||||
case 'hearts' :
|
case 'hearts' :
|
||||||
$strHeadTags .= '<link rel="stylesheet" href="'.$this->addStaticUrlTo('bundles/cgoitrateit/public/css/heart.min.css').'">';
|
$strHeadTags .= '<link rel="stylesheet" href="'.$this->addStaticUrlTo('bundles/cgoitrateit/css/heart.min.css').'">';
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$strHeadTags .= '<link rel="stylesheet" href="'.$this->addStaticUrlTo('bundles/cgoitrateit/public/css/star.min.css').'">';
|
$strHeadTags .= '<link rel="stylesheet" href="'.$this->addStaticUrlTo('bundles/cgoitrateit/css/star.min.css').'">';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $strHeadTags;
|
return $strHeadTags;
|
||||||
@ -101,7 +101,7 @@ class RateItPage extends \Frontend {
|
|||||||
$strHeadTags = '';
|
$strHeadTags = '';
|
||||||
if (is_array($GLOBALS['TL_JAVASCRIPT'])) {
|
if (is_array($GLOBALS['TL_JAVASCRIPT'])) {
|
||||||
foreach ($GLOBALS['TL_JAVASCRIPT'] as $script) {
|
foreach ($GLOBALS['TL_JAVASCRIPT'] as $script) {
|
||||||
if ($this->startsWith($script, 'bundles/cgoitrateit/public/js/rateit') === true) {
|
if ($this->startsWith($script, 'bundles/cgoitrateit/js/rateit') === true) {
|
||||||
$included = true;
|
$included = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -109,8 +109,8 @@ class RateItPage extends \Frontend {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!$included) {
|
if (!$included) {
|
||||||
$strHeadTags = '<script' . (($objPage->outputFormat == 'xhtml') ? ' type="text/javascript"' : '') . ' src="' . $this->addStaticUrlTo('bundles/cgoitrateit/public/js/onReadyRateIt.js') . '"></script>' . "\n";
|
$strHeadTags = '<script' . (($objPage->outputFormat == 'xhtml') ? ' type="text/javascript"' : '') . ' src="' . $this->addStaticUrlTo('bundles/cgoitrateit/js/onReadyRateIt.js') . '"></script>' . "\n";
|
||||||
$strHeadTags .= '<script' . (($objPage->outputFormat == 'xhtml') ? ' type="text/javascript"' : '') . ' src="' . $this->addStaticUrlTo('bundles/cgoitrateit/public/js/rateit.js') . '"></script>' . "\n";
|
$strHeadTags .= '<script' . (($objPage->outputFormat == 'xhtml') ? ' type="text/javascript"' : '') . ' src="' . $this->addStaticUrlTo('bundles/cgoitrateit/js/rateit.js') . '"></script>' . "\n";
|
||||||
}
|
}
|
||||||
return $strHeadTags;
|
return $strHeadTags;
|
||||||
}
|
}
|
||||||
|
@ -36,13 +36,13 @@ namespace cgoIT\rateit;
|
|||||||
class RateItTopRatingsModule extends RateItFrontend
|
class RateItTopRatingsModule extends RateItFrontend
|
||||||
{
|
{
|
||||||
private static $arrUrlCache = array();
|
private static $arrUrlCache = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the controller
|
* Initialize the controller
|
||||||
*/
|
*/
|
||||||
public function __construct($objElement) {
|
public function __construct($objElement) {
|
||||||
parent::__construct($objElement);
|
parent::__construct($objElement);
|
||||||
|
|
||||||
$this->strKey = "rateit_top_ratings";
|
$this->strKey = "rateit_top_ratings";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -62,22 +62,22 @@ class RateItTopRatingsModule extends RateItFrontend
|
|||||||
|
|
||||||
return $objTemplate->parse();
|
return $objTemplate->parse();
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->strTemplate = $this->rateit_template;
|
$this->strTemplate = $this->rateit_template;
|
||||||
|
|
||||||
$this->arrTypes = deserialize($this->rateit_types);
|
$this->arrTypes = deserialize($this->rateit_types);
|
||||||
|
|
||||||
$GLOBALS['TL_JAVASCRIPT'][] = 'bundles/cgoitrateit/public/js/onReadyRateIt.js|static';
|
$GLOBALS['TL_JAVASCRIPT'][] = 'bundles/cgoitrateit/js/onReadyRateIt.js|static';
|
||||||
$GLOBALS['TL_JAVASCRIPT'][] = 'bundles/cgoitrateit/public/js/rateit.js|static';
|
$GLOBALS['TL_JAVASCRIPT'][] = 'bundles/cgoitrateit/js/rateit.js|static';
|
||||||
$GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/public/css/rateit.min.css||static';
|
$GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/css/rateit.min.css||static';
|
||||||
switch ($GLOBALS['TL_CONFIG']['rating_type']) {
|
switch ($GLOBALS['TL_CONFIG']['rating_type']) {
|
||||||
case 'hearts' :
|
case 'hearts' :
|
||||||
$GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/public/css/heart.min.css||static';
|
$GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/css/heart.min.css||static';
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/public/css/star.min.css||static';
|
$GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/css/star.min.css||static';
|
||||||
}
|
}
|
||||||
|
|
||||||
return parent::generate();
|
return parent::generate();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -86,9 +86,9 @@ class RateItTopRatingsModule extends RateItFrontend
|
|||||||
*/
|
*/
|
||||||
protected function compile() {
|
protected function compile() {
|
||||||
$this->Template = new \FrontendTemplate($this->strTemplate);
|
$this->Template = new \FrontendTemplate($this->strTemplate);
|
||||||
|
|
||||||
$this->Template->setData($this->arrData);
|
$this->Template->setData($this->arrData);
|
||||||
|
|
||||||
$this->import("\\Database", "Database");
|
$this->import("\\Database", "Database");
|
||||||
$arrResult = $this->Database->prepare("SELECT i.id AS item_id,
|
$arrResult = $this->Database->prepare("SELECT i.id AS item_id,
|
||||||
i.rkey AS rkey,
|
i.rkey AS rkey,
|
||||||
@ -114,32 +114,32 @@ class RateItTopRatingsModule extends RateItFrontend
|
|||||||
$return = new \stdClass();
|
$return = new \stdClass();
|
||||||
$return->title = $result['title'];
|
$return->title = $result['title'];
|
||||||
$return->typ = $result['typ'];
|
$return->typ = $result['typ'];
|
||||||
|
|
||||||
// ID ermitteln
|
// ID ermitteln
|
||||||
$stars = $this->percentToStars($result['best']);
|
$stars = $this->percentToStars($result['best']);
|
||||||
$return->rateItID = 'rateItRating-'.$result['rkey'].'-'.$result['typ'].'-'.
|
$return->rateItID = 'rateItRating-'.$result['rkey'].'-'.$result['typ'].'-'.
|
||||||
$stars.'_'.intval($GLOBALS['TL_CONFIG']['rating_count']);
|
$stars.'_'.intval($GLOBALS['TL_CONFIG']['rating_count']);
|
||||||
$return->descriptionId = 'rateItRating-'.$result['rkey'].'-description';
|
$return->descriptionId = 'rateItRating-'.$result['rkey'].'-description';
|
||||||
|
|
||||||
$return->rateit_class = 'rateItRating';
|
$return->rateit_class = 'rateItRating';
|
||||||
|
|
||||||
$return->url = $this->getUrl($result);
|
$return->url = $this->getUrl($result);
|
||||||
|
|
||||||
// Beschriftung ermitteln
|
// Beschriftung ermitteln
|
||||||
$rating = array();
|
$rating = array();
|
||||||
$rating['totalRatings'] = $result['most'];
|
$rating['totalRatings'] = $result['most'];
|
||||||
$rating['rating'] = $result['best'];
|
$rating['rating'] = $result['best'];
|
||||||
$return->description = $this->getStarMessage($rating);
|
$return->description = $this->getStarMessage($rating);
|
||||||
|
|
||||||
$return->rating = $result['best'];
|
$return->rating = $result['best'];
|
||||||
$return->count = $result['most'];
|
$return->count = $result['most'];
|
||||||
$return->rel = 'not-rateable';
|
$return->rel = 'not-rateable';
|
||||||
$objReturn[] = $return;
|
$objReturn[] = $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->Template->arrRatings = $objReturn;
|
$this->Template->arrRatings = $objReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function getUrl($rating) {
|
private function getUrl($rating) {
|
||||||
if ($rating['typ'] === 'page') {
|
if ($rating['typ'] === 'page') {
|
||||||
return \PageModel::findById($rating['rkey'])->getAbsoluteUrl();
|
return \PageModel::findById($rating['rkey'])->getAbsoluteUrl();
|
||||||
@ -153,25 +153,25 @@ class RateItTopRatingsModule extends RateItFrontend
|
|||||||
if ($rating['typ'] === 'news') {
|
if ($rating['typ'] === 'news') {
|
||||||
$objNews = \NewsModel::findById($rating['rkey']);
|
$objNews = \NewsModel::findById($rating['rkey']);
|
||||||
$objArticle = \NewsModel::findPublishedByPid($objNews->pid);
|
$objArticle = \NewsModel::findPublishedByPid($objNews->pid);
|
||||||
|
|
||||||
// Internal link
|
// Internal link
|
||||||
if ($objArticle->source != 'external') {
|
if ($objArticle->source != 'external') {
|
||||||
return $this->generateNewsUrl($objNews);
|
return $this->generateNewsUrl($objNews);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Encode e-mail addresses
|
// Encode e-mail addresses
|
||||||
if (substr($objArticle->url, 0, 7) == 'mailto:') {
|
if (substr($objArticle->url, 0, 7) == 'mailto:') {
|
||||||
$strArticleUrl = \StringUtil::encodeEmail($objArticle->url);
|
$strArticleUrl = \StringUtil::encodeEmail($objArticle->url);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ampersand URIs
|
// Ampersand URIs
|
||||||
else {
|
else {
|
||||||
$strArticleUrl = ampersand($objArticle->url);
|
$strArticleUrl = ampersand($objArticle->url);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @var \PageModel $objPage */
|
/** @var \PageModel $objPage */
|
||||||
global $objPage;
|
global $objPage;
|
||||||
|
|
||||||
// External link
|
// External link
|
||||||
return $strArticleUrl;
|
return $strArticleUrl;
|
||||||
}
|
}
|
||||||
@ -180,15 +180,15 @@ class RateItTopRatingsModule extends RateItFrontend
|
|||||||
|
|
||||||
private function generateNewsUrl($objItem) {
|
private function generateNewsUrl($objItem) {
|
||||||
$strCacheKey = 'id_' . $objItem->id;
|
$strCacheKey = 'id_' . $objItem->id;
|
||||||
|
|
||||||
// Load the URL from cache
|
// Load the URL from cache
|
||||||
if (isset(self::$arrUrlCache[$strCacheKey])) {
|
if (isset(self::$arrUrlCache[$strCacheKey])) {
|
||||||
return self::$arrUrlCache[$strCacheKey];
|
return self::$arrUrlCache[$strCacheKey];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initialize the cache
|
// Initialize the cache
|
||||||
self::$arrUrlCache[$strCacheKey] = null;
|
self::$arrUrlCache[$strCacheKey] = null;
|
||||||
|
|
||||||
switch ($objItem->source) {
|
switch ($objItem->source) {
|
||||||
// Link to an external page
|
// Link to an external page
|
||||||
case 'external' :
|
case 'external' :
|
||||||
@ -198,7 +198,7 @@ class RateItTopRatingsModule extends RateItFrontend
|
|||||||
self::$arrUrlCache[$strCacheKey] = ampersand($objItem->url);
|
self::$arrUrlCache[$strCacheKey] = ampersand($objItem->url);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// Link to an internal page
|
// Link to an internal page
|
||||||
case 'internal' :
|
case 'internal' :
|
||||||
if (($objTarget = $objItem->getRelated('jumpTo')) !== null) {
|
if (($objTarget = $objItem->getRelated('jumpTo')) !== null) {
|
||||||
@ -206,7 +206,7 @@ class RateItTopRatingsModule extends RateItFrontend
|
|||||||
self::$arrUrlCache[$strCacheKey] = ampersand($objTarget->getFrontendUrl());
|
self::$arrUrlCache[$strCacheKey] = ampersand($objTarget->getFrontendUrl());
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// Link to an article
|
// Link to an article
|
||||||
case 'article' :
|
case 'article' :
|
||||||
if (($objArticle = \ArticleModel::findByPk($objItem->articleId, array(
|
if (($objArticle = \ArticleModel::findByPk($objItem->articleId, array(
|
||||||
@ -217,25 +217,25 @@ class RateItTopRatingsModule extends RateItFrontend
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Link to the default page
|
// Link to the default page
|
||||||
if (self::$arrUrlCache[$strCacheKey] === null) {
|
if (self::$arrUrlCache[$strCacheKey] === null) {
|
||||||
$objPage = \PageModel::findWithDetails($objItem->getRelated('pid')->jumpTo);
|
$objPage = \PageModel::findWithDetails($objItem->getRelated('pid')->jumpTo);
|
||||||
|
|
||||||
if ($objPage === null) {
|
if ($objPage === null) {
|
||||||
self::$arrUrlCache[$strCacheKey] = ampersand(\Environment::get('request'), true);
|
self::$arrUrlCache[$strCacheKey] = ampersand(\Environment::get('request'), true);
|
||||||
} else {
|
} else {
|
||||||
self::$arrUrlCache[$strCacheKey] = ampersand($objPage->getFrontendUrl(((\Config::get('useAutoItem') && ! \Config::get('disableAlias')) ? '/' : '/items/') . ((! \Config::get('disableAlias') && $objItem->alias != '') ? $objItem->alias : $objItem->id)));
|
self::$arrUrlCache[$strCacheKey] = ampersand($objPage->getFrontendUrl(((\Config::get('useAutoItem') && ! \Config::get('disableAlias')) ? '/' : '/items/') . ((! \Config::get('disableAlias') && $objItem->alias != '') ? $objItem->alias : $objItem->id)));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add the current archive parameter (news archive)
|
// Add the current archive parameter (news archive)
|
||||||
if ($blnAddArchive && \Input::get('month') != '') {
|
if ($blnAddArchive && \Input::get('month') != '') {
|
||||||
self::$arrUrlCache[$strCacheKey] .= (\Config::get('disableAlias') ? '&' : '?') . 'month=' . \Input::get('month');
|
self::$arrUrlCache[$strCacheKey] .= (\Config::get('disableAlias') ? '&' : '?') . 'month=' . \Input::get('month');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return self::$arrUrlCache[$strCacheKey];
|
return self::$arrUrlCache[$strCacheKey];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
// Add the colorbox style sheet and javascript
|
// Add the colorbox style sheet and javascript
|
||||||
$GLOBALS['TL_CSS'][] = 'assets/jquery/colorbox/'. COLORBOX .'/css/colorbox.min.css||static';
|
$GLOBALS['TL_CSS'][] = 'assets/jquery/colorbox/'. COLORBOX .'/css/colorbox.min.css||static';
|
||||||
$GLOBALS['TL_JAVASCRIPT'][] = 'bundles/cgoitrateit/public/js/jquery/colorbox/colorbox-rateit.min.js|static';
|
$GLOBALS['TL_JAVASCRIPT'][] = 'bundles/cgoitrateit/js/jquery/colorbox/colorbox-rateit.min.js|static';
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
// Add the colorbox style sheet and javascript
|
// Add the colorbox style sheet and javascript
|
||||||
$GLOBALS['TL_CSS'][] = 'assets/jquery/colorbox/'. COLORBOX .'/css/colorbox.min.css||static';
|
$GLOBALS['TL_CSS'][] = 'assets/jquery/colorbox/'. COLORBOX .'/css/colorbox.min.css||static';
|
||||||
$GLOBALS['TL_JAVASCRIPT'][] = 'bundles/cgoitrateit/public/js/jquery/colorbox/colorbox-rateit.min.js|static';
|
$GLOBALS['TL_JAVASCRIPT'][] = 'bundles/cgoitrateit/js/jquery/colorbox/colorbox-rateit.min.js|static';
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
// Add the mediabox style sheet and javascript
|
// Add the mediabox style sheet and javascript
|
||||||
$GLOBALS['TL_CSS'][] = 'assets/mootools/mediabox/'. MEDIABOX .'/css/mediaboxAdvBlack21.css||static';
|
$GLOBALS['TL_CSS'][] = 'assets/mootools/mediabox/'. MEDIABOX .'/css/mediaboxAdvBlack21.css||static';
|
||||||
$GLOBALS['TL_JAVASCRIPT'][] = 'bundles/cgoitrateit/public/js/mootools/mediabox/mediabox-rateit.js|static';
|
$GLOBALS['TL_JAVASCRIPT'][] = 'bundles/cgoitrateit/js/mootools/mediabox/mediabox-rateit.js|static';
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
// Add the mediabox style sheet
|
// Add the mediabox style sheet
|
||||||
$GLOBALS['TL_CSS'][] = 'assets/mootools/mediabox/'. MEDIABOX .'/css/mediaboxAdvBlack21.css||static';
|
$GLOBALS['TL_CSS'][] = 'assets/mootools/mediabox/'. MEDIABOX .'/css/mediaboxAdvBlack21.css||static';
|
||||||
$GLOBALS['TL_JAVASCRIPT'][] = 'bundles/cgoitrateit/public/js/mootools/mediabox/mediabox-rateit.js|static';
|
$GLOBALS['TL_JAVASCRIPT'][] = 'bundles/cgoitrateit/js/mootools/mediabox/mediabox-rateit.js|static';
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
@ -567,14 +567,14 @@ function doRateIt() {
|
|||||||
jQuery(document).ready(function() {
|
jQuery(document).ready(function() {
|
||||||
jQuery.ajax({
|
jQuery.ajax({
|
||||||
type: "GET",
|
type: "GET",
|
||||||
url: "bundles/cgoitrateit/public/js/jquery-ui-effects.custom.min.js",
|
url: "bundles/cgoitrateit/js/jquery-ui-effects.custom.min.js",
|
||||||
dataType: "script",
|
dataType: "script",
|
||||||
async: false,
|
async: false,
|
||||||
cache: true
|
cache: true
|
||||||
});
|
});
|
||||||
jQuery.ajax({
|
jQuery.ajax({
|
||||||
type: "GET",
|
type: "GET",
|
||||||
url: "bundles/cgoitrateit/public/js/helper.min.js",
|
url: "bundles/cgoitrateit/js/helper.min.js",
|
||||||
dataType: "script",
|
dataType: "script",
|
||||||
async: false,
|
async: false,
|
||||||
cache: true
|
cache: true
|
||||||
|
@ -20,5 +20,5 @@ el.data('selected').css('width',el.data('newFill'));},mouseCrap:function(event){
|
|||||||
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 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;}
|
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;}}}
|
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:"bundles/cgoitrateit/public/js/jquery-ui-effects.custom.min.js",dataType:"script",async:false,cache:true});jQuery.ajax({type:"GET",url:"bundles/cgoitrateit/public/js/helper.min.js",dataType:"script",async:false,cache:true});RateItRating=Object.create(RateItRatings).initialize({url:'SimpleAjaxFrontend.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;};}}
|
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:"bundles/cgoitrateit/js/jquery-ui-effects.custom.min.js",dataType:"script",async:false,cache:true});jQuery.ajax({type:"GET",url:"bundles/cgoitrateit/js/helper.min.js",dataType:"script",async:false,cache:true});RateItRating=Object.create(RateItRatings).initialize({url:'SimpleAjaxFrontend.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();});
|
onReadyRateIt(function(){doRateIt();});
|
Loading…
Reference in New Issue
Block a user