Skip to content

Commit

Permalink
Ability to provide custom core icon
Browse files Browse the repository at this point in the history
  • Loading branch information
Massi-X committed May 5, 2024
1 parent 8d9e047 commit 69a530c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions build
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,18 @@ else { //add the config array
arrayLoopAdd($depends_to_add); //add all the values declared before
echo colorLog("Dependencies set.\n", 'b'); //no need to skip this if no dependency is set (it will never happen because version is always there)

//icon
echo colorLog("Searching for core custom icon...\n", 'b');

//if icon exists, copy it into the assets folder
if (file_exists("$tmpFolder/$rawname/core/assets/images/icon.png")) {
if (!copy("$tmpFolder/$rawname/core/assets/images/icon.png", "$tmpFolder/$rawname/assets/images/icon_core.png"))
echo colorLog("Unable to copy core icon!\n", 'e');
else
echo colorLog("Using the provided core icon\n", 'b');
} else
echo colorLog("'core/assets/images/icon.png' not found\n", 'b');

//remove module.xml from output (if present)...
if (file_exists("$tmpFolder/$rawname/module.xml") && !unlink("$tmpFolder/$rawname/module.xml"))
die_i("Unable to delete module.xml!\n");
Expand Down
2 changes: 1 addition & 1 deletion page.carddavmiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

<div class="ph-header">
<div class="title">
<img class="header-img" src="assets/phonemiddleware/images/icon.png"> <!-- as in cdr module there is no way to not hardcode this path -->
<img class="header-img" src="assets/phonemiddleware/images/<?= file_exists('assets/phonemiddleware/images/icon_core.png') ? 'icon_core.png' : 'icon.png' ?>"> <!-- load custom core icon if present - as in cdr module there is no way to not hardcode this path -->
<h2>
<?php
echo str_replace(
Expand Down

0 comments on commit 69a530c

Please sign in to comment.