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

Source for file display.php

Documentation is available at display.php

  1. <?php
  2. /**
  3.  * @package linea21.modules
  4.  * @subpackage publication
  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(themePath('../publication/'.SQL.'.inc.php'));
  12.  
  13. if(!function_exists('DisplayListPublication')) {
  14.  
  15.   function DisplayListPublication($statut$filter$id_filter$debut{
  16.  
  17.     if($statut=='public'{
  18.       $pas=100;
  19.       $suffix='';
  20.     else $pas=SELECT_LIMIT;
  21.     if($statut=='archives_p'$suffix=' '._t('statut','PA');
  22.     $data=$GLOBALS['sql_object'-> DBSelect(SQL_getPublicationList($debut$pas$statut$filter$id_filter));
  23.     $datacount=$GLOBALS['sql_object'-> DBSelect(SQL_getCountPublicationList($statut$filter$id_filter));
  24.     $bdd_nb_com=$datacount[0]['num_rows'];
  25.     $bdd_nb_com_display '<p>'.$bdd_nb_com.' '._t('publication','name2').' '.$suffix.'</p>'.END_LINE;
  26.  
  27.     $content'<h1>'._t('publication','listing').'</h1>'.END_LINE;
  28.     $content.='<div class="sub-title">';
  29.     $content.=_t('publication','h1_public_comment');
  30.     $content.='</div>';
  31.     if($data!=0)
  32.     {
  33.       //echo $bdd_nb_com_display;
  34.       $current_link array('rub' => $GLOBALS['links'][U_L]['publication-archives']['linkvalue']);
  35.       Display_linkin_page($current_link,$bdd_nb_com$debut$pas);
  36.       for($i=0$i<count($data)$i++{
  37.         $link_detailarray('rub'=> $GLOBALS['links'][U_L]['publication']['linkvalue'],'id'=>$data[$i]['publi_id']'name' => $data[$i]['publi_title']);
  38.         $link_themearray('rub'=> $GLOBALS['links'][U_L]['publication']['linkvalue'],'filter'=> $GLOBALS['filters'][U_L]['theme']['linkvalue'],'id'=>$data[$i]['sdtheme_id']'name' =>  $data[$i]['sdtheme_name']);
  39.         $link_levelarray('rub'=> $GLOBALS['links'][U_L]['publication']['linkvalue'],'filter'=> $GLOBALS['filters'][U_L]['level']['linkvalue'],'id'=>$data[$i]['publi_level']'name' =>  $data[$i]['level_name']);
  40.         $link_scalearray('rub'=> $GLOBALS['links'][U_L]['publication']['linkvalue'],'filter'=> $GLOBALS['filters'][U_L]['scale']['linkvalue'],'id'=>$data[$i]['publi_scale']'name' =>  $data[$i]['scale_denomination']);
  41.         $link_userarray('rub'=> $GLOBALS['links'][U_L]['user-profile']['linkvalue'],'id'=>$data[$i]['publi_posted_by']'name' => $data[$i]['user_login']);
  42.         $publi_title=formatText($data[$i]['complete_publi_title']'2HTML');
  43.         $publi_resume=formatText($data[$i]['publi_resume']'2HTML');
  44.         $publi_sdtheme=formatText($data[$i]['sdtheme_name']'2HTML');
  45.         $level_name=formatText($data[$i]['level_name']'2HTML');
  46.         $scale_denomination=formatText($data[$i]['scale_denomination']'2HTML');
  47.         $publi_posted_on=formatText($data[$i]['publi_published_date_display']'2HTML');
  48.         $publi_posted_by=formatText($data[$i]['user_login']'2HTML');
  49.          
  50.         $content.='<h2>'.END_LINE;
  51.         $content.='<a href="'.HrefMaker($link_detail).'" title="'.$publi_title.'">'.$publi_title.'</a>'.END_LINE;
  52.         $content.='</h2>'.END_LINE;
  53.         $content.='<p class="published_by">'.END_LINE;
  54.         $content.=_t('statut','published_on'' ' .$publi_posted_on.' ';
  55.         $content.=_t('divers','by').' <a href="'.HrefMaker($link_user).'" title="'.formatText($GLOBALS['links'][U_L]['user-profile']['desc']' ('.$publi_posted_by.')''2ATT').'">'.$publi_posted_by.'</a>';
  56.         $content.='</p>'.END_LINE;
  57.         $content.='<div class="chapo">'.$publi_resume.'</div>'.END_LINE;
  58.         $content .= '<a class="readmore" href="'.HrefMaker($link_detail).'">'._t('btn''read_more').'</a>';
  59.         $content.='<p class="filter_info">';
  60.         $content .= _t('divers','level'' : ';
  61.         $content.='<a href="'.HrefMaker($link_level).'" title="'.formatText($GLOBALS['filters'][U_L]['level']['desc'].' : '.$level_name'2ATT').'" class="filter_info_level">'.$level_name.'</a> '.END_LINE;
  62.         $content .= _t('divers','themeref'' : ';
  63.         $content.='<a href="'.HrefMaker($link_theme).'" title="'.formatText($GLOBALS['filters'][U_L]['theme']['desc'].' : '.$publi_sdtheme'2ATT').'" class="filter_info_theme">'.$publi_sdtheme.'</a>'.END_LINE;
  64.         $content .= _t('divers','scale'' : ';
  65.         $content.='<a href="'.HrefMaker($link_scale).'" title="'.formatText($GLOBALS['filters'][U_L]['scale']['desc'].' : '.$scale_denomination'2ATT').'" class="filter_info_scale">'.$scale_denomination.'</a>'.END_LINE;
  66.         $content.='</p>'.END_LINE;
  67.         $content.='<hr />'.END_LINE;
  68.       }
  69.     }
  70.     else
  71.     {
  72.       $content.='<p class="info">'._t('divers','nodata').'</p>';
  73.     }
  74.  
  75.     echo $content;
  76.   }
  77. }
  78.  
  79. if(!function_exists('DisplayOnePublication')) {
  80.  
  81.   function DisplayOnePublication($publi_id{
  82.     $data=$GLOBALS['sql_object'-> DBSelect(SQL_getoneCompletePublication($publi_id'P'));
  83.     $content '';
  84.     if(count($data)!=1exit;
  85.     else
  86.     {
  87.       $link_themearray('rub'=> $GLOBALS['links'][U_L]['publication']['linkvalue'],'filter'=> $GLOBALS['filters'][U_L]['theme']['linkvalue'],'id'=>$data[0]['theme_sd_theme']'name' => $data[0]['sdtheme_name']);
  88.       $link_levelarray('rub'=> $GLOBALS['links'][U_L]['publication']['linkvalue'],'filter'=> $GLOBALS['filters'][U_L]['level']['linkvalue'],'id'=>$data[0]['publi_level']'name' => $data[0]['level_name']);
  89.       $link_scalearray('rub'=> $GLOBALS['links'][U_L]['publication']['linkvalue'],'filter'=> $GLOBALS['filters'][U_L]['scale']['linkvalue'],'id'=>$data[0]['publi_scale']'name' => $data[0]['scale_denomination']);
  90.       $link_userarray('rub'=> $GLOBALS['links'][U_L]['user-profile']['linkvalue'],'id'=>$data[0]['publi_posted_by']'name' => $data[0]['user_login']);
  91.       $link_self array('rub' => $GLOBALS['links'][U_L]['publication']['linkvalue']'id' => $publi_id);
  92.        
  93.       $publi_title=formatText($data[0]['publi_title']'2HTML');
  94.       $publi_resume=linkin_content(formatText($data[0]['publi_resume']'2HTML'));
  95.        
  96.       $publi_sdtheme=formatText($data[0]['sdtheme_name']'2HTML');
  97.       $publi_scale_denomination=formatText($data[0]['scale_denomination']'2HTML');
  98.       $publi_theme=formatText($data[0]['theme_name']'2HTML');
  99.       $publi_level=formatText($data[0]['level_name']'2HTML');
  100.        
  101.       $publi_posted_on=formatText($data[0]['publi_published_date_display']'2HTML');
  102.       $publi_posted_by=formatText($data[0]['user_login']'2HTML');
  103.       $publi_modify_on=formatText($data[0]['publi_last_modify_display']'2HTML');
  104.       $publi_statut=$data[0]['publi_statut'];
  105.        
  106.       // workrep_workshop_id
  107.     if(commentEnabled('publication')) {
  108.         postCommentAction(array('module'=> ActiveItemKey($GLOBALS['activeitem'])'module_id'=> $publi_id));
  109.         $content .= '<div id="anchor-comments">'.END_LINE;
  110.         $content .= getCommentsAnchor(array('module'=> ActiveItemKey($GLOBALS['activeitem'])'module_id'=> $publi_id));
  111.         if($publi_statut == 'P'$content .= getPostCommentAnchor(array('module'=> ActiveItemKey($GLOBALS['activeitem'])'module_id'=> $publi_id));
  112.         $content .= '</div>'.END_LINE;
  113.       }
  114.       $content.='<h1>'.$publi_title.'</h1>'.END_LINE;
  115.       $content.='<p class="published_by">'.END_LINE;
  116.       $content.=_t('statut','published_on').' '.$publi_posted_on.' ';
  117.       $content.=_t('divers','by').' <a href="'.HrefMaker($link_user).'" title="'.$GLOBALS['links'][U_L]['user-profile']['desc']' ('.$publi_posted_by.')">'.$publi_posted_by.'</a>';
  118.       if($publi_statut=='PA')  {
  119.         $content.=' ('._t('statut','archived_on').' '.$publi_modify_on.')';
  120.       }
  121.       $content .= formatted_permalink($link_self' - ');
  122.       $content.='</p>'.END_LINE;
  123.       $content.='<div class="chapo">'.$publi_resume.'</div>';
  124.  
  125.       $content.='<p class="filter_info">';
  126.       $content.=_t('divers','level').' : '.END_LINE;
  127.       $content.='<a href="'.HrefMaker($link_level).'" title="'.formatText($GLOBALS['filters'][U_L]['level']['desc'].' : '.$publi_level'2ATT').'" class="filter_info_level">'.$publi_level.'</a> '.END_LINE;
  128.       $content.=_t('divers','themeref').' : '.END_LINE;
  129.       $content.='<a href="'.HrefMaker($link_theme).'" title="'.formatText($GLOBALS['filters'][U_L]['theme']['desc'].' : '.$publi_sdtheme'2ATT').'" class="filter_info_theme">'.$publi_sdtheme.'</a>'.END_LINE;
  130.       //$content._t('divers','sousthemeref').' : '.END_LINE;
  131.       //$content.=$publi_theme.END_LINE;
  132.       $content.=_t('divers','scale').' : ';
  133.       $content.='<a href="'.HrefMaker($link_scale).'" title="'.formatText($GLOBALS['filters'][U_L]['scale']['desc'].' : '.$publi_scale_denomination'2ATT').'" class="filter_info_scale">'.$publi_scale_denomination.'</a>'.END_LINE;
  134.       $content.='</p>'.END_LINE;
  135.       $content.='<hr />'.END_LINE;
  136.  
  137.        
  138.     }
  139.     echo $content;
  140.     
  141.     return $publi_statut;
  142.     
  143.   }
  144. }
  145.  
  146. if(!function_exists('DisplayPublicationParts')) {
  147.  
  148.   function DisplayPublicationParts($publi_id{
  149.     $data=$GLOBALS['sql_object'-> DBSelect(SQL_getPublicationParts($publi_id));
  150.     $content ='<div class="parts">'.END_LINE;
  151.     $content.='<h2>'._t('publication','parts').'</h2>'.END_LINE;
  152.     if($data!=0)
  153.     {
  154.       $content.='<ol>'.END_LINE;
  155.       for($i=0$i<count($data)$i++{
  156.         $link_partsarray('rub'=> $GLOBALS['links'][U_L]['publication-part']['linkvalue'],'id'=> $data[$i]['publicon_id'],'parentid'=>$publi_id'name' => $data[$i]['publicon_title']);
  157.         $publicon_title=formatText($data[$i]['publicon_title']'2HTML');
  158.         $content.='<li>'.END_LINE;
  159.         //$content.='<span class="num">'.($i+1).' - </span>'.END_LINE;
  160.         $content.='<a href="'HrefMaker($link_parts).'">';
  161.         $content.=$publicon_title;
  162.         $content.='</a>';
  163.         $content.='</li>'.END_LINE;
  164.       }
  165.       $content.='</ol>'.END_LINE;
  166.     }
  167.     else
  168.     {
  169.       $content.='<p class="info">'._t('publication','no_part').'</p>';
  170.     }
  171.     $content.='</div>'.END_LINE;
  172.     //$content.='<hr />';
  173.  
  174.     echo $content;
  175.   }
  176. }
  177.  
  178. if(!function_exists('DisplayPublicationLinks')) {
  179.  
  180.   function DisplayPublicationLinks($publi_id{
  181.  
  182.     $data=SQL_GetResources($publi_id'P''LINK'$GLOBALS['sql_object']);
  183.     $content ='<div class="links">'.END_LINE;
  184.     $content.='<h2>'._t('publication','link_res').'</h2>'.END_LINE;
  185.     if($data!=0)
  186.     {
  187.       $content.='<ul>'.END_LINE;
  188.       for($i=0$i<count($data)$i++{
  189.         $linkres_mask=formatText($data[$i]['linkres_mask']'2HTML');
  190.         $linkres_text=$data[$i]['linkres_text'];
  191.         $content.='<li>'.END_LINE;
  192.         $content.='<a href="'$linkres_text.'" class="out">';
  193.         $content.=$linkres_mask;
  194.         $content.='</a>';
  195.         $content.='</li>'.END_LINE;
  196.       }
  197.       $content.='</ul>'.END_LINE;
  198.  
  199.     }
  200.     else
  201.     {
  202.       $content.='<p class="info">'._t('publication','no_link').'</p>';
  203.     }
  204.     $content.='</div>'.END_LINE;
  205.     //$content.='<hr />'.END_LINE;
  206.  
  207.     echo $content;
  208.   }
  209. }
  210.  
  211. if(!function_exists('DisplayPublicationBiblio')) {
  212.  
  213.   function DisplayPublicationBiblio($publi_id{
  214.  
  215.     $data=SQL_GetResources($publi_id'P''BIBLIO'$GLOBALS['sql_object']);
  216.     $content ='<div class="biblio">'.END_LINE;
  217.     $content.='<h2>'._t('publication','biblio_res').'</h2>'.END_LINE;
  218.     if($data!=0)
  219.     {
  220.       $content.='<ul>'.END_LINE;
  221.       for($i=0$i<count($data)$i++{
  222.         $bibliores_author=formatText($data[$i]['bibliores_author']'2HTML');
  223.         $bibliores_title=formatText($data[$i]['bibliores_title']'2HTML');
  224.         $bibliores_sub_title=empty($data[$i]['bibliores_sub_title']?  '' ', '.formatText($data[$i]['bibliores_sub_title']'2HTML');
  225.         $bibliores_editor=empty($data[$i]['bibliores_editor']?  '' ' - '.formatText($data[$i]['bibliores_editor']'2HTML');
  226.         $bibliores_date=empty($data[$i]['bibliores_date']?  '' ', '.formatText($data[$i]['bibliores_date']'2HTML');
  227.          
  228.         $content.='<li>'.END_LINE;
  229.         $content.=$bibliores_author.' - <span class="biblio_title">'.$bibliores_title;
  230.         $content.=$bibliores_sub_title.'</span>'$bibliores_editor.$bibliores_date;
  231.         $content.='</li>'.END_LINE;
  232.       }
  233.       $content.='</ul>'.END_LINE;
  234.  
  235.     }
  236.     else
  237.     {
  238.       $content.='<p class="info">'._t('publication','no_biblio').'</p>';
  239.     }
  240.     $content.='</div>'.END_LINE;
  241.     //$content.='<hr />'.END_LINE;
  242.  
  243.     echo $content;
  244.   }
  245. }
  246.  
  247. if(!function_exists('DisplayPublicationMulti')) {
  248.  
  249.   function DisplayPublicationMulti($publi_id{
  250.  
  251.     $data=SQL_GetResources($publi_id'P''MULTI'$GLOBALS['sql_object']);
  252.     $content ='<div class="multi">'.END_LINE;
  253.     $content.='<h2>'._t('publication','multi_res').'</h2>'.END_LINE;
  254.     if($data!=0)
  255.     {
  256.       $content.='<ul>'.END_LINE;
  257.       for($i=0$i<count($data)$i++{
  258.         $multires_name=formatText($data[$i]['multires_name']'2HTML');
  259.         $multires_description=formatText($data[$i]['multires_description']'2HTML');
  260.         if($data[$i]['multires_media_uri'][0]=='m'$multires_media_uri='../'.$data[$i]['multires_media_uri'];
  261.         else $multires_media_uri=$data[$i]['multires_media_uri'];
  262.          
  263.         $content.='<li>'.END_LINE;
  264.         $content.='<a href="'.$multires_media_uri.'" class="out">'.$multires_name.'</a><br />'.END_LINE;
  265.         $content.='<div>'.END_LINE;
  266.         $content.=$multires_description.END_LINE;
  267.         $content.='</div>'.END_LINE;
  268.         $content.='</li>'.END_LINE;
  269.          
  270.       }
  271.       $content.='</ul>'.END_LINE;
  272.     }
  273.     else
  274.     {
  275.       $content.='<p class="info">'._t('publication','no_multi').'</p>';
  276.     }
  277.     $content.='</div>'.END_LINE;
  278.  
  279.     echo $content;
  280.   }
  281. }
  282. ?>

Documentation generated on Thu, 03 May 2012 15:04:10 +0200 by phpDocumentor 1.4.1