33 public function _showSimpleMessage($content, $type, $title =
null, $icon =
"info", $timeout = NULL, $staticName =
null, $closeAction =
null, $toast =
false): HtmlMessage {
34 $semantic = $this->jquery->semantic ();
35 if (! isset ( $staticName ))
36 $staticName =
"msg-" . rand ( 0, 50 );
37 if(isset($this->style)){
38 $type.=
' '.$this->style;
40 $message = $semantic->htmlMessage ( $staticName, $content, $type );
41 if (isset ( $title )) {
42 $message->addHeader ( $title );
44 if (isset ( $icon )) {
45 $message->setIcon ( $icon );
47 if ($timeout !==
'') {
48 $message->setDismissable ();
50 if ($timeout !=
null) {
51 $message->setTimeout ( 3000 );
52 } elseif (isset ( $closeAction )) {
53 $message->getOnClose ( $this->_getFiles ()->getAdminBaseRoute () .
"/_closeMessage/" . $closeAction );
56 $message->asToast ($toast);
62 return $this->_showConfMessage ( $message->getMessage (), $message->getType (), $message->getTitle (), $message->getIcon (), $url, $responseElement, $data, $attributes );
65 protected function _showConfMessage($content, $type, $title, $icon, $url, $responseElement, $data, $attributes = NULL): HtmlMessage {
66 $messageDlg = $this->_showSimpleMessage ( $content, $type, $title, $icon );
67 $btOkay =
new HtmlButton (
"bt-okay",
"Confirm",
"negative" );
68 $btOkay->addIcon (
"check circle" );
69 $btOkay->postOnClick ( $url,
"{data:'" . $data .
"'}", $responseElement, $attributes );
70 $btCancel =
new HtmlButton (
"bt-cancel-" . UString::cleanAttribute ( $url ),
"Cancel" );
71 $btCancel->addIcon (
"remove circle outline" );
72 $btCancel->onClick ( $messageDlg->jsHide () );
73 $messageDlg->addContent ( [
new HtmlDivider (
"" ),
new HtmlSemDoubleElement (
"",
"div",
"", [ $btOkay->floatRight (),$btCancel->floatRight () ] ) ] );
74 $this->_getModelViewer ()->onConfirmButtons ( $btOkay, $btCancel );