Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 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
/**
19
 * Version upgrade scripts for the message teacher block
20
 *
21
 * @package    block_messageteacher
22
 * @author     Mark Johnson <mark@barrenfrozenwasteland.com>
23
 * @copyright  2012 onwards Mark Johnson
24
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
25
 */
26
 
27
defined('MOODLE_INTERNAL') || die();
28
 
29
/**
30
 * Plugin upgrade steps
31
 *
32
 * @param int $oldversion
33
 * @return bool
34
 */
35
function xmldb_block_messageteacher_upgrade($oldversion=0) {
36
 
37
    global $CFG;
38
 
39
    $result = true;
40
 
41
    // And upgrade begins here. For each one, you'll need one
42
    // block of code similar to the next one. Please, delete
43
    // this comment lines once this file start handling proper
44
    // upgrade code.
45
 
46
    if ($result && $oldversion < 2012121501) {
47
        $config = array('roles', 'groups', 'showuserpictures');
48
        foreach ($config as $name) {
49
            if ($value = $CFG->{'block_messageteacher_'.$name}) {
50
                set_config($name, $value, 'block_messageteacher');
51
            }
52
        }
53
 
54
        upgrade_block_savepoint(true, 2012121501, 'messageteacher');
55
    }
56
 
57
    return $result;
58
}