Skip to content

Commit 23f2e75

Browse files
committed
Update link.lib.php
Add function inside the class.
1 parent aa052c0 commit 23f2e75

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

main/inc/lib/link.lib.php

+21
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,27 @@ function delete_link_from_search_engine($course_id, $link_id)
456456
require_once(api_get_path(LIBRARY_PATH) . 'specific_fields_manager.lib.php');
457457
delete_all_values_for_item($course_id, TOOL_DOCUMENT, $link_id);
458458
}
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+
}
459480
}
460481

461482
/**

0 commit comments

Comments
 (0)