Skip to content
GitLab
Menu
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
d8a6d49c
Commit
d8a6d49c
authored
Sep 02, 2013
by
Rossiani Wijaya
Browse files
MDL-40686 book: fix heading level and styling
parent
3b42864d
Changes
11
Hide whitespace changes
Inline
Side-by-side
mod/book/delete.php
View file @
d8a6d49c
...
...
@@ -78,6 +78,7 @@ if ($confirm) { // the operation was confirmed.
}
echo
$OUTPUT
->
header
();
echo
$OUTPUT
->
heading
(
$book
->
name
);
// The operation has not been confirmed yet so ask the user to do so.
if
(
$chapter
->
subchapter
)
{
...
...
mod/book/edit.php
View file @
d8a6d49c
...
...
@@ -114,7 +114,7 @@ $PAGE->set_title($book->name);
$PAGE
->
set_heading
(
$course
->
fullname
);
echo
$OUTPUT
->
header
();
echo
$OUTPUT
->
heading
(
get_string
(
'editingchapter'
,
'mod_book'
)
);
echo
$OUTPUT
->
heading
(
$book
->
name
);
$mform
->
display
();
...
...
mod/book/edit_form.php
View file @
d8a6d49c
...
...
@@ -42,7 +42,11 @@ class book_chapter_edit_form extends moodleform {
$mform
=
$this
->
_form
;
$mform
->
addElement
(
'header'
,
'general'
,
get_string
(
'edit'
));
if
(
!
empty
(
$chapter
->
id
))
{
$mform
->
addElement
(
'header'
,
'general'
,
get_string
(
'editingchapter'
,
'mod_book'
));
}
else
{
$mform
->
addElement
(
'header'
,
'general'
,
get_string
(
'addafter'
,
'mod_book'
));
}
$mform
->
addElement
(
'text'
,
'title'
,
get_string
(
'chaptertitle'
,
'mod_book'
),
array
(
'size'
=>
'30'
));
$mform
->
setType
(
'title'
,
PARAM_RAW
);
...
...
mod/book/styles.css
View file @
d8a6d49c
.path-mod-book
.book_chapter_title
{
font-family
:
Tahoma
,
Verdana
,
Arial
,
Helvetica
,
sans-serif
;
text-align
:
left
;
font-size
:
large
;
font-weight
:
bold
;
margin-left
:
0
;
margin-bottom
:
20px
;
}
.dir-rtl.path-mod-book
.book_chapter_title
{
text-align
:
right
;
}
.path-mod-book
.navtop
img
.icon
,
.path-mod-book
.navbotto
n
img
.icon
{
.path-mod-book
.navbotto
m
img
.icon
{
margin-right
:
4px
;
margin-left
:
4px
;
border
:
0
;
...
...
@@ -65,11 +52,6 @@
margin-right
:
0
;
}
/* toc style NUMBERED */
.path-mod-book
.book_toc_numbered
{
font-size
:
0.8em
;
}
/*toc style BULLETS */
.path-mod-book
.book_toc_bullets
{
font-size
:
0.8em
;
...
...
mod/book/tool/importhtml/import_form.php
View file @
d8a6d49c
...
...
@@ -32,7 +32,7 @@ class booktool_importhtml_form extends moodleform {
$mform
=
$this
->
_form
;
$data
=
$this
->
_customdata
;
$mform
->
addElement
(
'header'
,
'general'
,
get_string
(
'import'
));
$mform
->
addElement
(
'header'
,
'general'
,
get_string
(
'import'
,
'booktool_importhtml'
));
$options
=
array
(
// '0'=>get_string('typeonefile', 'booktool_importhtml'),
...
...
mod/book/tool/importhtml/index.php
View file @
d8a6d49c
...
...
@@ -67,7 +67,8 @@ if ($mform->is_cancelled()) {
}
else
if
(
$data
=
$mform
->
get_data
())
{
echo
$OUTPUT
->
header
();
echo
$OUTPUT
->
heading
(
get_string
(
'importingchapters'
,
'booktool_importhtml'
));
echo
$OUTPUT
->
heading
(
$book
->
name
);
echo
$OUTPUT
->
heading
(
get_string
(
'importingchapters'
,
'booktool_importhtml'
),
3
);
// this is a bloody hack - children do not try this at home!
$fs
=
get_file_storage
();
...
...
@@ -84,7 +85,7 @@ if ($mform->is_cancelled()) {
}
echo
$OUTPUT
->
header
();
echo
$OUTPUT
->
heading
(
get_string
(
'import'
,
'booktool_importhtml'
)
);
echo
$OUTPUT
->
heading
(
$book
->
name
);
$mform
->
display
();
...
...
mod/book/tool/print/index.php
View file @
d8a6d49c
...
...
@@ -98,7 +98,9 @@ if ($chapter) {
echo
html_writer
::
link
(
'#'
,
$printicon
.
$printtext
,
$printlinkatt
);
?>
<a
name=
"top"
></a>
<h1
class=
"book_title"
>
<?php
echo
format_string
(
$book
->
name
,
true
,
array
(
'context'
=>
$context
))
?>
</h1>
<?php
echo
$OUTPUT
->
heading
(
format_string
(
$book
->
name
,
true
,
array
(
'context'
=>
$context
)),
1
);
?>
<div
class=
"chapter"
>
<?php
...
...
@@ -106,11 +108,12 @@ if ($chapter) {
if
(
!
$book
->
customtitles
)
{
if
(
!
$chapter
->
subchapter
)
{
$currtitle
=
book_get_chapter_title
(
$chapter
->
id
,
$chapters
,
$book
,
$context
);
echo
'<h2 class="book_chapter_title">'
.
$currtitle
.
'</h2>'
;
echo
$OUTPUT
->
heading
(
$currtitle
)
;
}
else
{
$currtitle
=
book_get_chapter_title
(
$chapters
[
$chapter
->
id
]
->
parent
,
$chapters
,
$book
,
$context
);
$currsubtitle
=
book_get_chapter_title
(
$chapter
->
id
,
$chapters
,
$book
,
$context
);
echo
'<h2 class="book_chapter_title">'
.
$currtitle
.
'</h2><h3 class="book_chapter_title">'
.
$currsubtitle
.
'</h3>'
;
echo
$OUTPUT
->
heading
(
$currtitle
);
echo
$OUTPUT
->
heading
(
$currsubtitle
,
3
);
}
}
...
...
@@ -143,7 +146,9 @@ if ($chapter) {
echo
html_writer
::
link
(
'#'
,
$printicon
.
$printtext
,
$printlinkatt
);
?>
<a
name=
"top"
></a>
<h1
class=
"book_title"
>
<?php
echo
format_string
(
$book
->
name
,
true
,
array
(
'context'
=>
$context
))
?>
</h1>
<?php
echo
$OUTPUT
->
heading
(
format_string
(
$book
->
name
,
true
,
array
(
'context'
=>
$context
)),
1
);
?>
<p
class=
"book_summary"
>
<?php
echo
format_text
(
$book
->
intro
,
$book
->
introformat
,
array
(
'noclean'
=>
true
,
'context'
=>
$context
))
?>
</p>
<div
class=
"book_info"
><table>
<tr>
...
...
@@ -178,9 +183,9 @@ if ($chapter) {
echo
'<div class="book_chapter"><a name="ch'
.
$ch
->
id
.
'"></a>'
;
if
(
!
$book
->
customtitles
)
{
if
(
!
$chapter
->
subchapter
)
{
echo
'<h2 class="book_chapter_title">'
.
$titles
[
$ch
->
id
]
.
'</h2>'
;
echo
$OUTPUT
->
heading
(
$titles
[
$ch
->
id
]
)
;
}
else
{
echo
'<h3 class="book_chapter_title">'
.
$titles
[
$ch
->
id
]
.
'</h3>'
;
echo
$OUTPUT
->
heading
(
$titles
[
$ch
->
id
]
,
3
)
;
}
}
$content
=
str_replace
(
$link1
,
'#ch'
,
$chapter
->
content
);
...
...
mod/book/tool/print/locallib.php
View file @
d8a6d49c
...
...
@@ -60,7 +60,7 @@ function booktool_print_get_toc($chapters, $book, $cm) {
$toc
.
=
html_writer
::
tag
(
'a'
,
''
,
array
(
'name'
=>
'toc'
));
// Representation of toc (HTML).
$toc
.
=
html_writer
::
tag
(
'h2'
,
get_string
(
'toc'
,
'mod_book'
)
,
array
(
'class'
=>
'book_chapter_title'
)
);
$toc
.
=
html_writer
::
tag
(
'h2'
,
get_string
(
'toc'
,
'mod_book'
));
$toc
.
=
html_writer
::
start_tag
(
'ul'
);
foreach
(
$chapters
as
$ch
)
{
if
(
!
$ch
->
hidden
)
{
...
...
mod/book/tool/print/print.css
View file @
d8a6d49c
...
...
@@ -6,38 +6,12 @@ h1, h2, h3, h4, h5, h6 {
page-break-inside
:
avoid
;
}
.book_title
{
margin-left
:
-40px
;
font-family
:
Tahoma
,
Verdana
,
Arial
,
Helvetica
,
sans-serif
;
font-size
:
3em
;
font-weight
:
bold
;
margin-top
:
120px
;
margin-bottom
:
30px
;
text-align
:
center
;
}
.book_summary
{
margin-left
:
-40px
;
text-align
:
center
;
margin-bottom
:
120px
;
}
.book_chapter_title
{
font-family
:
Tahoma
,
Verdana
,
Arial
,
Helvetica
,
sans-serif
;
text-align
:
left
;
font-size
:
1.7em
;
font-weight
:
bold
;
border-style
:
solid
;
border-top-width
:
0px
;
border-right-width
:
0px
;
border-bottom-width
:
1px
;
border-left-width
:
0px
;
margin-left
:
0px
;
margin-bottom
:
20px
;
}
.book_chapter
{
page-break-before
:
always
;
}
...
...
mod/book/view.php
View file @
d8a6d49c
...
...
@@ -172,22 +172,24 @@ if ($nextid) {
// =====================================================
echo
$OUTPUT
->
header
();
echo
$OUTPUT
->
heading
(
$book
->
name
);
// upper nav
echo
'<div class="navtop">'
.
$chnavigation
.
'</div>'
;
// chapter itself
echo
$OUTPUT
->
box_start
(
'generalbox book_content'
);
$hidden
=
$chapter
->
hidden
?
' dimmed_text'
:
null
;
echo
$OUTPUT
->
box_start
(
'generalbox book_content'
.
$hidden
);
if
(
!
$book
->
customtitles
)
{
$hidden
=
$chapter
->
hidden
?
'dimmed_text'
:
''
;
if
(
!
$chapter
->
subchapter
)
{
$currtitle
=
book_get_chapter_title
(
$chapter
->
id
,
$chapters
,
$book
,
$context
);
echo
$OUTPUT
->
heading
(
$currtitle
,
2
,
array
(
'class'
=>
'book_chapter_title '
.
$hidden
)
);
echo
$OUTPUT
->
heading
(
$currtitle
,
3
);
}
else
{
$currtitle
=
book_get_chapter_title
(
$chapters
[
$chapter
->
id
]
->
parent
,
$chapters
,
$book
,
$context
);
$currsubtitle
=
book_get_chapter_title
(
$chapter
->
id
,
$chapters
,
$book
,
$context
);
echo
$OUTPUT
->
heading
(
$currtitle
,
2
,
array
(
'class'
=>
'book_chapter_title '
.
$hidden
)
);
echo
$OUTPUT
->
heading
(
$currsubtitle
,
3
,
array
(
'class'
=>
'book_chapter_title '
.
$hidden
)
);
echo
$OUTPUT
->
heading
(
$currtitle
,
3
);
echo
$OUTPUT
->
heading
(
$currsubtitle
,
4
);
}
}
$chaptertext
=
file_rewrite_pluginfile_urls
(
$chapter
->
content
,
'pluginfile.php'
,
$context
->
id
,
'mod_book'
,
'chapter'
,
$chapter
->
id
);
...
...
theme/bootstrapbase/style/moodle.css
View file @
d8a6d49c
This source diff could not be displayed because it is too large. You can
view the blob
instead.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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