Page 1 of 2
Sugesstion for sorting
Posted: 15 Nov 2011, 15:43
by jamfx
Hi Jan,
this time, I want to make a suggestion for an improvement of PhocaDownloads.
I have a lot of downloads in a lot of categories. The phsical folder structure looks like this:
- Category A
\-> 2011
\-> 2010
\-> 2009
- Category B
\-> 2011
\-> 2010
\-> 2009
- Category C
\-> 2011
\-> 2010
\-> 2009
[....]
Now, if you click on the Editor-Button, PhocaDownloads goes crazy on sorting the Folders... It's simply impossible to find the proper Folder, because a lot of folders are named identicaly. The are sorted somehow (mysticaly for me).
To improve this, I would suggest to use the Alias or the Name from the Backend. Maybe it's even better to show the structured folders from backend.
Thanks
JamFX
Re: Sugesstion for sorting
Posted: 18 Nov 2011, 00:38
by Jan
Hi, physical folder structure is not sorted, like by file manager, all your folder structure is displayed.

e.g. in multiple add feature
Jan
Re: Sugesstion for sorting
Posted: 22 Nov 2011, 09:41
by jamfx
No, sorry, it's not sorted. It looks like this:
http://imageshack.us/photo/my-images/696/unsorted.png/
It's the latest Joomla 1.7 Version. This view is seen, if you write an article and use a the Download-Editor-Button to insert a download in an Article.
Thanks for your help / review.
JamFX
Re: Sugesstion for sorting
Posted: 23 Nov 2011, 19:05
by Jan
Aha, now I know what you mean. The sorting of tree (which was added in some previous version) was removed because tree didn't follow the ACL - the rights needs to be checked for every category.
So you can change the sorting here:
administrator\components\com_phocadownload\models\fields\phocadownloadcategory.php
Jan
Re: Sugesstion for sorting
Posted: 24 Nov 2011, 09:25
by jamfx
Hi,
thanks Jan for your reply. I found in the mentioned file line 29:
Which options do I have to sort? I would like to have a nice treeview if possible... Or can I just order them as I have the folder structure in my first post?
Thanks.
JamFX
Re: Sugesstion for sorting
Posted: 30 Nov 2011, 14:48
by Jan
Hi, depends on you. E.g. ORDER BY a.title ASC or ORDER BY a.title DESC, etc.
Jan
Re: Sugesstion for sorting
Posted: 02 Dec 2011, 10:06
by jamfx
Hi Jan,
is there an overview somewhere where I can find all possible sortings and their meanings?
Thx
JamFX
Re: Sugesstion for sorting
Posted: 04 Dec 2011, 19:05
by Jan
Hi, I think you need to see some mysql manual and see tables in database where you can see by which columns you can order.
Jan
Re: Sugesstion for sorting
Posted: 27 Dec 2011, 11:51
by jamfx
Hi Jan,
first, I hope you had a nice Xmas and had a fiew days off, so you could regain power, with family and a good dinner
But i just faced the problem again. I am not into SQL and Table-THings like you. Hopefully you will find a solution for this mess. I can not explain how hard it is to use the Phoca-Download with this issue. PLease find a way. I think - >THIS IS A BUG <- not a sorting problem at all...
So hopefully you can do something about it, please!!!
Thanks a lot
JamFX
Re: Sugesstion for sorting
Posted: 28 Dec 2011, 23:00
by SonRiab
Moin jamfx!
/JOOMLAROOT/administrator/components/com_phocadownload/helpers/phocadownload.php (line 179-186):
Code: Select all
foreach ($catDataTree as $k => $v) {
foreach ($catData as $k2 => $v2) {
if ($v->value == $v2->value) {
$catDataTreeRights[$k]->text = $v->text;
$catDataTreeRights[$k]->value = $v->value;
}
}
}
I have changed this to keep the right order (which is in $catDataTree!).
/JOOMLAROOT/components/com_phocadownload/views/phocadownloadlinkfile/view.html.php (line 80-84):
Code: Select all
if ($tmpl['type'] != 4) {
$lists['catid'] = PhocaDownloadHelper::filterCategory($query, $catid, null, true, true);
} else {
$lists['catid'] = PhocaDownloadHelper::filterCategory($query, $catid, null, false, true);
}
To get the tree, we have to set the last parameter of the filterCategory function to true.
/JOOMLAROOT/adminstrator/components/com_phocadownload/views/phocadownloadlinkfile/view.html.php (line 80-84):
Code: Select all
if ($tmpl['type'] != 4) {
$lists['catid'] = PhocaDownloadHelper::filterCategory($query, $catid, null, true, true);
} else {
$lists['catid'] = PhocaDownloadHelper::filterCategory($query, $catid, null, false, true);
}
Hope this will fix your problem!

And Jan: Maybe you could implement it into a new version. It would make the Phoca Download Button Plugin more user-friendly.