jcb-compiler/src/480d11b9-783b-45d5-bce1-b0c.../code.power

44 lines
843 B
Plaintext

/**
* Constructor.
*
* @since 3.2.0
*/
public function __construct()
{
$this->setSeparator('|');
}
/**
* Get the build view content
*
* @return string
* @since 3.2.0
*/
public function build(): string
{
if ($this->isActive())
{
$bucket = [];
foreach ($this->active as $views_code_name => $actions)
{
$bucket[] = Indent::_(1) . '<section name="' . $views_code_name . '">';
foreach ($actions as $action)
{
$bucket[] = Indent::_(2) . '<action name="'
. $action['name'] . '" title="'
. $action['title'] . '" description="'
. $action['description'] . '" />';
}
$bucket[] = Indent::_(1) . "</section>";
}
// reset memory
$this->active = [];
return PHP_EOL . implode(PHP_EOL, $bucket);
}
return '';
}