"index.php", "name" => get_lang('Sessions'));
$tool_name = get_lang('SessionList');
Display::display_header($tool_name);
$error_message = '';
if (isset($_GET['action']) && $_GET['action'] == 'show_message') {
$error_message = Security::remove_XSS($_GET['message']);
}
if (!empty($error_message)) {
Display::display_normal_message($error_message, false);
}
//jqgrid will use this URL to do the selects
$url = api_get_path(WEB_AJAX_PATH).'model.ajax.php?a=get_sessions&list_type='.$list_type;
if (isset($_REQUEST['keyword'])) {
//Begin with see the searchOper param
$url = api_get_path(WEB_AJAX_PATH).'model.ajax.php?a=get_sessions&_search=true&rows=20&page=1&sidx=&sord=asc&filters=&searchField=name&searchString='.Security::remove_XSS($_REQUEST['keyword']).'&searchOper=bw';
}
//Autowidth
$extra_params['autowidth'] = 'true';
//Height auto
$extra_params['height'] = '100%';
$extra_params['rowList'] = array(20, 50, 100, 250, 500);
$result = SessionManager::get_session_columns($list_type);
$columns = $result['columns'];
$column_model = $result['column_model'];
$extra_params['postData'] =array(
'filters' => array(
"groupOp" => "AND",
"rules" => $result['rules'],
/*array(
array( "field" => "display_start_date", "op" => "gt", "data" => ""),
array( "field" => "display_end_date", "op" => "gt", "data" => "")
),*/
//'groups' => $groups
)
);
//With this function we can add actions to the jgrid (edit, delete, etc)
$action_links = '
function action_formatter(cellvalue, options, rowObject) {
return \''.Display::return_icon('edit.png',get_lang('Edit'),'',ICON_SIZE_SMALL).''.
' '.Display::return_icon('user_subscribe_session.png',get_lang('SubscribeUsersToSession'),'',ICON_SIZE_SMALL).''.
' '.Display::return_icon('courses_to_session.png',get_lang('SubscribeCoursesToSession'),'',ICON_SIZE_SMALL).''.
' '.Display::return_icon('copy.png',get_lang('Copy'),'',ICON_SIZE_SMALL).''.
' '.Display::return_icon('delete.png',get_lang('Delete'),'',ICON_SIZE_SMALL).''.
'\';
}';
$url_select = api_get_path(WEB_AJAX_PATH).'extra_field.ajax.php?1=1';
?>
';
echo ''.Display::return_icon('new_session.png',get_lang('AddSession'),'',ICON_SIZE_MEDIUM).'';
echo ''.Display::return_icon('session_to_category.png',get_lang('AddSessionsInCategories'),'',ICON_SIZE_MEDIUM).'';
echo ''.Display::return_icon('folder.png',get_lang('ListSessionCategory'),'',ICON_SIZE_MEDIUM).'';
if ($list_type == 'complete') {
echo ''.Display::return_icon('view_remove.png',get_lang('Simple'),'',ICON_SIZE_MEDIUM).'';
} else {
echo ''.Display::return_icon('view_text.png',get_lang('Complete'),'',ICON_SIZE_MEDIUM).'';
}
echo '';
echo Display::grid_html('sessions');