當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。