Show
Ignore:
Timestamp:
07/02/08 18:44:15 (5 months ago)
Author:
aarkerio
Message:

In spanish please

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/app/views/elements/poll.ctp

    r458 r620  
    1010  $poll = $session->read('poll'); 
    1111   
    12   if ( $poll != null &&  $Element["Poll"]['Poll']['id'] == $poll) // the user has already voted, show poll results 
    13   { 
     12  if ( $poll != null &&  $Element["Poll"]['Poll']['id'] == $poll): // the user has already voted, show poll results 
     13   
    1414    $total_votes = 0; 
    1515     
    16     foreach ($Element["Poll"]["Pollrow"] as $key => $val)  
    17     { 
    18         $total_votes += $val["vote"];  // the total votes 
    19     } 
     16    foreach ($Element["Poll"]["Pollrow"] as $key => $val): 
     17         $total_votes += $val["vote"];  // the total votes 
     18    endforeach; 
    2019     
    21     echo "<p><b>" . $Element["Poll"]['Poll']['question'] ."</b></p>"; 
     20    echo $html->para('negrita', $Element['Poll']['Poll']['question']); 
    2221     
    23     foreach ($Element["Poll"]["Pollrow"] as $key => $val)  
    24     {         
    25              if ($val["vote"] > 0) 
    26              { 
    27                   $percent = ($val["vote"] * 100) / $total_votes;  // % = votes * 100 / total 
    28              } 
    29              else 
    30              { 
     22    foreach ($Element['Poll']['Pollrow'] as $val):         
     23             if ($val['vote'] > 0): 
     24                  $percent = ($val['vote'] * 100) / $total_votes;  // % = votes * 100 / total 
     25             else: 
    3126                  $percent = 0; 
    32              } 
     27         endif; 
    3328             $width   = number_format($percent, 0); 
    3429             echo '<p><b>'.$val['answer'].'</b> '.number_format($percent, 2).'% <br />';  
    3530             echo $html->image('static/poll/'.$val["color"].'.png', array("height"=>"10", "width"=>$width, "alt"=>$val["answer"], "title"=>$val["answer"]) ); 
    3631             echo "  ". $val['vote']; 
    37     } 
     32   endforeach; 
    3833     
    39     echo '<p class="negrita">Total votes:' . $total_votes . '</p>';  
    40   } 
    41   else // the user has no voted, print the form 
    42   { 
     34    echo $html->para('negrita', __('Total votes', true).':' . $total_votes);  
     35  
     36  else: // the user has no voted, print the form 
     37 
    4338    echo $ajax->form(); 
    4439     
    4540    $array   = array(); 
    4641     
    47     echo "<p><b>" . $Element["Poll"]['Poll']['question'] ."</b></p>"; 
     42    echo $html->para('negrita', $Element['Poll']['Poll']['question']); 
    4843     
    49     echo $form->hidden('Pollrow.poll_id', array("value"=>$Element["Poll"]['Poll']['id']));  // Poll_id 
     44    echo $form->hidden('Pollrow.poll_id', array('value'=>$Element['Poll']['Poll']['id']));  // Poll_id 
    5045     
    51     foreach ($Element["Poll"]['Pollrow'] as $key=>$val) 
    52     { 
    53        $array[$val['id']] = $val['answer'];  // construct id->value array 
    54     } 
     46    foreach ($Element['Poll']['Pollrow'] as $val): 
     47         $array[$val['id']] = $val['answer'];  // construct id->value array 
     48    endforeach; 
    5549     
    5650    echo '<span style="font-size:7pt">'; 
     
    6458        )); 
    6559    echo '</span></form>'; 
    66    } 
    67  
     60  endif; 
    6861?> 
    6962</div>