'index.php', 'name' => get_lang('PlatformAdmin')); $tpl = new Template(get_lang('ResourcesSequencing')); $sessionListFromDatabase = SessionManager::get_sessions_list(); $sessionList = []; if (!empty($sessionListFromDatabase)) { foreach ($sessionListFromDatabase as $sessionItem) { $sessionList[$sessionItem['id']] = $sessionItem['name'].' ('.$sessionItem['id'].')'; } } $formSequence = new FormValidator('sequence_form', 'post', api_get_self(), null, null, 'inline'); $formSequence->addText('name', get_lang('Sequence'), true, ['cols-size' => [3, 8, 1]]); $formSequence->addButtonCreate(get_lang('AddSequence'), 'submit_sequence', false, ['cols-size' => [3, 8, 1]]); $em = Database::getManager(); // Add sequence if ($formSequence->validate()) { $values = $formSequence->exportValues(); $sequence = new Sequence(); $sequence->setName($values['name']); $em->persist($sequence); $em->flush(); header('Location: '.api_get_self()); exit; } $selectSequence = new FormValidator(''); $selectSequence ->addHidden('sequence_type', 'session'); $em = Database::getManager(); $sequenceList = $em->getRepository('ChamiloCoreBundle:Sequence')->findAll(); $selectSequence->addSelect( 'sequence', get_lang('Sequence'), $sequenceList, ['id' => 'sequence_id', 'cols-size' => [3, 7, 2]] ); $form = new FormValidator(''); $form->addHtml("