Changeset View
Changeset View
Standalone View
Standalone View
branches/5.2.x/core/kernel/db/cat_tag_processor.php
Show First 20 Lines • Show All 528 Lines • ▼ Show 20 Line(s) | |||||
return $rating_helper->ratingBar($object, true, '', $small_style); | return $rating_helper->ratingBar($object, true, '', $small_style); | ||||
} | } | ||||
function RelevanceIndicator($params) | function RelevanceIndicator($params) | ||||
{ | { | ||||
$object = $this->getObject($params); | $object = $this->getObject($params); | ||||
$search_results_table = TABLE_PREFIX.'ses_'.$this->Application->GetSID().'_'.TABLE_PREFIX.'Search'; | /** @var kSearchHelper $search_helper */ | ||||
$search_helper = $this->Application->recallObject('SearchHelper'); | |||||
$search_results_table = $search_helper->getSearchTable(); | |||||
$sql = 'SELECT Relevance | $sql = 'SELECT Relevance | ||||
FROM '.$search_results_table.' | FROM '.$search_results_table.' | ||||
WHERE ResourceId = '.$object->GetDBField('ResourceId'); | WHERE ResourceId = '.$object->GetDBField('ResourceId'); | ||||
$percents_off = (int)(100 - (100 * $this->Conn->GetOne($sql))); | $percents_off = (int)(100 - (100 * $this->Conn->GetOne($sql))); | ||||
$percents_off = ($percents_off < 0) ? 0 : $percents_off; | $percents_off = ($percents_off < 0) ? 0 : $percents_off; | ||||
if ($percents_off) { | if ($percents_off) { | ||||
$params['percent_off'] = $percents_off; | $params['percent_off'] = $percents_off; | ||||
▲ Show 20 Lines • Show All 397 Lines • ▼ Show 20 Line(s) | |||||
$categories = $perm_helper->getPermissionCategories($perm_prefix . '.' . ($object->IsNewItem() ? 'ADD' : 'MODIFY')); | $categories = $perm_helper->getPermissionCategories($perm_prefix . '.' . ($object->IsNewItem() ? 'ADD' : 'MODIFY')); | ||||
} | } | ||||
$json_helper = $this->Application->recallObject('JSONHelper'); | $json_helper = $this->Application->recallObject('JSONHelper'); | ||||
/* @var $json_helper JSONHelper */ | /* @var $json_helper JSONHelper */ | ||||
return $json_helper->encode($categories); | return $json_helper->encode($categories); | ||||
} | } | ||||
} | } | ||||
No newline at end of file |