Page 1 of 1

Customize Upload layer

Posted: 02 May 2020, 18:25
by tintilld
Hello,

I would like to configure the "User Upload" layer in order to:
- Delete / Hide some fields (File title, descritpions, Author, ...)
- Generate the name of the file on the basis of usernam_YYYY-MM-DD_HH-MM.ext (ext is the extension of the uploaded file)

How can you do this easily?

If this is not possible with Phoca download, what can I use instead?

Thank you in advance for your help

kind regards
Tintilld.

Re: Customize Upload layer

Posted: 02 May 2020, 22:12
by christine
Hi,
tintilld wrote: 02 May 2020, 18:25 I would like to configure the "User Upload" layer in order to:
- Delete / Hide some fields (File title, descritpions, Author, ...)
You could try this with an template override of: components\com_phocadownload\site\views\user\tmpl\default_files.php

See similar Thread here: viewtopic.php?f=31&p=155995#p155995
Maybe the lines could be different.

Kind regards
Christine

Re: Customize Upload layer

Posted: 03 May 2020, 21:32
by tintilld
Many Thanks Christine.
As always, you help us when we have a difficulty :)

I successfully delete line that I want :)

Users have just one category to Upload
How can I fix the category for don't ask user?

Another question, what is the name of the variable which contain the UserName ?

Sorry for my very bad english

Thanks by advance for your help.
Tintilld.

Re: Customize Upload layer

Posted: 04 May 2020, 01:12
by Jan
Hi, user name are mostly stored in variables like $user, or $u, or $this->u, etc.

one category - in such case the select box needs to be changed and the one category set as only one item in the select box list.

Generating name should be changed in upload class:
administrator\components\com_phocadownload\libraries\phocadownload\file\fileupload.php

Jan

Re: Customize Upload layer

Posted: 05 May 2020, 21:12
by tintilld
Hi Jan,

Many thanks for your answer :)
I find the username in this variables ==> $user->get('name', 0)

I could fix the filesnames too :)

But I didn't find how resolve my last difficulty :
one category - in such case the select box needs to be changed and the one category set as only one item in the select box list.
How can I do it?

Tintilld.

Re: Customize Upload layer

Posted: 08 May 2020, 21:15
by Jan
You need to write own select box in the override file - including the category id, which you need to display. Just see the source html code of the select box, copy it, change it to your needs and paste to the file which overrides the output.

Jan