File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1111if (!isset ($ options ['info_contents ' ])) {
1212 $ options ['info_contents ' ] = '<p>★ <a href="https://aplus-framework.com" target="_blank">aplus-framework.com</a></p> ' ;
1313}
14- $ iconPath = __DIR__ . '/icon.png ' ;
14+ $ iconPath = __DIR__ . '/icon.svg ' ;
1515if (isset ($ options ['icon_path ' ])) {
1616 $ iconPath = $ options ['icon_path ' ];
1717}
@@ -130,7 +130,12 @@ class_exists('Aplus')
130130 </div>
131131 <div class="toolbar">
132132 <div class="icon">
133- <img src="data:image/png;base64,<?= base64_encode ((string ) file_get_contents ($ iconPath )) ?> " alt="A+" width="32" height="32">
133+ <?php $ contents = (string ) file_get_contents ($ iconPath ) ?>
134+ <?php if (str_ends_with ($ iconPath , '.svg ' )) : ?>
135+ <?= strtr ($ contents , ['<svg ' => '<svg width="32" height="32" ' ]) ?>
136+ <?php else : ?>
137+ <img src="data:image/png;base64,<?= base64_encode ($ contents ) ?> " alt="A+" width="32" height="32">
138+ <?php endif ?>
134139 </div>
135140 <div class="collections">
136141 <?php foreach ($ collections as $ collection ): ?>
Original file line number Diff line number Diff line change @@ -248,6 +248,14 @@ public function testIconPathOption() : void
248248 );
249249 }
250250
251+ public function testDefaultIconPath () : void
252+ {
253+ self ::assertStringContainsString (
254+ '<svg width="32" height="32" ' ,
255+ $ this ->debugger ->renderDebugbar ()
256+ );
257+ }
258+
251259 protected function closeBuffer () : void
252260 {
253261 if (\ob_get_level ()) {
You can’t perform that action at this time.
0 commit comments