FIX открытие ссылки на точку в окне редактирования статьи
This commit is contained in:
parent
4c3586b3ea
commit
d61aa7897c
|
|
@ -9,7 +9,7 @@ class Helper
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TYPES: 'clear','html','js'
|
* TYPES: 'clear','html', 'editor','js'
|
||||||
* @param type $string
|
* @param type $string
|
||||||
* @param type $replaceType
|
* @param type $replaceType
|
||||||
* @return type
|
* @return type
|
||||||
|
|
@ -34,14 +34,22 @@ class Helper
|
||||||
|
|
||||||
switch ($replaceType) {
|
switch ($replaceType) {
|
||||||
case 'html':
|
case 'html':
|
||||||
|
// Используется при отображении страницы точки или статьи
|
||||||
$linkName = $linkName ? $linkName : '<span class="glyphicon glyphicon-link"></span>';
|
$linkName = $linkName ? $linkName : '<span class="glyphicon glyphicon-link"></span>';
|
||||||
$string = str_replace($link, '<a href="/point/' . $linkId . '" title="' . $linkTitle . '">' . $linkName . '</a>', $string);
|
$string = str_replace($link, '<a href="/point/' . $linkId . '" title="' . $linkTitle . '">' . $linkName . '</a>', $string);
|
||||||
break;
|
break;
|
||||||
|
case 'editor':
|
||||||
|
// Используется при редактировании статьи
|
||||||
|
$linkName = $linkName ? $linkName : '<span class="glyphicon glyphicon-link"></span>';
|
||||||
|
$string = str_replace($link, '<a href="/point/' . $linkId . '" title="' . $linkTitle . '" target="_blank">' . $linkName . '</a>', $string);
|
||||||
|
break;
|
||||||
case 'js':
|
case 'js':
|
||||||
|
// Используется при показе описания описания точки НА КАРТЕ
|
||||||
$linkName = $linkName ? $linkName : '<span class="glyphicon glyphicon-link"></span>';
|
$linkName = $linkName ? $linkName : '<span class="glyphicon glyphicon-link"></span>';
|
||||||
$string = str_replace($link, '<a href="/?point=' . $linkId . '" title="' . $linkTitle . '">' . $linkName . '</a>', $string);
|
$string = str_replace($link, '<a href="/?point=' . $linkId . '" title="' . $linkTitle . '">' . $linkName . '</a>', $string);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
// Для OG и т.п. - без ссылок
|
||||||
$string = str_replace($link, $linkName, $string);
|
$string = str_replace($link, $linkName, $string);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -202,7 +202,7 @@ class ArticleController extends Controller
|
||||||
$html = str_replace(array('<','>',"'"), array('<','>','′'), $html);
|
$html = str_replace(array('<','>',"'"), array('<','>','′'), $html);
|
||||||
$html = Markdown::processing($html);
|
$html = Markdown::processing($html);
|
||||||
$html = nl2br($html);
|
$html = nl2br($html);
|
||||||
$html = Helper::replaceLinks($html, 'html');
|
$html = Helper::replaceLinks($html, 'editor');
|
||||||
$html = Helper::replaceImgs($html, 'html', 'small');
|
$html = Helper::replaceImgs($html, 'html', 'small');
|
||||||
|
|
||||||
print $html;
|
print $html;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue