<?php
/**
 * Default newsletter template
 * 
 * This file can be overriden. Discover logic and examples on :
 * @url http://dev.linea21.com/projects/linea21/wiki/Override
 * @url http://dev.linea21.com/projects/linea21/wiki/Personnalisation_de_l%27interface_publique
 * 
 * @package linea21\core\public
 * @author $Author$ - linea21 <info@linea21.com>
 * @version $Id$ 
 * @access public
 * @license http://opensource.org/licenses/gpl-3.0.html
 */
?>

<?php
//////////////////////////////////////////
/////affichage newsletter
//////////////////////////////////////////

if(ActiveItemKey($GLOBALS['activeitem']) == 'newsletter') {

  SetHTMLTitle('Newsletter'); // set HTML title
  setBreadcrumb(array(ucfirst(formatText('Newsletter', '2HTML')) => HrefMaker(array('rub'=> $GLOBALS['links'][U_L]['newsletter']['linkvalue']))));

  include_once(override('../newsletter/display.php'));

  if(isset($_REQUEST['id']) && is_numeric($_REQUEST['id'])) $id=$_REQUEST['id']; else $id=null;

  echo '<h1>'.mb_ucfirst(_t('name', 'newsletter_module')).'</h1>'.PHP_EOL;

  $id = displayNewsletter($id);
  
  $newsletters = newslettersList($id);

  if(!empty($newsletters)){
	  echo '<div class="nav">'.PHP_EOL;
	  echo '<h2>'._t('divers', 'previous_newsletter').'</h2>'.PHP_EOL;
	  echo $newsletters;
	  echo '</div>'.PHP_EOL;
  }
}

?>