Page 1 of 1
Frontend: Upload-button in category
Posted: 21 Feb 2013, 17:31
by BlueSnake
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.
Re: Frontend: Upload-button in category
Posted: 24 Feb 2013, 21:37
by Jan
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
Re: Frontend: Upload-button in category
Posted: 19 Jul 2015, 16:14
by MFoucard
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 ...
Re: Frontend: Upload-button in category
Posted: 23 Jul 2015, 23:49
by Jan
Ok
Re: Frontend: Upload-button in category
Posted: 26 Jul 2015, 19:17
by MFoucard
I have modify 2 files :
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.
Re: Frontend: Upload-button in category
Posted: 26 Jul 2015, 19:55
by Jan
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
Re: Frontend: Upload-button in category
Posted: 26 Jul 2015, 21:15
by MFoucard
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.
Re: Frontend: Upload-button in category
Posted: 26 Jul 2015, 23:37
by Jan
Hi, aha now I understand, so this is different to the topic theme, but which such feature no experiences yet
Jan