当前位置: 首页>>代码示例>>PHP>>正文


PHP CourseManager::get_group_list_of_course方法代码示例

本文整理汇总了PHP中CourseManager::get_group_list_of_course方法的典型用法代码示例。如果您正苦于以下问题:PHP CourseManager::get_group_list_of_course方法的具体用法?PHP CourseManager::get_group_list_of_course怎么用?PHP CourseManager::get_group_list_of_course使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CourseManager的用法示例。


在下文中一共展示了CourseManager::get_group_list_of_course方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: showToForm

 /**
  * @param FormValidator $form
  * @param array $sendTo array('everyone' => false, 'users' => [1, 2], 'groups' => [3, 4])
  * @param array $attributes
  * @param bool $addOnlyItemsInSendTo
  * @param bool $required
  * @return bool
  */
 public function showToForm($form, $sendTo = array(), $attributes = array(), $addOnlyItemsInSendTo = false, $required = false)
 {
     if ($this->type != 'course') {
         return false;
     }
     $order = 'lastname';
     if (api_is_western_name_order()) {
         $order = 'firstname';
     }
     $userList = CourseManager::get_user_list_from_course_code(api_get_course_id(), $this->sessionId, null, $order);
     $groupList = CourseManager::get_group_list_of_course(api_get_course_id(), $this->sessionId);
     $this->setSendToSelect($form, $groupList, $userList, $sendTo, $attributes, $addOnlyItemsInSendTo, $required);
     return true;
 }
开发者ID:secuencia24,项目名称:chamilo-lms,代码行数:22,代码来源:agenda.lib.php

示例2: get_course_groups

 /**
  * this function gets all the groups of the course,
  * not including linked courses
  */
 public static function get_course_groups()
 {
     $session_id = api_get_session_id();
     if ($session_id != 0) {
         $new_group_list = CourseManager::get_group_list_of_course(api_get_course_id(), $session_id, 1);
     } else {
         $new_group_list = CourseManager::get_group_list_of_course(api_get_course_id(), 0, 1);
     }
     return $new_group_list;
 }
开发者ID:secuencia24,项目名称:chamilo-lms,代码行数:14,代码来源:AnnouncementManager.php

示例3: show_to_form

 /**
  * @param array $form
  * @param $to_already_selected
  */
 public static function show_to_form($form, $to_already_selected)
 {
     $order = 'lastname';
     if (api_is_western_name_order()) {
         $order = 'firstname';
     }
     $user_list = CourseManager::get_user_list_from_course_code(api_get_course_id(), api_get_session_id(), null, $order);
     $group_list = CourseManager::get_group_list_of_course(api_get_course_id(), api_get_session_id());
     self::construct_not_selected_select_form_validator($form, $group_list, $user_list, $to_already_selected);
 }
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:14,代码来源:agenda.lib.php

示例4: get_lang

}
//Building the form for Users
$formUsers = new \FormValidator('lp_edit', 'post', $url);
$formUsers->addElement('hidden', 'user_form', 1);
$userMultiSelect = $formUsers->addElement('advmultiselect', 'users', get_lang('Users'), $choices);
$formUsers->addButtonSave(get_lang('Save'));
$defaults = array();
if (!empty($selectedChoices)) {
    $defaults['users'] = $selectedChoices;
}
$formUsers->setDefaults($defaults);
//Building the form for Groups
$form = new \FormValidator('lp_edit', 'post', $url);
$form->addElement('hidden', 'group_form', 1);
// Group list
$groupList = \CourseManager::get_group_list_of_course(api_get_course_id(), api_get_session_id(), 1);
$groupChoices = array_column($groupList, 'name', 'id');
// Subscribed groups to a LP
$subscribedGroupsInLp = $em->getRepository('ChamiloCourseBundle:CItemProperty')->getGroupsSubscribedToItem('learnpath', $lpId, $course, $session);
$selectedGroupChoices = array();
/** @var CItemProperty $itemProperty */
foreach ($subscribedGroupsInLp as $itemProperty) {
    $selectedGroupChoices[] = $itemProperty->getGroup()->getId();
}
$groupMultiSelect = $form->addElement('advmultiselect', 'groups', get_lang('Groups'), $groupChoices);
// submit button
$form->addButtonSave(get_lang('Save'));
$defaults = array();
if (!empty($selectedGroupChoices)) {
    $defaults['groups'] = $selectedGroupChoices;
}
开发者ID:KRCM13,项目名称:chamilo-lms,代码行数:31,代码来源:lp_subscribe_users.php

示例5: show_to

function show_to($filter = 0, $id = null)
{
    $order = 'lastname';
    if (api_is_western_name_order()) {
        $order = 'firstname';
    }
    $user_list = CourseManager::get_user_list_from_course_code(api_get_course_id(), api_get_session_id(), null, $order);
    $group_list = CourseManager::get_group_list_of_course(api_get_course_id(), api_get_session_id());
    return construct_to_select_form($group_list, $user_list, $filter, $id);
}
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:10,代码来源:agenda.inc.php

示例6: generate_user_group_array

 static function generate_user_group_array($course_code, $session_id = 0)
 {
     $order = api_is_western_name_order() ? 'firstname' : 'lastname';
     $user_list = CourseManager::get_real_and_linked_user_list($course_code, true, $session_id, $order);
     $group_list = CourseManager::get_group_list_of_course($course_code, $session_id, 1);
     $items = self::transform_user_group_array($user_list, $group_list);
     return $items;
 }
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:8,代码来源:usermanager.lib.php

示例7: indexAction

 /**
  * Index
  *
  * @param   \Silex\Application $app
  * @param   int $lpId
  *
  * @todo move calls in repositories
  *
  * @return Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response
  */
 public function indexAction(Request $request)
 {
     ///$lpId
     $courseId = api_get_course_int_id();
     //@todo use the before filter to aborts this course calls
     if (empty($courseId)) {
         $app->abort(403, 'Course not available');
     }
     $courseCode = api_get_course_id();
     $lp = new \learnpath($courseCode, $lpId, api_get_user_id());
     $url = $app['url_generator']->generate('subscribe_users', array('lpId' => $lpId));
     //Setting breadcrumb @todo move this in the template lib
     $breadcrumb = array(array('url' => api_get_path(WEB_CODE_PATH) . 'newscorm/lp_controller.php?action=list', 'name' => get_lang('LearningPaths')), array('url' => api_get_path(WEB_CODE_PATH) . "newscorm/lp_controller.php?action=build&lp_id=" . $lp->get_id(), 'name' => $lp->get_name()), array('url' => '#', 'name' => get_lang('SubscribeUsers')));
     $app['breadcrumb'] = $breadcrumb;
     // Find session.
     $sessionId = api_get_session_id();
     $session = null;
     if (!empty($sessionId)) {
         $session = $app['orm.em']->getRepository('Chamilo\\CoreBundle\\Entity\\Session')->find($sessionId);
     }
     // Find course.
     $course = $app['orm.em']->getRepository('Chamilo\\CoreBundle\\Entity\\Course')->find($courseId);
     // Getting subscribe users to the course.
     $subscribedUsers = $app['orm.em']->getRepository('Chamilo\\CoreBundle\\Entity\\Course')->getSubscribedStudents($course);
     $subscribedUsers = $subscribedUsers->getQuery();
     $subscribedUsers = $subscribedUsers->execute();
     // Getting all users in a nice format.
     $choices = array();
     foreach ($subscribedUsers as $user) {
         $choices[$user->getUserId()] = $user->getCompleteNameWithClasses();
     }
     // Getting subscribed users to a LP.
     $subscribedUsersInLp = $app['orm.em']->getRepository('Chamilo\\CoreBundle\\Entity\\CItemProperty')->getUsersSubscribedToItem('learnpath', $lpId, $course, $session);
     $selectedChoices = array();
     foreach ($subscribedUsersInLp as $itemProperty) {
         $selectedChoices[] = $itemProperty->getToUserId();
     }
     //Building the form for Users
     $formUsers = new \FormValidator('lp_edit', 'post', $url);
     $formUsers->addElement('hidden', 'user_form', 1);
     $formUsers->addElement('header', get_lang('SubscribeUsersToLp'));
     $userMultiSelect = $formUsers->addElement('advmultiselect', 'users', get_lang('Users'), $choices);
     $userMultiSelect->setButtonAttributes('add');
     $userMultiSelect->setButtonAttributes('remove');
     $formUsers->addElement('style_submit_button', 'submit', get_lang('Save'), 'class="save"');
     $defaults = array();
     if (!empty($selectedChoices)) {
         $defaults['users'] = $selectedChoices;
     }
     $formUsers->setDefaults($defaults);
     //Building the form for Groups
     $form = new \FormValidator('lp_edit', 'post', $url);
     $form->addElement('header', get_lang('SubscribeGroupsToLp'));
     $form->addElement('hidden', 'group_form', 1);
     //Group list
     $groupList = \CourseManager::get_group_list_of_course(api_get_course_id(), api_get_session_id(), 1);
     $groupChoices = array();
     if (!empty($groupList)) {
         foreach ($groupList as $group) {
             $groupChoices[$group['id']] = $group['name'];
         }
     }
     //Subscribed groups to a LP
     $subscribedGroupsInLp = $app['orm.em']->getRepository('Chamilo\\CoreBundle\\Entity\\CItemProperty')->getGroupsSubscribedToItem('learnpath', $lpId, $course, $session);
     $selectedGroupChoices = array();
     foreach ($subscribedGroupsInLp as $itemProperty) {
         $selectedGroupChoices[] = $itemProperty->getToGroupId();
     }
     $groupMultiSelect = $form->addElement('advmultiselect', 'groups', get_lang('Groups'), $groupChoices);
     $groupMultiSelect->setButtonAttributes('add');
     $groupMultiSelect->setButtonAttributes('remove');
     // submit button
     $form->addElement('style_submit_button', 'submit', get_lang('Save'), 'class="save"');
     /*$form = $app['form.factory']->createBuilder('form')
            ->add('origin', 'choice', array(
               'label' => get_lang('Origin'),
               'multiple' => true,
               'required' => false,
               'expanded' => false,
               //'class' => 'Entity\Course',
               //'property' => 'complete_name',
               //'query_builder' => function(Chamilo\CoreBundle\Entity\Repository\CourseRepository $repo) use ($course) {
                   $repo =  $repo->getSubscribedStudents($course);
                   return $repo;
               },
               'choices' => $choices
           ))
           ->add('destination', 'choice', array(
               'label' => get_lang('Destination'),
               'multiple' => true,
//.........这里部分代码省略.........
开发者ID:ragebat,项目名称:chamilo-lms,代码行数:101,代码来源:LearningPathController.php

示例8: get_course_groups

/**
 * this function gets all the groups of the course
 * @author Patrick Cool <patrick.cool@UGent.be>, Ghent University
 * @return array
 */
function get_course_groups()
{
    $group_list = CourseManager::get_group_list_of_course(api_get_course_id(), api_get_session_id());
    return $group_list;
}
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:10,代码来源:agenda.inc.php


注:本文中的CourseManager::get_group_list_of_course方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。