Fixing notice and header3 see BT#3500

skala
Julio Montoya 14 years ago
parent 62bcbbf255
commit e3f58707cc
  1. 1
      index.php
  2. 31
      main/admin/configure_homepage.php
  3. 22
      main/css/base.css
  4. 5
      main/inc/banner.inc.php
  5. 77
      main/inc/lib/banner.lib.php
  6. 6
      main/inc/lib/template.lib.php
  7. 3
      main/inc/lib/userportal.lib.php
  8. 7
      main/template/default/layout/header.tpl

@ -17,7 +17,6 @@ require_once 'main/inc/global.inc.php';
require_once api_get_path(LIBRARY_PATH).'userportal.lib.php';
require_once 'main/chat/chat_functions.lib.php';
// The section (for the tabs).
$this_section = SECTION_CAMPUS;

@ -14,7 +14,6 @@ api_protect_admin_script();
require_once api_get_path(LIBRARY_PATH).'WCAG/WCAG_rendering.php';
require_once api_get_path(LIBRARY_PATH).'fileUpload.lib.php';
global $_configuration;
$action = Security::remove_XSS($_GET['action']);
@ -336,7 +335,7 @@ if (!empty($action)) {
}
}
$class_add_in_tab = '';
$class_add_in_tab = 'show_menu';
if (!$add_in_tab) {
$class_add_in_tab = 'class="hide_menu"';
}
@ -628,15 +627,11 @@ switch ($action) {
<form action="<?php echo api_get_self(); ?>?action=<?php echo $action; ?>" method="post" style="margin:0px;">
<div class="row"><div class="form_header"><?php echo $tool_name; ?></div></div>
<input type="hidden" name="formSent" value="1"/>
<?php
if (!empty($errorMsg)) {
//echo '<tr><td colspan="2">';
Display::display_normal_message($errorMsg);
//echo '</td></tr>';
}
?>
<table border="0" cellpadding="5" cellspacing="0">
<tr><td colspan="2"><?php echo '<span style="font-style: italic;">'.get_lang('LetThoseFieldsEmptyToHideTheNotice').'</span>'; ?></tr>
<tr>
@ -698,9 +693,10 @@ switch ($action) {
$target_blank_checkbox = & $form->addElement('checkbox', 'target_blank', null, get_lang('OpenInNewWindow'), 1);
$form->addElement('checkbox', 'add_in_tab', null, get_lang('AddInMenu'), 1);
$default['add_in_tab'] = $add_in_tab;
if ($action == 'insert_tabs' || $action == 'edit_tabs') {
$form->addElement('checkbox', 'add_in_tab', null, get_lang('AddInMenu'), 1);
$default['add_in_tab'] = $add_in_tab;
}
if ($target_blank) $target_blank_checkbox->setChecked(true);
@ -915,7 +911,7 @@ switch ($action) {
<td width="20%" rowspan="3" valign="top">
<div id="menu-wrapper">
<div id="menu" class="menu">
<?php api_display_language_form(); ?>
<?php echo api_display_language_form(); ?>
<form id="formLogin">
<div><label><?php echo get_lang('LoginName'); ?></label></div>
<div><input type="text" id="login" size="15" value="" disabled="disabled" /></div>
@ -937,12 +933,15 @@ switch ($action) {
</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">
<div class="menusection">
<span class="menusectioncaption">
<?php echo get_lang('Notice'); ?>
<a href="<?php echo api_get_self(); ?>?action=edit_notice">
<?php Display::display_icon('edit.png', get_lang('Edit'), array(), 22); ?></a>
</span>
<?php
$home_notice = '';
if (file_exists($homep.$noticef.'_'.$lang.$ext)) {
$home_notice = @(string)file_get_contents($homep.$noticef.'_'.$lang.$ext);
@ -950,10 +949,12 @@ switch ($action) {
$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 '<div class="homepage_notice">';
echo $home_notice;
echo '</div>';
?>
</div>
<br />
</div>

@ -1272,15 +1272,19 @@ a.personal_agenda:hover, a.personal_agenda:hover {
.online_grid_item {
float:left;
margin:10px;
text-align:center;
width: 100%;
}
.online_grid_element_0 {
width: 100px;
display: inline;
float: left;
height: 100px;
overflow: hidden;
width: 100px;
}
.online_grid_element_1, .online_grid_element_2 {
font-size:10px;
font-size:13px;
float: left;
margin: 25px 0px 0px 10px;
}
/* input values to crop the image: top, right, bottom, left */
@ -4197,3 +4201,15 @@ a:active{
position:absolute;
background: url("online.png") no-repeat scroll right center transparent;
}
.hide_menu{
display:none;
}
.homepage_notice {
width:90%;
margin-left: 14px;
margin-bottom: 10px;
}

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

@ -252,8 +252,9 @@ function show_header_2() {
function show_header_3() {
$navigation = $menu_navigation = array();
$possible_tabs = get_tabs();
$navigation = array();
$menu_navigation = array();
$possible_tabs = get_tabs();
// Campus Homepage
if (api_get_setting('show_tabs', 'campus_homepage') == 'true') {
@ -334,6 +335,7 @@ function show_header_3() {
$menu_navigation['platform_admin'] = $possible_tabs['platform_admin'];
}
}
// Reports
if (api_get_setting('show_tabs', 'reports') == 'true') {
if ((api_is_platform_admin() || api_is_drh() || api_is_session_admin()) && Rights::hasRight('show_tabs:reports')) {
@ -393,7 +395,7 @@ function show_header_3() {
} elseif (is_file($homep.$menutabs.$lang.$ext) && is_readable($homep.$menutabs.$lang.$ext)) {
$home_top = @(string)file_get_contents($homep.$menutabs.$lang.$ext);
} else {
$errorMsg = get_lang('HomePageFilesNotReadable');
//$errorMsg = get_lang('HomePageFilesNotReadable');
}
$home_top = api_to_system_encoding($home_top, api_detect_encoding(strip_tags($home_top)));
@ -403,44 +405,18 @@ function show_header_3() {
$open = api_to_system_encoding($open, api_detect_encoding(strip_tags($open)));
$lis = '';
$show_bar = false;
if (!empty($open)) {
$lis .= Display::tag('li', $open);
$show_bar = true;
}
//} else {
//This code was moved in the admin/configure_homepage.php file
/*
$home_menu = '';
if (file_exists($homep.$menutabs.'_'.$lang.$ext)) {
$home_menu = @file($homep.$menutabs.'_'.$lang.$ext);
} else {
$home_menu = @file($homep.$menutabs.$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);
}
$tab_counter = 0;
if (!empty($home_menu)) {
$show_bar = true;
}
foreach ($home_menu as $enreg) {
$enreg = trim($enreg);
if (!empty($enreg)) {
$edit_link = '<a href="'.api_get_self().'?action=edit_tabs&amp;link_index='.$tab_counter.'" ><span>'.Display::return_icon('edit.gif', get_lang('Edit')).'</span></a>';
$delete_link = '<a href="'.api_get_self().'?action=delete_tabs&amp;link_index='.$tab_counter.'" onclick="javascript: if(!confirm(\''.addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES)).'\')) return false;"><span>'.Display::return_icon('delete.gif', get_lang('Delete')).'</span></a>';
$tab_string = 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=', $edit_link.$delete_link.'</li>'), $enreg);
$lis .= $tab_string;
$tab_counter++;
if (strpos($open, 'show_menu') === false) {
if (api_is_anonymous()) {
$navigation[SECTION_CAMPUS] = null;
}
} else {
$lis .= Display::tag('li', $open);
}
$lis .= '<li id="insert-link"><a href="'.api_get_self().'?action=insert_tabs" style="padding-right:0px;"><span>'. Display::return_icon('addd.gif', get_lang('InsertLink'), array('style' => 'vertical-align:middle')).' '.get_lang('InsertLink').'</span></a></li>';
*/
//}
$show_bar = true;
}
if (count($navigation) > 1 || !empty($lis)) {
$pre_lis = '';
@ -450,17 +426,18 @@ function show_header_3() {
} else {
$current = '';
}
$pre_lis .= '<li'.$current.'><a href="'.$navigation_info['url'].'" target="_top"><span id="tab_active">'.$navigation_info['title'].'</span></a></li>';
if (!empty($navigation_info['title'])) {
$pre_lis .= '<li'.$current.'><a href="'.$navigation_info['url'].'" target="_top"><span id="tab_active">'.$navigation_info['title'].'</span></a></li>';
}
}
$lis = $pre_lis.$lis;
$show_bar = true;
}
$header3 = '';
// Logout
if ($show_bar) {
echo '<div id="header3">';
if (api_get_user_id()) {
$login = '';
if (api_is_anonymous()) {
@ -471,19 +448,19 @@ function show_header_3() {
}
//start user section line with name, my course, my profile, scorm info, etc
echo '<ul id="logout">';
$header3 .= '<ul id="logout">';
//echo '<li><span>'.get_lang('LoggedInAsX').' '.$login.'</span></li>';
//echo '<li><a href="'.api_get_path(WEB_PATH).'main/auth/profile.php" target="_top"><span>'.get_lang('Profile').'</span></a></li>';
echo '<li><a href="'.api_get_path(WEB_PATH).'index.php?logout=logout&uid='.api_get_user_id().'" target="_top"><span>'.get_lang('Logout').' ('.$login.')</span></a></li>';
echo '</ul>';
$header3 .= '<li><a href="'.api_get_path(WEB_PATH).'index.php?logout=logout&uid='.api_get_user_id().'" target="_top"><span>'.get_lang('Logout').' ('.$login.')</span></a></li>';
$header3 .= '</ul>';
}
if (!empty($lis)) {
$header3 .= '<ul>';
$header3 .= $lis;
$header3 .= '</ul>';
}
echo '<ul>';
echo $lis;
echo '</ul>';
echo '</div>';
}
return $menu_navigation;
return $header3;
}
//Header 4

@ -379,11 +379,7 @@ class Template extends Smarty {
$header2 = ob_get_contents();
ob_clean();
ob_start();
$menu_navigation = show_header_3();
$header3 = ob_get_contents();
ob_clean();
$header3 = show_header_3();
$header4 = show_header_4($interbreadcrumb, $language_file, $nameTools);
$this->assign('header1', $header1);

@ -340,7 +340,8 @@ class IndexManager {
if (!empty($home_notice)) {
$home_notice = api_to_system_encoding($home_notice, api_detect_encoding(strip_tags($home_notice)));
echo self::show_right_block('', $home_notice, 'note');
$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) {

@ -78,4 +78,9 @@
</div>
{* menu *}
{$header3}
{if $header3}
<div id="header3">
{$header3}
</div>
{/if}

Loading…
Cancel
Save