<?php use_helper('ModalBox') ?>
<?php $sf_context->getResponse()->addJavascriptCommand('setCategory('.$tblblogentry->getEntryCategory().');'); ?>
<?php echo blogStore::getCategoryPath($tblblogentry->getEntryCategory()) ?>
<div class="doc entry">
  <h2>
    <label>
      <?php echo blogStore::getPostLink($tblblogentry->getEntryCategory(), 'entry', 'Tạo % mới') ?>
      <?php if ($tblblogentry->canEditEntry()) echo link_to('Chỉnh sửa', '/entry/edit?entry_id='.$entry_id) ?>
      <?php if ($tblblogentry->canDeleteEntry()) echo link_to('Xóa bài viêt', '/entry/delete?entry_id='.$entry_id, array('confirm'=>'Bạn có chắc chắn xóa bài viết này?')) ?>
    </label>
    <?php echo $tblblogentry->getEntryTitle() ?>
  </h2>
  <div class="content">
    <?php $content = $tblblogentry->getEntryContent(); ?>
    <?php $content = preg_replace('@src="(http://([\w\d_-]+\.)?violet\.vn)?/uploads/(resources/blog|previews/blog|blogs)/@', 'src="http://d4.violet.vn/uploads/blogs/', $content); ?>
    <?php echo htmlFilter::filterText($content); ?>
    <hr />
    <div style="float:right"><?php echo mm_link_need_login('Nhắn tin cho tác giả', $tblblogentry->getObject()->getMessageLink()) ?></div>
    <?php echo $tblblogentry->getTbluser()->getObject()->getHtmlName(), ' @ ' ?>
    <?php echo $tblblogentry->getEntryModifyDate('H:i d/m/Y'); ?>
    <?php echo '<br>', 'Số lượt xem: ', blogStatistics::recordViewEntry($tblblogentry) ?>
    <?php include_component('entry', 'showlike', array('tblblogentry' => $tblblogentry)); ?>
  </div>
</div>
<?php include_component('entry', 'listcomment') ?>
<?php include_component('entry', 'createcomment') ?>
<ul>
  <?php foreach ($tblblogentry->getRecentEntrys() as $tblblogcategoryentry): ?>
    <li><?php echo $tblblogcategoryentry->getObject()->getTitleWithLink() ?>
    (<?php echo $tblblogcategoryentry->getCeModifydate('d/m/y') ?>)
    </li>
  <?php endforeach ?>
</ul>
<?php echo link_to('print', 'entry/showprint?entry_id='.$entry_id, 'style="display:none"') ?>
