<div id="header">  <!-- header section start -->

 <div id="header1"> <!-- top of banner with institution name/hompage link -->
 <!-- Logo header
   <table width="100%" height="32"  border="0" cellpadding="0" cellspacing="0" class="ignoziHeader">

      <tr>

        <td width="24%" align="left" valign="bottom" ></td>

        <td width="76%" align="right" valign="top">

		<table width="200" cellpadding="10" cellspacing="1">

          <tr>

            <td><span class="style1"> </span></td>

          </tr>

        </table></td>

      </tr>

   </table>
   -->
<?php

//Put the name of the course in the header
if (isset ($_cid) && 2==3) /* --- Course Title Section --- */

{

?>



	 <div id="my_courses"><a href="<?php echo api_get_path(WEB_COURSE_PATH).$_course['path']; ?>/index.php" target="_top">
	 	<?php



	echo $_course['name']." ";

	if (get_setting("display_coursecode_in_courselist") == "true")

	{

		echo $_course['official_code'];

	}

	if (get_setting("display_coursecode_in_courselist") == "true" AND get_setting("display_teacher_in_courselist") == "true")

	{

		echo " - ";

	}

	if (get_setting("display_teacher_in_courselist") == "true")

	{

		echo $_course['titular'];

	}

echo "</a></div>";



}

//Put the name of the user-tools in the header

elseif (isset ($nameTools) && $langFile != 'course_home' && 2==3)

{

	if (!isset ($_uid))

		echo " ";

	elseif(!$noPHP_SELF)

	{

		echo "<div id=\"my_courses\"><a href=\"".$_SERVER['PHP_SELF']."?".api_get_cidreq(), "\" target=\"_top\">", $nameTools, "</a></div>", "\n";

	}

	else

	{

		echo "<div id=\"my_courses\">$nameTools</div>\n";

	}

}

//not to let the header disappear if there's nothing on the left



//load appropriate plugins for banner section

if (is_array($plugins['banner']))

{

	foreach ($plugins['banner'] as $this_plugin)

	{

		include (api_get_path(PLUGIN_PATH)."$this_plugin/index.php");

	}

}

?>







<?php



/**

==============================================================================

*	This script contains the actual html code to display the "header"

*	or "banner" on top of every Dokeos page.

*

*	@package dokeos.include

==============================================================================

*/



$web_course_path = api_get_path(WEB_COURSE_PATH);



if ($_course['extLink']['name'] != "") /* --- External Link Section --- */

{

	/* commented on 10.01.2006.  
	
	echo "/ ";

	if ($_course['extLink']['url'] != "")

	{

		echo "<a href=\"".$_course['extLink']['url']."\" target=\"_top\">";

		echo $_course['extLink']['name'];

		echo "</a>";

	}

	else

		echo $_course['extLink']['name'];
	*/
}

?>

 </div> <!-- end of #header1 -->

<?php
if ($_uid) {/* --- User Section --- */
?>
<div id="header2"> <!-- start user section line with name, my course, my profile, scorm info, etc -->

<form method="get" action="<?php echo api_get_path(WEB_PATH); ?>index.php" class="banner_links" target="_top">

 <input type="hidden" name="logout" value="true"/>

 <input type="hidden" name="uid" value="<?php echo $_uid;?>"/>



 <div id="logout">

<input type="submit" name="submit" value="<?php echo get_lang("Logout"); ?>"

 onmouseover="this.style.textDecoration='underline'" onmouseout="this.style.textDecoration='none'"

 class="logout"/>

 </div>



<?php echo $_user ['lastName']," ",$_user ['firstName'] ?> :

<a href="<?php echo api_get_path(WEB_PATH); ?>index.php" target="_top">

 <?php echo get_lang("MyCourses"); ?></a>

 |

<a href="<?php echo $clarolineRepositoryWeb ?>auth/profile.php<?php if(!empty($_course['path'])) echo '?coursePath='.$_course['path'].'&amp;courseCode='.$_course['official_code']; ?>" target="_top">

 <?php echo get_lang("ModifyProfile"); ?></a>

 |

<a href="<?php echo $clarolineRepositoryWeb ?>calendar/myagenda.php<?php if(!empty($_course['path'])) echo '?coursePath='.$_course['path'].'&amp;courseCode='.$_course['official_code']; ?>" target="_top">

 <?php echo get_lang("MyAgenda"); ?></a>

 <?php



	if (api_is_platform_admin())

	{

		echo "| <a href=\"".$rootAdminWeb."\" target=\"_top\">".get_lang("PlatformAdmin")."</a>";

	}

?>



</form>

</div> <!-- end of header2 (user) section -->
<?php
} else {//not registered users

}
?>

<div id="header3">
<div id="Header3Right">
	<?php



echo '<ul>';

if (get_setting('showonline') == "true")

{

	$statistics_database = Database :: get_statistic_database();

	$number = count(WhoIsOnline(api_get_user_id(), $statistics_database, 30));
	if (api_is_platform_admin() || api_is_course_admin() || api_is_allowed_to_create_course()) {
	echo "<li><a href='".api_get_path(WEB_PATH)."whoisonline.php?referer=".urlencode($_SERVER['REQUEST_URI'])."' target='_top'>".get_lang('UsersOnline').": ".$number."</a></li>";
	} else {
	echo "<li>".get_lang('UsersOnline').": ".$number."&nbsp;</li>";
	}
}

if ($_uid)

{

	if (api_is_course_admin() && is_student_view_enabled())

	{

		echo '<li>|';

		display_tool_view_option($_GET['isStudentView']);

		echo '</li>';

	}

}

/* cut the help-by-sections link
if (api_is_allowed_to_edit()) {

	if( $help != null) {

	// Show help

	?>

	<li>|

	<a href="#" onclick="MyWindow=window.open('<?php echo api_get_path(WEB_CODE_PATH)."help/help.php"; ?>?open=<?php echo $help; ?>','MyWindow','toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=500,height=600,left=200,top=20'); return false;">

	<img src="<?php echo api_get_path(WEB_CODE_PATH); ?>img/buoy.gif" style="vertical-align: middle;" alt="<?php echo get_lang("Help") ?>"/>&nbsp;<?php echo get_lang("Help") ?></a>

	</li>

	<?php
	}
	
}*/

// always show student's help, but only teachers see the teacher's help
//$help_path = api_get_path(WEB_CODE_PATH).'help/greek/';
$help_path = api_get_path(WEB_CODE_PATH).'help/'.$GLOBALS['HTTP_SESSION_VARS']['user_language_choice'].'/';
if ($GLOBALS['is_allowedCreateCourse'] || $GLOBALS['is_platformAdmin'] || api_is_allowed_to_edit() || api_is_course_admin()) {
	$help_path .= 'teacher/index.html';
} else {
	$help_path .= 'student/index.html';
}
?>
<li>|
<a href="#" onClick="MyWindow=window.open('<?php echo $help_path;?>', 'MyWindow', 'toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=770,height=600,left=200,top=20'); return false;">
<img src="<?php echo api_get_path(WEB_CODE_PATH); ?>img/buoy.gif" style="vertical-align: middle;" alt="<?php echo get_lang("Help") ?>"/>&nbsp;<?php echo get_lang("Help") ?></a>
</li>

<?php
echo '</ul></div>';

?>





<?php





if (isset ($_cid))

{

?>

		 <a href="<?php echo api_get_path(WEB_PATH) ?>index.php" target="_top">

		 <?php echo get_setting('siteName'); ?></a> &gt;

		 <a href="<?php echo $web_course_path . $_course['path']?>/index.php" target="_top">

		 <?php



	//old: echo ($langFile == 'course_home')?''.$_course['official_code'].'':$_course['official_code'];

	//new suggestion fro usability discussion:

	//echo get_lang("CourseHomepageLink");
	echo $_course['name'];
?></a>



		<?php





}



// if name tools or interbredcrump defined, we don't set the Site name bold



elseif (isset ($nameTools) || is_array($interbredcrump))

{

	if (!isset ($_uid))

		echo " ";

	else

	{

?>

		  <a href="<?php echo api_get_path(WEB_PATH); ?>index.php" target="_top"> <?php echo get_setting('siteName');?></a>


		<?php

	}

}

// else we set the Site name bold
if (is_array($interbredcrump))

{

	while (list (, $bredcrumpStep) = each($interbredcrump))

	{

		$sep = '?';

		if (strrchr($bredcrumpStep['url'], '?'))

		{

			$sep = '&';

		}

		$last_link = $bredcrumpStep['url'].$sep.api_get_cidreq();
		// when in a scorm package
		echo " &gt; <a href=\"", $bredcrumpStep['url'].$sep.api_get_cidreq(), "\" target=\"_top\">", $bredcrumpStep['name'], "</a>\n";

	}

}

// clickable bredcrump construction
// parse the openDir path
$dir = $GLOBALS['openDir'];
$tmplink = './scormdocument.php?cidReq='.$_REQUEST['cidReq'];
if (strlen($dir)) {
	$last_pos = 0;
	$start_pos = 1;
	$found = 1;
	$full_link = '';
	$pos = FALSE;
	do {
		$pos = strpos($dir, '/', $start_pos);
		if ($pos !== FALSE) {
			$found = 1;
			$tmpdir = substr($dir, $last_pos, $pos - $last_pos);
			if (strlen($tmpdir) && ($tmpdir != '/')) {
				$fulldir = substr($dir, 0, $pos);
				$full_link .= ' <a href="'.$tmplink.'&subdirs=yes&openDir='.urlencode($fulldir).'" target="_top">'.$tmpdir.'</a> ';
				$last_pos = $pos;
				$start_pos = $pos + 1;
			}
		} else {
			$found = 0;
			$tmpdir = substr($dir, $last_pos);
			$last_link = '<a href="'.$tmplink.'&subdirs=yes&openDir='.urlencode($dir).'" target="_top">'.$tmpdir.'</a>';
			$full_link .= ' '.$last_link;
		}
	} while ($found);
}

if (strpos($GLOBALS['HTTP_SERVER_VARS']['PHP_SELF'], 'scormdocument.php')) { // in learning path
	$nametool_link = $tmplink;
} else {
	$nametool_link = $_SERVER['REQUEST_URI'];
}

if (isset ($nameTools) && $langFile != 'course_home')

{

	if (!isset ($_uid))

		echo " &gt; ", "<a href=\"".$_SERVER['REQUEST_URI']."\" target=\"_top\">", $nameTools, "</a>", $full_link, "\n";

	else

	{

		if ($noPHP_SELF) {
			// when in a scorm package
			$full_link = str_replace($last_link, $tmpdir, $full_link);
			if (!strlen($full_link)) {
				echo "&gt; " . $nameTools;
			}
			echo $full_link . "\n";
		} else {
			// when not in a scorm package
			echo " &gt; ", "<a href=\"".$nametool_link."\" target=\"_top\">", $nameTools, "</a>", $full_link, "\n";
		}

	}
}
//not to let the empty header disappear and ensure help pic is inside the header

echo "<div class=\"clear\">&nbsp;</div>";

?>
</div> <!-- End of header 3-->



<?php


/*}*/

?>



	<div id="toolshortcuts">

		<?php if(get_setting('show_toolshortcuts')=="true") { include('tool_shortcuts.inc.php'); } ?>

	</div>



<?php



if (isset ($dokeos_database_connection))

{

	// connect to the main database.

	// if single database, don't pefix table names with the main database name in SQL queries

	// (ex. SELECT * FROM `table`)

	// if multiple database, prefix table names with the course database name in SQL queries (or no prefix if the table is in

	// the main database)

	// (ex. SELECT * FROM `table_from_main_db`  -  SELECT * FROM `courseDB`.`table_from_course_db`)

	mysql_select_db($mainDbName, $dokeos_database_connection);

}

?>



</div> <!-- end of the whole #header section -->



<div id="main"> <!-- start of #main wrapper for #content and #menu divs -->



<?php



// ===== "call for chat" module section =====



$chat = strpos($_SERVER['PHP_SELF'], 'chat_banner.php');

if (!$chat)

{

	include_once (api_get_library_path()."/online.inc.php");

	echo $accept;

	$chatcall = chatcall();

	if ($chatcall)

	{

		Display :: display_normal_message($chatcall);

	}

}


// ===== end "call for chat" module section =====

?>



<!--   Begin Of script Output   -->



