| Index
» Projects
» phpMyEdit
» Forum
» Modification to the way that trimlen works with URLs |
 |
ajh
Joined: 17 Dec 2003
Posts: 236
Posted: 2003-12-17 17:50
Back to top
Reply with quote
|
The problem I have with trimlen is that it trims the field before the value is passed to the URLdisplay routine. So if you want the URL to be trimmed on screen, but to be linked to the full URL, you can't.
I've made a small change to the cellDisplay function to create a new variable $fullvalue which is set before trimlen is run as follows:
| Code: |
$fullvalue = $value;
if (intval($this->fdd[$k]['trimlen']) > 0 && strlen($value) > $this->fdd[$k]['trimlen']) {
$value = ereg_replace("[\r\n\t ]+",' ',$value);
$value = substr($value, 0, $this->fdd[$k]['trimlen'] - 3).'...';
} |
This is then passed to URLDisplay as an extra parameter:
| Code: |
if ($this->col_has_URL($k)) {
return $this->urlDisplay($k, $value, $fullvalue, $css, $key_rec);
} |
URLdisplay itself just needs the extra parameter added:
| Code: |
| function urlDisplay($k, $value, $fullvalue, $css, $key) |
You now have an extra variable that you can use in the URL and URLdisp options. $value gives you the trimmed url to use in URLdisp, $fullvalue gives you full url to use in URL
Is this something that we could see in the next release?
|
nepto
Joined: 06 Jan 2003
Posts: 381
Location: Phoenix, Arizona (USA)
Posted: 2003-12-18 22:15
Back to top
Reply with quote
|
Thank you for this nice bug-report.
It was fixed in the CVS and will appear in comming release.
http://opensource.platon.sk/projects/bug_view_advanced_page.php?f_bug_id=150
_________________ Ondrej Jombik (Nepto)
Visit my
homepage
, review my recent
CV
or
projects
and give me some
feedback
.
|
|
Post new topic
Reply to topic
|
|
|
|