MIOLO20
Carregando...
Procurando...
Nenhuma entrada encontrada
mnotification.class
Ir para a documentação deste ficheiro.
1
<?php
2
3
class
MPushNotification
4
{
25
private
$options;
26
27
public
function
__construct
(
$title
, $content =
''
, $icon =
''
, $otherOptions = array())
28
{
29
$MIOLO
=
MIOLO::getInstance
();
30
31
$this->options[
'title'
] =
$title
;
32
$this->options[
'body'
] = $content;
33
$this->options[
'icon'
] = strlen($icon) > 0 ? $icon :
$MIOLO
->getUI()->getImageTheme(
$MIOLO
->getTheme()->id,
'logo.png'
);
34
}
35
36
public
function
generate
()
37
{
38
$title
= $this->options[
'title'
];
39
unset($this->options[
'title'
]);
40
41
$options = array();
42
foreach
($this->options as $name => $value)
43
{
44
$options[] =
"$name: '{$value}'"
;
45
}
46
47
$optionsString = count($options) > 0 ?
'{'
. implode(
', '
, $options) .
'}'
:
''
;
48
$component =
"if (location.protocol == 'https:') Push.create(\"$title\", $optionsString);"
;
49
MIOLO::getInstance
()->page->addJsCode($component);
50
}
51
52
56
public
function
setRequireInteraction
($requireInteraction)
57
{
58
$this->options[
'requireInteraction'
] = $requireInteraction;
59
}
60
64
public
function
setTimeout
($timeout)
65
{
66
$this->options[
'timeout'
] = $timeout;
67
}
68
69
}
70
71
?>
MIOLO\getInstance
static getInstance()
Definição
miolo.class:134
MPushNotification
Definição
mnotification.class:4
MPushNotification\setTimeout
setTimeout($timeout)
Definição
mnotification.class:64
MPushNotification\setRequireInteraction
setRequireInteraction($requireInteraction)
Definição
mnotification.class:56
MPushNotification\generate
generate()
Definição
mnotification.class:36
MPushNotification\__construct
__construct($title, $content='', $icon='', $otherOptions=array())
Definição
mnotification.class:27
$MIOLO
$MIOLO
Definição
mdatetimefield.class:25
$title
$title
Definição
base.php:3
classes
ui
controls
mnotification.class
Gerado por
1.10.0