Skip to content

Commit

Permalink
Merge pull request #8 from kialo/PM-45856-fix-kialo-icon-colors
Browse files Browse the repository at this point in the history
PM-45856 prevent kialo icon colors from being altered
  • Loading branch information
mk-kialo authored Jul 11, 2024
2 parents 0b83ee7 + e650bb3 commit 7b0f3d2
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
### v1.1.1 (Build - 2024071001)

* Always render Kialo icon on neutral background
* Prevent Kialo icon colors from being altered

### v1.1.0 (Build - 2024053101)

* Moodle 4.4 compatibility
Expand Down
12 changes: 7 additions & 5 deletions lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@
* @return true | string | null Truthy if the feature is supported, null otherwise.
*/
function kialo_supports($feature) {
if (defined("FEATURE_MOD_PURPOSE") && $feature === FEATURE_MOD_PURPOSE) {
// Moodle 4.0 and newer.
return MOD_PURPOSE_COLLABORATION;
}

switch ($feature) {
case FEATURE_BACKUP_MOODLE2:
return true;
Expand All @@ -46,6 +41,13 @@ function kialo_supports($feature) {
}
}

/**
* Prevent the Kialo icon from having its colors modified on Moodle >= 4.4.
*/
function kialo_is_branded(): bool {
return true;
}

/**
* Saves a new instance of the mod_kialo into the database.
*
Expand Down
2 changes: 1 addition & 1 deletion tests/lib_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function test_kialo_supports(): void {

// Moodle 4.0 and newer.
if (defined("FEATURE_MOD_PURPOSE")) {
$this->assertEquals(MOD_PURPOSE_COLLABORATION, kialo_supports(FEATURE_MOD_PURPOSE));
$this->assertNull(kialo_supports(FEATURE_MOD_PURPOSE));
}
}

Expand Down
4 changes: 2 additions & 2 deletions version.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
$plugin->component = 'mod_kialo';

// See https://moodledev.io/docs/apis/commonfiles/version.php.
$plugin->version = 2024053101; // Must be incremented for each new release!
$plugin->release = '1.1.0'; // Semantic version.
$plugin->version = 2024071001; // Must be incremented for each new release!
$plugin->release = '1.1.1'; // Semantic version.

// Officially we require PHP 7.4. The first Moodle version that requires this as a minimum is Moodle 4.1.
// But technically this plugin also runs on older Moodle versions, as long as they run on PHP 7.4,
Expand Down

0 comments on commit 7b0f3d2

Please sign in to comment.