Remove -- Select Category -- from file upload

Phoca Download - download manager
acschnabel
Phoca Newbie
Phoca Newbie
Posts: 1
Joined: 31 Dec 2015, 20:58

Remove -- Select Category -- from file upload

Post by acschnabel »

We have a client running Phoca download and it is working well for their purposes. Their main challenge is that too many users are "forgetting" to choose their default category from the drop-down menu after logging in and the upload is failing. They are instead leaving it at " -- Select Category --".

The way this is set up is that there a single category assigned to a user that represents a particular company. All users within that company have the same category, and NO users, other than the developers and our client, as access to more than a single category. All users that are registered are members of a category as they are created individually by out client. These are NOT public uploads and downloads.

So what we would like to do is remove the "--Select Category--" value from the drop down list when updating a file and only show the actual categories they are a member of. I tried making some code adjustments but was unable to find the right locations to do so.

Any assistance would be appreciated.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48550
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Remove -- Select Category -- from file upload

Post by Jan »

Hi,

the file to edit is:
components\com_phocadownload\views\user\tmpl\default_files.php

there you can find the list of categories:

<?php echo $this->listsfiles['catid'] ?>

which is called by view:

components\com_phocadownload\views\user\view.html.php

$lists_files['catid'] = PhocaDownloadCategory::filterCategory($query, $catid_files, TRUE, TRUE, TRUE);

The function you can find here:
administrator\components\com_phocadownload\libraries\phocadownload\category\category.php

So you can somehow implement the loading only specific category and set it as default - instead of "select category"

When you remove this line:
$categories[] = JHTML::_('select.option', '0', '- '.JText::_('COM_PHOCADOWNLOAD_SELECT_CATEGORY').' -');

then the "select category" will be not more set.

Jan
If you find Phoca extensions useful, please support the project
ferhanzo
Phoca Newbie
Phoca Newbie
Posts: 6
Joined: 16 Sep 2015, 18:34

Re: Remove -- Select Category -- from file upload

Post by ferhanzo »

Hi
So you can somehow implement the loading only specific category and set it as default - instead of "select category"
I am not able to do that. How do I set a default category?

Thanks
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48550
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Remove -- Select Category -- from file upload

Post by Jan »

Hi, why you are not able to do it? Is the file somehow protected from editing?

Jan
If you find Phoca extensions useful, please support the project
ferhanzo
Phoca Newbie
Phoca Newbie
Posts: 6
Joined: 16 Sep 2015, 18:34

Re: Remove -- Select Category -- from file upload

Post by ferhanzo »

No, i do not know how to do this.

I need to set a default category and then remove the field.

Sorry my bad english.
Thanks
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48550
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Remove -- Select Category -- from file upload

Post by Jan »

Hmmm, then I think, you need to someone hire for this. Unfortunately, I didn't do such customization yet, so cannot give any clue advice there :-(

Jan
If you find Phoca extensions useful, please support the project
ferhanzo
Phoca Newbie
Phoca Newbie
Posts: 6
Joined: 16 Sep 2015, 18:34

Re: Remove -- Select Category -- from file upload

Post by ferhanzo »

Ok, no problem!

Thanks
Post Reply