Changeset 2740


Ignore:
Timestamp:
May 19, 2012, 10:26:27 PM (8 years ago)
Author:
goya
Message:

gestion liens externes en cas d'iframe

Location:
cpc/trunk/project/apps/frontend/modules
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • cpc/trunk/project/apps/frontend/modules/parlementaire/actions/actions.class.php

    r2733 r2740  
    542542#     $dep = Doctrine::getTable('Parlementaire')->findOneByNomSexeGroupeCirco($search, $sexe);
    543543    $this->parl = $dep->slug;
    544     $this->options = array('titre' => 1, 'photo' => 1, 'graphe' => 1, 'activite' => 1, 'tags' => 1);
     544    $this->options = array('titre' => 1, 'photo' => 1, 'graphe' => 1, 'activite' => 1, 'tags' => 1, 'iframe' => 0);
    545545    if ($request->getParameter('notitre', false))
    546546      $this->options['titre'] = 0;
     
    557557    if (preg_match('/^\d+$/', $request->getParameter('width', 935)))
    558558      $this->options['width'] = $request->getParameter('width', 935);
     559    if ($request->getParameter('iframe', false))
     560      $this->options['iframe'] = 1;
    559561    $this->setLayout(false);
    560562  }
  • cpc/trunk/project/apps/frontend/modules/parlementaire/actions/components.class.php

    r2733 r2740  
    5353    $this->parl = Doctrine::getTable('Parlementaire')->findOneBySlug($this->slug);
    5454    if (!$this->options)
    55       $this->options = array('titre' => 1, 'photo' => 1, 'graphe' => 1, 'activite' => 1, 'tags' => 1, 'width' => 935, 'maxtags' => 40);
     55      $this->options = array('titre' => 1, 'photo' => 1, 'graphe' => 1, 'activite' => 1, 'tags' => 1, 'iframe' => 0, 'width' => 935, 'maxtags' => 40);
    5656  } 
    5757}
  • cpc/trunk/project/apps/frontend/modules/parlementaire/templates/_top.php

    r2733 r2740  
    66  $serv = 'http://'.$_SERVER['SERVER_NAME'];
    77}
     8if (!isset($target))
     9  $target = '';
    810$titres = array('semaines_presence' => 'Semaines d\'activité',
    911               'commission_presences' => 'Présences en commission',
     
    103105    echo 'a';
    104106  else echo 'span';
    105   echo ' class="jstitle" title="'.$titre.'" href="'.url_for('@top_global_sorted?sort='.$sort[$k].'#'.$parlementaire->slug, $abs).'"><img style="height: '.$icosize.'px; width: '.$icosize.'px;" src="'.$serv.$sf_request->getRelativeUrlRoot().'/images/xneth/';
     107  echo $target.' class="jstitle" title="'.$titre.'" href="'.url_for('@top_global_sorted?sort='.$sort[$k].'#'.$parlementaire->slug, $abs).'"><img style="height: '.$icosize.'px; width: '.$icosize.'px;" src="'.$serv.$sf_request->getRelativeUrlRoot().'/images/xneth/';
    106108  printf($images[$k], $couleur);
    107109  echo '" alt="'.$titre.'" />';
  • cpc/trunk/project/apps/frontend/modules/parlementaire/templates/_widget.php

    r2735 r2740  
    22 return;
    33}
     4$target = '';
     5if ($options['iframe'])
     6  $target = ' target="_blank"';
    47if (!$options['photo'])
    58  $widthrate = $options['width']/800.;
     
    710$url = url_for('@parlementaire?slug='.$parl->slug, 'absolute=true'); ?>
    811<style type="text/css">
    9  .nosdeputes_widget { width: <?php echo $options['width']; ?>px; text-align: center; font-size: <?php echo max(8, floor(14*$options['width']/935)); ?>px; }
     12 .nosdeputes_widget { width: <?php echo $options['width']; ?>px; text-align: center; font-size: <?php echo max(8, floor(15*$options['width']/935)); ?>px; }
    1013 .nosdeputes_widget a { text-decoration: none; color: inherit; }
    1114 .nosdeputes_widget .clearBoth { clear: both; }
     
    2225if ($options['graphe']) : ?>
    2326 .nosdeputes_widget .graph_depute { float: left; height: <?php echo floor(160*$widthrate); ?>px; width: <?php echo floor(800*$widthrate); ?>px; margin: auto; <?php echo ($widthrate > 1/3 ? 'margin-bottom: 10px;' : ''); ?>}
    24  .nosdeputes_widget .graph_depute p { font-size: <?php echo floor(11*$options['width']/935); ?>px; margin: 0; padding: 0; }
     27 .nosdeputes_widget .graph_depute p { font-size: <?php echo floor(12*$options['width']/935); ?>px; margin: 0; padding: 0; }
    2528<?php endif;
    2629if ($options['activite']) : ?>
    27  .nosdeputes_widget .barre_activite { font-size: <?php echo floor(12*$options['width']/935); ?>px; background-color: #EBEBEB; float: left; margin-top: <?php echo floor(10*$options['width']/935); ?>px; padding-top: <?php echo floor(3*$options['width']/935); ?>px; width: <?php echo floor($options['width']); ?>px; text-align: left; }
     30 .nosdeputes_widget .barre_activite { font-size: <?php echo floor(13*$options['width']/935); ?>px; background-color: #EBEBEB; float: left; margin-top: <?php echo floor(10*$options['width']/935); ?>px; padding-top: <?php echo floor(3*$options['width']/935); ?>px; width: <?php echo floor($options['width']); ?>px; text-align: left; }
    2831 .nosdeputes_widget .barre_activite ul, .barre_activite li { background-color: transparent; display: inline; font-weight: bold; line-height: <?php echo floor(24*$options['width']/935); ?>px; margin: -<?php echo floor(3*$options['width']/935); ?>px; padding: 0; }
    2932 .nosdeputes_widget .barre_activite h3 { background-color: transparent; color: #6B6B6B; display: inline; font-size: 1.2em; line-height: <?php echo floor(24*$options['width']/935); ?>px; margin: 0; padding-left: <?php echo floor(5*$options['width']/935); ?>px; }
     
    4245<div class="nosdeputes_widget">
    4346<?php if ($options['titre']) : ?>
    44   <h2><a href="<?php echo $url; ?>"><?php echo $parl->nom; ?><?php if ($options['width'] > 600) echo ', '.$parl->getLongStatut(); else if ($options['width'] > 300) echo ', '.$parl->getStatut(); ?></a></h2>
     47  <h2><a<?php echo $target; ?> href="<?php echo $url; ?>"><?php echo $parl->nom; ?><?php if ($options['width'] > 600) echo ', '.$parl->getLongStatut(); else if ($options['width'] > 300) echo ', '.$parl->getStatut(); ?></a></h2>
    4548<?php endif;
    4649if ($options['photo']) : ?>
    4750  <div class="photo_depute">
    48     <a href="<?php echo $url; ?>"><?php include_partial('photoParlementaire', array('parlementaire' => $parl, 'height' => $photoh, 'absolute' => true)); ?></a>
     51    <a<?php echo $target; ?> href="<?php echo $url; ?>"><?php include_partial('photoParlementaire', array('parlementaire' => $parl, 'height' => $photoh, 'absolute' => true)); ?></a>
    4952  </div>
    5053<?php endif;
     
    5457  else $widthrate = $options['width']/935.; ?>
    5558  <div class="graph_depute">
    56     <?php echo include_component('plot', 'parlementaire', array('parlementaire' => $parl, 'options' => array('plot' => 'total', 'questions' => 'true', 'link' => 'true', 'absolute' => true, 'widthrate' => $widthrate))); ?>
     59    <?php echo include_component('plot', 'parlementaire', array('parlementaire' => $parl, 'options' => array('plot' => 'total', 'questions' => 'true', 'link' => 'true', 'absolute' => true, 'widthrate' => $widthrate, 'target' => $target))); ?>
    5760  </div>
    5861  <div class="clearBoth"></div>
     
    6063if ($options['activite']) : ?>
    6164  <div class="barre_activite">
    62     <?php include_partial('top', array('parlementaire'=>$parl, 'absolute' => true, 'widthrate' => $options['width']/935.)); ?>
     65    <?php include_partial('top', array('parlementaire'=>$parl, 'absolute' => true, 'widthrate' => $options['width']/935., 'target' => $target)); ?>
    6366  </div>
    6467  <div class="clearBoth"></div>
     
    6669if ($options['tags']) : ?>
    6770  <div class="tags_depute">
    68 <?php echo include_component('tag', 'parlementaire', array('parlementaire'=>$parl, 'absolute' => true, 'limit' => $options['maxtags'])); ?>
     71<?php echo include_component('tag', 'parlementaire', array('parlementaire'=>$parl, 'absolute' => true, 'limit' => $options['maxtags'], 'target' => $target)); ?>
    6972  </div>
    7073<?php endif; ?>
  • cpc/trunk/project/apps/frontend/modules/plot/templates/_parlementaire.php

    r2735 r2740  
    1 <?php $plotarray = array('parlementaire' => $parlementaire, 'time' => 'lastyear', 'questions' => 'false', 'link' => 'false', 'absolute' => false, 'widthrate' => 1);
     1<?php $plotarray = array('parlementaire' => $parlementaire, 'time' => 'lastyear', 'questions' => 'false', 'link' => 'false', 'absolute' => false, 'widthrate' => 1, 'target' => '');
    22if (isset($options['session'])) $plotarray['time'] = $options['session'];
    33if (isset($options['questions'])) $plotarray['questions'] = $options['questions'];
    44if (isset($options['link'])) $plotarray['link'] = $options['link'];
    55if (isset($options['widthrate'])) $plotarray['widthrate'] = $options['widthrate'];
     6if (isset($options['target'])) $plotarray['target'] = $options['target'];
    67if (isset($options['absolute'])) {
    78  $plotarray['absolute'] = $options['absolute'];
  • cpc/trunk/project/apps/frontend/modules/plot/templates/_plotParlementaire.php

    r2735 r2740  
    11<?php
    22$abs = '';
     3if (!isset($target))
     4  $target = '';
    35if (isset($absolute) && $absolute)
    46  $abs = 'absolute=true';
     
    1820  $time = 'lastyear';
    1921  if (myTools::isFinLegislature()) $time = 'legislature';
    20   echo '<a href="'.url_for('@parlementaire'.(isset($absolute) && $absolute ? '' : '_plot').'?slug='.$parlementaire->slug.(isset($absolute) && $absolute ? '' : '&time=legislature'), $abs).'">';
     22  echo '<a'.$target.' href="'.url_for('@parlementaire'.(isset($absolute) && $absolute ? '' : '_plot').'?slug='.$parlementaire->slug.(isset($absolute) && $absolute ? '' : '&time=legislature'), $abs).'">';
    2123  if (!isset($widthrate))
    2224    $size = 'height:150px; width:800px';
    2325  else $size = 'height:'.floor(150*$widthrate).'px; width:'.floor(800*$widthrate).'px';
    2426 } else echo '<div class="par_session">'; ?>
    25  <img style="<?php echo $size; ?>" id="graph<?php echo $PictureID; ?>" alt="Participation <?php echo $titre; ?> de <?php echo $parlementaire->nom; ?>" src="<?php echo url_for('@parlementaire_plot_graph?slug='.$parlementaire->slug.'&time='.$time.'&type='.$type.'&questions='.$questions.'&link='.$link.'&mapId='.$PictureID, $abs); ?>" onmousemove="getMousePosition(event);" onmouseout="nd();"/>
     27 <img style="<?php echo $size; ?>" id="graph<?php echo $PictureID; ?>" alt="Participation <?php echo $titre; ?> de <?php echo $parlementaire->nom; ?>" src="<?php echo url_for('@parlementaire_plot_graph?slug='.$parlementaire->slug.'&time='.$time.'&type='.$type.'&questions='.$questions.'&link='.$link.'&mapId='.$PictureID, $abs); ?>"<?php if (!isset($absolute)) echo ' onmousemove="getMousePosition(event);" onmouseout="nd();"'; ?>/>
    2628<?php if ($link === 'true' && !isset($absolute)) { ?>
    2729<script type="text/javascript">
     
    4446echo "<span style='font-weight: bolder; color: rgb(160,160,160);'>&mdash;</span>&nbsp;Présence médiane";
    4547if ($link === 'true')
    46   echo '&nbsp;&nbsp;&nbsp;&nbsp;<a href="'.url_for('@faq', $abs).'#post_4">Explications</a></p>';
     48  echo '&nbsp;&nbsp;&nbsp;&nbsp;<a'.$target.' href="'.url_for('@faq', $abs).'#post_4">Explications</a></p>';
    4749else echo '</p>';
    4850}
  • cpc/trunk/project/apps/frontend/modules/tag/templates/_parlementaire.php

    r2733 r2740  
    55if (!isset($limit))
    66  $limit = 100;
    7 echo include_component('tag', 'tagcloud', array('tagquery' => $qtag, 'model' => 'Intervention', 'min_tag' => 2, 'route' => '@tag_parlementaire_interventions?parlementaire='.$parlementaire->slug.'&', 'limit' => $limit, 'absolute' => $abs)); ?>
     7if (!isset($target))
     8  $target = '';
     9echo include_component('tag', 'tagcloud', array('tagquery' => $qtag, 'model' => 'Intervention', 'min_tag' => 2, 'route' => '@tag_parlementaire_interventions?parlementaire='.$parlementaire->slug.'&', 'limit' => $limit, 'absolute' => $abs, 'target' => $target)); ?>
    810</div>
  • cpc/trunk/project/apps/frontend/modules/tag/templates/_tagcloud.php

    r2736 r2740  
    22if (isset($absolute) && $absolute)
    33  $abs = 'absolute=true';
     4if (!isset($target))
     5  $target = '';
    46$keys = array_keys($tags);
    57$tot = count($keys);
     
    1517if ($tot > 0) { foreach($keys as $tag) : ?>
    1618<span class="tag_level_<?php echo $tags[$tag]['class']; ?>"><?php if (isset($route)) {
    17 echo '<a href="';
     19echo '<a'.$target.' href="';
    1820$rel = $tags[$tag]['related'];
    1921$rel = preg_replace('/^aZ/', 'â', $rel);
Note: See TracChangeset for help on using the changeset viewer.