linea21-core
[ class tree: linea21-core ] [ index: linea21-core ] [ all elements ]

Source for file display.php

Documentation is available at display.php

  1. <?php
  2. /**
  3.  * @package linea21.core
  4.  * @subpackage public
  5.  * @author linea21 <info@linea21.com>
  6.  * @version $id SVN
  7.  * @access public
  8.  * @license http://opensource.org/licenses/gpl-3.0.html
  9.  */
  10.  
  11. include_once('../user/'.SQL.'.inc.php');
  12.  
  13. function DisplayLastPublications($nb) {
  14.     $data=$GLOBALS['sql_object']->DBSelect(SQL_Get_LastPublications($nb));
  15.  
  16.     $content ='<div id="home_publication">'.END_LINE;
  17.     $content.='<h2>'._t('public','last_news_h1').'</h2>'.END_LINE;
  18.     
  19.     $link_publi= array('rub'=> $GLOBALS['links'][LANGUAGE]['publication']['linkvalue']);
  20.         
  21.     for($i=0; $i<count($data); $i++) {
  22.         $publi_id=$data[$i]['publi_id'];
  23.         $publi_title=formatText($data[$i]['publi_title'],'2HTML');
  24.         $publi_resume=formatText($data[$i]['publi_resume'],'2HTML');
  25.         $link_this= array('rub'=> $GLOBALS['links'][LANGUAGE]['publication']['linkvalue'], 'id'=>$publi_id, 'name'=> $data[$i]['publi_title']);
  26.             
  27.         $content.='<div>';
  28.         $content.='<h3>'.$publi_title.'</h3>';
  29.         $content.='<a href="'.HrefMaker($link_this).'" title="'.formatText($GLOBALS['links'][LANGUAGE]['publication']['desc'].' : '.$publi_title, '2ATT').'">';
  30.         $content.=$publi_resume;
  31.         $content.='</a>';
  32.         $content.='</div><br />';
  33.     }
  34.     //$content.='<a href="'.HrefMaker($link_publi).'" title="'.$GLOBALS['links'][LANGUAGE]['publication']['desc'].'">';
  35.     //$content.='accéder à la liste des dossiers';
  36.     //$content.='</a>';
  37.     $content.='</div>    '.END_LINE;
  38.     
  39.     echo $content;
  40. }
  41.  
  42. function DisplayEdito() {
  43.     $content ='<div id="home_edito">'.END_LINE;
  44.     $content.='<h2>Bienvenue</h2>'.END_LINE;
  45.     $content.='<p>';
  46.     $content.=_t('public','edito');
  47. $content.='</p>'.END_LINE;
  48.     $content.='</div>';
  49.     echo $content;
  50. }
  51.  
  52. function DisplayGDT() {
  53.     $link_gdt= array('rub'=> $GLOBALS['links'][LANGUAGE]['workgroup']['linkvalue']);
  54.  
  55.     $content ='<div id="home_top"><div id="home_gdt">'.END_LINE;
  56.     $content.='<h2>'._t('public','workgroup_h1').'</h2>'.END_LINE;
  57.     $content.='<p>';
  58.     $content.='<a href="'.HrefMaker($link_gdt).'" title="'.formatText($GLOBALS['links'][LANGUAGE]['workgroup']['desc'], '2ATT').'">';
  59.     $content.=_t('public','workgroup_edito');
  60.     $content.='</a>';
  61.     $content.='</p>'.END_LINE;
  62.     $content.='</div>';
  63.     echo $content;
  64. }
  65.  
  66. function DisplayIDD() {
  67.     $link_idd= array('rub'=> $GLOBALS['links'][LANGUAGE]['dashboard']['linkvalue']);
  68.     $content ='<div id="home_idd">'.END_LINE;
  69.     $content.='<h2>'._t('public','dashboard_h1').'</h2>'.END_LINE;
  70.     $content.='<p>';
  71.     $content.='<a href="'.HrefMaker($link_idd).'" title="'.formatText($GLOBALS['links'][LANGUAGE]['dashboard']['desc'], '2ATT').'">';
  72.     $content.=_t('public','dashboard_edito');
  73.     $content.='</a>';
  74.     $content.='</p>'.END_LINE;
  75.     $content.='</div></div>';
  76.     echo $content;
  77. }
  78.  
  79. /**
  80.  * DisplayMenu()
  81.  * Affichage du menu
  82.  *
  83.  * @return void ( echo string )
  84.  */
  85. function DisplayMenu()
  86. {
  87.   //$content .= '<a href="#contenu" class="semnone" title="'._t('header','goto_contents').'" accesskey="2">'._t('header','goto_contents').'</a>'.END_LINE;
  88.   $content = '<ul>'.END_LINE;
  89.   $content .= '    <li><a href="'.HrefMaker(array('rub' => $GLOBALS['links'][LANGUAGE]['home']['linkvalue'])).'" accesskey="1" title="'.$GLOBALS['links'][LANGUAGE]['home']['desc'].'">'.$GLOBALS['links'][LANGUAGE]['home']['title'].'</a></li>'.END_LINE;
  90.   while (list($key, $value) = each ($GLOBALS['menuitems'])) {
  91.  
  92.     (ActiveItemAlias($GLOBALS['activeitem']) == $value) ? $classe = ' class="actif"' : $classe = '' ;
  93.     $current_link = array('rub' => $GLOBALS['links'][LANGUAGE][$value]['linkvalue']);
  94.     $content .= '<li id="menu_'.$value.'">';
  95.     $content .= '<a href="' . HrefMaker($current_link) . '" title="' . $GLOBALS['links'][LANGUAGE][$value]['desc'] . '" accesskey="' . $GLOBALS['links'][LANGUAGE][$value]['accesskey'] . '" id="amenu_'.$value.'"'.$classe.'>' . $GLOBALS['links'][LANGUAGE][$value]['title'] . '</a>';
  96.     $content .= '</li>' . END_LINE;
  97.   }
  98.   $content .= "</ul>";
  99.   echo $content;
  100. }
  101.  
  102. /**
  103.  * MyAccount()
  104.  * Renvoie les liens de creation de compte ou de déconnexion
  105.  * suivant le statut de l'utilisateur
  106.  *
  107.  * @return string content
  108.  */
  109. function MyAccount()
  110. {
  111.   $link_account = array('rub' => $GLOBALS['links'][LANGUAGE]['user-prefs']['linkvalue']);
  112.   $content  = '<div><h3>'._t('header','myaccount').'</h3>';
  113.   $content .= '<ul id="account">' . END_LINE;
  114.   $content .= '<li><a href="' . HrefMaker($link_account) . '" accesskey="u" title="'._t('header','myaccount_title').'">' . _t('header','myaccount') . '</a></li>';
  115.   $link_create = array('rub' => $GLOBALS['links'][LANGUAGE]['user-registration']['linkvalue']);
  116.   $link_logout = array('rub' => $GLOBALS['links'][LANGUAGE]['logout']['linkvalue']);
  117.   if (isset($_COOKIE['linea21']['whois'])) $content .= '<li><a href="' . HrefMaker($link_logout) . '" accesskey="l" title="'._t('header','deconnexion_title').'">' . _t('header','deconnexion') . '</a></li>';
  118.   else $content .= '<li><a href="' . HrefMaker($link_create) . '" accesskey="c" title="'._t('divers','user_inscription_title').'">' . _t('divers','user_inscription') . '</a></li>';
  119.   $content .= '</ul></div>' . END_LINE;
  120.   echo $content;
  121. }
  122.  
  123. /**
  124.  * AuthForm()
  125.  * Formulaire d'authentification pour login ou inscription
  126.  *
  127.  * @param string $todo 
  128.  * @return void (echo string)
  129.  */
  130. function AuthForm($todo = 'LOGON', $back = 1 )
  131. {
  132.   if($back=== 1) $back=$_SERVER['HTTP_REFERER'];
  133.  
  134.   if ($todo == 'LOGON') {
  135.     $input_hidden = $GLOBALS['links'][LANGUAGE]['user-prefs']['linkvalue'];
  136.     $div_id = 'logon';
  137.   } else {
  138.     $input_hidden = $GLOBALS['links'][LANGUAGE]['user-registration']['linkvalue'];
  139.     $div_id = 'subscribe';
  140.   }
  141.   $form = '<form action="index.php" method="post">' . END_LINE;
  142.   $form .= '<div id="' . $div_id . '">' . END_LINE;
  143.   $form .= '<label for="login" class="labelised">' . _t('divers','login') . ' : </label>' . END_LINE;
  144.   $form .= '<input type="text" maxlength="20" class="shorttextfield" name="login" id="login" />' . END_LINE;
  145.   $form .= '<br />'.END_LINE;
  146.   if ($todo == 'LOGON') {
  147.     $form .= '<label for="password" class="labelised">' . _t('divers','password') . ' : </label>' . END_LINE;
  148.     $form .= '<input type="password" maxlength="20" class="shorttextfield" name="password" id="password" />' . END_LINE;
  149.   } else {
  150.     $form .= '<label for="email" class="labelised">' . _t('divers','email') . ' : </label>' . END_LINE;
  151.     $form .= '<input type="text" maxlength="100" class="shorttextfield" name="email" id="email" />' . END_LINE;
  152.   }
  153.   $form .= '<br />'.END_LINE;
  154.   $form .= '<input type="hidden" name="rub" id="rub" value="' . $input_hidden . '" />' . END_LINE;
  155.   $form .= '<input type="hidden" name="referer" id="referer" value="' . $back . '" />' . END_LINE;
  156.   $form .= '<input type="submit"  value="'._t('btn','valid').'" alt="'._t('btn','valid').'" title="'._t('btn','valid').'" size="15" name="valid" id="valid" />'.END_LINE;
  157.   $form .= '</div>' . END_LINE;
  158.   $form .= '</form>' . END_LINE;
  159.  
  160.   return $form;
  161. }
  162.  
  163. ?>

Documentation generated on Fri, 16 Oct 2009 09:32:17 +0200 by phpDocumentor 1.4.1