Changeset 2695


Ignore:
Timestamp:
May 13, 2012, 9:57:33 PM (8 years ago)
Author:
teymour
Message:

Image size style + reduction des risques des graphes identiques

Location:
cpc/trunk/project/apps/frontend/modules/plot
Files:
2 edited

Legend:

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

    r1625 r2695  
    2828      $this->drawAction = "draw";
    2929    $this->mapId = $request->getParameter('mapId');
    30     $this->forward404Unless($this->mapId && preg_match('/^Map_\d+\.map$/', $this->mapId));
     30    $this->forward404Unless($this->mapId && preg_match('/^Map_.*_\d+\.map$/', $this->mapId));
    3131    sfConfig::set('sf_web_debug', false);
    3232    $this->getResponse()->setHttpHeader('content-type', 'image/png');
  • cpc/trunk/project/apps/frontend/modules/plot/templates/_plotParlementaire.php

    r2677 r2695  
    11<?php
     2$size='';
    23if ($time === 'lastyear')
    34  $shortduree = 'annee';
     
    1011  $titre .= '-'.$shortduree;
    1112}
    12 $PictureID = "Map_".rand(1,10000).".map";
    13 $size = 'height="300" width="800"';
     13$PictureID = "Map_".$parlementaire->slug.'_'.rand(1,10000).".map";
    1414if ($link === 'true') {
    1515  echo '<a href="'.url_for('@parlementaire_plot?slug='.$parlementaire->slug.'&time=lastyear').'">';
    16   $size = 'height="150" width="800"';
     16  $size = 'height:150px; width:800px';
    1717 } else echo '<div class="par_session">'; ?>
    18  <img <?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); ?>" onmousemove="getMousePosition(event);" onmouseout="nd();"/>
     18 <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); ?>" onmousemove="getMousePosition(event);" onmouseout="nd();"/>
    1919<?php if ($link === 'true') { ?>
    2020<script type="text/javascript">
Note: See TracChangeset for help on using the changeset viewer.