芝麻web文件管理V1.00
编辑当前文件:/home2/sdektunc/.trash/cepali/blocks/participants/block_participants.php
. /** * Participants block * * @package block_participants * @copyright 1999 onwards Martin Dougiamas (http://dougiamas.com) * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ defined('MOODLE_INTERNAL') || die(); require_once($CFG->dirroot . '/course/lib.php'); /** * Participants block * * @package block_participants * @copyright 1999 onwards Martin Dougiamas (http://dougiamas.com) * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class block_participants extends block_list { function init() { $this->title = get_string('pluginname', 'block_participants'); } function get_content() { global $CFG, $OUTPUT; if (empty($this->instance)) { $this->content = ''; return $this->content; } $this->content = new stdClass(); $this->content->items = array(); $this->content->icons = array(); $this->content->footer = ''; // user/index.php expect course context, so get one if page has module context. $currentcontext = $this->page->context->get_course_context(false); if (empty($currentcontext)) { $this->content = ''; return $this->content; } else if ($this->page->course->id == SITEID) { if (!course_can_view_participants(context_system::instance())) { $this->content = ''; return $this->content; } } else { if (!course_can_view_participants($currentcontext)) { $this->content = ''; return $this->content; } } $icon = $OUTPUT->pix_icon('i/users', ''); $this->content->items[] = '
'.$icon.get_string('participants').'
'; return $this->content; } // my moodle can only have SITEID and it's redundant here, so take it away function applicable_formats() { return array('all' => true, 'my' => false, 'tag' => false); } }