diff --git a/index.php b/index.php index 499787a0aa..3c39a1c63c 100644 --- a/index.php +++ b/index.php @@ -133,7 +133,7 @@ if (!api_is_anonymous()) { $controller->tpl->assign('profile_block', $controller->return_profile_block()); if (api_is_platform_admin()) { - $controller->tpl->assign('account_block', $controller->return_account_block()); + $controller->tpl->assign('course_block', $controller->return_course_block()); } else { $controller->tpl->assign('teacher_block', $controller->return_teacher_link()); } @@ -142,7 +142,10 @@ if (!api_is_anonymous()) { $controller->tpl->assign('hot_courses', $controller->return_hot_courses()); $controller->tpl->assign('announcements_block', $controller->return_announcements()); $controller->tpl->assign('home_page_block', $controller->return_home_page()); + $controller->tpl->assign('notice_block', $controller->return_notice()); +$controller->tpl->assign('main_navigation_block', $controller->return_navigation_links()); +$controller->tpl->assign('help_block', $controller->return_help()); if (api_is_platform_admin() || api_is_drh()) { $controller->tpl->assign('skills_block', $controller->return_skills_links()); diff --git a/main/inc/lib/userportal.lib.php b/main/inc/lib/userportal.lib.php index 3e266474b7..23c0015c94 100644 --- a/main/inc/lib/userportal.lib.php +++ b/main/inc/lib/userportal.lib.php @@ -220,11 +220,6 @@ class IndexManager { $show_create_link = false; $show_course_link = false; - if ($display_add_course_link) { - $show_menu = true; - $show_create_link = true; - } - if (api_is_platform_admin() || api_is_course_admin() || api_is_allowed_to_create_course()) { $show_menu = true; $show_course_link = true; @@ -261,7 +256,7 @@ class IndexManager { } if (!empty($html)) { - $html = self::show_right_block(get_lang('MenuUser'), $html); + $html = self::show_right_block(get_lang('Courses'), $html, 'teacher_block'); } return $html; } @@ -320,61 +315,38 @@ class IndexManager { if (!empty($home_notice)) { $home_notice = api_to_system_encoding($home_notice, api_detect_encoding(strip_tags($home_notice))); $home_notice = Display::div($home_notice, array('class' => 'homepage_notice')); - $html = self::show_right_block(get_lang('Notice'), $home_notice, ''); - } - - if (isset($_SESSION['_user']['user_id']) && $_SESSION['_user']['user_id'] != 0) { - // Deleting the myprofile link. - if (api_get_setting('allow_social_tool') == 'true') { - unset($this->tpl->menu_navigation['myprofile']); - } - - if (!empty($this->tpl->menu_navigation)) { - $content = '
'; - $html .= self::show_right_block(get_lang('MainNavigation'), $content); - } + $html = self::show_right_block(get_lang('Notice'), $home_notice, 'notice_block'); } - + return $html; + } + + function return_help() { + $user_selected_language = api_get_interface_language(); + $sys_path = api_get_path(SYS_PATH); + // Help section. /* Hide right menu "general" and other parts on anonymous right menu. */ if (!isset($user_selected_language)) { $user_selected_language = $platformLanguage; } - + + $html = null; $home_menu = @(string)file_get_contents($sys_path.$this->home.'home_menu_'.$user_selected_language.'.html'); if (!empty($home_menu)) { $home_menu_content .= ''; - $html .= self::show_right_block(get_lang('MenuGeneral'), $home_menu_content); - } - + $html .= self::show_right_block(get_lang('MenuGeneral'), $home_menu_content, 'help_block'); + } return $html; } - - /*function return_plugin_campushomepage() { - $html = ''; - if (api_get_user_id() && api_number_of_plugins('campushomepage_menu') > 0) { - ob_start(); - api_plugin('campushomepage_menu'); - $plugin_content = ob_get_contents(); - ob_end_clean(); - $html = self::show_right_block('', $plugin_content); - } - return $html; - }*/ - + function return_skills_links() { $content = ''; - $html = self::show_right_block(get_lang("Skills"), $content); + $html = self::show_right_block(get_lang("Skills"), $content, 'skill_block'); return $html; } @@ -703,14 +675,20 @@ class IndexManager { return $courses; } - function show_right_block($title, $content, $class = '') { - $html = ''; - $html.= '