Ejemplo n.º 1
0
/* For licensing terms, see /license.txt */
/**
 *	@package chamilo.admin
 */
use Chamilo\CoreBundle\Framework\Container;
use Chamilo\CoreBundle\Entity\Course;
use Chamilo\CoreBundle\Form\CourseType;
$cidReset = true;
$this_section = SECTION_PLATFORM_ADMIN;
api_protect_admin_script();
$tool_name = get_lang('AddCourse');
$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
$interbreadcrumb[] = array('url' => 'course_list.php', 'name' => get_lang('CourseList'));
/* MAIN CODE */
global $_configuration;
$group = Container::getGroupManager()->findGroupByName('teachers');
$teachers = array();
$users = $group->getUsers();
/** @var Chamilo\UserBundle\Entity\User $user */
foreach ($users as $user) {
    $teachers[$user->getId()] = $user->getCompleteName();
}
// Build the form.
$form = new FormValidator('update_course');
$form->addElement('header', $tool_name);
// Title
$form->add_textfield('title', get_lang('Title'), true, array('class' => 'span6'));
$form->applyFilter('title', 'html_filter');
$form->applyFilter('title', 'trim');
// Code
$form->add_textfield('visual_code', array(get_lang('CourseCode'), get_lang('OnlyLettersAndNumbers')), false, array('class' => 'span3', 'maxlength' => CourseManager::MAX_COURSE_LENGTH_CODE));