Proyectos de Subversion Moodle

Rev

Rev 1441 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1441 Rev 1450
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 25... Línea 26...
25
 
26
 
-
 
27
    function init()
26
    function init() {
28
    {
Línea 27... Línea 29...
27
        global $CFG;
29
        global $CFG;
Línea 28... Línea 30...
28
 
30
 
29
        require_once($CFG->dirroot . '/comment/lib.php');
31
        require_once($CFG->dirroot . '/comment/lib.php');
Línea 30... Línea 32...
30
 
32
 
-
 
33
        $this->title = get_string('pluginname', 'block_comments');
31
        $this->title = get_string('pluginname', 'block_comments');
34
    }
32
    }
35
 
33
 
36
    function specialization()
-
 
37
    {
34
    function specialization() {
38
        $this->title = get_string('pluginname', 'block_comments');
-
 
39
        comment::init();
35
        // require js for commenting
40
    }
36
        comment::init();
41
 
Línea -... Línea 42...
-
 
42
    function applicable_formats()
-
 
43
    {
-
 
44
        return array('all' => true);
-
 
45
    }
-
 
46
 
37
    }
47
    function has_config()
-
 
48
    {
38
    function applicable_formats() {
49
        return true;
39
        return array('all' => true);
50
    }
Línea 40... Línea 51...
40
    }
51
 
-
 
52
    function instance_allow_multiple()
41
 
53
    {
Línea 42... Línea 54...
42
    function instance_allow_multiple() {
54
        return false;
43
        return false;
55
    }
44
    }
56
 
Línea 89... Línea 101...
89
     * This block shouldn't be added to a page if the comments advanced feature is disabled.
101
     * This block shouldn't be added to a page if the comments advanced feature is disabled.
90
     *
102
     *
91
     * @param moodle_page $page
103
     * @param moodle_page $page
92
     * @return bool
104
     * @return bool
93
     */
105
     */
94
    public function can_block_be_added(moodle_page $page): bool {
106
    public function can_block_be_added(moodle_page $page): bool
-
 
107
    {
95
        global $CFG;
108
        global $CFG;
Línea 96... Línea 109...
96
 
109
 
97
        return $CFG->usecomments;
110
        return $CFG->usecomments;
98
    }
111
    }