Skip to content

Commit aeac10a

Browse files
committed
Update link.lib.php
1 parent 23f2e75 commit aeac10a

File tree

1 file changed

+22
-21
lines changed

1 file changed

+22
-21
lines changed

Diff for: main/inc/lib/link.lib.php

+22-21
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,28 @@ public function updateLink($linkId, $linkUrl, $courseId = null, $sessionId = nul
103103

104104
return false;
105105
}
106+
107+
/**
108+
*
109+
* Get link info
110+
* @param int link id
111+
* @return array link info
112+
*
113+
**/
114+
public static function get_link_info($id)
115+
{
116+
$tbl_link = Database:: get_course_table(TABLE_LINK);
117+
$course_id = api_get_course_int_id();
118+
$sql = "SELECT * FROM " . $tbl_link . "
119+
WHERE c_id = $course_id AND id='" . intval($id) . "' ";
120+
$result = Database::query($sql);
121+
$data = array();
122+
if (Database::num_rows($result)) {
123+
$data = Database::fetch_array($result);
124+
}
125+
126+
return $data;
127+
}
106128
}
107129

108130
/**
@@ -456,27 +478,6 @@ function delete_link_from_search_engine($course_id, $link_id)
456478
require_once(api_get_path(LIBRARY_PATH) . 'specific_fields_manager.lib.php');
457479
delete_all_values_for_item($course_id, TOOL_DOCUMENT, $link_id);
458480
}
459-
460-
/**
461-
*
462-
* Get link info
463-
* @param int link id
464-
* @return array link info
465-
*
466-
**/
467-
public static function get_link_info($id)
468-
{
469-
$tbl_link = Database:: get_course_table(TABLE_LINK);
470-
$course_id = api_get_course_int_id();
471-
$sql = "SELECT * FROM " . $tbl_link . "
472-
WHERE c_id = $course_id AND id='" . intval($id) . "' ";
473-
$result = Database::query($sql);
474-
$data = array();
475-
if (Database::num_rows($result)) {
476-
$data = Database::fetch_array($result);
477-
}
478-
return $data;
479-
}
480481
}
481482

482483
/**

0 commit comments

Comments
 (0)