Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 1441
Línea 15... Línea 15...
15
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
15
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
Línea 16... Línea 16...
16
 
16
 
17
/**
17
/**
18
 * Badges user preferences page.
18
 * Badges user preferences page.
19
 *
19
 *
20
 * @package    core
20
 * @package    core_badges
21
 * @subpackage badges
21
 * @subpackage badges
22
 * @copyright  2013 onwards Totara Learning Solutions Ltd {@link http://www.totaralms.com/}
22
 * @copyright  2013 onwards Totara Learning Solutions Ltd {@link http://www.totaralms.com/}
23
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
23
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
24
 * @author     Yuliya Bozhko <yuliya.bozhko@totaralms.com>
24
 * @author     Yuliya Bozhko <yuliya.bozhko@totaralms.com>
Línea 25... Línea 25...
25
 */
25
 */
26
 
26
 
-
 
27
require_once(__DIR__ . '/../config.php');
27
require_once(__DIR__ . '/../config.php');
28
require_once($CFG->dirroot . '/user/editlib.php');
Línea 28... Línea 29...
28
require_once('preferences_form.php');
29
 
Línea 29... Línea 30...
29
require_once($CFG->dirroot.'/user/editlib.php');
30
use core_badges\form\preferences;
30
 
31
 
Línea 37... Línea 38...
37
 
38
 
38
if (empty($CFG->enablebadges)) {
39
if (empty($CFG->enablebadges)) {
39
    throw new \moodle_exception('badgesdisabled', 'badges');
40
    throw new \moodle_exception('badgesdisabled', 'badges');
Línea 40... Línea 41...
40
}
41
}
41
 
42
 
Línea 42... Línea 43...
42
$mform = new badges_preferences_form();
43
$mform = new preferences();
43
$mform->set_data(array('badgeprivacysetting' => get_user_preferences('badgeprivacysetting')));
44
$mform->set_data(['badgeprivacysetting' => get_user_preferences('badgeprivacysetting')]);
44
 
45
 
45
if (!$mform->is_cancelled() && $data = $mform->get_data()) {
46
if (!$mform->is_cancelled() && $data = $mform->get_data()) {