Permalink
Browse files

Update link.lib.php

Add function inside the class.
  • Loading branch information...
jmontoyaa committed May 13, 2015
1 parent aa052c0 commit 23f2e7520be2c0c9e77e58d508023f39afb82f6c
Showing with 21 additions and 0 deletions.
  1. +21 −0 main/inc/lib/link.lib.php
@@ -456,6 +456,27 @@ function delete_link_from_search_engine($course_id, $link_id)
require_once(api_get_path(LIBRARY_PATH) . 'specific_fields_manager.lib.php');
delete_all_values_for_item($course_id, TOOL_DOCUMENT, $link_id);
}
/**
*
* Get link info
* @param int link id
* @return array link info
*
**/
public static function get_link_info($id)
{
$tbl_link = Database:: get_course_table(TABLE_LINK);
$course_id = api_get_course_int_id();
$sql = "SELECT * FROM " . $tbl_link . "
WHERE c_id = $course_id AND id='" . intval($id) . "' ";
$result = Database::query($sql);
$data = array();
if (Database::num_rows($result)) {
$data = Database::fetch_array($result);
}
return $data;
}
}
/**

0 comments on commit 23f2e75

Please sign in to comment.