1.10.x
Julio 10 years ago
parent dc321757c8
commit c86517066f
  1. 4
      main/gradebook/index.php
  2. 2
      main/gradebook/lib/be/category.class.php
  3. 3
      main/inc/ajax/chat.ajax.php
  4. 41
      main/inc/introductionSection.inc.php
  5. 10
      main/inc/lib/course.lib.php
  6. 61
      main/inc/lib/display.lib.php
  7. 2
      main/inc/lib/javascript/chat/video.php
  8. 21
      main/newscorm/learnpath.class.php
  9. 28
      main/template/default/auth/courses_categories.php
  10. 8
      main/tracking/courseLog.php

@ -771,7 +771,7 @@ if ($category != '0') {
$stud_id
);
if (isset($certificate['pdf_url'])) {
$actionsLeft .= Display::url(Display::returnFontAswesomeIcon('file-pdf-o') .
$actionsLeft .= Display::url(Display::returnFontAwesomeIcon('file-pdf-o') .
get_lang('DownloadCertificatePdf'),
$certificate['pdf_url'],
['class' => 'btn btn-default']
@ -786,7 +786,7 @@ if ($category != '0') {
if (!api_is_allowed_to_edit(null, true)) {
$actionsLeft .= Display::url(
Display::returnFontAswesomeIcon('file-pdf-o') . get_lang('DownloadReportPdf'),
Display::returnFontAwesomeIcon('file-pdf-o') . get_lang('DownloadReportPdf'),
api_get_self()."?".api_get_self()."&action=export_table",
['class' => 'btn btn-default']
);

@ -1998,7 +1998,7 @@ class Category implements GradebookItem
$url = api_get_path(WEB_PATH) . 'certificates/index.php?id=' . $my_certificate['id'];
$certificates = Display::url(
Display::returnFontAswesomeIcon('download').' '.get_lang('DownloadCertificate'),
Display::returnFontAwesomeIcon('download').' '.get_lang('DownloadCertificate'),
$url,
array(
'target' => '_blank',

@ -29,7 +29,6 @@ if ($action == 'preview') {
);
}
if (api_get_setting('allow_global_chat') == 'false') {
exit;
}
@ -88,7 +87,7 @@ switch ($action) {
$videoChatUrl = api_get_path(WEB_LIBRARY_JS_PATH) . "chat/video.php?room={$room['id']}";
$videoChatLink = Display::url(
Display::returnFontAswesomeIcon('video-camera') . get_lang('StartVideoChat'),
Display::returnFontAwesomeIcon('video-camera') . get_lang('StartVideoChat'),
$videoChatUrl
);

@ -250,26 +250,27 @@ if ($tool == TOOL_COURSE_HOMEPAGE && !isset($_GET['intro_cmdEdit'])) {
$userInfo = $_SESSION['_user'];
$courseInfo = api_get_course_info();
$titleThematic = $thematic_advance .' : '. $courseInfo['name'] . ' <b>( '. $thematicScore .' )</b>';
$infoUser = '<div class="thematic-avatar"><img src="' . $userInfo['avatar'] . '" class="img-circle img-responsive"></div>';
$infoUser .= '<div class="progress">
<div class="progress-bar progress-bar-danger" role="progressbar" style="width: ' . $thematicScore . ';">
'.$thematicScore.'
</div>
</div>';
$thematicItemOne = '<div class="col-md-6 items-progress">
<div class="thematic-cont '.$class1.'">
<div class="topics">' . $subTitle1 . '</div>
<h4 class="title-topics">' . Display::returnFontAswesomeIcon('book') . $thematic_info['title'] . '</h4>
<p class="date">' . Display::returnFontAswesomeIcon('calendar-o') . $thematic_advance_info['start_date'] . '</p>
<div class="views">' . Display::returnFontAswesomeIcon('file-text-o') . strip_tags($thematic_advance_info['content']). '</div>
<p class="time">'. Display::returnFontAswesomeIcon('clock-o') . get_lang('DurationInHours') . ' : ' . $thematic_advance_info['duration'] . ' - <a href="' . $thematicUrl . '">' . get_lang('SeeDetail') . '</a></p>
</div>
</div>';
$thematicItemOne = '
<div class="col-md-6 items-progress">
<div class="thematic-cont '.$class1.'">
<div class="topics">' . $subTitle1 . '</div>
<h4 class="title-topics">' . Display::returnFontAwesomeIcon('book') . $thematic_info['title'] . '</h4>
<p class="date">' . Display::returnFontAwesomeIcon('calendar-o') . $thematic_advance_info['start_date'] . '</p>
<div class="views">' . Display::returnFontAwesomeIcon('file-text-o') . strip_tags($thematic_advance_info['content']). '</div>
<p class="time">'. Display::returnFontAwesomeIcon('clock-o') . get_lang('DurationInHours') . ' : ' . $thematic_advance_info['duration'] . ' - <a href="' . $thematicUrl . '">' . get_lang('SeeDetail') . '</a></p>
</div>
</div>';
if (!empty($thematic_advance_info2)) {
$thematic_info2 = $thematic->get_thematic_list($thematic_advance_info2['thematic_id']);
@ -280,15 +281,15 @@ if ($tool == TOOL_COURSE_HOMEPAGE && !isset($_GET['intro_cmdEdit'])) {
<div class="col-md-6 items-progress">
<div class="thematic-cont">
<div class="topics">'.$subTitle2.'</div>
<h4 class="title-topics">'. Display::returnFontAswesomeIcon('book') . $thematic_info2['title'].'</h4>
<p class="date">' . Display::returnFontAswesomeIcon('calendar-o') .$thematic_advance_info2['start_date'].'</p>
<div class="views">' . Display::returnFontAswesomeIcon('file-text-o') . strip_tags($thematic_advance_info2['content']).'</div>
<p class="time">'. Display::returnFontAswesomeIcon('clock-o') .get_lang('DurationInHours').' : '.$thematic_advance_info2['duration'].' - <a href="'.$thematicUrl.'">'.get_lang('SeeDetail').'</a></p>
<h4 class="title-topics">'. Display::returnFontAwesomeIcon('book') . $thematic_info2['title'].'</h4>
<p class="date">' . Display::returnFontAwesomeIcon('calendar-o') .$thematic_advance_info2['start_date'].'</p>
<div class="views">' . Display::returnFontAwesomeIcon('file-text-o') . strip_tags($thematic_advance_info2['content']).'</div>
<p class="time">'. Display::returnFontAwesomeIcon('clock-o') .get_lang('DurationInHours').' : '.$thematic_advance_info2['duration'].' - <a href="'.$thematicUrl.'">'.get_lang('SeeDetail').'</a></p>
</div>
</div>';
}
$thematicPanel = '<div class="row">';
$thematicPanel .= '<div class="col-md-2">' . $infoUser . '</div>';
$thematicPanel .= '<div class="col-md-10"><div class="row">' . $thematicItemOne . $thematicItemTwo . '</div></div>';

@ -4600,7 +4600,7 @@ class CourseManager
//Course visibility
if ($access_link && in_array('register', $access_link)) {
$my_course['extra_info']['register_button'] = Display::url(
Display::returnFontAswesomeIcon('sign-in'),
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')));
}
@ -4609,14 +4609,14 @@ class CourseManager
$access_link) || $course_info['visibility'] == COURSE_VISIBILITY_OPEN_WORLD
) {
$my_course['extra_info']['go_to_course_button'] = Display::url(
Display::returnFontAswesomeIcon('share'),
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::returnFontAswesomeIcon('sign-out'),
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')));
}
@ -4627,13 +4627,13 @@ class CourseManager
$my_course_code_list)
) { */
$my_course['extra_info']['description_button'] = Display::url(
Display::returnFontAswesomeIcon('info-circle'),
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') */

@ -1881,6 +1881,7 @@ class Display
* Prints a tooltip
* @param string $text
* @param string $tip
*
* @return string
*/
public static function tip($text, $tip)
@ -2071,15 +2072,16 @@ class Display
return $editProfileUrl;
}
/**
* Get the vCard for a user
* @param int $userId The user id
* @return *.*vcf file
* @return string *.*vcf file
*/
public static function getVCardUserLink($userId)
{
{
$vCardUrl = api_get_path(WEB_PATH).'main/social/vcard_export.php?userId='.intval($userId);;
return $vCardUrl;
}
@ -2128,8 +2130,13 @@ class Display
* @param array $attributes The additional attributes
* @return string The button HTML
*/
public static function toolbarButton($text, $url, $icon = 'check', $type = 'default', array $attributes = [])
{
public static function toolbarButton(
$text,
$url,
$icon = 'check',
$type = 'default',
array $attributes = []
) {
$buttonClass = "btn btn-$type";
$icon = self::tag('i', null, ['class' => "fa fa-$icon"]);
$attributes['class'] = isset($attributes['class']) ? "$buttonClass {$attributes['class']}" : $buttonClass;
@ -2179,17 +2186,17 @@ class Display
* Get a HTML code for a icon by Font Awesome
* @param string $name The icon name
* @param boolean $fixWidth Optional. Whether add the fw class
* @param int|string $size Optional. The size for the icon.
* @param string $aditionalClass Optional. Additional class
* @param int|string $size Optional. The size for the icon.
* @param string $additionalClass Optional. Additional class
*
* @return string
*/
public static function returnFontAswesomeIcon(
public static function returnFontAwesomeIcon(
$name,
$fixWidth = false,
$size = null,
$aditionalClass = null
)
{
$additionalClass = null
) {
$className = "fa fa-$name";
if ($fixWidth) {
@ -2211,24 +2218,44 @@ class Display
break;
}
if (!empty($aditionalClass)) {
$className .= " $aditionalClass";
if (!empty($additionalClass)) {
$className .= " $additionalClass";
}
$icon = self::tag('em', null, ['class' => $className]);
return "$icon ";
}
public static function panelCollapse($title, $content, $id = null, $params = null, $idAccordion = null, $idCollpase = null, $open = true, $arrow = false)
{
/**
* @param string $title
* @param string $content
* @param null $id
* @param array $params
* @param null $idAccordion
* @param null $idCollapse
* @param bool|true $open
* @param bool|false $arrow
* @return null|string
*/
public static function panelCollapse(
$title,
$content,
$id = null,
$params = array(),
$idAccordion = null,
$idCollapse = null,
$open = true,
$arrow = false
) {
if (!empty($idAccordion)) {
$html = null;
$html .= '<div class="panel-group" id="'.$idAccordion.'" role="tablist" aria-multiselectable="true">' . PHP_EOL;
$html .= '<div class="panel panel-default" id="'.$id.'">' . PHP_EOL;
$html .= '<div class="panel-heading" role="tab"><h4 class="panel-title">' . PHP_EOL;
$html .= '<a class="' . ($arrow===true?'arrow':'') . ' '.($open===true?'':'collapsed').'" role="button" data-toggle="collapse" data-parent="#'.$idAccordion.'" href="#'.$idCollpase.'" aria-expanded="true" aria-controls="'.$idCollpase.'">'.$title.'</a>' . PHP_EOL;
$html .= '<a class="' . ($arrow===true?'arrow':'') . ' '.($open===true?'':'collapsed').'" role="button" data-toggle="collapse" data-parent="#'.$idAccordion.'" href="#'.$idCollapse.'" aria-expanded="true" aria-controls="'.$idCollapse.'">'.$title.'</a>' . PHP_EOL;
$html .= '</h4></div>' . PHP_EOL;
$html .= '<div id="'.$idCollpase.'" class="panel-collapse collapse '.($open===true?'in':'').'" role="tabpanel">' . PHP_EOL;
$html .= '<div id="'.$idCollapse.'" class="panel-collapse collapse '.($open===true?'in':'').'" role="tabpanel">' . PHP_EOL;
$html .= '<div class="panel-body">'.$content.'</div>' . PHP_EOL;
$html .= '</div></div></div>' . PHP_EOL;

@ -45,7 +45,7 @@ $template->assign('block_friends', $friend_html);
$content = $template->fetch('default/chat/video.tpl');
$templateHeader = Display::returnFontAswesomeIcon('video-camera', true, 'lg')
$templateHeader = Display::returnFontAwesomeIcon('video-camera', true, 'lg')
. $chatVideo->getRoomName();
$template->assign('header', $templateHeader);

@ -1899,7 +1899,7 @@ class learnpath
$this->index = count($this->ordered_items) - 1;
return $this->ordered_items[$this->index];
}
return false;
}
@ -3115,7 +3115,7 @@ class learnpath
}
//$html = '<div id="scorm_title" class="scorm-heading">'.Security::remove_XSS($this->get_name()) . '</div>';
$html = '<div class="scorm-body">';
$html .= '<div id="inner_lp_toc" class="inner_lp_toc scrollbar-light">';
require_once 'resourcelinker.inc.php';
@ -3212,18 +3212,18 @@ class learnpath
$html .= "</div>";
return $html;
}
/**
* Returns an HTML-formatted string ready to display with teacher buttons
* in LP view menu
* @return string HTML TOC ready to display
*/
public function get_teacher_toc_buttons()
{
{
$is_allowed_to_edit = api_is_allowed_to_edit(null, true, false, false);
$hide_teacher_icons_lp = api_get_configuration_value('hide_teacher_icons_lp');
$html = '';
if ($is_allowed_to_edit && $hide_teacher_icons_lp == false) {
$gradebook = '';
if (!empty($_GET['gradebook'])) {
@ -3232,15 +3232,18 @@ class learnpath
if ($this->get_lp_session_id() == api_get_session_id()) {
$html .= '<div id="actions_lp" class="actions_lp">';
$html .= '<div class="btn-group">';
$html .= "<a class='btn btn-sm btn-default' href='lp_controller.php?" . api_get_cidreq()."&gradebook=$gradebook&action=build&lp_id=" . $this->lp_id . "' target='_parent'>" . Display::returnFontAswesomeIcon('street-view') . get_lang('Overview') . "</a>";
$html .= "<a class='btn btn-sm btn-default' href='lp_controller.php?" . api_get_cidreq()."&action=add_item&type=step&lp_id=" . $this->lp_id . "' target='_parent'>" . Display::returnFontAswesomeIcon('pencil') . get_lang('Edit') . "</a>";
$html .= '<a class="btn btn-sm btn-default" href="lp_controller.php?'.api_get_cidreq()."&gradebook=$gradebook&action=edit&lp_id=" . $this->lp_id.'">' . Display::returnFontAswesomeIcon('cog') . get_lang('Settings').'</a>';
$html .= "<a class='btn btn-sm btn-default' href='lp_controller.php?" . api_get_cidreq()."&gradebook=$gradebook&action=build&lp_id=" . $this->lp_id . "' target='_parent'>" .
Display::returnFontAwesomeIcon('street-view') . get_lang('Overview') . "</a>";
$html .= "<a class='btn btn-sm btn-default' href='lp_controller.php?" . api_get_cidreq()."&action=add_item&type=step&lp_id=" . $this->lp_id . "' target='_parent'>" .
Display::returnFontAwesomeIcon('pencil') . get_lang('Edit') . "</a>";
$html .= '<a class="btn btn-sm btn-default" href="lp_controller.php?'.api_get_cidreq()."&gradebook=$gradebook&action=edit&lp_id=" . $this->lp_id.'">' .
Display::returnFontAwesomeIcon('cog') . get_lang('Settings').'</a>';
$html .= '</div>';
$html .= '</div>';
}
}
return $html;
}
/**
* Gets the learnpath maker name - generally the editor's name

@ -229,12 +229,12 @@ if ($showCourses && $action != 'display_sessions') {
$html .= '<div class="toolbar">';
$html .= '<div class="btn-group">';
// if user registered as student
$html .= return_description_button($course, $icon_title);
if ($user_registerd_in_course_as_student) {
$html .= return_already_registered_label('student');
if (!$course_closed) {
if ($course_unsubscribe_allowed) {
$html .= return_unregister_button($course, $stok, $search_term, $code);
@ -248,7 +248,7 @@ if ($showCourses && $action != 'display_sessions') {
$html .= return_unregister_button($course, $stok, $search_term, $code);
}
$html .= return_already_registered_label('teacher');
} else {
// if user not registered in the course
if (!$course_closed) {
@ -259,7 +259,7 @@ if ($showCourses && $action != 'display_sessions') {
}
}
}
}
$html .= '</div>';
$html .= '</div>';
@ -345,7 +345,8 @@ function return_description_button($course, $icon_title)
$title = $course['title'];
$html = '';
if (api_get_setting('show_courses_descriptions_in_catalog') == 'true') {
$html = '<a data-title="' . $title . '" class="ajax btn btn-default btn-sm" href="'.api_get_path(WEB_CODE_PATH).'inc/ajax/course_home.ajax.php?a=show_course_information&code='.$course['code'].'" title="' . get_lang('Description') . '">' . Display::returnFontAswesomeIcon('info-circle') . '</a>';
$html = '<a data-title="' . $title . '" class="ajax btn btn-default btn-sm" href="'.api_get_path(WEB_CODE_PATH).'inc/ajax/course_home.ajax.php?a=show_course_information&code='.$course['code'].'" title="' . get_lang('Description') . '">' .
Display::returnFontAwesomeIcon('info-circle') . '</a>';
}
return $html;
@ -357,7 +358,8 @@ function return_description_button($course, $icon_title)
*/
function return_goto_button($course)
{
$html = ' <a class="btn btn-default btn-sm" title="' . get_lang('GoToCourse') . '" href="'.api_get_course_url($course['code']).'">'.Display::returnFontAswesomeIcon('share').'</a>';
$html = ' <a class="btn btn-default btn-sm" title="' . get_lang('GoToCourse') . '" href="'.api_get_course_url($course['code']).'">'.
Display::returnFontAwesomeIcon('share').'</a>';
return $html;
}
@ -372,7 +374,11 @@ function return_already_registered_label($in_status)
if ($in_status == 'student') {
$icon = Display::return_icon('user.png', get_lang('Student'), null, ICON_SIZE_TINY);
}
$html = Display::tag('button',$icon, array('id' => 'register', 'class' => 'btn btn-default btn-sm', 'title' => get_lang("AlreadyRegisteredToCourse")));
$html = Display::tag(
'button',
$icon,
array('id' => 'register', 'class' => 'btn btn-default btn-sm', 'title' => get_lang("AlreadyRegisteredToCourse"))
);
return $html;
}
@ -386,7 +392,8 @@ function return_already_registered_label($in_status)
*/
function return_register_button($course, $stok, $code, $search_term)
{
$html = ' <a class="btn btn-success btn-sm" title="' . get_lang('Subscribe') . '" href="'.api_get_self().'?action=subscribe_course&sec_token='.$stok.'&subscribe_course='.$course['code'].'&search_term='.$search_term.'&category_code='.$code.'">' . Display::returnFontAswesomeIcon('sign-in') . '</a>';
$html = ' <a class="btn btn-success btn-sm" title="' . get_lang('Subscribe') . '" href="'.api_get_self().'?action=subscribe_course&sec_token='.$stok.'&subscribe_course='.$course['code'].'&search_term='.$search_term.'&category_code='.$code.'">' .
Display::returnFontAwesomeIcon('sign-in') . '</a>';
return $html;
}
@ -399,6 +406,7 @@ function return_register_button($course, $stok, $code, $search_term)
*/
function return_unregister_button($course, $stok, $search_term, $code)
{
$html = ' <a class="btn btn-danger btn-sm" title="' . get_lang('Unsubscribe') . '" href="'. api_get_self().'?action=unsubscribe&sec_token='.$stok.'&unsubscribe='.$course['code'].'&search_term='.$search_term.'&category_code='.$code.'">' . Display::returnFontAswesomeIcon('sign-out') . '</a>';
$html = ' <a class="btn btn-danger btn-sm" title="' . get_lang('Unsubscribe') . '" href="'. api_get_self().'?action=unsubscribe&sec_token='.$stok.'&unsubscribe='.$course['code'].'&search_term='.$search_term.'&category_code='.$code.'">' .
Display::returnFontAwesomeIcon('sign-out') . '</a>';
return $html;
}

@ -270,7 +270,7 @@ $course_name = get_lang('Course').' '.$courseInfo['name'];
if ($session_id) {
$titleSession = Display::return_icon('session.png', get_lang('Session'), array(), ICON_SIZE_SMALL).' '.api_get_session_name($session_id);
$titleCourse = Display::return_icon('course.png', get_lang('Course'), array(), ICON_SIZE_SMALL).' '.$course_name;
} else {
$titleSession = Display::return_icon('course.png', get_lang('Course'), array(), ICON_SIZE_SMALL).' '.$courseInfo['name'];
}
@ -280,7 +280,7 @@ $teacherList = CourseManager::get_teacher_list_from_course_code_to_string(
$courseInfo['code'],
',',
false,
true
true
);
$coaches = null;
@ -290,7 +290,7 @@ if (!empty($session_id)) {
$courseInfo['real_id'],
',',
false,
true
true
);
}
$html = '';
@ -345,7 +345,7 @@ if (count($a_students) > 0) {
);
$el = $form->addSelect(
'since',
Display::returnFontAswesomeIcon('warning') . get_lang('RemindInactivesLearnersSince'),
Display::returnFontAwesomeIcon('warning') . get_lang('RemindInactivesLearnersSince'),
$options,
['class' => 'col-sm-3']
);

Loading…
Cancel
Save