[svn r11873] consistency improvements

improvements xhtml compliance
coding guidelines
skala
Patrick Cool 18 years ago
parent 9d7dc00dc0
commit 5d16579e7e
  1. 8
      main/auth/courses.php
  2. 30
      main/auth/lostPassword.php
  3. 98
      main/auth/lost_password.lib.php
  4. 170
      main/calendar/agenda.inc.php
  5. 19
      main/inc/lib/display.lib.php
  6. 24
      main/link/link.php
  7. 13
      main/link/linkfunctions.php
  8. 62
      main/work/work.lib.php
  9. 30
      main/work/work.php

@ -1,4 +1,4 @@
<?php // $Id: courses.php 11811 2007-03-30 13:28:21Z pcool $
<?php // $Id: courses.php 11873 2007-04-04 19:46:04Z pcool $
/*
==============================================================================
Dokeos - elearning and course management software
@ -900,7 +900,8 @@ function display_course_icons($key, $number_of_courses, $course, $user_courses)
if ($key>0 AND $user_courses[$key-1]['user_course_category']==$course['user_course_category'])
{
echo "<a href=\"courses.php?action=".$_GET['action']."&amp;move=up&amp;course=".$course['code']."&amp;category=".$course['user_course_cat']."\">";
echo "<img src=\"../img/up.gif\" alt=\"".htmlentities(get_lang("Up"))."\"></a>";
Display::display_icon('up.gif', get_lang('Up'));
echo '</a>';
}
echo "</td>";
// the edit icon OR the edit dropdown list
@ -935,7 +936,8 @@ function display_course_icons($key, $number_of_courses, $course, $user_courses)
if ($key<$number_of_courses-1 AND $user_courses[$key+1]['user_course_category']==$course['user_course_category'])
{
echo "<a href=\"courses.php?action=".$_GET['action']."&amp;move=down&amp;course=".$course['code']."&amp;category=".$course['user_course_cat']."\">";
echo "<img src=\"../img/down.gif\" alt=\"".htmlentities(get_lang("Down"))."\"></a>";
Display::display_icon('down.gif', get_lang('Down'));
echo '</a>';
}
echo "</td></tr></table>";
}

@ -1,27 +1,27 @@
<?php
// $Id: lostPassword.php 11113 2007-02-14 17:43:58Z elixir_inter $
// $Id: lostPassword.php 11873 2007-04-04 19:46:04Z pcool $
/*
==============================================================================
==============================================================================
Dokeos - elearning and course management software
Copyright (c) 2004 Dokeos S.A.
Copyright (c) 2003 Ghent University (UGent)
Copyright (c) 2001 Universite catholique de Louvain (UCL)
Copyright (c) various contributors
For a full list of contributors, see "credits.txt".
The full license can be read in "license.txt".
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
See the GNU General Public License for more details.
Contact: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com
==============================================================================
==============================================================================
*/
/**
==============================================================================
@ -37,7 +37,7 @@
* @todo refactor, move relevant functions to code libraries
*
* @package dokeos.auth
==============================================================================
==============================================================================
*/
// name of the language file that needs to be included
$language_file = "registration";
@ -80,15 +80,21 @@ else
if ($result && mysql_num_rows($result))
{
while ($data = mysql_fetch_array($result))
{
$user[] = $data;
}
if ($userPasswordCrypted)
{
$msg = handle_encrypted_password($user);
}
else
$msg = send_password_to_user($user, get_lang('YourPasswordHasBeenEmailed'));
{
send_password_to_user($user);
}
}
else
{
$msg = get_lang('_no_user_account_with_this_email_address');
Display::display_error_message(get_lang('_no_user_account_with_this_email_address'));
}
$msg .= '<br/><br/><a href="'.api_get_path(WEB_PATH).'main/auth/lostPassword.php">&lt;&lt; '.get_lang('Back').'</a>';
echo '<p>'.$msg.'</p>';
@ -107,4 +113,4 @@ else
Display :: display_footer();
//////////////////////////////////////////////////////////////////////////////
?>
?>

@ -1,30 +1,34 @@
<?php
// $Id: lost_password.lib.php 11158 2007-02-20 00:58:00Z yannoo $
// $Id: lost_password.lib.php 11873 2007-04-04 19:46:04Z pcool $
/*
==============================================================================
==============================================================================
Dokeos - elearning and course management software
Copyright (c) 2004 Dokeos S.A.
Copyright (c) 2003 Ghent University (UGent)
Copyright (c) 2001 Universite catholique de Louvain (UCL)
Copyright (c) various contributors
For a full list of contributors, see "credits.txt".
The full license can be read in "license.txt".
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
See the GNU General Public License for more details.
Contact: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com
==============================================================================
==============================================================================
*/
/*** By Olivier Cauberghe, UGent ***/
//-----------------------------------------------------------------------------
/**
* Enter description here...
*
* @return unknown
* @author Olivier Cauberghe <olivier.cauberghe@UGent.be>, Ghent University
*/
function get_email_headers()
{
global $charset;
@ -36,8 +40,14 @@ function get_email_headers()
$emailHeaders .= "Mime-Version: 1.0";
return $emailHeaders;
}
/*** By Olivier Cauberghe, UGent ***/
//-----------------------------------------------------------------------------
/**
* Enter description here...
*
* @param unknown_type $user
* @param unknown_type $reset
* @return unknown
* @author Olivier Cauberghe <olivier.cauberghe@UGent.be>, Ghent University
*/
function get_user_account_list($user, $reset = false)
{
global $_configuration;
@ -45,21 +55,32 @@ function get_user_account_list($user, $reset = false)
{
$secretword = get_secret_word($thisUser["email"]);
if ($reset)
{
$reset_link = "\tReset link : ".$_configuration['root_web']."main/auth/lostPassword.php?reset=".$secretword."&id=".$thisUser[uid];
}
else
{
$reset_link = "\t".get_lang('Pass')." : $thisUser[password]";
}
$userAccountList[] = $thisUser["firstName"]." ".$thisUser["lastName"]."\n\n"."\t".get_lang('UserName')." : ".$thisUser["loginName"]."\n"."$reset_link\n\n";
}
if ($userAccountList)
{
$userAccountList = implode("------------------------\n", $userAccountList);
}
return $userAccountList;
}
/*** By Olivier Cauberghe, UGent ***/
//-----------------------------------------------------------------------------
function send_password_to_user($user, $success_msg)
/**
* This function sends the actual password to the user
*
* @param unknown_type $user
* @author Olivier Cauberghe <olivier.cauberghe@UGent.be>, Ghent University
*/
function send_password_to_user($user)
{
global $charset;
global $_configuration;
$emailHeaders = get_email_headers(); // Email Headers
$emailSubject = "[".get_setting('siteName')."] ".get_lang('LoginRequest'); // SUBJECT
$userAccountList = get_user_account_list($user); // BODY
@ -67,12 +88,23 @@ function send_password_to_user($user, $success_msg)
// SEND MESSAGE
$emailTo = $user[0]["email"];
if (@ api_send_mail($emailTo, $emailSubject, $emailBody, $emailHeaders))
return $success_msg;
{
Display::display_confirmation_message(get_lang('YourPasswordHasBeenEmailed'));
}
else
return "<p>The system is unable to send you an e-mail.<br/>Please contact the ".Display :: encrypted_mailto_link(get_setting('emailAdministrator'), "Platform administrator").".</p>";
{
$message = get_lang('SystemUnableToSendEmailContact') . Display :: encrypted_mailto_link(get_setting('emailAdministrator'), get_lang('PlatformAdmin')).".</p>";
Display::display_error_message($message, false);
}
}
//-----------------------------------------------------------------------------
/*** By Olivier Cauberghe, UGent ***/
/**
* Enter description here...
*
* @param unknown_type $user
* @return unknown
*
* @author Olivier Cauberghe <olivier.cauberghe@UGent.be>, Ghent University
*/
function handle_encrypted_password($user)
{
global $charset;
@ -84,18 +116,28 @@ function handle_encrypted_password($user)
$secretword = get_secret_word($emailTo);
$emailBody = get_lang("password_request")."\n\n\n".get_lang("YourAccountParam")." ".$_configuration['root_web']."\n\n".$userAccountList;
if (@ api_send_mail($emailTo, $emailSubject, $emailBody, $emailHeaders))
return get_lang('YourPasswordHasBeenEmailed');
{
Display::display_confirmation_message(get_lang('YourPasswordHasBeenEmailed'));
}
else
echo "<p>", "The system is unable to send you an e-mail.<br/>", "Please contact the ", Display::encrypted_mailto_link(get_setting('emailAdministrator'),"platform administrator"), ".<p>";
return "";
{
$message = get_lang('SystemUnableToSendEmailContact') . Display :: encrypted_mailto_link(get_setting('emailAdministrator'), get_lang('PlatformAdmin')).".</p>";
Display::display_error_message($message, false);
}
}
//-----------------------------------------------------------------------------
/**
* Enter description here...
* @author Olivier Cauberghe <olivier.cauberghe@UGent.be>, Ghent University
*/
function get_secret_word($add)
{
global $_configuration;
return $secretword = md5($_configuration['security_key'].$add);
}
//-----------------------------------------------------------------------------
/**
* Enter description here...
* @author Olivier Cauberghe <olivier.cauberghe@UGent.be>, Ghent University
*/
function reset_password($secret, $id)
{
global $your_password_has_been_reset,$userPasswordCrypted;
@ -104,21 +146,27 @@ function reset_password($secret, $id)
$sql = "SELECT user_id AS uid, lastname AS lastName, firstname AS firstName, username AS loginName, password, email FROM ".$tbl_user." WHERE user_id=$id";
$result = api_sql_query($sql,__FILE__,__LINE__);
if ($result && mysql_num_rows($result))
{
$user[] = mysql_fetch_array($result);
}
else
{
return "Could not reset password.";
}
if (get_secret_word($user[0]["email"]) == $secret) // OK, secret word is good. Now change password and mail it.
{
$user[0]["password"] = api_generate_password();
$crypted = $user[0]["password"];
if( $userPasswordCrypted)
{
$crypted = md5($crypted);
$crypted = md5($crypted);
}
api_sql_query("UPDATE ".$tbl_user." SET password='$crypted' WHERE user_id=$id");
return send_password_to_user($user, $your_password_has_been_reset);
}
else
{
return "Not allowed.";
}
}
?>

@ -1,4 +1,4 @@
<?php //$Id: agenda.inc.php 11855 2007-04-03 15:00:22Z pcool $
<?php //$Id: agenda.inc.php 11873 2007-04-04 19:46:04Z pcool $
/*
==============================================================================
Dokeos - elearning and course management software
@ -36,7 +36,7 @@
/*
-----------------------------------------------------------
Constants and variables
Constants and variables
-----------------------------------------------------------
*/
// the variables for the days and the months
@ -48,9 +48,9 @@ $DaysLong = array (get_lang("SundayLong"), get_lang("MondayLong"), get_lang("Tue
$MonthsLong = array (get_lang("JanuaryLong"), get_lang("FebruaryLong"), get_lang("MarchLong"), get_lang("AprilLong"), get_lang("MayLong"), get_lang("JuneLong"), get_lang("JulyLong"), get_lang("AugustLong"), get_lang("SeptemberLong"), get_lang("OctoberLong"), get_lang("NovemberLong"), get_lang("DecemberLong"));
/*
==============================================================================
==============================================================================
FUNCTIONS
==============================================================================
==============================================================================
*/
/**
@ -429,10 +429,10 @@ global $_cid;
if (!isset($courseadmin_filter))
{$courseadmin_filter='';}
$sql = "SELECT u.user_id uid, u.lastname lastName, u.firstname firstName
FROM $tbl_user as u, $tbl_courseUser as cu
WHERE cu.course_code = '".$_cid."'
AND cu.user_id = u.user_id $courseadmin_filter
$sql = "SELECT u.user_id uid, u.lastname lastName, u.firstname firstName
FROM $tbl_user as u, $tbl_courseUser as cu
WHERE cu.course_code = '".$_cid."'
AND cu.user_id = u.user_id $courseadmin_filter
ORDER BY u.lastname, u.firstname";
$result = api_sql_query($sql,__FILE__,__LINE__);
while($user=mysql_fetch_array($result)){
@ -440,17 +440,17 @@ while($user=mysql_fetch_array($result)){
}
if(!empty($_SESSION['id_session'])){
$sql = "SELECT u.user_id uid, u.lastname lastName, u.firstName firstName
$sql = "SELECT u.user_id uid, u.lastname lastName, u.firstName firstName
FROM $tbl_session_course_user AS session_course_user
INNER JOIN $tbl_user u
ON u.user_id = session_course_user.id_user
WHERE id_session='".$_SESSION['id_session']."'
WHERE id_session='".$_SESSION['id_session']."'
AND course_code='$_cid'";
$result = api_sql_query($sql,__FILE__,__LINE__);
while($user=mysql_fetch_array($result)){
$users[$user[0]] = $user;
}
}
}
@ -667,8 +667,8 @@ return $last_id;
*/
function store_agenda_item_as_announcement($item_id){
$table_agenda = Database::get_course_table(TABLE_AGENDA);
$table_ann = Database::get_course_table(TABLE_ANNOUNCEMENT);
//check params
$table_ann = Database::get_course_table(TABLE_ANNOUNCEMENT);
//check params
if(empty($item_id) or $item_id != strval(intval($item_id))){return -1;}
//get the agenda item
$sql = "SELECT * FROM $table_agenda WHERE id = '".$item_id."'";
@ -684,7 +684,7 @@ function store_agenda_item_as_announcement($item_id){
//build the announcement text
$content = $row['start_date']." - ".$row['end_date']."\n\n".$row['content'];
//insert announcement
$sql_ins = "INSERT INTO $table_ann (title,content,end_date,display_order) " .
"VALUES ('".$row['title']."','$content','".$row['end_date']."','$max')";
$res_ins = api_sql_query($sql_ins,__FILE__,__LINE__);
@ -959,7 +959,7 @@ function show_user_group_filter_form()
echo ($this_user['uid']==$_SESSION['user'])? " selected":"" ;
echo ">".$this_user['lastName']." ".$this_user['firstName']."</option>";
}
echo "\n\t</optgroup>";
echo "\n\t</optgroup>";
echo "</select>";
}
@ -1031,7 +1031,7 @@ function change_visibility($tool,$id)
* @author Patrick Cool <patrick.cool@UGent.be>, Ghent University
*/
function display_courseadmin_links()
{
{
echo "<li><a href='".$_SERVER['PHP_SELF']."?action=add&amp;origin=".$_GET['origin']."'><img src=\"../img/view_more_stats.gif\" alt=\"".get_lang('MoreStats')."\" border=\"0\" /> ".get_lang("AgendaAdd")."</a><br /></li>";
if (empty ($_SESSION['toolgroup']))
{
@ -1054,21 +1054,21 @@ function display_student_links()
global $show;
if ($_SESSION['sort'] == 'DESC')
{
echo "<li><a href='".$_SERVER['PHP_SELF']."?sort=asc&amp;origin=".$_GET['origin']."'><img src=\"../img/calendar_up.gif\" border=\"0\" alt=\"".get_lang('AgendaSortChronologicallyUp')."\" /> ".get_lang("AgendaSortChronologicallyUp")."</a></li>";
echo "<li><a href='".$_SERVER['PHP_SELF']."?sort=asc&amp;origin=".$_GET['origin']."'>".Display::return_icon('calendar_up.gif',get_lang('AgendaSortChronologicallyUp')).' '.get_lang("AgendaSortChronologicallyUp")."</a></li>";
}
else
{
echo "<li><a href='".$_SERVER['PHP_SELF']."?sort=desc&amp;origin=".$_GET['origin']."'><img src=\"../img/calendar_down.gif\" border=\"0\" alt=\"".get_lang('AgendaSortChronologicallyDown')."\" /> ".get_lang("AgendaSortChronologicallyDown")."</a></li>";
echo "<li><a href='".$_SERVER['PHP_SELF']."?sort=desc&amp;origin=".$_GET['origin']."'>".Display::return_icon('calendar_down.gif',get_lang('AgendaSortChronologicallyDown')).' '.get_lang("AgendaSortChronologicallyDown")."</a></li>";
}
// showing the link to show all items or only those of the current month
if ($_SESSION['show']=="showcurrent")
{
echo "<li><a href='".$_SERVER['PHP_SELF']."?action=showall&amp;origin=".$_GET['origin']."'><img src=\"../img/calendar_select.gif\" border=\"0\" /> ".get_lang("ShowAll")."</a></li>";
echo "<li><a href='".$_SERVER['PHP_SELF']."?action=showall&amp;origin=".$_GET['origin']."'>".Display::return_icon('calendar_select.gif').' '.get_lang("ShowAll")."</a></li>";
}
else
{
echo "<li><a href='".$_SERVER['PHP_SELF']."?action=showcurrent&amp;origin=".$_GET['origin']."'><img src=\"../img/calendar_month.gif\" border=\"0\" /> ".get_lang("ShowCurrent")."</a></li>";
echo "<li><a href='".$_SERVER['PHP_SELF']."?action=showcurrent&amp;origin=".$_GET['origin']."'>".Display::return_icon('calendar_month.gif').' '.get_lang("ShowCurrent")."</a></li>";
}
}
@ -1238,7 +1238,7 @@ function showhide_agenda_item($id)
==================================================*/
// and $_GET['isStudentView']<>"false" is added to prevent that the visibility is changed after you do the following:
// change visibility -> studentview -> course manager view
if ((is_allowed_to_edit() OR api_get_course_setting('allow_user_edit_agenda')) and $_GET['isStudentView']<>"false")
if ((is_allowed_to_edit() OR api_get_course_setting('allow_user_edit_agenda')) and $_GET['isStudentView']<>"false")
{
if (isset($_GET['id'])&&$_GET['id']&&isset($_GET['action'])&&$_GET['action']=="showhide")
{
@ -1261,7 +1261,7 @@ function display_agenda_items()
global $is_courseAdmin;
global $dateFormatLong, $timeNoSecFormat;
global $_user;
// getting the group memberships
$group_memberships=GroupManager::get_group_ids($_course['dbName'],$_user['user_id']);
@ -1495,11 +1495,11 @@ function display_agenda_items()
// the icons. If the message is sent to one or more specific users/groups
// we add the groups icon
// 2do: if it is sent to groups we display the group icon, if it is sent to a user we show the user icon
echo "<img src=\"../img/agenda.gif\" border=\"0\" />";
Display::display_icon('agenda.gif', get_lang('Agenda'));
if ($myrow['to_group_id']!=='0')
{
echo "<img src=\"../img/group.gif\" border=\"0\" />";
}
{
echo "<img src=\"../img/group.gif\" border=\"0\" alt=\"".get_lang('Group')."\"/>";
}
echo " ".$myrow['title']."\n";
echo "\t\t</th>\n";
@ -1537,7 +1537,7 @@ function display_agenda_items()
echo "<tr class='row_even'>";
echo "<td colspan='2'>";
echo '<a href="#" onclick="javascript:win_print=window.open(\'print.php?id='.$myrow['id'].'\',\'popup\',\'left=100,top=100,width=700,height=500,scrollbars=1,resizable=0\'); win_print.focus(); return false;"><img src="../img/print.gif" border="0" title="'.htmlentities(get_lang('Print')).'" /></a>&nbsp;';
echo '<a href="#" onclick="javascript:win_print=window.open(\'print.php?id='.$myrow['id'].'\',\'popup\',\'left=100,top=100,width=700,height=500,scrollbars=1,resizable=0\'); win_print.focus(); return false;">'.Display::return_icon('print.gif', get_lang('Print')).'</a>&nbsp;';
echo $content;
echo "</td></tr>";
@ -1560,19 +1560,19 @@ function display_agenda_items()
/*--------------------------------------------------
display: edit delete button (course admin only)
--------------------------------------------------*/
$event_list.=$myrow['id'].',';
echo "<tr class='row_odd'><td>";
if (is_allowed_to_edit() OR api_get_course_setting('allow_user_edit_agenda'))
{
// edit
echo "<a href=\"".$_SERVER['PHP_SELF']."?origin=".$_GET['origin']."&action=edit&id=".$myrow['id']."\">",
"<img src=\"../img/edit.gif\" border=\"0\" align=\"absmiddle\" alt=\"".get_lang("ModifyCalendarItem")."\" /></a>",
"<a href=\"".$_SERVER['PHP_SELF']."?origin=".$_GET['origin']."&action=delete&id=".$myrow['id']."\" onclick=\"javascript:if(!confirm('".addslashes(htmlentities(get_lang("ConfirmYourChoice")))."')) return false;\">",
"<img src=\"../img/delete.gif\" border=\"0\" align=\"absmiddle\" alt=\"".get_lang("Delete")."\"/></a>";
echo "<a href=\"".$_SERVER['PHP_SELF']."?origin=".$_GET['origin']."&action=announce&id=".$myrow['id']."\">".
"<img src=\"../img/announce_add.gif\" border=\"0\" align=\"absmiddle\" alt=\"".get_lang("AddAnnouncement")."\"/></a>";
echo "<a href=\"".$_SERVER['PHP_SELF']."?origin=".$_GET['origin']."&amp;action=edit&amp;id=".$myrow['id']."\">",
"<img src=\"../img/edit.gif\" border=\"0\" alt=\"".get_lang("ModifyCalendarItem")."\" /></a>",
"<a href=\"".$_SERVER['PHP_SELF']."?origin=".$_GET['origin']."&amp;action=delete&amp;id=".$myrow['id']."\" onclick=\"javascript:if(!confirm('".addslashes(htmlentities(get_lang("ConfirmYourChoice")))."')) return false;\">",
"<img src=\"../img/delete.gif\" border=\"0\" alt=\"".get_lang("Delete")."\"/></a>";
echo "<a href=\"".$_SERVER['PHP_SELF']."?origin=".$_GET['origin']."&amp;action=announce&amp;id=".$myrow['id']."\">".
"<img src=\"../img/announce_add.gif\" border=\"0\" alt=\"".get_lang("AddAnnouncement")."\"/></a>";
if ($myrow['visibility']==1)
{
$image_visibility="visible";
@ -1582,17 +1582,17 @@ function display_agenda_items()
$image_visibility="invisible";
}
echo "<a href=\"".$_SERVER['PHP_SELF']."?origin=".$_GET['origin']."&amp;action=showhide&amp;id=".$myrow['id']."\">",
"<img src=\"../img/".$image_visibility.".gif\" border=\"0\" align=\"absmiddle\" alt=\"".get_lang("Visible")."\" /></a>";
"<img src=\"../img/".$image_visibility.".gif\" border=\"0\" alt=\"".get_lang("Visible")."\" /></a>";
}
echo "</td>";
$counter++;
/*--------------------------------------------------
display: jump-to-top icon
--------------------------------------------------*/
echo "<td><a href=\"#top\"><img src=\"../img/top.gif\" border=\"0\" alt=\"to top\" align=\"right\" /></a></td></tr>";
echo "</table><br><br>";
echo "</table><br /><br />";
} // end while ($myrow=mysql_fetch_array($result))
@ -1701,10 +1701,10 @@ function display_one_agenda_item($agenda_id)
// the icons. If the message is sent to one or more specific users/groups
// we add the groups icon
// 2do: if it is sent to groups we display the group icon, if it is sent to a user we show the user icon
echo "<img src=\"../img/agenda.gif\" border=\"0\" />";
echo Display::return_icon('agenda.gif');
if ($myrow['to_group_id']!=='0')
{
echo "<img src=\"../img/group.gif\" border=\"0\" />";
echo Display::return_icon('group.gif'); //"<img src=\"../img/group.gif\" border=\"0\" />";
}
echo " ".$myrow['title']."\n";
echo "\t\t</td>\n";
@ -1908,26 +1908,28 @@ function show_add_form($id = '')
</tr>
<!-- the select specific users / send to all form -->
<?php
<?php
if (isset ($_SESSION['toolgroup']))
{
echo '<tr id="subtitle">';
echo '<td colspan="3">';
echo '<input type="hidden" name="selectedform[0]" value="GROUP:'.$_SESSION['toolgroup'].'"/>' ;
echo '<input type="hidden" name="To" value="true"/>' ;
echo '<input type="hidden" name="selectedform[0]" value="GROUP:'.$_SESSION['toolgroup'].'"/>' ;
echo '<input type="hidden" name="To" value="true"/>' ;
echo '</td>';
echo '</tr>';
}else{
echo '</tr>';
}
else
{
?>
<tr class="subtitle">
<td valign="top" colspan="3">
<?php
// this variable defines if the course administrator can send a message to a specific user / group
// or not
// or not
//echo "<input type=\"submit\" name=\"To\" value=\"".get_lang("SelectGroupsUsers")."\" style=\"float:left\">" ;
//echo "sessiewaarde: ".$_SESSION['allow_individual_calendar'];
echo get_lang("SentTo").": ";
if ((isset($_GET['id']) && $to=='everyone') || !isset($_GET['id'])){
@ -1943,23 +1945,23 @@ function show_add_form($id = '')
</td>
</tr>
<?php
}
<?php
}
?>
<!-- START date and time -->
<tr class="subtitle">
<td>
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr><td width="110">
<!-- date: 1 -> 31 -->
<?php echo get_lang('StartDate').": \n"; ?>
</td>
<td>
<select name="fday" onchange="javascript:document.new_calendar_item.end_fday.value=this.value;">
<?php
// small loop for filling all the dates
@ -1971,7 +1973,7 @@ function show_add_form($id = '')
$value = ($i <= 9 ? '0'.$i : $i );
// the current day is indicated with [] around the date
if ($value==$day)
{
{
echo "\t\t\t\t <option value=\"".$value."\" selected> ".$i." </option>\n";
}
else
@ -1998,12 +2000,12 @@ function show_add_form($id = '')
$value=$i;
}
if ($value==$month)
{
echo "\t\t\t\t <option value=\"".$value."\" selected>".$MonthsLong[$i-1]."</option>\n";
{
echo "\t\t\t\t <option value=\"".$value."\" selected>".$MonthsLong[$i-1]."</option>\n";
}
else
{
echo "\t\t\t\t <option value=\"".$value."\">".$MonthsLong[$i-1]."</option>\n";
{
echo "\t\t\t\t <option value=\"".$value."\">".$MonthsLong[$i-1]."</option>\n";
}
} ?>
</select>
@ -2019,20 +2021,20 @@ function show_add_form($id = '')
echo "\t\t\t\t<option value=\"$value\">$value</option>\n";
} ?>
</select>
<a href="javascript:openCalendar('new_calendar_item', 'f')"><img src="../img/calendar_select.gif" border="0" align="absmiddle" /></a>
<a href="javascript:openCalendar('new_calendar_item', 'f')"><img src="../img/calendar_select.gif" border="0" alt="Select"/></a>
</td></tr></table>
</td>
<td>
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr><td width="110">
<!-- date: 1 -> 31 -->
<?php echo get_lang('StartTime').": \n"; ?>
</td>
<td>
<select name="fhour" onchange="javascript:document.new_calendar_item.end_fhour.value=this.value;">
<option value="--">--</option>
<?php
@ -2043,8 +2045,8 @@ function show_add_form($id = '')
$value = ($i <= 9 ? '0'.$i : $i );
// the current hour is indicated with [] around the hour
if ($hours==$value)
{
echo "\t\t\t\t<option value=\"".$value."\" selected> ".$value." </option>\n";
{
echo "\t\t\t\t<option value=\"".$value."\" selected> ".$value." </option>\n";
}
else
{
@ -2071,16 +2073,16 @@ function show_add_form($id = '')
<tr class="subtitle">
<td>
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr><td width="110">
<!-- date: 1 -> 31 -->
<?php echo get_lang('EndDate').": \n"; ?>
</td>
<td>
<select name="end_fday">
<?php
// small loop for filling all the dates
@ -2124,21 +2126,21 @@ function show_add_form($id = '')
echo "\t\t\t\t<option value=\"$value\">$value</option>\n";
} ?>
</select>
<a href="javascript:openCalendar('new_calendar_item', 'end_f')"><img src="../img/calendar_select.gif" border="0" align="absmiddle" /></a>
<a href="javascript:openCalendar('new_calendar_item', 'end_f')"><img src="../img/calendar_select.gif" border="0" /></a>
</td></tr></table>
</td>
<td>
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr><td width="110">
<!-- date: 1 -> 31 -->
<?php echo get_lang('EndTime').": \n"; ?>
</td>
<td>
<select name="end_fhour">
<option value="--">--</option>
<?php
@ -2179,10 +2181,10 @@ function show_add_form($id = '')
<tr>
<td colspan="7">
<?php
<?php
require_once(api_get_path(LIBRARY_PATH) . "/fckeditor/fckeditor.php");
$oFCKeditor = new FCKeditor('content') ;
$oFCKeditor->BasePath = api_get_path(WEB_PATH) . 'main/inc/lib/fckeditor/' ;
$oFCKeditor->Height = '175';
@ -2190,17 +2192,17 @@ function show_add_form($id = '')
$oFCKeditor->Value = $content;
$oFCKeditor->Config['CustomConfigurationsPath'] = api_get_path(REL_PATH)."main/inc/lib/fckeditor/myconfig.js";
$oFCKeditor->ToolbarSet = "Middle";
$TBL_LANGUAGES = Database::get_main_table(TABLE_MAIN_LANGUAGE);
$sql="SELECT isocode FROM ".$TBL_LANGUAGES." WHERE english_name='".$_SESSION["_course"]["language"]."'";
$result_sql=api_sql_query($sql);
$isocode_language=mysql_result($result_sql,0,0);
$oFCKeditor->Config['DefaultLanguage'] = $isocode_language;
$return = $oFCKeditor->CreateHtml();
echo $return;
?>
</td>
</tr>

@ -93,10 +93,12 @@ class Display {
* @param string $tool These are the constants that are used for indicating the tools
* @return html code for adding an introduction
*/
function display_introduction_section($tool) {
function display_introduction_section($tool)
{
$is_allowed_to_edit = api_is_allowed_to_edit();
$moduleId = $tool;
if (api_get_setting('enable_tool_introduction') == 'true' || $tool==TOOL_COURSE_HOMEPAGE) {
if (api_get_setting('enable_tool_introduction') == 'true' || $tool==TOOL_COURSE_HOMEPAGE)
{
include (api_get_path(INCLUDE_PATH)."introductionSection.inc.php");
}
}
@ -111,7 +113,8 @@ class Display {
*
* @param $full_file_name, the (path) name of the file, without .html
*/
function display_localised_html_file($full_file_name) {
function display_localised_html_file($full_file_name)
{
global $language_interface;
$localised_file_name = $full_file_name."_".$language_interface.".html";
$default_file_name = $full_file_name.".html";
@ -195,10 +198,16 @@ class Display {
if ($is_alternating)
{
if ($bgcolor == "bgcolor='".HTML_WHITE."'")
{
$bgcolor = "bgcolor='".DOKEOSLIGHTGREY."'";
}
else
{
if ($bgcolor == "bgcolor='".DOKEOSLIGHTGREY."'")
{
$bgcolor = "bgcolor='".HTML_WHITE."'";
}
}
}
return $bgcolor;
}
@ -294,7 +303,8 @@ class Display {
*/
function display_normal_message($message,$filter=true)
{
if($filter){
if($filter)
{
//filter message
$message = htmlentities($message);
}
@ -386,6 +396,7 @@ class Display {
//filter message
$message = htmlentities($message);
}
if (!headers_sent())
{
echo '

@ -45,7 +45,7 @@
INIT SECTION
==============================================================================
*/
// name of the language file that needs to be included
// name of the language file that needs to be included
$language_file = "link";
// including libraries
@ -151,10 +151,10 @@ switch($_GET['action'])
break;
case "visible":
change_visibility($_GET['id'],$_GET['scope']); // here we edit a category
break;
break;
case "invisible":
change_visibility($_GET['id'],$_GET['scope']); // here we edit a category
break;
break;
}
@ -180,7 +180,7 @@ if (is_allowed_to_edit())
{
echo "<input type=\"hidden\" name=\"id\" value=\"".$_GET['id']."\" />";
}
echo "<table><tr>"
. "<td align=\"right\">URL<span class=\"required\">*</span> :</td>"
. "<td><input type=\"text\" name=\"urllink\" size=\"50\" value=\"" . (empty($urllink)?'http://':htmlentities($urllink)) . "\" /></td>" . "</tr>";
@ -188,9 +188,9 @@ if (is_allowed_to_edit())
. "<td align=\"right\">" . get_lang("LinkName") . " :</td>"
. "<td><input type=\"text\" name=\"title\" size=\"50\" value=\"" . htmlentities($title) . "\" /></td>"
. "</tr>"
. "<tr>" .
"<td align=\"right\" valign=\"top\">" . get_lang("Description") . " :</td>" .
"<td><textarea wrap=\"physical\" rows=\"3\" cols=\"50\" name=\"description\">" .
. "<tr>" .
"<td align=\"right\" valign=\"top\">" . get_lang("Description") . " :</td>" .
"<td><textarea rows=\"3\" cols=\"50\" name=\"description\">" .
htmlentities($description) . "</textarea></td></tr>";
$sqlcategories="SELECT * FROM ".$tbl_categories." ORDER BY display_order DESC";
@ -213,7 +213,7 @@ if (is_allowed_to_edit())
}
echo "<tr><td align=\"right\">".get_lang("OnHomepage")." ? </td><td><input class=\"checkbox\" type=\"checkbox\" name=\"onhomepage\" id=\"onhomepage\" value=\"1\" $onhomepage><label for=\"onhomepage\"> ".get_lang("Yes")."</label></td></tr>";
echo "<tr><td></td><td><input type=\"Submit\" name=\"submitLink\" value=\"".get_lang("Ok")."\" /></td></tr>",
"</table>",
"</form>";
@ -236,8 +236,8 @@ if (is_allowed_to_edit())
"<td><input type=\"text\" name=\"category_title\" size=\"50\" value=\"",htmlentities($category_title)."\" /></td>",
"</tr>",
"<tr><td align=\"right\" valign=\"top\">".get_lang("Description")." :</td>",
"<td><textarea wrap=\"physical\" rows=\"3\" cols=\"50\" name=\"description\">",htmlentities($description)."</textarea></td></tr>",
"<tr><td></td><td><input type=\"Submit\" name=\"submitCategory\" value=\"".get_lang("Ok")."\"></td></tr>",
"<td><textarea rows=\"3\" cols=\"50\" name=\"description\">",htmlentities($description)."</textarea></td></tr>",
"<tr><td></td><td><input type=\"Submit\" name=\"submitCategory\" value=\"".get_lang("Ok")."\" /></td></tr>",
"</table>",
"</form>";
}
@ -353,14 +353,14 @@ while ($myrow=@mysql_fetch_array($resultcategories))
echo "<tr><th style=\"font-weight: bold; text-align:left;padding-left: 10px;\">+ <a href=\"".$_SERVER['PHP_SELF']."?urlview=";
echo is_array($view)?implode('',$view):$view;
echo "\">".htmlentities($myrow["category_title"])."</a><br>&nbsp;&nbsp;&nbsp;";
echo "\">".htmlentities($myrow["category_title"])."</a><br />&nbsp;&nbsp;&nbsp;";
echo $myrow["description"];
if (is_allowed_to_edit())
{
showcategoryadmintools($myrow["id"]);
}
echo "</td>",
echo "</th>",
"</tr>";
}
// displaying the link of the category

@ -66,7 +66,7 @@ function addlinkcategory($type)
$urllink = $_POST['urllink'];
$description = $_POST['description'];
$selectcategory = $_POST['selectcategory'];
if ($_POST['onhomepage'] == '')
if ($_POST['onhomepage'] = '')
{
$onhomepage = 0;
}
@ -231,7 +231,6 @@ function editlinkcategory($type)
global $selectcategory;
global $description;
global $category_title;
global $onhomepage;
$tbl_link = Database :: get_course_table(TABLE_LINK);
$tbl_categories = Database :: get_course_table(TABLE_LINK_CATEGORY);
@ -255,7 +254,7 @@ function editlinkcategory($type)
// this is used to put the modified info of the link-form into the database
if ($_POST['submitLink'])
{
if ($_POST['onhomepage'] == '')
if ($_POST['onhomepage'] = '')
{
$onhomepage = 0;
}
@ -386,12 +385,12 @@ function showlinksofcategory($catid)
{
if (api_is_allowed_to_edit())
{
echo "<tr>", "<td align=\"center\" valign=\"middle\" width=\"15\">", "<a href=\"link_goto.php?link_id=", $myrow[0], "&link_url=", urlencode($myrow[1]), "\" target=\"_blank\" class=\"invisible\">", "<img src=\"../../main/img/file_html_na.gif\" border=\"0\" alt=\"".get_lang('Links')."\">", "</td>", "<td width=\"580\" valign=\"top\">", "<a href=\"link_goto.php?link_id=", $myrow[0], "&link_url=", urlencode($myrow[1]), "\" target=\"_blank\" class=\"invisible\">", htmlentities($myrow[2]), "</a>\n", "<br>", $myrow[3], "";
echo "<tr>", "<td align=\"center\" valign=\"middle\" width=\"15\">", "<a href=\"link_goto.php?link_id=", $myrow[0], "&amp;link_url=", urlencode($myrow[1]), "\" target=\"_blank\" class=\"invisible\">", Display::return_icon('file_html_na.gif', get_lang('Links')),"</a></td>", "<td width=\"580\" valign=\"top\">", "<a href=\"link_goto.php?link_id=", $myrow[0], "&amp;link_url=", urlencode($myrow[1]), "\" target=\"_blank\" class=\"invisible\">", htmlentities($myrow[2]), "</a>\n", "<br />", $myrow[3], "";
}
}
if (api_is_allowed_to_edit())
{
echo "<br>", "<a href=\"".$_SERVER['PHP_SELF']."?action=editlink&category=$category&id=$myrow[0]&urlview=$urlview\">", "<img src=\"../img/edit.gif\" border=\"0\" alt=\"", get_lang('Modify'), "\">", "</a>", " <a href=\"".$_SERVER['PHP_SELF']."?action=deletelink&amp;id=", $myrow[0], "&urlview=", $urlview, "\" onclick=\"javascript:if(!confirm('".get_lang('LinkDelconfirm')."')) return false;\">", "<img src=\"../img/delete.gif\" border=\"0\" alt=\"", get_lang('Delete'), "\">", "</a>";
echo "<br />", "<a href=\"".$_SERVER['PHP_SELF']."?action=editlink&amp;category=$category&amp;id=$myrow[0]&amp;urlview=$urlview\">", "<img src=\"../img/edit.gif\" border=\"0\" alt=\"", get_lang('Modify'), "\" />", "</a>", " <a href=\"".$_SERVER['PHP_SELF']."?action=deletelink&amp;id=", $myrow[0], "&amp;urlview=", $urlview, "\" onclick=\"javascript:if(!confirm('".get_lang('LinkDelconfirm')."')) return false;\">", "<img src=\"../img/delete.gif\" border=\"0\" alt=\"", get_lang('Delete'), "\" />", "</a>";
// DISPLAY MOVE UP COMMAND only if it is not the top link
if ($i != 1)
{
@ -404,11 +403,11 @@ function showlinksofcategory($catid)
}
if ($myrow['visibility'] == "1")
{
echo "<a href=\"link.php?action=invisible&amp;id=".$myrow['id']."&amp;scope=link\"><img src=\"../img/visible.gif\"/></a>";
echo "<a href=\"link.php?action=invisible&amp;id=".$myrow['id']."&amp;scope=link\">".Display::return_icon('visible.gif')."</a>";
}
if ($myrow['visibility'] == "0")
{
echo "<a href=\"link.php?action=visible&amp;id=".$myrow['id']."&amp;scope=link\"><img src=\"../img/invisible.gif\"/></a>";
echo "<a href=\"link.php?action=visible&amp;id=".$myrow['id']."&amp;scope=link\">".Display::return_icon('invisible.gif')."</a>";
}
}

@ -41,11 +41,11 @@ function display_action_links($cur_dir_path, $always_show_tool_options, $always_
}
if (! $always_show_upload_form )
{
$display_output .= "<a href=\"".$_SERVER['PHP_SELF']."?curdirpath=".$cur_dir_path."&display_upload_form=true&origin=".$_GET['origin']."\">".Display::return_icon('submit_file.gif')." ". get_lang("UploadADocument") . "</a> ";
$display_output .= "<a href=\"".$_SERVER['PHP_SELF']."?curdirpath=".$cur_dir_path."&amp;display_upload_form=true&amp;origin=".$_GET['origin']."\">".Display::return_icon('submit_file.gif')." ". get_lang("UploadADocument") . "</a> ";
}
if (! $always_show_tool_options && api_is_allowed_to_edit() )
{
$display_output .= "<a href=\"".$_SERVER['PHP_SELF']."?curdirpath=".$cur_dir_path."&display_tool_options=true&origin=".$_GET['origin']."\">".Display::return_icon('acces_tool.gif').' ' . get_lang("EditToolOptions") . "</a> ";
$display_output .= "<a href=\"".$_SERVER['PHP_SELF']."?curdirpath=".$cur_dir_path."&amp;display_tool_options=true&amp;origin=".$_GET['origin']."\">".Display::return_icon('acces_tool.gif').' ' . get_lang("EditToolOptions") . "</a> ";
}
if ($display_output != "")
@ -72,16 +72,16 @@ function display_tool_options($uploadvisibledisabled, $origin,$base_work_dir,$cu
$work_table = Database::get_course_table(TABLE_STUDENT_PUBLICATION);
if (! $is_allowed_to_edit) return;
echo '<form method="post" action="'.$_SERVER['PHP_SELF'].'?origin='.$origin.'&display_tool_options=true"; ">';
echo "<br><table class=\"data_table\">\n",
echo '<form method="post" action="'.$_SERVER['PHP_SELF'].'?origin='.$origin.'&display_tool_options=true">';
echo "<br/><table class=\"data_table\">\n",
"<tr><th>&nbsp;</th><th>".get_lang("Modify")."</th></tr><tr class=\"row_even\">\n",
"<td>",
get_lang('AllFiles')." : </td>",
"<td><a href=\"".$_SERVER['PHP_SELF']."?".api_get_cidreq()."&curdirpath=".$cur_dir_path."&origin=$origin&delete=all&display_tool_options=true\" ",
"<td><a href=\"".$_SERVER['PHP_SELF']."?".api_get_cidreq()."&amp;curdirpath=".$cur_dir_path."&amp;origin=$origin&amp;delete=all&amp;display_tool_options=true\" ",
"onclick=\"javascript:if(!confirm('".addslashes(htmlentities(get_lang('ConfirmYourChoice')))."')) return false;\">",
"<img src=\"../img/delete.gif\" border=\"0\" alt=\"".get_lang('Delete')."\" align=\"absmiddle\">",
"<img src=\"../img/delete.gif\" border=\"0\" alt=\"".get_lang('Delete')."\" />",
"</a>",
"&nbsp;";
@ -94,14 +94,14 @@ function display_tool_options($uploadvisibledisabled, $origin,$base_work_dir,$cu
if ($columnStatus['Default'] == 1)
{
echo "<a href=\"".$_SERVER['PHP_SELF']."?".api_get_cidreq()."&curdirpath=".$cur_dir_path."&origin=$origin&make_invisible=all&display_tool_options=true\">",
"<img src=\"../img/visible.gif\" border=\"0\" alt=\"".get_lang('Invisible')."\" align=\"absmiddle\">",
echo "<a href=\"".$_SERVER['PHP_SELF']."?".api_get_cidreq()."&curdirpath=".$cur_dir_path."&amp;origin=$origin&make_invisible=all&display_tool_options=true\">",
"<img src=\"../img/visible.gif\" border=\"0\" alt=\"".get_lang('Invisible')."\" />",
"</a>\n";
}
else
{
echo "<a href=\"".$_SERVER['PHP_SELF']."?".api_get_cidreq()."&curdirpath=".$cur_dir_path."&origin=$origin&make_visible=all&display_tool_options=true\">",
"<img src=\"../img/invisible.gif\" border=\"0\" alt=\"".get_lang('Visible')."\" align=\"absmiddle\">",
echo "<a href=\"".$_SERVER['PHP_SELF']."?".api_get_cidreq()."&amp;curdirpath=".$cur_dir_path."&amp;origin=$origin&amp;make_visible=all&amp;display_tool_options=true\">",
"<img src=\"../img/invisible.gif\" border=\"0\" alt=\"".get_lang('Visible')."\">",
"</a>\n";
}
}
@ -111,12 +111,12 @@ function display_tool_options($uploadvisibledisabled, $origin,$base_work_dir,$cu
display_default_visibility_form($uploadvisibledisabled);
echo '</table>';
echo '<div>'.get_lang("ValidateChanges").' : <input type="submit" name="changeProperties" value="'.get_lang("Ok").'"></div></form>';
echo "<br><table cellpadding=\"5\" cellspacing=\"2\" border=\"0\">\n";
echo '<div>'.get_lang("ValidateChanges").' : <input type="submit" name="changeProperties" value="'.get_lang("Ok").'" /></div></form>';
echo "<br/><table cellpadding=\"5\" cellspacing=\"2\" border=\"0\">\n";
/*
==============================================================================
Display directories list
@ -136,8 +136,8 @@ function display_tool_options($uploadvisibledisabled, $origin,$base_work_dir,$cu
get_lang("Up").'</a>&nbsp;'."\n";
}
echo '<!-- create directory -->' .
'<a href="'.$_SERVER['PHP_SELF'].'?'.api_get_cidreq().'&curdirpath='.$cur_dir_path.'&amp;createdir=1"><img src="../img/folder_new.gif" border="0" align="absmiddle" alt ="" /></a>'.
'<a href="'.$_SERVER['PHP_SELF'].'?'.api_get_cidreq().'&curdirpath='.$cur_dir_path.'&amp;createdir=1">'.get_lang("CreateDir").'</a>&nbsp;'."\n";
'<a href="'.$_SERVER['PHP_SELF'].'?'.api_get_cidreq().'&amp;curdirpath='.$cur_dir_path.'&amp;createdir=1"><img src="../img/folder_new.gif" border="0"alt ="" /></a>'.
'<a href="'.$_SERVER['PHP_SELF'].'?'.api_get_cidreq().'&amp;curdirpath='.$cur_dir_path.'&amp;createdir=1">'.get_lang("CreateDir").'</a>&nbsp;'."\n";
echo "</td></tr></table>";
}
@ -155,10 +155,10 @@ function display_default_visibility_form($uploadvisibledisabled)
<tr class="row_odd"><td align="left">
<strong><?php echo get_lang("_default_upload"); ?></strong></td>
<td><input class="checkbox" type="radio" name="uploadvisibledisabled" value="0"
<?php if($uploadvisibledisabled==0) echo "checked"; ?>>
<?php if($uploadvisibledisabled==0) echo "checked"; ?> />
<?php echo get_lang("_new_visible");?><br />
<input class="checkbox" type="radio" name="uploadvisibledisabled" value="1"
<?php if($uploadvisibledisabled==1) echo "checked"; ?>>
<?php if($uploadvisibledisabled==1) echo "checked"; ?> />
<?php echo get_lang("_new_unvisible"); ?><br />
</td></tr>
<?php
@ -303,23 +303,23 @@ function display_student_publications_list($work_dir,$sub_course_dir,$currentCou
if( $is_allowed_to_edit)
{
$action = '';
$action .= '<a href="'.$_SERVER['PHP_SELF'].'?curdirpath='.urlencode($my_sub_dir).'&origin='.$origin.'&edit='.$work->id.'"><img src="../img/edit.gif" alt="'.get_lang('Modify').'"></a>';
$action .= '<a href="'.$_SERVER['PHP_SELF'].'?curdirpath='.urlencode($my_sub_dir).'&origin='.$origin.'&delete='.$work->id.'" onclick="javascript:if(!confirm('."'".addslashes(htmlentities(get_lang('ConfirmYourChoice')))."'".')) return false;"><img src="../img/delete.gif" alt="'.get_lang('WorkDelete').'"></a>';
$action .= '<a href="'.$_SERVER['PHP_SELF'].'?curdirpath='.urlencode($my_sub_dir).'&origin='.$origin.'&move='.$work->id.'"><img src="../img/deplacer_fichier.gif" border="0" title="'.get_lang('Move').'" alt="" /></a>';
$action .= '<a href="'.$_SERVER['PHP_SELF'].'?curdirpath='.urlencode($my_sub_dir).'&amp;origin='.$origin.'&amp;edit='.$work->id.'"><img src="../img/edit.gif" alt="'.get_lang('Modify').'"></a>';
$action .= '<a href="'.$_SERVER['PHP_SELF'].'?curdirpath='.urlencode($my_sub_dir).'&amp;origin='.$origin.'&amp;delete='.$work->id.'" onclick="javascript:if(!confirm('."'".addslashes(htmlentities(get_lang('ConfirmYourChoice')))."'".')) return false;"><img src="../img/delete.gif" alt="'.get_lang('WorkDelete').'"></a>';
$action .= '<a href="'.$_SERVER['PHP_SELF'].'?curdirpath='.urlencode($my_sub_dir).'&amp;origin='.$origin.'&amp;move='.$work->id.'"><img src="../img/deplacer_fichier.gif" border="0" title="'.get_lang('Move').'" alt="" /></a>';
if($work->accepted == '1')
{
$action .= '<a href="'.$_SERVER['PHP_SELF'].'?curdirpath='.urlencode($my_sub_dir).'&origin='.$origin.'&make_invisible='.$work->id.'&amp;'.$sort_params.'"><img src="../img/visible.gif" alt="'.get_lang('Invisible').'"></a>';
$action .= '<a href="'.$_SERVER['PHP_SELF'].'?curdirpath='.urlencode($my_sub_dir).'&amp;origin='.$origin.'&amp;make_invisible='.$work->id.'&amp;'.$sort_params.'"><img src="../img/visible.gif" alt="'.get_lang('Invisible').'"></a>';
}
else
{
$action .= '<a href="'.$_SERVER['PHP_SELF'].'?curdirpath='.urlencode($my_sub_dir).'&origin='.$origin.'&make_visible='.$work->id.'&amp;'.$sort_params.'"><img src="../img/invisible.gif" alt="'.get_lang('Visible').'"></a>';
$action .= '<a href="'.$_SERVER['PHP_SELF'].'?curdirpath='.urlencode($my_sub_dir).'&amp;origin='.$origin.'&amp;make_visible='.$work->id.'&amp;'.$sort_params.'"><img src="../img/invisible.gif" alt="'.get_lang('Visible').'"></a>';
}
$row[] = $action;
}elseif($is_author){
$action = '';
$action .= '<a href="'.$_SERVER['PHP_SELF'].'?curdirpath='.urlencode($my_sub_dir).'&origin='.$origin.'&edit='.$work->id.'"><img src="../img/edit.gif" alt="'.get_lang('Modify').'"></a>';
$action .= '<a href="'.$_SERVER['PHP_SELF'].'?curdirpath='.urlencode($my_sub_dir).'&origin='.$origin.'&delete='.$work->id.'" onclick="javascript:if(!confirm('."'".addslashes(htmlentities(get_lang('ConfirmYourChoice')))."'".')) return false;"><img src="../img/delete.gif" alt="'.get_lang('WorkDelete').'"></a>';
$action .= '<a href="'.$_SERVER['PHP_SELF'].'?curdirpath='.urlencode($my_sub_dir).'&amp;origin='.$origin.'&amp;edit='.$work->id.'"><img src="../img/edit.gif" alt="'.get_lang('Modify').'"></a>';
$action .= '<a href="'.$_SERVER['PHP_SELF'].'?curdirpath='.urlencode($my_sub_dir).'&amp;origin='.$origin.'&amp;delete='.$work->id.'" onclick="javascript:if(!confirm('."'".addslashes(htmlentities(get_lang('ConfirmYourChoice')))."'".')) return false;"><img src="../img/delete.gif" alt="'.get_lang('WorkDelete').'"></a>';
$row[] = $action;
}else{
@ -401,7 +401,7 @@ function build_directory_selector($folders,$curdirpath,$group_dir='')
}
$form .= '</select>'."\n";
$form .= '<noscript><input type="submit" name="change_path" value="'.get_lang('Ok').'"></noscript>'."\n";
$form .= '<noscript><input type="submit" name="change_path" value="'.get_lang('Ok').'" /></noscript>'."\n";
$form .= '</form>';
return $form;
@ -419,7 +419,7 @@ function build_directory_selector($folders,$curdirpath,$group_dir='')
function build_move_to_selector($folders,$curdirpath,$move_file,$group_dir='')
{
$form = '<form name="move_to" action="'.$_SERVER['PHP_SELF'].'" method="POST">'."\n";
$form .= '<input type="hidden" name="move_file" value="'.$move_file.'">'."\n";
$form .= '<input type="hidden" name="move_file" value="'.$move_file.'" />'."\n";
$form .= get_lang('MoveTo').' <select name="move_to">'."\n";
//group documents cannot be uploaded in the root
@ -462,7 +462,7 @@ function build_move_to_selector($folders,$curdirpath,$move_file,$group_dir='')
}
$form .= '</select>'."\n";
$form .= '<input type="submit" name="move_file_submit" value="'.get_lang('Ok').'">'."\n";
$form .= '<input type="submit" name="move_file_submit" value="'.get_lang('Ok').'" />'."\n";
$form .= '</form>';
return $form;

@ -23,7 +23,7 @@
* @author Patrick Cool <patrick.cool@UGent.be>, Ghent University - ability for course admins to specify wether uploaded documents are visible or invisible by default.
* @author Roan Embrechts, code refactoring and virtual course support
* @author Frederic Vauthier, directories management
* @version $Id: work.php 11699 2007-03-26 13:47:44Z pcool $
* @version $Id: work.php 11873 2007-04-04 19:46:04Z pcool $
*
* @todo refactor more code into functions, use quickforms, coding standards, ...
*/
@ -827,56 +827,56 @@ if ($_POST['submitWork'] && $succeed &&!$id) //last value is to check this is no
$defaults["document"] = '<a href="'.format_url($submitGroupWorkUrl).'">'.$realUrl.'</a>';
$text_document->freeze();
}
elseif ($edit && ($is_allowed_to_edit or $is_author))
{
$workUrl = $currentCourseRepositoryWeb.$workUrl;
$form->addElement('hidden', 'id', $edit);
$html='<div class="row">
<div class="label">'.get_lang("Document").'
</div>
<div class="formw">
<div class="formw">
<a href="'.$workUrl.'">'.$workUrl.'</a>
</div>
</div>';
$form->addElement('html', $html);
}
else // else standard upload option
{
$form->addElement('file','file',get_lang('DownloadFile'));
}
$titleWork=$form->addElement('text', 'title', get_lang("TitleWork"));
$defaults["title"] = ($edit?stripslashes($workTitle):stripslashes($title));
$titleAuthors=$form->addElement('text', 'authors', get_lang("Authors"));
$defaults["authors"] = ($edit?stripslashes($workAuthor):stripslashes($authors));
$titleAuthors=$form->addElement('textarea', 'description', get_lang("Description"));
$defaults["description"] = ($edit?stripslashes($workDescription):stripslashes($description));
$form->addElement('hidden', 'active', 1);
$form->addElement('hidden', 'accepted', 1);
$form->addElement('submit', 'submitWork', get_lang('Ok'));
if(empty($authors))
{
$authors=$_user['lastName']." ".$_user['firstName'];
}
if($_POST['submitWork'] || $edit)
{
$form->addElement('submit', 'cancelForm', get_lang('Cancel'));
}
$form->add_real_progress_bar('uploadWork','DownloadFile');
$form->setDefaults($defaults);
$form->display();
}
//show them the form for the directory name
if(isset($_REQUEST['createdir']) && $is_allowed_to_edit)

Loading…
Cancel
Save