Add conf variable for filter the session admin's block - refs BT#9325

1.9.x
Angel Fernando Quiroz Campos 11 years ago
parent 8cf85ce7c6
commit 56fbda7415
  1. 18
      main/admin/index.php
  2. 4
      main/install/configuration.dist.php

@ -112,16 +112,23 @@ if (api_is_platform_admin()) {
$items[] = array('url'=>'ldap_users_list.php', 'label' => get_lang('ImportLDAPUsersIntoPlatform')); $items[] = array('url'=>'ldap_users_list.php', 'label' => get_lang('ImportLDAPUsersIntoPlatform'));
} }
$items[] = array('url'=>'user_fields.php', 'label' => get_lang('ManageUserFields')); $items[] = array('url'=>'user_fields.php', 'label' => get_lang('ManageUserFields'));
$items[] = array('url'=>'usergroups.php', 'label' => get_lang('Classes'));
} elseif (
api_is_session_admin() &&
api_get_configuration_value('limit_session_admin_role')
) {
$items = array(
array('url'=>'user_list.php', 'label' => get_lang('UserList'))
);
} else { } else {
$items = array( $items = array(
array('url'=>'user_list.php', 'label' => get_lang('UserList')), array('url'=>'user_list.php', 'label' => get_lang('UserList')),
array('url'=>'user_add.php', 'label' => get_lang('AddUsers')), array('url'=>'user_add.php', 'label' => get_lang('AddUsers')),
array('url'=>'user_import.php', 'label' => get_lang('ImportUserListXMLCSV')), array('url'=>'user_import.php', 'label' => get_lang('ImportUserListXMLCSV')),
array('url'=>'usergroups.php', 'label' => get_lang('Classes'))
); );
} }
$items[] = array('url'=>'usergroups.php', 'label' => get_lang('Classes'));
$blocks['users']['items'] = $items; $blocks['users']['items'] = $items;
$blocks['users']['extra'] = null; $blocks['users']['extra'] = null;
@ -245,7 +252,13 @@ $search_form = ' <form method="GET" class="form-search" action="session_list.php
</form>'; </form>';
$blocks['sessions']['search_form'] = $search_form; $blocks['sessions']['search_form'] = $search_form;
$items = array(); $items = array();
$items[] = array('url'=>'session_list.php', 'label' => get_lang('ListSession')); $items[] = array('url'=>'session_list.php', 'label' => get_lang('ListSession'));
if (
!api_is_session_admin() ||
!api_get_configuration_value('limit_session_admin_role')
) {
$items[] = array('url'=>'session_add.php', 'label' => get_lang('AddSession')); $items[] = array('url'=>'session_add.php', 'label' => get_lang('AddSession'));
$items[] = array('url'=>'session_category_list.php', 'label' => get_lang('ListSessionCategory')); $items[] = array('url'=>'session_category_list.php', 'label' => get_lang('ListSessionCategory'));
$items[] = array('url'=>'session_import.php', 'label' => get_lang('ImportSessionListXMLCSV')); $items[] = array('url'=>'session_import.php', 'label' => get_lang('ImportSessionListXMLCSV'));
@ -255,6 +268,7 @@ if (isset($extAuthSource) && isset($extAuthSource['ldap']) && count($extAuthSour
} }
$items[] = array('url'=>'session_export.php', 'label' => get_lang('ExportSessionListXMLCSV')); $items[] = array('url'=>'session_export.php', 'label' => get_lang('ExportSessionListXMLCSV'));
$items[] = array('url'=>'../coursecopy/copy_course_session.php', 'label' => get_lang('CopyFromCourseInSessionToAnotherSession')); $items[] = array('url'=>'../coursecopy/copy_course_session.php', 'label' => get_lang('CopyFromCourseInSessionToAnotherSession'));
}
if (api_is_platform_admin()) { if (api_is_platform_admin()) {
if (is_dir(api_get_path(SYS_TEST_PATH).'datafiller/')) { // option only visible in development mode. Enable through code if required if (is_dir(api_get_path(SYS_TEST_PATH).'datafiller/')) { // option only visible in development mode. Enable through code if required

@ -295,3 +295,7 @@ $_configuration['system_stable'] = NEW_VERSION_STABLE;
//$_configuration['allow_delete_attendance'] = false; //$_configuration['allow_delete_attendance'] = false;
// Course log - Default columns to hide // Course log - Default columns to hide
//$_configuration['course_log_hide_columns'] = array(1, 9); //$_configuration['course_log_hide_columns'] = array(1, 9);
// Limit for the Session Admin role. The administration page show only
// User block -> Add user
// Course Sessions block -> Training session list
$_configuration['limit_session_admin_role'] = false;

Loading…
Cancel
Save