// URL.
$mform->addElement('text', 'url', get_string('importfromurl', 'calendar'), array('maxsize' => '255', 'size' => '50'));
- $mform->setType('url', PARAM_URL);
+ // Cannot set as PARAM_URL since we need to allow webcal:// protocol.
+ $mform->setType('url', PARAM_RAW);
- // Import file
- $mform->addElement('filepicker', 'importfile', get_string('importfromfile', 'calendar'));
-
- $mform->disabledIf('url', 'importfrom', 'eq', CALENDAR_IMPORT_FROM_FILE);
- $mform->disabledIf('importfile', 'importfrom', 'eq', CALENDAR_IMPORT_FROM_URL);
-
// Poll interval
$choices = calendar_get_pollinterval_choices();
$mform->addElement('select', 'pollinterval', get_string('pollinterval', 'calendar'), $choices);