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
50c53e20
Commit
50c53e20
authored
Mar 25, 2008
by
Dan Poltawski
Browse files
CONTRIB-350 - Update book module to use new navigation structure & admin
settings in 1.9
parent
ee7758e5
Changes
8
Hide whitespace changes
Inline
Side-by-side
config.html
deleted
100644 → 0
View file @
ee7758e5
<!-- $Id: config.html,v 1.1 2006/03/12 18:39:59 skodak Exp $ //-->
<form
method=
"post"
action=
"module.php"
name=
"form"
>
<input
type=
"hidden"
name=
"sesskey"
value=
"<?php echo $USER->sesskey ?>"
/>
<table
cellpadding=
"9"
cellspacing=
"0"
>
<tr
valign=
"top"
>
<td
align=
"right"
>
<p>
book_tocwidth:
</p>
</td>
<td>
<?php
$choices = array('140'=>'140', '160'=>'160', '180'=>'180', '200'=>'200',
'220'=>'220', '240'=>'240', '260'=>'260', '280'=>'280', '300'=>'300');
choose_from_menu ($choices, 'book_tocwidth', $CFG->book_tocwidth, '');
?>
</td>
<td>
<?php print_string('tocwidth', 'book') ?>
</td>
</tr>
<tr>
<td
colspan=
"3"
align=
"center"
>
<input
type=
"submit"
value=
"<?php print_string('savechanges') ?>"
/>
</td>
</tr>
</table>
</form>
delete.php
View file @
50c53e20
<?PHP
// $Id: delete.php,v 1.
2
200
6/11/21 19:26:36 skodak
Exp $
<?PHP
// $Id: delete.php,v 1.
3
200
8/03/25 20:19:49 poltawski
Exp $
require
(
'teacheraccess.php'
);
//page only for teachers
$confirm
=
optional_param
(
'confirm'
,
0
,
PARAM_BOOL
);
...
...
@@ -8,21 +8,9 @@ $confirm = optional_param('confirm', 0, PARAM_BOOL);
$strbooks
=
get_string
(
'modulenameplural'
,
'book'
);
$strbook
=
get_string
(
'modulename'
,
'book'
);
if
(
$course
->
category
)
{
$navigation
=
'<a href="../../course/view.php?id='
.
$course
->
id
.
'">'
.
$course
->
shortname
.
'</a> ->'
;
}
else
{
$navigation
=
''
;
}
$navigation
=
build_navigation
(
''
,
$cm
);
print_header
(
"
$course->shortname
:
$book->name
"
,
$course
->
fullname
,
"
$navigation
<a href=index.php?id=
$course->id
>
$strbooks
</a> ->
$book->name
"
,
''
,
''
,
true
,
''
,
''
);
print_header
(
"
$course->shortname
:
$book->name
"
,
$course
->
fullname
,
$navigation
);
///form processing
if
(
$confirm
)
{
// the operation was confirmed.
...
...
edit.php
View file @
50c53e20
<?PHP
// $Id: edit.php,v 1.
2
200
7
/0
5
/2
0 06:00:26 skodak
Exp $
<?PHP
// $Id: edit.php,v 1.
3
200
8
/0
3
/2
5 20:19:49 poltawski
Exp $
require_once
(
'../../config.php'
);
require_once
(
'lib.php'
);
...
...
@@ -123,22 +123,9 @@ if (!$chapter) {
}
///prepare the page header
if
(
$course
->
category
)
{
$navigation
=
'<a href="../../course/view.php?id='
.
$course
->
id
.
'">'
.
$course
->
shortname
.
'</a> ->'
;
}
else
{
$navigation
=
''
;
}
print_header
(
"
$course->shortname
:
$book->name
"
,
$course
->
fullname
,
"
$navigation
<a href=
\"
index.php?id=
$course->id
\"
>
$strbooks
</A> -> <a href=
\"
view.php?id=
$cm->id
\"
>
$book->name
</A> ->
$stredit
"
,
''
,
''
,
true
,
''
,
''
);
$navigation
=
build_navigation
(
''
,
$cm
);
print_header
(
"
$course->shortname
:
$book->name
"
,
$course
->
fullname
,
$navigation
);
$icon
=
'<img align="absmiddle" height="16" width="16" src="icon_chapter.gif" /> '
;
print_heading_with_help
(
$pageheading
,
'edit'
,
'book'
,
$icon
);
...
...
import.php
View file @
50c53e20
<?PHP
// $Id: import.php,v 1.
3
200
7
/0
5
/2
0 06:00:29 skodak
Exp $
<?PHP
// $Id: import.php,v 1.
4
200
8
/0
3
/2
5 20:19:49 poltawski
Exp $
require_once
(
'../../config.php'
);
require_once
(
'lib.php'
);
...
...
@@ -45,21 +45,12 @@ $strbook = get_string('modulename', 'book');
$strbooks
=
get_string
(
'modulenameplural'
,
'book'
);
$strimport
=
get_string
(
'import'
,
'book'
);
if
(
$course
->
category
)
{
$navigation
=
'<a href="../../course/view.php?id='
.
$course
->
id
.
'">'
.
$course
->
shortname
.
'</a> ->'
;
}
else
{
$navigation
=
''
;
}
$navlinks
=
array
();
$navlinks
[]
=
array
(
'name'
=>
$strimport
,
'link'
=>
''
,
'type'
=>
'title'
);
$navigation
=
build_navigation
(
$navlinks
,
$cm
);
print_header
(
"
$course->shortname
:
$book->name
"
,
$course
->
fullname
,
"
$navigation
<a href=
\"
index.php?id=
$course->id
\"
>
$strbooks
</a> -> <a href=
\"
view.php?id=
$cm->id
\"
>
$book->name
</a> ->
$strimport
"
,
''
,
''
,
true
,
''
,
''
);
print_header
(
"
$course->shortname
:
$book->name
"
,
$course
->
fullname
,
$navigation
);
/// If data submitted, then process, store and relink.
if
((
$form
=
data_submitted
())
&&
(
confirm_sesskey
()))
{
...
...
index.php
View file @
50c53e20
<?PHP
// $Id: index.php,v 1.
2
200
7
/0
5
/2
0 06:00:29 skodak
Exp $
<?PHP
// $Id: index.php,v 1.
3
200
8
/0
3
/2
5 20:19:49 poltawski
Exp $
/// This page lists all the instances of book in a particular course
...
...
@@ -28,22 +28,12 @@ unset($id);
$strbooks
=
get_string
(
'modulenameplural'
,
'book'
);
$strbook
=
get_string
(
'modulename'
,
'book'
);
/// Print the header
if
(
$course
->
category
)
{
$navigation
=
'<a href="../../course/view.php?id='
.
$course
->
id
.
'">'
.
$course
->
shortname
.
'</a> ->'
;
}
else
{
$navigation
=
''
;
}
print_header
(
"
$course->shortname
:
$strbooks
"
,
$course
->
fullname
,
"
$navigation
$strbooks
"
,
''
,
''
,
true
,
''
,
navmenu
(
$course
)
);
$navlinks
=
array
();
$navlinks
[]
=
array
(
'name'
=>
$strbooks
,
'link'
=>
''
,
'type'
=>
'activity'
);
$navigation
=
build_navigation
(
$navlinks
);
print_header_simple
(
$strbooks
,
''
,
$navigation
,
''
,
''
,
true
,
''
,
navmenu
(
$course
));
add_to_log
(
$course
->
id
,
'book'
,
'view all'
,
'index.php?id='
.
$course
->
id
,
''
);
...
...
lang/en_utf8/book.php
View file @
50c53e20
<?PHP
// $Id: book.php,v 1.
2
200
7
/0
5
/2
0 06:00:30 skodak
Exp $
<?PHP
// $Id: book.php,v 1.
3
200
8
/0
3
/2
5 20:19:49 poltawski
Exp $
$string
[
'modulename'
]
=
'Book'
;
$string
[
'modulenameplural'
]
=
'Books'
;
$string
[
'toc'
]
=
'Table of Contents'
;
$string
[
'tocwidth'
]
=
'Select width of the Table of Contents for all books.'
;
$string
[
'book_tocwidth'
]
=
'Table of Contents width'
;
$string
[
'faq'
]
=
'Book FAQ'
;
$string
[
'disableprinting'
]
=
'Disable Printing'
;
...
...
settings.php
0 → 100644
View file @
50c53e20
<?php
//$Id: settings.php,v 1.2 2008/03/25 20:19:49 poltawski Exp $
$choices
=
array
(
'140'
=>
'140'
,
'160'
=>
'160'
,
'180'
=>
'180'
,
'200'
=>
'200'
,
'220'
=>
'220'
,
'240'
=>
'240'
,
'260'
=>
'260'
,
'280'
=>
'280'
,
'300'
=>
'300'
);
$settings
->
add
(
new
admin_setting_configselect
(
'book_tocwidth'
,
get_string
(
'book_tocwidth'
,
'book'
),
get_string
(
'tocwidth'
,
'book'
),
'180'
,
$choices
));
?>
view.php
View file @
50c53e20
<?PHP
// $Id: view.php,v 1.
4
200
7
/0
6/17 10:41:25 stronk7
Exp $
<?PHP
// $Id: view.php,v 1.
5
200
8
/0
3/25 20:19:49 poltawski
Exp $
require_once
(
'../../config.php'
);
require_once
(
'lib.php'
);
...
...
@@ -98,11 +98,7 @@ $strbook = get_string('modulename', 'book');
$strTOC
=
get_string
(
'TOC'
,
'book'
);
/// prepare header
if
(
$course
->
category
)
{
$navigation
=
'<a href="../../course/view.php?id='
.
$course
->
id
.
'">'
.
$course
->
shortname
.
'</a> ->'
;
}
else
{
$navigation
=
''
;
}
$navigation
=
build_navigation
(
''
,
$cm
);
$buttons
=
$allowedit
?
'<table cellspacing="0" cellpadding="0"><tr><td>'
.
update_module_button
(
$cm
->
id
,
$course
->
id
,
$strbook
)
.
'</td>'
.
'<td> </td><td>'
.
book_edit_button
(
$cm
->
id
,
$course
->
id
,
$chapter
->
id
)
.
'</td></tr></table>'
...
...
@@ -110,7 +106,7 @@ $buttons = $allowedit ? '<table cellspacing="0" cellpadding="0"><tr><td>'.update
print_header
(
"
$course->shortname
:
$book->name
(
$chapter->title
)"
,
$course
->
fullname
,
"
$navigation
<a href=
\"
index.php?id=
$course->id
\"
>
$strbooks
</a> ->
$book->name
"
,
$navigation
,
''
,
'<style type="text/css">@import url('
.
$CFG
->
wwwroot
.
'/mod/book/book_theme.css);</style>'
,
true
,
...
...
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