|
|
|
@ -331,7 +331,6 @@ class Link extends Model |
|
|
|
|
$description = trim($_POST['description']); |
|
|
|
|
|
|
|
|
|
if (empty($category_title)) { |
|
|
|
|
$msgErr = get_lang('GiveCategoryName'); |
|
|
|
|
Display:: display_error_message(get_lang('GiveCategoryName')); |
|
|
|
|
$ok = false; |
|
|
|
|
} else { |
|
|
|
@ -388,7 +387,6 @@ class Link extends Model |
|
|
|
|
$id = intval($id); |
|
|
|
|
|
|
|
|
|
if (empty($id)) { |
|
|
|
|
|
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -450,7 +448,7 @@ class Link extends Model |
|
|
|
|
public static function delete_link_from_search_engine($course_id, $link_id) |
|
|
|
|
{ |
|
|
|
|
// Remove from search engine if enabled. |
|
|
|
|
if (api_get_setting('search_enabled') == 'true') { |
|
|
|
|
if (api_get_setting('search_enabled') === 'true') { |
|
|
|
|
$tbl_se_ref = Database:: get_main_table( |
|
|
|
|
TABLE_MAIN_SEARCH_ENGINE_REF |
|
|
|
|
); |
|
|
|
@ -459,9 +457,7 @@ class Link extends Model |
|
|
|
|
$res = Database:: query($sql); |
|
|
|
|
if (Database:: num_rows($res) > 0) { |
|
|
|
|
$row = Database:: fetch_array($res); |
|
|
|
|
require_once api_get_path( |
|
|
|
|
LIBRARY_PATH |
|
|
|
|
) . 'search/ChamiloIndexer.class.php'; |
|
|
|
|
require_once api_get_path(LIBRARY_PATH) . 'search/ChamiloIndexer.class.php'; |
|
|
|
|
$di = new ChamiloIndexer(); |
|
|
|
|
$di->remove_document((int)$row['search_did']); |
|
|
|
|
} |
|
|
|
@ -588,15 +584,9 @@ class Link extends Model |
|
|
|
|
$res = Database:: query($sql); |
|
|
|
|
|
|
|
|
|
if (Database:: num_rows($res) > 0) { |
|
|
|
|
require_once api_get_path( |
|
|
|
|
LIBRARY_PATH |
|
|
|
|
).'search/ChamiloIndexer.class.php'; |
|
|
|
|
require_once api_get_path( |
|
|
|
|
LIBRARY_PATH |
|
|
|
|
).'search/IndexableChunk.class.php'; |
|
|
|
|
require_once api_get_path( |
|
|
|
|
LIBRARY_PATH |
|
|
|
|
).'specific_fields_manager.lib.php'; |
|
|
|
|
require_once api_get_path(LIBRARY_PATH).'search/ChamiloIndexer.class.php'; |
|
|
|
|
require_once api_get_path(LIBRARY_PATH).'search/IndexableChunk.class.php'; |
|
|
|
|
require_once api_get_path(LIBRARY_PATH).'specific_fields_manager.lib.php'; |
|
|
|
|
|
|
|
|
|
$se_ref = Database:: fetch_array($res); |
|
|
|
|
$specific_fields = get_specific_field_list(); |
|
|
|
@ -1260,10 +1250,7 @@ class Link extends Model |
|
|
|
|
WHERE c_id = $course_id AND " . $urleq . ' AND ' . $cateq |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
if (Database:: num_rows($result) >= 1 && ($row = Database:: fetch_array( |
|
|
|
|
$result |
|
|
|
|
)) |
|
|
|
|
) { |
|
|
|
|
if (Database:: num_rows($result) >= 1 && ($row = Database:: fetch_array($result))) { |
|
|
|
|
$sql = "UPDATE $tbl_link SET |
|
|
|
|
title = '" . Database:: escape_string($title) . "', |
|
|
|
|
description = '" . Database:: escape_string($description) . "' |
|
|
|
@ -1573,7 +1560,6 @@ class Link extends Model |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$header .= Security::remove_XSS($myrow['category_title']).'</a>'; |
|
|
|
|
|
|
|
|
|
$header .= '<div class="pull-right">'; |
|
|
|
|
if (api_is_allowed_to_edit(null, true)) { |
|
|
|
|
if ($session_id == $myrow['session_id']) { |
|
|
|
|