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


PHP Display::return_rating_system方法代码示例

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


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

示例1: api_get_user_id

 * Responses to AJAX calls
 */
$language_file[] = 'admin';
require_once '../global.inc.php';
$action = $_REQUEST['a'];
$user_id = api_get_user_id();
switch ($action) {
    case 'add_course_vote':
        $course_id = intval($_REQUEST['course_id']);
        $star = intval($_REQUEST['star']);
        if (!api_is_anonymous()) {
            CourseManager::add_course_vote($user_id, $star, $course_id, 0);
        }
        $point_info = CourseManager::get_course_ranking($course_id, 0);
        $ajax_url = api_get_path(WEB_AJAX_PATH) . 'course.ajax.php?a=add_course_vote';
        $rating = Display::return_rating_system('star_' . $course_id, $ajax_url . '&course_id=' . $course_id, $point_info, false);
        echo $rating;
        break;
    case 'get_user_courses':
        if (api_is_platform_admin()) {
            $user_id = intval($_POST['user_id']);
            $list_course_all_info = CourseManager::get_courses_list_by_user_id($user_id, false);
            if (!empty($list_course_all_info)) {
                foreach ($list_course_all_info as $course_item) {
                    $course_info = api_get_course_info($course_item['code']);
                    echo $course_info['title'] . '<br />';
                }
            } else {
                echo get_lang('UserHasNoCourse');
            }
        }
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:31,代码来源:course.ajax.php

示例2: return_title

/**
 * Display the title of a course in course catalog
 * @param $course
 */
function return_title($course)
{
    $html = '';
    $linkCourse = api_get_course_url($course['code']);
    $title = cut($course['title'], 70);
    $ajax_url = api_get_path(WEB_AJAX_PATH) . 'course.ajax.php?a=add_course_vote';
    $teachers = CourseManager::getTeacherListFromCourseToString($course['real_id']);
    $rating = Display::return_rating_system('star_' . $course['real_id'], $ajax_url . '&course_id=' . $course['real_id'], $course['point_info']);
    $html .= '<h4 class="title"><a href="' . $linkCourse . '">' . cut($title, 60) . '</a></h4>';
    $html .= '<div class="teachers">' . $teachers . '</div>';
    $html .= '<div class="ranking">' . $rating . '</div>';
    return $html;
}
开发者ID:omaoibrahim,项目名称:chamilo-lms,代码行数:17,代码来源:courses_categories.php

示例3: process_hot_course_item

 /**
  * @param array $courses
  * @param array $my_course_code_list
  * @return mixed
  */
 public static function process_hot_course_item($courses, $my_course_code_list = array())
 {
     $hotCourses = [];
     $ajax_url = api_get_path(WEB_AJAX_PATH) . 'course.ajax.php?a=add_course_vote';
     $stok = Security::get_existing_token();
     foreach ($courses as $courseId) {
         $course_info = api_get_course_info_by_id($courseId['c_id']);
         $courseCode = $course_info['code'];
         $categoryCode = !empty($course_info['categoryCode']) ? $course_info['categoryCode'] : "";
         $my_course['extra_info'] = $course_info;
         $my_course['extra_info']['go_to_course_button'] = '';
         $my_course['extra_info']['register_button'] = '';
         $access_link = self::get_access_link_by_user(api_get_user_id(), $course_info, $my_course_code_list);
         //Course visibility
         if ($access_link && in_array('register', $access_link)) {
             $my_course['extra_info']['register_button'] = Display::url(Display::returnFontAwesomeIcon('sign-in'), api_get_path(WEB_COURSE_PATH) . $course_info['path'] . '/index.php?action=subscribe&sec_token=' . $stok, array('class' => 'btn btn-success btn-sm', 'title' => get_lang('Subscribe')));
         }
         if ($access_link && in_array('enter', $access_link) || $course_info['visibility'] == COURSE_VISIBILITY_OPEN_WORLD) {
             $my_course['extra_info']['go_to_course_button'] = Display::url(Display::returnFontAwesomeIcon('share'), api_get_path(WEB_COURSE_PATH) . $course_info['path'] . '/index.php', array('class' => 'btn btn-default btn-sm', 'title' => get_lang('GoToCourse')));
         }
         if ($access_link && in_array('unsubscribe', $access_link)) {
             $my_course['extra_info']['unsubscribe_button'] = Display::url(Display::returnFontAwesomeIcon('sign-out'), api_get_path(WEB_CODE_PATH) . 'auth/courses.php?action=unsubscribe&unsubscribe=' . $courseCode . '&sec_token=' . $stok . '&category_code=' . $categoryCode, array('class' => 'btn btn-danger btn-sm', 'title' => get_lang('Unreg')));
         }
         //Description
         $my_course['extra_info']['description_button'] = '';
         /* if ($course_info['visibility'] == COURSE_VISIBILITY_OPEN_WORLD || in_array($course_info['real_id'],
                    $my_course_code_list)
            ) { */
         $my_course['extra_info']['description_button'] = Display::url(Display::returnFontAwesomeIcon('info-circle'), api_get_path(WEB_AJAX_PATH) . 'course_home.ajax.php?a=show_course_information&code=' . $course_info['code'], ['class' => 'btn btn-default btn-sm ajax', 'data-title' => get_lang('Description'), 'title' => get_lang('Description')]);
         //}
         /* get_lang('Description') */
         $my_course['extra_info']['teachers'] = CourseManager::getTeacherListFromCourseToString($course_info['real_id']);
         $point_info = self::get_course_ranking($course_info['real_id'], 0);
         $my_course['extra_info']['rating_html'] = Display::return_rating_system('star_' . $course_info['real_id'], $ajax_url . '&course_id=' . $course_info['real_id'], $point_info);
         $hotCourses[] = $my_course;
     }
     return $hotCourses;
 }
开发者ID:feroli1000,项目名称:chamilo-lms,代码行数:43,代码来源:course.lib.php

示例4: substr

 // course isn't closed
 $title = Text::cut($course['title'], 70);
 $tutor_name = $course['tutor'];
 $creation_date = substr($course['creation_date'], 0, 10);
 $count_connections = $course['count_connections'];
 $course_path = api_get_path(SYS_COURSE_PATH) . $course['directory'];
 // course path
 if (file_exists($course_path . '/course-pic85x85.png')) {
     $course_medium_image = api_get_path(WEB_COURSE_PATH) . $course['directory'] . '/course-pic85x85.png';
     // redimensioned image 85x85
 } else {
     $course_medium_image = api_get_path(WEB_IMG_PATH) . 'without_picture.png';
     // without picture
 }
 $pointInfo = isset($course['point_info']) ? $course['point_info'] : null;
 $rating = Display::return_rating_system('star_' . $course['real_id'], $ajax_url . '&amp;course_id=' . $course['real_id'], $pointInfo);
 echo '<div class="well_border"><div class="row">';
 echo '<div class="col-md-2">';
 echo '<div class="thumbnail">';
 if (api_get_setting('show_courses_descriptions_in_catalog') == 'true') {
     echo '<a class="ajax" href="' . api_get_path(WEB_CODE_PATH) . 'inc/ajax/course_home.ajax.php?a=show_course_information&amp;code=' . $course['code'] . '" rel="gb_page_center[778]">';
     echo '<img src="' . $course_medium_image . '" alt="" />';
     echo '</a>';
 } else {
     echo '<img src="' . $course_medium_image . '" alt="' . $title . '"/>';
 }
 echo '</div>';
 //thumb
 echo '</div>';
 echo '<div class="col-md-8">';
 $teachers = CourseManager::get_teacher_list_from_course_code_to_string($course['real_id']);
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:31,代码来源:courses_categories.php

示例5: process_hot_course_item

 public static function process_hot_course_item($courses, $my_course_code_list = array())
 {
     $ajax_url = api_get_path(WEB_AJAX_PATH) . 'course.ajax.php?a=add_course_vote';
     foreach ($courses as &$my_course) {
         $course_info = api_get_course_info_by_id($my_course['c_id']);
         $my_course['extra_info'] = $course_info;
         $my_course['extra_info']['go_to_course_button'] = '';
         $my_course['extra_info']['register_button'] = '';
         $access_link = self::get_access_link_by_user(api_get_user_id(), $course_info, $my_course_code_list);
         //Course visibility
         if ($access_link && in_array('register', $access_link)) {
             $stok = Security::get_token();
             $my_course['extra_info']['register_button'] = Display::url(get_lang('Subscribe'), api_get_path(WEB_COURSE_PATH) . $course_info['path'] . '/index.php?action=subscribe&amp;sec_token=' . $stok, array('class' => 'btn btn-primary'));
         }
         if ($access_link && in_array('enter', $access_link)) {
             $my_course['extra_info']['go_to_course_button'] = Display::url(get_lang('GoToCourse'), api_get_path(WEB_COURSE_PATH) . $course_info['path'] . '/index.php', array('class' => 'btn btn-primary'));
         }
         // Description
         $my_course['extra_info']['description_button'] = '';
         if ($course_info['visibility'] == COURSE_VISIBILITY_OPEN_WORLD || in_array($course_info['real_id'], $my_course_code_list)) {
             $my_course['extra_info']['description_button'] = Display::url(get_lang('Description'), api_get_path(WEB_AJAX_PATH) . 'course_home.ajax.php?a=show_course_information&amp;code=' . $course_info['code'], array('class' => 'ajax btn btn-default'));
         }
         $my_course['extra_info']['teachers'] = CourseManager::get_teacher_list_from_course_code_to_string($course_info['real_id']);
         $point_info = self::get_course_ranking($course_info['real_id'], 0);
         $my_course['extra_info']['rating_html'] = Display::return_rating_system('star_' . $course_info['real_id'], $ajax_url . '&amp;course_id=' . $course_info['real_id'], $point_info);
     }
     return $courses;
 }
开发者ID:ragebat,项目名称:chamilo-lms,代码行数:28,代码来源:course.lib.php

示例6: display_title

/**
 * Display the title of a course in course catalog
 * @param $course
 */
function display_title($course)
{
    $title      = cut($course['title'], 70);
    $ajax_url = api_get_path(WEB_AJAX_PATH).'course.ajax.php?a=add_course_vote';
    $teachers = CourseManager::get_teacher_list_from_course_code_to_string($course['code']);
    $rating = Display::return_rating_system('star_'.$course['real_id'], $ajax_url.'&amp;course_id='.$course['real_id'], $course['point_info']);

    $teachers = '<h5>'.$teachers.'</h5>';
    echo '<div class="categories-course-description">';
    echo '<h3>'.cut($title, 60).'</h3>';
    echo $teachers;
    echo $rating;
    echo '</div>';  // categories-course-description
}
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:18,代码来源:courses_categories.php


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