| Index
» Projekty
» phpMyEdit
» Fórum
» check if a link (file) exists |
 |
hiluc
Založený: 15.09.2004
Príspevky: 3
Zaslal: 2004-09-15 20:14
Návrat hore
Odpovedať s citátom
|
A table including title,file_path,file_name
The title is 'clickable' and points to a file:
$opts['fdd']['title'] = array(
'name' => 'Title',
'escape' => false,
'sql|L' => 'concat("<a target=\"_blank\" href=\"",file_path,file_name,"\">",title,"</a>")',
);
Is it possible to check if the file exists (to make the clickable to non-clickable here in the opts[...]
declarations ?
thx, hiluc
|
michal
Založený: 17.06.2003
Príspevky: 537
Bydlisko: Slovakia
Zaslal: 2004-09-18 22:36
Návrat hore
Odpovedať s citátom
|
this is a candidate for a custom php function. finally something that cannot be done with sql concat :)
try patch from bug #127. should work, but that was a long time ago...
|
hsicard
Založený: 22.10.2003
Príspevky: 17
Zaslal: 2004-10-23 23:46
Návrat hore
Odpovedať s citátom
|
This is actually possible using an idea of hbernard. See:
http://opensource.platon.sk/forum/projects/viewtopic.php?t=395
1- Each time you load the form, you create on the fly a temporary table with the information you need (for each record, your php script test if file exists. If yes you put the link. If not you could even put an input type=file
2- Through a virtual SQL|L field, you link your table with the temporay table you generated
I use this to manage image files.
|
|
Odoslať novú tému
Odpovedať na tému
|
|
|
|