MetaModels\DcGeneral\Dca\Builder\Builder::parseModelOperations PHP Метод

parseModelOperations() защищенный Метод

Parse the defined model scoped operations and populate the definition.
protected parseModelOperations ( ContaoCommunityAlliance\DcGeneral\Contao\DataDefinition\Definition\Contao2BackendViewDefinitionInterface $view, MetaModels\DcGeneral\DataDefinition\IMetaModelDataDefinition $container ) : void
$view ContaoCommunityAlliance\DcGeneral\Contao\DataDefinition\Definition\Contao2BackendViewDefinitionInterface The backend view information.
$container MetaModels\DcGeneral\DataDefinition\IMetaModelDataDefinition The data container.
Результат void
    protected function parseModelOperations(Contao2BackendViewDefinitionInterface $view, IMetaModelDataDefinition $container)
    {
        $collection = $view->getModelCommands();
        $this->createCommand($collection, 'edit', array('act' => 'edit'), 'edit.gif', array())->createCommand($collection, 'copy', array('act' => ''), 'copy.gif', array('attributes' => 'onclick="Backend.getScrollOffset();"'))->createCommand($collection, 'cut', array('act' => 'paste', 'mode' => 'cut'), 'cut.gif', array('attributes' => 'onclick="Backend.getScrollOffset();"'))->createCommand($collection, 'delete', array('act' => 'delete'), 'delete.gif', array('attributes' => sprintf('onclick="if (!confirm(\'%s\')) return false; Backend.getScrollOffset();"', $GLOBALS['TL_LANG']['MSC']['deleteConfirm'])))->createCommand($collection, 'show', array('act' => 'show'), 'show.gif', array());
        if ($this->getMetaModel()->hasVariants()) {
            $this->createCommand($collection, 'createvariant', array('act' => 'createvariant'), 'system/modules/metamodels/assets/images/icons/variants.png', array());
        }
        // Check if we have some children.
        foreach ($this->getViewCombinations()->getParentedInputScreens($container->getName()) as $screen) {
            $metaModel = $screen->getMetaModel();
            $arrCaption = array('', sprintf($GLOBALS['TL_LANG']['MSC']['metamodel_edit_as_child']['label'], $metaModel->getName()));
            foreach ($screen->getBackendCaption() as $arrLangEntry) {
                if ($arrLangEntry['label'] != '' && $arrLangEntry['langcode'] == $GLOBALS['TL_LANGUAGE']) {
                    $arrCaption = array($arrLangEntry['description'], $arrLangEntry['label']);
                }
            }
            $this->createCommand($collection, 'edit_' . $metaModel->getTableName(), array('table' => $metaModel->getTableName()), self::getBackendIcon($screen->getIcon()), array('attributes' => 'onclick="Backend.getScrollOffset();"', 'label' => $arrCaption[0], 'description' => $arrCaption[1], 'idparam' => 'pid'));
        }
        $event = new BuildMetaModelOperationsEvent($this->getMetaModel(), $container, $this->getInputScreenDetails(), $this);
        $this->serviceContainer->getEventDispatcher()->dispatch($event::NAME, $event);
    }