From a9de02428d523e12b022342a59b73ffde8c34583 Mon Sep 17 00:00:00 2001 From: skaldrom Date: Sun, 6 Jun 2004 12:07:28 +0000 Subject: [PATCH] Export mechanism and Administration restriction. --- mod/wiki/admin.php | 11 +- mod/wiki/ewiki/ewiki.php | 8 +- mod/wiki/ewiki/plugins/aview/backlinks.php | 4 +- .../plugins/moodle/moodle_binary_store.php | 4 +- .../ewiki/plugins/moodle/moodle_wikidump.php | 453 ++++++++++++++++++ mod/wiki/ewiki/plugins/moodle/sitemap.php | 13 +- mod/wiki/ewikimoodlelib.php | 3 + mod/wiki/lib.php | 15 +- mod/wiki/view.php | 5 +- 9 files changed, 494 insertions(+), 22 deletions(-) create mode 100644 mod/wiki/ewiki/plugins/moodle/moodle_wikidump.php diff --git a/mod/wiki/admin.php b/mod/wiki/admin.php index 7ba5831b76..2364441735 100644 --- a/mod/wiki/admin.php +++ b/mod/wiki/admin.php @@ -74,7 +74,14 @@ if (($wiki_entry = wiki_get_entry($wiki, $course, $userid, $groupid)) === false || wiki_can_edit_entry($wiki_entry, $wiki, $USER, $course) === false) { error(get_string("notadministratewiki","wiki")); } - + + # Check for dangerous events (hacking) ! + if(in_array($action,array("removepages","strippages","revertpages"))) { + if($wiki->wtype!="student" || !isteacher($course->id)) { + error("Hack attack detected !"); + } + } + /// The wiki_entry->pagename is set to the specified value of the wiki, /// or the default value in the 'lang' file if the specified value was empty. define("EWIKI_PAGE_INDEX",$wiki_entry->pagename); @@ -294,7 +301,7 @@ /// Administrative Links echo ''; - wiki_print_administration_actions($cm->id, $userid, $groupid, $wikipage, $wiki->htmlmode!=2); + wiki_print_administration_actions($wiki, $cm->id, $userid, $groupid, $wikipage, $wiki->htmlmode!=2, $course); echo ''; # if($wiki->htmlmode!=2) { diff --git a/mod/wiki/ewiki/ewiki.php b/mod/wiki/ewiki/ewiki.php index 717d5062d9..631e6c11ea 100644 --- a/mod/wiki/ewiki/ewiki.php +++ b/mod/wiki/ewiki/ewiki.php @@ -277,6 +277,10 @@ #-- init stuff, autostarted parts ksort($ewiki_plugins["init"]); if ($pf_a = $ewiki_plugins["init"]) foreach ($pf_a as $pf) { + // Binary Handling starts here + if(headers_sent($file,$line)) { + print $file.":".$line."
"; + } $pf($GLOBALS); } unset($ewiki_plugins["init"]); @@ -886,7 +890,7 @@ function ewiki_script_url() { return(NULL); #-- could not guess it } - $url = "http://" . $_SERVER["SERVER_NAME"] . $url; + #$url = "http://" . $_SERVER["SERVER_NAME"] . $url; return($url); } @@ -3469,4 +3473,4 @@ function ewiki_database_mysql($action, &$args, $sw1, $sw2) { - + \ No newline at end of file diff --git a/mod/wiki/ewiki/plugins/aview/backlinks.php b/mod/wiki/ewiki/plugins/aview/backlinks.php index 7f90f3a13d..9977548f1b 100755 --- a/mod/wiki/ewiki/plugins/aview/backlinks.php +++ b/mod/wiki/ewiki/plugins/aview/backlinks.php @@ -19,6 +19,4 @@ function ewiki_view_append_backlinks($id, $data, $action) { return($o); } - - -?> \ No newline at end of file +?> \ No newline at end of file diff --git a/mod/wiki/ewiki/plugins/moodle/moodle_binary_store.php b/mod/wiki/ewiki/plugins/moodle/moodle_binary_store.php index ab349b8c4b..ec70c5d09a 100644 --- a/mod/wiki/ewiki/plugins/moodle/moodle_binary_store.php +++ b/mod/wiki/ewiki/plugins/moodle/moodle_binary_store.php @@ -47,9 +47,9 @@ function moodle_binary_get_path($id, $meta, $course, $wiki, $userid, $groupid) { $dir=make_upload_directory("$course->id/$CFG->moddata/wiki/$wiki->id/$entry->id/".$meta["section"]); if(substr($id, 0, strlen(EWIKI_IDF_INTERNAL))!=EWIKI_IDF_INTERNAL) { - error("Binary entry does not start with ".EWIKI_IDF_INTERNAL.":::".substr($id, 0, strlen(EWIKI_IDF_INTERNAL))); + error("Binary entry does not start with ".EWIKI_IDF_INTERNAL.substr($id, 0, strlen(EWIKI_IDF_INTERNAL))); } - $id = substr($id,11); + $id = substr($id,strlen(EWIKI_IDF_INTERNAL)); $id = clean_filename($id); return "$dir/$id"; diff --git a/mod/wiki/ewiki/plugins/moodle/moodle_wikidump.php b/mod/wiki/ewiki/plugins/moodle/moodle_wikidump.php new file mode 100644 index 0000000000..0885e2e76c --- /dev/null +++ b/mod/wiki/ewiki/plugins/moodle/moodle_wikidump.php @@ -0,0 +1,453 @@ + + + + '; + + +function moodle_ewiki_page_wiki_dump($id=0, $data=0, $action=0) { + global $userid, $groupid, $cm, $wikipage, $wiki, $course, $CFG; + #-- return legacy page + $cont = true; + if (!empty($_REQUEST["wikiexport"])) { + $binaries=$_REQUEST["exportbinaries"]; + if(!$wiki->ewikiacceptbinary) { + $binaries=0; + } + $exportformats=$_REQUEST["exportformats"]; + if($wiki->htmlmode==2) { + $exportformats=1; + } + $cont=ewiki_page_wiki_dump_send($binaries, + $exportformats, + $_REQUEST["withvirtualpages"], + $_REQUEST["exportdestinations"]); + } + if($cont===false) return; + + $url = ewiki_script("", "WikiExport"); + $ret = ewiki_make_title($id, $id, 2); + $ret .= ($cont&&$cont!==true)?$cont."

\n":""; + $ret .= get_string("wikiexportcomment","wiki"); + $ret .= "

\n". + '
'."\n". + ''."\n". + ''."\n". + ''."\n". + ''."\n". + "
\n"; + + // Export binaroes too ? + if(!$wiki->ewikiacceptbinary) { + $ret.=''.$exportdestinations[0]."\n"; + } else { + $ret.=''."\n"; + } + $ret.="\n"; + if($wiki->ewikiacceptbinary) { + $ret.=" \n". + ' \n". + " \n". + " \n"; + } + $ret.=" \n". + ' \n". + " \n". + " \n"; + $exportformats=array( "0" => get_string("plaintext","wiki") , "1" => get_string("html","wiki")); + /// Formats + $ret.=" \n". + ' \n". + " \n". + " \n"; + /// Destination + $exportdestinations=array("0" => get_string("downloadaszip","wiki")); + if(isteacher($course->id)) { + // Get Directory List + $rawdirs = get_directory_list("$CFG->dataroot/$course->id", 'moddata', true, true, false); + + foreach ($rawdirs as $rawdir) { + $exportdestinations[$rawdir] = get_string("moduledirectory","wiki").": ".$rawdir; + } + } + + $ret.=" \n". + ' \n". + " \n". + " \n". + "
'.get_string("withbinaries","wiki").":\n". + ' \n". + "
'.get_string("withvirtualpages","wiki").":\n". + ' \n". + "
'.get_string("exportformats","wiki").":\n"; + if($wiki->htmlmode!=2) { + $ret.= choose_from_menu($exportformats, "exportformats", $_REQUEST["exportformats"], "", "", "", true)."\n"; + } else { + $ret.= ''. + get_string("html","wiki"); + } + $ret.="
'.get_string("exportto","wiki").":\n"; + if(count($exportdestinations)==1) { + $ret.=''.$exportdestinations[0]."\n"; + } else { + $ret.=choose_from_menu($exportdestinations, "exportdestinations", $_REQUEST["exportdestinations"], "", "", "", true)."\n"; + } + $ret.="
\n". + ' '."\n". + "
\n"; + "
\n"; + return $ret; +} + +function ewiki_page_wiki_dump_send($exportbinaries=0, $exportformats=0, $withvirtualpages=0, $exportdestinations=0) { + global $ewiki_config, $wiki, $ewiki_plugins, $wiki_entry, $course, $CFG, $ewiki_t, $userid, $groupid; + + $filestozip=array(); + #-- disable protected email + foreach($ewiki_plugins["link_url"] as $key => $linkplugin){ + if($linkplugin == "ewiki_email_protect_link"){ + unset($ewiki_plugins["link_url"][$key]); + } + } + + /// HTML-Export + if($exportformats==1) { + #-- if exportformats is html + $HTML_TEMPLATE = ' + '.$ewiki_t["c"]["EWIKIDUMPCSS"].' + $title + + +
+

$title

+ $content +
+ + '; + + #-- reconfigure ewiki_format() to generate offline pages and files + $html_ext = ".html"; + $ewiki_config["script"] = "%s$html_ext"; + $ewiki_config["script_binary"] = "%s"; + } + + // Export Virtual pages special + $a_virtual = array_keys($ewiki_plugins["page"]); + + #-- get all pages / binary files + $a_validpages = ewiki_valid_pages(1, $withvirtualpages); + $a_pagelist = ewiki_sitemap_create($wiki_entry->pagename, $a_validpages, 100, 1); + + # Add linked binary files to pagelist + foreach($a_pagelist as $key => $value) { + if(is_array($a_validpages[$value]["refs"])){ + foreach($a_validpages[$value]["refs"] as $refs){ + if($a_validpages[$refs]["type"]=="image" || $a_validpages[$refs]["type"]=="file"){ + $a_pagelist[]=$refs; + } + } + } + } + + # Adjust links to binary files + foreach($a_pagelist as $key => $value){ + if($a_validpages[$value]["type"]=="image"){ + $a_images[]=urlencode($value); + $a_rimages[]=urlencode(preg_replace(EWIKI_DUMP_FILENAME_REGEX, "", $value)); + unset($a_validpages[$value]); + } + if($a_validpages[$value]["type"]=="file") { + $a_images[]=urlencode($value); + $a_rimages[]=clean_filename(substr($value,strlen(EWIKI_IDF_INTERNAL))); + $a_images[]=$value; + $a_rimages[]=clean_filename(substr($value,strlen(EWIKI_IDF_INTERNAL))); + unset($a_validpages[$value]); + } + } + + # Remove binaries from a_validpages and add to a_pagelist + foreach($a_validpages as $key => $value){ + if($a_validpages[$key]["type"]=="image" || $a_validpages[$key]["type"]=="file"){ + $a_pagelist[]=$key; + unset($a_validpages[$key]); + } + } + + #print "
"; print_r($a_validpages); print "
"; + #print "
"; print_r($a_pagelist); print "
"; + + $a_sitemap = ewiki_sitemap_create($wiki_entry->pagename, $a_validpages, 99, 0); + if ($a_pagelist) { + #-- create new zip file + #if($arctype == "ZIP"){ + # $archivename=EWIKI_WIKIDUMP_ARCNAME."$rootid.zip"; + # $archive = new ewiki_virtual_zip(); + #} elseif ($arctype == "TAR") { + # $archivename=EWIKI_WIKIDUMP_ARCNAME."$rootid.tar"; + # $archive = new ewiki_virtual_tarball(); + #} else { + # die(); + #} + + /// Create/Set Directory + $wname=clean_filename($wiki->name); + if($exportdestinations) { + if(isteacher($course->id)) { + $exportdir=$CFG->dataroot."/".$course->id."/".$exportdestinations; + } else { + die("Hack attack identified !!!"); + } + } else { + $exportbasedir=tempnam("/tmp","WIKIEXPORT"); + @unlink($exportbasedir); + @mkdir($exportbasedir); + /// maybe we need to check the name here...? + $exportdir=$exportbasedir."/".$wname; + @mkdir($exportdir); + if(!is_dir($exportdir)) { + error("Cannot create temporary directory $exportdir !"); + } + } + + $a_pagelist = array_unique($a_pagelist); + + + #-- convert all pages + foreach($a_pagelist as $pagename){ + + if ((!in_array($pagename, $a_virtual))) { + $id = $pagename; + #-- not a virtual page + $row = ewiki_database("GET", array("id"=>$pagename)); + $content = ""; + } elseif($withvirtualpages) { + $id = $pagename; + #-- is a virtual page + $pf = $ewiki_plugins["page"][$id]; + $content = $pf($id, $content, "view"); + if ($exportformats==1) { + $content = str_replace('$content', $content, str_replace('$title', $id, $HTML_TEMPLATE)); + } + $fn = urlencode($id); + $fn = preg_replace(EWIKI_DUMP_FILENAME_REGEX, "", $fn); + $fn = $fn.$html_ext; + } else { + continue; + } + + if (empty($content)){ + switch ($row["flags"] & EWIKI_DB_F_TYPE) { + case (EWIKI_DB_F_TEXT): + #print "
"; print_r($row[content]); print "\n-------------
"; + if($exportformats==1) {/// HTML-Export + $content = ewiki_format($row["content"]); + } else { + $content = $row["content"]; + } + + # Binary files link adjustment when html + if($exportformats==1) { + $content = str_replace($a_images, $a_rimages, $content); + } + $fn = preg_replace(EWIKI_DUMP_FILENAME_REGEX, "", urlencode($id)); + $fn = $fn.$html_ext; + if($exportformats==1) {/// HTML-Export + $content = str_replace('$content', $content, str_replace('$title', $id, $HTML_TEMPLATE)); + } + break; + case (EWIKI_DB_F_BINARY): + #print "Binary: $row[id]
"; + if (($row["meta"]["class"]=="image" || $row["meta"]["class"]=="file") && ($exportbinaries)) { + # Copy files to the appropriate directory + $fn= moodle_binary_get_path($id, $row["meta"], $course, $wiki, $userid, $groupid); + $destfn=clean_filename(substr($id,strlen(EWIKI_IDF_INTERNAL))); + $dest="$exportdir/".$destfn; + if(!copy($fn,$dest)) { + error("Cannot copy $fn to $dest."); + } + + #$fn = urlencode(preg_replace(EWIKI_DUMP_FILENAME_REGEX, "", $id)); + #$content = &$row["content"]; + $filestozip[]=$exportdir."/".$destfn; + continue (2); + } + else { + #-- php considers switch statements as loops so continue 2 is needed to + #-- hit the end of the for loop + continue(2); + } + break; + + default: + # don't want it + continue(2); + } + } + + # Do not translate links when wiki already in pure html - mode + if($wiki->htmlmode!=2) { + $content=preg_replace_callback( + '/()/', + create_function( + // single quotes are essential here, + // or alternative escape all $ as \$ + '$matches', + 'return($matches[1].preg_replace(EWIKI_DUMP_FILENAME_REGEX,"",$matches[2]).$matches[3]);' + ), + $content + ); + } + #-- add file + // Let's make sure the file exists and is writable first. + if (!$handle = fopen($exportdir."/".$fn, 'w')) { + error("Cannot open file ($exportdir/$fn)"); + } + + // Write $content to our opened file. + if (fwrite($handle, $content) === FALSE) { + error("Cannot write to file ($exportdir/$fn)"); + } + + fclose($handle); + $filestozip[]=$exportdir."/".$fn; + #$archive->add($content, $fn, array( + # "mtime" => $row["lastmodified"], + # "uname" => "ewiki", + # "mode" => 0664 | (($row["flags"]&EWIKI_DB_F_WRITEABLE)?0002:0000), + # ), $complevel); + } + + #-- create index page + /// HTML-Export + if($exportformats==1) { + $timer=array(); + $level=-1; + $fordump=1; + $str_formatted="".str_pad("", $fin_level*6, "\n"); + $str_formatted=preg_replace_callback( + '/()/', + create_function( + // single quotes are essential here, + // or alternative escape all $ as \$ + '$matches', + 'return($matches[1].preg_replace(EWIKI_DUMP_FILENAME_REGEX,"",$matches[2]).$matches[3]);' + ), + $str_formatted + ); + $str_formatted = str_replace('$content', $str_formatted, str_replace('$title', get_string("index","wiki"), $HTML_TEMPLATE)); + #-- add file + // Let's make sure the file exists and is writable first. + $indexname="index".$html_ext; + if (!$handle = fopen($exportdir."/".$indexname, 'w')) { + error("Cannot open file ($exportdir/$indexname)"); + } + + // Write $somecontent to our opened file. + if (fwrite($handle, $str_formatted) === FALSE) { + error("Cannot write to file ($exportdir/$indexname)"); + } + + fclose($handle); + $filestozip[]=$exportdir."/".$indexname; + + #-- add index page +# $archive->add($str_formatted, "Index_$rootid".$html_ext, array( +# "mtime" => $row["lastmodified"], +# "uname" => "ewiki", +# "mode" => 0664 | (($row["flags"]&EWIKI_DB_F_WRITEABLE)?0002:0000), +# ), $complevel); + } + + if(!$exportdestinations) { + $archivename=$wname.".zip"; + if (empty($CFG->zip)) { // Use built-in php-based zip function + include_once("$CFG->libdir/pclzip/pclzip.lib.php"); + $archive = new PclZip("$exportbasedir/$archivename"); + if (($list = $archive->create($filestozip,'',"$exportbasedir/")) == 0) { + error($archive->errorInfo(true)); + } + } else { // Use external zip program + $files = ""; + foreach ($filestozip as $file) { + $files .= $wname."/".basename($file); + $files .= " "; + } + $command = "cd $exportbasedir ; $CFG->zip -r $archivename $files"; + Exec($command); + } + + #-- Headers + Header("Content-type: application/zip"); + Header("Content-disposition: attachment; filename=$archivename"); + Header("Cache-control: private"); + Header("Original-Filename: $archivename"); + + if(!@readfile("$exportbasedir/$archivename")) { + error("Cannot read $exportbasedir/$archivename"); + } + if(!deldir($exportbasedir)) { + error("Cannot delete $exportbasedir"); + } + return false; + } else { + return get_string("exportsuccessful","wiki")."
"; + } + } +} + +function deldir($dir) +{ + $handle = opendir($dir); + while (false!==($FolderOrFile = readdir($handle))) + { + if($FolderOrFile != "." && $FolderOrFile != "..") + { + if(is_dir("$dir/$FolderOrFile")) + { deldir("$dir/$FolderOrFile"); } // recursive + else + { unlink("$dir/$FolderOrFile"); } + } + } + closedir($handle); + if(rmdir($dir)) + { $success = true; } + return $success; +} +?> \ No newline at end of file diff --git a/mod/wiki/ewiki/plugins/moodle/sitemap.php b/mod/wiki/ewiki/plugins/moodle/sitemap.php index 8dc0df019d..730d88e073 100644 --- a/mod/wiki/ewiki/plugins/moodle/sitemap.php +++ b/mod/wiki/ewiki/plugins/moodle/sitemap.php @@ -100,15 +100,18 @@ function ewiki_valid_pages($bool_allowimages=0, $virtual_pages=0){ if (EWIKI_PROTECTED_MODE && EWIKI_PROTECTED_MODE_HIDING && !ewiki_auth($row["id"], $str_null, "view")) { continue; } - if (($row["flags"] & EWIKI_DB_F_TYPE) == EWIKI_DB_F_TEXT || ($bool_allowimages ? $row["meta"]["class"]=="image" : 0)) { + + $isbinary= ($row["meta"]["class"]=="image"||$row["meta"]["class"]=="file")?true:false; + + if (($row["flags"] & EWIKI_DB_F_TYPE) == EWIKI_DB_F_TEXT || ($bool_allowimages ? $isbinary : 0)) { $temp_refs=explode("\n",$row["refs"]); foreach($temp_refs as $key => $value) { if(empty($value)) { unset($temp_refs[$key]); } } - if($row["meta"]["class"]=="image"){ - $a_validpages[$row["id"]]=$temp_array=array("refs" => $temp_refs, "type" => "image", "touched" => FALSE); + if($isbinary){ + $a_validpages[$row["id"]]=$temp_array=array("refs" => $temp_refs, "type" => $row["meta"]["class"], "touched" => FALSE); } else { $a_validpages[$row["id"]]=$temp_array=array("refs" => $temp_refs, "type" => "page", "touched" => FALSE); } @@ -209,7 +212,7 @@ function ewiki_sitemap_create($str_rootid, $a_validpages, $i_maxdepth, $i_flatma //list all of the children of the root ewiki_page_listallchildren($str_rootid, $a_children, $a_sitemap, $a_validpages, $i_depth, $i_maxdepth, $i_flatmap); $i_depth++; - + if($a_children){ end($a_children); $str_nextlevel=key($a_children); @@ -236,4 +239,4 @@ function ewiki_sitemap_create($str_rootid, $a_validpages, $i_maxdepth, $i_flatma return $a_sitemap; } -?> +?> \ No newline at end of file diff --git a/mod/wiki/ewikimoodlelib.php b/mod/wiki/ewikimoodlelib.php index 3f7a57adcc..4d5e54dff9 100644 --- a/mod/wiki/ewikimoodlelib.php +++ b/mod/wiki/ewikimoodlelib.php @@ -201,6 +201,9 @@ function ewiki_database_moodle($action, &$args, $sw1, $sw2) { # } #} #print "
"; print_r($result); print "
"; + if(!$result) { + $result=array(); + } while(list($key, $val) = each($result)) { $row=get_object_vars($val); $i = EWIKI_CASE_INSENSITIVE ? strtolower($row["id"]) : $row["id"]; diff --git a/mod/wiki/lib.php b/mod/wiki/lib.php index ac0f68b1a9..2950b21b12 100644 --- a/mod/wiki/lib.php +++ b/mod/wiki/lib.php @@ -868,7 +868,7 @@ function wiki_get_owner(&$wiki_entry) { $owner = $course->shortname; } else { - $owner = '- unknown -'; + $owner = '- '.get_string("ownerunknown","wiki").' -'; } return $owner; } @@ -907,6 +907,7 @@ function wiki_print_wikilinks_block($cmid, $binary=false, $return=false) { $links["UpdatedPages"]=get_string("updatedpages", "wiki"); $links["OrphanedPages"]=get_string("orphanedpages", "wiki"); $links["WantedPages"]=get_string("wantedpages", "wiki"); + $links["WikiExport"]=get_string("wikiexport", "wiki"); if($binary) { $links["FileDownload"]=get_string("filedownload", "wiki"); } @@ -938,7 +939,7 @@ function wiki_print_page_actions($cmid, $specialpages, $wikipage, $action, $bina popup_form(EWIKI_SCRIPT, $page, "wikiactions", "", get_string("action", "wiki"), "", "", false); } -function wiki_print_administration_actions($cmid, $userid, $groupid, $wikipage, $noeditor) { +function wiki_print_administration_actions($wiki, $cmid, $userid, $groupid, $wikipage, $noeditor, $course) { /// Displays actions which can be performed on the page global $ME; @@ -952,12 +953,14 @@ function wiki_print_administration_actions($cmid, $userid, $groupid, $wikipage, $action=array( - "removepages" => get_string("removepages", "wiki"), - "strippages" => get_string("strippages", "wiki"), "setpageflags" => get_string("setpageflags", "wiki"), - "revertpages" => get_string("revertpages", "wiki"), ); // We cannot do certain things if html is used ! + if($wiki->wtype=="student" || isteacher($course->id)) { + $action["removepages"] = get_string("removepages", "wiki"); + $action["strippages"] = get_string("strippages", "wiki"); + $action["revertpages"] = get_string("revertpages", "wiki"); + } if($noeditor) { $action["checklinks"]=get_string("checklinks", "wiki"); } @@ -1258,7 +1261,7 @@ function wiki_admin_checklinks($pagetocheck) { $get = ewiki_database("GET", array("id" => $pagetocheck)); $content = $get["content"]; - preg_match_all('_(http://[^\s"\'<>#,;]+[^\s"\'<>#,;.])_', $content, $links); + preg_match_all('_(http.?://[^\s"\'<>#,;]+[^\s"\'<>#,;.])_', $content, $links); $badlinks = array(); if(!$links[1]) { $ret = get_string("nolinksfound","wiki")."

"; diff --git a/mod/wiki/view.php b/mod/wiki/view.php index ab465748c4..84d93b8e54 100644 --- a/mod/wiki/view.php +++ b/mod/wiki/view.php @@ -134,6 +134,7 @@ include_once($CFG->dirroot."/mod/wiki/ewiki/plugins/moodle/moodle_highlight.php"); include_once($CFG->dirroot."/mod/wiki/ewiki/plugins/moodle/f_fixhtml.php"); include_once($CFG->dirroot."/mod/wiki/ewiki/plugins/moodle/sitemap.php"); + include_once($CFG->dirroot."/mod/wiki/ewiki/plugins/moodle/moodle_wikidump.php"); include_once($CFG->dirroot."/mod/wiki/ewiki/plugins/aview/backlinks.php"); #include_once($CFG->dirroot."/mod/wiki/ewiki/plugins/markup/css.php"); include_once($CFG->dirroot."/mod/wiki/ewiki/plugins/markup/footnotes.php"); @@ -260,7 +261,7 @@ } if ($wiki_entry) { - $specialpages=array("SiteMap", "SearchPages", "PageIndex","NewestPages","MostVisitedPages","MostOftenChangedPages","UpdatedPages","FileDownload","FileUpload","OrphanedPages","WantedPages"); + $specialpages=array("WikiExport", "SiteMap", "SearchPages", "PageIndex","NewestPages","MostVisitedPages","MostOftenChangedPages","UpdatedPages","FileDownload","FileUpload","OrphanedPages","WantedPages"); /// Page Actions echo ''; echo ''; @@ -304,7 +305,7 @@ /// Administrative Links if($canedit) { echo ''; } -- 2.39.5
'; - wiki_print_administration_actions($cm->id, $userid, $groupid, $ewiki_title, $wiki->htmlmode!=2); + wiki_print_administration_actions($wiki, $cm->id, $userid, $groupid, $ewiki_title, $wiki->htmlmode!=2, $course); echo '