mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 08:26:37 +02:00
MDL-17203 new option for disabling of calendar export
This commit is contained in:
parent
81f2bb8122
commit
dbf9d4cb37
5 changed files with 22 additions and 9 deletions
|
@ -44,6 +44,7 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
|
||||||
$temp->add(new admin_setting_special_calendar_weekend());
|
$temp->add(new admin_setting_special_calendar_weekend());
|
||||||
$temp->add(new admin_setting_configtext('calendar_lookahead',get_string('configlookahead','admin'),get_string('helpupcominglookahead', 'admin'),21,PARAM_INT));
|
$temp->add(new admin_setting_configtext('calendar_lookahead',get_string('configlookahead','admin'),get_string('helpupcominglookahead', 'admin'),21,PARAM_INT));
|
||||||
$temp->add(new admin_setting_configtext('calendar_maxevents',get_string('configmaxevents','admin'),get_string('helpupcomingmaxevents', 'admin'),10,PARAM_INT));
|
$temp->add(new admin_setting_configtext('calendar_maxevents',get_string('configmaxevents','admin'),get_string('helpupcomingmaxevents', 'admin'),10,PARAM_INT));
|
||||||
|
$temp->add(new admin_setting_configcheckbox('enablecalendarexport', get_string('enablecalendarexport', 'admin'), get_string('configenablecalendarexport','admin'), 1));
|
||||||
$ADMIN->add('appearance', $temp);
|
$ADMIN->add('appearance', $temp);
|
||||||
|
|
||||||
// "htmleditor" settingpage
|
// "htmleditor" settingpage
|
||||||
|
|
|
@ -15,6 +15,10 @@ if ($courseid = optional_param('course', 0, PARAM_INT)) {
|
||||||
|
|
||||||
require_login();
|
require_login();
|
||||||
|
|
||||||
|
if (empty($CFG->enablecalendarexport)) {
|
||||||
|
die('no export');
|
||||||
|
}
|
||||||
|
|
||||||
if(!$site = get_site()) {
|
if(!$site = get_site()) {
|
||||||
redirect($CFG->wwwroot.'/'.$CFG->admin.'/index.php');
|
redirect($CFG->wwwroot.'/'.$CFG->admin.'/index.php');
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,10 @@ require_once($CFG->libdir.'/bennu/bennu.inc.php');
|
||||||
$username = required_param('username', PARAM_TEXT);
|
$username = required_param('username', PARAM_TEXT);
|
||||||
$authtoken = required_param('authtoken', PARAM_ALPHANUM);
|
$authtoken = required_param('authtoken', PARAM_ALPHANUM);
|
||||||
|
|
||||||
|
if (empty($CFG->enablecalendarexport)) {
|
||||||
|
die('no export');
|
||||||
|
}
|
||||||
|
|
||||||
//Fetch user information
|
//Fetch user information
|
||||||
if (!$user = get_complete_user_data('username', $username)) {
|
if (!$user = get_complete_user_data('username', $username)) {
|
||||||
//No such user
|
//No such user
|
||||||
|
|
|
@ -165,17 +165,19 @@
|
||||||
|
|
||||||
//Link to calendar export page
|
//Link to calendar export page
|
||||||
echo '<div class="bottom">';
|
echo '<div class="bottom">';
|
||||||
print_single_button('export.php', array('course'=>$courseid), get_string('exportcalendar', 'calendar'));
|
if (!empty($CFG->enablecalendarexport)) {
|
||||||
|
print_single_button('export.php', array('course'=>$courseid), get_string('exportcalendar', 'calendar'));
|
||||||
|
|
||||||
if (!empty($USER->id)) {
|
if (!empty($USER->id)) {
|
||||||
$authtoken = sha1($USER->username . $USER->password);
|
$authtoken = sha1($USER->username . $USER->password);
|
||||||
$usernameencoded = urlencode($USER->username);
|
$usernameencoded = urlencode($USER->username);
|
||||||
|
|
||||||
echo "<a href=\"export_execute.php?preset_what=all&preset_time=recentupcoming&username=$usernameencoded&authtoken=$authtoken\">"
|
echo "<a href=\"export_execute.php?preset_what=all&preset_time=recentupcoming&username=$usernameencoded&authtoken=$authtoken\">"
|
||||||
.'<img src="'.$CFG->pixpath.'/i/ical.gif" height="14" width="36" '
|
.'<img src="'.$CFG->pixpath.'/i/ical.gif" height="14" width="36" '
|
||||||
.'alt="'.get_string('ical', 'calendar').'" '
|
.'alt="'.get_string('ical', 'calendar').'" '
|
||||||
.'title="'.get_string('quickdownloadcalendar', 'calendar').'" />'
|
.'title="'.get_string('quickdownloadcalendar', 'calendar').'" />'
|
||||||
.'</a>';
|
.'</a>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
echo '</div>';
|
echo '</div>';
|
||||||
|
|
|
@ -114,6 +114,7 @@ $string['configemailchangeconfirmation'] = 'Require an email confirmation step w
|
||||||
$string['configemoticons'] = 'Change the code on the left that relates to the name of the emoticon on the right. To add new emoticons, add a code and a name, then add an image as name.gif in /pix/s.';
|
$string['configemoticons'] = 'Change the code on the left that relates to the name of the emoticon on the right. To add new emoticons, add a code and a name, then add an image as name.gif in /pix/s.';
|
||||||
$string['configenableajax'] = 'This setting allows you to control the use of AJAX (advanced client/server interfaces using Javascript) across the whole site. With this setting enabled users can still make a choice in their profile, otherwise AJAX is disabled for everybody.';
|
$string['configenableajax'] = 'This setting allows you to control the use of AJAX (advanced client/server interfaces using Javascript) across the whole site. With this setting enabled users can still make a choice in their profile, otherwise AJAX is disabled for everybody.';
|
||||||
$string['configdisablecourseajax'] = 'Do not use AJAX when editing main course pages.';
|
$string['configdisablecourseajax'] = 'Do not use AJAX when editing main course pages.';
|
||||||
|
$string['configenablecalendarexport'] = 'Enable exporting or subscribing to calendars.';
|
||||||
$string['configenablecourserequests'] = 'This will allow any user to request a course be created.';
|
$string['configenablecourserequests'] = 'This will allow any user to request a course be created.';
|
||||||
$string['configenableglobalsearch'] = 'This setting enables global text searching in resources and activities, it is not compatible with PHP 4.';
|
$string['configenableglobalsearch'] = 'This setting enables global text searching in resources and activities, it is not compatible with PHP 4.';
|
||||||
$string['configenablegroupings'] = 'This setting enables groupings of groups.';
|
$string['configenablegroupings'] = 'This setting enables groupings of groups.';
|
||||||
|
@ -354,6 +355,7 @@ $string['emailchangeconfirmation'] = 'Email change confirmation';
|
||||||
$string['emoticons'] = 'Emoticons';
|
$string['emoticons'] = 'Emoticons';
|
||||||
$string['emptysettingvalue'] = 'Empty';
|
$string['emptysettingvalue'] = 'Empty';
|
||||||
$string['enableajax'] = 'Enable AJAX';
|
$string['enableajax'] = 'Enable AJAX';
|
||||||
|
$string['enablecalendarexport'] = 'Enable calendar export';
|
||||||
$string['enablecourserequests'] = 'Enable course requests';
|
$string['enablecourserequests'] = 'Enable course requests';
|
||||||
$string['enableglobalsearch'] = 'Enable global search';
|
$string['enableglobalsearch'] = 'Enable global search';
|
||||||
$string['enablegroupings'] = 'Enable groupings';
|
$string['enablegroupings'] = 'Enable groupings';
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue