Text('Comments'); ?>
Text('Comments description'); ?>
paginator->count() == 0): ?>
Translate('There are no items found'); ?>
ViewGridList(array('paginator' => $this->paginator));
$headers = array('entity', 'name', 'email', 'content', 'created', 'status');
$tab = false;
if('comments' == $this->tab) {
$tab = true;
}
$currentPage = $this->paginator->getCurrentPageNumber();
$currentRouteMatch = $this->getHelperPluginManager()->getServiceLocator()->get('Application\Service\RouteMatchParams')->getRouteMatch();
foreach ($headers as $value) {
$view->addCallback($value, function($page, $view, $item) use($currentPage, $currentRouteMatch, $tab) {
$url = '#';
$order = ($tab)
?$item['orderData']
:array('current'=>'', 'url'=>'asc');
if($view && $currentRouteMatch instanceof \Zend\Mvc\Router\Http\RouteMatch) {
$url = $view->url($currentRouteMatch->getMatchedRouteName(), $currentRouteMatch->getParams(), array(
'query' => array(
'sortby' => $item['data'],
'order' => $order['url'],
'tab' => 'comments'
)
));
}
$item['title'] = sprintf('%s',
$url, $view->Translate($item['title']), $order['current']);
return $item;
}, true);
}
$view->addCallback('status', function($entity, $view) {
if($entity->getStatus() != 'Enabled') {
$link = $view->url('admin/comment', array(
'action' => 'approve',
'id' => $entity->getId()
));
return sprintf('%s %s', $entity->getStatus(), $link, $view->Translate('Approve'));
}
else {
return $entity->getStatus();
}
});
$view->addCallback('action', function($entity, $view) {
$result = array();
$link = $view->url('admin/comment', array('action'=>'reply', 'id'=>$entity->getId()));
$result[] = sprintf('%s', $link, $view->Translate('Reply'));
if($view->acl()->isAllowed('comment', 'edit_comment')) {
$link = $view->url('admin/comment', array('action'=>'edit', 'id'=>$entity->getId()));
$result[] = sprintf('%s', $link, $view->Translate('Edit'));
}
if($view->acl()->isAllowed('comment', 'remove_comment')) {
$link = $view->url('admin/comment', array(
'action' => 'delete',
'id' => $entity->getId()
));
$result[] = sprintf('%s', $link, $view->Translate('Delete'));
}
return sprintf('', join('', $result));
});
echo $view->render();
echo $this->paginationControl($this->paginator, 'Sliding', 'partial/paginator.phtml', array('name' => 'mpage', 'hash' => 'comments'));
?>