Skip to content

Commit

Permalink
MDL-41288 Wiki: add additional fix for heading level
Browse files Browse the repository at this point in the history
  • Loading branch information
Rossiani Wijaya authored and danpoltawski committed Sep 13, 2013
1 parent 6e3cdbd commit 14cdc25
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 11 deletions.
16 changes: 9 additions & 7 deletions mod/wiki/pagelib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1080,7 +1080,7 @@ function print_header() {
$vstring = new stdClass();
$vstring->old = $this->compare;
$vstring->new = $this->comparewith;
echo $OUTPUT->heading(get_string('comparewith', 'wiki', $vstring));
echo html_writer::tag('div', get_string('comparewith', 'wiki', $vstring), array('class' => 'wiki_headingtitle'));
}

/**
Expand Down Expand Up @@ -1187,7 +1187,7 @@ function print_pagetitle() {
global $OUTPUT;
$html = '';

$html .= $OUTPUT->container_start();
$html .= $OUTPUT->container_start('wiki_headingtitle');
$html .= $OUTPUT->heading_with_help(format_string($this->title), 'history', 'wiki', '', '', 3);
$html .= $OUTPUT->container_end();
echo $html;
Expand Down Expand Up @@ -1253,7 +1253,7 @@ private function print_history_content() {
$a = new StdClass;
$a->date = userdate($this->page->timecreated, get_string('strftimedaydatetime', 'langconfig'));
$a->username = fullname($creator);
echo $OUTPUT->heading(get_string('createddate', 'wiki', $a), 4);
echo html_writer::tag ('div', get_string('createddate', 'wiki', $a), array('class' => 'wiki_headingtime'));
if ($vcount > 0) {

/// If there is only one version, we don't need radios nor forms
Expand Down Expand Up @@ -1884,7 +1884,8 @@ private function print_restoreversion() {
$restoreurl = new moodle_url('/mod/wiki/restoreversion.php', $optionsyes);
$return = new moodle_url('/mod/wiki/viewversion.php', array('pageid'=>$this->page->id, 'versionid'=>$version->id));

echo $OUTPUT->heading(get_string('restoreconfirm', 'wiki', $version->version), 3);
echo $OUTPUT->container_start('wiki-form-center');
echo html_writer::tag('div', get_string('restoreconfirm', 'wiki', $version->version));
echo $OUTPUT->container_start(false, 'wiki_restoreform');
echo '<form class="wiki_restore_yes" action="' . $restoreurl . '" method="post" id="restoreversion">';
echo '<div><input type="submit" name="confirm" value="' . get_string('yes') . '" /></div>';
Expand All @@ -1893,6 +1894,7 @@ private function print_restoreversion() {
echo '<div><input type="submit" name="norestore" value="' . get_string('no') . '" /></div>';
echo '</form>';
echo $OUTPUT->container_end();
echo $OUTPUT->container_end();
}
}
/**
Expand Down Expand Up @@ -2117,15 +2119,15 @@ private function print_version_view() {

if ($pageversion) {
$restorelink = new moodle_url('/mod/wiki/restoreversion.php', array('pageid' => $this->page->id, 'versionid' => $this->version->id));
echo $OUTPUT->heading(get_string('viewversion', 'wiki', $pageversion->version) . '<br />' .
echo html_writer::tag('div', get_string('viewversion', 'wiki', $pageversion->version) . '<br />' .
html_writer::link($restorelink->out(false), '(' . get_string('restorethis', 'wiki') .
')', array('class' => 'wiki_restore')) . '&nbsp;', 4);
')', array('class' => 'wiki_restore')) . '&nbsp;', array('class' => 'wiki_headingtitle'));
$userinfo = wiki_get_user_info($pageversion->userid);
$heading = '<p><strong>' . get_string('modified', 'wiki') . ':</strong>&nbsp;' . userdate($pageversion->timecreated, get_string('strftimedatetime', 'langconfig'));
$viewlink = new moodle_url('/user/view.php', array('id' => $userinfo->id));
$heading .= '&nbsp;&nbsp;&nbsp;<strong>' . get_string('user') . ':</strong>&nbsp;' . html_writer::link($viewlink->out(false), fullname($userinfo));
$heading .= '&nbsp;&nbsp;&rarr;&nbsp;' . $OUTPUT->user_picture(wiki_get_user_info($pageversion->userid), array('popup' => true)) . '</p>';
echo $OUTPUT->container($heading, false, 'mdl-align wiki_modifieduser wiki_headingtime');
echo $OUTPUT->container($heading, 'wiki_headingtime', 'mdl-align wiki_modifieduser');
$options = array('swid' => $this->subwiki->id, 'pretty_print' => true, 'pageid' => $this->page->id);

$pageversion->content = file_rewrite_pluginfile_urls($pageversion->content, 'pluginfile.php', $this->modcontext->id, 'mod_wiki', 'attachments', $this->subwiki->id);
Expand Down
6 changes: 5 additions & 1 deletion mod/wiki/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,13 @@
}

.wiki_restore_yes, .wiki_deletecomment_yes,
.wiki_restore_no, .wiki_deletecomment_no {
.dir-rtl .wiki_restore_no, .wiki_deletecomment_no {
float: left;
}
.wiki_restore_no, .wiki_deletecomment_no,
.dir-rtl .wiki_restore_yes, .wiki_deletecomment_yes {
float: right;
}

.wiki_restoreform, .wiki_deletecommentform {
width: 10%;
Expand Down
10 changes: 8 additions & 2 deletions theme/bootstrapbase/less/moodle/modules.less
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,12 @@ div#dock {
text-align: center;
}

.path-mod-wiki .wiki_headingtitle {
.text-left;
.path-mod-wiki .wiki_headingtitle,
.path-mod-wiki .midpad,
.path-mod-wiki .wiki_headingtime {
text-align: inherit;
}

.path-mod-wiki .wiki_contentbox {
width: 100%;
}
2 changes: 1 addition & 1 deletion theme/bootstrapbase/style/moodle.css

Large diffs are not rendered by default.

0 comments on commit 14cdc25

Please sign in to comment.