Dotclear


Ignore:
Timestamp:
07/31/12 13:18:23 (13 years ago)
Author:
Dsls <dsls@…>
Branch:
sexy
Message:

sexy step 1 : no more comments ...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • admin/services.php

    r323 r848  
    1818 
    1919$core->rest->addFunction('getPostById',array('dcRestMethods','getPostById')); 
    20 $core->rest->addFunction('getCommentById',array('dcRestMethods','getCommentById')); 
    2120$core->rest->addFunction('quickPost',array('dcRestMethods','quickPost')); 
    2221$core->rest->addFunction('validatePostMarkup',array('dcRestMethods','validatePostMarkup')); 
     
    7069          $rsp->post_status($rs->post_status); 
    7170          $rsp->post_selected($rs->post_selected); 
    72           $rsp->post_open_comment($rs->post_open_comment); 
    73           $rsp->post_open_tb($rs->post_open_tb); 
    74           $rsp->nb_comment($rs->nb_comment); 
    75           $rsp->nb_trackback($rs->nb_trackback); 
    7671          $rsp->user_name($rs->user_name); 
    7772          $rsp->user_firstname($rs->user_firstname); 
     
    10095     } 
    10196      
    102      public static function getCommentById($core,$get) 
    103      { 
    104           if (empty($get['id'])) { 
    105                throw new Exception('No comment ID'); 
    106           } 
    107            
    108           $rs = $core->blog->getComments(array('comment_id' => (integer) $get['id'])); 
    109            
    110           if ($rs->isEmpty()) { 
    111                throw new Exception('No comment for this ID'); 
    112           } 
    113            
    114           $rsp = new xmlTag('post'); 
    115           $rsp->id = $rs->comment_id; 
    116            
    117           $rsp->comment_dt($rs->comment_dt); 
    118           $rsp->comment_upddt($rs->comment_upddt); 
    119           $rsp->comment_author($rs->comment_author); 
    120           $rsp->comment_site($rs->comment_site); 
    121           $rsp->comment_content($rs->comment_content); 
    122           $rsp->comment_trackback($rs->comment_trackback); 
    123           $rsp->comment_status($rs->comment_status); 
    124           $rsp->post_title($rs->post_title); 
    125           $rsp->post_url($rs->post_url); 
    126           $rsp->post_id($rs->post_id); 
    127           $rsp->post_dt($rs->post_dt); 
    128           $rsp->user_id($rs->user_id); 
    129            
    130           $rsp->comment_display_content($rs->getContent(true)); 
    131            
    132           if ($core->auth->userID()) { 
    133                $rsp->comment_ip($rs->comment_ip); 
    134                $rsp->comment_email($rs->comment_email); 
    135                $rsp->comment_spam_disp(dcAntispam::statusMessage($rs)); 
    136           } 
    137            
    138           return $rsp; 
    139      } 
    14097      
    14198     public static function quickPost($core,$get,$post) 
     
    150107          $cur->post_lang = !empty($post['post_lang']) ? $post['post_lang'] : ''; 
    151108          $cur->post_status = !empty($post['post_status']) ? (integer) $post['post_status'] : 0; 
    152           $cur->post_open_comment = (integer) $core->blog->settings->system->allow_comments; 
    153           $cur->post_open_tb = (integer) $core->blog->settings->system->allow_trackbacks; 
    154109           
    155110          # --BEHAVIOR-- adminBeforePostCreate 
Note: See TracChangeset for help on using the changeset viewer.

Sites map