- use htmlarea for editing app description and notes

- special stylesheet for application description and notes
- function to display summary of description with html stripping
This commit is contained in:
Jonathan Ernst
2005-02-02 02:38:20 +00:00
committed by WineHQ
parent 6beff0b816
commit f2258e7ee5
7 changed files with 158 additions and 63 deletions

View File

@@ -116,4 +116,20 @@ function lookupAppName($appId)
return $ob->appName;
}
/**
* Remove html formatting from description and extract the first part of the description only.
* This is to be used for search results, application summary tables, etc.
*/
function trim_description($sDescription)
{
// 1) let's take the first line of the description:
$aDesc = explode("\n",trim($sDescription),2);
// 2) maybe it's an html description and lines are separated with <br> or </p><p>
$aDesc = explode("<br>",$aDesc[0],2);
$aDesc = explode("<br />",$aDesc[0],2);
$aDesc = explode("</p><p>",$aDesc[0],2);
$aDesc = explode("</p><p /><p>",$aDesc[0],2);
return trim(strip_tags($aDesc[0]));
}
?>