Proyectos de Subversion Moodle

Rev

Rev 277 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 277 Rev 1441
Línea 19... Línea 19...
19
 *
19
 *
20
 * @package    block_comments
20
 * @package    block_comments
21
 * @copyright 2009 Dongsheng Cai <dongsheng@moodle.com>
21
 * @copyright 2009 Dongsheng Cai <dongsheng@moodle.com>
22
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
22
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
23
 */
23
 */
24
class block_comments extends block_base
24
class block_comments extends block_base {
25
{
-
 
Línea 26... Línea 25...
26
 
25
 
27
    function init()
-
 
28
    {
26
    function init() {
Línea 29... Línea 27...
29
        global $CFG;
27
        global $CFG;
Línea 30... Línea 28...
30
 
28
 
31
        require_once($CFG->dirroot . '/comment/lib.php');
29
        require_once($CFG->dirroot . '/comment/lib.php');
Línea 32... Línea 30...
32
 
30
 
33
        $this->title = get_string('pluginname', 'block_comments');
-
 
34
    }
31
        $this->title = get_string('pluginname', 'block_comments');
35
 
32
    }
36
    function specialization()
33
 
37
    {
-
 
38
        $this->title = get_string('pluginname', 'block_comments');
34
    function specialization() {
39
        comment::init();
-
 
40
    }
35
        // require js for commenting
41
 
36
        comment::init();
Línea 42... Línea -...
42
    function applicable_formats()
-
 
43
    {
-
 
44
        return array('all' => true);
-
 
45
    }
-
 
46
 
-
 
47
    function has_config()
37
    }
48
    {
-
 
49
        return true;
38
    function applicable_formats() {
50
    }
39
        return array('all' => true);
Línea 51... Línea 40...
51
 
40
    }
52
    function instance_allow_multiple()
-
 
53
    {
41
 
Línea 54... Línea 42...
54
        return false;
42
    function instance_allow_multiple() {
55
    }
43
        return false;
56
 
44
    }
Línea 101... Línea 89...
101
     * This block shouldn't be added to a page if the comments advanced feature is disabled.
89
     * This block shouldn't be added to a page if the comments advanced feature is disabled.
102
     *
90
     *
103
     * @param moodle_page $page
91
     * @param moodle_page $page
104
     * @return bool
92
     * @return bool
105
     */
93
     */
106
    public function can_block_be_added(moodle_page $page): bool
94
    public function can_block_be_added(moodle_page $page): bool {
107
    {
-
 
108
        global $CFG;
95
        global $CFG;
Línea 109... Línea 96...
109
 
96
 
110
        return $CFG->usecomments;
97
        return $CFG->usecomments;
111
    }
98
    }