Skip to content
Snippets Groups Projects
Commit b4325dc9 authored by Kathrin Osswald's avatar Kathrin Osswald
Browse files

Setting to be able to add a default Font Awesome icon in front of the block title.

parent c4ec15f4
No related branches found
No related tags found
No related merge requests found
......@@ -6,6 +6,7 @@ Changes
### Unreleased
* 2017-03-30 - Setting to be able to add a default Font Awesome icon in front of the block title.
* 2017-03-29 - Setting to be able to hide Moodle's default links in the footer.
* 2017-03-27 - Setting to be able to upload own font files.
* 2017-03-23 - Improved fonts on category overview page.
......
......@@ -197,6 +197,10 @@ We added a back to top button that appears in the right bottom corner when the u
Improved font sizes and weights on category overview page for better readability.
### Block icon
With this setting you can add a default Font Awesome icon in front of the block title. If checked, we additionally provide individual icon replacements for many Moodle core blocks and also some widely used blocks. You also can change the icons easily for each block individually in your raw SCSS via the change of the Font Awesome content. For all available icons please visit http://fontawesome.io/icons/ and use the Unicode value of the icon to replace the default one. The code to change the icon looks like this example change for the block "People": ``.block_people .card-block .card-title::before { content: '\f0c0' ; }``.
Further information
-------------------
......
......@@ -81,3 +81,9 @@ $string['footerhidehomelinksetting'] = 'Hide link to the webpage start';
$string['courselayoutheadingsetting'] = 'Course layout';
$string['footerlayoutheadingsetting'] = 'Footer layout';
$string['blockdesignheadingsetting'] = 'Blocks';
$string['blockiconsetting'] = 'Block icon';
$string['blockiconsetting_desc'] = 'With this setting you can add a default Font Awesome icon in front of the block title. If checked, we additionally provide individual icon replacements for many Moodle core blocks and also some widely used blocks. You also can change the icons easily for each block individually in your raw SCSS via the change of the Font Awesome content. For all available icons please visit http://fontawesome.io/icons/ and use the Unicode value of the icon to replace the default one. <br/> The code to change the icon looks like this example change for the block "People": <br/>';
$string['blockiconsetting_desc_code'] = '.block_people .card-block .card-title::before { content: \'\f0c0\' ; }';
......@@ -81,6 +81,7 @@ function theme_boost_campus_get_pre_scss($theme) {
'footerhidehelplink' => ['footerhidehelplink'],
'footerhidelogininfo' => ['footerhidelogininfo'],
'footerhidehomelink' => ['footerhidehomelink'],
'blockicon' => ['blockicon'],
/* MODIFICATION END */
];
......
......@@ -298,6 +298,81 @@ body.path-course-view #section-0 h3.accesshide {
}
/*------------------------------------
Blocks
-------------------------------------*/
@if variable-exists(blockicon){
@if $blockicon == 'yes'{
/* If setting blockicon is checked, add a default Font Awesome icon
* before the block title. */
.block .card-block .card-title::before {
font-family: FontAwesome;
content: '\f009';
font-size: 1.3rem;
padding-right: 7px;
color: $gray-dark;
}
/* Provide different, suitable Font Awesome icons for different Moodle blocks. */
.block_recent_activity .card-block .card-title::before {
content: '\f017';
}
.block_calendar_month .card-block .card-title::before,
.block_calendar_upcoming .card-block .card-title::before {
content: '\f133';
}
.block_people .card-block .card-title::before {
content: '\f0c0';
}
.block_quickmail .card-block .card-title::before {
content: '\f003';
}
.block_activity_module .card-block .card-title::before {
content: '\f12e';
}
.block_news_items .card-block .card-title::before {
content: '\f0a1';
}
.block_progress .card-block .card-title::before {
content: '\f0ae';
}
.block_private_files .card-block .card-title::before {
content: '\f114';
}
.block_comments .card-block .card-title::before {
content: '\f075';
}
.block_completion_status .card-block .card-title::before {
content: '\f0e4';
}
.block_search_forums .card-block .card-title::before {
content: '\f0e6';
}
.block_admin_bookmarks .card-block .card-title::before {
content: '\f097';
}
.block_adminblock .card-block .card-title::before {
content: '\f0fe';
}
.block_attendance .card-block .card-title::before {
content: '\f046';
}
.block_sharing_cart .card-block .card-title::before {
content: '\f07a';
}
.block_glossary_random .card-block .card-title::before {
content: '\f14b';
}
.block_selfcompletion .card-block .card-title::before {
content: '\f14a';
}
.block_badges .card-block .card-title::before {
content: '\f0a3';
}
}
}
/*------------------------------------
Page Footer
-------------------------------------*/
......
......@@ -240,6 +240,20 @@ if ($ADMIN->fulltree) {
$setting = new admin_setting_configstoredfile($name, $title, $description, 'fontfiles', 0,
array('maxfiles' => 100, 'accepted_types' => array('.ttf', '.eot', '.woff', '.woff2')));
$setting->set_updatedcallback('theme_reset_all_caches');
// Settings title to group block related settings together with a common heading. We don't want a description here.
$setting = new admin_setting_heading('theme_boost_campus/blockdesignheading',
get_string('blockdesignheadingsetting', 'theme_boost_campus', null, true), null);
$page->add($setting);
// Setting for displaying a standard Font Awesome icon in front of the block title
$setting = new admin_setting_configcheckbox('theme_boost_campus/blockicon',
get_string('blockiconsetting', 'theme_boost_campus', null, true),
get_string('blockiconsetting_desc', 'theme_boost_campus', null, true) .
get_string('blockiconsetting_desc_code', 'theme_boost_campus', null, true),'no', 'yes', 'no'); // Overriding default values
// yes = 1 and no = 0 because of the use of empty() in theme_boost_campus_get_pre_scss() (lib.php). Default 0 value would
// not write the variable to scss that could cause the scss to crash if used in that file.
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
// Add tab to settings page.
......
......@@ -25,7 +25,7 @@
defined('MOODLE_INTERNAL') || die();
$plugin->component = 'theme_boost_campus';
$plugin->version = '2017032900';
$plugin->version = '2017033000';
$plugin->release = 'v3.2-r1';
$plugin->requires = '2016070700';
$plugin->maturity = MATURITY_STABLE;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment