From 60da0467ecdb3dee6cc59311fd59b0d9b40ac177 Mon Sep 17 00:00:00 2001 From: Adam Olley Date: Thu, 3 Oct 2013 14:14:42 +0930 Subject: [PATCH] MDL-42122 block_community: Dont show install option without capability --- blocks/community/communitycourse.php | 2 +- blocks/community/forms.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/blocks/community/communitycourse.php b/blocks/community/communitycourse.php index fe21d76b15f..a7224e5c52e 100644 --- a/blocks/community/communitycourse.php +++ b/blocks/community/communitycourse.php @@ -142,7 +142,7 @@ $fromformdata['subject'] = optional_param('subject', 'all', PARAM_ALPHANUMEXT); $fromformdata['audience'] = optional_param('audience', 'all', PARAM_ALPHANUMEXT); $fromformdata['language'] = optional_param('language', current_language(), PARAM_ALPHANUMEXT); $fromformdata['educationallevel'] = optional_param('educationallevel', 'all', PARAM_ALPHANUMEXT); -$fromformdata['downloadable'] = optional_param('downloadable', 1, PARAM_ALPHANUM); +$fromformdata['downloadable'] = optional_param('downloadable', $usercandownload, PARAM_ALPHANUM); $fromformdata['orderby'] = optional_param('orderby', 'newest', PARAM_ALPHA); $fromformdata['huburl'] = optional_param('huburl', HUB_MOODLEORGHUBURL, PARAM_URL); $fromformdata['search'] = $search; diff --git a/blocks/community/forms.php b/blocks/community/forms.php index cb8d7d3e188..552130ccf3d 100644 --- a/blocks/community/forms.php +++ b/blocks/community/forms.php @@ -213,6 +213,7 @@ class community_hub_search_form extends moodleform { } else { $mform->addElement('hidden', 'downloadable', 0); } + $mform->setType('downloadable', PARAM_INT); $options = array(); $options['all'] = get_string('any');