mirror of
https://github.com/moodle/moodle.git
synced 2025-03-01 06:22:39 +01:00
Thanks very much to Remote Learner Canada, especially Hubert Chathi and Olav Jordan, for their work on the bulk of this code, and also Mike Churchward for supporting them. I worked on it after that (actually simplified it by removing a feature temporarily: multiple pages) to bring it more to what I was imagining, and to provide a base to build on and get all the navigation perfect. There's still work to do. Some blocks don't quite work as expected, and some of the code still needs upgrading to bring it fully into line with 2.0. We also could use a much better course overview block and better CSS styling of the profile pages. But it's definitely more usable this it was, I think.
157 lines
7.5 KiB
PHP
157 lines
7.5 KiB
PHP
<?php
|
|
|
|
// This file is part of Moodle - http://moodle.org/
|
|
//
|
|
// Moodle is free software: you can redistribute it and/or modify
|
|
// it under the terms of the GNU General Public License as published by
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
// (at your option) any later version.
|
|
//
|
|
// Moodle is distributed in the hope that it will be useful,
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
// GNU General Public License for more details.
|
|
//
|
|
// You should have received a copy of the GNU General Public License
|
|
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
/**
|
|
* Form for editing profile block settings
|
|
*
|
|
* @package blocks
|
|
* @copyright 2010 Remote-Learner.net
|
|
* @author Olav Jordan <olav.jordan@remote-learner.ca>
|
|
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
|
*/
|
|
class block_myprofile_edit_form extends block_edit_form {
|
|
protected function specific_definition($mform) {
|
|
global $CFG;
|
|
$mform->addElement('header', 'configheader', get_string('myprofile_settings', 'block_myprofile'));
|
|
|
|
$mform->addElement('selectyesno', 'config_display_picture', get_string('display_picture', 'block_myprofile'));
|
|
if (isset($this->block->config->display_picture)) {
|
|
$mform->setDefault('config_display_picture', $this->block->config->display_picture);
|
|
} else {
|
|
$mform->setDefault('config_display_picture', '1');
|
|
}
|
|
|
|
$mform->addElement('selectyesno', 'config_display_country', get_string('display_country', 'block_myprofile'));
|
|
if (isset($this->block->config->display_country)) {
|
|
$mform->setDefault('config_display_country', $this->block->config->display_country);
|
|
} else {
|
|
$mform->setDefault('config_display_country', '1');
|
|
}
|
|
|
|
$mform->addElement('selectyesno', 'config_display_city', get_string('display_city', 'block_myprofile'));
|
|
if (isset($this->block->config->display_city)) {
|
|
$mform->setDefault('config_display_city', $this->block->config->display_city);
|
|
} else {
|
|
$mform->setDefault('config_display_city', '1');
|
|
}
|
|
|
|
$mform->addElement('selectyesno', 'config_display_email', get_string('display_email', 'block_myprofile'));
|
|
if (isset($this->block->config->display_email)) {
|
|
$mform->setDefault('config_display_email', $this->block->config->display_email);
|
|
} else {
|
|
$mform->setDefault('config_display_email', '1');
|
|
}
|
|
|
|
$mform->addElement('selectyesno', 'config_display_un', get_string('display_un', 'block_myprofile'));
|
|
if (isset($this->block->config->display_un)) {
|
|
$mform->setDefault('config_display_un', $this->block->config->display_un);
|
|
} else {
|
|
$mform->setDefault('config_display_un', '0');
|
|
}
|
|
|
|
$mform->addElement('selectyesno', 'config_display_icq', get_string('display_icq', 'block_myprofile'));
|
|
if (isset($this->block->config->display_icq)) {
|
|
$mform->setDefault('config_display_icq', $this->block->config->display_icq);
|
|
} else {
|
|
$mform->setDefault('config_display_icq', '0');
|
|
}
|
|
|
|
$mform->addElement('selectyesno', 'config_display_skype', get_string('display_skype', 'block_myprofile'));
|
|
if (isset($this->block->config->display_skype)) {
|
|
$mform->setDefault('config_display_skype', $this->block->config->display_skype);
|
|
} else {
|
|
$mform->setDefault('config_display_skype', '0');
|
|
}
|
|
|
|
$mform->addElement('selectyesno', 'config_display_yahoo', get_string('display_yahoo', 'block_myprofile'));
|
|
if (isset($this->block->config->display_yahoo)) {
|
|
$mform->setDefault('config_display_yahoo', $this->block->config->display_yahoo);
|
|
} else {
|
|
$mform->setDefault('config_display_yahoo', '0');
|
|
}
|
|
|
|
$mform->addElement('selectyesno', 'config_display_aim', get_string('display_aim', 'block_myprofile'));
|
|
if (isset($this->block->config->display_aim)) {
|
|
$mform->setDefault('config_display_aim', $this->block->config->display_aim);
|
|
} else {
|
|
$mform->setDefault('config_display_aim', '0');
|
|
}
|
|
|
|
$mform->addElement('selectyesno', 'config_display_msn', get_string('display_msn', 'block_myprofile'));
|
|
if (isset($this->block->config->display_msn)) {
|
|
$mform->setDefault('config_display_msn', $this->block->config->display_msn);
|
|
} else {
|
|
$mform->setDefault('config_display_msn', '0');
|
|
}
|
|
|
|
$mform->addElement('selectyesno', 'config_display_phone1', get_string('display_phone1', 'block_myprofile'));
|
|
if (isset($this->block->config->display_phone1)) {
|
|
$mform->setDefault('config_display_phone1', $this->block->config->display_phone1);
|
|
} else {
|
|
$mform->setDefault('config_display_phone1', '0');
|
|
}
|
|
|
|
$mform->addElement('selectyesno', 'config_display_phone2', get_string('display_phone2', 'block_myprofile'));
|
|
if (isset($this->block->config->display_phone2)) {
|
|
$mform->setDefault('config_display_phone2', $this->block->config->display_phone2);
|
|
} else {
|
|
$mform->setDefault('config_display_phone2', '0');
|
|
}
|
|
|
|
$mform->addElement('selectyesno', 'config_display_institution', get_string('display_institution', 'block_myprofile'));
|
|
if (isset($this->block->config->display_institution)) {
|
|
$mform->setDefault('config_display_institution', $this->block->config->display_institution);
|
|
} else {
|
|
$mform->setDefault('config_display_institution', '0');
|
|
}
|
|
|
|
$mform->addElement('selectyesno', 'config_display_address', get_string('display_address', 'block_myprofile'));
|
|
if (isset($this->block->config->display_address)) {
|
|
$mform->setDefault('config_display_address', $this->block->config->display_address);
|
|
} else {
|
|
$mform->setDefault('config_display_address', '0');
|
|
}
|
|
|
|
$mform->addElement('selectyesno', 'config_display_firstaccess', get_string('display_firstaccess', 'block_myprofile'));
|
|
if (isset($this->block->config->display_firstaccess)) {
|
|
$mform->setDefault('config_display_firstaccess', $this->block->config->display_firstaccess);
|
|
} else {
|
|
$mform->setDefault('config_display_firstaccess', '0');
|
|
}
|
|
|
|
$mform->addElement('selectyesno', 'config_display_lastaccess', get_string('display_lastaccess', 'block_myprofile'));
|
|
if (isset($this->block->config->display_lastaccess)) {
|
|
$mform->setDefault('config_display_lastaccess', $this->block->config->display_lastaccess);
|
|
} else {
|
|
$mform->setDefault('config_display_lastaccess', '0');
|
|
}
|
|
|
|
$mform->addElement('selectyesno', 'config_display_currentlogin', get_string('display_currentlogin', 'block_myprofile'));
|
|
if (isset($this->block->config->display_currentlogin)) {
|
|
$mform->setDefault('config_display_currentlogin', $this->block->config->display_currentlogin);
|
|
} else {
|
|
$mform->setDefault('config_display_currentlogin', '0');
|
|
}
|
|
|
|
$mform->addElement('selectyesno', 'config_display_lastip', get_string('display_lastip', 'block_myprofile'));
|
|
if (isset($this->block->config->display_lastip)) {
|
|
$mform->setDefault('config_display_lastip', $this->block->config->display_lastip);
|
|
} else {
|
|
$mform->setDefault('config_display_lastip', '0');
|
|
}
|
|
}
|
|
} |