Changeset 742

Show
Ignore:
Timestamp:
08/27/08 20:54:25 (3 months ago)
Author:
aarkerio
Message:

Little Bugs fixed

Location:
trunk/app
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/app/controllers/replies_controller.php

    r696 r742  
    4141 } 
    4242  
    43  /**    ---  ADMIN METHODS  ---  **/ 
     43 /**===    ADMIN METHODS  ===**/ 
    4444  
     45 public function admin_points($reply_id, $sense) 
     46 { 
     47   $points = (int) $this->Reply->field('points', array('Reply.id'=>$reply_id)); 
     48    
     49   $points = ($sense == 'up' ) ? ($points + 1) : ($points - 1); 
     50 
     51   $this->data['Reply']['id']       = $reply_id;     
     52       
     53   $this->data['Reply']['points']   = $points; 
     54      
     55   if ($this->Reply->save($this->data)): 
     56             $this->set('points', $points); 
     57         $this->render('admin_points', 'ajax'); 
     58   endif; 
     59 } 
     60 
    4561 public function admin_edit($id = null) 
    4662 { 
  • trunk/app/views/vclassrooms/admin_record.ctp

    r741 r742  
    152152                           '/admin/replies/points/'.$re['Reply']['id'].'/down', 
    153153                        array('update'  => $div_id, 
    154                               'loading '=>"Element.show('loadingre');", 
    155                                   'after'   =>'tp('.$data['User']['id'].','.$data['Vclassroom']['id'].')', 
    156                           'complete'=>"Element.hide('loadingre');Effect.Appear(".$div_id.")"),null,false); 
     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); 
    157157      echo $ajax->link($html->image('static/aupmod.png', array('alt'=>__('Points up', true), 'title'=>__('Points up', true))), 
    158158                           '/admin/replies/points/'.$re['Reply']['id'].'/up', 
    159159                        array('update'  => $div_id, 
    160160                                  'after'   =>'tp('.$data['User']['id'].','.$data['Vclassroom']['id'].')', 
    161                               'loading '=>"Element.show('loadingre')", 
    162                           'complete'=>"Element.hide('loadingre');Effect.Appear(".$div_id.")"),null,false); 
     161                              'loading '=>"Element.show('loadreply')", 
     162                          'complete'=>"Element.hide('loadreply');Effect.Appear(".$div_id.")"),null,false); 
    163163        echo '</div>';   
    164164        $rpoints += $re['Reply']['points']; //sum 
     
    166166       e('</div>'); 
    167167      endforeach; 
    168   e($html->div(null, $html->image('static/loading.gif', array('alt'=>'Loading')),array('id'=>'loadingre', 'style'=>'display:none;'))); 
     168  e($html->div(null, $html->image('static/loading.gif', array('alt'=>'Loading')),array('id'=>'loadreply', 'style'=>'display:none;'))); 
    169169 else: 
    170170    echo  $html->para(null, 'No reply found');