Skip to content

Commit

Permalink
Improved styling of headings
Browse files Browse the repository at this point in the history
  • Loading branch information
moodler committed Feb 9, 2005
1 parent 2f71f2a commit bfca009
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions lib/weblib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1895,13 +1895,13 @@ function print_navigation ($navigation) {
}

/**
* Prints a string in a specified size
* Prints a string in a specified size (retained for backward compatibility)
*
* @param string $text The text to be displayed
* @param int $size The size to set the font for text display.
*/
function print_headline($text, $size=2) {
echo '<strong><font size="'. $size .'">'. $text .'</font></strong><br />'."\n";
print_heading($text, 'left', $size);
}

/**
Expand All @@ -1911,8 +1911,11 @@ function print_headline($text, $size=2) {
* @param string $align The alignment of the printed paragraph of text
* @param int $size The size to set the font for text display.
*/
function print_heading($text, $align='center', $size=3) {
echo '<p align="'. $align .'"><font size="'. $size .'"><strong>'. stripslashes_safe($text) .'</strong></font></p>';
function print_heading($text, $align='', $size=2) {
if ($align) {
$align = ' align="'.$align.'"';
}
echo "<h$size $align>".stripslashes_safe($text)."</h$size>";
}

/**
Expand All @@ -1925,9 +1928,9 @@ function print_heading($text, $align='center', $size=3) {
* @param string $icon Image to display if needed
*/
function print_heading_with_help($text, $helppage, $module='moodle', $icon='') {
echo '<p align="center"><font size="3">'. $icon .'<strong>'. stripslashes_safe($text);
echo "<h$size>$icon".stripslashes_safe($text);
helpbutton($helppage, $text, $module);
echo '</strong></font></p>';
echo "</h$size>";
}

/**
Expand Down

0 comments on commit bfca009

Please sign in to comment.