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