diff --git a/main/link/link.php b/main/link/link.php index 00a2d95cbe..0cc7e321c5 100755 --- a/main/link/link.php +++ b/main/link/link.php @@ -1,36 +1,35 @@ - category-less link is always visible. -* -* @author Patrick Cool, main author, completely rewritten -* @author René Haentjens, added CSV file import (October 2004) -* @package chamilo.link -* @todo improve organisation, tables should come from database library -*/ - -/* - INIT SECTION -*/ -// name of the language file that needs to be included -$language_file = array('link','admin'); - -// including libraries -require_once "../inc/global.inc.php"; -require_once "linkfunctions.php"; - - -$this_section=SECTION_COURSES; + * Main script for the links tool. + * + * Features: + * - Organize links into categories; + * - favorites/bookmarks-like interface; + * - move links up/down within a category; + * - move categories up/down; + * - expand/collapse all categories (except the main "non"-category); + * - add link to 'root' category => category-less link is always visible. + * + * @author Patrick Cool, main author, completely rewritten + * @author René Haentjens, added CSV file import (October 2004) + * @package chamilo.link + * @todo improve organisation, tables should come from database library + */ + +/* INIT SECTION */ + +// Language files that need to be included +$language_file = array('link', 'admin'); + +// Including libraries +require_once '../inc/global.inc.php'; +require_once 'linkfunctions.php'; + +$this_section = SECTION_COURSES; api_protect_course_script(); + $htmlHeadXtra[] = ''; //jQuery $htmlHeadXtra[] = ''; - -// div_target // @todo change the $_REQUEST into $_POST or $_GET // @todo remove this code -$link_submitted = (isset($_POST['submitLink'])?true:false); -$category_submitted = (isset($_POST['submitCategory'])?true:false); -$urlview = (!empty($_GET['urlview'])?$_GET['urlview']:''); -$submitImport = (!empty($_POST['submitImport'])?$_POST['submitImport']:''); -$down = (!empty($_GET['down'])?$_GET['down']:''); -$up = (!empty($_GET['up'])?$_GET['up']:''); -$catmove = (!empty($_GET['catmove'])?$_GET['catmove']:''); -$editlink = (!empty($_REQUEST['editlink'])?$_REQUEST['editlink']:''); -$id = (!empty($_REQUEST['id'])?$_REQUEST['id']:''); -$urllink = (!empty($_REQUEST['urllink'])?$_REQUEST['urllink']:''); -$title = (!empty($_REQUEST['title'])?$_REQUEST['title']:''); -$description = (!empty($_REQUEST['description'])?$_REQUEST['description']:''); -$selectcategory = (!empty($_REQUEST['selectcategory'])?$_REQUEST['selectcategory']:''); -$submitLink = (isset($_REQUEST['submitLink'])?true : false); -$action = (!empty($_REQUEST['action'])?$_REQUEST['action']:''); -$category_title = (!empty($_REQUEST['category_title'])?$_REQUEST['category_title']:''); -$submitCategory = isset($_POST['submitCategory'])?true:false; +$link_submitted = isset($_POST['submitLink']); +$category_submitted = isset($_POST['submitCategory']); +$urlview = !empty($_GET['urlview']) ? $_GET['urlview'] : ''; +$submit_import = !empty($_POST['submitImport']) ? $_POST['submitImport'] : ''; +$down = !empty($_GET['down']) ? $_GET['down'] : ''; +$up = !empty($_GET['up']) ? $_GET['up'] : ''; +$catmove = !empty($_GET['catmove']) ? $_GET['catmove'] : ''; +$editlink = !empty($_REQUEST['editlink']) ? $_REQUEST['editlink'] : ''; +$id = !empty($_REQUEST['id']) ? $_REQUEST['id'] : ''; +$urllink = !empty($_REQUEST['urllink']) ? $_REQUEST['urllink'] : ''; +$title = !empty($_REQUEST['title']) ? $_REQUEST['title'] : ''; +$description = !empty($_REQUEST['description']) ? $_REQUEST['description'] : ''; +$selectcategory = !empty($_REQUEST['selectcategory']) ? $_REQUEST['selectcategory'] : ''; +$submit_link = isset($_REQUEST['submitLink']); +$action = !empty($_REQUEST['action']) ? $_REQUEST['action'] : ''; +$category_title = !empty($_REQUEST['category_title']) ? $_REQUEST['category_title'] : ''; +$submit_category = isset($_POST['submitCategory']); + $nameTools = get_lang('Links'); -//condition for the session +// Condition for the session $session_id = api_get_session_id(); $condition_session = api_get_session_condition($session_id, false); -if (isset($_GET['action']) && $_GET['action']=='addlink') { +if (isset($_GET['action']) && $_GET['action'] == 'addlink') { $nameTools = ''; - $interbreadcrumb[] = array ('url' => 'link.php', 'name' => get_lang('Links')); - $interbreadcrumb[] = array ('url' => 'link.php?action=addlink', 'name' => get_lang('AddLink')); + $interbreadcrumb[] = array('url' => 'link.php', 'name' => get_lang('Links')); + $interbreadcrumb[] = array('url' => 'link.php?action=addlink', 'name' => get_lang('AddLink')); } -if (isset($_GET['action']) && $_GET['action']=='addcategory') { +if (isset($_GET['action']) && $_GET['action'] == 'addcategory') { $nameTools = ''; - $interbreadcrumb[] = array ('url' => 'link.php', 'name' => get_lang('Links')); - $interbreadcrumb[] = array ('url' => 'link.php?action=addcategory', 'name' => get_lang('AddCategory')); + $interbreadcrumb[] = array('url' => 'link.php', 'name' => get_lang('Links')); + $interbreadcrumb[] = array('url' => 'link.php?action=addcategory', 'name' => get_lang('AddCategory')); } -if (isset($_GET['action']) && $_GET['action']=='editlink') { +if (isset($_GET['action']) && $_GET['action'] == 'editlink') { $nameTools = ''; - $interbreadcrumb[] = array ('url' => 'link.php', 'name' => get_lang('Links')); - $interbreadcrumb[] = array ('url' => '#', 'name' => get_lang('EditLink')); + $interbreadcrumb[] = array('url' => 'link.php', 'name' => get_lang('Links')); + $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('EditLink')); } - // Database Table definitions $tbl_link = Database::get_course_table(TABLE_LINK); $tbl_categories = Database::get_course_table(TABLE_LINK_CATEGORY); -//statistics +// Statistics event_access_tool(TOOL_LINK); Display::display_header($nameTools, 'Links'); + ?>