// 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/>. /** * Inbound Message Settings. * * @package tool_messageinbound * @copyright 2014 Andrew Nicols * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ defined('MOODLE_INTERNAL') || die; if ($hassiteconfig) { $category = new admin_category('messageinbound', new lang_string('incomingmailconfiguration', 'tool_messageinbound')); // Create a settings page for all of the mail server settings. $settings = new admin_settingpage('messageinbound_mailsettings', new lang_string('mailsettings', 'tool_messageinbound')); $settings->add(new admin_setting_heading('messageinbound_generalconfiguration', new lang_string('messageinboundgeneralconfiguration', 'tool_messageinbound'), new lang_string('messageinboundgeneralconfiguration_desc', 'tool_messageinbound'), '')); $settings->add(new admin_setting_configcheckbox('messageinbound_enabled', new lang_string('messageinboundenabled', 'tool_messageinbound'), new lang_string('messageinboundenabled_desc', 'tool_messageinbound'), 0)); // These settings are used when generating a Inbound Message address. $settings->add(new admin_setting_heading('messageinbound_mailboxconfiguration', new lang_string('mailboxconfiguration', 'tool_messageinbound'), new lang_string('messageinboundmailboxconfiguration_desc', 'tool_messageinbound'), '')); $settings->add(new admin_setting_configtext('messageinbound_mailbox', new lang_string('mailbox', 'tool_messageinbound'), null, '', PARAM_RAW)); $settings->add(new admin_setting_configtext('messageinbound_domain', new lang_string('domain', 'tool_messageinbound'), null, '', PARAM_RAW)); // These settings are used when checking the incoming mailbox for mail. $settings->add(new admin_setting_heading('messageinbound_serversettings', new lang_string('incomingmailserversettings', 'tool_messageinbound'), new lang_string('incomingmailserversettings_desc', 'tool_messageinbound'), '')); $settings->add(new admin_setting_configtext('messageinbound_host', new lang_string('messageinboundhost', 'tool_messageinbound'), new lang_string('configmessageinboundhost', 'tool_messageinbound'), '', PARAM_RAW)); $options = array('' => get_string('noencryption', 'tool_messageinbound'), 'ssl' => get_string('ssl', 'tool_messageinbound'), 'sslv2' => get_string('sslv2', 'tool_messageinbound'), 'sslv3' => get_string('sslv3', 'tool_messageinbound'), 'tls' => get_string('tls', 'tool_messageinbound'), 'tlsv1' => get_string('tlsv1', 'tool_messageinbound')); $settings->add(new admin_setting_configselect('messageinbound_hostssl', new lang_string('messageinboundhostssl', 'tool_messageinbound'), new lang_string('messageinboundhostssl_desc', 'tool_messageinbound'), 'ssl', $options)); $settings->add(new admin_setting_configtext('messageinbound_hostuser', new lang_string('messageinboundhostuser', 'tool_messageinbound'), new lang_string('messageinboundhostuser_desc', 'tool_messageinbound'), '', PARAM_NOTAGS)); $settings->add(new admin_setting_configpasswordunmask('messageinbound_hostpass', new lang_string('messageinboundhostpass', 'tool_messageinbound'), new lang_string('messageinboundhostpass_desc', 'tool_messageinbound'), ''));
/** * @param bool $fulltree true means all settings required, * false only pages required */ public function __construct($fulltree) { global $CFG; parent::__construct('root', get_string('administration'), false); $this->errors = array(); $this->search = ''; $this->fulltree = $fulltree; $this->loaded = false; $this->category_cache = array(); // load custom defaults if found $this->custom_defaults = null; $defaultsfile = "{$CFG->dirroot}/local/defaults.php"; if (is_readable($defaultsfile)) { $defaults = array(); include $defaultsfile; if (is_array($defaults) and count($defaults)) { $this->custom_defaults = $defaults; } } }
function admin_root() { parent::admin_category('root', get_string('administration'), false); $this->errors = array(); $this->search = ''; $this->fulltree = true; }