Fixing menu when user is not logged in + cleaning the template.lib.php

skala
Julio Montoya 13 years ago
parent 0ac6b04caf
commit dcf92ede10
  1. 18
      main/css/base.css
  2. 22
      main/inc/lib/banner.lib.php
  3. 29
      main/inc/lib/template.lib.php
  4. 8
      main/template/default/layout/main_header.tpl

@ -3573,3 +3573,21 @@ a.forum_group_link {
#online_grid_container .thumbnail .caption {
height: 30px;
}
#hide_bar_template {
width: 10px;
display: inline;
overflow: hidden;
height: 100%;
padding-bottom: 90em;
cursor:pointer;
background-color:#eee;
margin-left: 0px !important;
background-image: url("../img/hide0.png");
background-repeat: no-repeat;
background-position: center center;
}
#hide_bar_template:hover {
background-color:#aaa;
}

@ -111,9 +111,8 @@ function get_tabs() {
return $navigation;
}
function show_header_1($language_file, $nameTools, $theme) {
global $noPHP_SELF;
$_course = api_get_course_info();
function return_logo($theme) {
$_course = api_get_course_info();
$html = '';
$logo = api_get_path(SYS_CODE_PATH).'css/'.$theme.'/images/header-logo.png';
@ -146,21 +145,21 @@ function show_header_1($language_file, $nameTools, $theme) {
}
}
/* Course title section */
/* // Course title section
if (!empty($_cid) and $_cid != -1 and isset($_course)) {
//Put the name of the course in the header
$html .= '<div id="my_courses">';
$html .= '</div>';
} elseif (isset($nameTools) && $language_file != 'course_home') {
//Put the name of the user-tools in the header
if (!isset($_user['user_id'])) {
if (!isset($user_id)) {
//echo '<div id="my_courses"></div>';
} elseif (!$noPHP_SELF) {
$html .= '<div id="my_courses"><a href="'.api_get_self().'?'.api_get_cidreq(). '" target="_top">'.$nameTools.'</a></div>';
} else {
$html .= '<div id="my_courses">'.$nameTools.'</div>';
}
}
}*/
return $html;
}
@ -221,7 +220,7 @@ function return_navigation_array() {
$navigation = array();
$menu_navigation = array();
$possible_tabs = get_tabs();
$possible_tabs = get_tabs();
// Campus Homepage
if (api_get_setting('show_tabs', 'campus_homepage') == 'true') {
@ -326,7 +325,7 @@ function return_navigation_array() {
}
function return_menu() {
$navigation = return_navigation_array();
$navigation = return_navigation_array();
$navigation = $navigation['navigation'];
// Displaying the tabs
@ -407,11 +406,11 @@ function return_menu() {
$show_bar = true;
}
$menu = '';
$menu = null;
// Logout
if ($show_bar) {
if (api_get_user_id()) {
if (api_get_user_id() && !api_is_anonymous()) {
$login = '';
if (api_is_anonymous()) {
$login = get_lang('Anonymous');
@ -421,6 +420,7 @@ function return_menu() {
$logout_link = api_get_path(WEB_PATH).'index.php?logout=logout&uid='.api_get_user_id();
$message_link = null;
if (api_get_setting('allow_message_tool') == 'true') {
$message_link = '<a href="'.api_get_path(WEB_CODE_PATH).'messages/inbox.php">'.get_lang('Inbox').'</a>';
}
@ -446,7 +446,7 @@ function return_menu() {
$menu .= $lis;
$menu .= '</ul>';
}
}
}
return $menu;
}

@ -2,12 +2,11 @@
/* For licensing terms, see /license.txt */
/*
* @author Julio Montoya <gugli100@gmail.com>
* @todo better organization of the class, methods and variables
*
**/
/* @todo better organization of the class methods and variables */
// Load Smarty library
// Load Smarty library
require_once api_get_path(LIBRARY_PATH).'smarty/Smarty.class.php';
require_once api_get_path(LIBRARY_PATH).'course_home.lib.php';
require_once api_get_path(LIBRARY_PATH).'banner.lib.php';
@ -22,7 +21,7 @@ class Template extends Smarty {
var $show_header;
var $show_footer;
var $help;
var $menu_navigation = array();
//var $menu_navigation = array();
var $show_learnpath = false; // This is a learnpath section or not?
var $plugin = null;
var $course_id = null;
@ -285,23 +284,24 @@ class Template extends Smarty {
$this->assign('css_style', $style_html);
$style_print = '@import "'.api_get_path(WEB_CSS_PATH).$this->theme.'/print.css";'."\n";
$this->assign('css_style_print', $style_print);
$this->assign('style_print', $style_print);
// Header 1
$header1 = show_header_1($language_file, $nameTools, $this->theme);
$this->assign('header1', $header1);
$this->assign('css_style_print', $style_print);
// Logo
$logo = return_logo($this->theme);
$this->assign('logo', $logo);
}
private function set_header_parameters() {
$help = $this->help;
$nameTools = $this->title;
global $lp_theme_css, $mycoursetheme, $user_theme;
global $httpHeadXtra, $htmlHeadXtra, $_course, $_user, $text_dir, $_user,
$_cid, $interbreadcrumb, $charset, $language_file, $noPHP_SELF;
global $httpHeadXtra, $htmlHeadXtra, $_course, $text_dir,
$interbreadcrumb, $charset, $language_file, $noPHP_SELF;
$navigation = return_navigation_array();
$this->menu_navigation = $navigation['menu_navigation'];
//$navigation = return_navigation_array();
//$this->menu_navigation = $navigation['menu_navigation'];
global $_configuration;
@ -325,6 +325,7 @@ class Template extends Smarty {
$title_list[] = api_get_setting('Institution');
$title_list[] = api_get_setting('siteName');
if (!empty($course_title)) {
$title_list[] = $course_title;
}
@ -467,7 +468,7 @@ class Template extends Smarty {
$this->assign('bug_notification_link', $bug_notification_link);
$notification = return_notification_menu();
$menu = return_menu();
$menu = return_menu();
$breadcrumb = return_breadcrumb($interbreadcrumb, $language_file, $nameTools);
$this->assign('notification_menu', $notification);

@ -29,10 +29,11 @@
<div id="main" class="container">
<header>
<div class="row">
{* header1 - logo *}
<div class="row">
<div id="header_left" class="span4">
{$header1}
{* logo *}
{$logo}
{* plugin_header *}
{if !empty($plugin_header_left)}
<div id="plugin_header_left">
@ -76,6 +77,7 @@
</div>
{/if}
</header>
{* menu *}
{if $menu}
<div class="subnav">

Loading…
Cancel
Save