Treeview

ricm

Joined: 2010-07-12
Posts: 8
Posted: Sun, 2010-11-14 09:57

"Albumselect" module used to have a treeview for G2. Is there anything similar for G3?
Thanks,
Ric

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7985
Posted: Fri, 2010-11-19 20:01

I just wrote a module called "albumtree" that does this. It's in the gallery3-contrib repo and should show up on http://gallerymodules.com shortly. It's probably a little slow for big installs.
---
Problems? Check gallery3/var/logs
bugs/feature req's | upgrade to the latest code | use git

 
ccoredump

Joined: 2010-11-28
Posts: 5
Posted: Sun, 2010-11-28 02:02

Hi bharat,

I was working on a slight modification on your albumtree. Basically I'm just changing it to use a div with a scrollbar. But, I noticed that this code returns a list of all albums, even if a given user has no permission to the album. How could this be modified to only show albums that the user is able to view?

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7985
Posted: Sun, 2010-11-28 02:36

Doh! That's a bug. I just submitted a change to fix that:
https://github.com/gallery/gallery3-contrib/commit/30700cb8de1293b442b73dae462e3fd2e6b4bf31

Nice catch, ccoredump!
---
Problems? Check gallery3/var/logs
bugs/feature req's | upgrade to the latest code | use git

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7985
Posted: Sun, 2010-11-28 02:37

PS: if you're making the UI better, how about just modifying the albumtree module directly and replace the dropdown list? I think the dropdown list is pretty lame to begin with, so you might as well just improve it and we'll all use what you come up with.
---
Problems? Check gallery3/var/logs
bugs/feature req's | upgrade to the latest code | use git

 
ccoredump

Joined: 2010-11-28
Posts: 5
Posted: Sun, 2010-11-28 15:00

That exactly what I just did, basically I just changed the select box to a DIV and added a couple of CSS rules.

I was also playing around with some pretty iPhone-like Jquery lists, but I didn't quite get it to work.
I'll look at submitting something for this.

Thanks for the quick bug fix.

 
disrupter
disrupter's picture

Joined: 2008-03-14
Posts: 34
Posted: Sun, 2010-11-28 15:21

I've been looking for this for a while, thanks so much! One thing is that it displays all albums (even those that you dont have the access to). In other words the permission dont work :(

 
ccoredump

Joined: 2010-11-28
Posts: 5
Posted: Sun, 2010-11-28 20:38

Hi disrupter,

A change was just submitted that takes care of this. But, I did come across another issue, and that is if you are using the chroot module, this module doesn't take that into account.

So none of the URLs work and there might be a security issue if a user relies on using the chroot module rather then setting up album permissions.

 
ccoredump

Joined: 2010-11-28
Posts: 5
Posted: Sun, 2010-11-28 20:38

Hi disrupter,

A change was just submitted that takes care of this. But, I did come across another issue, and that is if you are using the chroot module, this module doesn't take that into account.

So none of the URLs work and there might be a security issue if a user relies on using the chroot module rather then setting up album permissions.

 
disrupter
disrupter's picture

Joined: 2008-03-14
Posts: 34
Posted: Sun, 2010-11-28 21:33
ccoredump wrote:
Hi disrupter,

A change was just submitted that takes care of this. But, I did come across another issue, and that is if you are using the chroot module, this module doesn't take that into account.

So none of the URLs work and there might be a security issue if a user relies on using the chroot module rather then setting up album permissions.

Thanks, I really need to learn how to read :)

 
gabrielbarreno2

Joined: 2010-07-27
Posts: 11
Posted: Tue, 2010-11-30 18:18

hi, is there any Classic treeview?....or how can I transform this one

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7985
Posted: Sat, 2010-12-18 01:11

I just pushed a second style up, thanks to ccoredump. It's totally hacky, but now that there are two styles, it's easy to add more. You switch between styles by going to Admin > Settings > Advanced and changing the albumtree.style variable between "list" and "select".
---
Problems? Check gallery3/var/logs
file a bug/feature ticket | upgrade to the latest code! | hacking G3? join us on IRC!

 
zjohn13

Joined: 2010-12-01
Posts: 62
Posted: Sat, 2010-12-18 08:08

Excellent bharat, the list view works well and is just what I wanted.
Why do people always ask for more whatever they are given? :-)
It would be great if folders could be toggled open/close as in Finder/Explorer.
I will have over 50 sub folders in some gallery folders.

John

 
zjohn13

Joined: 2010-12-01
Posts: 62
Posted: Sat, 2010-12-18 08:30

Oops, I was carried away with the list view appearance but had not tested its function.
The tree structure displays correctly but gives error page not found when selecting any folder.
An example, folder web path websitename/gallery3/index.php/locations/amersham
Selecting folder in tree list tries to connect to websitename/index.php/items/4

Switching back to select works OK

Installed ver 2 by overwriting ver 1 files, removed/saved/added/saved the module.
Any suggestions please?
Thanks,
John

 
zjohn13

Joined: 2010-12-01
Posts: 62
Posted: Sat, 2010-12-18 17:57

I've found a workaround to get albumtree working in list mode on my gallery.
Edited line 20 in albumtree_block_list.html.php to prefix /index.php/items with the root gallery folder name.
Not sure if it needs a variable for the gallery root name to be added there or if my system has lost a variable that the code is already looking for.

John

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 25955
Posted: Sat, 2010-12-18 18:49

zjoh13,
good catch. Line 20 of albumtree_block_list.html.php should now read:
<a href="<?= url::site("items/$album->id")?>"><?= str_repeat("&nbsp;&nbsp;", $level) ?><?= $album->title ?></a>
There was a missing closing </a> as well.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
zjohn13

Joined: 2010-12-01
Posts: 62
Posted: Sat, 2010-12-18 19:04

You guys are amazing, best forum product support I've seen and it's much appreciated.

John

 
missterryman

Joined: 2011-01-10
Posts: 51
Posted: Tue, 2011-01-11 22:43

Hi Bharat,

I gather from the above that the original albumtree module was your creation?
Congratulations! I think you've done a great service to the Gallery 3 community.

I wonder if you are able to offer any help for me to achieve a slight mod I require?
I am aiming to have it only show a part of the tree - only a certain level.

It's the parent/child relationship that I am puzzling over as I only want it to show the menu items for the parent album. An example may help?
ie - considering the following structure:

  • Album 1
  • Album 2
    • Sub-album 1
    • Sub-album 2
    • Sub-album 3
    • Sub-album 4
  • Album 3

When viewing a photo within Sub-album 2, you would see links for Sub-albums 1,3 & 4. (only)

Can you shed any light on how to achieve this?

If so, I would be grateful...

Or maybe it's something you have considered for a future version?

D.

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7985
Posted: Wed, 2011-01-12 01:21

I'm not actively working on this module, but it's pretty easy so perhaps somebody else here can help.
---
Problems? Check gallery3/var/logs
file a bug/feature ticket | upgrade to the latest code! | hacking G3? join us on IRC!

 
missterryman

Joined: 2011-01-10
Posts: 51
Posted: Wed, 2011-01-12 09:13

Ok. Thanks anyway!

I'll continue to look at the code, but if there is anyone who can offer any help, then that'd be great too!

D.