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


PHP Display::span方法代码示例

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


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

示例1: listMyFriends

 /**
  * @param int $user_id
  * @param $link_shared
  * @param $show_full_profile
  * @return string
  */
 public static function listMyFriends($user_id, $link_shared, $show_full_profile)
 {
     //SOCIALGOODFRIEND , USER_RELATION_TYPE_FRIEND, USER_RELATION_TYPE_PARENT
     $friends = SocialManager::get_friends($user_id, USER_RELATION_TYPE_FRIEND);
     $number_of_images = 30;
     $number_friends = count($friends);
     $friendHtml = '';
     if ($number_friends != 0) {
         if ($number_friends > $number_of_images) {
             if (api_get_user_id() == $user_id) {
                 $friendHtml .= ' <span><a href="friends.php">' . get_lang('SeeAll') . '</a></span>';
             } else {
                 $friendHtml .= ' <span>' . '<a href="' . api_get_path(WEB_CODE_PATH) . 'social/profile_friends_and_groups.inc.php' . '?view=friends&height=390&width=610&user_id=' . $user_id . '"' . 'class="ajax" data-title="' . get_lang('SeeAll') . '" title="' . get_lang('SeeAll') . '" >' . get_lang('SeeAll') . '</a></span>';
             }
         }
         $friendHtml .= '<ul class="nav nav-list">';
         $j = 1;
         for ($k = 0; $k < $number_friends; $k++) {
             if ($j > $number_of_images) {
                 break;
             }
             if (isset($friends[$k])) {
                 $friend = $friends[$k];
                 $name_user = api_get_person_name($friend['firstName'], $friend['lastName']);
                 $user_info_friend = api_get_user_info($friend['friend_user_id'], true);
                 if ($user_info_friend['user_is_online']) {
                     $statusIcon = Display::span('', array('class' => 'online_user_in_text'));
                 } else {
                     $statusIcon = Display::span('', array('class' => 'offline_user_in_text'));
                 }
                 $friendHtml .= '<li>';
                 $friendHtml .= '<div>';
                 // the height = 92 must be the same in the image_friend_network span style in default.css
                 $friends_profile = UserManager::getUserPicture($friend['friend_user_id'], USER_IMAGE_SIZE_SMALL);
                 $friendHtml .= '<img src="' . $friends_profile . '" id="imgfriend_' . $friend['friend_user_id'] . '" title="' . $name_user . '"/>';
                 $link_shared = empty($link_shared) ? '' : '&' . $link_shared;
                 $friendHtml .= $statusIcon . '<a href="profile.php?' . 'u=' . $friend['friend_user_id'] . $link_shared . '">' . $name_user . '</a>';
                 $friendHtml .= '</div>';
                 $friendHtml .= '</li>';
             }
             $j++;
         }
         $friendHtml .= '</ul>';
     } else {
         $friendHtml .= '<div class="">' . get_lang('NoFriendsInYourContactList') . '<br />' . '<a class="btn btn-primary" href="' . api_get_path(WEB_PATH) . 'whoisonline.php"><em class="fa fa-search"></em> ' . get_lang('TryAndFindSomeFriends') . '</a></div>';
     }
     $friendHtml = Display::panel($friendHtml, get_lang('SocialFriend') . ' (' . $number_friends . ')');
     return $friendHtml;
 }
开发者ID:jloguercio,项目名称:chamilo-lms,代码行数:55,代码来源:social.lib.php

示例2: return_rating_system

    /**
     * Return the five star HTML
     *
     * @param  string  id of the rating ul element
     * @param  string  url that will be added (for jquery see hot_courses.tpl)
     * @param	string	point info array see function CourseManager::get_course_ranking()
     * @param	bool	add a div wrapper
     * @todo	use     templates
     **/
    public static function return_rating_system($id, $url, $point_info = array(), $add_div_wrapper = true)
    {
        $number_of_users_who_voted = isset($point_info['users_who_voted']) ? $point_info['users_who_voted'] : null;
        $percentage = isset($point_info['point_average']) ? $point_info['point_average'] : 0;
        if (!empty($percentage)) {
            $percentage = $percentage * 125 / 100;
        }
        $accesses = isset($point_info['accesses']) ? $point_info['accesses'] : 0;
        $star_label = sprintf(get_lang('XStarsOutOf5'), $point_info['point_average_star']);
        $html = '<ul id="' . $id . '" class="star-rating">
					<li class="current-rating" style="width:' . $percentage . 'px;"></li>
					<li><a href="javascript:void(0);" data-link="' . $url . '&amp;star=1" title="' . $star_label . '" class="one-star">1</a></li>
					<li><a href="javascript:void(0);" data-link="' . $url . '&amp;star=2" title="' . $star_label . '" class="two-stars">2</a></li>
					<li><a href="javascript:void(0);" data-link="' . $url . '&amp;star=3" title="' . $star_label . '" class="three-stars">3</a></li>
					<li><a href="javascript:void(0);" data-link="' . $url . '&amp;star=4" title="' . $star_label . '" class="four-stars">4</a></li>
					<li><a href="javascript:void(0);" data-link="' . $url . '&amp;star=5" title="' . $star_label . '" class="five-stars">5</a></li>
				</ul>';
        $labels = array();
        $labels[] = $number_of_users_who_voted == 1 ? $number_of_users_who_voted . ' ' . get_lang('Vote') : $number_of_users_who_voted . ' ' . get_lang('Votes');
        $labels[] = $accesses == 1 ? $accesses . ' ' . get_lang('Visit') : $accesses . ' ' . get_lang('Visits');
        if (!empty($number_of_users_who_voted)) {
            $labels[] = get_lang('Average') . ' ' . $point_info['point_average_star'] . '/5';
        }
        $labels[] = $point_info['user_vote'] ? get_lang('YourVote') . ' [' . $point_info['user_vote'] . ']' : get_lang('YourVote') . ' [?] ';
        if (!$add_div_wrapper && api_is_anonymous()) {
            $labels[] = Display::tag('span', get_lang('LoginToVote'), array('class' => 'error'));
        }
        $html .= Display::span(implode(' | ', $labels), array('id' => 'vote_label_' . $id, 'class' => 'vote_label_info'));
        $html .= ' ' . Display::span(' ', array('id' => 'vote_label2_' . $id));
        if ($add_div_wrapper) {
            $html = Display::div($html, array('id' => 'rating_wrapper_' . $id));
        }
        return $html;
    }
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:43,代码来源:display.lib.php

示例3: get_work_user_list


//.........这里部分代码省略.........
                $qualification_exists = true;
            }
            $qualification_string = '';
            if ($qualification_exists) {
                if ($work['qualification'] == '') {
                    $qualification_string = Display::label('-');
                } else {
                    $label = 'info';
                    $relativeScore = $work['qualification'] / $work_data['qualification'];
                    if ($relativeScore < 0.5) {
                        $label = 'important';
                    } elseif ($relativeScore < 0.75) {
                        $label = 'warning';
                    }
                    $qualification_string = Display::label($work['qualification'] . ' / ' . $work_data['qualification'], $label);
                }
            }
            $work['qualification_score'] = $work['qualification'];
            $add_string = '';
            $time_expires = '';
            if (!empty($work_assignment['expires_on'])) {
                $time_expires = api_strtotime($work_assignment['expires_on'], 'UTC');
            }
            if (!empty($work_assignment['expires_on']) && !empty($time_expires) && $time_expires < api_strtotime($work['sent_date'], 'UTC')) {
                $add_string = Display::label(get_lang('Expired'), 'important');
            }
            if ($can_read && $work['accepted'] == '1' || $is_author && in_array($work['accepted'], array('1', '0')) || ($is_allowed_to_edit || api_is_drh())) {
                // Firstname, lastname, username
                $work['firstname'] = Display::div($work['firstname'], array('class' => $class));
                $work['lastname'] = Display::div($work['lastname'], array('class' => $class));
                $work['title_clean'] = $work['title'];
                if (strlen($work['title']) > 30) {
                    $short_title = substr($work['title'], 0, 27) . '...';
                    $work['title'] = Display::span($short_title, array('class' => $class, 'title' => $work['title']));
                } else {
                    $work['title'] = Display::div($work['title'], array('class' => $class));
                }
                // Type.
                $work['type'] = DocumentManager::build_document_icon_tag('file', $work['url']);
                // File name.
                $link_to_download = null;
                // If URL is present then there's a file to download keep BC.
                if ($work['contains_file'] || !empty($work['url'])) {
                    $link_to_download = '<a href="' . $url . 'download.php?id=' . $item_id . '&' . api_get_cidreq() . '">' . Display::return_icon('save.png', get_lang('Save'), array(), ICON_SIZE_SMALL) . '</a> ';
                }
                $send_to = Portfolio::share('work', $work['id'], array('style' => 'white-space:nowrap;'));
                $feedback = null;
                $count = getWorkCommentCount($item_id, $course_info);
                if (!is_null($count) && !empty($count)) {
                    if ($qualification_exists) {
                        $feedback .= "<br />";
                    }
                    $feedback .= '<a href="' . $url . 'view.php?' . api_get_cidreq() . '&id=' . $item_id . '" title="' . get_lang('View') . '">' . Display::label($count . ' ' . get_lang('Feedback'), 'info') . '</a> ';
                }
                $work['qualification'] = $qualification_string . $feedback;
                $work['qualification_only'] = $qualification_string;
                // Date.
                $work_date = api_convert_and_format_date($work['sent_date']);
                $work['sent_date_from_db'] = $work['sent_date'];
                $work['sent_date'] = '<div class="date-time">' . date_to_str_ago(api_get_local_time($work['sent_date'])) . ' ' . $add_string . ' ' . $work_date . '</div>';
                // Actions.
                $correction = '';
                $action = '';
                if (api_is_allowed_to_edit()) {
                    if (!empty($work['url_correction'])) {
                        $action .= Display::url(Display::return_icon('check-circle.png', get_lang('Correction'), null, ICON_SIZE_SMALL), api_get_path(WEB_CODE_PATH) . 'work/download.php?id=' . $item_id . '&' . api_get_cidreq() . '&correction=1');
开发者ID:omaoibrahim,项目名称:chamilo-lms,代码行数:67,代码来源:work.lib.php

示例4: showlinksofcategory

 /**
  * Displays all the links of a given category.
  * @author Patrick Cool <patrick.cool@UGent.be>, Ghent University
  */
 public static function showlinksofcategory($catid)
 {
     global $token;
     $_user = api_get_user_info();
     $course_id = api_get_course_int_id();
     $session_id = api_get_session_id();
     $catid = intval($catid);
     $tbl_link = Database::get_course_table(TABLE_LINK);
     $TABLE_ITEM_PROPERTY = Database::get_course_table(TABLE_ITEM_PROPERTY);
     // Condition for the session.
     $condition_session = api_get_session_condition($session_id, true, true, 'link.session_id');
     $content = '';
     $sql = "SELECT *, link.id FROM {$tbl_link} link\n                INNER JOIN {$TABLE_ITEM_PROPERTY} itemproperties\n                ON (link.id=itemproperties.ref AND link.c_id = itemproperties.c_id )\n                WHERE\n                    itemproperties.tool='" . TOOL_LINK . "' AND\n                    link.category_id='" . $catid . "' AND\n                    (itemproperties.visibility='0' OR itemproperties.visibility='1')\n                    {$condition_session} AND\n                    link.c_id = " . $course_id . " AND\n                    itemproperties.c_id = " . $course_id . "\n                ORDER BY link.display_order DESC";
     $result = Database::query($sql);
     $numberoflinks = Database::num_rows($result);
     if ($numberoflinks > 0) {
         $content .= '<div class="link list-group">';
         $i = 1;
         while ($myrow = Database::fetch_array($result)) {
             // Validation when belongs to a session.
             $session_img = api_get_session_image($myrow['session_id'], $_user['status']);
             //$css_class = $i % 2 == 0 ? $css_class = 'row_odd' : $css_class = 'row_even';
             $toolbar = '';
             $link_validator = '';
             if (api_is_allowed_to_edit(null, true)) {
                 $toolbar .= Display::toolbarButton('', '#', 'retweet', 'default btn-sm', array('onclick' => "check_url('" . $myrow['id'] . "', '" . addslashes($myrow['url']) . "');", 'title' => get_lang('CheckURL')));
                 $link_validator .= Display::span('', array('id' => 'url_id_' . $myrow['id'], 'class' => 'check-link'));
             }
             if (api_is_allowed_to_edit(null, true)) {
                 if ($session_id == $myrow['session_id']) {
                     $url = api_get_self() . '?' . api_get_cidreq() . '&action=editlink&category=' . (!empty($category) ? $category : '') . '&id=' . $myrow['id'] . '&category_id=' . $myrow['id'];
                     $title = get_lang('Edit');
                     $toolbar .= Display::toolbarButton('', $url, 'pencil', 'default btn-sm', array('title' => $title));
                     // DISPLAY MOVE UP COMMAND only if it is not the top link.
                     /* commented at least since 2014-10-11
                                             if ($i != 1) {
                                                 echo '<a href="' . api_get_self() . '?' . api_get_cidreq() .  '&sec_token='.$token.'&urlview=' . $urlview . '&up=', $myrow[0], '" title="' . get_lang('Up') . '">' . Display :: return_icon('up.png', get_lang('Up'), array (), ICON_SIZE_SMALL) . '', "</a>\n";
                                             } else {
                                                 echo Display :: return_icon('up_na.png', get_lang('Up'), array (), ICON_SIZE_SMALL) . '</a>';
                                             }
                     
                                             // DISPLAY MOVE DOWN COMMAND only if it is not the bottom link.
                                             if ($i < $numberoflinks) {
                                                 echo '<a href="' . api_get_self() . '?' . api_get_cidreq() .  '&sec_token='.$token.'&urlview=' . $urlview . '&down=' . $myrow[0] . '" title="' . get_lang('Down') . '">' . Display :: return_icon('down.png', get_lang('Down'), array (), ICON_SIZE_SMALL) . '', "</a>\n";
                                             } else {
                                                 echo Display :: return_icon('down_na.png', get_lang('Down'), array (), ICON_SIZE_SMALL) . '', "</a>\n";
                                             }*/
                     if ($myrow['visibility'] == '1') {
                         $url .= 'link.php?' . api_get_cidreq() . '&sec_token=' . $token . '&action=invisible&id=' . $myrow['id'] . '&scope=link&category_id=' . $myrow['category_id'];
                         $title = get_lang('MakeInvisible');
                         $toolbar .= Display::toolbarButton('', $url, 'eye', 'default btn-sm', array('title' => $title));
                     }
                     if ($myrow['visibility'] == '0') {
                         $url .= 'link.php?' . api_get_cidreq() . '&sec_token=' . $token . '&action=visible&id=' . $myrow['id'] . '&scope=link&category_id=' . $myrow['category_id'];
                         $title = get_lang('MakeVisible');
                         $toolbar .= Display::toolbarButton('', $url, 'eye-slash', 'primary btn-sm', array('title' => $title));
                     }
                     $url .= api_get_self() . '?' . api_get_cidreq() . '&sec_token=' . $token . '&action=deletelink&id=' . $myrow['id'] . '&category_id=' . $myrow['category_id'];
                     $event = "javascript: if(!confirm('" . get_lang('LinkDelconfirm') . "'))return false;";
                     $title = get_lang('Delete');
                     $toolbar .= Display::toolbarButton('', $url, 'trash', 'default btn-sm', array('onclick' => $event, 'title' => $title));
                 } else {
                     $title = get_lang('EditionNotAvailableFromSession');
                     $toolbar .= Display::toolbarButton('', '#', 'trash-o', 'default btn-sm', array('title' => $title));
                 }
             }
             $iconLink = Display::return_icon('url.png', get_lang('Link'), null, ICON_SIZE_SMALL);
             if ($myrow['visibility'] == '1') {
                 $content .= '<div class="list-group-item">';
                 $content .= '<div class="pull-right"><div class="btn-group">' . $toolbar . '</div></div>';
                 $content .= '<h4 class="list-group-item-heading">';
                 $content .= $iconLink;
                 $url = 'link_goto.php?' . api_get_cidreq() . '&link_id=' . $myrow['id'] . '&link_url=' . urlencode($myrow['url']);
                 $content .= Display::tag('a', Security::remove_XSS($myrow['title']), array('href' => $url, 'target' => $myrow['target']));
                 $content .= $link_validator;
                 $content .= $session_img;
                 $content .= '</h4>';
                 $content .= '<p class="list-group-item-text">' . $myrow['description'] . '</p>';
                 $content .= '</div>';
             } else {
                 if (api_is_allowed_to_edit(null, true)) {
                     $content .= '<div class="list-group-item">';
                     $content .= '<div class="pull-right"><div class="btn-group">' . $toolbar . '</div></div>';
                     $content .= '<h4 class="list-group-item-heading">';
                     $content .= $iconLink;
                     $url = 'link_goto.php?' . api_get_cidreq() . '&link_id=' . $myrow['id'] . "&link_url=" . urlencode($myrow['url']);
                     $content .= Display::tag('a', Security::remove_XSS($myrow['title']), array('href' => $url, 'target' => '_blank', 'class' => 'invisible'));
                     $content .= $link_validator;
                     $content .= $session_img;
                     $content .= '</h4>';
                     $content .= '<p class="list-group-item-text">' . $myrow['description'] . '</p>';
                     $content .= '</div>';
                 }
             }
             $i++;
         }
//.........这里部分代码省略.........
开发者ID:feroli1000,项目名称:chamilo-lms,代码行数:101,代码来源:link.lib.php

示例5: return_new_tree


//.........这里部分代码省略.........
            if (file_exists($iconSysPath . 'lp_' . $icon_name . '.png')) {
                $icon = Display::return_icon('lp_' . $icon_name . '.png');
            } else {
                if (file_exists($iconSysPath . 'lp_' . $icon_name . '.gif')) {
                    $icon = Display::return_icon('lp_' . $icon_name . '.gif');
                } else {
                    $icon = Display::return_icon('folder_document.gif');
                }
            }
            // The audio column.
            $return_audio .= '<td align="center">';
            $audio = '';
            if (!$update_audio or $update_audio != 'true') {
                if (!empty($arrLP[$i]['audio'])) {
                    /*$audio .= '<span id="container'.$i.'"><a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this player.</span>';
                      $audio .= '<script type="text/javascript" src="../inc/lib/mediaplayer/swfobject.js"></script>';
                      $audio .= '<script type="text/javascript">
                                      var s1 = new SWFObject("../inc/lib/mediaplayer/player.swf","ply","250","20","9","#FFFFFF");
                                      s1.addParam("allowscriptaccess","always");
                                      s1.addParam("flashvars","file=../../courses/' . $_course['path'] . '/document/audio/' . $arrLP[$i]['audio'] . '");
                                      s1.write("container' . $i . '");
                                  </script>';*/
                } else {
                    $audio .= '';
                }
            } else {
                if ($arrLP[$i]['item_type'] != 'dokeos_chapter' && $arrLP[$i]['item_type'] != 'dokeos_module' && $arrLP[$i]['item_type'] != 'dir') {
                    $audio .= '<input type="file" name="mp3file' . $arrLP[$i]['id'] . '" id="mp3file" />';
                    if (!empty($arrLP[$i]['audio'])) {
                        $audio .= '<br />' . Security::remove_XSS($arrLP[$i]['audio']) . '<br /><input type="checkbox" name="removemp3' . $arrLP[$i]['id'] . '" id="checkbox' . $arrLP[$i]['id'] . '" />' . get_lang('RemoveAudio');
                    }
                }
            }
            $return_audio .= Display::span($icon . ' ' . $title) . Display::tag('td', $audio, array('style' => ''));
            $return_audio .= '</td>';
            $move_icon = '';
            $move_item_icon = '';
            $edit_icon = '';
            $delete_icon = '';
            $audio_icon = '';
            $prerequisities_icon = '';
            if ($is_allowed_to_edit) {
                if (!$update_audio or $update_audio != 'true') {
                    $move_icon .= '<a class="moved" href="#">';
                    $move_icon .= Display::return_icon('move_everywhere.png', get_lang('Move'), array(), ICON_SIZE_TINY);
                    $move_icon .= '</a>';
                }
                // No edit for this item types
                if (!in_array($arrLP[$i]['item_type'], array('sco', 'asset'))) {
                    if (!in_array($arrLP[$i]['item_type'], array('dokeos_chapter', 'dokeos_module'))) {
                        $edit_icon .= '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&amp;action=edit_item&amp;view=build&amp;id=' . $arrLP[$i]['id'] . '&amp;lp_id=' . $this->lp_id . '&amp;path_item=' . $arrLP[$i]['path'] . '">';
                        $edit_icon .= Display::return_icon('edit.png', get_lang('LearnpathEditModule'), array(), ICON_SIZE_TINY);
                        $edit_icon .= '</a>';
                    } else {
                        $edit_icon .= '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&amp;action=edit_item&amp;id=' . $arrLP[$i]['id'] . '&amp;lp_id=' . $this->lp_id . '&amp;path_item=' . $arrLP[$i]['path'] . '">';
                        $edit_icon .= Display::return_icon('edit.png', get_lang('LearnpathEditModule'), array(), ICON_SIZE_TINY);
                        $edit_icon .= '</a>';
                    }
                }
                $delete_icon .= ' <a href="' . api_get_self() . '?' . api_get_cidreq() . '&amp;action=delete_item&amp;id=' . $arrLP[$i]['id'] . '&amp;lp_id=' . $this->lp_id . '" onClick="return confirmation(\'' . addslashes($title) . '\');">';
                $delete_icon .= Display::return_icon('delete.png', get_lang('LearnpathDeleteModule'), array(), ICON_SIZE_TINY);
                $delete_icon .= '</a>';
                $url = api_get_self() . '?' . api_get_cidreq() . '&view=build&id=' . $arrLP[$i]['id'] . '&lp_id=' . $this->lp_id;
                if (!in_array($arrLP[$i]['item_type'], array('dokeos_chapter', 'dokeos_module', 'dir'))) {
                    $prerequisities_icon = Display::url(Display::return_icon('accept.png', get_lang('LearnpathPrerequisites'), array(), ICON_SIZE_TINY), $url . '&action=edit_item_prereq');
                    $move_item_icon = Display::url(Display::return_icon('move.png', get_lang('Move'), array(), ICON_SIZE_TINY), $url . '&action=move_item');
开发者ID:ragebat,项目名称:chamilo-lms,代码行数:67,代码来源:learnpath.class.php

示例6: showlinksofcategory

 /**
  * Displays all the links of a given category.
  * @author Patrick Cool <patrick.cool@UGent.be>, Ghent University
  */
 public static function showlinksofcategory($catid)
 {
     global $urlview, $up, $down, $_user, $token;
     $tbl_link = Database::get_course_table(TABLE_LINK);
     $TABLE_ITEM_PROPERTY = Database::get_course_table(TABLE_ITEM_PROPERTY);
     // Condition for the session.
     $session_id = api_get_session_id();
     $condition_session = api_get_session_condition($session_id, true, true, 'link.session_id');
     $catid = intval($catid);
     $course_id = api_get_course_int_id();
     $sqlLinks = "SELECT *, link.id FROM {$tbl_link} link\n                     INNER JOIN {$TABLE_ITEM_PROPERTY} itemproperties\n                     ON (link.id=itemproperties.ref AND link.c_id = itemproperties.c_id )\n                     WHERE\n                        itemproperties.tool='" . TOOL_LINK . "' AND\n                        link.category_id='" . $catid . "' AND\n                        (itemproperties.visibility='0' OR itemproperties.visibility='1')\n                        {$condition_session} AND\n                        link.c_id = " . $course_id . " AND\n                        itemproperties.c_id = " . $course_id . "\n                    ORDER BY link.display_order DESC";
     $result = Database::query($sqlLinks);
     $numberoflinks = Database::num_rows($result);
     if ($numberoflinks > 0) {
         echo '<table class="data_table" width="100%">';
         $i = 1;
         while ($myrow = Database::fetch_array($result)) {
             // Validation when belongs to a session.
             $session_img = api_get_session_image($myrow['session_id'], $_user['status']);
             $css_class = $i % 2 == 0 ? $css_class = 'row_odd' : ($css_class = 'row_even');
             $link_validator = '';
             if (api_is_allowed_to_edit(null, true)) {
                 $link_validator = Display::url(Display::return_icon('preview_view.png', get_lang('CheckURL'), array(), 16), '#', array('onclick' => "check_url('" . $myrow['id'] . "', '" . addslashes($myrow['url']) . "');"));
                 $link_validator .= Display::span('', array('id' => 'url_id_' . $myrow['id']));
             }
             if ($myrow['visibility'] == '1') {
                 echo '<tr class="' . $css_class . '">';
                 echo '<td align="center" valign="middle" width="5%">';
                 echo '<a href="link_goto.php?' . api_get_cidreq() . '&link_id=' . $myrow['id'] . '&link_url=' . urlencode($myrow['url']) . '" target="_blank">
                         <img src="../../main/img/link.gif" border="0" alt="' . get_lang('Link') . '"/></a>
                     </td>
                     <td width="80%" valign="top">
                     <a href="link_goto.php?' . api_get_cidreq() . '&link_id=' . $myrow['id'] . '&link_url=' . urlencode($myrow['url']) . '" target="' . $myrow['target'] . '">';
                 echo Security::remove_XSS($myrow['title']);
                 echo '</a>';
                 echo $link_validator;
                 echo $session_img;
                 echo '<br />' . $myrow['description'];
             } else {
                 if (api_is_allowed_to_edit(null, true)) {
                     echo '<tr class="' . $css_class . '">';
                     echo '<td align="center" valign="middle" width="5%">
                         <a href="link_goto.php?' . api_get_cidreq() . '&link_id=' . $myrow['id'] . "\n                            &link_url=" . urlencode($myrow['url']) . '"
                         target="_blank" class="invisible">';
                     echo Display::return_icon('link_na.gif', get_lang('Link')), '</a>';
                     echo '</td><td width="80%" valign="top">
                           <a href="link_goto.php?', api_get_cidreq(), '&link_id=', $myrow['id'], '&link_url=', urlencode($myrow['url']), '" target="', $myrow['target'], '"  class="invisible">';
                     echo Security::remove_XSS($myrow['title']);
                     echo "</a>";
                     echo $link_validator;
                     echo $session_img, '<br />', $myrow['description'];
                 }
             }
             if (api_is_allowed_to_edit(null, true)) {
                 echo '<td style="text-align:center;">';
                 if ($session_id == $myrow['session_id']) {
                     $url = api_get_self() . '?' . api_get_cidreq() . '&action=editlink&category=' . (!empty($category) ? $category : '') . '&id=' . $myrow['id'] . '&category_id=' . $myrow['id'];
                     echo '<a href="' . $url . '">' . Display::return_icon('edit.png', get_lang('Modify'), array(), ICON_SIZE_SMALL) . '</a>';
                     // DISPLAY MOVE UP COMMAND only if it is not the top link.
                     /* commented at least since 2014-10-11
                                             if ($i != 1) {
                                                 echo '<a href="' . api_get_self() . '?' . api_get_cidreq() .  '&sec_token='.$token.'&urlview=' . $urlview . '&up=', $myrow[0], '" title="' . get_lang('Up') . '">' . Display :: return_icon('up.png', get_lang('Up'), array (), ICON_SIZE_SMALL) . '', "</a>\n";
                                             } else {
                                                 echo Display :: return_icon('up_na.png', get_lang('Up'), array (), ICON_SIZE_SMALL) . '</a>';
                                             }
                     
                                             // DISPLAY MOVE DOWN COMMAND only if it is not the bottom link.
                                             if ($i < $numberoflinks) {
                                                 echo '<a href="' . api_get_self() . '?' . api_get_cidreq() .  '&sec_token='.$token.'&urlview=' . $urlview . '&down=' . $myrow[0] . '" title="' . get_lang('Down') . '">' . Display :: return_icon('down.png', get_lang('Down'), array (), ICON_SIZE_SMALL) . '', "</a>\n";
                                             } else {
                                                 echo Display :: return_icon('down_na.png', get_lang('Down'), array (), ICON_SIZE_SMALL) . '', "</a>\n";
                                             }*/
                     if ($myrow['visibility'] == '1') {
                         echo '<a href="link.php?' . api_get_cidreq() . '&sec_token=' . $token . '&action=invisible&id=' . $myrow['id'] . '&scope=link&category_id=' . $myrow['category_id'] . '" title="' . get_lang('Hide') . '">' . Display::return_icon('visible.png', get_lang('Hide'), array(), ICON_SIZE_SMALL) . '</a>';
                     }
                     if ($myrow['visibility'] == '0') {
                         echo ' <a href="link.php?' . api_get_cidreq() . '&sec_token=' . $token . '&action=visible&id=' . $myrow['id'] . '&scope=link&category_id=' . $myrow['category_id'] . '" title="' . get_lang('Show') . '">' . Display::return_icon('invisible.png', get_lang('Show'), array(), ICON_SIZE_SMALL) . '</a>';
                     }
                     echo ' <a href="' . api_get_self() . '?' . api_get_cidreq() . '&sec_token=' . $token . '&action=deletelink&id=' . $myrow['id'] . '&category_id=' . $myrow['category_id'] . "\"\n                            onclick=\"javascript: if(!confirm('" . get_lang('LinkDelconfirm') . "'))\n                            return false;\" title=\"" . get_lang('Delete') . '">' . Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL) . '</a>';
                 } else {
                     echo Display::return_icon('edit_na.png', get_lang('EditionNotAvailableFromSession'), array(), ICON_SIZE_SMALL);
                     //get_lang('EditionNotAvailableFromSession');
                 }
                 echo '</td>';
             }
             echo '</tr>';
             $i++;
         }
         echo '</table>';
     }
 }
开发者ID:KRCM13,项目名称:chamilo-lms,代码行数:95,代码来源:link.lib.php

示例7: return_new_tree

 /**
  * @param string string $update_audio
  * @param bool $drop_element_here
  * @return string
  */
 public function return_new_tree($update_audio = 'false', $drop_element_here = false)
 {
     $return = '';
     $is_allowed_to_edit = api_is_allowed_to_edit(null, true);
     $course_id = api_get_course_int_id();
     $tbl_lp_item = Database::get_course_table(TABLE_LP_ITEM);
     $sql = "SELECT * FROM {$tbl_lp_item}\n                WHERE c_id = {$course_id} AND lp_id = " . $this->lp_id;
     $result = Database::query($sql);
     $arrLP = array();
     while ($row = Database::fetch_array($result)) {
         $arrLP[] = array('id' => $row['id'], 'item_type' => $row['item_type'], 'title' => Security::remove_XSS($row['title']), 'path' => $row['path'], 'description' => Security::remove_XSS($row['description']), 'parent_item_id' => $row['parent_item_id'], 'previous_item_id' => $row['previous_item_id'], 'next_item_id' => $row['next_item_id'], 'max_score' => $row['max_score'], 'min_score' => $row['min_score'], 'mastery_score' => $row['mastery_score'], 'prerequisite' => $row['prerequisite'], 'display_order' => $row['display_order'], 'audio' => $row['audio'], 'prerequisite_max_score' => $row['prerequisite_max_score'], 'prerequisite_min_score' => $row['prerequisite_min_score']);
     }
     $this->tree_array($arrLP);
     $arrLP = isset($this->arrMenu) ? $this->arrMenu : null;
     unset($this->arrMenu);
     $default_data = null;
     $default_content = null;
     $elements = array();
     $return_audio = null;
     for ($i = 0; $i < count($arrLP); $i++) {
         $title = $arrLP[$i]['title'];
         $title_cut = cut($arrLP[$i]['title'], 25);
         //Link for the documents
         if ($arrLP[$i]['item_type'] == 'document') {
             $url = api_get_self() . '?' . api_get_cidreq() . '&action=view_item&mode=preview_document&id=' . $arrLP[$i]['id'] . '&lp_id=' . $this->lp_id;
             $title_cut = Display::url($title_cut, $url, array('class' => 'ajax', 'data-title' => $title_cut));
         }
         if ($i % 2 == 0) {
             $oddClass = 'row_odd';
         } else {
             $oddClass = 'row_even';
         }
         $return_audio .= '<tr id ="lp_item_' . $arrLP[$i]['id'] . '" class="' . $oddClass . '">';
         $icon_name = str_replace(' ', '', $arrLP[$i]['item_type']);
         $icon = '';
         if (file_exists('../img/lp_' . $icon_name . '.png')) {
             $icon = '<img src="../img/lp_' . $icon_name . '.png" />';
         } else {
             if (file_exists('../img/lp_' . $icon_name . '.gif')) {
                 $icon = '<img src="../img/lp_' . $icon_name . '.gif"  />';
             } else {
                 $icon = '<img src="../img/folder_document.gif" />';
             }
         }
         // The audio column.
         $return_audio .= '<td align="left" style="padding-left:10px;">';
         $audio = '';
         if (!$update_audio || $update_audio != 'true') {
             if (!empty($arrLP[$i]['audio'])) {
                 /*$audio .= '<span id="container'.$i.'"><a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this player.</span>';
                   $audio .= '<script type="text/javascript" src="../inc/lib/mediaplayer/swfobject.js"></script>';
                   $audio .= '<script type="text/javascript">
                                   var s1 = new SWFObject("../inc/lib/mediaplayer/player.swf","ply","250","20","9","#FFFFFF");
                                   s1.addParam("allowscriptaccess","always");
                                   s1.addParam("flashvars","file=../../courses/' . $_course['path'] . '/document/audio/' . $arrLP[$i]['audio'] . '");
                                   s1.write("container' . $i . '");
                               </script>';*/
             } else {
                 $audio .= '';
             }
         } else {
             $types = self::getChapterTypes();
             if (!in_array($arrLP[$i]['item_type'], $types)) {
                 $audio .= '<input type="file" name="mp3file' . $arrLP[$i]['id'] . '" id="mp3file" />';
                 if (!empty($arrLP[$i]['audio'])) {
                     $audio .= '<br />' . Security::remove_XSS($arrLP[$i]['audio']) . '<br />
                     <input type="checkbox" name="removemp3' . $arrLP[$i]['id'] . '" id="checkbox' . $arrLP[$i]['id'] . '" />' . get_lang('RemoveAudio');
                 }
             }
         }
         $return_audio .= Display::span($icon . ' ' . $title) . Display::tag('td', $audio, array('style' => ''));
         $return_audio .= '</td>';
         $move_icon = '';
         $move_item_icon = '';
         $edit_icon = '';
         $delete_icon = '';
         $audio_icon = '';
         $prerequisities_icon = '';
         if ($is_allowed_to_edit) {
             if (!$update_audio || $update_audio != 'true') {
                 $move_icon .= '<a class="moved" href="#">';
                 $move_icon .= Display::return_icon('move_everywhere.png', get_lang('Move'), array(), ICON_SIZE_TINY);
                 $move_icon .= '</a>';
             }
             // No edit for this item types
             if (!in_array($arrLP[$i]['item_type'], array('sco', 'asset'))) {
                 if (!in_array($arrLP[$i]['item_type'], array('dokeos_chapter', 'dokeos_module'))) {
                     $edit_icon .= '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&action=edit_item&view=build&id=' . $arrLP[$i]['id'] . '&lp_id=' . $this->lp_id . '&path_item=' . $arrLP[$i]['path'] . '">';
                     $edit_icon .= Display::return_icon('edit.png', get_lang('LearnpathEditModule'), array(), ICON_SIZE_TINY);
                     $edit_icon .= '</a>';
                 } else {
                     $edit_icon .= '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&action=edit_item&id=' . $arrLP[$i]['id'] . '&lp_id=' . $this->lp_id . '&path_item=' . $arrLP[$i]['path'] . '">';
                     $edit_icon .= Display::return_icon('edit.png', get_lang('LearnpathEditModule'), array(), ICON_SIZE_TINY);
                     $edit_icon .= '</a>';
                 }
//.........这里部分代码省略.........
开发者ID:secuencia24,项目名称:chamilo-lms,代码行数:101,代码来源:learnpath.class.php

示例8: show_score

 /**
  * Converts the score with the exercise_max_note and exercise_min_score
  * the platform settings + formats the results using the float_format function
  *
  * @param float $score
  * @param float $weight
  * @param bool $show_percentage show percentage or not
  * @param bool $use_platform_settings use or not the platform settings
  * @param bool $show_only_percentage
  * @return  string  an html with the score modified
  */
 public static function show_score($score, $weight, $show_percentage = true, $use_platform_settings = true, $show_only_percentage = false)
 {
     if (is_null($score) && is_null($weight)) {
         return '-';
     }
     $max_note = api_get_setting('exercise.exercise_max_score');
     $min_note = api_get_setting('exercise.exercise_min_score');
     if ($use_platform_settings) {
         if ($max_note != '' && $min_note != '') {
             if (!empty($weight) && intval($weight) != 0) {
                 $score = $min_note + ($max_note - $min_note) * $score / $weight;
             } else {
                 $score = $min_note;
             }
             $weight = $max_note;
         }
     }
     $percentage = 100 * $score / ($weight != 0 ? $weight : 1);
     // Formats values
     $percentage = float_format($percentage, 1);
     $score = float_format($score, 1);
     $weight = float_format($weight, 1);
     $html = null;
     if ($show_percentage) {
         $parent = '(' . $score . ' / ' . $weight . ')';
         $html = $percentage . "%  {$parent}";
         if ($show_only_percentage) {
             $html = $percentage . "% ";
         }
     } else {
         $html = $score . ' / ' . $weight;
     }
     $html = Display::span($html, array('class' => 'score_exercise'));
     return $html;
 }
开发者ID:feroli1000,项目名称:chamilo-lms,代码行数:46,代码来源:exercise.lib.php

示例9: return_new_tree

 /**
  * @param string string $update_audio
  * @param bool $drop_element_here
  * @return string
  */
 public function return_new_tree($update_audio = 'false', $drop_element_here = false)
 {
     $return = '';
     $is_allowed_to_edit = api_is_allowed_to_edit(null, true);
     $course_id = api_get_course_int_id();
     $tbl_lp_item = Database::get_course_table(TABLE_LP_ITEM);
     $sql = "SELECT * FROM {$tbl_lp_item}\n                WHERE c_id = {$course_id} AND lp_id = " . $this->lp_id;
     $result = Database::query($sql);
     $arrLP = array();
     while ($row = Database::fetch_array($result)) {
         $arrLP[] = array('id' => $row['id'], 'item_type' => $row['item_type'], 'title' => Security::remove_XSS($row['title']), 'path' => $row['path'], 'description' => Security::remove_XSS($row['description']), 'parent_item_id' => $row['parent_item_id'], 'previous_item_id' => $row['previous_item_id'], 'next_item_id' => $row['next_item_id'], 'max_score' => $row['max_score'], 'min_score' => $row['min_score'], 'mastery_score' => $row['mastery_score'], 'prerequisite' => $row['prerequisite'], 'display_order' => $row['display_order'], 'audio' => $row['audio'], 'prerequisite_max_score' => $row['prerequisite_max_score'], 'prerequisite_min_score' => $row['prerequisite_min_score']);
     }
     $this->tree_array($arrLP);
     $arrLP = isset($this->arrMenu) ? $this->arrMenu : null;
     unset($this->arrMenu);
     $default_data = null;
     $default_content = null;
     $elements = array();
     $return_audio = null;
     for ($i = 0; $i < count($arrLP); $i++) {
         $title = $arrLP[$i]['title'];
         $title_cut = cut($arrLP[$i]['title'], 25);
         $url = api_get_self() . '?' . api_get_cidreq() . '&action=view_item&id=' . $arrLP[$i]['id'] . '&lp_id=' . $this->lp_id;
         $title_cut = Display::url($title_cut, $url, array('class' => 'ajax moved', 'data-title' => $title_cut));
         if ($i % 2 == 0) {
             $oddClass = 'row_odd';
         } else {
             $oddClass = 'row_even';
         }
         $return_audio .= '<tr id ="lp_item_' . $arrLP[$i]['id'] . '" class="' . $oddClass . '">';
         $icon_name = str_replace(' ', '', $arrLP[$i]['item_type']);
         if (file_exists('../img/lp_' . $icon_name . '.png')) {
             $icon = Display::return_icon('lp_' . $icon_name . '.png');
         } else {
             if (file_exists('../img/lp_' . $icon_name . '.gif')) {
                 $icon = Display::return_icon('lp_' . $icon_name . '.gif');
             } else {
                 $icon = Display::return_icon('folder_document.gif');
             }
         }
         // The audio column.
         $return_audio .= '<td align="left" style="padding-left:10px;">';
         $audio = '';
         if (!$update_audio || $update_audio != 'true') {
             if (!empty($arrLP[$i]['audio'])) {
             } else {
                 $audio .= '';
             }
         } else {
             $types = self::getChapterTypes();
             if (!in_array($arrLP[$i]['item_type'], $types)) {
                 $audio .= '<input type="file" name="mp3file' . $arrLP[$i]['id'] . '" id="mp3file" />';
                 if (!empty($arrLP[$i]['audio'])) {
                     $audio .= '<br />' . Security::remove_XSS($arrLP[$i]['audio']) . '<br />
                     <input type="checkbox" name="removemp3' . $arrLP[$i]['id'] . '" id="checkbox' . $arrLP[$i]['id'] . '" />' . get_lang('RemoveAudio');
                 }
             }
         }
         $return_audio .= Display::span($icon . ' ' . $title) . Display::tag('td', $audio, array('style' => ''));
         $return_audio .= '</td>';
         $move_icon = '';
         $move_item_icon = '';
         $edit_icon = '';
         $delete_icon = '';
         $audio_icon = '';
         $prerequisities_icon = '';
         $forumIcon = '';
         $previewIcon = '';
         if ($is_allowed_to_edit) {
             if (!$update_audio || $update_audio != 'true') {
                 $move_icon .= '<a class="moved" href="#">';
                 $move_icon .= Display::return_icon('move_everywhere.png', get_lang('Move'), array(), ICON_SIZE_TINY);
                 $move_icon .= '</a>';
             }
             // No edit for this item types
             if (!in_array($arrLP[$i]['item_type'], array('sco', 'asset'))) {
                 if (!in_array($arrLP[$i]['item_type'], array('dokeos_chapter', 'dokeos_module'))) {
                     $edit_icon .= '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&action=edit_item&view=build&id=' . $arrLP[$i]['id'] . '&lp_id=' . $this->lp_id . '&path_item=' . $arrLP[$i]['path'] . '" class="btn btn-default">';
                     $edit_icon .= Display::return_icon('edit.png', get_lang('LearnpathEditModule'), array(), ICON_SIZE_TINY);
                     $edit_icon .= '</a>';
                     if (!in_array($arrLP[$i]['item_type'], ['forum', 'thread'])) {
                         if ($this->items[$arrLP[$i]['id']]->getForumThread($this->course_int_id, $this->lp_session_id)) {
                             $forumIconUrl = api_get_self() . '?' . api_get_cidreq() . '&' . http_build_query(['action' => 'dissociate_forum', 'id' => $arrLP[$i]['id'], 'lp_id' => $this->lp_id]);
                             $forumIcon = Display::url(Display::return_icon('forum.png', get_lang('DissociateForumToLPItem'), [], ICON_SIZE_TINY), $forumIconUrl, ['class' => 'btn btn-default lp-btn-dissociate-forum']);
                         } else {
                             $forumIconUrl = api_get_self() . '?' . api_get_cidreq() . '&' . http_build_query(['action' => 'create_forum', 'id' => $arrLP[$i]['id'], 'lp_id' => $this->lp_id]);
                             $forumIcon = Display::url(Display::return_icon('forum.png', get_lang('AssociateForumToLPItem'), [], ICON_SIZE_TINY), $forumIconUrl, ['class' => "btn btn-default lp-btn-associate-forum"]);
                         }
                     }
                 } else {
                     $edit_icon .= '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&action=edit_item&id=' . $arrLP[$i]['id'] . '&lp_id=' . $this->lp_id . '&path_item=' . $arrLP[$i]['path'] . '" class="btn btn-default">';
                     $edit_icon .= Display::return_icon('edit.png', get_lang('LearnpathEditModule'), array(), ICON_SIZE_TINY);
                     $edit_icon .= '</a>';
                 }
             }
//.........这里部分代码省略.........
开发者ID:jloguercio,项目名称:chamilo-lms,代码行数:101,代码来源:learnpath.class.php

示例10: indexAction


//.........这里部分代码省略.........
                 $item['actions'] .= Display::url(Display::return_icon('delete.png', get_lang('Delete')), api_get_path(WEB_CODE_PATH) . 'timeline/?action=delete&id=' . $item['id']);
                 $new_result[] = $item;
             }
             $result = $new_result;
             break;
         case 'get_gradebooks':
             $columns = array('name', 'certificates', 'skills', 'actions', 'has_certificates');
             if (!in_array($sidx, $columns)) {
                 $sidx = 'name';
             }
             $result = Database::select('*', $obj->table, array('order' => "{$sidx} {$sord}", 'LIMIT' => "{$start} , {$limit}"));
             $new_result = array();
             foreach ($result as $item) {
                 if ($item['parent_id'] != 0) {
                     continue;
                 }
                 $skills = $obj->get_skills_by_gradebook($item['id']);
                 //Fixes bug when gradebook doesn't have names
                 if (empty($item['name'])) {
                     $item['name'] = $item['course_code'];
                 } else {
                     //$item['name'] =  $item['name'].' ['.$item['course_code'].']';
                 }
                 $item['name'] = Display::url($item['name'], api_get_path(WEB_CODE_PATH) . 'gradebook/index.php?id_session=0&cidReq=' . $item['course_code']);
                 if (!empty($item['certif_min_score']) && !empty($item['document_id'])) {
                     $item['certificates'] = Display::return_icon('accept.png', get_lang('WithCertificate'), array(), ICON_SIZE_SMALL);
                     $item['has_certificates'] = '1';
                 } else {
                     $item['certificates'] = Display::return_icon('warning.png', get_lang('NoCertificate'), array(), ICON_SIZE_SMALL);
                     $item['has_certificates'] = '0';
                 }
                 if (!empty($skills)) {
                     foreach ($skills as $skill) {
                         $item['skills'] .= Display::span($skill['name'], array('class' => 'label_tag skill'));
                     }
                 }
                 $new_result[] = $item;
             }
             $result = $new_result;
             break;
         case 'get_event_email_template':
             $columns = array('subject', 'event_type_name', 'language_id', 'activated', 'actions');
             if (!in_array($sidx, $columns)) {
                 $sidx = 'subject';
             }
             $result = Database::select('*', $obj->table, array('order' => "{$sidx} {$sord}", 'LIMIT' => "{$start} , {$limit}"));
             $new_result = array();
             foreach ($result as $item) {
                 $language_info = api_get_language_info($item['language_id']);
                 $item['language_id'] = $language_info['english_name'];
                 $item['actions'] = Display::url(Display::return_icon('edit.png', get_lang('Edit')), api_get_path(WEB_CODE_PATH) . 'admin/event_type.php?action=edit&event_type_name=' . $item['event_type_name']);
                 $item['actions'] .= Display::url(Display::return_icon('delete.png', get_lang('Delete')), api_get_path(WEB_CODE_PATH) . 'admin/event_controller.php?action=delete&id=' . $item['id']);
                 /*if (!$item['status']) {
                       $item['name'] = '<font style="color:#AAA">'.$item['subject'].'</font>';
                   }*/
                 $new_result[] = $item;
             }
             $result = $new_result;
             break;
         case 'get_careers':
             $columns = array('name', 'description', 'actions');
             if (!in_array($sidx, $columns)) {
                 $sidx = 'name';
             }
             $result = Database::select('*', $obj->table, array('order' => "{$sidx} {$sord}", 'LIMIT' => "{$start} , {$limit}"));
             $new_result = array();
开发者ID:ragebat,项目名称:chamilo-lms,代码行数:67,代码来源:ModelAjaxController.php

示例11: get_lang

            break;
        default:
            $affected_rows = 0;
    }
    if ($affected_rows) {
        $msg = get_lang('AssignedUsersHaveBeenUpdatedSuccessfully');
    }
}
// Display header
Display::display_header($tool_name);
// actions
echo '<div class="actions">';
if ($userStatus != STUDENT_BOSS) {
    $actions = Display::url(Display::return_icon('course_add.gif', get_lang('AssignCourses'), array('style' => 'vertical-align:middle')) . get_lang('AssignCourses'), "dashboard_add_courses_to_user.php?user={$user_id}");
    $actions .= Display::url(Display::return_icon('view_more_stats.gif', get_lang('AssignSessions'), array('style' => 'vertical-align:middle')) . get_lang('AssignSessions'), "dashboard_add_sessions_to_user.php?user={$user_id}");
    echo Display::span($actions, array('style' => 'float: right; margin: 0; paddingg: 0;'));
}
echo Display::url(get_lang('AdvancedSearch'), '#', array('class' => 'advanced_options', 'id' => 'advanced_search'));
echo '</div>';
echo '<div id="advanced_search_options" style="display:none">';
$searchForm->display();
echo '</div>';
echo Display::page_header(sprintf(get_lang('AssignUsersToX'), api_get_person_name($user_info['firstname'], $user_info['lastname'])));
switch ($userStatus) {
    case DRH:
        $assigned_users_to_hrm = UserManager::get_users_followed_by_drh($user_id);
        break;
    case STUDENT_BOSS:
        $assigned_users_to_hrm = UserManager::getUsersFollowedByStudentBoss($user_id);
        break;
}
开发者ID:KRCM13,项目名称:chamilo-lms,代码行数:31,代码来源:dashboard_add_users_to_user.php

示例12: api_get_person_name

 $friend_html .= '</div>';
 // close div friend-header
 $friend_html .= '<ul class="thumbnails">';
 $j = 1;
 for ($k = 0; $k < $number_friends; $k++) {
     if ($j > $number_of_images) {
         break;
     }
     if (isset($friends[$k])) {
         $friend = $friends[$k];
         $name_user = api_get_person_name($friend['firstName'], $friend['lastName']);
         $user_info_friend = api_get_user_info($friend['friend_user_id'], true);
         if ($user_info_friend['user_is_online']) {
             $status_icon = Display::span('', array('class' => 'online_user_in_text'));
         } else {
             $status_icon = Display::span('', array('class' => 'offline_user_in_text'));
         }
         $friend_html .= '<li class="span2">';
         $friend_html .= '<div class="thumbnail">';
         // the height = 92 must be the sqme in the image_friend_network span style in default.css
         $friends_profile = SocialManager::get_picture_user($friend['friend_user_id'], $friend['image'], 92, USER_IMAGE_SIZE_ORIGINAL);
         $friend_html .= '<img src="' . $friends_profile['file'] . '"  id="imgfriend_' . $friend['friend_user_id'] . '" title="' . $name_user . '" />';
         $friend_html .= '<div class="caption">';
         $friend_html .= $status_icon . '<a href="' . $user_info_friend['profile_url'] . '">';
         $friend_html .= $name_user;
         $friend_html .= '</a></div>';
         $friend_html .= '</div>';
         $friend_html .= '</li>';
     }
     $j++;
 }
开发者ID:ragebat,项目名称:chamilo-lms,代码行数:31,代码来源:profile.php

示例13: get_lang

        true
    );
    $result['name'] = Security::remove_XSS($result['name'], STUDENT, true);
    $id = $result['id'];
    $group_url = "groups.php?id=$id";

    if ($result['count'] == 1) {
        $result['count'] = '1 ' . get_lang('Member');
    } else {
        $result['count'] = $result['count'] . ' ' . get_lang('Members');
    }
    $result['name'] = Display::url(
            api_ucwords(cut($result['name'], 40, true)),
            $group_url
        ) . Display::span(
            '<br />' . $result['count'],
            array('class' => 'box_description_group_member')
        );
    $picture = GroupPortalManager::get_picture_group(
        $id,
        $result['picture_uri'],
        80
    );
    $result['picture_uri'] = '<img class="social-groups-image" src="' . $picture['file'] . '" hspace="10" height="44" border="2" align="left" width="44" />';
    $group_actions = '<div class="box_description_group_actions" ><a href="groups.php?#tab_browse-3">' . get_lang(
            'SeeMore'
        ) . '</a></div>';
    $groups_pop[] = array(
        Display::url($result['picture_uri'], $group_url),
        $result['name'],
        cut($result['description'], 120, true) . $group_actions
    );
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:32,代码来源:home.php

示例14: api_get_path

 if (api_get_setting('registration.allow_terms_conditions') == 'true' && $user_already_registered_show_terms) {
     $form_data['action'] = api_get_path(WEB_PATH) . 'user_portal.php';
 } else {
     if (!empty($values['email'])) {
         $text_after_registration .= '<p>' . get_lang('MailHasBeenSent', null, $_user['language']) . '.</p>';
     }
     if ($is_allowedCreateCourse) {
         if ($usersCanCreateCourse) {
             $form_data['message'] = '<p>' . get_lang('NowGoCreateYourCourse', null, $_user['language']) . "</p>";
         }
         $form_data['action'] = '../create_course/add_course.php';
         if (api_get_setting('course.course_validation') == 'true') {
             $form_data['button'] = Display::button('next', get_lang('CreateCourseRequest', null, $_user['language']), array('class' => 'btn btn-primary btn-large'));
         } else {
             $form_data['button'] = Display::button('next', get_lang('CourseCreate', null, $_user['language']), array('class' => 'btn btn-primary btn-large'));
             $form_data['go_button'] = '&nbsp;&nbsp;<a href="' . api_get_path(WEB_PATH) . 'index.php' . '">' . Display::span(get_lang('Next', null, $_user['language']), array('class' => 'btn btn-primary btn-large')) . '</a>';
         }
     } else {
         if (api_get_setting('display.allow_students_to_browse_courses') == 'true') {
             $form_data['action'] = 'courses.php?action=subscribe';
             $form_data['message'] = '<p>' . get_lang('NowGoChooseYourCourses', null, $_user['language']) . ".</p>";
         } else {
             $form_data['action'] = api_get_path(WEB_PATH) . 'user_portal.php';
         }
         $form_data['button'] = Display::button('next', get_lang('Next', null, $_user['language']), array('class' => 'btn btn-primary btn-large'));
     }
 }
 $form_data = CourseManager::redirectToCourse($form_data);
 $form_register = new FormValidator('form_register', 'post', $form_data['action']);
 if (!empty($form_data['message'])) {
     $form_register->addElement('html', $form_data['message'] . '<br /><br />');
开发者ID:omaoibrahim,项目名称:chamilo-lms,代码行数:31,代码来源:inscription.php

示例15: cut

 $group['description'] = Security::remove_XSS($group['description'], STUDENT, true);
 $id = $group['id'];
 $url_open = '<a class="btn btn-default" href="group_view.php?id=' . $id . '">';
 $url_close = '</a>';
 $name = cut($group['name'], 60, true);
 $count_users_group = count($usergroup->get_all_users_by_group($id));
 if ($count_users_group == 1) {
     $count_users_group = $count_users_group . ' ' . get_lang('Member');
 } else {
     $count_users_group = $count_users_group . ' ' . get_lang('Members');
 }
 $picture = $usergroup->get_picture_group($group['id'], $group['picture'], GROUP_IMAGE_SIZE_ORIGINAL);
 //$tags = $usergroup->get_group_tags($group['id']);
 $tags = null;
 $group['picture'] = '<img src="' . $picture['file'] . '" />';
 $members = Display::span($count_users_group);
 $item_1 = Display::tag('h3', $url_open . $name . $url_close) . $members;
 $social_right_content .= '
     <div class="col-md-4">
         <div class="card">
             <div class="avatar">
                 ' . $group['picture'] . '
             </div>
             <div class="content">
                 ' . $item_1 . '
                 <p>' . $group['description'] . '</p>
                 <p>' . $tags . '</p>
                 <p>' . $url_open . get_lang('SeeMore') . $url_close . '</p>
             </div>
         </div>
     </div>';
开发者ID:KRCM13,项目名称:chamilo-lms,代码行数:31,代码来源:search.php


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