Skip to content

Commit

Permalink
"MDL-23917, added component parameter to comment api"
Browse files Browse the repository at this point in the history
  • Loading branch information
Dongsheng Cai committed Aug 25, 2010
1 parent e993559 commit 7ade777
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions comment/comment.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ M.core_comment = {
this.client_id = args.client_id;
this.itemid = args.itemid;
this.commentarea = args.commentarea;
this.component = args.component;
this.courseid = args.courseid;
this.contextid = args.contextid;
this.env = args.env;
Expand Down Expand Up @@ -121,6 +122,7 @@ bodyContent: '<div class="comment-delete-confirm"><a href="#" id="confirmdelete-
params['area'] = this.commentarea;
params['courseid'] = this.courseid;
params['contextid'] = this.contextid;
params['component'] = this.component;
if (args['params']) {
for (i in args['params']) {
params[i] = args['params'][i];
Expand Down
2 changes: 2 additions & 0 deletions comment/comment_ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
$content = optional_param('content', '', PARAM_RAW);
$itemid = optional_param('itemid', '', PARAM_INT);
$page = optional_param('page', 0, PARAM_INT);
$component = optional_param('component', '', PARAM_ALPHAEXT);

echo $OUTPUT->header(); // send headers

Expand All @@ -57,6 +58,7 @@
$args->area = $area;
$args->itemid = $itemid;
$args->client_id = $client_id;
$args->component = $component;
$manager = new comment($args);
} else {
die;
Expand Down
2 changes: 2 additions & 0 deletions comment/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ public static function init() {
}

public function set_component($component) {
$this->component = $component;
list($this->plugintype, $this->pluginname) = normalize_component($component);
return null;
}
Expand Down Expand Up @@ -277,6 +278,7 @@ public function output($return = true) {
$options->courseid = $this->courseid;
$options->contextid = $this->contextid;
$options->env = $this->env;
$options->component = $this->component;
if ($this->env == 'block_comments') {
$options->notoggle = true;
$options->autostart = true;
Expand Down

0 comments on commit 7ade777

Please sign in to comment.