mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
hub MDL-19309 new site registration form + course publication + community block
This commit is contained in:
parent
7b4c6d34b8
commit
07ab0c80ec
36 changed files with 3208 additions and 21 deletions
66
blocks/community/block_community.php
Normal file
66
blocks/community/block_community.php
Normal file
|
@ -0,0 +1,66 @@
|
|||
<?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/>.
|
||||
|
||||
/*
|
||||
* @package blocks
|
||||
* @subpackage community
|
||||
* @author Jerome Mouneyrac <jerome@mouneyrac.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL
|
||||
* @copyright (C) 1999 onwards Martin Dougiamas http://dougiamas.com
|
||||
*
|
||||
* The community block
|
||||
*/
|
||||
|
||||
require_once('locallib.php');
|
||||
|
||||
class block_community extends block_list {
|
||||
function init() {
|
||||
$this->title = get_string('pluginname', 'block_community');
|
||||
$this->version = 2010042701;
|
||||
}
|
||||
|
||||
function get_content() {
|
||||
|
||||
global $CFG, $OUTPUT, $USER;
|
||||
|
||||
$this->content = new stdClass();
|
||||
$this->content->items = array();
|
||||
$this->content->icons = array();
|
||||
$this->content->footer = '';
|
||||
|
||||
$this->content->items[] = '<a href='.$CFG->wwwroot.'/blocks/community/communitycourse.php?add=true>'.get_string('addcourse', 'block_community').'</a>';
|
||||
$this->content->icons[] = '<img src="'.$OUTPUT->pix_url('i/group') . '" class="icon" alt="" />';
|
||||
|
||||
$community = new community();
|
||||
$courses = $community->get_community_courses($USER->id);
|
||||
$this->content->items[] = '';
|
||||
$this->content->icons[] = '';
|
||||
$this->content->items[] = get_string('mycommunities', 'block_community');
|
||||
$this->content->icons[] = '';
|
||||
foreach ($courses as $course) {
|
||||
$this->content->items[] = '<a href='.$course->courseurl.'>'.$course->coursename.'</a>';
|
||||
$this->content->icons[] = '';
|
||||
}
|
||||
|
||||
return $this->content;
|
||||
}
|
||||
|
||||
function applicable_formats() {
|
||||
return array('all' => true);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue