Filepicker [message #4600] |
Thu, 16 October 2014 10:14 |
htManager
Messages: 433 Registered: May 2014
|
Senior Member |
|
|
Hi Tony,
I read the post of deleting files in a filepicker screen with a button in the HOW TO category from 2010. There you told that a new task called 'file(delete)' was added in version 1.42.0. I can't find this task. What expression/pattern do I have to look for?
If there is no possibility to delete files I think there isn't also a possibility to filter images/logos due to the account in a virtual private database, isn't it? If a user cannot delete a file it is possibly the best practice in a VPD to deal with all the logo files. Is this the reason why the framework has no such pattern? Or do you have other reasons/experiences?
Best regards,
Juergen
|
|
|
|
|
Re: Filepicker [message #5518 is a reply to message #5517] |
Thu, 28 April 2016 04:24 |
AJM
Messages: 2367 Registered: April 2006 Location: Surrey, UK
|
Senior Member |
|
|
The 'Select' button is missing from that screen simply because it is missing in your screen structure file. If you try the standard 'Batch Log Files' navigation which is available on all menu screens you should see that each row has a selected button by default.
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
|
|
|
|
Re: Filepicker [message #5521 is a reply to message #5519] |
Fri, 29 April 2016 04:33 |
AJM
Messages: 2367 Registered: April 2006 Location: Surrey, UK
|
Senior Member |
|
|
I meant "if you try the standard 'Batch Log Files' navigation button" which is available in the demonstration system. This shows 'select' checkboxes because they are defined in the screen structure file. For image pickers there is the ability to drop the 'select' checkbox and make the image name a clickable link. The 'select' checkbox is not shown because it is missing from the screen structure file.
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
|
|
|
|
Re: Filepicker [message #5528 is a reply to message #5524] |
Sun, 01 May 2016 06:47 |
AJM
Messages: 2367 Registered: April 2006 Location: Surrey, UK
|
Senior Member |
|
|
On the filepicker screen which shows image files it is possible to add one navigation button to allow new images to be uploaded, and another navigation button which allows selected files to be deleted. I do not currently have a task which expands the image to full size.
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
|
|
|
|
|
Re: Filepicker [message #5533 is a reply to message #5532] |
Thu, 05 May 2016 04:23 |
AJM
Messages: 2367 Registered: April 2006 Location: Surrey, UK
|
Senior Member |
|
|
When you enter the _cm_pre_deleteRecord method the $rowdata argument contains values from the database record which is the subject of this deletion. I see from this code that it has the name $rowdata['file'] which you are then copying into the $filename variable along with the directory name. You are then doing something with a 'training_plan_uebungen' object, but I cannot determine what. You need to step through with your debugger to see where the actual behaviour differs from what you are expecting.
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
|
|
|
|
|
|
Re: Filepicker [message #5751 is a reply to message #5750] |
Sat, 23 July 2016 12:21 |
AJM
Messages: 2367 Registered: April 2006 Location: Surrey, UK
|
Senior Member |
|
|
I have made a change to std.filepicker.list1.xsl which is attached. I tested it with a new filepicker task which deals only with videos. This requires a different screen structure file which looks like the following:
<?php
$structure['xsl_file'] = 'std.filepicker.list1.xsl';
$structure['tables']['main'] = 'file';
$structure['main']['columns'][] = array('width' => '25%');
$structure['main']['columns'][] = array('width' => '25%');
$structure['main']['fields'][] = array('file' => 'File Name');
$structure['main']['fields'][] = array('video' => 'Video',
'imageheight' => 180,
'imagewidth' => 320,
'nosort' => 'y');
?>
This shows two videos per line. You can select a video by clicking on its name, or you can play a video by activating any of its controls.
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
|
|
|
|
Re: Filepicker [message #5756 is a reply to message #5753] |
Tue, 26 July 2016 05:23 |
AJM
Messages: 2367 Registered: April 2006 Location: Surrey, UK
|
Senior Member |
|
|
Why are you defining a field called 'file' in $fieldspec? That is a dummy field that holds nothing but the file name and is read-only, so it does not need any specifications. The only difference between an image picker and a video picker is the screen structure file that I provided previously. In your class file you also need to set $this->picker_subdir to the directory which contains your video files. Those are the only changes I made in my tests, and I do not encounter this error.
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
|
|
|
|
|
|
Re: Filepicker [message #5765 is a reply to message #5760] |
Thu, 28 July 2016 04:31 |
AJM
Messages: 2367 Registered: April 2006 Location: Surrey, UK
|
Senior Member |
|
|
I cannot reproduce this error on my PC. In order for me to investigate what is happening in your code you will have to send me the following:
1) The ?.class.inc file which is used in this filepicker
2) The ?.dict.inc file
3) The screen structure file
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
|
|
|
|
|
|
Re: Filepicker [message #5771 is a reply to message #5770] |
Sat, 30 July 2016 12:28 |
AJM
Messages: 2367 Registered: April 2006 Location: Surrey, UK
|
Senior Member |
|
|
To display a video file the screen structure file must have the following:
$structure['main']['fields'][] = array('video' => 'Video',
The following is only valid for still images:
$structure['main']['fields'][] = array('image' => 'Image',
I have tried the code you gave me and I cannot reproduce the error. When I set the type to 'video' as shown above I can see the video file.
Can you send me the XML document that was included in the error log?
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
|
|
|
|
|
|
|