*/ // name of the language file that needs to be included $language_file='admin'; // resetting the course id $cidReset=true; // including some necessary dokeos files require_once '../inc/global.inc.php'; require_once api_get_path(LIBRARY_PATH).'urlmanager.lib.php'; require_once api_get_path(LIBRARY_PATH).'access_url_edit_sessions_to_url_functions.lib.php'; $xajax = new xajax(); $xajax -> registerFunction (array('search_sessions', 'Accessurleditsessionstourl', 'search_sessions')); // setting the section (for the tabs) $this_section = SECTION_PLATFORM_ADMIN; // Access restrictions api_protect_global_admin_script(); if (!$_configuration['multiple_access_urls']) { header('Location: index.php'); exit; } // Database Table Definitions $tbl_access_url_rel_session = Database :: get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION); $tbl_session = Database :: get_main_table(TABLE_MAIN_SESSION); $tbl_access_url = Database :: get_main_table(TABLE_MAIN_ACCESS_URL); // setting breadcrumbs $tool_name = get_lang('EditSessionsToURL'); $interbreadcrumb[] = array ('url' => 'index.php', 'name' => get_lang('PlatformAdmin')); $interbreadcrumb[] = array ('url' => 'access_urls.php', 'name' => get_lang('MultipleAccessURLs')); $add_type = 'multiple'; if(isset($_REQUEST['add_type']) && $_REQUEST['add_type']!=''){ $add_type = Security::remove_XSS($_REQUEST['add_type']); } $access_url_id=1; if(isset($_REQUEST['access_url_id']) && $_REQUEST['access_url_id']!=''){ $access_url_id = Security::remove_XSS(intval($_REQUEST['access_url_id'])); } $xajax -> processRequests(); $htmlHeadXtra[] = $xajax->getJavascript('../inc/lib/xajax/'); $htmlHeadXtra[] = ' '; $form_sent=0; $errorMsg=''; $UserList=$SessionList=array(); $users=$sessions=array(); if($_POST['form_sent']) { $form_sent=$_POST['form_sent']; $session_list=$_POST['session_list']; if(!is_array($session_list)) { $session_list=array(); } if($form_sent == 1) { if ($access_url_id==0) { header('Location: access_url_edit_users_to_url.php?action=show_message&message='.get_lang('SelectURL')); exit; } elseif(is_array($session_list) ) { UrlManager::update_urls_rel_session($session_list,$access_url_id); header('Location: access_urls.php?action=show_message&message='.get_lang('SessionsWereEdited')); exit; } } } Display::display_header($tool_name); echo '
'; echo '
'.Display::return_icon('course_add.gif',get_lang('AddSessionsToURL'),'').get_lang('AddSessionsToURL').'

'; echo '
'; api_display_tool_title($tool_name); if ($_GET['action'] == 'show_message') Display :: display_normal_message(Security::remove_XSS(stripslashes($_GET['message']))); $no_session_list = $session_list = array(); $ajax_search = $add_type == 'unique' ? true : false; if($ajax_search) { $sessions=UrlManager::get_url_rel_session_data($access_url_id); foreach($sessions as $session) { $session_list[$session['id']] = $session ; } } else { $sessions=UrlManager::get_url_rel_session_data(); foreach($sessions as $session) { if($session['access_url_id'] == $access_url_id) { $session_list[$session['id']] = $session ; } } $tbl_course = Database :: get_main_table(TABLE_MAIN_COURSE); $sql="SELECT id, name FROM $tbl_session u ORDER BY name, id"; $result=Database::query($sql); $sessions=Database::store_result($result); $session_list_leys = array_keys($session_list); foreach($sessions as $session) { if (!in_array($session['id'],$session_list_leys)) $no_session_list[$session['id']] = $session ; } } if($add_type == 'multiple') { $link_add_type_unique = ''.get_lang('SessionAddTypeUnique').''; $link_add_type_multiple = get_lang('SessionAddTypeMultiple'); } else { $link_add_type_unique = get_lang('SessionAddTypeUnique'); $link_add_type_multiple = ''.get_lang('SessionAddTypeMultiple').''; } $url_list = UrlManager::get_url_data(); ?>
 | 


>

:









'.get_lang('AddSessionsToURL').''; else echo ''; ?>