mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
removed unnecessary calls to get_site()
This commit is contained in:
parent
afd97e8449
commit
222ac91bc9
26 changed files with 219 additions and 415 deletions
|
@ -38,10 +38,6 @@
|
|||
|
||||
global $CFG;
|
||||
|
||||
if (! $site = get_site()) {
|
||||
error("Invalid site!");
|
||||
}
|
||||
|
||||
?>
|
||||
<html>
|
||||
<head>
|
||||
|
|
|
@ -37,11 +37,7 @@
|
|||
|
||||
global $CFG;
|
||||
|
||||
if (! $site = get_site()) {
|
||||
error("Invalid site!");
|
||||
}
|
||||
|
||||
if ($course->id == $site->id) {
|
||||
if ($course->id == SITEID) {
|
||||
$strfiles = get_string("sitefiles");
|
||||
} else {
|
||||
$strfiles = get_string("files");
|
||||
|
@ -64,21 +60,21 @@
|
|||
|
||||
print_header();
|
||||
?>
|
||||
<script language="javscript" type="text/javascript">
|
||||
<!--
|
||||
function set_value(url) {
|
||||
var str_url = url;
|
||||
//if(document.all) {
|
||||
// window.returnValue = str_url;
|
||||
// window.close();
|
||||
//}
|
||||
//else {
|
||||
window.opener.document.forms[0].url.value = str_url;
|
||||
window.close();
|
||||
//}
|
||||
}
|
||||
<script language="javscript" type="text/javascript">
|
||||
<!--
|
||||
function set_value(url) {
|
||||
var str_url = url;
|
||||
//if(document.all) {
|
||||
// window.returnValue = str_url;
|
||||
// window.close();
|
||||
//}
|
||||
//else {
|
||||
window.opener.document.forms[0].url.value = str_url;
|
||||
window.close();
|
||||
//}
|
||||
}
|
||||
-->
|
||||
</script>
|
||||
</script>
|
||||
<?php
|
||||
|
||||
echo '<table border="0" cellpadding="3" cellspacing="0" width="100%">';
|
||||
|
@ -89,7 +85,7 @@
|
|||
echo '</tr>';
|
||||
echo '</table>';
|
||||
|
||||
if ($course->id == $site->id) {
|
||||
if ($course->id == SITEID) {
|
||||
print_heading(get_string("publicsitefileswarning"), "center", 2);
|
||||
}
|
||||
|
||||
|
@ -544,33 +540,33 @@
|
|||
break;
|
||||
|
||||
case "torte":
|
||||
if($_POST)
|
||||
{
|
||||
while(list($key, $val) = each($_POST))
|
||||
{
|
||||
if(ereg("file([0-9]+)", $key, $regs))
|
||||
{
|
||||
$file = $val;
|
||||
}
|
||||
}
|
||||
if(@filetype($CFG->dataroot ."/". $course->id . $file) == "file")
|
||||
{
|
||||
if(mimeinfo("icon", $file) == "image.gif")
|
||||
{
|
||||
$url = $CFG->wwwroot ."/file.php?file=/" .$course->id . $file;
|
||||
runjavascript($url);
|
||||
}
|
||||
else
|
||||
{
|
||||
print "File is not a image!";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print "You cannot insert FOLDER into richtext editor!!!";
|
||||
}
|
||||
}
|
||||
break;
|
||||
if($_POST)
|
||||
{
|
||||
while(list($key, $val) = each($_POST))
|
||||
{
|
||||
if(ereg("file([0-9]+)", $key, $regs))
|
||||
{
|
||||
$file = $val;
|
||||
}
|
||||
}
|
||||
if(@filetype($CFG->dataroot ."/". $course->id . $file) == "file")
|
||||
{
|
||||
if(mimeinfo("icon", $file) == "image.gif")
|
||||
{
|
||||
$url = $CFG->wwwroot ."/file.php?file=/" .$course->id . $file;
|
||||
runjavascript($url);
|
||||
}
|
||||
else
|
||||
{
|
||||
print "File is not a image!";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print "You cannot insert FOLDER into richtext editor!!!";
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "cancel";
|
||||
clearfilelist();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue