|
|
|
|
@ -1557,90 +1557,6 @@ class learnpath |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Gets all the chapters belonging to the same parent as the item/chapter given |
|
|
|
|
* Can also be called as abstract method. |
|
|
|
|
* |
|
|
|
|
* @deprecated not used |
|
|
|
|
* |
|
|
|
|
* @param int $id Item ID |
|
|
|
|
* |
|
|
|
|
* @return array A list of all the "brother items" (or an empty array on failure) |
|
|
|
|
*/ |
|
|
|
|
public function getSiblingDirectories($id) |
|
|
|
|
{ |
|
|
|
|
$course_id = api_get_course_int_id(); |
|
|
|
|
|
|
|
|
|
if (empty($id) || $id != strval(intval($id))) { |
|
|
|
|
return []; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$lp_item = Database::get_course_table(TABLE_LP_ITEM); |
|
|
|
|
$sql_parent = "SELECT * FROM $lp_item |
|
|
|
|
WHERE iid = $id AND item_type='dir'"; |
|
|
|
|
$res_parent = Database::query($sql_parent); |
|
|
|
|
if (Database::num_rows($res_parent) > 0) { |
|
|
|
|
$row_parent = Database::fetch_array($res_parent); |
|
|
|
|
$parent = $row_parent['parent_item_id']; |
|
|
|
|
$sql = "SELECT * FROM $lp_item |
|
|
|
|
WHERE |
|
|
|
|
parent_item_id = $parent AND |
|
|
|
|
iid = $id AND |
|
|
|
|
item_type='dir' |
|
|
|
|
ORDER BY display_order"; |
|
|
|
|
$res_bros = Database::query($sql); |
|
|
|
|
|
|
|
|
|
$list = []; |
|
|
|
|
while ($row_bro = Database::fetch_array($res_bros)) { |
|
|
|
|
$list[] = $row_bro; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return $list; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return []; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Gets all the items belonging to the same parent as the item given |
|
|
|
|
* Can also be called as abstract method. |
|
|
|
|
* |
|
|
|
|
* @deprecated not used |
|
|
|
|
* |
|
|
|
|
* @param int $id Item ID |
|
|
|
|
* |
|
|
|
|
* @return array A list of all the "brother items" (or an empty array on failure) |
|
|
|
|
*/ |
|
|
|
|
public function get_brother_items($id) |
|
|
|
|
{ |
|
|
|
|
$course_id = api_get_course_int_id(); |
|
|
|
|
|
|
|
|
|
if (empty($id) || $id != strval(intval($id))) { |
|
|
|
|
return []; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$lp_item = Database::get_course_table(TABLE_LP_ITEM); |
|
|
|
|
$sql_parent = "SELECT * FROM $lp_item |
|
|
|
|
WHERE iid = $id"; |
|
|
|
|
$res_parent = Database::query($sql_parent); |
|
|
|
|
if (Database::num_rows($res_parent) > 0) { |
|
|
|
|
$row_parent = Database::fetch_array($res_parent); |
|
|
|
|
$parent = $row_parent['parent_item_id']; |
|
|
|
|
$sql = "SELECT * FROM $lp_item |
|
|
|
|
WHERE c_id = $course_id AND parent_item_id = $parent |
|
|
|
|
ORDER BY display_order"; |
|
|
|
|
$res_bros = Database::query($sql); |
|
|
|
|
$list = []; |
|
|
|
|
while ($row_bro = Database::fetch_array($res_bros)) { |
|
|
|
|
$list[] = $row_bro; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return $list; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return []; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Get the specific prefix index terms of this learning path. |
|
|
|
|
* |
|
|
|
|
|