Fixing classes.php due the last changed

skala
Julio Montoya 14 years ago
parent ef9cf2baff
commit 3ffaf8c023
  1. 6
      main/user/classes.php
  2. 14
      user_portal.php

@ -5,9 +5,9 @@
* @author Julio Montoya <gugli100@gmail.com>
*/
$language_file = array('userInfo');
$language_file = array('userInfo','admin');
$cidReset=true;
require_once './main/inc/global.inc.php';
require_once '../inc/global.inc.php';
require_once api_get_path(LIBRARY_PATH).'usergroup.lib.php';
@ -38,7 +38,7 @@ if (!empty($usergroup_list)) {
}
} else {
if (api_is_platform_admin()) {
Display::display_normal_message(Display::url(get_lang('CreateAClass') ,api_get_path(WEB_CODE_PATH).'admin/usergroups.php?action=add'), false);
Display::display_normal_message(Display::url(get_lang('AddClasses') ,api_get_path(WEB_CODE_PATH).'admin/usergroups.php?action=add'), false);
}
}

@ -648,23 +648,21 @@ if (api_get_setting('search_enabled') == 'true') {
echo show_right_block(get_lang('Search'), $search_content);
}
if (api_get_setting('show_groups_to_users') == 'true') {
if (api_get_setting('show_groups_to_users') == 'true') {
require_once api_get_path(LIBRARY_PATH).'usergroup.lib.php';
$usergroup = new Usergroup();
$usergroup_list = $usergroup->get_usergroup_by_user(api_get_user_id());
$classes = '';
if (!empty($usergroup_list)) {
if (!empty($usergroup_list)) {
foreach($usergroup_list as $group_id) {
$data = $usergroup->get($group_id);
$data['name'] = Display::url($data['name'], api_get_path(WEB_PATH).'classes.php?id='.$data['id']);
$data['name'] = Display::url($data['name'], api_get_path(WEB_CODE_PATH).'user/classes.php?id='.$data['id']);
$classes .= Display::tag('li', $data['name']);
}
}
}
}
if (api_is_platform_admin()) {
$classes .= Display::tag('li', Display::url(get_lang('AddClasses') ,api_get_path(WEB_CODE_PATH).'admin/usergroups.php?action=add'));
}
}
if (!empty($classes)) {
$classes = Display::tag('ul', $classes, array('class'=>'menulist'));
echo show_right_block(get_lang('Classes'), $classes);

Loading…
Cancel
Save