Page 1 of 1

Remove -- Select Category -- from file upload

Posted: 31 Dec 2015, 21:06
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.

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

Posted: 03 Jan 2016, 01:36
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

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

Posted: 21 May 2016, 14:10
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

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

Posted: 21 May 2016, 17:11
by Jan
Hi, why you are not able to do it? Is the file somehow protected from editing?

Jan

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

Posted: 30 May 2016, 21:36
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

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

Posted: 01 Jun 2016, 23:13
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

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

Posted: 02 Jun 2016, 14:23
by ferhanzo
Ok, no problem!

Thanks