本文整理汇总了PHP中Chamilo\CoreBundle\Framework\Container::getGroupManager方法的典型用法代码示例。如果您正苦于以下问题:PHP Container::getGroupManager方法的具体用法?PHP Container::getGroupManager怎么用?PHP Container::getGroupManager使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Chamilo\CoreBundle\Framework\Container
的用法示例。
在下文中一共展示了Container::getGroupManager方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
/* 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));