Add an ellipsis when cutting urls
This commit is contained in:
committed by
Chris Morgan
parent
7e5264a3d0
commit
647a307fa9
@@ -744,7 +744,7 @@ class Application {
|
||||
$oVendor = new Vendor($this->iVendorId);
|
||||
|
||||
// set URL
|
||||
$appLinkURL = ($this->sWebpage) ? "<a href=\"".$this->sWebpage."\">".substr(stripslashes($this->sWebpage),0,30)."</a>": " ";
|
||||
$appLinkURL = ($this->sWebpage) ? trimmed_link($this->sWebpage,30) : " ";
|
||||
|
||||
// start display application
|
||||
echo html_frame_start("","98%","",0);
|
||||
|
||||
@@ -916,6 +916,22 @@ function HtmlAreaLoaderScript($aTextareas)
|
||||
$outputIndex++; /* increment the output index */
|
||||
}
|
||||
|
||||
/**
|
||||
* Cuts the link text to the specified number of chars if it's longer,
|
||||
* and adds an ellipsis
|
||||
*/
|
||||
function trimmed_link($shUrl, $iLength)
|
||||
{
|
||||
$shText = $shUrl;
|
||||
$shEnd = '';
|
||||
if(strlen($shUrl) > $iLength)
|
||||
{
|
||||
$shText = substr($shUrl, 0, $iLength);
|
||||
$shText .= '...';
|
||||
}
|
||||
return "<a href=\"$shUrl\">$shText</a>";
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
|
||||
@@ -822,7 +822,7 @@ class version {
|
||||
$oCategory->display($oApp->iAppId, $this->iVersionId);
|
||||
|
||||
// set URL
|
||||
$appLinkURL = ($oApp->sWebpage) ? "<a href=\"".$oApp->sWebpage."\">".substr(stripslashes($oApp->sWebpage),0,30)."</a>": " ";
|
||||
$appLinkURL = ($oApp->sWebpage) ? trimmed_link($oApp->sWebpage,30) : " ";
|
||||
|
||||
// start version display
|
||||
echo html_frame_start("","98%","",0);
|
||||
|
||||
Reference in New Issue
Block a user