|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/** |
|
4
|
|
|
* This file is part of the adminbsb-material-design-bundle package. |
|
5
|
|
|
* |
|
6
|
|
|
* (c) 2018 WEBEWEB |
|
7
|
|
|
* |
|
8
|
|
|
* For the full copyright and license information, please view the LICENSE |
|
9
|
|
|
* file that was distributed with this source code. |
|
10
|
|
|
*/ |
|
11
|
|
|
|
|
12
|
|
|
namespace WBW\Bundle\AdminBSBBundle\Twig\Extension\UI; |
|
13
|
|
|
|
|
14
|
|
|
use WBW\Bundle\AdminBSBBundle\Twig\Extension\AbstractAdminBSBTwigExtension; |
|
15
|
|
|
|
|
16
|
|
|
/** |
|
17
|
|
|
* Abstract preloader Twig extension. |
|
18
|
|
|
* |
|
19
|
|
|
* @author webeweb <https://github.com/webeweb/> |
|
20
|
|
|
* @package WBW\Bundle\AdminBSBBundle\Twig\Extension\UI |
|
21
|
|
|
* @abstract |
|
22
|
|
|
*/ |
|
23
|
|
|
abstract class AbstractPreloaderTwigExtension extends AbstractAdminBSBTwigExtension { |
|
24
|
|
|
|
|
25
|
|
|
/** |
|
26
|
|
|
* Constructor. |
|
27
|
|
|
*/ |
|
28
|
|
|
protected function __construct() { |
|
29
|
|
|
parent::__construct(); |
|
30
|
|
|
} |
|
31
|
|
|
|
|
32
|
|
|
/** |
|
33
|
|
|
* Displays an AdminBSB preloader. |
|
34
|
|
|
* |
|
35
|
|
|
* @param string $class The class. |
|
36
|
|
|
* @param string $size The size. |
|
37
|
|
|
* @return string Returns the AdminBSB preloader. |
|
38
|
|
|
*/ |
|
39
|
|
|
protected function adminBSBPreloader($class, $size) { |
|
40
|
|
|
|
|
41
|
|
|
// Initialize the values. |
|
42
|
|
|
$sizes = ["xs", "sm", "l", "xl"]; |
|
43
|
|
|
|
|
44
|
|
|
// Initialize the attributes. |
|
45
|
|
|
$attributes = []; |
|
46
|
|
|
|
|
47
|
|
|
$attributes["class"][] = "preloader"; |
|
48
|
|
|
$attributes["class"][] = true === in_array($size, $sizes) ? "pl-size-" . $size : null; |
|
49
|
|
|
|
|
50
|
|
|
// Initialize the parameters. |
|
51
|
|
|
$content = "<div class=\"circle-clipper left\"><div class=\"circle\"></div></div><div class=\"circle-clipper right\"><div class=\"circle\"></div></div>"; |
|
52
|
|
|
$innerHTML = self::bootstrapHTMLElement("div", $content, ["class" => ["spinner-layer", $class]]); |
|
|
|
|
|
|
53
|
|
|
|
|
54
|
|
|
// Return the HTML. |
|
55
|
|
|
return self::bootstrapHTMLElement("div", $innerHTML, $attributes); |
|
|
|
|
|
|
56
|
|
|
} |
|
57
|
|
|
|
|
58
|
|
|
} |
|
59
|
|
|
|
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.