Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
moodle
moodle
Commits
2eb68e6f
Commit
2eb68e6f
authored
Jul 29, 2004
by
moodler
Browse files
Various cleanups of the installation process
parent
a6b87f82
Changes
8
Hide whitespace changes
Inline
Side-by-side
admin/index.php
View file @
2eb68e6f
...
...
@@ -193,6 +193,25 @@
}
/// Insert default values for any important configuration variables
include_once
(
"
$CFG->dirroot
/lib/defaults.php"
);
foreach
(
$defaults
as
$name
=>
$value
)
{
if
(
!
isset
(
$CFG
->
$name
))
{
$CFG
->
$name
=
$value
;
set_config
(
$name
,
$value
);
$configchange
=
true
;
}
}
/// If any new configurations were found then send to the config page to check
if
(
!
empty
(
$configchange
))
{
redirect
(
"config.php"
);
}
/// Upgrade backup/restore system if necessary
require_once
(
"
$CFG->dirroot
/backup/lib.php"
);
upgrade_backup_db
(
"
$CFG->wwwroot
/
$CFG->admin
/index.php"
);
// Return here afterwards
...
...
@@ -312,25 +331,6 @@
}
/// Insert default values for any important configuration variables
include_once
(
"
$CFG->dirroot
/lib/defaults.php"
);
foreach
(
$defaults
as
$name
=>
$value
)
{
if
(
!
isset
(
$CFG
->
$name
))
{
$CFG
->
$name
=
$value
;
set_config
(
$name
,
$value
);
$configchange
=
true
;
}
}
/// If any new configurations were found then send to the config page to check
if
(
!
empty
(
$configchange
))
{
redirect
(
"config.php"
);
}
/// Set up the overall site name etc.
if
(
!
$site
=
get_site
())
{
redirect
(
"site.php"
);
...
...
admin/site.php
View file @
2eb68e6f
...
...
@@ -65,6 +65,7 @@
$form
->
shortname
=
""
;
$form
->
summary
=
""
;
$form
->
newsitems
=
3
;
$form
->
numsections
=
0
;
$form
->
id
=
""
;
$form
->
category
=
0
;
$form
->
format
=
"social"
;
...
...
blocks/course_list/block_course_list.php
View file @
2eb68e6f
...
...
@@ -2,7 +2,7 @@
class
CourseBlock_course_list
extends
MoodleBlock
{
function
CourseBlock_course_list
(
$course
)
{
$this
->
title
=
get_string
(
'
my
courses'
);
$this
->
title
=
get_string
(
'courses'
);
$this
->
content_type
=
BLOCK_TYPE_LIST
;
$this
->
course
=
$course
;
$this
->
version
=
2005052600
;
...
...
blocks/site_main_menu/block_site_main_menu.php
View file @
2eb68e6f
...
...
@@ -15,10 +15,14 @@ class CourseBlock_site_main_menu extends MoodleBlock {
function
get_content
()
{
global
$USER
,
$CFG
;
if
(
$this
->
content
!==
NULL
)
{
if
(
$this
->
content
!==
NULL
)
{
return
$this
->
content
;
}
if
(
empty
(
$this
->
course
))
{
return
''
;
}
$this
->
content
=
New
stdClass
;
$this
->
content
->
items
=
array
();
$this
->
content
->
icons
=
array
();
...
...
blocks/social_activities/block_social_activities.php
View file @
2eb68e6f
...
...
@@ -15,9 +15,12 @@ class CourseBlock_social_activities extends MoodleBlock {
function
get_content
()
{
global
$USER
,
$CFG
;
if
(
$this
->
content
!==
NULL
)
{
if
(
$this
->
content
!==
NULL
)
{
return
$this
->
content
;
}
if
(
empty
(
$this
->
course
))
{
return
''
;
}
$this
->
content
=
New
object
;
$this
->
content
->
items
=
array
();
...
...
calendar/lib.php
View file @
2eb68e6f
...
...
@@ -628,7 +628,11 @@ function calendar_filter_controls($type, $vars = NULL, $course = NULL) {
$getvars
=
'&from='
.
$type
;
break
;
case
'course'
:
$getvars
=
'&from=course&id='
.
$_GET
[
'id'
];
if
(
isset
(
$_GET
[
'id'
]))
{
$getvars
=
'&from=course&id='
.
$_GET
[
'id'
];
}
else
{
$getvars
=
'&from=course'
;
}
if
(
isset
(
$course
->
groupmode
)
and
!
$course
->
groupmode
and
$course
->
groupmodeforce
)
{
$groupevents
=
false
;
}
...
...
course/lib.php
View file @
2eb68e6f
...
...
@@ -438,6 +438,7 @@ function print_log($course, $user=0, $date=0, $order="l.time ASC", $page=0, $per
if
(
$course
->
category
)
{
$joins
[]
=
"l.course='
$course->id
'"
;
}
else
{
$courses
[
0
]
=
''
;
if
(
$ccc
=
get_courses
(
"all"
,
"c.id ASC"
,
"c.id,c.shortname"
))
{
foreach
(
$ccc
as
$cc
)
{
$courses
[
$cc
->
id
]
=
"
$cc->shortname
"
;
...
...
@@ -500,6 +501,7 @@ function print_log($course, $user=0, $date=0, $order="l.time ASC", $page=0, $per
}
$count
=
0
;
$ldcache
=
array
();
$tt
=
getdate
(
time
());
$today
=
mktime
(
0
,
0
,
0
,
$tt
[
"mon"
],
$tt
[
"mday"
],
$tt
[
"year"
]);
...
...
@@ -512,31 +514,37 @@ function print_log($course, $user=0, $date=0, $order="l.time ASC", $page=0, $per
print_paging_bar
(
$totalcount
,
$page
,
$perpage
,
"
$url
&perpage=
$perpage
&"
);
echo
"
<table border=0 align=center cellpadding=3 cellspacing=3>
"
;
echo
'
<table border=0 align=center cellpadding=3 cellspacing=3>
'
;
foreach
(
$logs
as
$log
)
{
if
(
$ld
=
get_record
(
"log_display"
,
"module"
,
"
$log->module
"
,
"action"
,
"
$log->action
"
))
{
$log
->
info
=
get_field
(
$ld
->
mtable
,
$ld
->
field
,
"id"
,
$log
->
info
);
if
(
isset
(
$ldcache
[
$log
->
module
][
$log
->
action
]))
{
$ld
=
$ldcache
[
$log
->
module
][
$log
->
action
];
}
else
{
$ld
=
get_record
(
'log_display'
,
'module'
,
$log
->
module
,
"action"
,
$log
->
action
);
$ldcache
[
$log
->
module
][
$log
->
action
]
=
$ld
;
}
if
(
$ld
)
{
$log
->
info
=
get_field
(
$ld
->
mtable
,
$ld
->
field
,
'id'
,
$log
->
info
);
}
echo
"
<tr nowrap
>"
;
echo
'
<tr nowrap
="nowrap">'
;
if
(
!
$course
->
category
)
{
echo
"
<td nowrap><font size=2><a href=
\
"
view.php?id=
$log->course
\
"
>
"
.
$courses
[
$log
->
course
]
.
"
</a></td>
"
;
echo
'
<td nowrap
="nowrap"
><font size=2><a href="view.php?id=
'
.
$log
->
course
.
'
">
'
.
$courses
[
$log
->
course
]
.
'
</a></td>
'
;
}
echo
"
<td nowrap align=right><font size=2>
"
.
userdate
(
$log
->
time
,
"
%a
"
)
.
"
</td>
"
;
echo
"
<td nowrap><font size=2>
"
.
userdate
(
$log
->
time
,
$strftimedatetime
)
.
"
</td>
"
;
echo
"
<td nowrap><font size=2>
"
;
link_to_popup_window
(
"/lib/ipatlas/plot.php?address=
$log->ip
&user=
$log->userid
"
,
"
ipatlas
"
,
"
$log->ip
"
,
400
,
700
);
echo
"
</td>
"
;
echo
'
<td nowrap align=right><font size=2>
'
.
userdate
(
$log
->
time
,
'
%a
'
)
.
'
</td>
'
;
echo
'
<td nowrap><font size=2>
'
.
userdate
(
$log
->
time
,
$strftimedatetime
)
.
'
</td>
'
;
echo
'
<td nowrap><font size=2>
'
;
link_to_popup_window
(
"/lib/ipatlas/plot.php?address=
$log->ip
&user=
$log->userid
"
,
'
ipatlas
'
,
$log
->
ip
,
400
,
700
);
echo
'
</td>
'
;
$fullname
=
fullname
(
$log
,
$isteacher
);
echo
"
<td nowrap><font size=2><a href=
\
"
../user/view.php?id=
$log->userid
&course=
$log->course
\
"
><b>
$fullname
</b></td>
"
;
echo
"
<td nowrap><font size=2>
"
;
link_to_popup_window
(
make_log_url
(
$log
->
module
,
$log
->
url
),
"
fromloglive
"
,
"
$log->module
$log->action
"
,
400
,
600
);
echo
"
</td>
"
;
echo
"
<td nowrap><font size=2>
$log->info
</td>
"
;
echo
"
</tr>
"
;
}
echo
"
</table>
"
;
echo
'
<td nowrap><font size=2><a href="../user/view.php?id=
'
.
"
$log->userid
&course=
$log->course
"
.
'
"><b>
'
.
$fullname
.
'
</b></td>
'
;
echo
'
<td nowrap><font size=2>
'
;
link_to_popup_window
(
make_log_url
(
$log
->
module
,
$log
->
url
),
'
fromloglive
'
,
"
$log->module
$log->action
"
,
400
,
600
);
echo
'
</td>
'
;
echo
'
<td nowrap><font size=2>
'
.
$log
->
info
.
'
</td>
'
;
echo
'
</tr>
'
;
}
echo
'
</table>
'
;
print_paging_bar
(
$totalcount
,
$page
,
$perpage
,
"
$url
&perpage=
$perpage
&"
);
}
...
...
lib/defaults.php
View file @
2eb68e6f
...
...
@@ -12,6 +12,7 @@
"country"
=>
""
,
"debug"
=>
7
,
"deleteunconfirmed"
=>
168
,
"digestmailtime"
=>
17
,
"displayloginfailures"
=>
''
,
"enablerssfeeds"
=>
0
,
"enrol"
=>
'internal'
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment