Skip to content

Commit

Permalink
v5.21.10
Browse files Browse the repository at this point in the history
  • Loading branch information
Ross Parker committed Mar 5, 2023
1 parent 6fd4b7c commit 9547f23
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 6 deletions.
6 changes: 6 additions & 0 deletions Free Learning/CHANGEDB.php
Original file line number Diff line number Diff line change
Expand Up @@ -2178,3 +2178,9 @@
$sql[$count][1] = "
INSERT INTO `gibbonSetting` (`gibbonSettingID` ,`scope` ,`name` ,`nameDisplay` ,`description` ,`value`) VALUES (NULL , 'Free Learning', 'defaultBrowseView', 'Default View in Browse Units', 'Which view should the browse units page default to?', 'Map');end
INSERT INTO `gibbonSetting` (`gibbonSettingID` ,`scope` ,`name` ,`nameDisplay` ,`description` ,`value`) VALUES (NULL , 'Free Learning', 'defaultBrowseCourse', 'Default Course in Browse Units', 'If set, the Browse Units page will show a certain course by default.', '');end";

//v5.21.10
++$count;
$sql[$count][0] = '5.21.10';
$sql[$count][1] = "
INSERT INTO `gibbonSetting` (`gibbonSettingID` ,`scope` ,`name` ,`nameDisplay` ,`description` ,`value`) VALUES (NULL , 'Free Learning', 'collapsedSmartBlocks', 'Collapsed Smart Blocks', 'Should Smart Blocks be collapsed when viewing a unit?', 'N');end";
4 changes: 4 additions & 0 deletions Free Learning/CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
CHANGELOG
=========
v5.21.10
--------
Added setting for collapsed smart blocks (off by default)

v5.21.09
--------
Added settings to choose a default view and/or default course for Browse Units.
Expand Down
1 change: 1 addition & 0 deletions Free Learning/manifest.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@
$gibbonSetting[] = "INSERT INTO `gibbonSetting` (`gibbonSettingID` ,`scope` ,`name` ,`nameDisplay` ,`description` ,`value`) VALUES (NULL , 'Free Learning', 'bigDataSchool', 'Big Data School', 'Enables various defaults and filters for schools producing lots of data.', 'N');";
$gibbonSetting[] = "INSERT INTO `gibbonSetting` (`gibbonSettingID` ,`scope` ,`name` ,`nameDisplay` ,`description` ,`value`) VALUES (NULL , 'Free Learning', 'defaultBrowseView', 'Default View in Browse Units', 'Which view should the browse units page default to?', 'Map');";
$gibbonSetting[] = "INSERT INTO `gibbonSetting` (`gibbonSettingID` ,`scope` ,`name` ,`nameDisplay` ,`description` ,`value`) VALUES (NULL , 'Free Learning', 'defaultBrowseCourse', 'Default Course in Browse Units', 'If set, the Browse Units page will show a certain course by default.', '');";
$gibbonSetting[] = "INSERT INTO `gibbonSetting` (`gibbonSettingID` ,`scope` ,`name` ,`nameDisplay` ,`description` ,`value`) VALUES (NULL , 'Free Learning', 'collapsedSmartBlocks', 'Collapsed Smart Blocks', 'Should Smart Blocks be collapsed when viewing a unit?', 'N');";
$gibbonSetting[] = "INSERT INTO `gibbonNotificationEvent` (`event`, `moduleName`, `actionName`, `type`, `scopes`, `active`) VALUES ('Evidence Submitted', 'Free Learning', 'Browse Units_all', 'Additional', 'All', 'Y');";
$gibbonSetting[] = "INSERT INTO `gibbonNotificationEvent` (`event`, `moduleName`, `actionName`, `type`, `scopes`, `active`) VALUES ('Unit Comment', 'Free Learning', 'Browse Units_all', 'Additional', 'All', 'Y');";
$gibbonSetting[] = "INSERT INTO `gibbonNotificationEvent` (`event`, `moduleName`, `actionName`, `type`, `scopes`, `active`) VALUES ('Unit Feedback', 'Free Learning', 'Browse Units_all', 'Additional', 'All', 'Y');";
Expand Down
5 changes: 5 additions & 0 deletions Free Learning/settings_manage.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,11 @@
$row = $form->addRow();
$row->addLabel($setting['name'], __m($setting['nameDisplay']))->description(__m($setting['description']));
$row->addSelect($setting['name'])->fromArray($courses)->placeholder()->selected($setting['value']);

$setting = $settingGateway->getSettingByScope('Free Learning', 'collapsedSmartBlocks', true);
$row = $form->addRow();
$row->addLabel($setting['name'], __m($setting['nameDisplay']))->description(__m($setting['description']));
$row->addYesNo($setting['name'])->required()->selected($setting['value']);

$setting = $settingGateway->getSettingByScope('Free Learning', 'disableOutcomes', true);
$row = $form->addRow();
Expand Down
2 changes: 2 additions & 0 deletions Free Learning/settings_manageProcess.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
$certificatesAvailable = $_POST['certificatesAvailable'] ?? '';
$certificateTemplate = $_POST['certificateTemplate'] ?? '';
$certificateOrientation = $_POST['certificateOrientation'] ?? '';
$collapsedSmartBlocks = $_POST['collapsedSmartBlocks'] ?? '';
$disableOutcomes = $_POST['disableOutcomes'] ?? '';
$disableExemplarWork = $_POST['disableExemplarWork'] ?? '';
$disableParentEvidence = $_POST['disableParentEvidence'] ?? '';
Expand Down Expand Up @@ -92,6 +93,7 @@
$partialFail = !$settingGateway->updateSettingByScope('Free Learning', 'certificatesAvailable', $certificatesAvailable);
$partialFail = !$settingGateway->updateSettingByScope('Free Learning', 'certificateTemplate', $certificateTemplate);
$partialFail = !$settingGateway->updateSettingByScope('Free Learning', 'certificateOrientation', $certificateOrientation);
$partialFail = !$settingGateway->updateSettingByScope('Free Learning', 'collapsedSmartBlocks', $collapsedSmartBlocks);
$partialFail = !$settingGateway->updateSettingByScope('Free Learning', 'disableOutcomes', $disableOutcomes);
$partialFail = !$settingGateway->updateSettingByScope('Free Learning', 'disableExemplarWork', $disableExemplarWork);
$partialFail = !$settingGateway->updateSettingByScope('Free Learning', 'disableParentEvidence', $disableParentEvidence);
Expand Down
17 changes: 13 additions & 4 deletions Free Learning/templates/unitBlockCollapsed.twig.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,19 @@

<div class="unit-block relative rounded-sm shadow p-8 bg-white border-t-4 border-purple-500 mb-6">

<span id="showHide-{{ freeLearningUnitBlockID }}" class="z-10 tag block absolute right-0 top-0 mt-5 mr-5">
<img id="show-{{ freeLearningUnitBlockID }}" src="{{ absoluteURL }}/themes/{{ gibbonThemeName }}/img/plus.png"/>
<img id="hide-{{ freeLearningUnitBlockID }}" style='display: none' src="{{ absoluteURL }}/themes/{{ gibbonThemeName }}/img/minus.png"/>
</span>
<div class="z-10 block absolute right-0 top-0 mt-4 mr-5 align-right">
<div class="m-auto flex items-center">
{% if length %}
<span class="tag dull mr-3">
{{ length }} {{ __('mins') }}
</span>
{% endif %}
<span class="mt-1" id="showHide-{{ freeLearningUnitBlockID }}">
<img id="show-{{ freeLearningUnitBlockID }}" src="{{ absoluteURL }}/themes/{{ gibbonThemeName }}/img/plus.png"/>
<img id="hide-{{ freeLearningUnitBlockID }}" style='display: none' src="{{ absoluteURL }}/themes/{{ gibbonThemeName }}/img/minus.png"/>
</span>
</div>
</div>

<div class="-mt-3 font-sans text-lg leading-snug text-gray-800 font-bold">
{{ title }}
Expand Down
8 changes: 7 additions & 1 deletion Free Learning/units_browse_details.php
Original file line number Diff line number Diff line change
Expand Up @@ -602,9 +602,15 @@
$templateView = $container->get(View::class);
$resourceContents = '';

if ($settingGateway->getSettingByScope('Free Learning', 'collapsedSmartBlocks') == "Y") {
$template = "unitBlockCollapsed.twig.html";
} else {
$template = "unitBlock.twig.html";
}

$blockCount = 0;
foreach ($blocks as $block) {
echo $templateView->fetchFromTemplate('unitBlock.twig.html', $block + [
echo $templateView->fetchFromTemplate($template, $block + [
'roleCategory' => $roleCategory,
'gibbonPersonID' => $session->get('username') ?? '',
'blockCount' => $blockCount
Expand Down
2 changes: 1 addition & 1 deletion Free Learning/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@
/**
* Sets version information.
*/
$moduleVersion = '5.21.09';
$moduleVersion = '5.21.10';
$coreVersion = '24.0.00';

0 comments on commit 9547f23

Please sign in to comment.