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 mode, flat, parented or hierarchical.
  *
  * @param BasicDefinitionInterface $config The basic definition of the data definition.
  *
  * @return void
  */
 protected function parseBasicMode(BasicDefinitionInterface $config)
 {
     if ($config->getMode() !== null) {
         return;
     }
     switch ($this->getFromDca('list/sorting/mode')) {
         case 0:
             // Records are not sorted.
         // Records are not sorted.
         case 1:
             // Records are sorted by a fixed field.
         // Records are sorted by a fixed field.
         case 2:
             // Records are sorted by a switchable field.
         // Records are sorted by a switchable field.
         case 3:
             // Records are sorted by the parent table.
             $config->setMode(BasicDefinitionInterface::MODE_FLAT);
             break;
         case 4:
             // Displays the child records of a parent record (see style sheets module).
             $config->setMode(BasicDefinitionInterface::MODE_PARENTEDLIST);
             break;
         case 5:
             // Records are displayed as tree (see site structure).
         // Records are displayed as tree (see site structure).
         case 6:
             // Displays the child records within a tree structure (see articles module).
             $config->setMode(BasicDefinitionInterface::MODE_HIERARCHICAL);
             break;
         default:
     }
 }