Move into nested docroot
This commit is contained in:
parent
83a0d3a149
commit
c8b70abde9
13405 changed files with 0 additions and 0 deletions
39
web/core/modules/toolbar/src/Ajax/SetSubtreesCommand.php
Normal file
39
web/core/modules/toolbar/src/Ajax/SetSubtreesCommand.php
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
<?php
|
||||
|
||||
namespace Drupal\toolbar\Ajax;
|
||||
|
||||
use Drupal\Core\Ajax\CommandInterface;
|
||||
|
||||
/**
|
||||
* Defines an AJAX command that sets the toolbar subtrees.
|
||||
*/
|
||||
class SetSubtreesCommand implements CommandInterface {
|
||||
|
||||
/**
|
||||
* The toolbar subtrees.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $subtrees;
|
||||
|
||||
/**
|
||||
* Constructs a SetSubtreesCommand object.
|
||||
*
|
||||
* @param array $subtrees
|
||||
* The toolbar subtrees that will be set.
|
||||
*/
|
||||
public function __construct($subtrees) {
|
||||
$this->subtrees = $subtrees;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function render() {
|
||||
return [
|
||||
'command' => 'setToolbarSubtrees',
|
||||
'subtrees' => array_map('strval', $this->subtrees),
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
Reference in a new issue