Is it possible to activate an upload-button in category-view?
I know that it is possible to upload by using the member-upload-link, but it would be great e.g. to navigate in "Downloads -> Category 1" and have an upload-button right in this category.
Thanks for your help.
Frontend: Upload-button in category
- Jan
- Phoca Hero
- Posts: 48566
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Frontend: Upload-button in category
Hi, for now such feature exists in Phoca Gallery, and I am planning to write it for Phoca Download, it is in feature request list but I cannot say when I will find to look at it 
Jan

Jan
If you find Phoca extensions useful, please support the project
-
- Phoca Newbie
- Posts: 3
- Joined: 19 Jul 2015, 16:03
Re: Frontend: Upload-button in category
Hello,
I didn't see this feature in the last release.
I am actually working on my website to create a button or a link to do that.
I already have the code to check the upload rights on the category and a sample link to the upload form with the category id set.
I will keep working on it and update this post when it will have finished.
Maybe it will help you to implement this feature.
PS : sorry for my bad english ...
I didn't see this feature in the last release.
I am actually working on my website to create a button or a link to do that.
I already have the code to check the upload rights on the category and a sample link to the upload form with the category id set.
I will keep working on it and update this post when it will have finished.
Maybe it will help you to implement this feature.
PS : sorry for my bad english ...
- Jan
- Phoca Hero
- Posts: 48566
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Frontend: Upload-button in category
Ok
If you find Phoca extensions useful, please support the project
-
- Phoca Newbie
- Posts: 3
- Joined: 19 Jul 2015, 16:03
Re: Frontend: Upload-button in category
I have modify 2 files :
yoursite\com_phocadownload\views\category\tmpl\default.php
add at line 49 just after "if (!empty($this->category[0])) {"
yoursite\media\com_phocadownload\css\main\phocadownload.css
Search "pdtop" and after the 2 blocks found, copy this :
For information, I also made some modifications to the blocks pdtop to better center the "parent category" icon :
If you have any question or suggestion, do not hesitate to contact me.
I'm now trying to add a variable to translate the link.
yoursite\com_phocadownload\views\category\tmpl\default.php
add at line 49 just after "if (!empty($this->category[0])) {"
Code: Select all
//Upload Link start
$catAccess = PhocaDownloadAccess::getCategoryAccess((int)$this->category[0]->id);
if (!empty($catAccess)) {
$rightDisplayUpload = PhocaDownloadAccess::getUserRight('uploaduserid', $catAccess->uploaduserid, 2, array(0 => 2), $this->t['user']->get('id', 0), 0);
}
if ($rightDisplayUpload == 1) {
echo '<div class="pdupload"><a href="yoursite/index.php?option=com_phocadownload&view=user&Itemid=201&catid='. $this->category[0]->id.'">Upload file</a></div>';
}
//Upload Link end
yoursite\media\com_phocadownload\css\main\phocadownload.css
Search "pdtop" and after the 2 blocks found, copy this :
Code: Select all
#phoca-dl-category-box .pd-category div.pdupload,
#phoca-dl-file-box .pd-file div.pdupload,
#phoca-dl-download-box .pd-file div.pdupload {
float: right;
position: relative;
margin: 0;
padding: 6px;
}
For information, I also made some modifications to the blocks pdtop to better center the "parent category" icon :
Code: Select all
#phoca-dl-category-box .pd-category div.pdtop,
#phoca-dl-file-box .pd-file div.pdtop,
#phoca-dl-download-box .pd-file div.pdtop {
float: right;
position: relative;
margin: 0;
padding: 5px 6px 6px 6px;
vertical-align: middle;
}
If you have any question or suggestion, do not hesitate to contact me.
I'm now trying to add a variable to translate the link.
Last edited by MFoucard on 26 Jul 2015, 21:08, edited 1 time in total.
- Jan
- Phoca Hero
- Posts: 48566
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Frontend: Upload-button in category
Hi, to have the option to upload in category view, it is not so easy as if it would I would implement it quickly.
1) design - you need to create form for it in category view
2) controller - you need to get the form data and check for possible rights (access, duplicity, ..., ...)
3) then you need to manage the files on the server, including all possible issues
4) then you can send them to model and store such information to database.
(and of course I didn't do it for Phoca Download yet, so this list maybe is not complete)

Jan
1) design - you need to create form for it in category view
2) controller - you need to get the form data and check for possible rights (access, duplicity, ..., ...)
3) then you need to manage the files on the server, including all possible issues
4) then you can send them to model and store such information to database.



Jan
If you find Phoca extensions useful, please support the project
-
- Phoca Newbie
- Posts: 3
- Joined: 19 Jul 2015, 16:03
Re: Frontend: Upload-button in category
I didn't want to upload from the category view but only to be able to have a "download in this category" button which send me to the user view with the category already selected.
- Jan
- Phoca Hero
- Posts: 48566
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Frontend: Upload-button in category
Hi, aha now I understand, so this is different to the topic theme, but which such feature no experiences yet 
Jan

Jan
If you find Phoca extensions useful, please support the project