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 content
  5.  * @author linea21 <info@linea21.com>
  6.  * @version $id SVN
  7.  * @access public
  8.  * @license http://opensource.org/licenses/gpl-3.0.html
  9.  *  'Content' module is used by 'Publication' and 'Workshop' modules
  10.  */
  11.  
  12. include_once(themePath('../contents/'.SQL.'.inc.php'));
  13.  
  14. if(!function_exists('DisplayOneWorkshopPart')) {
  15.  
  16.   function DisplayOneWorkshopPart($work_id{
  17.     $data=$GLOBALS['sql_object'-> DBSelect(SQL_getOneWorkshopParts($work_id));
  18.     $content '';
  19.     if(count($data)!=1exit;
  20.     else
  21.     {
  22.       $workrepcon_title=formatText($data[0]['workrepcon_title']'2HTML');
  23.       $workrepcon_body=linkin_content(formatText($data[0]['workrepcon_body']'2HTML'));
  24.       $workrepcon_date_crea_display=formatText($data[0]['workrepcon_date_crea_display']'2HTML');
  25.       $link_self array('rub' => $GLOBALS['links'][U_L]['report-part']['linkvalue']'id' => $work_id'parentid' => $_REQUEST['parentid']);
  26.        
  27.       $content.='<h1>'.$workrepcon_title.'</h1>'.END_LINE;
  28.       $content.='<p class="permalink">'.END_LINE;
  29.       $content.= formatted_permalink($link_self);
  30.       $content.='</p>'.END_LINE;
  31.       $content.='<div class="body">'.$workrepcon_body.'</div>';
  32.        
  33.     }
  34.     echo $content;
  35.   }
  36. }
  37.  
  38. if(!function_exists('DisplayOnePublicationPart')) {
  39.  
  40.   function DisplayOnePublicationPart($publi_id{
  41.     $data=$GLOBALS['sql_object'-> DBSelect(SQL_getOnePublicationParts($publi_id));
  42.     $content '';
  43.  
  44.     $link_self array('rub' => $GLOBALS['links'][U_L]['publication-part']['linkvalue']'id' => $publi_id'parentid' => $_REQUEST['parentid']);
  45.  
  46.     if(count($data)!=1exit;
  47.     else
  48.     {
  49.       $title=formatText($data[0]['publicon_title']'2HTML');
  50.       $body=linkin_content(formatText($data[0]['publicon_body']'2HTML'));
  51.       $publicon_date_crea_display=formatText($data[0]['publicon_date_crea_display']'2HTML');
  52.        
  53.       $content.='<h1>'.$title.'</h1>'.END_LINE;
  54.       $content.='<p class="permalink">'.END_LINE;
  55.       $content.= formatted_permalink($link_self);
  56.       $content.='</p>'.END_LINE;
  57.       $content.='<div class="body">'.$body.'</div>';
  58.       $content.='<hr />';
  59.        
  60.     }
  61.     echo $content;
  62.   }
  63. }
  64.  
  65. if(!function_exists('DisplayWorkshopNameAndGroup')) {
  66.  
  67.   function DisplayWorkshopNameAndGroup($work_id{
  68.     $data=$GLOBALS['sql_object'-> DBSelect(SQL_getWorkshopRepTitleAndGroup($work_id));
  69.     $content '';
  70.     if(count($data)!=1exit;
  71.     else
  72.     {
  73.       $link_workshoparray('rub'=> $GLOBALS['links'][U_L]['workgroup']['linkvalue'],'id'=>$data[0]['workshop_id']'name' => $data[0]['workshop_denomination']);
  74.       $link_workshopreparray('rub'=> $GLOBALS['links'][U_L]['report']['linkvalue'],'id'=>$data[0]['workrep_id']'name' => $data[0]['workrep_title']);
  75.        
  76.       $workrep_title=formatText($data[0]['workrep_title']'2HTML');
  77.       $workshop_denomination=formatText($data[0]['workshop_denomination']'2HTML');
  78.        
  79.       $content.='<p id="parentHeader">'.END_LINE;
  80.       $content.=_t('workshoprep','name').' : ';
  81.       $content.='<a href="'.HrefMaker($link_workshoprep).'" title="'.$GLOBALS['links'][U_L]['report']['desc']' ('.$workrep_title.')">'.$workrep_title.'</a>';
  82.       $content.=' | ';
  83.       $content.='<span class="workshopname">';
  84.       $content.='<a href="'.HrefMaker($link_workshop).'" title="'._t('workshoprep','workshop_product')' : '.formatText($workshop_denomination'2ATT').'">'.$workshop_denomination.'</a>';
  85.       $content.='</span>';
  86.       $content.='</p>'.END_LINE;
  87.        
  88.     }
  89.     echo $content;
  90.   }
  91. }
  92.  
  93. if(!function_exists('DisplayPublicationTitle')) {
  94.  
  95.   function DisplayPublicationTitle($publi_id{
  96.     $data=$GLOBALS['sql_object'-> DBSelect(SQL_getPublicationTitle($publi_id));
  97.     $content '';
  98.     if(count($data)!=1exit;
  99.     else
  100.     {
  101.       $link_publiarray('rub'=> $GLOBALS['links'][U_L]['publication']['linkvalue'],'id'=>$data[0]['publi_id']'name'=> $data[0]['publi_title']);
  102.       $publi_title=formatText($data[0]['publi_title']'2HTML');
  103.  
  104.       $content.='<p id="parentHeader">'.END_LINE;
  105.       $content.=''._t('publication','name').' : ';
  106.       $content.='<a href="'.HrefMaker($link_publi).'" title="'.$GLOBALS['links'][U_L]['publication']['desc']' ('.formatText($publi_title'2ATT').')">'.$publi_title.'</a>';
  107.       $content.='</p>'.END_LINE;
  108.        
  109.     }
  110.     echo $content;
  111.   }
  112. }
  113.  
  114. if(!function_exists('DisplayWorkshopRepLinkinPart')) {
  115.  
  116.   function DisplayWorkshopRepLinkinPart($id$parentid$format='TEXT'{
  117.     /**
  118.      * $id -> partie courante
  119.      * $parentid -> id du dossier
  120.      * $format 'NUM' || 'TEXT'
  121.      */
  122.     $data=$GLOBALS['sql_object'-> DBSelect(SQL_getWorkshopParts($parentid));
  123.     $content '';
  124.  
  125.     if($data!=0)
  126.     {
  127.       $content.='<div id="linkinparts">';
  128.       //$content.=_t('publication','goto').' : '.END_LINE;
  129.  
  130.       if($format=='TEXT'{
  131.         $content.='<ol>'.END_LINE;
  132.         for($i=0$i<count($data)$i++)
  133.         {
  134.           $link_partsarray('rub'=> $GLOBALS['links'][U_L]['report-part']['linkvalue'],'id'=> $data[$i]['workrepcon_id'],'parentid'=>$parentid'name'=> $data[$i]['workrepcon_title']);
  135.           $workrepcon_title=formatText($data[$i]['workrepcon_title']'2HTML');
  136.           $content.='<li>'.END_LINE;
  137.           //$content.='<span class="num">'.($i +1).' - </span>'.END_LINE;
  138.           if($id!=$data[$i]['workrepcon_id']{
  139.             $content.='<a href="'HrefMaker($link_parts).'" title="'.formatText($workrepcon_title'2ATT').'">';
  140.             $content.=$workrepcon_title;
  141.             $content.='</a>';
  142.           else {
  143.             $content.=$workrepcon_title;
  144.           }
  145.           $content.='</li>'.END_LINE;
  146.         }
  147.         $content.='</ol>'.END_LINE;
  148.       else {
  149.         $content.= _t('contents','name').' : '.END_LINE;
  150.         $sep='';
  151.         for($i=0$i<count($data)$i++)
  152.         {
  153.           $link_partsarray('rub'=> $GLOBALS['links'][U_L]['report-part']['linkvalue'],'id'=> $data[$i]['workrepcon_id'],'parentid'=>$parentid'name'=> $data[$i]['workrepcon_title']);
  154.           $workrepcon_title=formatText($data[$i]['workrepcon_title']'2HTML');
  155.           $content.=$sep;
  156.           if($id!=$data[$i]['workrepcon_id']{
  157.             $content.='<a href="'HrefMaker($link_parts).'" title="'.formatText($workrepcon_title'2ATT').'">';
  158.             $content.=($i +1);
  159.             $content.='</a>';
  160.           else {
  161.             $content.=($i +1);
  162.           }
  163.           $sep=' - ';
  164.         }
  165.       }
  166.       $content.='</div>'.END_LINE;
  167.       $content.='<hr />'.END_LINE;
  168.     }
  169.     echo $content;
  170.   }
  171. }
  172.  
  173.  
  174. if(!function_exists('DisplayPublicationLinkinPart')) {
  175.  
  176.   function DisplayPublicationLinkinPart($id$parentid$format='TEXT'{
  177.     /**
  178.      * $id -> partie courante
  179.      * $parentid -> id du dossier
  180.      * $format 'NUM' || 'TEXT'
  181.      */
  182.  
  183.     $data=$GLOBALS['sql_object'-> DBSelect(SQL_getPublicationParts($parentid));
  184.     $content '';
  185.  
  186.     if($data!=0)
  187.     {
  188.       $content.='<div id="linkinparts">'.END_LINE;
  189.       if($format=='TEXT'{
  190.         $content.='<ol>'.END_LINE;
  191.         for($i=0$i<count($data)$i++)
  192.         {
  193.           $link_partsarray('rub'=> $GLOBALS['links'][U_L]['publication-part']['linkvalue'],'id'=> $data[$i]['publicon_id'],'parentid'=>$parentid'name'=> $data[$i]['publicon_title']);
  194.           $publicon_title=formatText($data[$i]['publicon_title']'2HTML');
  195.           $content.='<li>'.END_LINE;
  196.           //$content.='<span class="num">'.($i +1).' - </span>'.END_LINE;
  197.           if($id!=$data[$i]['publicon_id']{
  198.             $content.='<a href="'HrefMaker($link_parts).'" title="'.formatText($publicon_title'2ATT').'">';
  199.             $content.=$publicon_title;
  200.             $content.='</a>';
  201.           else {
  202.             $content.=$publicon_title;
  203.           }
  204.           $content.='</li>'.END_LINE;
  205.         }
  206.         $content.='</ol>'.END_LINE;
  207.       else {
  208.         $content.=''._t('publication','part_number2').' : '.END_LINE;
  209.         $sep='';
  210.         for($i=0$i<count($data)$i++)
  211.         {
  212.           $link_partsarray('rub'=> $GLOBALS['links'][U_L]['publication-part']['linkvalue'],'id'=> $data[$i]['$publicon_id'],'parentid'=>$parentid'name'=> $data[$i]['publicon_title']);
  213.           $publicon_title=formatText($data[$i]['$publicon_title']'2HTML');
  214.           $content.=$sep;
  215.           if($id!=$data[$i]['workrepcon_id']{
  216.             $content.='<a href="'HrefMaker($link_parts).'" title="'.formatText($publicon_title'2ATT').'">';
  217.             $content.=($i +1);
  218.             $content.='</a>';
  219.           else {
  220.             $content.=($i +1);
  221.           }
  222.           $sep=' - ';
  223.         }
  224.       }
  225.       $content.='</div>'.END_LINE;
  226.        
  227.     }
  228.     echo $content;
  229.   }
  230. }
  231.  
  232. if(!function_exists('DisplayLinkParts')) {
  233.  
  234.   function DisplayLinkParts($current_part$parentid$direction$type{
  235.  
  236.     if($type=='W'{
  237.       $link_rub=$GLOBALS['links'][U_L]['report-part']['linkvalue'];
  238.       $q SQL_getWorkshopRepRangeAndDate($current_part);
  239.       $r $GLOBALS['sql_object']->DBSelect($q);
  240.       $range $r[0]['item_range'];
  241.       $published_date $r[0]['item_date_crea'];
  242.     }
  243.     if($type=='P'{
  244.       $link_rub=$GLOBALS['links'][U_L]['publication-part']['linkvalue'];
  245.       $q SQL_getPublicationRangeAndDate($current_part);
  246.       $r $GLOBALS['sql_object']->DBSelect($q);
  247.       $range $r[0]['item_range'];
  248.       $published_date $r[0]['item_date_crea'];
  249.     }
  250.  
  251.     if($direction=='NEXT'{
  252.       if($type=='W'{
  253.         if($range != 0{
  254.             $q SQL_getNextWorkshopRepPartsByRange($current_part$parentid$range);
  255.         else {
  256.             $q SQL_getNextWorkshopRepPartsByDate($current_part$parentid$published_date);
  257.         }
  258.       }
  259.       if($type=='P'{
  260.         if($range != 0{
  261.             $q SQL_getNextPublicationPartsByRange($current_part$parentid$range);
  262.         else {
  263.             $q SQL_getNextPublicationPartsByDate($current_part$parentid$published_date);
  264.         }
  265.       }
  266.       $class='next';
  267.       $prefix ' | ';
  268.       $suffix ' →';
  269.       $title=_t('publication','next_part');
  270.     }
  271.     if($direction=='PREVIOUS'{
  272.       if($type=='W'{
  273.         if($range != 0{
  274.             $q SQL_getPreviousWorkshopRepPartsByRange($current_part$parentid$range);
  275.         else {
  276.             $q SQL_getPreviousWorkshopRepPartsByDate($current_part$parentid$published_date);
  277.         }
  278.       }
  279.       if($type=='P'{
  280.         if($range != 0{
  281.             $q SQL_getPreviousPublicationPartsByRange($current_part$parentid$range);
  282.         else {
  283.             $q SQL_getPreviousPublicationPartsByDate($current_part$parentid$published_date);
  284.         }
  285.       }
  286.       $class='previous';
  287.       $prefix '← ';
  288.       $suffix '';
  289.       $title=_t('publication','prev_part');
  290.     }
  291.     $data=$GLOBALS['sql_object'-> DBSelect($q);
  292.  
  293.     if($data==false || count($data)!=1$content '';
  294.     else
  295.     {
  296.       $link_partarray('rub'=> $link_rub,'id'=>$data[0]['part_id']'parentid' =>$parentid'name'=> $data[0]['part_title']);
  297.       $part_title=formatText(cutText($data[0]['part_title']45)'2HTML');
  298.       $part_complete_title=formatText($data[0]['part_title']'2HTML');
  299.  
  300.       $content ='<div class="'.$class.'">'.END_LINE;
  301.       $content.=$prefix;
  302.       $content.='<a href="'.HrefMaker($link_part).'" title="'.formatText($title.' : '.$part_complete_title'2ATT').'">'.$part_title.'</a>';
  303.       $content.=$suffix;
  304.       $content.='</div>'.END_LINE;
  305.        
  306.     }
  307.     echo $content;
  308.   }
  309. }
  310.  
  311. ?>

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