diff --git a/index.php b/index.php index f22f40a6ee..327e43a0a6 100755 --- a/index.php +++ b/index.php @@ -295,12 +295,9 @@ if (!api_is_anonymous()) { echo show_right_block(get_lang('Profile'), $profile_content); } - - // Display right menu: language form, login section + useful weblinks. -echo ''; echo ''; @@ -425,10 +422,13 @@ function display_dashboard_link() { * @todo does $_plugins need to be global? */ function display_anonymous_right_menu() { - global $loginFailed, $_plugins, $_user, $menu_navigation; + global $loginFailed, $_plugins, $_user, $menu_navigation, $home, $home_old; - $platformLanguage = api_get_setting('platformLanguage'); - $sys_path = api_get_path(SYS_PATH); + $platformLanguage = api_get_setting('platformLanguage'); + $sys_path = api_get_path(SYS_PATH); + $user_selected_language = api_get_interface_language(); + + echo ''; } + } + echo ''; + + // Notice - // Deleting the myprofile link. + $home_notice = @(string)file_get_contents($sys_path.$home.'home_notice_'.$user_selected_language.'.html'); + if (empty($home_notice)) { + $home_notice = @(string)file_get_contents($sys_path.$home.'home_notice.html'); + } + + if (!empty($home_notice)) { + $home_notice = api_to_system_encoding($home_notice, api_detect_encoding(strip_tags($home_notice))); + echo show_right_block('', $home_notice, 'note'); + } + + + + if (isset($_SESSION['_user']['user_id']) && $_SESSION['_user']['user_id'] != 0) { + // Deleting the myprofile link. if (api_get_setting('allow_social_tool') == 'true') { unset($menu_navigation['myprofile']); } - if (!empty($menu_navigation)) { - echo ''; + $content .= ''; + echo show_right_block(get_lang('MainNavigation'), $content); } - } + } // Help section. /* Hide right menu "general" and other parts on anonymous right menu. */ - - $user_selected_language = api_get_interface_language(); - global $home, $home_old; + if (!isset($user_selected_language)) { $user_selected_language = $platformLanguage; } $home_menu = @(string)file_get_contents($sys_path.$home.'home_menu_'.$user_selected_language.'.html'); - /*if (empty($home_menu)) { - $home_menu = @(string)file_get_contents($sys_path.$home_old.'home_menu_'.$user_selected_language.'.html'); - } - if (empty($home_menu)) { - $home_menu = @(string)file_get_contents($sys_path.$home.'home_menu.html'); + if (!empty($home_menu)) { + $home_menu_content .= ''; + echo show_right_block(get_lang('MenuGeneral'), $home_menu_content); } - if (empty($home_menu)) { - $home_menu = @(string)file_get_contents($sys_path.$home_old.'home_menu.html'); - }*/ - if (!empty($home_menu)) { - echo ''; - } - + //Plugin + if ($_user['user_id'] && api_number_of_plugins('campushomepage_menu') > 0) { - echo '
'; + ob_start(); api_plugin('campushomepage_menu'); - echo '
'; - } - - // Includes for any files to be displayed below anonymous right menu. - - $home_notice = @(string)file_get_contents($sys_path.$home.'home_notice_'.$user_selected_language.'.html'); - if (empty($home_notice)) { - $home_notice = @(string)file_get_contents($sys_path.$home.'home_notice.html'); - } - if (!empty($home_notice)) { - echo '
'; - $home_notice = api_to_system_encoding($home_notice, api_detect_encoding(strip_tags($home_notice))); - echo $home_notice; - echo '
'; + $plugin_content = ob_get_contents(); + ob_end_clean(); + echo show_right_block('', $plugin_content); } } @@ -908,17 +902,15 @@ function get_courses_of_user($user_id) { } -function show_right_block($title, $content) { - $html = ''; - +function show_right_block($title, $content, $class = '') { + $html = ''; $html.= ''; return $html; -} - - +} \ No newline at end of file diff --git a/main/admin/configure_homepage.php b/main/admin/configure_homepage.php index 1feccf1f1e..cbc2914004 100755 --- a/main/admin/configure_homepage.php +++ b/main/admin/configure_homepage.php @@ -899,7 +899,7 @@ switch ($action) {