/**
  * Parse the listing configuration.
  *
  * @param Contao2BackendViewDefinitionInterface $view The backend view definition.
  *
  * @return void
  */
 protected function parseListing(Contao2BackendViewDefinitionInterface $view)
 {
     $listing = $view->getListingConfig();
     $this->parseListLabel($listing);
 }
 /**
  * Parse the defined model scoped operations and populate the definition.
  *
  * @param Contao2BackendViewDefinitionInterface $view The backend view configuration definition to populate.
  *
  * @return void
  */
 protected function parseModelOperations(Contao2BackendViewDefinitionInterface $view)
 {
     $operationsDca = $this->getFromDca('list/operations');
     if (!is_array($operationsDca)) {
         return;
     }
     $collection = $view->getModelCommands();
     foreach ($operationsDca as $operationName => $operationDca) {
         $command = $this->createCommand($operationName, $operationDca);
         $collection->addCommand($command);
     }
 }
Example #3
0
 /**
  * Add the select command to the backend view definition.
  *
  * @param Contao2BackendViewDefinitionInterface $view      The backend view definition.
  * @param IMetaModelDataDefinition              $container The metamodel data definition.
  *
  * @return void
  *
  * @SuppressWarnings(PHPMD.Superglobals)
  * @SuppressWarnings(PHPMD.CamelCaseVariableName)
  */
 protected function addSelectCommand(Contao2BackendViewDefinitionInterface $view, $container)
 {
     /** @var BasicDefinitionInterface $definition */
     $definition = $container->getBasicDefinition();
     // No ations allowed. Don't add the select command button.
     if (!$definition->isEditable() && !$definition->isDeletable() && !$definition->isCreatable()) {
         return;
     }
     $commands = $view->getGlobalCommands();
     $command = new SelectCommand();
     // FIXME: Use the translator to translate the labels.
     $command->setName('all')->setLabel($GLOBALS['TL_LANG']['MSC']['all'][0])->setDescription($GLOBALS['TL_LANG']['MSC']['all'][1]);
     $parameters = $command->getParameters();
     $parameters['act'] = 'select';
     $extra = $command->getExtra();
     $extra['class'] = 'header_edit_all';
     $commands->addCommand($command);
 }