MDL-35415 completely remove add activity in settings (MDL-22732)
[moodle.git] / course / format / social / lib.php
CommitLineData
7d2a0492 1<?php
2// This file is part of Moodle - http://moodle.org/
3//
4// Moodle is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8//
9// Moodle is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
16
17/**
18 * This file contains general functions for the course format Social
19 *
20 * @since 2.0
21 * @package moodlecore
22 * @copyright 2009 Sam Hemelryk
23 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
24 */
25
26/**
27 * Used to display the course structure for a course where format=social
28 *
29 * This is called automatically by {@link load_course()} if the current course
30 * format = weeks.
31 *
32 * @param array $path An array of keys to the course node in the navigation
33 * @param stdClass $modinfo The mod info object for the current course
34 * @return bool Returns true
35 */
0f4ab67d
SH
36function callback_social_load_content(&$navigation, $course, $coursenode) {
37 return $navigation->load_generic_course_sections($course, $coursenode, 'social');
7d2a0492 38}
39
40/**
41 * Used to display the course structure for a course where format=social
42 *
43 * This is called automatically by {@link load_course()} if the current course
44 * format = weeks and the navigation was requested via AJAX
45 *
46 * @param array $path An array of keys to the course node in the navigation
47 * @param stdClass $modinfo The mod info object for the current course
48 * @return bool Returns true
49 */
50function limited_load_section_social(&$navigation, $keys, $course, $section) {
51 $navigation->limited_load_section_generic($keys, $course, $section, get_string('social'), 'social');
52}
53
4bd1108f
MD
54/**
55 * Indicates this format uses sections.
56 *
57 * @return bool Returns true
58 */
eb1c14e0 59function callback_social_uses_sections() {
4bd1108f
MD
60 return false;
61}
62
7d2a0492 63/**
64 * The string that is used to describe a section of the course
65 * e.g. Topic, Week...
66 *
67 * @return string
68 */
69function callback_social_definition() {
4bd1108f 70 return get_string('topic');
7d2a0492 71}
72
7d2a0492 73/**
74 * Toogle display of course contents (sections, activities)
75 *
76 * @return bool
77 */
78function callback_social_display_content() {
79 return false;
80}
81
aa6c1ced 82