public function getPostContent($post, $moreText = true, $moreLink = false, $cut = false)
{
if ($moreLink === true) {
$moreLink = '≫ 続きを読む';
}
$out = '<div class="post-body">' . $post['BlogPost']['content'] . '</div>';
if ($moreText && $post['BlogPost']['detail']) {
$out .= '<div id="post-detail">' . $post['BlogPost']['detail'] . '</div>';
}
if ($cut) {
$out = str_replace(array("\r\n", "\r", "\n"), '', $out);
$out = html_entity_decode($out, ENT_QUOTES, 'UTF-8');
$out = mb_substr(strip_tags($out), 0, $cut, 'UTF-8');
}
if ($moreLink && trim($post['BlogPost']['detail']) && trim($post['BlogPost']['detail']) != "<br>") {
if (!isset($this->Html)) {
App::uses('HtmlHelper', 'View/Helper');
$this->Html = new HtmlHelper($this->_View);
}
$out .= '<p class="more">' . $this->Html->link($moreLink, $this->request->params['Content']['url'] . 'archives/' . $post['BlogPost']['no'] . '#post-detail', null, null, false) . '</p>';
}
return $out;
}