if($this->_config[’absoluteLink’]){
$cLink = $tempDocInfo[’link’];
$tempDocInfo[’link’] = ($cLink != $modx->config[’site_url’]) ? $modx->config[’site_url’] . $cLink : $cLink;
}
//Create the link
if ($this->_config[’useWeblinkUrl’] !== ’FALSE’ && $tempDocInfo[’type’] == ’reference’) {
if (is_numeric($tempDocInfo[’content’])) {
$tempDocInfo[’link’] = $modx->makeUrl(intval($tempDocInfo[’content’]));
} else {
$tempDocInfo[’link’] = $tempDocInfo[’content’];
}
} elseif ($tempDocInfo[’id’] == $modx->config[’site_start’]) {
$tempDocInfo[’link’] = $modx->config[’site_url’];
} else {
$tempDocInfo[’link’] = $modx->makeUrl($tempDocInfo[’id’]);
}
<?php// for highlighting only
$resultIds = array();
//loop through the results
for($i=0;$i<$numResults;$i++) {
$internLink = true;//added this line
$tempDocInfo = $modx->fetchRow($result);
$resultIds[] = $tempDocInfo['id'];
//Create the link
if ($this->_config['useWeblinkUrl'] !== 'FALSE' && $tempDocInfo['type'] == 'reference') {
if (is_numeric($tempDocInfo['content'])) {
$tempDocInfo['link'] = $modx->makeUrl(intval($tempDocInfo['content']));
} else {
$internLink = false;//this one too
$tempDocInfo['link'] = $tempDocInfo['content'];
}
} elseif ($tempDocInfo['id'] == $modx->config['site_start']) {
$tempDocInfo['link'] = $modx->config['site_url'];
} else {
$tempDocInfo['link'] = $modx->makeUrl($tempDocInfo['id']);
}
//and this block
if($this->_config['absoluteLink'] && $internLink){
$cLink = $tempDocInfo['link'];
$tempDocInfo['link'] = ($cLink != $modx->config['site_url']) ? $modx->config['site_url'] . $cLink : $cLink;
}
//determine the level, if parent has changed
if ($prevParent !== $tempDocInfo['parent']) {
$level = count($modx->getParentIds($tempDocInfo['id'])) + 1 - $startLevel;
}
//add parent to hasChildren array for later processing
if (($level > 1 || $this->_config['displayStart']) && !in_array($tempDocInfo['parent'],$this->hasChildren)) {
$this->hasChildren[] = $tempDocInfo['parent'];
}
//set the level
$tempDocInfo['level'] = $level;
$prevParent = $tempDocInfo['parent'];
//determine other output options
$useTextField = (empty($tempDocInfo[$this->_config['textOfLinks']])) ? 'pagetitle' : $this->_config['textOfLinks'];
$tempDocInfo['linktext'] = $tempDocInfo[$useTextField];
$tempDocInfo['title'] = $tempDocInfo[$this->_config['titleOfLinks']];
//If tvs were specified keep array flat otherwise array becomes level->parent->doc
if (!empty($this->tvList)) {
$tempResults[] = $tempDocInfo;
} else {
$resourceArray[$tempDocInfo['level']][$tempDocInfo['parent']][] = $tempDocInfo;
}
}