Fix PHp warning + rename function "get_link_info" to "getLinkInfo"

pull/2487/head
jmontoyaa 7 years ago
parent 51c5473217
commit 00d9f78b79
  1. 7
      main/inc/lib/link.lib.php
  2. 2
      main/link/link_goto.php
  3. 12
      main/lp/learnpath.class.php

@ -474,12 +474,11 @@ class Link extends Model
/**
*
* Get link info
* @param int link id
* @param integer $id
* @param int $id
* @return array link info
*
**/
public static function get_link_info($id)
public static function getLinkInfo($id)
{
$tbl_link = Database::get_course_table(TABLE_LINK);
$course_id = api_get_course_int_id();
@ -1693,7 +1692,7 @@ class Link extends Model
{
$course_id = api_get_course_int_id();
$session_id = api_get_session_id();
$linkInfo = self::get_link_info($linkId);
$linkInfo = self::getLinkInfo($linkId);
$categoryId = isset($linkInfo['category_id']) ? $linkInfo['category_id'] : '';
$lpId = isset($_GET['lp_id']) ? Security::remove_XSS($_GET['lp_id']) : null;

@ -20,7 +20,7 @@ $this_section = SECTION_COURSES;
$linkId = intval($_GET['link_id']);
$linkInfo = Link::get_link_info($linkId);
$linkInfo = Link::getLinkInfo($linkId);
$linkUrl = html_entity_decode(Security::remove_XSS($linkInfo['url']));
// Launch event
Event::event_link($linkId);

@ -12294,9 +12294,12 @@ EOD;
$origin = 'learnpath'
) {
$session_id = api_get_session_id();
$course_info = api_get_course_info_by_id($course_id);
$learningPathId = intval($learningPathId);
$id_in_path = intval($id_in_path);
$lpViewId = intval($lpViewId);
$em = Database::getManager();
$lpItemRepo = $em->getRepository('ChamiloCourseBundle:CLpItem');
/** @var CLpItem $rowItem */
@ -12310,7 +12313,6 @@ EOD;
return -1;
}
$course_info = api_get_course_info_by_id($course_id);
$course_code = $course_info['code'];
$type = $rowItem->getItemType();
$id = empty($rowItem->getPath()) ? '0' : $rowItem->getPath();
@ -12326,9 +12328,11 @@ EOD;
case TOOL_ANNOUNCEMENT:
return $main_dir_path.'announcements/announcements.php?ann_id='.$id.'&'.$extraParams;
case TOOL_LINK:
$linkInfo = Link::get_link_info($id);
return $linkInfo['url'];
$linkInfo = Link::getLinkInfo($id);
if (isset($linkInfo['url'])) {
return $linkInfo['url'];
}
return '';
case TOOL_QUIZ:
if (empty($id)) {
return '';

Loading…
Cancel
Save