示例#1
0
"><i class="fa fa-trash-o"></i></a></li>
                </ul>

                <div><?php 
        echo $set->getTitle() ? $set->getTitle() : t('(No Title)');
        ?>
</div>

            </div>

            <table class="table table-hover" style="width: 100%;">
                <tbody>

                <?php 
        foreach ($set->getControls() as $control) {
            $element = new \Concrete\Controller\Element\Dashboard\Express\Control($control);
            echo $element->render();
        }
        ?>

                </tbody>
            </table>

        </div>

    <?php 
    }
    ?>

<?php 
} else {
示例#2
0
 public function add_control($id = null)
 {
     $set = $this->fieldSetRepository->findOneById($id);
     $manager = \Core::make('express/control/type/manager');
     if ($this->request->isMethod("POST")) {
         if ($this->token->validate('add_control')) {
             $current = count($set->getControls());
             $position = 0;
             if ($current > 0) {
                 $position = $current;
             }
             $type = $manager->driver($this->request->request->get('type'));
             $control = $type->createControlByIdentifier($this->request->request->get('id'));
             $control->setId((new UuidGenerator())->generate($this->entityManager, $control));
             $control->setFieldSet($set);
             $control->setPosition($position);
             $this->entityManager->persist($control);
             $this->entityManager->flush();
             $element = new \Concrete\Controller\Element\Dashboard\Express\Control($control);
             echo $element->render();
             exit;
         }
     } else {
         $drivers = $manager->getDrivers();
         $tabs = array();
         foreach ($drivers as $type => $driver) {
             $active = false;
             if ($type == 'entity_property') {
                 $active = true;
             }
             $tabs[] = array($type, $driver->getPluralDisplayName(), $active);
         }
         $this->set('drivers', $drivers);
         $this->set('set', $set);
         $this->set('tabs', $tabs);
         $this->set('interface', \Core::make('helper/concrete/ui'));
         $this->setThemeViewTemplate('dialog.php');
         $this->render('/dashboard/system/express/entities/forms/add_control');
     }
 }