community block MDL-22890 sort search results
This commit is contained in:
@@ -149,6 +149,8 @@ if (!empty($fromform)) {
|
||||
$options->language = $fromform->language;
|
||||
}
|
||||
|
||||
$options->orderby = $fromform->orderby;
|
||||
|
||||
//check if the selected hub is from the registered list (in this case we use the private token)
|
||||
$token = 'publichub';
|
||||
$registrationmanager = new registration_manager();
|
||||
|
||||
@@ -214,6 +214,17 @@ class community_hub_search_form extends moodleform {
|
||||
$mform->setDefault('language', 'all');
|
||||
$mform->addHelpButton('language', 'language', 'block_community');
|
||||
|
||||
$mform->addElement('radio', 'orderby', get_string('orderby', 'block_community'),
|
||||
get_string('orderbynewest', 'block_community'), 'newest');
|
||||
$mform->addElement('radio', 'orderby', null,
|
||||
get_string('orderbyeldest', 'block_community'), 'eldest');
|
||||
$mform->addElement('radio', 'orderby', null,
|
||||
get_string('orderbyname', 'block_community'), 'fullname');
|
||||
$mform->addElement('radio', 'orderby', null,
|
||||
get_string('orderbypublisher', 'block_community'), 'publisher');
|
||||
$mform->setDefault('orderby', 'newest');
|
||||
$mform->setType('orderby', PARAM_ALPHA);
|
||||
|
||||
$mform->addElement('text', 'search', get_string('keywords', 'block_community'));
|
||||
$mform->addHelpButton('search', 'keywords', 'block_community');
|
||||
|
||||
|
||||
@@ -75,6 +75,12 @@ $string['nocomments'] = 'No comments';
|
||||
$string['nocourse'] = 'No courses found';
|
||||
$string['noratings'] = 'No ratings';
|
||||
$string['operation'] = 'Operation';
|
||||
$string['orderby'] = 'Sort by';
|
||||
$string['orderby_help'] = 'The order the search results are displayed.';
|
||||
$string['orderbynewest'] = 'Newest';
|
||||
$string['orderbyeldest'] = 'Eldest';
|
||||
$string['orderbyname'] = 'Name';
|
||||
$string['orderbypublisher'] = 'Publisher';
|
||||
$string['outcomes'] = 'Outcomes: {$a}';
|
||||
$string['pluginname'] = 'Community';
|
||||
$string['rateandcomment'] = 'Rate and comment';
|
||||
|
||||
Reference in New Issue
Block a user