Changeset 848:ad18a33a3cef for admin/services.php
- Timestamp:
- 07/31/12 13:18:23 (13 years ago)
- Branch:
- sexy
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
admin/services.php
r323 r848 18 18 19 19 $core->rest->addFunction('getPostById',array('dcRestMethods','getPostById')); 20 $core->rest->addFunction('getCommentById',array('dcRestMethods','getCommentById'));21 20 $core->rest->addFunction('quickPost',array('dcRestMethods','quickPost')); 22 21 $core->rest->addFunction('validatePostMarkup',array('dcRestMethods','validatePostMarkup')); … … 70 69 $rsp->post_status($rs->post_status); 71 70 $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);76 71 $rsp->user_name($rs->user_name); 77 72 $rsp->user_firstname($rs->user_firstname); … … 100 95 } 101 96 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 }140 97 141 98 public static function quickPost($core,$get,$post) … … 150 107 $cur->post_lang = !empty($post['post_lang']) ? $post['post_lang'] : ''; 151 108 $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;154 109 155 110 # --BEHAVIOR-- adminBeforePostCreate
Note: See TracChangeset
for help on using the changeset viewer.