public function masterPluginsAction($workspaceName = 'live', array $dimensions = array())
{
$this->response->setHeader('Content-Type', 'application/json');
$contentContext = $this->createContentContext($workspaceName, $dimensions);
$pluginNodes = $this->pluginService->getPluginNodesWithViewDefinitions($contentContext);
$masterPlugins = array();
if (is_array($pluginNodes)) {
/** @var $pluginNode NodeInterface */
foreach ($pluginNodes as $pluginNode) {
if ($pluginNode->isRemoved()) {
continue;
}
$q = new FlowQuery(array($pluginNode));
$page = $q->closest('[instanceof Neos.Neos:Document]')->get(0);
if ($page === null) {
continue;
}
$translationHelper = new TranslationHelper();
$masterPlugins[$pluginNode->getIdentifier()] = $translationHelper->translate('masterPlugins.nodeTypeOnPageLabel', null, ['nodeTypeName' => $translationHelper->translate($pluginNode->getNodeType()->getLabel()), 'pageLabel' => $page->getLabel()], 'Main', 'Neos.Neos');
}
}
return json_encode((object) $masterPlugins);
}