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


PHP UserManager::getUserPicture方法代码示例

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


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

示例1: get_link_user_picture

 public function get_link_user_picture($username, $password, $id)
 {
     if ($this->verifyUserPass($username, $password) == "valid") {
         $userPic = UserManager::getUserPicture($id);
         if (empty($userPic)) {
             return "0";
         }
         return $userPic;
     }
     return "0";
 }
开发者ID:omaoibrahim,项目名称:chamilo-lms,代码行数:11,代码来源:cm_webservice_user.php

示例2: _api_format_user

/**
 * Formats user information into a standard array
 * This function should be only used inside api_get_user_info()
 *
 * @param array Non-standard user array
 * @param bool $add_password
 *
 * @return array Standard user array
 */
function _api_format_user($user, $add_password = false)
{
    $result = array();
    $firstname = null;
    $lastname = null;
    if (isset($user['firstname']) && isset($user['lastname'])) {
        $firstname = $user['firstname'];
        $lastname = $user['lastname'];
    } elseif (isset($user['firstName']) && isset($user['lastName'])) {
        $firstname = isset($user['firstName']) ? $user['firstName'] : null;
        $lastname = isset($user['lastName']) ? $user['lastName'] : null;
    }
    $result['complete_name'] = api_get_person_name($firstname, $lastname);
    $result['complete_name_with_username'] = $result['complete_name'];
    if (!empty($user['username'])) {
        $result['complete_name_with_username'] = $result['complete_name'] . ' (' . $user['username'] . ')';
    }
    $result['firstname'] = $firstname;
    $result['lastname'] = $lastname;
    // Kept for historical reasons
    $result['firstName'] = $firstname;
    $result['lastName'] = $lastname;
    $attributes = array('phone', 'picture_uri', 'official_code', 'status', 'active', 'auth_source', 'username', 'theme', 'language', 'creator_id', 'registration_date', 'hr_dept_id', 'expiration_date');
    foreach ($attributes as $attribute) {
        $result[$attribute] = isset($user[$attribute]) ? $user[$attribute] : null;
    }
    if (isset($user['email'])) {
        $result['mail'] = isset($user['email']) ? $user['email'] : null;
        $result['email'] = isset($user['email']) ? $user['email'] : null;
    } else {
        $result['mail'] = isset($user['mail']) ? $user['mail'] : null;
        $result['email'] = isset($user['mail']) ? $user['mail'] : null;
    }
    $user_id = intval($user['user_id']);
    // Maintain the user_id index for backwards compatibility
    $result['user_id'] = $result['id'] = $user_id;
    $saveUserLastLogin = api_get_configuration_value('save_user_last_login');
    if ($saveUserLastLogin) {
        $last_login = $user['last_login'];
    } else {
        if (!isset($user['lastLogin']) && !isset($user['last_login'])) {
            $timestamp = Tracking::get_last_connection_date($result['user_id'], false, true);
            // Convert the timestamp back into a datetime
            // NOTE: this timestamp has ALREADY been converted to the local timezone in the get_last_connection_date function
            $last_login = date('Y-m-d H:i:s', $timestamp);
        } else {
            if (isset($user['lastLogin'])) {
                $last_login = $user['lastLogin'];
            } else {
                $last_login = $user['last_login'];
            }
        }
    }
    $result['last_login'] = $last_login;
    // Kept for historical reasons
    $result['lastLogin'] = $last_login;
    // Getting user avatar.
    $originalFile = UserManager::getUserPicture($user_id, USER_IMAGE_SIZE_ORIGINAL, $result);
    $smallFile = UserManager::getUserPicture($user_id, USER_IMAGE_SIZE_SMALL, $result);
    $result['avatar'] = $originalFile;
    $avatarString = explode('?', $originalFile);
    $result['avatar_no_query'] = reset($avatarString);
    $result['avatar_small'] = $smallFile;
    //$result['avatar_sys_path'] = api_get_path(SYS_CODE_PATH).'img/unknown.jpg';
    if (isset($user['user_is_online'])) {
        $result['user_is_online'] = $user['user_is_online'] == true ? 1 : 0;
    }
    if (isset($user['user_is_online_in_chat'])) {
        $result['user_is_online_in_chat'] = intval($user['user_is_online_in_chat']);
    }
    if ($add_password) {
        $result['password'] = $user['password'];
    }
    $result['profile_url'] = api_get_path(WEB_CODE_PATH) . 'social/profile.php?u=' . $user_id;
    if (isset($user['extra'])) {
        $result['extra'] = $user['extra'];
    }
    return $result;
}
开发者ID:feroli1000,项目名称:chamilo-lms,代码行数:88,代码来源:api.lib.php

示例3: display_header_user

 /**
  * @param int $userid
  */
 public static function display_header_user($userid)
 {
     $select_cat = intval($_GET['selectcat']);
     $user_id = $userid;
     $user = api_get_user_info($user_id);
     $catcourse = Category::load($select_cat);
     $scoredisplay = ScoreDisplay::instance();
     $scorecourse = $catcourse[0]->calc_score($user_id);
     // generating the total score for a course
     $allevals = $catcourse[0]->get_evaluations($user_id, true);
     $alllinks = $catcourse[0]->get_links($user_id, true);
     $evals_links = array_merge($allevals, $alllinks);
     $item_value = 0;
     $item_total = 0;
     for ($count = 0; $count < count($evals_links); $count++) {
         $item = $evals_links[$count];
         $score = $item->calc_score($user_id);
         $my_score_denom = $score[1] == 0 ? 1 : $score[1];
         $item_value += $score[0] / $my_score_denom * $item->get_weight();
         $item_total += $item->get_weight();
         //$row[] = $scoredisplay->display_score($score,SCORE_DIV_PERCENT);
     }
     $item_value = number_format($item_value, 2, '.', ' ');
     $total_score = array($item_value, $item_total);
     $scorecourse_display = $scoredisplay->display_score($total_score, SCORE_DIV_PERCENT);
     //$scorecourse_display = (isset($scorecourse) ? $scoredisplay->display_score($scorecourse,SCORE_AVERAGE) : get_lang('NoResultsAvailable'));
     $cattotal = Category::load(0);
     $scoretotal = $cattotal[0]->calc_score($user_id);
     $scoretotal_display = isset($scoretotal) ? $scoredisplay->display_score($scoretotal, SCORE_PERCENT) : get_lang('NoResultsAvailable');
     $imageUrl = UserManager::getUserPicture($userid);
     $info = '<div class="row"><div class="col-md-3">';
     $info .= '<div class="thumbnail"><img src="' . $imageUrl . '" /></div>';
     $info .= '</div>';
     $info .= '<div class="col-md-6">';
     $info .= get_lang('Name') . ' :  <a target="_blank" href="' . api_get_path(WEB_CODE_PATH) . 'social/profile.php?u=' . $userid . '"> ' . $user['complete_name'] . '</a><br />';
     if (api_get_setting('show_email_addresses') == 'true') {
         $info .= get_lang('Email') . ' : <a href="mailto:' . $user['email'] . '">' . $user['email'] . '</a><br />';
     }
     $info .= get_lang('TotalUser') . ' : <b>' . $scorecourse_display . '</b>';
     $info .= '</div>';
     $info .= '</div>';
     echo $info;
 }
开发者ID:secuencia24,项目名称:chamilo-lms,代码行数:46,代码来源:displaygradebook.php

示例4: isset

        }
        $show = isset($_GET['show']) ? '&amp;show=' . Security::remove_XSS($_GET['show']) : '';
        if (isset($_GET['type']) && $_GET['type'] == 'extended') {
            $actions .= '<a href="profile.php?type=reduced' . $show . '">' . Display::return_icon('edit.png', get_lang('EditNormalProfile'), '', 16) . '</a>';
        } else {
            $actions .= '<a href="profile.php?type=extended' . $show . '">' . Display::return_icon('edit.png', get_lang('EditExtendProfile'), '', 16) . '</a>';
        }
        $actions .= '</div>';
    }
}
$show_delete_account_button = api_get_setting('platform_unsubscribe_allowed') == 'true' ? true : false;
$tpl = new Template(get_lang('ModifyProfile'));
$tpl->assign('actions', $actions);
SocialManager::setSocialUserBlock($tpl, $user_id, 'messages');
if (api_get_setting('social.allow_social_tool') == 'true') {
    SocialManager::setSocialUserBlock($tpl, api_get_user_id(), 'home');
    $menu = SocialManager::show_social_menu('home', null, api_get_user_id(), false, $show_delete_account_button);
    $tpl->assign('social_menu_block', $menu);
    $tpl->assign('social_right_content', $form->returnForm());
    $social_layout = $tpl->get_template('social/edit_profile.tpl');
    $tpl->display($social_layout);
} else {
    $bigImage = UserManager::getUserPicture(api_get_user_id(), USER_IMAGE_SIZE_BIG);
    $normalImage = UserManager::getUserPicture(api_get_user_id(), USER_IMAGE_SIZE_ORIGINAL);
    $imageToShow = '<div id="image-message-container">';
    $imageToShow .= '<a class="expand-image" href="' . $bigImage . '" /><img src="' . $normalImage . '"></a>';
    $imageToShow .= '</div>';
    $content = $imageToShow . $form->returnForm();
    $tpl->assign('content', $content);
    $tpl->display_one_col_template();
}
开发者ID:jloguercio,项目名称:chamilo-lms,代码行数:31,代码来源:profile.php

示例5: implode

            $info_course['tutor_name'] = implode(",", $info_tutor_name);
        } elseif ($session_coach_id != 0) {
            $session_coach_id = intval($session_info['id_coach']);
            $coach_info = api_get_user_info($session_coach_id);
            $info_course['tutor_name'] = $coach_info['complete_name'];
        }
        $coachs_name = $info_course['tutor_name'];
        $session_name = $session_info['name'];
    }
    // end
    $info_course = CourseManager::get_course_information($get_course_code);
    $table_title = Display::return_icon('user.png', get_lang('User'), array(), ICON_SIZE_SMALL) . $user_info['complete_name'];
    echo Display::page_subheader($table_title);
    echo '<table width="100%" border="0">';
    echo '<tr>';
    $userPicture = UserManager::getUserPicture($user_info['user_id']);
    echo '<img src="' . $userPicture . '" />';
    echo '</td>';
    ?>
    <td width="40%" valign="top">
        <table width="100%" class="data_table">
            <tr>
                <th><?php 
    echo get_lang('Information');
    ?>
</th>
            </tr>
            <tr>
                <td><?php 
    echo get_lang('Name') . ' : ' . $user_info['complete_name'];
    ?>
开发者ID:omaoibrahim,项目名称:chamilo-lms,代码行数:31,代码来源:myStudents.php

示例6: saveMessage

/**
 * @param string $message
 * @param array $_course
 * @param int $group_id
 * @param int $session_id
 * @param bool $preview
 */
function saveMessage($message, $userId, $_course, $session_id, $group_id, $preview = true)
{
    $userInfo = api_get_user_info($userId);
    $fullName = $userInfo['complete_name'];
    $isMaster = (bool) api_is_course_admin();
    $document_path = api_get_path(SYS_COURSE_PATH) . $_course['path'] . '/document';
    if (!empty($group_id)) {
        $group_info = GroupManager::get_group_properties($group_id);
        $basepath_chat = $group_info['directory'] . '/chat_files';
    } else {
        $basepath_chat = '/chat_files';
    }
    $chat_path = $document_path . $basepath_chat . '/';
    if (!is_dir($chat_path)) {
        if (is_file($chat_path)) {
            @unlink($chat_path);
        }
    }
    $date_now = date('Y-m-d');
    $message = trim($message);
    $timeNow = date('d/m/y H:i:s');
    if (!empty($group_id)) {
        $basename_chat = 'messages-' . $date_now . '_gid-' . $group_id;
    } elseif (!empty($session_id)) {
        $basename_chat = 'messages-' . $date_now . '_sid-' . $session_id;
    } else {
        $basename_chat = 'messages-' . $date_now;
    }
    if (!api_is_anonymous()) {
        if (!empty($message)) {
            Emojione\Emojione::$imagePathPNG = api_get_path(WEB_LIBRARY_PATH) . 'javascript/emojione/png/';
            Emojione\Emojione::$ascii = true;
            // Parsing emojis
            $message = Emojione\Emojione::toImage($message);
            // Parsing text to understand markdown (code highlight)
            $message = MarkdownExtra::defaultTransform($message);
            // Security XSS
            $message = Security::remove_XSS($message);
            if ($preview == true) {
                return $message;
            }
            if (!file_exists($chat_path . $basename_chat . '.log.html')) {
                $doc_id = add_document($_course, $basepath_chat . '/' . $basename_chat . '.log.html', 'file', 0, $basename_chat . '.log.html');
                api_item_property_update($_course, TOOL_DOCUMENT, $doc_id, 'DocumentAdded', $userId, $group_id, null, null, null, $session_id);
                api_item_property_update($_course, TOOL_DOCUMENT, $doc_id, 'invisible', $userId, $group_id, null, null, null, $session_id);
                item_property_update_on_folder($_course, $basepath_chat, $userId);
            } else {
                $doc_id = DocumentManager::get_document_id($_course, $basepath_chat . '/' . $basename_chat . '.log.html');
            }
            $fp = fopen($chat_path . $basename_chat . '.log.html', 'a');
            $userPhoto = UserManager::getUserPicture($userId, USER_IMAGE_SIZE_MEDIUM);
            $filePhoto = '<img class="chat-image" src="' . $userPhoto . '"/>';
            if ($isMaster) {
                fputs($fp, '<div class="message-teacher"><div class="content-message"><div class="chat-message-block-name">' . $fullName . '</div><div class="chat-message-block-content">' . $message . '</div><div class="message-date">' . $timeNow . '</div></div><div class="icon-message"></div>' . $filePhoto . '</div>' . "\n");
            } else {
                fputs($fp, '<div class="message-student">' . $filePhoto . '<div class="icon-message"></div><div class="content-message"><div class="chat-message-block-name">' . $fullName . '</div><div class="chat-message-block-content">' . $message . '</div><div class="message-date">' . $timeNow . '</div></div></div>' . "\n");
            }
            fclose($fp);
            $chat_size = filesize($chat_path . $basename_chat . '.log.html');
            update_existing_document($_course, $doc_id, $chat_size);
            item_property_update_on_folder($_course, $basepath_chat, $userId);
        }
    }
}
开发者ID:secuencia24,项目名称:chamilo-lms,代码行数:71,代码来源:chat_functions.lib.php

示例7: get_lang

        $social_right_content .= get_lang('YouNeedToHaveFriendsInYourSocialNetwork');
    } else {
        $social_right_content .= get_lang('YouAlreadyInviteAllYourContacts');
    }
    $social_right_content .= '<div>';
    $social_right_content .= '<a href="search.php">' . get_lang('TryAndFindSomeFriends') . '</a>';
    $social_right_content .= '</div>';
}
$form = new FormValidator('invitation', 'post', api_get_self() . '?id=' . $group_id);
$form->addHidden('form_sent', 1);
$form->addHidden('id', $group_id);
$group_members_element = $form->addElement('advmultiselect', 'invitation', get_lang('Friends'), $nosessionUsersList, 'style="width: 280px;"');
$form->addButtonSave(get_lang('InviteUsersToGroup'));
$social_right_content .= $form->returnForm();
// Current group members
$members = $usergroup->get_users_by_group($group_id, false, array(GROUP_USER_PERMISSION_PENDING_INVITATION));
if (is_array($members) && count($members) > 0) {
    foreach ($members as &$member) {
        $image = UserManager::getUserPicture($member['user_id']);
        $member['image'] = '<img src="' . $image . '"  width="50px" height="50px"  />';
    }
    $social_right_content .= '<h3>' . get_lang('UsersAlreadyInvited') . '</h3>';
    $social_right_content .= Display::return_sortable_grid('invitation_profile', array(), $members, array('hide_navigation' => true, 'per_page' => 100), array(), false, array(true, false, true, true));
}
$tpl = \Chamilo\CoreBundle\Framework\Container::getTwig();
SocialManager::setSocialUserBlock($tpl, api_get_user_id(), 'groups', $group_id);
$social_menu_block = SocialManager::show_social_menu('member_list', $group_id);
$tpl->addGlobal('social_menu_block', $social_menu_block);
//$tpl->setHelp('Groups');
$tpl->addGlobal('social_right_content', $social_right_content);
echo $tpl->render('@template_style/social/add_groups.html.twig');
开发者ID:omaoibrahim,项目名称:chamilo-lms,代码行数:31,代码来源:group_invitation.php

示例8: get_user_data

/**
 * Get the users to display on the current page (fill the sortable-table)
 * @param   int     offset of first user to recover
 * @param   int     Number of users to get
 * @param   int     Column to sort on
 * @param   string  Order (ASC,DESC)
 * @return  array   A list of users with their data
 * @see SortableTable#get_table_data($from)
 */
function get_user_data($from, $number_of_items, $column, $direction)
{
    $user_table = Database::get_main_table(TABLE_MAIN_USER);
    if (api_is_western_name_order()) {
        $col34 = "u.firstname AS col3,\n                  u.lastname AS col4,";
    } else {
        $col34 = "u.lastname AS col3,\n                  u.firstname AS col4,";
    }
    $sql = "SELECT\n                u.user_id AS col0,\n                u.official_code AS col2,\n                {$col34}\n                u.username AS col5,\n                u.email AS col6,\n                u.status AS col7,\n                u.active AS col8,\n                u.user_id AS col9 ,\n                u.expiration_date AS exp\n            FROM {$user_table} u ";
    if (isset($_GET['keyword'])) {
        $keyword = Database::escape_string(trim($_GET['keyword']));
        $sql .= " WHERE (u.firstname LIKE '%{$keyword}%' OR\n                  u.lastname LIKE '%{$keyword}%' OR\n                  concat(u.firstname,' ',u.lastname) LIKE '%{$keyword}%' OR\n                  concat(u.lastname,' ',u.firstname) LIKE '%{$keyword}%' OR\n                  u.username LIKE '%{$keyword}%'  OR\n                  u.official_code LIKE '%{$keyword}%' OR\n                  u.email LIKE '%{$keyword}%' )";
    }
    if (!in_array($direction, array('ASC', 'DESC'))) {
        $direction = 'ASC';
    }
    $column = intval($column);
    $from = intval($from);
    $number_of_items = intval($number_of_items);
    $sql .= " ORDER BY col{$column} {$direction} ";
    $sql .= " LIMIT {$from}, {$number_of_items}";
    $res = Database::query($sql);
    $users = array();
    while ($user = Database::fetch_row($res)) {
        $user_id = $user[0];
        $userPicture = UserManager::getUserPicture($user_id);
        $photo = '<img src="' . $userPicture . '" alt="' . api_get_person_name($user[2], $user[3]) . '" title="' . api_get_person_name($user[2], $user[3]) . '" />';
        $button = '<a  href="javascript:void(0)" onclick="load_course_list(\'div_' . $user_id . '\',' . $user_id . ', \'' . $user[5] . '\')">' . Display::return_icon('view_more_stats.gif', get_lang('Info')) . '</a>&nbsp;&nbsp;';
        $users[] = array($photo, $user_id, $user[2], $user[3], $user[4], $user[5], $button);
    }
    return $users;
}
开发者ID:KRCM13,项目名称:chamilo-lms,代码行数:41,代码来源:new_ticket.php

示例9: _api_format_user

/**
 * Formats user information into a standard array
 * This function should be only used inside api_get_user_info()
 *
 * @param array Non-standard user array
 * @param bool $add_password
 *
 * @return array Standard user array
 */
function _api_format_user($user, $add_password = false)
{
    $result = array();
    $firstname = null;
    $lastname = null;
    if (isset($user['firstname']) && isset($user['lastname'])) {
        $firstname = $user['firstname'];
        $lastname = $user['lastname'];
    } elseif (isset($user['firstName']) && isset($user['lastName'])) {
        $firstname = isset($user['firstName']) ? $user['firstName'] : null;
        $lastname = isset($user['lastName']) ? $user['lastName'] : null;
    }
    $result['complete_name'] = api_get_person_name($firstname, $lastname);
    $result['complete_name_with_username'] = $result['complete_name'];
    if (!empty($user['username'])) {
        $result['complete_name_with_username'] = $result['complete_name'] . ' (' . $user['username'] . ')';
    }
    $result['firstname'] = $firstname;
    $result['lastname'] = $lastname;
    // Kept for historical reasons
    $result['firstName'] = $firstname;
    $result['lastName'] = $lastname;
    $attributes = array('phone', 'picture_uri', 'official_code', 'status', 'active', 'auth_source', 'username', 'theme', 'language', 'creator_id', 'registration_date', 'hr_dept_id', 'expiration_date', 'last_login');
    foreach ($attributes as $attribute) {
        $result[$attribute] = isset($user[$attribute]) ? $user[$attribute] : null;
    }
    if (isset($user['email'])) {
        $result['mail'] = isset($user['email']) ? $user['email'] : null;
        $result['email'] = isset($user['email']) ? $user['email'] : null;
    } else {
        $result['mail'] = isset($user['mail']) ? $user['mail'] : null;
        $result['email'] = isset($user['mail']) ? $user['mail'] : null;
    }
    $user_id = intval($user['user_id']);
    // Maintain the user_id index for backwards compatibility
    $result['user_id'] = $result['id'] = $user_id;
    $result['last_login'] = $user['last_login'];
    // Getting user avatar.
    $originalFile = UserManager::getUserPicture($user_id, USER_IMAGE_SIZE_ORIGINAL, $result);
    $smallFile = UserManager::getUserPicture($user_id, USER_IMAGE_SIZE_SMALL, $result);
    $result['avatar'] = $originalFile;
    $avatarString = explode('?', $originalFile);
    $result['avatar_no_query'] = reset($avatarString);
    $result['avatar_small'] = $smallFile;
    if (isset($user['user_is_online'])) {
        $result['user_is_online'] = $user['user_is_online'] == true ? 1 : 0;
    }
    if (isset($user['user_is_online_in_chat'])) {
        $result['user_is_online_in_chat'] = intval($user['user_is_online_in_chat']);
    }
    if ($add_password) {
        $result['password'] = $user['password'];
    }
    $result['profile_url'] = api_get_path(WEB_CODE_PATH) . 'social/profile.php?u=' . $user_id;
    if (isset($user['extra'])) {
        $result['extra'] = $user['extra'];
    }
    return $result;
}
开发者ID:jloguercio,项目名称:chamilo-lms,代码行数:68,代码来源:api.lib.php

示例10: count

 $friend_html = '';
 $number_of_images = 8;
 $number_friends = count($friends);
 if ($number_friends != 0) {
     $number_loop = $number_friends / $number_of_images;
     $loop_friends = ceil($number_loop);
     $j = 0;
     for ($k = 0; $k < $loop_friends; $k++) {
         if ($j == $number_of_images) {
             $number_of_images = $number_of_images * 2;
         }
         while ($j < $number_of_images) {
             if (isset($friends[$j])) {
                 $friend = $friends[$j];
                 $user_name = api_xml_http_response_encode($friend['firstName'] . ' ' . $friend['lastName']);
                 $userPicture = UserManager::getUserPicture($friend['friend_user_id']);
                 $friend_html .= '
                     <div class="col-md-3">
                         <div class="thumbnail text-center" id="div_' . $friends[$j]['friend_user_id'] . '">
                             <img src="' . $userPicture . '" class="img-responsive" id="imgfriend_' . $friend['friend_user_id'] . '" title="$user_name">
                             <div class="caption">
                                 <h3>
                                     <a href="profile.php?u=' . $friend['friend_user_id'] . '">' . $user_name . '</a>
                                 </h3>
                                 <p>
                                     <button class="btn btn-danger" onclick="delete_friend(this)" id=img_' . $friend['friend_user_id'] . '>
                                         ' . get_lang('Delete') . '
                                     </button>
                                 </p>
                             </div>
                         </div>
开发者ID:secuencia24,项目名称:chamilo-lms,代码行数:31,代码来源:social.ajax.php

示例11: auto_add_page_users

 /**
  * Function wizard individual assignment
  * @author Juan Carlos Raña <herodoto@telefonica.net>
  */
 public function auto_add_page_users($values)
 {
     $assignment_type = $values['assignment'];
     $session_id = $this->session_id;
     $groupId = api_get_group_id();
     if ($groupId == 0) {
         //extract course members
         if (!empty($session_id)) {
             $a_users_to_add = CourseManager::get_user_list_from_course_code(api_get_course_id(), $session_id);
         } else {
             $a_users_to_add = CourseManager::get_user_list_from_course_code(api_get_course_id(), 0);
         }
     } else {
         //extract group members
         $subscribed_users = GroupManager::get_subscribed_users($groupId);
         $subscribed_tutors = GroupManager::get_subscribed_tutors($groupId);
         $a_users_to_add_with_duplicates = array_merge($subscribed_users, $subscribed_tutors);
         //remove duplicates
         $a_users_to_add = $a_users_to_add_with_duplicates;
         //array_walk($a_users_to_add, create_function('&$value,$key', '$value = json_encode($value);'));
         $a_users_to_add = array_unique($a_users_to_add);
         //array_walk($a_users_to_add, create_function('&$value,$key', '$value = json_decode($value, true);'));
     }
     $all_students_pages = array();
     // Data about teacher
     $userId = api_get_user_id();
     $userinfo = api_get_user_info($userId);
     $username = api_htmlentities(sprintf(get_lang('LoginX'), $userinfo['username'], ENT_QUOTES));
     $name = $userinfo['complete_name'] . " - " . $username;
     $photo = '<img src="' . $userinfo['avatar'] . '" alt="' . $name . '"  width="40" height="50" align="top" title="' . $name . '"  />';
     // teacher assignment title
     $title_orig = $values['title'];
     // teacher assignment reflink
     $link2teacher = $values['title'] = $title_orig . "_uass" . $userId;
     // first: teacher name, photo, and assignment description (original content)
     $content_orig_A = '<div align="center" style="background-color: #F5F8FB; border:solid; border-color: #E6E6E6">
     <table border="0">
         <tr><td style="font-size:24px">' . get_lang('AssignmentDesc') . '</td></tr>
         <tr><td>' . $photo . '<br />' . Display::tag('span', api_get_person_name($userinfo['firstname'], $userinfo['lastname']), array('title' => $username)) . '</td></tr>
     </table></div>';
     $content_orig_B = '<br/><div align="center" style="font-size:24px">' . get_lang('AssignmentDescription') . ': ' . $title_orig . '</div><br/>' . $_POST['content'];
     //Second: student list (names, photo and links to their works).
     //Third: Create Students work pages.
     foreach ($a_users_to_add as $o_user_to_add) {
         if ($o_user_to_add['user_id'] != $userId) {
             // except that puts the task
             $assig_user_id = $o_user_to_add['user_id'];
             // identifies each page as created by the student, not by teacher
             $userPicture = UserManager::getUserPicture($assig_user_id);
             $username = api_htmlentities(sprintf(get_lang('LoginX'), $o_user_to_add['username'], ENT_QUOTES));
             $name = api_get_person_name($o_user_to_add['firstname'], $o_user_to_add['lastname']) . " . " . $username;
             $photo = '<img src="' . $userPicture . '" alt="' . $name . '"  width="40" height="50" align="bottom" title="' . $name . '"  />';
             $is_tutor_of_group = GroupManager::is_tutor_of_group($assig_user_id, $groupId);
             //student is tutor
             $is_tutor_and_member = GroupManager::is_tutor_of_group($assig_user_id, $groupId) && GroupManager::is_subscribed($assig_user_id, $groupId);
             // student is tutor and member
             if ($is_tutor_and_member) {
                 $status_in_group = get_lang('GroupTutorAndMember');
             } else {
                 if ($is_tutor_of_group) {
                     $status_in_group = get_lang('GroupTutor');
                 } else {
                     $status_in_group = " ";
                     //get_lang('GroupStandardMember')
                 }
             }
             if ($assignment_type == 1) {
                 $values['title'] = $title_orig;
                 $values['content'] = '<div align="center" style="background-color: #F5F8FB; border:solid; border-color: #E6E6E6">
                 <table border="0">
                 <tr><td style="font-size:24px">' . get_lang('AssignmentWork') . '</td></tr>
                 <tr><td>' . $photo . '<br />' . $name . '</td></tr></table>
                 </div>[[' . $link2teacher . ' | ' . get_lang('AssignmentLinktoTeacherPage') . ']] ';
                 //If $content_orig_B is added here, the task written by the professor was copied to the page of each student. TODO: config options
                 // AssignmentLinktoTeacherPage
                 $all_students_pages[] = '<li>' . Display::tag('span', strtoupper($o_user_to_add['lastname']) . ', ' . $o_user_to_add['firstname'], array('title' => $username)) . ' [[' . $_POST['title'] . "_uass" . $assig_user_id . ' | ' . $photo . ']] ' . $status_in_group . '</li>';
                 //don't change this line without guaranteeing that users will be ordered by last names in the following format (surname, name)
                 $values['assignment'] = 2;
             }
             $this->assig_user_id = $assig_user_id;
             self::save_new_wiki($values);
         }
     }
     foreach ($a_users_to_add as $o_user_to_add) {
         if ($o_user_to_add['user_id'] == $userId) {
             $assig_user_id = $o_user_to_add['user_id'];
             if ($assignment_type == 1) {
                 $values['title'] = $title_orig;
                 $values['comment'] = get_lang('AssignmentDesc');
                 sort($all_students_pages);
                 $values['content'] = $content_orig_A . $content_orig_B . '<br/>
                 <div align="center" style="font-size:18px; background-color: #F5F8FB; border:solid; border-color:#E6E6E6">
                 ' . get_lang('AssignmentLinkstoStudentsPage') . '
                 </div><br/>
                 <div style="background-color: #F5F8FB; border:solid; border-color:#E6E6E6">
                 <ol>' . implode($all_students_pages) . '</ol>
//.........这里部分代码省略.........
开发者ID:daffef,项目名称:chamilo-lms,代码行数:101,代码来源:wiki.inc.php

示例12: api_get_path

            exit;
            break;
    }
}
Display::display_header($tool_name);
echo '<div class="actions">
        <a href="' . api_get_path(WEB_CODE_PATH) . 'mySpace/myStudents.php?student=' . intval($_GET['user_id']) . '" title="' . get_lang('Reporting') . '">' . Display::return_icon('statistics.png', get_lang('Reporting'), '', ICON_SIZE_MEDIUM) . '
        </a>
        ' . $login_as_icon . '
        ' . $editUser . '
        ' . $exportLink . '
        ' . $vCardExportLink . '
    </div>';
echo Display::page_header($tool_name);
$fullUrlBig = UserManager::getUserPicture($user['user_id'], USER_IMAGE_SIZE_BIG);
$fullUrl = UserManager::getUserPicture($user['user_id'], USER_IMAGE_SIZE_ORIGINAL);
echo '<div class="row">';
echo '<div class="col-md-2">';
echo '<a class="expand-image" href="' . $fullUrlBig . '">' . '<img src="' . $fullUrl . '" /></a><br />';
echo '</div>';
echo $message;
echo '<div class="col-md-5">';
echo $userInformation;
echo '</div>';
echo '<div class="col-md-5">';
echo $trackingInformation;
echo '</div>';
echo '</div>';
echo Display::page_subheader(get_lang('SessionList'));
echo $sessionInformation;
echo $courseInformation;
开发者ID:omaoibrahim,项目名称:chamilo-lms,代码行数:31,代码来源:user_information.php

示例13: getWorkComments

/**
 * @param array $work
 * @return array
 */
function getWorkComments($work)
{
    $commentTable = Database::get_course_table(TABLE_STUDENT_PUBLICATION_ASSIGNMENT_COMMENT);
    $userTable = Database::get_main_table(TABLE_MAIN_USER);
    $courseId = intval($work['c_id']);
    $workId = intval($work['id']);
    if (empty($courseId) || empty($workId)) {
        return array();
    }
    $sql = "SELECT\n            c.id, c.user_id, u.firstname, u.lastname, u.username, u.picture_uri\n            FROM {$commentTable} c\n            INNER JOIN {$userTable} u ON (u.user_id = c.user_id)\n            WHERE c_id = {$courseId} AND work_id = {$workId}\n            ORDER BY sent_at\n            ";
    $result = Database::query($sql);
    $comments = Database::store_result($result, 'ASSOC');
    if (!empty($comments)) {
        foreach ($comments as &$comment) {
            $comment['picture'] = UserManager::getUserPicture($comment['user_id']);
            $commentInfo = getWorkComment($comment['id']);
            if (!empty($commentInfo)) {
                $comment = array_merge($comment, $commentInfo);
            }
        }
    }
    return $comments;
}
开发者ID:omaoibrahim,项目名称:chamilo-lms,代码行数:27,代码来源:work.lib.php

示例14: ExtraFieldValue

$fieldTagsRepo = $entityManager->getRepository('ChamiloCoreBundle:ExtraFieldRelTag');
$userRepo = $entityManager->getRepository('ChamiloUserBundle:User');
$sequenceResourceRepo = $entityManager->getRepository('ChamiloCoreBundle:SequenceResource');
$tagField = $fieldsRepo->findOneBy(['extraFieldType' => ExtraField::COURSE_FIELD_TYPE, 'variable' => 'tags']);
$courseValues = new ExtraFieldValue('course');
$userValues = new ExtraFieldValue('user');
$sessionValues = new ExtraFieldValue('session');
foreach ($sessionCourses as $sessionCourse) {
    $courseTags = [];
    if (!is_null($tagField)) {
        $courseTags = $fieldTagsRepo->getTags($tagField, $sessionCourse->getId());
    }
    $courseCoaches = $userRepo->getCoachesForSessionCourse($session, $sessionCourse);
    $coachesData = [];
    foreach ($courseCoaches as $courseCoach) {
        $coachData = ['complete_name' => $courseCoach->getCompleteName(), 'image' => UserManager::getUserPicture($courseCoach->getId(), USER_IMAGE_SIZE_ORIGINAL), 'extra_fields' => $userValues->getAllValuesForAnItem($courseCoach->getId(), true)];
        $coachesData[] = $coachData;
    }
    $courseDescriptionTools = $entityManager->getRepository('ChamiloCourseBundle:CCourseDescription')->findBy(['cId' => $sessionCourse->getId(), 'sessionId' => 0], ['id' => 'DESC', 'descriptionType' => 'ASC']);
    $courseDescription = $courseObjectives = $courseTopics = null;
    foreach ($courseDescriptionTools as $descriptionTool) {
        switch ($descriptionTool->getDescriptionType()) {
            case CCourseDescription::TYPE_DESCRIPTION:
                $courseDescription = $descriptionTool;
                break;
            case CCourseDescription::TYPE_OBJECTIVES:
                $courseObjectives = $descriptionTool;
                break;
            case CCourseDescription::TYPE_TOPICS:
                $courseTopics = $descriptionTool;
                break;
开发者ID:omaoibrahim,项目名称:chamilo-lms,代码行数:31,代码来源:about.php

示例15: get_lang

            if (in_array($user_role, array(GROUP_USER_PERMISSION_ADMIN, GROUP_USER_PERMISSION_MODERATOR))) {
                $user['link'] = '<a href="group_members.php?id=' . $group_id . '&u=' . $user['id'] . '&action=delete">' . Display::return_icon('delete.png', get_lang('DeleteFromGroup')) . '</a>' . '<a href="group_members.php?id=' . $group_id . '&u=' . $user['id'] . '&action=set_moderator">' . Display::return_icon('social_moderator_add.png', get_lang('AddModerator')) . '</a>';
            }
            break;
        case GROUP_USER_PERMISSION_PENDING_INVITATION:
            $user['link'] = '<a href="group_members.php?id=' . $group_id . '&u=' . $user['id'] . '&action=add">' . Display::return_icon('pending_invitation.png', get_lang('PendingInvitation')) . '</a>';
            break;
        case GROUP_USER_PERMISSION_MODERATOR:
            $user['link'] = Display::return_icon('social_group_moderator.png', get_lang('Moderator'));
            //only group admin can manage moderators
            if ($user_role == GROUP_USER_PERMISSION_ADMIN) {
                $user['link'] .= '<a href="group_members.php?id=' . $group_id . '&u=' . $user['id'] . '&action=delete_moderator">' . Display::return_icon('social_moderator_delete.png', get_lang('DeleteModerator')) . '</a>';
            }
            break;
    }
    $userPicture = UserManager::getUserPicture($user['id']);
    $user['image'] = '<img src="' . $userPicture . '"  width="50px" height="50px"  />';
    $new_member_list[] = $user;
}
if (count($new_member_list) > 0) {
    $social_right_content .= Display::return_sortable_grid('list_members', array(), $new_member_list, array('hide_navigation' => true, 'per_page' => 100), array(), false, array(true, false, true, true, false, true, true));
}
$tpl = \Chamilo\CoreBundle\Framework\Container::getTwig();
//$tpl->setHelp('Groups');
$tpl->addGlobal('social_avatar_block', $social_avatar_block);
$tpl->addGlobal('social_menu_block', $social_menu_block);
$tpl->addGlobal('social_right_content', $social_right_content);
$tpl->addGlobal('social_search_block', '');
$tpl->addGlobal('social_skill_block', '');
$tpl->addGlobal('social_group_block', '');
$tpl->addGlobal('social_auto_extend_link', '');
开发者ID:jloguercio,项目名称:chamilo-lms,代码行数:31,代码来源:group_members.php


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