Show
Ignore:
Timestamp:
10/03/08 12:53:45 (3 months ago)
Author:
riaf
Message:

どうやらローカルではそれなりに更新してあったらしい。どこまでやってるかわからないけどとりあえずコミットしておく。あとでちゃんと見ますごめんなさいごめんなさい。

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • events/phpframework/rhaco/trunk/library/PhwittrStatus.php

    r20589 r20593  
    4040            $status = $this->dbUtil->insert($this->toObject(new Status())); 
    4141        } 
    42         switch($this->getVariable('type', 'html')){ 
    43             case 'json': 
    44                 if(Variable::istype('TableObjectBase', $status)){ 
    45                     // success 
    46                     $replyUserName = $status->getReplyUserName(); 
    47                     $status->comment = PhwittrFormatter::c($status->comment); 
    48                     $status->createdAt = TemplateFormatter::dateformat($status->createdAt); 
    49                     $status->replyTo = ($status->replyUserId) ? sprintf(' in reply to <a href="%s">%s</a>', Rhaco::url($replyUserName), $replyUserName) : ''; 
    50                     $response = array( 
    51                         'error' => 0, 
    52                         'message' => 'status updated!', 
    53                         'status' => $status, 
    54                         'user' => $user, 
    55                     ); 
    56                 } else { 
    57                     // fail 
    58                     $error = array_shift(ExceptionTrigger::get('Status_comment')); 
    59                     $response = array( 
    60                         'error' => 1, 
    61                         'message' => $error->getMessage(), 
    62                     ); 
    63                 } 
    64                 $response = V::toJson($response); 
    65                 header('Content-type: application/json; charset=UTF-8'); 
    66                 header(sprintf("X-JSON: (%s)", $response)); 
    67                 echo $response; 
    68                 break; 
    69             default: 
    70                 if(Variable::istype('TableObjectBase', $status)) 
    71                     $this->setSession('notice', 'status updated!'); 
    72                 Header::redirect(Rhaco::url('home')); 
     42        if(Variable::istype('TableObjectBase', $status)){ 
     43            // success 
     44            $replyUserName = $status->getReplyUserName(); 
     45            $status->comment = PhwittrFormatter::c($status->comment); 
     46            $status->createdAt = TemplateFormatter::dateformat($status->createdAt); 
     47            $status->replyTo = ($status->replyUserId) ? sprintf(' in reply to <a href="%s">%s</a>', Rhaco::url($replyUserName), $replyUserName) : ''; 
     48            $response = array( 
     49                'error' => 0, 
     50                'message' => 'status updated!', 
     51                'status' => $status, 
     52                'user' => $user, 
     53            ); 
     54        } else { 
     55            // fail 
     56            $error = array_shift(ExceptionTrigger::get('Status_comment')); 
     57            $response = array( 
     58                'error' => 1, 
     59                'message' => $error->getMessage(), 
     60            ); 
    7361        } 
     62        $response = V::toJson($response); 
     63        header('Content-type: application/json; charset=UTF-8'); 
     64        header(sprintf("X-JSON: (%s)", $response)); 
     65        echo $response; 
    7466        Rhaco::end(); 
    7567    }