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


PHP GroupManager类代码示例

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


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

示例1: ShowUsers

 function ShowUsers($filter)
 {
     require_once PATH_ACCESS . '/UserManager.php';
     require_once PATH_ACCESS . '/GroupManager.php';
     require_once PATH_ACCESS . '/GlobalSettingsManager.php';
     $globalSettingsManager = new globalSettingsManager();
     $userManager = new UserManager();
     $groupManager = new GroupManager();
     try {
         $groups = $groupManager->getTableData();
         //$users = $userManager->getTableData();
         isset($_GET['sitePointer']) ? $showPage = $_GET['sitePointer'] + 0 : ($showPage = 1);
         $nextPointer = $showPage * 10 - 10;
         $users = $userManager->getUsersSorted($nextPointer, $filter);
     } catch (Exception $e) {
         $this->logs->log('ADMIN', 'MODERATE', sprintf('Error while getting Data from MySQL:%s in %s', $e->getMessage(), __METHOD__));
         $this->userInterface->dieError($this->messages['error']['get_data_failed']);
     }
     foreach ($users as &$user) {
         $is_named = false;
         foreach ($groups as $gn) {
             if ($gn['ID'] == $user['GID']) {
                 $user['groupname'] = $gn['name'];
                 $is_named = true;
                 break;
             }
         }
         $is_named or $user['groupname'] = 'Error: This group is non-existent!';
     }
     $specialCourses = $globalSettingsManager->getSpecialCourses();
     $specialCourses_exploded = explode("|", $specialCourses);
     $navbar = navBar($showPage, 'SystemUsers', 'System', 'SpecialCourse', '3', $filter);
     $this->SpecialCourseInterface->ShowUsers($users, $specialCourses_exploded, $navbar);
 }
开发者ID:Auwibana,项目名称:babesk,代码行数:34,代码来源:AdminSpecialCourseProcessing.php

示例2: executePopup

 public function executePopup()
 {
     $group_manager = new GroupManager();
     $acct_schema = $group_manager->getAcctSchema();
     //if the group name contains spaces, replace %20 by a space
     $_GET['group'] = str_replace("%20", " ", $_GET['group']);
     //if the owner field exists in ACCT table, sort the db result by owner
     if (array_key_exists(OWNER, $acct_schema)) {
         $result = $group_manager->getDetailedStat($_GET['group'], OWNER);
     } else {
         $result = $group_manager->getDetailedStat($_GET['group'], null);
     }
     $group_status = array();
     $has_status = 0;
     foreach ($result as $line) {
         if (array_key_exists(STATUS, $acct_schema)) {
             $has_status = 1;
             if (!array_key_exists(TYPE, $acct_schema) || $line[TYPE] != 'dir') {
                 if (isset($group_status[$line[STATUS]])) {
                     $group_status[$line[STATUS]] += $line[COUNT];
                 } else {
                     $group_status[$line[STATUS]] = $line[COUNT];
                 }
             }
         }
     }
     $this->page->addVar('acct_schema', $acct_schema);
     $this->page->addVar('result', $result);
     if ($has_status) {
         $this->page->addVar('group_status', $group_status);
     }
 }
开发者ID:rootfs,项目名称:robinhood,代码行数:32,代码来源:GroupController.class.php

示例3: search_post

 /** search_post()
 		This function is how the data gets processed and displayed based on what was
 		searched for.
 	*/
 public function search_post()
 {
     // Variables
     $Groups = new GroupManager();
     // Find data -> Push data
     foreach ($Groups->search() as $Group) {
         $this->data[] = array('id' => $Group->get('id'), 'name' => $Group->get('name'), 'description' => $Group->get('description'), 'count' => $Group->getHostCount());
     }
     // Hook
     $this->HookManager->processEvent('GROUP_DATA', array('headerData' => &$this->headerData, 'data' => &$this->data, 'templates' => &$this->templates, 'attributes' => &$this->attributes));
     // Output
     $this->render();
 }
开发者ID:priestd09,项目名称:fogproject,代码行数:17,代码来源:GroupManagementPage.class.php

示例4: check_groups_per_user

/**
 * Function to check the number of groups per user
 */
function check_groups_per_user($value)
{
    $groups_per_user = $value['groups_per_user'];
    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;
}
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:11,代码来源:group_category.php

示例5: __construct

 public function __construct($resource)
 {
     $this->id = $resource->id;
     $this->leader = $resource->leader;
     $this->name = $resource->name;
     $this->description = $resource->description;
     $this->color = $resource->color;
     $this->icon = $resource->icon;
     $this->memberCount = GroupManager::getMemberCountByID($this->id);
 }
开发者ID:hoff121324,项目名称:GlassWebsite,代码行数:10,代码来源:GroupObject.php

示例6: loadBasicDummyData

 public static function loadBasicDummyData()
 {
     TestManager::clearDatabase();
     $database = new DatabaseManager();
     UserManager::verifyTable($database);
     AddonManager::verifyTable($database);
     BoardManager::verifyTable($database);
     TagManager::verifyTable($database);
     GroupManager::verifyTable($database);
     DependencyManager::verifyTable($database);
     CommentManager::verifyTable($database);
     RatingManager::verifyTable($database);
     BuildManager::verifyTable($database);
     StatManager::verifyTable($database);
     ScreenshotManager::verifyTable($database);
     if (!$database->query("INSERT INTO `addon_boards` (name, video, description) VALUES ('General Content', 'general_content_bg', 'Bricks, Events, Sounds, Prints, Environments, and much more!')")) {
         throw new Exception("Database error: " . $database->error());
     }
     if (!$database->query("INSERT INTO `addon_boards` (name, video, description) VALUES ('Minigames', 'minigames_bg', 'Weapons, Vehicles, Gamemodes, and all your gaming needs!')")) {
         throw new Exception("Database error: " . $database->error());
     }
     if (!$database->query("INSERT INTO `addon_boards` (name, video, description) VALUES ('Client Mods', 'client_mods_bg', 'Mods that run on your client.')")) {
         throw new Exception("Database error: " . $database->error());
     }
     if (!$database->query("INSERT INTO `addon_boards` (name, video, description) VALUES ('Bargain Bin', 'bargain_bin_bg', 'A home for \\'special\\' content.')")) {
         throw new Exception("Database error: " . $database->error());
     }
     if (!$database->query("INSERT INTO `users` (username, blid, password, email, salt, verified) VALUES ('testuser', '4833', '1d8436e97ef95a7a6151f47b909167c77cfe1985ee5500efa8d46cfe825abc59', 'email@email.com', '273eb4', '1')")) {
         throw new Exception("Database error: " . $database->error());
     }
     //the default json types likely need to be reworked
     if (!$database->query("INSERT INTO `addon_addons` (board, blid, name, filename, description, approved, versionInfo, authorInfo, reviewInfo) VALUES ('1', '4833', 'crapy adon', 'sciprt_hax.zip', 'bad addone pls delete', '1', '{}', '[]', '[]')")) {
         throw new Exception("Database error: " . $database->error());
     }
     StatManager::addStatsToAddon(1);
     if (!$database->query("INSERT INTO `addon_tags` (name, base_color, icon) VALUES ('dum tag', 'ff6600', 'brokenimage')")) {
         throw new Exception("Database error: " . $database->error());
     }
     if (!$database->query("INSERT INTO `addon_tagmap` (aid, tid) VALUES ('1', '1')")) {
         throw new Exception("Database error: " . $database->error());
     }
     if (!$database->query("INSERT INTO `group_groups` (leader, name, description, color, icon) VALUES ('4833', 'legion of dumies', 'a group for people who just want to be in a group', '00ff00', 'brokenimage')")) {
         throw new Exception("Database error: " . $database->error());
     }
     if (!$database->query("INSERT INTO `group_usermap` (gid, blid, administrator) VALUES ('1', '4833', '1')")) {
         throw new Exception("Database error: " . $database->error());
     }
     if (!$database->query("INSERT INTO `addon_comments` (blid, aid, comment) VALUES ('4833', '1', 'glorious addon comrade')")) {
         throw new Exception("Database error: " . $database->error());
     }
     if (!$database->query("INSERT INTO `addon_ratings` (blid, aid, rating) VALUES ('4833', '1', '1')")) {
         throw new Exception("Database error: " . $database->error());
     }
 }
开发者ID:hoff121324,项目名称:GlassWebsite,代码行数:54,代码来源:TestManager.php

示例7: inGroup

 public function inGroup($name)
 {
     $groups = GroupManager::getGroupsFromBLID($this->blid);
     foreach ($groups as $gid) {
         $group = GroupManager::getFromId($gid);
         if ($group->getName() == $name) {
             return true;
         }
     }
     return false;
 }
开发者ID:hoff121324,项目名称:GlassWebsite,代码行数:11,代码来源:UserObject.php

示例8: inGroup

 public function inGroup($name)
 {
     require_once realpath(dirname(__FILE__) . '/GroupObject.php');
     $groups = GroupManager::getGroupsFromBLID($this->blid);
     foreach ($groups as $gid) {
         $group = GroupManager::getFromId($gid);
         if ($group->getName() == $name) {
             return true;
         }
     }
     return false;
 }
开发者ID:BlocklandGlass,项目名称:GlassWebsite,代码行数:12,代码来源:UserObject.php

示例9: get_announcements

 private function get_announcements($username, $course_code, $announcement_id = 0)
 {
     $session_id = api_get_session_id();
     $condition_session = api_get_session_condition($session_id);
     $announcement_id = $announcement_id == 0 ? "" : "AND announcement.id=" . $announcement_id;
     $user_id = UserManager::get_user_id_from_username($username);
     //$listOfCourses = CourseManager::get_course_information_by_id($course_id);
     $course_info = CourseManager::get_course_information($course_code);
     $course_db = $course_info['db_name'];
     $tbl_item_property = Database::get_course_table(TABLE_ITEM_PROPERTY, $course_db);
     $tbl_announcement = Database::get_course_table(TABLE_ANNOUNCEMENT, $course_db);
     $maximum = '12';
     $group_memberships = GroupManager::get_group_ids($course_info['real_id'], $user_id);
     if (api_get_group_id() == 0) {
         $cond_user_id = " AND ( ip.to_user_id='" . $user_id . "'" . "OR ip.to_group_id IN (0, " . implode(", ", $group_memberships) . ")) ";
     } else {
         $cond_user_id = " AND ( ip.to_user_id='" . $user_id . "'" . "OR ip.to_group_id IN (0, " . api_get_group_id() . ")) ";
     }
     // the user is member of several groups => display personal announcements AND his group announcements AND the general announcements
     if (is_array($group_memberships) && count($group_memberships) > 0) {
         $sql = "SELECT\n                            announcement.*, ip.visibility, ip.to_group_id, ip.insert_user_id\n                            FROM {$tbl_announcement} announcement, {$tbl_item_property} ip\n                            WHERE announcement.id = ip.ref\n                            AND ip.tool='announcement'\n                            AND ip.visibility='1'\n                            {$announcement_id}\n                            {$cond_user_id}\n                            {$condition_session}\n                            GROUP BY ip.ref\n                            ORDER BY display_order DESC\n                            LIMIT 0,{$maximum}";
     } else {
         // the user is not member of any group
         // this is an identified user => show the general announcements AND his personal announcements
         if ($user_id) {
             if (api_get_course_setting('allow_user_edit_announcement') && !api_is_anonymous()) {
                 $cond_user_id = " AND (ip.lastedit_user_id = '" . api_get_user_id() . "' OR ( ip.to_user_id='" . $user_id . "' OR ip.to_group_id='0')) ";
             } else {
                 $cond_user_id = " AND ( ip.to_user_id='" . $user_id . "' OR ip.to_group_id='0') ";
             }
             $sql = "SELECT\n                                    announcement.*, ip.visibility, ip.to_group_id, ip.insert_user_id\n                                    FROM {$tbl_announcement} announcement, {$tbl_item_property} ip\n                                    WHERE announcement.id = ip.ref\n                                    AND ip.tool='announcement'\n                                    AND ip.visibility='1'\n                                    {$announcement_id}\n                                    {$cond_user_id}\n                                    {$condition_session}\n                                    GROUP BY ip.ref\n                                    ORDER BY display_order DESC\n                                    LIMIT 0,{$maximum}";
         } else {
             if (api_get_course_setting('allow_user_edit_announcement')) {
                 $cond_user_id = " AND (ip.lastedit_user_id = '" . api_get_user_id() . "' OR ip.to_group_id='0') ";
             } else {
                 $cond_user_id = " AND ip.to_group_id='0' ";
             }
             // the user is not identiefied => show only the general announcements
             $sql = "SELECT\n                                    announcement.*, ip.visibility, ip.to_group_id, ip.insert_user_id\n                                    FROM {$tbl_announcement} announcement, {$tbl_item_property} ip\n                                    WHERE announcement.id = ip.ref\n                                    AND ip.tool='announcement'\n                                    AND ip.visibility='1'\n                                    AND ip.to_group_id='0'\n                                    {$announcement_id}\n                                    {$condition_session}\n                                    GROUP BY ip.ref\n                                    ORDER BY display_order DESC\n                                    LIMIT 0,{$maximum}";
         }
     }
     $result = Database::query($sql);
     return $result;
 }
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:44,代码来源:cm_webservice_announcements.php

示例10: get_group_reporting

 public static function get_group_reporting($course_id, $group_id = null, $type = 'all', $start = 0, $limit = 1000, $sidx = 1, $sord = 'desc', $where_condition = array())
 {
     if (empty($course_id)) {
         return null;
     }
     $course_info = api_get_course_info_by_id($course_id);
     $table_group = Database::get_course_table(TABLE_GROUP);
     $course_id = intval($course_id);
     $select = ' * ';
     if ($type == 'count') {
         $select = ' count(id) as count ';
     }
     $default_where = array('c_id = ? ' => array($course_id));
     $result = Database::select($select, $table_group, array('limit' => " {$start}, {$limit}", 'where' => $default_where, 'order' => "{$sidx} {$sord}"));
     if ($type == 'count') {
         return $result[0]['count'];
     }
     $parsed_result = array();
     if (!empty($result)) {
         foreach ($result as $group) {
             $users = GroupManager::get_users($group['id'], true);
             $time = 0;
             $avg_student_score = 0;
             $avg_student_progress = 0;
             $work = 0;
             $messages = 0;
             foreach ($users as $user_data) {
                 $time += Tracking::get_time_spent_on_the_course($user_data['user_id'], $course_info['code'], 0);
                 $avg_student_score += Tracking::get_avg_student_score($user_data['user_id'], $course_info['code'], array(), 0);
                 $avg_student_progress += Tracking::get_avg_student_progress($user_data['user_id'], $course_info['code'], array(), 0);
                 $work += Tracking::count_student_assignments($user_data['user_id'], $course_info['code'], 0);
                 $messages += Tracking::count_student_messages($user_data['user_id'], $course_info['code'], 0);
             }
             $group_item = array('id' => $group['id'], 'name' => $group['name'], 'time' => api_time_to_hms($time), 'progress' => $avg_student_progress, 'score' => $avg_student_score, 'works' => $work, 'messages' => $messages);
             $parsed_result[] = $group_item;
         }
     }
     return $parsed_result;
 }
开发者ID:feroli1000,项目名称:chamilo-lms,代码行数:39,代码来源:tracking.lib.php

示例11: api_get_group_id

/* MAIN DISPLAY SECTION */
$groupId = api_get_group_id();
$my_forum = isset($_GET['forum']) ? $_GET['forum'] : '';
// Note: This has to be validated that it is an existing forum.
$current_forum = get_forum_information($my_forum);
if (empty($current_forum)) {
    api_not_allowed();
}
$current_forum_category = get_forumcategory_information($current_forum['forum_category']);
$is_group_tutor = false;
if (!empty($groupId)) {
    //Group info & group category info
    $group_properties = GroupManager::get_group_properties($groupId);
    //User has access in the group?
    $user_has_access_in_group = GroupManager::user_has_access($userid, $groupId, GroupManager::GROUP_TOOL_FORUM);
    $is_group_tutor = GroupManager::is_tutor_of_group(api_get_user_id(), $groupId);
    //Course
    if (!api_is_allowed_to_edit(false, true) and ($current_forum_category && $current_forum_category['visibility'] == 0 or $current_forum['visibility'] == 0 or !$user_has_access_in_group)) {
        api_not_allowed();
    }
} else {
    //Course
    if (!api_is_allowed_to_edit(false, true) and ($current_forum_category && $current_forum_category['visibility'] == 0 or $current_forum['visibility'] == 0)) {
        api_not_allowed();
    }
}
/* Header and Breadcrumbs */
$my_search = isset($_GET['search']) ? $_GET['search'] : '';
$my_action = isset($_GET['action']) ? $_GET['action'] : '';
$gradebook = null;
if (isset($_SESSION['gradebook'])) {
开发者ID:ragebat,项目名称:chamilo-lms,代码行数:31,代码来源:viewforum.php

示例12: get_user_data

/**
 * Get the users to display on the current page.
 */
function get_user_data($from, $number_of_items, $column, $direction)
{
    global $origin;
    global $course_info;
    global $is_western_name_order;
    global $session_id;
    $a_users = array();
    // limit
    $limit = 'LIMIT ' . intval($from) . ',' . intval($number_of_items);
    if (!in_array($direction, array('ASC', 'DESC'))) {
        $direction = 'ASC';
    }
    switch ($column) {
        case 2:
            //official code
            $order_by = 'ORDER BY user.official_code ' . $direction;
            break;
        case 3:
            if ($is_western_name_order) {
                $order_by = 'ORDER BY user.firstname ' . $direction . ', user.lastname ' . $direction;
            } else {
                $order_by = 'ORDER BY user.lastname ' . $direction . ', user.firstname ' . $direction;
            }
            break;
        case 4:
            if ($is_western_name_order) {
                $order_by = 'ORDER BY user.lastname ' . $direction . ', user.firstname ' . $direction;
            } else {
                $order_by = 'ORDER BY user.firstname ' . $direction . ', user.lastname ' . $direction;
            }
            break;
        case 5:
            //username
            $order_by = 'ORDER BY user.username ' . $direction;
            break;
        default:
            if ($is_western_name_order) {
                $order_by = 'ORDER BY user.lastname ' . $direction . ', user.firstname ' . $direction;
            } else {
                $order_by = 'ORDER BY user.firstname ' . $direction . ', user.lastname ' . $direction;
            }
            break;
    }
    $session_id = api_get_session_id();
    $course_code = api_get_course_id();
    $keyword = isset($_REQUEST['keyword']) ? $_REQUEST['keyword'] : null;
    $a_course_users = CourseManager::get_user_list_from_course_code($course_code, $session_id, $limit, $order_by, null, $keyword);
    foreach ($a_course_users as $user_id => $o_course_user) {
        $groups_name = GroupManager::get_user_group_name($user_id);
        $temp = array();
        if (api_is_allowed_to_edit(null, true)) {
            //if (api_get_setting('allow_user_course_subscription_by_course_admin') == 'true') {
            $temp[] = $user_id;
            //}
            $image_path = UserManager::get_user_picture_path_by_id($user_id, 'web', false, true);
            $user_profile = UserManager::get_picture_user($user_id, $image_path['file'], 22, USER_IMAGE_SIZE_SMALL, ' width="22" height="22" ');
            if (!api_is_anonymous()) {
                $photo = '<a href="userInfo.php?' . api_get_cidreq() . '&origin=' . $origin . '&amp;uInfo=' . $user_id . '" title="' . get_lang('Info') . '"  ><img src="' . $user_profile['file'] . '" ' . $user_profile['style'] . ' alt="' . api_get_person_name($o_course_user['firstname'], $o_course_user['lastname']) . '"  title="' . api_get_person_name($o_course_user['firstname'], $o_course_user['lastname']) . '" /></a>';
            } else {
                $photo = '<img src="' . $user_profile['file'] . '" ' . $user_profile['style'] . ' alt="' . api_get_person_name($o_course_user['firstname'], $o_course_user['lastname']) . '" title="' . api_get_person_name($o_course_user['firstname'], $o_course_user['lastname']) . '" />';
            }
            $temp[] = $photo;
            $temp[] = $o_course_user['official_code'];
            if ($is_western_name_order) {
                $temp[] = $o_course_user['firstname'];
                $temp[] = $o_course_user['lastname'];
            } else {
                $temp[] = $o_course_user['lastname'];
                $temp[] = $o_course_user['firstname'];
            }
            $temp[] = $o_course_user['username'];
            $temp[] = isset($o_course_user['role']) ? $o_course_user['role'] : null;
            //Description
            $temp[] = implode(', ', $groups_name);
            //Group
            // Status
            $default_status = '-';
            if (isset($o_course_user['status_rel']) && $o_course_user['status_rel'] == 1 || isset($o_course_user['status_session']) && $o_course_user['status_session'] == 2) {
                $default_status = get_lang('CourseManager');
            } elseif (isset($o_course_user['tutor_id']) && $o_course_user['tutor_id'] == 1) {
                $default_status = get_lang('Tutor');
            }
            $temp[] = $default_status;
            //Active
            $temp[] = $o_course_user['active'];
            //User id for actions
            $temp[] = $user_id;
        } else {
            $image_path = UserManager::get_user_picture_path_by_id($user_id, 'web', false, true);
            $image_repository = $image_path['dir'];
            $existing_image = $image_path['file'];
            if (!api_is_anonymous()) {
                $photo = '<a href="userInfo.php?' . api_get_cidreq() . '&origin=' . $origin . '&amp;uInfo=' . $user_id . '" title="' . get_lang('Info') . '"  ><img src="' . $image_repository . $existing_image . '" alt="' . api_get_person_name($o_course_user['firstname'], $o_course_user['lastname']) . '"  width="22" height="22" title="' . api_get_person_name($o_course_user['firstname'], $o_course_user['lastname']) . '" /></a>';
            } else {
                $photo = '<img src="' . $image_repository . $existing_image . '" alt="' . api_get_person_name($o_course_user['firstname'], $o_course_user['lastname']) . '"  width="22" height="22" title="' . api_get_person_name($o_course_user['firstname'], $o_course_user['lastname']) . '" />';
            }
            $temp[] = $user_id;
//.........这里部分代码省略.........
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:101,代码来源:user.php

示例13: sqlConfigSet

             sqlConfigSet('smtp-hello', $smtp_hello);
         }
         if ($email_test && !EMail::Send($email_test, 'Mail test', 'Content')) {
             $info .= '<br>' . lng('OPTIONS_MAIL_TEST_FAIL');
         }
     }
     $theme_manager = new ThemeManager(false, 'index.php?mode=control&');
     $theme_selector = $theme_manager->ShowThemeSelector();
     include View::Get('constants.html', $st_subdir);
     break;
 case 'profile':
     if (!$ban_user) {
         break;
     }
     tokenTool('set');
     $group_list = GroupManager::GetList($ban_user->group());
     include View::Get('profile_main.html', $st_subdir . 'profile/');
     $skin_def = $ban_user->defaultSkinTrigger();
     $cloak_exist = file_exists($ban_user->getCloakFName());
     $user_img_get = $ban_user->getSkinLink() . '&amp;refresh=' . rand(1000, 9999);
     if ($cloak_exist or !$skin_def) {
         include View::Get('profile_skin.html', $st_subdir . 'profile/');
     }
     if (!$skin_def) {
         include View::Get('profile_del_skin.html', $st_subdir . 'profile/');
     }
     if ($cloak_exist) {
         include View::Get('profile_del_cloak.html', $st_subdir . 'profile/');
     }
     if ($bd_names['iconomy']) {
         include View::Get('profile_money.html', $st_subdir . 'profile/');
开发者ID:qexyorg,项目名称:webMCR-1,代码行数:31,代码来源:admin.php

示例14: get_user_data

/**
 * Get the users to display on the current page.
 */
function get_user_data($from, $number_of_items, $column, $direction)
{
    global $is_western_name_order;
    global $extraFields;
    $type = isset($_REQUEST['type']) ? intval($_REQUEST['type']) : STUDENT;
    $course_info = api_get_course_info();
    $sessionId = api_get_session_id();
    $course_code = $course_info['code'];
    $a_users = array();
    // limit
    if (!isset($_GET['keyword']) || empty($_GET['keyword'])) {
        $limit = 'LIMIT ' . intval($from) . ',' . intval($number_of_items);
    }
    if (!in_array($direction, array('ASC', 'DESC'))) {
        $direction = 'ASC';
    }
    switch ($column) {
        case 2:
            //official code
            $order_by = 'ORDER BY user.official_code ' . $direction;
            break;
        case 3:
            if ($is_western_name_order) {
                $order_by = 'ORDER BY user.firstname ' . $direction . ', user.lastname ' . $direction;
            } else {
                $order_by = 'ORDER BY user.lastname ' . $direction . ', user.firstname ' . $direction;
            }
            break;
        case 4:
            if ($is_western_name_order) {
                $order_by = 'ORDER BY user.lastname ' . $direction . ', user.firstname ' . $direction;
            } else {
                $order_by = 'ORDER BY user.firstname ' . $direction . ', user.lastname ' . $direction;
            }
            break;
        case 5:
            //username
            $order_by = 'ORDER BY user.username ' . $direction;
            break;
        default:
            if ($is_western_name_order) {
                $order_by = 'ORDER BY user.lastname ' . $direction . ', user.firstname ' . $direction;
            } else {
                $order_by = 'ORDER BY user.firstname ' . $direction . ', user.lastname ' . $direction;
            }
            break;
    }
    $active = isset($_GET['active']) ? $_GET['active'] : null;
    if (empty($sessionId)) {
        $status = $type;
    } else {
        if ($type == COURSEMANAGER) {
            $status = 2;
        } else {
            $status = 0;
        }
    }
    $a_course_users = CourseManager::get_user_list_from_course_code($course_code, $sessionId, $limit, $order_by, $status, null, false, false, null, array(), array(), $active);
    foreach ($a_course_users as $user_id => $o_course_user) {
        if (isset($_GET['keyword']) && searchUserKeyword($o_course_user['firstname'], $o_course_user['lastname'], $o_course_user['username'], $o_course_user['official_code'], $_GET['keyword']) || !isset($_GET['keyword']) || empty($_GET['keyword'])) {
            $groupsNameList = GroupManager::getAllGroupPerUserSubscription($user_id);
            $groupsNameListParsed = [];
            if (!empty($groupsNameList)) {
                $groupsNameListParsed = array_column($groupsNameList, 'name');
            }
            $temp = array();
            if (api_is_allowed_to_edit(null, true)) {
                $userInfo = api_get_user_info($user_id);
                $photo = '<img src="' . $userInfo['avatar_small'] . '" alt="' . $userInfo['complete_name'] . '" title="' . $userInfo['complete_name'] . '" />';
                $temp[] = $user_id;
                $temp[] = $photo;
                $temp[] = $o_course_user['official_code'];
                if ($is_western_name_order) {
                    $temp[] = $o_course_user['firstname'];
                    $temp[] = $o_course_user['lastname'];
                } else {
                    $temp[] = $o_course_user['lastname'];
                    $temp[] = $o_course_user['firstname'];
                }
                $temp[] = $o_course_user['username'];
                // Groups.
                $temp[] = implode(', ', $groupsNameListParsed);
                // Status
                $default_status = get_lang('Student');
                if (isset($o_course_user['status_rel']) && $o_course_user['status_rel'] == 1 || isset($o_course_user['status_session']) && $o_course_user['status_session'] == 2) {
                    $default_status = get_lang('CourseManager');
                } elseif (isset($o_course_user['is_tutor']) && $o_course_user['is_tutor'] == 1) {
                    $default_status = get_lang('Tutor');
                }
                $temp[] = $default_status;
                // Active
                $temp[] = $o_course_user['active'];
                if (!empty($extraFields)) {
                    foreach ($extraFields as $extraField) {
                        $extraFieldValue = new ExtraFieldValue('user');
                        $data = $extraFieldValue->get_values_by_handler_and_field_id($user_id, $extraField['id']);
                        $temp[] = $data['value'];
//.........这里部分代码省略.........
开发者ID:KRCM13,项目名称:chamilo-lms,代码行数:101,代码来源:user.php

示例15: isset

 // Note: This can be speed up if we transform the $forum_list
 // to an array that uses the forum_category as the key.
 if (isset($forum['forum_category']) && $forum['forum_category'] == $forumCategory['cat_id']) {
     $show_forum = false;
     // SHOULD WE SHOW THIS PARTICULAR FORUM
     // you are teacher => show forum
     if (api_is_allowed_to_edit(false, true)) {
         $show_forum = true;
     } else {
         // you are not a teacher
         // it is not a group forum => show forum
         // (invisible forums are already left out see get_forums function)
         if ($forum['forum_of_group'] == '0') {
             $show_forum = true;
         } else {
             $show_forum = GroupManager::user_has_access($user_id, $forum['forum_of_group'], GroupManager::GROUP_TOOL_FORUM);
         }
     }
     if ($show_forum) {
         $form_count++;
         $mywhatsnew_post_info = isset($whatsnew_post_info[$forum['forum_id']]) ? $whatsnew_post_info[$forum['forum_id']] : null;
         $html = '<div class="panel panel-default forum">';
         $html .= '<div class="panel-body">';
         $forum_image = '';
         $imgForum = '';
         // Showing the image
         if (!empty($forum['forum_image'])) {
             $image_path = api_get_path(WEB_COURSE_PATH) . api_get_course_path() . '/upload/forum/images/' . $forum['forum_image'];
             $image_size = api_getimagesize($image_path);
             $img_attributes = '';
             if (!empty($image_size)) {
开发者ID:KRCM13,项目名称:chamilo-lms,代码行数:31,代码来源:index.php


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