Commit 60bfdf62 authored by Aaron Wells's avatar Aaron Wells Committed by Gerrit Code Review
Browse files

Merge "Bug 1690221: Add sort order to the profile types chooser"

parents bcaf92b7 1ffd82ce
......@@ -260,7 +260,18 @@ class PluginBlocktypeProfileinfo extends MaharaCoreBlocktype {
* are listed in the profile screen
*/
public static function artefactchooser_get_sort_order() {
return '';
safe_require('artefact', 'internal');
$artefacttypes = array_diff(PluginArtefactInternal::get_profile_artefact_types(), array('email'));
if (!get_record('blocktype_installed', 'active', 1, 'name', 'socialprofile')) {
$artefacttypes = array_diff($artefacttypes, array('socialprofile'));
}
$sortorder = array();
foreach ($artefacttypes as $type) {
$sortorder[] = array('fieldname' => 'artefacttype',
'fieldvalue' => $type,
'order' => 'DESC');
}
return $sortorder;
}
public static function rewrite_blockinstance_config(View $view, $configdata) {
......
......@@ -3358,8 +3358,11 @@ class View {
else {
$sortorder .= ', ';
}
$sortorder .= $field['fieldname'] . ' ' . $order;
$fieldname = $field['fieldname'];
if (!empty($field['fieldvalue'])) {
$fieldname .= " = '" . $field['fieldvalue'] . "'";
}
$sortorder .= $fieldname . ' ' . $order;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment