[svn r16925] Added general option to prevent course creation

skala
Isaac Flores 17 years ago
parent a341641d9b
commit 1506af4622
  1. 120
      main/inc/banner.inc.php

@ -1,5 +1,4 @@
<?php //$id: $
/* For licensing terms, see /dokeos_license.txt */
<?php
/**
==============================================================================
* This script contains the actual html code to display the "header"
@ -9,21 +8,15 @@
==============================================================================
*/
?>
<div id="header">
<div id="header1">
<div id="header"> <!-- header section start -->
<div id="header1"> <!-- top of banner with institution name/hompage link -->
<div id="top_corner"></div>
<div id="institution">
<a href="<?php echo api_get_path(WEB_PATH);?>index.php" target="_top"><?php echo api_get_setting('siteName') ?></a>
<?php
$iurl = api_get_setting('InstitutionUrl');
$iname = api_get_setting('Institution');
if (!empty($iname))
{
echo '-&nbsp;<a href="'.$iurl.'" target="_top">'.$iname.'</a>';
}
?>
-
<a href="<?php echo api_get_setting('InstitutionUrl') ?>" target="_top"><?php echo api_get_setting('Institution') ?></a>
</div>
<?php
/*
-----------------------------------------------------------------------------
@ -32,9 +25,11 @@
*/
if (!empty($_cid) and $_cid != -1 and isset($_course)) {
//Put the name of the course in the header
echo '
<div id="my_courses">
<a href="'.api_get_path(WEB_COURSE_PATH).$_course['path'].'/index.php" target="_top">'.$_course['name'].' ';
?>
<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 (api_get_setting("display_coursecode_in_courselist") == "true") {
echo $_course['official_code'];
}
@ -48,9 +43,7 @@ if (!empty($_cid) and $_cid != -1 and isset($_course)) {
if (api_get_setting("display_teacher_in_courselist") == "true") {
echo stripslashes($_course['titular']);
}
echo ' </a>';
echo '
</div>';
echo "</a></div>";
} elseif (isset ($nameTools) && $language_file != 'course_home') {
//Put the name of the user-tools in the header
if (!isset ($_user['user_id'])) {
@ -87,22 +80,17 @@ if (isset($_course['extLink']) && $_course['extLink']['name'] != "") {
} else {
echo $_course['extLink']['name'];
}
}
?>
</div>
echo "</div> <!-- end of #header1 -->";
echo '<div id="header2">';
echo '<div id="Header2Right">';
echo '<ul>';
<div id="header2">
<div id="Header2Right">
<ul>
<?php
if ((api_get_setting('showonline','world') == "true" AND !$_user['user_id']) OR (api_get_setting('showonline','users') == "true" AND $_user['user_id']) OR (api_get_setting('showonline','course') == "true" AND $_user['user_id'] AND $_cid)) {
if (api_get_setting("use_session_mode") == "true" && isset($_user['user_id']) && api_is_coach()) {
echo ' <li><a href="'.api_get_path(WEB_PATH).'whoisonlinesession.php?id_coach='.$_user['user_id'].'&amp;referer='.urlencode($_SERVER['REQUEST_URI']).'" target="_top">'.get_lang('UsersConnectedToMySessions').'</a></li>';
echo "<li><a href='".api_get_path(WEB_PATH)."whoisonlinesession.php?id_coach=".$_user['user_id']."&referer=".urlencode($_SERVER['REQUEST_URI'])."' target='_top'>".get_lang('UsersConnectedToMySessions')."</a></li>";
}
$statistics_database = Database :: get_statistic_database();
$number = count(WhoIsOnline(api_get_user_id(), $statistics_database, api_get_setting('time_limit_whosonline')));
if(!empty($_course['id'])) {
@ -111,24 +99,22 @@ if ((api_get_setting('showonline','world') == "true" AND !$_user['user_id']) OR
} else {
$number_online_in_course = 0;
}
echo ' <li>'.get_lang('UsersOnline').': ';
echo "<li>".get_lang('UsersOnline').": ";
// Display the who's online of the platform
if ((api_get_setting('showonline','world') == "true" AND !$_user['user_id']) OR (api_get_setting('showonline','users') == "true" AND $_user['user_id'])) {
echo '<a href="'.api_get_path(WEB_PATH).'whoisonline.php" target="_top">'.$number.'</a>';
echo "<a href='".api_get_path(WEB_PATH)."whoisonline.php' target='_top'>".$number."</a>";
}
// Display the who's online for the course
if (is_array($_course) AND api_get_setting('showonline','course') == "true" AND isset($_course['sysCode'])) {
echo "(<a href='".api_get_path(WEB_PATH)."whoisonline.php?cidReq=".$_course['sysCode']."' target='_top'>$number_online_in_course ".get_lang('InThisCourse')."</a>)";
}
echo '</li>';
}
if ($_user['user_id'] && isset($_cid)) {
if ((api_is_course_admin() || api_is_platform_admin()) && api_get_setting('student_view_enabled') == 'true') {
if (api_is_course_admin() && api_get_setting('student_view_enabled') == 'true') {
echo '<li>| ';
api_display_tool_view_option();
echo '</li>';
@ -148,9 +134,14 @@ if ( api_is_allowed_to_edit() ) {
?>
</ul>
</div>
<div class="clear">&nbsp;</div>
</div>
<!-- link to campus home (not logged in)
<a href="<?php echo api_get_path(WEB_PATH); ?>index.php" target="_top"><?php echo api_get_setting('siteName'); ?></a>
-->
<?php
//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 2-->
<div id="header3">
<?php
/*
@ -169,14 +160,20 @@ if ($_user['user_id']) {
?>
<!-- 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 $_user['user_id']; ?>"/>
<ul id="logout">
<li><a href="<?php echo api_get_path(WEB_PATH); ?>index.php?action=logout"><span><?php echo get_lang('Logout').' '.$login; ?></span></a></li>
<li>
<input type="submit" name="submit" value="<?php echo get_lang("Logout").' '.$login; ?>"
onmouseover="this.style.textDecoration='underline'" onmouseout="this.style.textDecoration='none'"
class="logout" style=" height:20px;" />
</li>
</ul>
</form>
<?php
}
?>
<ul>
<?php
echo "<ul>\n";
$navigation = array();
$possible_tabs = get_tabs();
@ -251,14 +248,21 @@ foreach($navigation as $section => $navigation_info) {
} else {
$current = '';
}
echo ' <li'.$current.'><a href="'.$navigation_info['url'].'" target="_top"><span>'.$navigation_info['title'].'</span></a></li>'."\n";
echo '<li'.$current.'>';
echo '<a href="'.$navigation_info['url'].'" target="_top">'.$navigation_info['title'].'</a>';
echo '</li>';
echo "\n";
}
?>
</ul>
<div style="clear: both;" class="clear"> </div>
</div>
</ul><!-- small hack to have it look good in opera -->&nbsp;
</div> <!-- end of header3 (user) section -->
<?php
/*
-----------------------------------------------------------------------------
BREADCRUMBS
-----------------------------------------------------------------------------
*/
?>
<div id="header4">
<?php
/*
@ -266,8 +270,7 @@ foreach($navigation as $section => $navigation_info) {
*/
$navigation = array();
// part 1: Course Homepage. If we are in a course then the first breadcrumb is a link to the course homepage
//hide_course_breadcrumb the parameter has been added to hide the name of the course, that appeared in the default $interbreadcrumb
if (isset ($_cid) and $_cid!=-1 and isset($_course) and !isset($_GET['hide_course_breadcrumb'])) {
if (isset ($_cid) and $_cid!=-1 and isset($_course)) {
$navigation_item['url'] = $web_course_path . $_course['path'].'/index.php';
switch(api_get_setting('breadcrumbs_course_homepage')) {
case 'get_lang':
@ -302,14 +305,13 @@ if (isset ($nameTools) AND $language_file<>"course_home") {
$final_navigation = array();
foreach ($navigation as $index => $navigation_info) {
if (!empty($navigation_info['title'])) {
$final_navigation[$index] = '<a href="'.$navigation_info['url'].'" class="breadcrumb breadcrumb'.$index.'" target="_top">'.$navigation_info['title'].'</a>';
$final_navigation[$index] = '<a href="'.$navigation_info['url'].'" target="_top">'.$navigation_info['title'].'</a>';
}
}
echo implode(' &gt; ',$final_navigation);
?>
</div>
</div><!-- end of header4 -->
<?php
if (api_get_setting('show_toolshortcuts')=='true') {
echo '<div id="toolshortcuts">';
@ -413,6 +415,13 @@ function get_tabs() {
$navigation['mycourses']['title'] = get_lang('MyCourses');
}
// Link to active sessions
//$navigation[SECTION_ACTIVESESSIONS]['url'] = api_get_path(WEB_PATH).'user_portal.php';
//$navigation[SECTION_ACTIVESESSIONS]['title'] = get_lang('myActiveSessions');
// Link to inactive sessions
//$navigation[SECTION_INACTIVESESSIONS]['url'] = api_get_path(WEB_PATH).'user_portal.php?inactives';
//$navigation[SECTION_INACTIVESESSIONS]['title'] = get_lang('myInActiveSessions');
} else {
// Link to my courses
$navigation['mycourses']['url'] = api_get_path(WEB_PATH).'user_portal.php';
@ -436,18 +445,17 @@ function get_tabs() {
// Reporting
if(api_is_allowed_to_create_course() || $_user['status']==DRH) {
// Link to my space
$navigation['session_my_space']['url'] = api_get_path(WEB_CODE_PATH).'mySpace/';
$navigation['session_my_space']['url'] = api_get_path(WEB_PATH).'main/mySpace/';
$navigation['session_my_space']['title'] = get_lang('MySpace');
} else {
// Link to my progress
$navigation['session_my_progress']['url'] = api_get_path(WEB_CODE_PATH).'auth/my_progress.php';
$navigation['session_my_progress']['url'] = api_get_path(WEB_PATH).'main/auth/my_progress.php';
$navigation['session_my_progress']['title'] = get_lang('MyProgress');
}
// Platform administration
if (api_is_platform_admin(true)) {
//$navigation['platform_admin']['url'] = $rootAdminWeb;
$navigation['platform_admin']['url'] = api_get_path(WEB_CODE_PATH).'admin/';
$navigation['platform_admin']['url'] = $rootAdminWeb;
$navigation['platform_admin']['title'] = get_lang('PlatformAdmin');
}

Loading…
Cancel
Save