noWrap option for htmlOutputText

This commit is contained in:
Roland Gruber 2011-05-20 17:43:31 +00:00
parent 0dc5655568
commit b5cb9f256a
2 changed files with 19 additions and 1 deletions

View File

@ -1178,6 +1178,8 @@ class htmlOutputText extends htmlElement {
private $isBold = false;
/** mark as required */
private $markAsRequired = false;
/** no wrap */
private $noWrap = false;
/**
* Constructor.
@ -1202,6 +1204,9 @@ class htmlOutputText extends htmlElement {
* @return array List of input field names and their type (name => type)
*/
function generateHTML($module, $input, $values, $restricted, &$tabindex, $scope) {
if ($this->noWrap) {
echo "<div class=\"nowrap\">";
}
if ($this->isBold) {
echo "<b>";
}
@ -1219,6 +1224,9 @@ class htmlOutputText extends htmlElement {
if ($this->isBold) {
echo "</b>";
}
if ($this->noWrap) {
echo "</div>";
}
return array();
}
@ -1240,6 +1248,15 @@ class htmlOutputText extends htmlElement {
$this->markAsRequired = $markAsRequired;
}
/**
* Specifies if word wrap is allowed for this text.
*
* @param boolean $noWrap no wrapping if set to true (default false)
*/
public function setNoWrap($noWrap) {
$this->noWrap = $noWrap;
}
}
/**

View File

@ -361,8 +361,9 @@ function showMainPage($scope, $selectedModules) {
$rowCells[] = $columnSpacer;
$rowCells[] = new htmlHelpLink($columns[$modules[$m]][$i]['help'], $modules[$m], $scope);
$rowCells[] = $columnSpacer;
$descriptionText = new htmlOutputText($columns[$modules[$m]][$i]['description'] . $required);
$descriptionText = new htmlOutputText($columns[$modules[$m]][$i]['description']);
$descriptionText->setMarkAsRequired($required);
$descriptionText->setNoWrap(true);
$rowCells[] = $descriptionText;
$rowCells[] = $columnSpacer;
$rowCells[] = new htmlOutputText($columns[$modules[$m]][$i]['name']);