Skip to content

Commit

Permalink
MDL-82313 mod_data: refactor field icon display
Browse files Browse the repository at this point in the history
  • Loading branch information
mackensen committed Nov 11, 2024
1 parent 2b337b4 commit 557fe73
Show file tree
Hide file tree
Showing 14 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion mod/data/classes/output/action_bar.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public function get_create_fields(bool $isprimarybutton = false): \action_menu {
$fieldselectparams['newtype'] = $fieldtype;
$fieldselect->add(new \action_menu_link(
new moodle_url('/mod/data/field.php', $fieldselectparams),
new \pix_icon('field/' . $fieldtype, $fieldname, 'data'),
new \image_icon('icon', $fieldtype, 'datafield_' . $fieldtype),
$fieldname,
false
));
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
10 changes: 7 additions & 3 deletions mod/data/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@ function name() {
function image() {
global $OUTPUT;

return $OUTPUT->pix_icon('field/' . $this->type, $this->type, 'data');
return $OUTPUT->image_icon('icon', $this->type, 'datafield_' . $this->type);
}

/**
Expand Down Expand Up @@ -4121,10 +4121,14 @@ function data_view($data, $course, $cm, $context) {
}

/**
* Get icon mapping for font-awesome.
* Get the list of deprecated icons.
*
* @return array with the deprecated key icons.
*/
function mod_data_get_fontawesome_icon_map() {
function mod_data_get_deprecated_icons() {
return [
// Deprecated since Moodle 4.6.
// See MDL-82313 for refactoring.
'mod_data:field/checkbox' => 'fa-regular fa-square-check',
'mod_data:field/date' => 'fa-regular fa-calendar',
'mod_data:field/file' => 'fa-regular fa-file',
Expand Down

0 comments on commit 557fe73

Please sign in to comment.