Changeset View
Changeset View
Standalone View
Standalone View
branches/5.2.x/core/units/categories/categories_tag_processor.php
Show First 20 Lines • Show All 2174 Lines • ▼ Show 20 Line(s) | |||||
'no_pass_through' => 1, | 'no_pass_through' => 1, | ||||
); | ); | ||||
return $this->Application->HREF($edit_template,'', $url_params); | return $this->Application->HREF($edit_template,'', $url_params); | ||||
} | } | ||||
function RelevanceIndicator($params) | function RelevanceIndicator($params) | ||||
{ | { | ||||
/** @var kDBItem $object */ | |||||
$object = $this->getObject($params); | $object = $this->getObject($params); | ||||
/* @var $object kDBItem */ | |||||
$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; | ||||
$params['percent_on'] = 100 - $percents_off; | $params['percent_on'] = 100 - $percents_off; | ||||
$params['name'] = $this->SelectParam($params, 'relevance_normal_render_as,block_relevance_normal'); | $params['name'] = $this->SelectParam($params, 'relevance_normal_render_as,block_relevance_normal'); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 85 Lines • Show Last 20 Lines |