1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* DialogLibraryInterface.php - Adapter for the Tingle library. |
5
|
|
|
* |
6
|
|
|
* @package jaxon-dialogs |
7
|
|
|
* @author Thierry Feuzeu <[email protected]> |
8
|
|
|
* @copyright 2016 Thierry Feuzeu <[email protected]> |
9
|
|
|
* @license https://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License |
10
|
|
|
* @link https://github.com/jaxon-php/jaxon-dialogs |
11
|
|
|
*/ |
12
|
|
|
|
13
|
|
|
namespace Jaxon\Dialogs\Library\Tingle; |
14
|
|
|
|
15
|
|
|
use Jaxon\Ui\Dialog\Library\AbstractDialogLibrary; |
|
|
|
|
16
|
|
|
use Jaxon\Ui\Dialog\ModalInterface; |
|
|
|
|
17
|
|
|
|
18
|
|
|
class TingleLibrary extends AbstractDialogLibrary implements ModalInterface |
19
|
|
|
{ |
20
|
|
|
/** |
21
|
|
|
* @const The library name |
22
|
|
|
*/ |
23
|
|
|
const NAME = 'tingle'; |
24
|
|
|
|
25
|
|
|
/** |
26
|
|
|
* @inheritDoc |
27
|
|
|
*/ |
28
|
|
|
public function getName(): string |
29
|
|
|
{ |
30
|
|
|
return self::NAME; |
31
|
|
|
} |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* @inheritDoc |
35
|
|
|
*/ |
36
|
|
|
public function getSubdir(): string |
37
|
|
|
{ |
38
|
|
|
return 'tingle'; |
39
|
|
|
} |
40
|
|
|
|
41
|
|
|
/** |
42
|
|
|
* @inheritDoc |
43
|
|
|
*/ |
44
|
|
|
public function getVersion(): string |
45
|
|
|
{ |
46
|
|
|
return '0.8.4'; |
47
|
|
|
} |
48
|
|
|
|
49
|
|
|
/** |
50
|
|
|
* @inheritDoc |
51
|
|
|
*/ |
52
|
|
|
public function getJs(): string |
53
|
|
|
{ |
54
|
|
|
return $this->xHelper->getJsCode('tingle.min.js'); |
55
|
|
|
} |
56
|
|
|
|
57
|
|
|
/** |
58
|
|
|
* @inheritDoc |
59
|
|
|
*/ |
60
|
|
|
public function getCss(): string |
61
|
|
|
{ |
62
|
|
|
return $this->xHelper->getCssCode('tingle.min.css'); |
63
|
|
|
} |
64
|
|
|
|
65
|
|
|
/** |
66
|
|
|
* @inheritDoc |
67
|
|
|
*/ |
68
|
|
|
public function getScript(): string |
69
|
|
|
{ |
70
|
|
|
return $this->xHelper->render('tingle/alert.js'); |
71
|
|
|
} |
72
|
|
|
|
73
|
|
|
/** |
74
|
|
|
* @inheritDoc |
75
|
|
|
*/ |
76
|
|
|
public function getReadyScript(): string |
77
|
|
|
{ |
78
|
|
|
return $this->xHelper->render('tingle/ready.js'); |
79
|
|
|
} |
80
|
|
|
|
81
|
|
|
/** |
82
|
|
|
* @inheritDoc |
83
|
|
|
*/ |
84
|
|
|
public function show(string $sTitle, string $sContent, array $aButtons, array $aOptions = []) |
85
|
|
|
{ |
86
|
|
|
// Show the footer only if there is a button to display. |
87
|
|
|
$aOptions['footer'] = (count($aButtons) > 0); |
88
|
|
|
// Show the modal dialog |
89
|
|
|
$this->addCommand(['cmd' => 'tingle.show'], |
90
|
|
|
['content' => '<h2>' . $sTitle . '</h2>' . $sContent, 'buttons' => $aButtons, 'options' => $aOptions]); |
91
|
|
|
} |
92
|
|
|
|
93
|
|
|
/** |
94
|
|
|
* @inheritDoc |
95
|
|
|
*/ |
96
|
|
|
public function hide() |
97
|
|
|
{ |
98
|
|
|
// Hide the modal dialog |
99
|
|
|
$this->addCommand(['cmd' => 'tingle.hide'], []); |
100
|
|
|
} |
101
|
|
|
} |
102
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths