MDL-26854 COMMENT
1. added pluginname_comment_validate callback to comments api
2. change permission callback defaults to false
3. Tidied up serveal areas of comments and implemented callback to
ignore system permissions for view (credits to Sam Hemelryk)
AMOS BEGIN
MOV [modulerejectcomment,error],[callbackrejectcomment,error]
AMOS END
This commit is contained in:
@@ -1,5 +1,31 @@
|
||||
<?php
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* The comments block
|
||||
*
|
||||
* @package block
|
||||
* @subpackage comments
|
||||
* @copyright 2009 Dongsheng Cai <[email protected]>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
// Obviously required
|
||||
require_once($CFG->dirroot . '/comment/lib.php');
|
||||
|
||||
class block_comments extends block_base {
|
||||
@@ -38,13 +64,12 @@ class block_comments extends block_base {
|
||||
$this->content->footer = '';
|
||||
$this->content->text = '';
|
||||
list($context, $course, $cm) = get_context_info_array($PAGE->context->id);
|
||||
$args = new stdClass();
|
||||
|
||||
$args = new stdClass;
|
||||
$args->context = $PAGE->context;
|
||||
$args->course = $course;
|
||||
$args->area = 'page_comments';
|
||||
$args->itemid = 0;
|
||||
// set 'env' to tell moodle tweak ui for this block
|
||||
$args->env = 'block_comments';
|
||||
$args->component = 'block_comments';
|
||||
$args->linktext = get_string('showcomments');
|
||||
$args->notoggle = true;
|
||||
|
||||
Reference in New Issue
Block a user