Permalink
Browse files

BackwardsCompatibilityBreak - fHTML::show() now does what fMessaging:…

…:show() used to, and fMessaging::show() now does a message retrieval in combination with a show
  • Loading branch information...
wbond committed Jun 30, 2008
1 parent 305442d commit 95cf1f34976d49957137146809dedccc8d2b13a0
Showing with 30 additions and 14 deletions.
  1. +22 −0 classes/response/fHTML.php
  2. +8 −14 classes/session/fMessaging.php
View
@@ -172,6 +172,28 @@ static public function sendHeader()
}
/**
* Prints a paragraph (or div if the content has block-level html) with the contents and the class specified - will not print if no content
*
* @param string $content The content to display
* @param string $css_class The css class to apply
* @return void
*/
static public function show($content, $css_class='')
{
if (!fCore::stringlike($content)) {
return;
}
$class = ($css_class) ? ' class="' . $css_class . '"' : '';
if (self::checkForBlockLevelHTML($content)) {
echo '<div' . $class . '>' . self::prepare($content) . '</div>';
} else {
echo '<p' . $class . '>' . self::prepare($content) . '</p>';
}
}
/**
* Forces use as a static class
*
@@ -45,24 +45,18 @@ static public function retrieve($name, $recipient)
/**
* Prints a paragraph (or div if the content has block-level html) with the contents and the class specified - will not print if no content
* Retrieves a message, removes it from the session and prints it with the CSS class specified - will not print if no content
*
* @param string $content The content to display
* @param string $css_class The css class to apply
* The message will be printed in a paragraph tag if it does not contain
* any block level HTML. Otherwise it will be printed in a div tag.
*
* @param string $name The name of the message to retrieve
* @param string $recipient The intended recipient
* @return void
*/
static public function show($content, $css_class='')
static public function show($name, $recipient, $css_class='')
{
if (!fCore::stringlike($content)) {
return;
}
$class = ($css_class) ? ' class="' . $css_class . '"' : '';
if (fHTML::checkForBlockLevelHTML($content)) {
echo '<div' . $class . '>' . fHTML::prepare($content) . '</div>';
} else {
echo '<p' . $class . '>' . fHTML::prepare($content) . '</p>';
}
fHTML::show(self::retrieve($name, $recipient), $css_class);
}

0 comments on commit 95cf1f3

Please sign in to comment.