28 public function __construct ($origin,
string $type,
string $output =
'',
int $code = 0, Throwable $previous = NULL)
30 $this->hookType = $type;
32 parent::__construct($origin, nl2br(
'<samp>'.
htmlescape($output).
'</samp>'), $code, $previous);
35 public function toArray (): array
37 $array = parent::toArray();
39 $array[
'hookType'] = $this->hookType;
40 $array[
'hookCode'] = $this->getCode();
45 public function computeMsgDialogParameters (): array
49 if (isset($this->object->dn)) {
53 if (isset($this->tab) && isset($this->tab->parent->by_name[get_class($this->tab)])) {
54 $html .=
htmlescape($this->tab->parent->by_name[get_class($this->tab)].
' > ');
57 if (isset($this->attribute)) {
58 $label = $this->attribute->getLabel();
60 $html .=
'<i>'.htmlescape($this->attribute->getLdapName()).
'</i>';
68 $html .=
'<br/><br/>'.
"\n";
70 $html .=
htmlescape(_(
'Trigger returned an error!'));
72 $html .=
'<br/><br/>'.
"\n";
73 $html .=
htmlescape(sprintf(_(
'Exit code: %d'), $this->getCode())).
'<br/>'.
"\n";
74 if (!empty($this->htmlMessage)) {
75 $html .=
'Result: '.$this->htmlMessage.
"\n";
78 return [_(
'Error'), $html, ERROR_DIALOG, FusionDirectoryError::formatTrace($this)];
htmlescape(string $str)
Escape string for HTML output.
Error returned by any method of SimplePlugin.
Error returned by a hook called from SimplePlugin.