From 0b7db08d30d443df44d60c7c555bb66ec7d3600a Mon Sep 17 00:00:00 2001 From: Isaac Flores Date: Wed, 12 Aug 2009 22:55:06 -0500 Subject: [PATCH] logic changes - Allow remove link de homepage --- main/link/linkfunctions.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/main/link/linkfunctions.php b/main/link/linkfunctions.php index f1fb2dd0c5..eec02ee15f 100644 --- a/main/link/linkfunctions.php +++ b/main/link/linkfunctions.php @@ -252,7 +252,11 @@ function deletelinkcategory($type) global $id; // -> items are no longer fysically deleted, but the visibility is set to 2 (in item_property). This will // make a restore function possible for the platform administrator - //$sql="DELETE FROM $tbl_link WHERE id='".$_GET['id']."'"; + if (isset($_GET['id']) && $_GET['id']==strval(intval($_GET['id']))) { + $sql="UPDATE $tbl_link SET on_homepage='0' WHERE id='".Database::escape_string($_GET['id'])."'"; + Database::query($sql,__FILE__,__LINE__); + } + api_item_property_update($_course, TOOL_LINK, $id, "delete", $_user['user_id']); delete_link_from_search_engine(api_get_course_id(), $id); $catlinkstatus = get_lang("LinkDeleted"); @@ -340,7 +344,7 @@ function editlinkcategory($type) // this is used to populate the link-form with the info found in the database $sql = "SELECT * FROM ".$tbl_link." WHERE id='".$_GET['id']."'"; $result = api_sql_query($sql, __FILE__, __LINE__); - if ($myrow = mysql_fetch_array($result)) + if ($myrow = Database::fetch_array($result)) { $urllink = $myrow["url"]; $title = $myrow["title"];