Commit eedb9ef1a59ae08feb881d6544e1906fbd5387a5
1 parent
43c508e5
(#2994) reinstated bad wrapping code
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@2701 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
16 additions
and
10 deletions
presentation/lookAndFeel/knowledgeTree/discussions/viewDiscussionUI.inc
| ... | ... | @@ -152,24 +152,30 @@ function getCommentBody($oComment, $iDocumentID, $oUser) { |
| 152 | 152 | $sBody = urldecode(str_replace("%0D%0A","<br>",str_replace("+", " ",$oComment->getBody()))); |
| 153 | 153 | $aBody = explode("<br>",$sBody); |
| 154 | 154 | $sBody = ""; |
| 155 | - $numChars = 80; // number of chars in a line | |
| 155 | + $numChars = 160; // number of chars in a line | |
| 156 | 156 | |
| 157 | - | |
| 158 | 157 | // Used for wrapping text that may be too long on one any line |
| 159 | 158 | for ($i=0; $i <= sizeof($aBody) ;$i++) { |
| 160 | - $sBody .= $aBody[$i] . "\n"; | |
| 161 | - } | |
| 159 | + if (strlen($aBody[$i]) >$numChars){ | |
| 160 | + $loop = (strlen($aBody[$i]) - (strlen($aBody[$i])) % $numChars)/$numChars +1; | |
| 161 | + | |
| 162 | + $j=$numChars; | |
| 163 | + for($j=0; $j < $loop; $j++ ) { | |
| 164 | + $sBody .= "<br>" . substr($aBody[$i],($j*$numChars), $numChars) . ""; | |
| 165 | + } | |
| 166 | + } else { $sBody .= "<br>" . $aBody[$i]; } | |
| 167 | + } | |
| 162 | 168 | |
| 163 | 169 | $sToRender .= "<br><table width=100% border=0><tr ><td colspan=2><b>Author: </b>" . $oUser->getUserName() . "</td>\n"; |
| 164 | 170 | $sToRender .= "<td align=right>\n"; |
| 165 | 171 | $sToRender .= "<a href=\"" . generateControllerLink("addComment", "fDocumentID=" . $iDocumentID . "&fReplyComment=1&fCommentID=" . $oComment->getID()) . "\"><img src=\"$default->graphicsUrl/widgets/reply.gif\" border=\"0\" /></a>"; |
| 166 | 172 | $sToRender .= "</td><td width=30><a href=\"" . generateControllerLink("viewDiscussion", "fForDiscussion=1&fDocumentID=$iDocumentID") . "\"><img src=\"$default->graphicsUrl/widgets/back.gif\" border=0 ><a></td></tr>\n"; |
| 167 | - $sToRender .= "<tr><td width=\"1\" style=\"background-color:#F5F6EE;\"><b>Subject: </b></td><td width=405 style=\"background-color:#F5F6EE;\">"; | |
| 168 | - $sToRender .= "<a>" . $oComment->getSubject() . "</a>"; | |
| 169 | - $sToRender .= "</td><td colspan=2><b>Date: </b><font color=\"#056DCE\">" . $oComment->getDate() . "</font> </td></tr><tr><td colspan=4 valign=top>"; | |
| 170 | - $sToRender .= "<table width=10 border=0><tr><td><a>"; | |
| 171 | - $sToRender .= wordwrap("<pre>" . $sBody . "</pre>", 80); // Div Views as HTML | |
| 172 | - $sToRender .= "</a></td></tr></table>"; | |
| 173 | + $sToRender .= "<tr><td width=\"1\" style=\"background-color:#F5F6EE;\" ><b>Subject: </b></td><td width=405 style=\"background-color:#F5F6EE;\">"; | |
| 174 | + $sToRender .= $oComment->getSubject(); | |
| 175 | + $sToRender .= "</td><td colspan=2 nowrap style=\"background-color:#F5F6EE;\"><b>Date: </b><font color=\"#056DCE\">" . $oComment->getDate() . "</font> </td></tr><tr><td colspan=4 valign=top>"; | |
| 176 | + $sToRender .= "<table border=0><tr><td>"; | |
| 177 | + $sToRender .= $sBody; | |
| 178 | + $sToRender .= "</td></tr></table>"; | |
| 173 | 179 | $sToRender .= "</td>\n"; |
| 174 | 180 | |
| 175 | 181 | $sToRender .= "</tr></table> "; | ... | ... |