Esempio n. 1
0
 /**
  * Check if paste into or after parameter is present, if not, perform showAll in tree mode.
  *
  * This is needed, as the destination is otherwise undefined.
  *
  * @param BasicDefinitionInterface $definition The current definition.
  * @param InputProviderInterface   $input      The input provider.
  *
  * @return bool
  */
 private function needTreeModeShowAll(BasicDefinitionInterface $definition, InputProviderInterface $input)
 {
     if (BasicDefinitionInterface::MODE_HIERARCHICAL !== $definition->getMode()) {
         return false;
     }
     // If destination is not known, perform showAll.
     if ($input->hasParameter('after') || $input->hasParameter('into')) {
         return false;
     }
     return true;
 }
 /**
  * Parse the basic flags.
  *
  * @param BasicDefinitionInterface $config The basic definition of the data definition.
  *
  * @return void
  */
 protected function parseBasicFlags(BasicDefinitionInterface $config)
 {
     if (($switchToEdit = $this->getFromDca('config/switchToEdit')) !== null) {
         $config->setSwitchToEditEnabled((bool) $switchToEdit);
     }
     if (($value = $this->getFromDca('config/forceEdit')) !== null) {
         $config->setEditOnlyMode((bool) $value);
     }
     if (($value = $this->getFromDca('config/closed')) !== null) {
         $config->setEditable(!$value)->setCreatable(!$value);
     }
     if (($value = $this->getFromDca('config/notEditable')) !== null) {
         $config->setEditable(!$value);
     }
     if (($value = $this->getFromDca('config/notDeletable')) !== null) {
         $config->setDeletable(!$value);
     }
     if (($value = $this->getFromDca('config/notCreatable')) !== null) {
         $config->setCreatable(!(bool) $value);
     }
 }