<?php

switch($this->item->type){
	case 'cd':
		$route = 'biblio-cd';
		$refL = 'catalogue-cd';
		$title = 'Livres sonores - CD';
		break;
	case 'cassette':
		$refL = 'catalogue-cassettes';
		$route = 'biblio-cassette';
		$title = 'Livres sonores - Cassettes';
		break;
	case 'book':
		$route = 'biblio-gc';
		$refL = 'catalogue';
		$title = 'Livres en grands caractères';
		break;
	case 'braille':
	default:
		$refL = 'catalogue-braille';
		$route = 'biblio-braille';
		$title = 'Livres en braille';
		break;
}
try{
	// Zend_Debug::dump($ref = $this->navigation()->findOneBy('ref',$route),$route);
	if( $ref = $this->navigation()->findOneBy('ref',$refL)){

		$pp = array(
			'route' => 'biblio-view',
			'module'=> 'biblio',
			'controller' => 'index',
			'action' => 'view',
			'params' => array(
				'key' => $this->item->key,
			)
		);
		$page = new Zend_Navigation_Page_Mvc( $pp );
		$page->setActive(true);
		$page->setVisible(false);
		$page->setLabel(  $this->item->author . ' - ' .$this->item->title );
		$ref->setActive(true);
		$ref->addPage($page);
	}
}catch(Exception $e){
	if( Alfred_Hod::isAdmin()){
		echo $e->getMessage();
	}
}

$this->isView=1;
echo '<h1>'.$title.'</h1>';
if( $this->item->isDeleted == 1){
	echo '<p class="alert alert-warning">Cette référence n\'est plus disponible</p>';
}else{
	echo $this->render( 'index/_item.phtml');
}
?>
<p>
	<a class="btn btn-md btn-primary" href="<?= $this->url(array(),$route,null) ?>">Retour</a>
</p>
