PluginProbe
Depicter — Popup & Slider Builder / 1.3.3
Depicter — Popup & Slider Builder v1.3.3
4.8.1 trunk 1.0.0 1.1.0 1.1.2 1.1.4 1.1.6 1.1.7 1.1.8 1.1.9 1.2.0 1.3.0 1.3.1 1.3.2 1.3.3 1.3.5 1.3.8 1.5.0 1.5.1 1.5.2 1.5.5 1.6.0 1.6.1 1.6.2 1.7.0 All 76 releases
depicter / app / src / Front / Symbols.php

Symbols.php in Depicter — Popup & Slider Builder 1.3.3, at app/src/Front/Symbols.php

44 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Depicter\Front;
3
4
5 use Depicter\Html\Html;
6
7 class Symbols
8 {
9
10 private $symbols = [];
11
12 /**
13 * Add symbol id to symbols list
14 *
15 * @param string $symbolID
16 * @return void
17 */
18 public function add( $symbolID ) {
19 if ( !in_array( $symbolID, $this->symbols ) ) {
20 $this->symbols[] = $symbolID;
21 }
22 }
23
24 /**
25 * Render registered svg symbols
26 *
27 * @return string|\TypeRocket\Html\Html
28 */
29 public function render() {
30 if ( !empty( $this->symbols ) ) {
31 $symbolsContent = '';
32 foreach ( $this->symbols as $key => $symbolID ) {
33 if ( file_exists( DEPICTER_PLUGIN_PATH .'/resources/scripts/svg-symbols/' . $symbolID . '.svg' ) ) {
34 $symbolsContent .= file_get_contents( DEPICTER_PLUGIN_PATH .'/resources/scripts/svg-symbols/' . $symbolID . '.svg' );
35 }
36 }
37
38 return Html::el('svg', [ 'xmlns' => "http://www.w3.org/2000/svg" ], $symbolsContent );
39 }
40
41 return '';
42 }
43 }
44