Changeset 744 for trunk/app/views

Show
Ignore:
Timestamp:
08/30/08 18:26:22 (3 months ago)
Author:
aarkerio
Message:

Little Bugs fixed

Location:
trunk/app/views
Files:
1 added
1 removed
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/app/views/vclassrooms/admin_record.ctp

    r742 r744  
    3131 // Tests 
    3232 if ( count($data['tests']) > 0 ): 
    33      echo '<h1>'. __('Tests', true).'</h1>'; 
    34      foreach ($data['tests'] as $t): 
    35      
    36       $div_id = 'te'.$t['TestsVclassroom']['id']; 
    37       e('<div style="border:1px dotted gray;padding:4px;margin:2px;height:20px;">'); 
    38  
    39       if ($t['TestsVclassroom']['points'] === null):  // not answered yet 
    40         e($html->div(null, __('Not answered this test yet', true), array('id'=>$div_id,'style'=>'width:220px;float:left;font-size:7pt;'))); 
    41         e($html->div(null, $t['TestsVclassroom']['title'], array('style'=>'width:350px;float:right;'))); 
    42       else: 
    43         e($html->div(null, $t['TestsVclassroom']['points'] .' '.__('points', true),  array('id'=>$div_id, 'style'=>'width:180px;float:left;'))); 
    44         e('<div style="width:450px;float:right;">'); 
     33  echo '<h1>'. __('Tests', true).'</h1>'; 
     34  foreach ($data['tests'] as $t): 
     35    $div_id = 'te'.$t['TestsVclassroom']['id']; 
     36    e('<div style="border:1px dotted gray;padding:4px;margin:2px;height:20px;">'); 
     37 
     38    if ($t['TestsVclassroom']['points'] === null):  // not answered yet 
     39      e($html->div(null, __('Not answered this test yet', true), array('id'=>$div_id,'style'=>'width:220px;float:left;font-size:7pt;'))); 
     40      e($html->div(null, $t['TestsVclassroom']['title'], array('style'=>'width:350px;float:right;'))); 
     41    else: 
     42      e($html->div(null, $t['TestsVclassroom']['points'].' '.__('points',true),array('id'=>$div_id,'style'=>'width:180px;float:left;'))); 
     43      e('<div style="width:450px;float:right;">'); 
    4544      echo $html->link($t['TestsVclassroom']['title'], '#'.$div_id, array('title'=>'View test', 'onclick'=> 
    4645        "window.open('/admin/tests/see/".$data['User']['id']."/".$t['TestsVclassroom']['test_id']."/".$data['Vclassroom']['id']."','mywin','left=20,top=10,width=700,height=700,scrollbars=1,toolbar=0,resizable=1')")) . '&nbsp;&nbsp;'; 
     
    5857                              'loading '=>"Element.show('loadingre')", 
    5958                          'complete'=>"Element.hide('loadingre');Effect.Appear(".$div_id.")"),null,false); */ 
    60       e('</div>'); 
     59        e('</div>'); 
    6160      endif; 
    62          
    63       e('</div>'); 
    64   
    65     endforeach; 
     61      e('</div>'); 
     62    endforeach; 
    6663 else: 
    6764      echo $html->para(null, __('No tests found', true)); 
    6865 endif; 
    6966 
    70  // Webquests 
     67 // Webquests --> ResultWebquest 
    7168 $wpoints = (int) 0; // webquest points 
    7269 if ( count($data['webquests']) > 0 ): 
    7370   echo '<h1>Webquests</h1>'; 
    7471   foreach ($data['webquests'] as $w): 
    75     
    7672     $wpoints += $w['ResultWebquest']['points']; 
    7773     $div_id   = 'w'.$w['Webquest']['id']; 
     
    8581                           '/admin/webquests/points/'.$w['ResultWebquest']['id'].'/down', 
    8682                        array('update'  => $div_id, 
    87                               'loading' =>"Element.show('loadingweb');", 
    88                                   'after'   =>'tp('.$data['User']['id'].','.$data['Vclassroom']['id'].')', 
    89                           'complete'=>"Element.hide('loadingweb');Effect.Appear(".$div_id.")"),null,false); 
     83                              'loading' =>"Element.show('loadingweb');Element.hide('".$div_id."')", 
     84                                  'after'   =>'tp('.$data['User']['id'].','.$data['Vclassroom']['id'].')', 
     85                          'complete'=>"Element.hide('loadingweb');Effect.Appear('".$div_id."')"),null,false); 
    9086      echo $ajax->link($html->image('static/aupmod.png', array('alt'=>__('Points up', true), 'title'=>__('Points up', true))), 
    9187                           '/admin/webquests/points/'.$w['ResultWebquest']['id'].'/up', 
    9288                        array('update'  => $div_id, 
    93                                   'after'   =>'tp('.$data['User']['id'].','.$data['Vclassroom']['id'].')', 
    94                               'loading' =>"Element.show('loadingweb')", 
    95                           'complete'=>"Element.hide('loadingweb');Effect.Appear(".$div_id.")"),null,false); 
     89                                  'loading' =>"Element.show('loadingweb');Element.hide('".$div_id."')",                                   
     90                                  'after'   =>'tp('.$data['User']['id'].','.$data['Vclassroom']['id'].')', 
     91                          'complete'=>"Element.hide('loadingweb');Effect.Appear('".$div_id."')"),null,false); 
    9692      e('</div>');   
    9793    e('</div>'); 
     
    108104 if ( count($data['treasures']) > 0 ): 
    109105  foreach ($data['treasures'] as $tr): 
    110      $tpoints += (int) $tr['ResultTreasure']['points']; 
    111106     $div_id   = 'tr'.$tr['Treasure']['id']; 
    112107     e('<div style="border:1px dotted gray;padding:4px;margin:2px;height:20px;">'); 
     
    119114                           '/admin/treasures/points/'.$tr['Treasure']['id'].'/down', 
    120115                        array('update'  => $div_id, 
    121                               'loading '=>"Element.show('loadtre');", 
    122                                   'after'   =>'tp('.$data['User']['id'].','.$data['Vclassroom']['id'].')', 
    123                           'complete'=>"Element.hide('loadtre');Effect.Appear(".$div_id.")"),null,false); 
     116                              'loading '=>"Element.show('loadtre');Element.hide('".$div_id."')", 
     117                                  'after'   =>'tp('.$data['User']['id'].','.$data['Vclassroom']['id'].')', 
     118                          'complete'=>"Element.hide('loadtre');Effect.Appear('".$div_id."')"),null,false); 
    124119     echo $ajax->link($html->image('static/aupmod.png', array('alt'=>__('Points up', true), 'title'=>__('Points up', true))), 
    125120                           '/admin/treasures/points/'.$tr['Treasure']['id'].'/up', 
    126121                        array('update'  => $div_id, 
    127122                                  'after'   =>'tp('.$data['User']['id'].','.$data['Vclassroom']['id'].')', 
    128                               'loading '=>"Element.show('loadtre')", 
    129                           'complete'=>"Element.hide('loadtre');Effect.Appear(".$div_id.")"),null,false); 
    130       e('</div>');   
    131       e('</div>'); 
    132   
    133      endforeach; 
     123                              'loading '=>"Element.show('loadtre');Element.hide('".$div_id."')", 
     124                          'complete'=>"Element.hide('loadtre');Effect.Appear('".$div_id."')"),null,false); 
     125      e('</div>'); 
     126    e('</div>'); 
     127   endforeach; 
    134128 echo $ajax->div('loadtre',array('style'=>'display:none')).$html->image('static/loading.gif',array('alt'=>'Loading')).$ajax->divEnd('loadtre'); 
    135129 else: 
    136130     echo $html->para(null, __('No Scavenger hunts found', true)); 
    137131 endif; 
    138     
     132 
     133 // Replies on forums. Model: Topic   
    139134 echo '<h1>'.__('Participations in forums', true).'</h1>'; 
     135 $rpoints = (int) 0; 
    140136 if ( count($data['replies']) > 0 ): 
    141    // Replies on forums. Model: Topic 
    142    $rpoints = (int) 0;  // reply points 
    143137   foreach ($data['replies'] as $re):   
    144       $div_id = 're'.$re['Reply']['id']; 
     138      $div_id = 'rep'.$re['Reply']['id']; 
    145139      e('<div style="border:1px dotted gray;padding:4px;margin:2px;height:20px;">'); 
    146140      e($html->div(null, $re['Reply']['points'].' '.__('points', true),  array('id'=>$div_id, 'style'=>'width:150px;float:left;'))); 
     
    152146                           '/admin/replies/points/'.$re['Reply']['id'].'/down', 
    153147                        array('update'  => $div_id, 
    154                               'loading '=>"Element.show('loadreply');", 
    155                                   'after'   =>'tp('.$data['User']['id'].','.$data['Vclassroom']['id'].')', 
    156                           'complete'=>"Element.hide('loadreply');Effect.Appear(".$div_id.")"),null,false); 
     148                              'loading' => "Element.show('lorep');Element.hide('".$div_id."')", 
     149                                  'complete'=>"Element.hide('lorep');Effect.Appear('".$div_id."')", 
     150                                  'after'   =>'tp('.$data['User']['id'].','.$data['Vclassroom']['id'].')'), 
     151                                   null,false); 
    157152      echo $ajax->link($html->image('static/aupmod.png', array('alt'=>__('Points up', true), 'title'=>__('Points up', true))), 
    158153                           '/admin/replies/points/'.$re['Reply']['id'].'/up', 
    159                         array('update'  => $div_id, 
    160                                   'after'   =>'tp('.$data['User']['id'].','.$data['Vclassroom']['id'].')', 
    161                               'loading '=>"Element.show('loadreply')", 
    162                           'complete'=>"Element.hide('loadreply');Effect.Appear(".$div_id.")"),null,false); 
    163         echo '</div>';   
    164         $rpoints += $re['Reply']['points']; //sum 
    165       
     154                       array('update'  => $div_id, 
     155                                 'loading' =>"Element.show('lorep');Element.hide('".$div_id."')", 
     156                                 'after'   =>'tp('.$data['User']['id'].','.$data['Vclassroom']['id'].')', 
     157                         'complete'=>"Element.hide('lorep');Effect.Appear('".$div_id."')"),null,false); 
     158        e('</div>');  
    166159       e('</div>'); 
    167       endforeach; 
    168   e($html->div(null, $html->image('static/loading.gif', array('alt'=>'Loading')),array('id'=>'loadreply', 'style'=>'display:none;'))); 
    169  else: 
    170     echo  $html->para(null, 'No reply found'); 
    171  endif; 
    172  
     160       $rpoints += (int) $re['Reply']['points']; 
     161    endforeach; 
     162  e($html->div(null, $html->image('static/loading.gif', array('alt'=>'Loading')), array('style'=>'display:none', 'id'=>'lorep'))); 
     163 else: 
     164    echo  $html->para(null, __('No reply found', true)); 
     165 endif; 
     166  
    173167 // Participations, model:  Participation 
    174168 $ppoints = (int) 0;  // participation points 
     
    177171   foreach ($data['participations'] as $p): 
    178172   e('<div style="border:1px dotted gray;padding:4px;margin:2px;height:20px;">'); 
    179  
    180173   $div_id = 'pa'.$p['Participation']['id']; 
    181   
    182174   $ppoints += $p['Participation']['points']; 
    183175   
     
    187179   echo __('Participation', true).': '. $html->link($p['Participation']['title'], '#', array('title'=>__('View text', true), 'onclick'=>"window.open('/admin/participations/show/".$p['Participation']['id']."','mywin','left=20,top=20,width=700,height=700,toolbar=0,resizable=1')")).'  '; 
    188180 
    189        echo $ajax->link($html->image('static/adownmod.png', array('alt'=>__('Points down', true), 'title'=>__('Points down', true))) , 
     181       echo $ajax->link($html->image('static/adownmod.png', array('alt'=>__('Points down', true), 'title'=>__('Points down', true))), 
    190182                           '/admin/participations/points/'.$p['Participation']['id'].'/down', 
    191183                        array('update'     => $div_id, 
    192                               'loading'    =>"Element.show('loadingpa');", 
    193                                   'interactive'=>'tp('.$data['User']['id'].','.$data['Vclassroom']['id'].')', 
    194                           'complete'   =>"Element.hide('loadingpa');Effect.Appear(".$div_id.");"),null,false); 
     184                              'loading'    =>"Element.show('loadingpa');Element.hide('".$div_id."')", 
     185                                  'interactive'=>'tp('.$data['User']['id'].','.$data['Vclassroom']['id'].')', 
     186                          'complete'   =>"Element.hide('loadingpa');Effect.Appear('".$div_id."')"),null,false); 
    195187       echo $ajax->link($html->image('static/aupmod.png', array('alt'=>__('Points up', true), 'title'=>__('Points up', true))), 
    196188                           '/admin/participations/points/'.$p['Participation']['id'].'/up', 
    197189                        array('update'     => $div_id, 
    198                                   'loading'    =>"Element.show('loadingpa');", 
    199                                   'interactive'=>'tp('.$data['User']['id'].','.$data['Vclassroom']['id'].')', 
    200                           'complete'   =>"Element.hide('loadingpa');Effect.Appear(".$div_id.");"),null,false); 
    201  
    202       e('</div>'); 
    203     e('</div>'); 
    204     endforeach; 
    205  
    206   e($html->div(null, $html->image('static/loading.gif', array('alt'=>'Loading')), array('style'=>'display:none;', 'id'=>'loadingpa'))); 
    207        
     190                                  'loading'    =>"Element.show('loadingpa');Element.hide('".$div_id."')", 
     191                                  'interactive'=>'tp('.$data['User']['id'].','.$data['Vclassroom']['id'].')', 
     192                          'complete'   =>"Element.hide('loadingpa');Effect.Appear('".$div_id."')"),null,false); 
     193 
     194      e('</div>'); 
     195    e('</div>'); 
     196  endforeach;      
     197  e($html->div(null, $html->image('static/loading.gif', array('alt'=>'Loading')), array('style'=>'display:none', 'id'=>'loadingpa'))); 
    208198 else: 
    209199    echo  $html->para(null, __('No participation found', true)); 
    210200 endif; 
    211  
     201  
     202  
    212203 // Reports, model:  Report 
    213  $repoints = (int) 0;  // participation points 
     204 $repoints = (int) 0;  // report points 
    214205 echo '<h1>'.__('Reports', true).'</h1>';  
    215206 if ( count($data['reports']) > 0 ): 
    216207   foreach ($data['reports'] as $r): 
    217208   e('<div style="border:1px dotted gray;padding:4px;margin:2px;height:20px;">'); 
    218  
    219209   $div_id = 're'.$r['Report']['id']; 
    220   
    221210   $repoints += (int) $r['Report']['points']; 
    222    
    223211   echo $html->div(null, $r['Report']['points'].' '.__('points',true),  array('id'=>$div_id,'style'=>'width:150px;float:left;')); 
    224212 
     
    229217                           '/admin/reports/points/'.$r['Report']['id'].'/down', 
    230218                        array('update'     => $div_id, 
    231                               'loading'    =>"Element.show('loadingrep');", 
    232                                   'interactive'=>'tp('.$data['User']['id'].','.$data['Vclassroom']['id'].')', 
    233                           'complete'   =>"Element.hide('loadingrep');Effect.Appear(".$div_id.");"),null,false); 
     219                              'loading'    =>"Element.show('loadingrep');Element.hide('".$div_id."')", 
     220                                  'interactive'=>'tp('.$data['User']['id'].','.$data['Vclassroom']['id'].')', 
     221                          'complete'   =>"Element.hide('loadingrep');Effect.Appear('".$div_id."')"),null,false); 
    234222     echo $ajax->link($html->image('static/aupmod.png', array('alt'=>__('Points up', true), 'title'=>__('Points up', true))), 
    235223                           '/admin/reports/points/'.$r['Report']['id'].'/up', 
    236224                        array('update'     => $div_id, 
    237                                   'loading'    =>"Element.show('loadingrep');", 
    238                                   'interactive'=>'tp('.$data['User']['id'].','.$data['Vclassroom']['id'].')', 
    239                           'complete'   =>"Element.hide('loadingrep');Effect.Appear(".$div_id.");"),null,false); 
     225                                  'loading'    =>"Element.show('loadingrep');Element.hide('".$div_id."')", 
     226                                  'interactive'=>'tp('.$data['User']['id'].','.$data['Vclassroom']['id'].')', 
     227                          'complete'   =>"Element.hide('loadingrep');Effect.Appear('".$div_id."')"),null,false); 
    240228 
    241229      e('</div>'); 
     
    251239 echo  $html->div(null, __('Scavengers hunts', true) .' ' .__('points', true) .': '. $tpoints); 
    252240 echo  $html->div(null, 'Webquests ' .__('points', true) .': '. $wpoints); 
     241 echo  $html->div(null, __('Replies', true). ' ' .__('points', true) .': '. $rpoints); 
    253242 echo  $html->div(null, __('Participations', true) .' '. __('points', true) .': '. $ppoints, array('id'=>'parpoints')); 
    254243 echo  $html->div(null, __('Reports', true) .' '. __('points', true) .': '. $repoints, array('id'=>'reppoints')); 
     
    256245 $points = ($tpoints + $wpoints + $rpoints + $ppoints + $repoints); 
    257246  
    258  echo  $ajax->div('totalpoints') . '<b>'.__('Total points', true).': ' . $points .'</b>'. $ajax->divEnd('totalpoints'); 
     247 echo  $ajax->div('totalpoints') .'<b>'.__('Total points', true).': ' . $points .'</b>'. $ajax->divEnd('totalpoints'); 
    259248?> 
    260249</div>