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


PHP GroupManager::get_category方法代码示例

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


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

示例1: get_lang

    if (isset($_POST['id']) && intval($groups_per_user) != GroupManager::GROUP_PER_MEMBER_NO_LIMIT && GroupManager::get_current_max_groups_per_user($_POST['id']) > intval($groups_per_user)) {
        return false;
    }
    return true;
}
if (api_get_setting('allow_group_categories') == 'true') {
    if (isset($_GET['id'])) {
        $category = GroupManager::get_category($_GET['id']);
        $nameTools = get_lang('EditGroupCategory') . ': ' . $category['title'];
    } else {
        $nameTools = get_lang('AddCategory');
        // Default values for new category
        $category = array('groups_per_user' => 1, 'doc_state' => GroupManager::TOOL_PRIVATE, 'work_state' => GroupManager::TOOL_PRIVATE, 'wiki_state' => GroupManager::TOOL_PRIVATE, 'chat_state' => GroupManager::TOOL_PRIVATE, 'calendar_state' => GroupManager::TOOL_PRIVATE, 'announcements_state' => GroupManager::TOOL_PRIVATE, 'forum_state' => GroupManager::TOOL_PRIVATE, 'max_student' => 0);
    }
} else {
    $category = GroupManager::get_category($_GET['id']);
    $nameTools = get_lang('PropModify');
}
$htmlHeadXtra[] = '<script>
$(document).ready( function() {
    $("#max_member").on("focus", function() {
        $("#max_member_selected").attr("checked", true);
    });
});
 </script>';
$interbreadcrumb[] = array('url' => 'group.php', 'name' => get_lang('Groups'));
$course_id = api_get_course_int_id();
// Build the form
if (isset($_GET['id'])) {
    // Update settings of existing category
    $action = 'update_settings';
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:31,代码来源:group_category.php

示例2: exportCategoriesAndGroupsToArray

 /**
  * Export all categories/group from a course to an array.
  * This function works only in a context of a course.
  * @return array
  */
 public static function exportCategoriesAndGroupsToArray()
 {
     $data = array();
     $data[] = array('category', 'group', 'description', 'announcements_state', 'calendar_state', 'chat_state', 'doc_state', 'forum_state', 'work_state', 'wiki_state', 'max_student', 'self_reg_allowed', 'self_unreg_allowed', 'groups_per_user');
     $categories = GroupManager::get_categories();
     foreach ($categories as $categoryInfo) {
         $data[] = array($categoryInfo['title'], null, $categoryInfo['description'], $categoryInfo['announcements_state'], $categoryInfo['calendar_state'], $categoryInfo['chat_state'], $categoryInfo['doc_state'], $categoryInfo['forum_state'], $categoryInfo['work_state'], $categoryInfo['wiki_state'], $categoryInfo['max_student'], $categoryInfo['self_reg_allowed'], $categoryInfo['self_unreg_allowed'], $categoryInfo['groups_per_user']);
     }
     $groups = GroupManager::get_group_list();
     foreach ($groups as $groupInfo) {
         $categoryTitle = null;
         $categoryInfo = GroupManager::get_category($groupInfo['category_id']);
         $groupSettings = GroupManager::get_group_properties($groupInfo['id']);
         if (!empty($categoryInfo)) {
             $categoryTitle = $categoryInfo['title'];
         }
         $data[] = array($categoryTitle, $groupSettings['name'], $groupSettings['description'], $groupSettings['announcements_state'], $groupSettings['calendar_state'], $groupSettings['chat_state'], $groupSettings['doc_state'], $groupSettings['forum_state'], $groupSettings['work_state'], $groupSettings['wiki_state'], $groupSettings['maximum_number_of_students'], $groupSettings['self_registration_allowed'], $groupSettings['self_unregistration_allowed']);
     }
     return $data;
 }
开发者ID:ragebat,项目名称:chamilo-lms,代码行数:25,代码来源:groupmanager.lib.php

示例3: exportCategoriesAndGroupsToArray

 /**
  * Export all categories/group from a course to an array.
  * This function works only in a context of a course.
  * @param int $groupId
  * @param bool $loadUsers
  * @return array
  */
 public static function exportCategoriesAndGroupsToArray($groupId = null, $loadUsers = false)
 {
     $data = array();
     $data[] = array('category', 'group', 'description', 'announcements_state', 'calendar_state', 'chat_state', 'doc_state', 'forum_state', 'work_state', 'wiki_state', 'max_student', 'self_reg_allowed', 'self_unreg_allowed', 'groups_per_user');
     $count = 1;
     if ($loadUsers) {
         $data[0][] = 'students';
         $data[0][] = 'tutors';
     }
     if ($loadUsers == false) {
         $categories = GroupManager::get_categories();
         foreach ($categories as $categoryInfo) {
             $data[$count] = array($categoryInfo['title'], null, $categoryInfo['description'], $categoryInfo['announcements_state'], $categoryInfo['calendar_state'], $categoryInfo['chat_state'], $categoryInfo['doc_state'], $categoryInfo['forum_state'], $categoryInfo['work_state'], $categoryInfo['wiki_state'], $categoryInfo['max_student'], $categoryInfo['self_reg_allowed'], $categoryInfo['self_unreg_allowed'], $categoryInfo['groups_per_user']);
             $count++;
         }
     }
     $groups = GroupManager::get_group_list();
     foreach ($groups as $groupInfo) {
         $categoryTitle = null;
         $categoryInfo = GroupManager::get_category($groupInfo['category_id']);
         $groupSettings = GroupManager::get_group_properties($groupInfo['id']);
         if (!empty($categoryInfo)) {
             $categoryTitle = $categoryInfo['title'];
         }
         $users = GroupManager::getStudents($groupInfo['id']);
         $userList = array();
         foreach ($users as $user) {
             $user = api_get_user_info($user['user_id']);
             $userList[] = $user['username'];
         }
         $tutors = GroupManager::getTutors($groupInfo['id']);
         $tutorList = array();
         foreach ($tutors as $user) {
             $user = api_get_user_info($user['user_id']);
             $tutorList[] = $user['username'];
         }
         $userListToString = null;
         if (!empty($userList)) {
             $userListToString = implode(',', $userList);
         }
         $tutorListToString = null;
         if (!empty($tutorList)) {
             $tutorListToString = implode(',', $tutorList);
         }
         $data[$count] = array($categoryTitle, $groupSettings['name'], $groupSettings['description'], $groupSettings['announcements_state'], $groupSettings['calendar_state'], $groupSettings['chat_state'], $groupSettings['doc_state'], $groupSettings['forum_state'], $groupSettings['work_state'], $groupSettings['wiki_state'], $groupSettings['maximum_number_of_students'], $groupSettings['self_registration_allowed'], $groupSettings['self_unregistration_allowed'], null);
         if ($loadUsers) {
             $data[$count][] = $userListToString;
             $data[$count][] = $tutorListToString;
         }
         if (!empty($groupId)) {
             if ($groupId == $groupInfo['id']) {
                 break;
             }
         }
         $count++;
     }
     return $data;
 }
开发者ID:omaoibrahim,项目名称:chamilo-lms,代码行数:65,代码来源:groupmanager.lib.php


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