[svn r22011] -now student can edit the main page but only in your groups.

-fix export to pdf before utf8
-fix version for concurrent users when we started the wiki
skala
Juan Carlos Raña 17 years ago
parent fd3ed1f387
commit e3967fdcee
  1. 3
      main/wiki/export_html2pdf.php
  2. 4190
      main/wiki/index.php
  3. 8
      main/wiki/wiki.inc.php

@ -88,6 +88,7 @@ $html2pdf->pdf->SetAuthor('Wiki Dokeos');
$html2pdf->pdf->SetTitle($titlePDF);
$html2pdf->pdf->SetSubject('Exported from Dokeos Wiki');
$html2pdf->pdf->SetKeywords('Dokeos Wiki');
$html2pdf->WriteHTML(utf8_decode($htmlbuffer));
//$html2pdf->WriteHTML(utf8_decode($htmlbuffer));
$html2pdf->WriteHTML($htmlbuffer);
$html2pdf->Output($titlePDF.'.pdf', 'D');
?>

File diff suppressed because it is too large Load Diff

@ -38,6 +38,7 @@ FUNCTIONS FOR WIKI
==============================================================================
*/
// including the global dokeos file
/**
* @author Patrick Cool <patrick.cool@ugent.be>, Ghent University
@ -334,7 +335,7 @@ function save_wiki() {
* This function restore a wikipage
* @author Juan Carlos Raña <herodoto@telefonica.net>
**/
function restore_wikipage($r_reflink, $r_title, $r_content, $r_group_id, $r_assignment, $r_progress, $c_version, $r_version, $r_linksto)
function restore_wikipage($r_page_id, $r_reflink, $r_title, $r_content, $r_group_id, $r_assignment, $r_progress, $c_version, $r_version, $r_linksto)
{
global $tbl_wiki;
@ -344,7 +345,7 @@ function restore_wikipage($r_reflink, $r_title, $r_content, $r_group_id, $r_assi
$r_version = $r_version+1;
$r_comment = get_lang('RestoredFromVersion').': '.$c_version;
$sql="INSERT INTO ".$tbl_wiki." (reflink, title, content, user_id, group_id, dtime, assignment, comment, progress, version, linksto, user_ip) VALUES ('".$r_reflink."','".$r_title."','".$r_content."','".$r_user_id."','".$r_group_id."','".$r_dtime."','".$r_assignment."','".$r_comment."','".$r_progress."','".$r_version."','".$r_linksto."','".Database::escape_string($_SERVER['REMOTE_ADDR'])."')";
$sql="INSERT INTO ".$tbl_wiki." (page_id, reflink, title, content, user_id, group_id, dtime, assignment, comment, progress, version, linksto, user_ip) VALUES ('".$r_page_id."','".$r_reflink."','".$r_title."','".$r_content."','".$r_user_id."','".$r_group_id."','".$r_dtime."','".$r_assignment."','".$r_comment."','".$r_progress."','".$r_version."','".$r_linksto."','".Database::escape_string($_SERVER['REMOTE_ADDR'])."')";
$result=api_sql_query($sql);
$Id = Database::insert_id();
@ -525,6 +526,7 @@ function display_wiki_entry()
global $tbl_wiki;
global $groupfilter;
global $page;
$_clean['group_id']=(int)$_SESSION['_gid'];
if ($_GET['view'])
@ -556,7 +558,7 @@ function display_wiki_entry()
// if both are empty and we are displaying the index page then we display the default text.
if ($row['content']=='' AND $row['title']=='' AND $page=='index')
{
if(api_is_allowed_to_edit() || api_is_platform_admin())
if(api_is_allowed_to_edit() || api_is_platform_admin() || GroupManager :: is_user_in_group(api_get_user_id(),$_SESSION['_gid']))
{
$content=sprintf(get_lang('DefaultContent'),api_get_path(WEB_IMG_PATH));
$title=get_lang('DefaultTitle');

Loading…
Cancel
Save