<?php  
class ControllerModuleArticleAuthor extends Controller {
	protected function index($setting) {
		$this->language->load('module/article_author');
		
    	$this->data['heading_title'] = $this->language->get('heading_title');
    	$this->data['text_all_author'] = $this->language->get('text_all_author');
		
		$this->load->model('news/author');
		$this->data['style'] = $setting['style'];
		
		$this->data['author_list'] = $this->url->link('news/author');
		if (isset($this->request->get['author_id'])) {
		$this->data['author_id'] = $this->request->get['author_id'];
		}else{
		$this->data['author_id'] = FALSE;		
		}
		$this->data['authors'] = array();

		foreach ($this->model_news_author->getAuthors() as $result) {
      		$this->data['authors'][] = array(
        		'author' => $result['author'],
        		'author_id' => $result['author_id'],
	    		'href'  => $this->url->link('news/author/info', 'author_id=' . $result['author_id'])
      		);
    	}
		
		if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/module/article_author.tpl')) {
			$this->template = $this->config->get('config_template') . '/template/module/article_author.tpl';
		} else {
			$this->template = 'default/template/module/article_author.tpl';
		}
		
		$this->render();
	}
}
?>