Exemple #1
0
function rw_enrich_options(&$settings, $dictionary = array(), $dir = 'ltr', $hor = 'right', $type = 'star')
{
    $settings = @rw_get_default_value($settings, new stdClass());
    $settings->boost = @rw_get_default_value($settings->boost, new stdClass());
    $settings->label = @rw_get_default_value($settings->label, new stdClass());
    $settings->label->text = @rw_get_default_value($settings->label->text, new stdClass());
    $settings->label->text->star = @rw_get_default_value($settings->label->text->star, new stdClass());
    $settings->label->text->nero = @rw_get_default_value($settings->label->text->nero, new stdClass());
    $settings->advanced = @rw_get_default_value($settings->advanced, new stdClass());
    $settings->advanced->font = @rw_get_default_value($settings->advanced->font, new stdClass());
    $settings->advanced->font->hover = @rw_get_default_value($settings->advanced->font->hover, new stdClass());
    $settings->advanced->layout = @rw_get_default_value($settings->advanced->layout, new stdClass());
    $settings->advanced->layout->align = @rw_get_default_value($settings->advanced->layout->align, new stdClass());
    $settings->advanced->text = @rw_get_default_value($settings->advanced->text, new stdClass());
    $settings->advanced->star = @rw_get_default_value($settings->advanced->star, new stdClass());
    $settings->advanced->nero = @rw_get_default_value($settings->advanced->nero, new stdClass());
    $settings->advanced->nero->text = @rw_get_default_value($settings->advanced->nero->text, new stdClass());
    $settings->advanced->nero->text->like = @rw_get_default_value($settings->advanced->nero->text->like, new stdClass());
    $settings->advanced->nero->text->dislike = @rw_get_default_value($settings->advanced->nero->text->dislike, new stdClass());
    $settings->lng = @rw_get_default_value($settings->lng, 'en');
    $settings->url = @rw_get_default_value($settings->url, '');
    $settings->img = @rw_get_default_value($settings->img, '');
    $settings->title = @rw_get_default_value($settings->title, '');
    $settings->type = @rw_get_default_value($settings->type, $type);
    $settings->rclass = @rw_get_default_value($settings->rclass, '');
    $settings->size = @rw_get_default_value($settings->size, 'small');
    $settings->style = @rw_get_default_value($settings->style, 'oxygen');
    $settings->imgUrl->ltr = @rw_get_default_value($settings->imgUrl->ltr, '');
    $settings->imgUrl->rtl = @rw_get_default_value($settings->imgUrl->rtl, '');
    $settings->mobile->optimized = @rw_get_default_value($settings->mobile->optimized, true);
    $settings->mobile->showTrigger = @rw_get_default_value($settings->mobile->showTrigger, true);
    $settings->readOnly = @rw_get_default_value($settings->readOnly, false);
    $settings->sync = @rw_get_default_value($settings->sync, true);
    $settings->forceSync = @rw_get_default_value($settings->forceSync, false);
    $settings->frequency = @rw_get_default_value($settings->frequency, DEF_FREQUENCY);
    $settings->showInfo = @rw_get_default_value($settings->showInfo, true);
    $settings->showTooltip = @rw_get_default_value($settings->showTooltip, true);
    $settings->showAverage = @rw_get_default_value($settings->showAverage, true);
    $settings->showReport = @rw_get_default_value($settings->showReport, true);
    $settings->showRecommendations = @rw_get_default_value($settings->showRecommendations, false);
    $settings->hideRecommendations = @rw_get_default_value($settings->hideRecommendations, false);
    $settings->showSponsored = @rw_get_default_value($settings->showSponsored, false);
    $settings->showLoader = @rw_get_default_value($settings->showLoader, true);
    $settings->beforeRate = @rw_get_default_value($settings->beforeRate, null);
    $settings->afterRate = @rw_get_default_value($settings->beforeRate, null);
    $settings->boost->votes = @rw_get_default_value($settings->boost->votes, 0);
    $settings->boost->rate = @rw_get_default_value($settings->boost->rate, 5);
    $settings->label->background = @rw_get_default_value($settings->label->background, '#FFFFFF');
    $settings->label->text->star->empty = @rw_get_default_value($settings->label->text->star->empty, '{{text.rateThis}}');
    $settings->label->text->star->normal = @rw_get_default_value($settings->label->text->star->normal, '{{text.rateThis}} ({{rating.votes}} {{text.votes}})');
    $settings->label->text->star->rated = @rw_get_default_value($settings->label->text->star->rated, '{{rating.votes}} {{text.votes}}');
    $settings->label->text->nero->empty = @rw_get_default_value($settings->label->text->nero->empty, '{{text.rateThis}}');
    $settings->label->text->nero->normal = @rw_get_default_value($settings->label->text->nero->normal, '{{text.rateThis}}');
    $settings->label->text->nero->rated = @rw_get_default_value($settings->label->text->nero->rated, '{{rating.votes}} {{text.votes}}');
    $settings->advanced->star->stars = @rw_get_default_value($settings->advanced->star->stars, 5);
    $settings->advanced->nero->showLike = @rw_get_default_value($settings->advanced->nero->showLike, true);
    $settings->advanced->nero->showDislike = @rw_get_default_value($settings->advanced->nero->showDislike, true);
    $settings->advanced->nero->text->like->empty = @rw_get_default_value($settings->advanced->nero->text->like->empty, '{{rating.likes}}');
    $settings->advanced->nero->text->like->rated = @rw_get_default_value($settings->advanced->nero->text->like->rated, '{{rating.likes}}');
    $settings->advanced->nero->text->dislike->empty = @rw_get_default_value($settings->advanced->nero->text->dislike->empty, '{{rating.dislikes}}');
    $settings->advanced->nero->text->dislike->rated = @rw_get_default_value($settings->advanced->nero->text->dislike->rated, '{{rating.dislikes}}');
    $settings->advanced->font->bold = @rw_get_default_value($settings->advanced->font->bold, false);
    $settings->advanced->font->italic = @rw_get_default_value($settings->advanced->font->italic, false);
    $settings->advanced->font->color = @rw_get_default_value($settings->advanced->font->color, '#000000');
    $settings->advanced->font->size = @rw_get_default_value($settings->advanced->font->size, '12px');
    $settings->advanced->font->type = @rw_get_default_value($settings->advanced->font->type, 'inherit');
    $settings->advanced->font->hover->color = @rw_get_default_value($settings->advanced->font->hover->color, '#000000');
    $settings->advanced->layout->dir = @rw_get_default_value($settings->advanced->layout->dir, $dir);
    $settings->advanced->layout->lineHeight = @rw_get_default_value($settings->advanced->layout->lineHeight, '18px');
    $settings->advanced->layout->align->hor = @rw_get_default_value($settings->advanced->layout->align->hor, $hor);
    $settings->advanced->layout->align->ver = @rw_get_default_value($settings->advanced->layout->align->ver, 'middle');
    $settings->advanced->text->rateAwful = @rw_get_default_value($settings->advanced->text->rateAwful, $dictionary['rateAwful']);
    $settings->advanced->text->ratePoor = @rw_get_default_value($settings->advanced->text->ratePoor, $dictionary['ratePoor']);
    $settings->advanced->text->rateAverage = @rw_get_default_value($settings->advanced->text->rateAverage, $dictionary['rateAverage']);
    $settings->advanced->text->rateGood = @rw_get_default_value($settings->advanced->text->rateGood, $dictionary['rateGood']);
    $settings->advanced->text->rateExcellent = @rw_get_default_value($settings->advanced->text->rateExcellent, $dictionary['rateExcellent']);
    $settings->advanced->text->rateThis = @rw_get_default_value($settings->advanced->text->rateThis, $dictionary['rateThis']);
    $settings->advanced->text->like = @rw_get_default_value($settings->advanced->text->like, $dictionary['like']);
    $settings->advanced->text->dislike = @rw_get_default_value($settings->advanced->text->dislike, $dictionary['dislike']);
    $settings->advanced->text->vote = @rw_get_default_value($settings->advanced->text->vote, $dictionary['vote']);
    $settings->advanced->text->votes = @rw_get_default_value($settings->advanced->text->votes, $dictionary['votes']);
    $settings->advanced->text->thanks = @rw_get_default_value($settings->advanced->text->thanks, $dictionary['thanks']);
    $settings->advanced->text->outOf = @rw_get_default_value($settings->advanced->text->outOf, $dictionary['outOf']);
    $settings->advanced->text->weRecommend = @rw_get_default_value($settings->advanced->text->weRecommend, $dictionary['weRecommend']);
}
function rw_enrich_options(&$settings, $dictionary = array(), $dir = "ltr", $hor = "right", $type = "star")
{
    $settings = @rw_get_default_value($settings, new stdClass());
    $settings->boost = @rw_get_default_value($settings->boost, new stdClass());
    $settings->label = @rw_get_default_value($settings->label, new stdClass());
    $settings->label->text = @rw_get_default_value($settings->label->text, new stdClass());
    $settings->label->text->star = @rw_get_default_value($settings->label->text->star, new stdClass());
    $settings->label->text->nero = @rw_get_default_value($settings->label->text->nero, new stdClass());
    $settings->advanced = @rw_get_default_value($settings->advanced, new stdClass());
    $settings->advanced->font = @rw_get_default_value($settings->advanced->font, new stdClass());
    $settings->advanced->font->hover = @rw_get_default_value($settings->advanced->font->hover, new stdClass());
    $settings->advanced->layout = @rw_get_default_value($settings->advanced->layout, new stdClass());
    $settings->advanced->layout->align = @rw_get_default_value($settings->advanced->layout->align, new stdClass());
    $settings->advanced->text = @rw_get_default_value($settings->advanced->text, new stdClass());
    $settings->advanced->star = @rw_get_default_value($settings->advanced->star, new stdClass());
    $settings->advanced->nero = @rw_get_default_value($settings->advanced->nero, new stdClass());
    $settings->advanced->nero->text = @rw_get_default_value($settings->advanced->nero->text, new stdClass());
    $settings->advanced->nero->text->like = @rw_get_default_value($settings->advanced->nero->text->like, new stdClass());
    $settings->advanced->nero->text->dislike = @rw_get_default_value($settings->advanced->nero->text->dislike, new stdClass());
    $settings->lng = @rw_get_default_value($settings->lng, "en");
    $settings->url = @rw_get_default_value($settings->url, '');
    $settings->img = @rw_get_default_value($settings->img, '');
    $settings->title = @rw_get_default_value($settings->title, '');
    $settings->type = @rw_get_default_value($settings->type, $type);
    $settings->rclass = @rw_get_default_value($settings->rclass, "");
    $settings->size = @rw_get_default_value($settings->size, "small");
    $settings->style = @rw_get_default_value($settings->style, "oxygen");
    $settings->imgUrl->ltr = @rw_get_default_value($settings->imgUrl->ltr, "");
    $settings->imgUrl->rtl = @rw_get_default_value($settings->imgUrl->rtl, "");
    $settings->mobile->optimized = @rw_get_default_value($settings->mobile->optimized, true);
    $settings->mobile->showTrigger = @rw_get_default_value($settings->mobile->showTrigger, true);
    $settings->readOnly = @rw_get_default_value($settings->readOnly, false);
    $settings->sync = @rw_get_default_value($settings->sync, true);
    $settings->forceSync = @rw_get_default_value($settings->forceSync, false);
    $settings->frequency = @rw_get_default_value($settings->frequency, DEF_FREQUENCY);
    $settings->showInfo = @rw_get_default_value($settings->showInfo, true);
    $settings->showTooltip = @rw_get_default_value($settings->showTooltip, true);
    $settings->showAverage = @rw_get_default_value($settings->showAverage, true);
    $settings->showReport = @rw_get_default_value($settings->showReport, true);
    $settings->showRecommendations = @rw_get_default_value($settings->showRecommendations, false);
    $settings->hideRecommendations = @rw_get_default_value($settings->hideRecommendations, false);
    $settings->showSponsored = @rw_get_default_value($settings->showSponsored, false);
    $settings->showLoader = @rw_get_default_value($settings->showLoader, true);
    $settings->beforeRate = @rw_get_default_value($settings->beforeRate, null);
    $settings->afterRate = @rw_get_default_value($settings->beforeRate, null);
    $settings->boost->votes = @rw_get_default_value($settings->boost->votes, 0);
    $settings->boost->rate = @rw_get_default_value($settings->boost->rate, 5);
    $settings->label->background = @rw_get_default_value($settings->label->background, '#FFFFFF');
    $settings->label->text->star->empty = @rw_get_default_value($settings->label->text->star->empty, '{{text.rateThis}}');
    $settings->label->text->star->normal = @rw_get_default_value($settings->label->text->star->normal, '{{text.rateThis}} ({{rating.votes}} {{text.votes}})');
    $settings->label->text->star->rated = @rw_get_default_value($settings->label->text->star->rated, '{{rating.votes}} {{text.votes}}');
    $settings->label->text->nero->empty = @rw_get_default_value($settings->label->text->nero->empty, '{{text.rateThis}}');
    $settings->label->text->nero->normal = @rw_get_default_value($settings->label->text->nero->normal, '{{text.rateThis}}');
    $settings->label->text->nero->rated = @rw_get_default_value($settings->label->text->nero->rated, '{{rating.votes}} {{text.votes}}');
    $settings->advanced->star->stars = @rw_get_default_value($settings->advanced->star->stars, 5);
    $settings->advanced->nero->showLike = @rw_get_default_value($settings->advanced->nero->showLike, true);
    $settings->advanced->nero->showDislike = @rw_get_default_value($settings->advanced->nero->showDislike, true);
    $settings->advanced->nero->text->like->empty = @rw_get_default_value($settings->advanced->nero->text->like->empty, '{{rating.likes}}');
    $settings->advanced->nero->text->like->rated = @rw_get_default_value($settings->advanced->nero->text->like->rated, '{{rating.likes}}');
    $settings->advanced->nero->text->dislike->empty = @rw_get_default_value($settings->advanced->nero->text->dislike->empty, '{{rating.dislikes}}');
    $settings->advanced->nero->text->dislike->rated = @rw_get_default_value($settings->advanced->nero->text->dislike->rated, '{{rating.dislikes}}');
    $settings->advanced->font->bold = @rw_get_default_value($settings->advanced->font->bold, false);
    $settings->advanced->font->italic = @rw_get_default_value($settings->advanced->font->italic, false);
    $settings->advanced->font->color = @rw_get_default_value($settings->advanced->font->color, "#000000");
    $settings->advanced->font->size = @rw_get_default_value($settings->advanced->font->size, "12px");
    $settings->advanced->font->type = @rw_get_default_value($settings->advanced->font->type, "inherit");
    $settings->advanced->font->hover->color = @rw_get_default_value($settings->advanced->font->hover->color, "#000000");
    $settings->advanced->layout->dir = @rw_get_default_value($settings->advanced->layout->dir, $dir);
    $settings->advanced->layout->lineHeight = @rw_get_default_value($settings->advanced->layout->lineHeight, "18px");
    $settings->advanced->layout->align->hor = @rw_get_default_value($settings->advanced->layout->align->hor, $hor);
    $settings->advanced->layout->align->ver = @rw_get_default_value($settings->advanced->layout->align->ver, "middle");
    $settings->advanced->text->rateAwful = @rw_get_default_value($settings->advanced->text->rateAwful, $dictionary["rateAwful"]);
    $settings->advanced->text->ratePoor = @rw_get_default_value($settings->advanced->text->ratePoor, $dictionary["ratePoor"]);
    $settings->advanced->text->rateAverage = @rw_get_default_value($settings->advanced->text->rateAverage, $dictionary["rateAverage"]);
    $settings->advanced->text->rateGood = @rw_get_default_value($settings->advanced->text->rateGood, $dictionary["rateGood"]);
    $settings->advanced->text->rateExcellent = @rw_get_default_value($settings->advanced->text->rateExcellent, $dictionary["rateExcellent"]);
    $settings->advanced->text->rateThis = @rw_get_default_value($settings->advanced->text->rateThis, $dictionary["rateThis"]);
    $settings->advanced->text->like = @rw_get_default_value($settings->advanced->text->like, $dictionary["like"]);
    $settings->advanced->text->dislike = @rw_get_default_value($settings->advanced->text->dislike, $dictionary["dislike"]);
    $settings->advanced->text->vote = @rw_get_default_value($settings->advanced->text->vote, $dictionary["vote"]);
    $settings->advanced->text->votes = @rw_get_default_value($settings->advanced->text->votes, $dictionary["votes"]);
    $settings->advanced->text->thanks = @rw_get_default_value($settings->advanced->text->thanks, $dictionary["thanks"]);
    $settings->advanced->text->outOf = @rw_get_default_value($settings->advanced->text->outOf, $dictionary["outOf"]);
    $settings->advanced->text->weRecommend = @rw_get_default_value($settings->advanced->text->weRecommend, $dictionary["weRecommend"]);
}
function rw_enrich_options(&$settings, $dictionary = array(), $dir = "ltr", $hor = "right", $type = "star")
{
    $settings = @rw_get_default_value($settings, new stdClass());
    $settings->boost = @rw_get_default_value($settings->boost, new stdClass());
    $settings->advanced = @rw_get_default_value($settings->advanced, new stdClass());
    $settings->advanced->font = @rw_get_default_value($settings->advanced->font, new stdClass());
    $settings->advanced->font->hover = @rw_get_default_value($settings->advanced->font->hover, new stdClass());
    $settings->advanced->layout = @rw_get_default_value($settings->advanced->layout, new stdClass());
    $settings->advanced->layout->align = @rw_get_default_value($settings->advanced->layout->align, new stdClass());
    $settings->advanced->text = @rw_get_default_value($settings->advanced->text, new stdClass());
    $settings->lng = @rw_get_default_value($settings->lng, "en");
    $settings->url = @rw_get_default_value($settings->url, "");
    $settings->title = @rw_get_default_value($settings->title, "");
    $settings->type = @rw_get_default_value($settings->type, $type);
    $settings->rclass = @rw_get_default_value($settings->rclass, "");
    $settings->size = @rw_get_default_value($settings->size, "small");
    $settings->color = @rw_get_default_value($settings->color, "yellow");
    $settings->style = @rw_get_default_value($settings->style, "oxygen");
    $settings->imgUrl = @rw_get_default_value($settings->imgUrl, "");
    $settings->readOnly = @rw_get_default_value($settings->readOnly, false);
    $settings->showInfo = @rw_get_default_value($settings->showInfo, true);
    $settings->showTooltip = @rw_get_default_value($settings->showTooltip, true);
    $settings->beforeRate = @rw_get_default_value($settings->beforeRate, null);
    $settings->afterRate = @rw_get_default_value($settings->beforeRate, null);
    $settings->boost->votes = @rw_get_default_value($settings->boost->votes, 0);
    $settings->boost->rate = @rw_get_default_value($settings->boost->rate, 5);
    $settings->advanced->font->bold = @rw_get_default_value($settings->advanced->font->bold, false);
    $settings->advanced->font->italic = @rw_get_default_value($settings->advanced->font->italic, false);
    $settings->advanced->font->color = @rw_get_default_value($settings->advanced->font->color, "#000");
    $settings->advanced->font->size = @rw_get_default_value($settings->advanced->font->size, "12px");
    $settings->advanced->font->type = @rw_get_default_value($settings->advanced->font->type, "inherit");
    $settings->advanced->font->hover->color = @rw_get_default_value($settings->advanced->font->hover->color, "#000");
    $settings->advanced->layout->dir = @rw_get_default_value($settings->advanced->layout->dir, $dir);
    $settings->advanced->layout->lineHeight = @rw_get_default_value($settings->advanced->layout->lineHeight, "18px");
    $settings->advanced->layout->align->hor = @rw_get_default_value($settings->advanced->layout->align->hor, $hor);
    $settings->advanced->layout->align->ver = @rw_get_default_value($settings->advanced->layout->align->ver, "middle");
    $settings->advanced->text->rateAwful = @rw_get_default_value($settings->advanced->text->rateAwful, $dictionary["rateAwful"]);
    $settings->advanced->text->ratePoor = @rw_get_default_value($settings->advanced->text->ratePoor, $dictionary["ratePoor"]);
    $settings->advanced->text->rateAverage = @rw_get_default_value($settings->advanced->text->rateAverage, $dictionary["rateAverage"]);
    $settings->advanced->text->rateGood = @rw_get_default_value($settings->advanced->text->rateGood, $dictionary["rateGood"]);
    $settings->advanced->text->rateExcellent = @rw_get_default_value($settings->advanced->text->rateExcellent, $dictionary["rateExcellent"]);
    $settings->advanced->text->rateThis = @rw_get_default_value($settings->advanced->text->rateThis, $dictionary["rateThis"]);
    $settings->advanced->text->like = @rw_get_default_value($settings->advanced->text->like, $dictionary["like"]);
    $settings->advanced->text->dislike = @rw_get_default_value($settings->advanced->text->dislike, $dictionary["dislike"]);
    $settings->advanced->text->vote = @rw_get_default_value($settings->advanced->text->vote, $dictionary["vote"]);
    $settings->advanced->text->votes = @rw_get_default_value($settings->advanced->text->votes, $dictionary["votes"]);
    $settings->advanced->text->thanks = @rw_get_default_value($settings->advanced->text->thanks, $dictionary["thanks"]);
}