|
Moodle
2.2.1
http://www.collinsharper.com
|
00001 <?php 00002 // This file is part of Moodle - http://moodle.org/ 00003 // 00004 // Moodle is free software: you can redistribute it and/or modify 00005 // it under the terms of the GNU General Public License as published by 00006 // the Free Software Foundation, either version 3 of the License, or 00007 // (at your option) any later version. 00008 // 00009 // Moodle is distributed in the hope that it will be useful, 00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 // GNU General Public License for more details. 00013 // 00014 // You should have received a copy of the GNU General Public License 00015 // along with Moodle. If not, see <http://www.gnu.org/licenses/>. 00016 00026 defined('MOODLE_INTERNAL') || die(); 00027 00040 function block_comments_comment_validate($comment_param) { 00041 if ($comment_param->commentarea != 'page_comments') { 00042 throw new comment_exception('invalidcommentarea'); 00043 } 00044 if ($comment_param->itemid != 0) { 00045 throw new comment_exception('invalidcommentitemid'); 00046 } 00047 return true; 00048 } 00049 00056 function block_comments_comment_permissions($args) { 00057 return array('post'=>true, 'view'=>true); 00058 } 00059 00067 function block_comments_comment_display($comments, $args) { 00068 if ($args->commentarea != 'page_comments') { 00069 throw new comment_exception('invalidcommentarea'); 00070 } 00071 if ($args->itemid != 0) { 00072 throw new comment_exception('invalidcommentitemid'); 00073 } 00074 return $comments; 00075 }