芝麻web文件管理V1.00
编辑当前文件:/home2/sdektunc/.trash/cepali/blocks/community/block_community.php
. /** * @package block_community * @author Jerome Mouneyrac
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL * @copyright (C) 1999 onwards Martin Dougiamas http://dougiamas.com * * The community block */ class block_community extends block_list { function init() { $this->title = get_string('pluginname', 'block_community'); } function user_can_addto($page) { // Don't allow people to add the block if they can't even use it if (!has_capability('moodle/community:add', $page->context)) { return false; } return parent::user_can_addto($page); } function user_can_edit() { // Don't allow people to edit the block if they can't even use it if (!has_capability('moodle/community:add', context::instance_by_id($this->instance->parentcontextid))) { return false; } return parent::user_can_edit(); } function get_content() { $this->content = new stdClass(); $this->content->items = array(); $this->content->icons = array(); $this->content->footer = ''; $this->content->items[] = get_string('functionalityremoved', 'error'); return $this->content; } }