<?php

$this->headLink()->appendStylesheet($this->DinamicPath().'css/table.css','all');
$translate = Zend_Registry::get('Zend_Translate');
$request = Zend_Controller_Front::getInstance()->getRequest();

if (!is_null($this->pager)){
	try {
		$paginator = $this->PagerToPaginator($this->pager,$this->select);

		$head = NULL;
		$head['nameHeader'] = array($translate->translate('ID'),$translate->translate('Title'),$translate->translate('Date'),$translate->translate('Username'),$translate->translate('State'));
		$selectData = array('id_article','article_text','article_dateTime','user_userName','nameState_name');
		$links['id_article']['link'] = $this->url(array('controller' => 'article', 'action' => 'edit'), 'default', true);
		$links['id_article']['get'][0] = 'id_article';
		$links['article_text']['link'] = $this->url(array('controller' => 'article', 'action' => 'show'), 'default', true);
		$links['article_text']['get'][0] = 'id_article';
		$columnValue = NULL;
		$hidden = NULL;
		$caption = array($translate->translate('ListArticles'));
		print $this->Table($paginator,$selectData,$columnValue,$head,$hidden,$caption,$links);
		print $this->paginationControl($this->pager,'Sliding','paginator.phtml');
	}catch (Exception $e){
		echo $e->getMessage();
	}
}else {
	echo "<p>"."Nenalezeny zaznamy"."</p>";
}
	
?>