<?php
/**
 * @package linea21.core
 * @subpackage public
 * @author linea21 <info@linea21.com>
 * @version $id SVN
 * @access public
 * @license http://opensource.org/licenses/gpl-3.0.html
 */

include_once('../user/'.SQL.'.inc.php');

function DisplayLastPublications($nb) {
	$data=$GLOBALS['sql_object']->DBSelect(SQL_Get_LastPublications($nb));

	$content ='<div id="home_publication">'.END_LINE;
	$content.='<h1>'.$GLOBALS['lang']['public']['last_news_h1'].'</h1>'.END_LINE;
	
	$link_publi= array('rub'=> $GLOBALS['links'][LANGUAGE]['publication']['linkvalue']);
		
	for($i=0; $i<count($data); $i++) {
		$publi_id=$data[$i]['publi_id'];
		$publi_title=formatText($data[$i]['publi_title'],'2HTML');
		$publi_resume=formatText($data[$i]['publi_resume'],'2HTML');
		$link_this= array('rub'=> $GLOBALS['links'][LANGUAGE]['publication']['linkvalue'], 'id'=>$publi_id, 'name'=> $data[$i]['publi_title']);
			
		$content.='<div>';
		$content.='<h2>'.$publi_title.'</h2>';
		$content.='<a href="'.HrefMaker($link_this).'" title="'.formatText($GLOBALS['links'][LANGUAGE]['publication']['desc'].' : '.$publi_title, '2ATT').'">';
		$content.=$publi_resume;
		$content.='</a>';
		$content.='</div><br />';
	}
	//$content.='<a href="'.HrefMaker($link_publi).'" title="'.$GLOBALS['links'][LANGUAGE]['publication']['desc'].'">';
	//$content.='accéder à la liste des dossiers';
	//$content.='</a>';
	$content.='</div>	'.END_LINE;
	
	echo $content;
}

function DisplayEdito() {
	$content ='<div id="home_edito">'.END_LINE;
	$content.='<h1>Edito</h1>'.END_LINE;
	$content.='<p>';
	$content.='
	<img src="../gfx/' .THEME_PUBLIC. '/images/public/edito.gif" alt="edito_habillage" />';
	$content.=$GLOBALS['lang']['public']['edito'];
$content.='</p>'.END_LINE;
	$content.='</div>';
	echo $content;
}

function DisplayGDT() {
	$link_gdt= array('rub'=> $GLOBALS['links'][LANGUAGE]['workgroup']['linkvalue']);

	$content ='<div id="home_top"><div id="home_gdt">'.END_LINE;
	$content.='<h1>'.$GLOBALS['lang']['public']['workgroup_h1'].'</h1>'.END_LINE;
	$content.='<p>';
	$content.='<a href="'.HrefMaker($link_gdt).'" title="'.formatText($GLOBALS['links'][LANGUAGE]['workgroup']['desc'], '2ATT').'">';
	$content.=$GLOBALS['lang']['public']['workgroup_edito'];
	$content.='</a>';
	$content.='</p>'.END_LINE;
	$content.='</div>';
	echo $content;
}

function DisplayIDD() {
	$link_idd= array('rub'=> $GLOBALS['links'][LANGUAGE]['dashboard']['linkvalue']);
	
	$content ='<div id="home_idd">'.END_LINE;
	$content.='<h1>'.$GLOBALS['lang']['public']['dashboard_h1'].'</h1>'.END_LINE;
	$content.='<p>';
	$content.='<a href="'.HrefMaker($link_idd).'" title="'.formatText($GLOBALS['links'][LANGUAGE]['dashboard']['desc'], '2ATT').'">';
	$content.=$GLOBALS['lang']['public']['dashboard_edito'];
	$content.='</a>';
	$content.='</p>'.END_LINE;
	$content.='</div></div>';
	echo $content;
}
?>

