Fixing menu navigation

skala
Julio Montoya 15 years ago
parent bced08b02f
commit 4f25a9527e
  1. 110
      index.php
  2. 118
      main/admin/configure_homepage.php
  3. 3
      main/css/base.css
  4. 11
      main/css/base_classic.css
  5. 2
      main/css/chamilo/default.css
  6. 4
      main/inc/banner.inc.php
  7. 6
      main/inc/lib/banner.lib.php
  8. 3
      user_portal.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 '<div class="menu" id="menu">';
display_anonymous_right_menu();
echo '</div>';
echo '</div>';
@ -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 '<div class="menu" id="menu">';
if (!($_user['user_id']) || api_is_anonymous($_user['user_id']) ) { // Only display if the user isn't logged in.
api_display_language_form(true);
@ -498,68 +498,62 @@ function display_anonymous_right_menu() {
}
echo '</ul></div>';
}
}
echo '</div>';
// 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 '<div class="menusection">';
echo '<span class="menusectioncaption">'.get_lang('MainNavigation').'</span>';
echo '<ul class="menulist">';
if (!empty($menu_navigation)) {
$content = '<ul class="menulist">';
foreach ($menu_navigation as $section => $navigation_info) {
$current = $section == $GLOBALS['this_section'] ? ' id="current"' : '';
echo '<li'.$current.'><a href="'.$navigation_info['url'].'" target="_self">'.$navigation_info['title'].'</a></li>', "\n";
$content .='<li'.$current.'><a href="'.$navigation_info['url'].'" target="_self">'.$navigation_info['title'].'</a></li>';
}
echo '</ul></div>';
$content .= '</ul>';
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 .= '<ul class="menulist">';
$home_menu_content .= api_to_system_encoding($home_menu, api_detect_encoding(strip_tags($home_menu)));
$home_menu_content .= '</ul>';
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 '<div class="menusection">', '<span class="menusectioncaption">'.get_lang('MenuGeneral').'</span>';
echo '<ul class="menulist">';
$home_menu = api_to_system_encoding($home_menu, api_detect_encoding(strip_tags($home_menu)));
echo $home_menu;
echo '</ul></div>';
}
//Plugin
if ($_user['user_id'] && api_number_of_plugins('campushomepage_menu') > 0) {
echo '<div class="note" style="background: none">';
ob_start();
api_plugin('campushomepage_menu');
echo '</div>';
}
// 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 '<div class="note">';
$home_notice = api_to_system_encoding($home_notice, api_detect_encoding(strip_tags($home_notice)));
echo $home_notice;
echo '</div>';
$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.= '<div id="menu" class="menu">';
$html.= '<div class="menusection">';
$html.= '<span class="menusectioncaption">'.$title.'</span>';
$html.= '<div class="menusection '.$class.' ">';
if (!empty($title)) {
$html.= '<span class="menusectioncaption">'.$title.'</span>';
}
$html.= $content;
$html.= '</div>';
$html.= '</div>';
$html.= '</div>';
return $html;
}
}

@ -899,7 +899,7 @@ switch ($action) {
<td width="10%" valign="top"></td>
<td width="20%" rowspan="3" valign="top">
<div id="menu-wrapper">
<div id="menu" class="menu" style="width: 100%;">
<div id="menu" class="menu">
<?php
api_display_language_form();
?>
@ -911,6 +911,8 @@ switch ($action) {
<div><button class="login" type="button" name="submitAuth" value="<?php echo get_lang('Ok'); ?>" disabled="disabled"><?php echo get_lang('Ok'); ?></button></div>
</form>
<div class="clear"> &nbsp; </div>
<div class="menusection">
<span class="menusectioncaption"><?php echo get_lang('MenuUser'); ?></span>
<ul class="menulist">
@ -918,62 +920,70 @@ switch ($action) {
<li><span style="color: #9D9DA1; font-weight: bold;"><?php echo api_ucfirst(get_lang('LostPassword')); ?></span></li>
</ul>
</div>
<br />
<a href="<?php echo api_get_self(); ?>?action=insert_link"><?php Display::display_icon('addd.gif', get_lang('InsertLink')); ?></a>
<a href="<?php echo api_get_self(); ?>?action=insert_link"/><?php echo get_lang('InsertLink'); ?></a>
<div class="menusection">
<span class="menusectioncaption"><?php echo api_ucfirst(get_lang('General')); ?></span>
<ul class="menulist">
<?php
$home_menu = '';
if (file_exists($homep.$menuf.'_'.$lang.$ext)) {
$home_menu = @file($homep.$menuf.'_'.$lang.$ext);
} else {
$home_menu = @file($homep.$menuf.$ext);
}
if (empty($home_menu)) {
$home_menu = array();
}
if (!empty($home_menu)) {
$home_menu = implode("\n", $home_menu);
$home_menu = api_to_system_encoding($home_menu, api_detect_encoding(strip_tags($home_menu)));
$home_menu = explode("\n", $home_menu);
}
$i = 0;
foreach ($home_menu as $enreg) {
$enreg = trim($enreg);
if (!empty($enreg)) {
$edit_link = '<a href="'.api_get_self().'?action=edit_link&amp;link_index='.$i.'">'.Display::return_icon('edit.gif', get_lang('Edit')).'</a>';
$delete_link = '<a href="'.api_get_self().'?action=delete_link&amp;link_index='.$i.'" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES)).'\')) return false;">'.Display::return_icon('delete.gif', get_lang('Delete')).'</a>';
echo str_replace(array('href="'.api_get_path(WEB_PATH).'index.php?include=', '</li>'), array('href="'.api_get_path(WEB_CODE_PATH).'admin/'.basename(api_get_self()).'?action=open_link&link=', '<br />'.$edit_link.' '.$delete_link.'</li>'), $enreg);
$i++;
}
}
?>
</ul>
</div>
<div id="menu" class="menu">
<br />
<a href="<?php echo api_get_self(); ?>?action=edit_notice"><?php Display::display_icon('edit.gif', get_lang('Edit')); ?></a> <a href="<?php echo api_get_self(); ?>?action=edit_notice"><?php echo get_lang('EditNotice'); ?></a>
<div class="menusection note">
<?php
$home_notice = '';
if (file_exists($homep.$noticef.'_'.$lang.$ext)) {
$home_notice = @(string)file_get_contents($homep.$noticef.'_'.$lang.$ext);
} else {
$home_notice = @(string)file_get_contents($homep.$noticef.$ext);
}
$home_notice = api_to_system_encoding($home_notice, api_detect_encoding(strip_tags($home_notice)));
echo $home_notice;
?>
</div>
<br />
</div>
<div id="menu" class="menu">
<br />
<a href="<?php echo api_get_self(); ?>?action=insert_link"><?php Display::display_icon('addd.gif', get_lang('InsertLink')); ?></a>
<a href="<?php echo api_get_self(); ?>?action=insert_link"/><?php echo get_lang('InsertLink'); ?></a>
<div class="menusection">
<span class="menusectioncaption"><?php echo api_ucfirst(get_lang('General')); ?></span>
<ul class="menulist">
<?php
$home_menu = '';
if (file_exists($homep.$menuf.'_'.$lang.$ext)) {
$home_menu = @file($homep.$menuf.'_'.$lang.$ext);
} else {
$home_menu = @file($homep.$menuf.$ext);
}
if (empty($home_menu)) {
$home_menu = array();
}
if (!empty($home_menu)) {
$home_menu = implode("\n", $home_menu);
$home_menu = api_to_system_encoding($home_menu, api_detect_encoding(strip_tags($home_menu)));
$home_menu = explode("\n", $home_menu);
}
$i = 0;
foreach ($home_menu as $enreg) {
$enreg = trim($enreg);
if (!empty($enreg)) {
$edit_link = '<a href="'.api_get_self().'?action=edit_link&amp;link_index='.$i.'">'.Display::return_icon('edit.gif', get_lang('Edit')).'</a>';
$delete_link = '<a href="'.api_get_self().'?action=delete_link&amp;link_index='.$i.'" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES)).'\')) return false;">'.Display::return_icon('delete.gif', get_lang('Delete')).'</a>';
echo str_replace(array('href="'.api_get_path(WEB_PATH).'index.php?include=', '</li>'), array('href="'.api_get_path(WEB_CODE_PATH).'admin/'.basename(api_get_self()).'?action=open_link&link=', '<br />'.$edit_link.' '.$delete_link.'</li>'), $enreg);
$i++;
}
}
?>
</ul>
</div>
</div>
<br />
&nbsp;&nbsp;<a href="<?php echo api_get_self(); ?>?action=edit_notice"><?php Display::display_icon('edit.gif', get_lang('Edit')); ?></a> <a href="<?php echo api_get_self(); ?>?action=edit_notice"><?php echo get_lang('EditNotice'); ?></a>
<div class="note">
<?php
$home_notice = '';
if (file_exists($homep.$noticef.'_'.$lang.$ext)) {
$home_notice = @(string)file_get_contents($homep.$noticef.'_'.$lang.$ext);
} else {
$home_notice = @(string)file_get_contents($homep.$noticef.$ext);
}
$home_notice = api_to_system_encoding($home_notice, api_detect_encoding(strip_tags($home_notice)));
echo $home_notice;
?>
</div>
</div>
</div> <!-- menu wrapper -->
</td>
</tr>

@ -728,3 +728,6 @@ div.system_announcement {
width: 98%;
}
.note {
background-color: #FFFF96;
}

@ -18,9 +18,16 @@
}
#header4 {
width: 100%;
width: 98%;
float:left;
padding-left:15px;
padding-left:20px;
padding-right:0px;
}
.menu , #menu {
min-height: 90px;
}
.message-body {
font-size:100%;
}

@ -1422,7 +1422,7 @@ a.nobold:hover {
font-size: 12px;
line-height: 14px;
font-family: verdana, arial, helvetica, sans-serif;
background-color: #E5EDF9;
background-color: #FFFF96;
color: #666666;
border: 1px solid #bbb;
padding: 10px 10px 10px 10px;

@ -39,10 +39,8 @@ echo '<div id="header">';
show_header_1($language_file, $nameTools);
show_header_2();
show_header_3();
$menu_navigation = show_header_3();
show_header_4($interbreadcrumb, $language_file, $nameTools);
if (isset($database_connection)) {
// connect to the main database.

@ -456,6 +456,7 @@ function show_header_3() {
echo '</ul>';
echo '</div>';
}
return $menu_navigation;
}
//Header 4
@ -589,4 +590,9 @@ function show_header_4($interbreadcrumb, $language_file, $nameTools) {
}
}
echo '<div class="clear"></div>';
}
function load_navigation_menu() {
}

@ -641,7 +641,8 @@ if (api_get_setting('allow_social_tool') == 'true') {
// Main navigation section.
// Tabs that are deactivated are added here.
if (!empty($menu_navigation)) {
$main_navigation_content .= '<ul class="menulist">';
$main_navigation_content .= '<ul class="menulist">';
foreach ($menu_navigation as $section => $navigation_info) {
$current = $section == $GLOBALS['this_section'] ? ' id="current"' : '';
$main_navigation_content .= '<li'.$current.'>';

Loading…
Cancel
Save