width = $width;
// Height.
$this->height = $height;
// Grid Width.
$this->gridWidth = $gridWidth;
// Options.
$this->values = $this->decoders($this->getOptionsWidget());
// Positions.
$this->position = $this->getPositionWidget();
// Page.
$this->page = basename(__FILE__);
// ClassName.
$class = new \ReflectionClass($this);
$this->className = $class->getShortName();
// Title.
$this->title = __('Welcome message to %s', get_product_name());
// Name.
if (empty($this->name) === true) {
$this->name = 'example';
}
$this->configurationRequired = false;
$this->overflow_scrollbars = false;
}
/**
* Decoders hack for retrocompability.
*
* @param array $decoder Values.
*
* @return array Returns the values with the correct key.
*/
public function decoders(array $decoder): array
{
$values = [];
// Retrieve global - common inputs.
$values = parent::decoders($decoder);
return $values;
}
/**
* Generates inputs for form (specific).
*
* @return array Of inputs.
*
* @throws Exception On error.
*/
public function getFormInputs(): array
{
$values = $this->values;
// Retrieve global - common inputs.
$inputs = parent::getFormInputs();
return $inputs;
}
/**
* Get Post for widget.
*
* @return array
*/
public function getPost():array
{
// Retrieve global - common inputs.
$values = parent::getPost();
$values['agentId'] = \get_parameter('agentId', 0);
return $values;
}
/**
* Draw widget.
*
* @return string;
*/
public function load()
{
$output = '';
$size = parent::getSize();
if (isset($this->values['message']) === true) {
$output .= \io_safe_output(
str_replace('
', '
', $this->values['message'])
);
return $output;
}
$style = 'height:'.$size['height'].'px; width:'.$size['width'].'px;';
$style .= 'text-align: left;';
$output .= '