Skip to content

Commit

Permalink
Made the quiz paging bar look more like the standard one, see bug 2443.
Browse files Browse the repository at this point in the history
  • Loading branch information
gustav_delius committed Feb 13, 2005
1 parent c46f27a commit 2f94514
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 28 deletions.
42 changes: 14 additions & 28 deletions mod/quiz/locallib.php
Expand Up @@ -717,7 +717,7 @@ function quiz_print_navigation_panel($questions, $questionsperpage, $navigation)
}
$pagenavigationlayout[] = $currentpagestart .'-'. ($nextqnumber - 1);
if ($currentpagestart < $navigation) {
// $firsquestion is out of sync so adjust it for robustness...
// $firstquestion is out of sync so adjust it for robustness...
$navigation = $currentpagestart;
}
}
Expand All @@ -736,42 +736,28 @@ function quiz_print_navigation_panel($questions, $questionsperpage, $navigation)
}

///////////////////////////////////////////////
/// Print the navigation meny
/// Print the navigation menu
///////////////////////////////////////////////
print_simple_box_start('center', '*');
echo '<table><tr><td colspan="5" align="center"><table><tr>';
echo '<div class="pagingbar">';
echo '<span class="title">'.get_string('questions', 'quiz').':</span>';
if (isset($previouspagelink)) {
$strprev = get_string('previous');
echo '<a href="' . quiz_navigation_javascript($previouspagelink) . '" title="'.$strprev.'">('.$strprev.')</a>';
}
foreach ($pagelinkagelayout as $key => $link) {
echo '<td align="center">&nbsp;';
if ($link != $navigation) {
echo '<a href="' . quiz_navigation_javascript($link) . '">';
} else {
echo '<span class="thispage">';
}
echo $pagenavigationlayout[$key];
if ($link != $navigation) {
echo '</a>';
}
echo '&nbsp;</td>';
echo ($link != $navigation) ? '</a>' : '</span>';
}
echo '</tr></table></td></tr><tr><td width="20%" align="left">';
if (isset($previouspagelink)) {
echo '<a href="' . quiz_navigation_javascript('1') . '">|&lt;&lt;&lt;</a></td><td width="20%" align="center" cellpadding="2">';
echo '<a href="' . quiz_navigation_javascript($previouspagelink) . '">&lt;&lt;&lt;</a></td>';
} else {
echo '</td><td width="20%"></td>';
}
echo '<td width="20%" align="center"><b>';
echo $currentnavigationtitle;
echo '</b></td><td width="20%" align="center" cellpadding="2">';
if (isset($nextpagelink)) {
echo '<a href="';
echo quiz_navigation_javascript($nextpagelink);
echo '">&gt;&gt;&gt;</a></td><td width="20%" align="right"><a href="';
echo quiz_navigation_javascript($endpagelink);
echo '">&gt;&gt;&gt;|</a>';
} else {
echo '</td><td width="20%">';
$strnext = get_string('next');
echo '<a href="'.quiz_navigation_javascript($nextpagelink).'" title="'.$strnext.'">('.$strnext.')</a></span>';
}
echo '</td></tr></table>';
print_simple_box_end();
echo '</div>';

////////////////////////////////////////////////
/// Return the potentially adjusted $navigation
Expand Down
7 changes: 7 additions & 0 deletions theme/standard/styles_fonts.css
Expand Up @@ -121,6 +121,13 @@ h4 {
******************************/
/* many places */

/* paging bar */
.pagingbar .title {
font-weight: bold;
}
.pagingbar .thispage {
font-weight: bold;
}

/*****************************
***
Expand Down
11 changes: 11 additions & 0 deletions theme/standard/styles_layout.css
Expand Up @@ -173,6 +173,17 @@ a img {
}


/* paging bar */
.pagingbar {
text-align:center;
}
.pagingbar a {
padding-left: 10px;
}
.pagingbar .thispage {
padding-left: 10px;
}

/*****************************
***
*** Admin
Expand Down

0 comments on commit 2f94514

Please sign in to comment.