1 | <?php |
||
24 | abstract class AbstractPluginTwigExtension extends AbstractBootstrapTwigExtension { |
||
25 | |||
26 | /** |
||
27 | * Constructor. |
||
28 | */ |
||
29 | protected function __construct() { |
||
32 | |||
33 | /** |
||
34 | * Displays a Font Awesome icon. |
||
35 | * |
||
36 | * @param string $style The Font Awesome style. |
||
37 | * @param string $name The Font Awesome name. |
||
38 | * @param string $size The Font Awesome size. |
||
39 | * @param boolean $fixedWidth Fixed width ? |
||
40 | * @param boolean $bordered Bordered ? |
||
41 | * @param string $pull The Font Awesome pull. |
||
42 | * @param string $anime The Font Awesome animation. |
||
43 | * @return string Returns the Font Awesome icon. |
||
44 | */ |
||
45 | protected function fontAwesomeIcon($style, $name, $size, $fixedWidth, $bordered, $pull, $anime) { |
||
46 | |||
47 | // Initialize the values. |
||
48 | $styles = ["", "s", "r", "l", "b"]; |
||
49 | $sizes = ["xs", "sm", "lg", "2x", "3x", "4x", "5x", "6x", "7x", "8x", "9x", "10x"]; |
||
50 | $pulls = ["left", "right"]; |
||
51 | $animates = ["spin", "pulse"]; |
||
52 | |||
53 | // Initialize the template. |
||
54 | $template = "<i %attributes%></i>"; |
||
55 | |||
56 | // Initialize the attributes. |
||
57 | $attributes = []; |
||
58 | |||
59 | $attributes["class"][] = true === in_array($style, $styles) ? "fa" . $style : "fa"; |
||
60 | $attributes["class"][] = null !== $name ? "fa-" . $name : null; |
||
61 | $attributes["class"][] = true === in_array($size, $sizes) ? "fa-" . $size : null; |
||
62 | $attributes["class"][] = true === $fixedWidth ? "fa-fw" : null; |
||
63 | $attributes["class"][] = true === $bordered ? "fa-border" : null; |
||
64 | $attributes["class"][] = true === in_array($pull, $pulls) ? "fa-pull-" . $pull : null; |
||
65 | $attributes["class"][] = true === in_array($anime, $animates) ? "fa-" . $anime : null; |
||
66 | |||
67 | // Return the HTML. |
||
68 | return StringUtility::replace($template, ["%attributes%"], [StringUtility::parseArray($attributes)]); |
||
69 | } |
||
70 | |||
71 | /** |
||
72 | * Displays a jQuery input mask. |
||
73 | * |
||
74 | * @param string $selector The input mask selector. |
||
75 | * @param string $mask The input mask. |
||
76 | * @param boolean $scriptTag Script tag ? |
||
77 | * @param array $options The input mask options. |
||
78 | * @return string Returns the jQuery input mask. |
||
79 | */ |
||
80 | protected function jQueryInputMask($selector, $mask, $scriptTag, array $options) { |
||
92 | |||
93 | /** |
||
94 | * Displays a Material Design Iconic Font icon. |
||
95 | * |
||
96 | * @param string $name The Material Design Iconic Font name. |
||
97 | * @param string $size The Material Design Iconic Font size. |
||
98 | * @param boolean $fixedWidth Fixed width ? |
||
99 | * @param string $border The Material Design Iconic Font border |
||
100 | * @param string $pull The Material Design Iconic Font pull. |
||
101 | * @param string $spin The Material Design Iconic Font spin. |
||
102 | * @param string $rotate The Material Design Iconic Font rotate. |
||
103 | * @param string $flip The Material Design Iconic Font flip. |
||
104 | * @return string Returns the Material Design Iconic Font icon. |
||
105 | */ |
||
106 | protected function materialDesignIconicFontIcon($name, $size, $fixedWidth, $border, $pull, $spin, $rotate, $flip) { |
||
135 | |||
136 | } |
||
137 |