| Index
» Projekty
» phpMyEdit
» Fórum
» Modification to the way that trimlen works with URLs |
 |
ajh
Založený: 17.12.2003
Príspevky: 236
Zaslal: 2003-12-17 17:50
Návrat hore
Odpovedať s citátom
|
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:
| Kód: |
$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:
| Kód: |
if ($this->col_has_URL($k)) {
return $this->urlDisplay($k, $value, $fullvalue, $css, $key_rec);
} |
URLdisplay itself just needs the extra parameter added:
| Kód: |
| 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
Založený: 06.01.2003
Príspevky: 381
Bydlisko: Phoenix, Arizona (USA)
Zaslal: 2003-12-18 22:15
Návrat hore
Odpovedať s citátom
|
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
.
|
|
Odoslať novú tému
Odpovedať na tému
|
|
|
|