Ok.. I see the permission edit item covers single item editing and album editing...
In my specific use.. i cannot allow the user to edit the album info.. BUT they can edit the single item..
ok.. i was going to delve into the core module tpl files to see if I could use a method i learned already doing somethin else...
first off.. I added this to the page so i could discover the users logged in ID
{$layout.user.id}
but i get a error.. is the layout info brought into the array that is used to build this
Notice: Undefined index: layout in /home/httpd/vhosts/carmelsilver.com/httpdocs/catalog/g2data/smarty/templates_c/%%1949190877/%%54^542^542DC2EF%%ItemEdit.tpl.php on line 4
gallery parses the page correctly but gives an error that states that it doesnt know what $layout is?
Posts: 32509
you understand that you can apply permissions not only to albums, but also to each item in the album, do you? if you don't set special permissions for an item in an album, it just receives the same permissions as its parent albums.
does this solve your issue?
and if not, could you be more descriptive what exactly you want to accomplish?
@ {$layout.user.id}: does http://gallery.menalto.com/index.php?name=PNphpBB2&file=viewtopic&p=129399 answer your questions?
Posts: 35
ok.. this will be better hopefully...
I have debugging turned on to see which templates are being parsed and what variables will be used to workwith..
in the assigned template variables.. the variable
is not present.. I am looking for a way to bring in that variable so i may do things like this..
I am looking to have only certain features seen by only certain users
Posts: 32509
see modules/core/classes/GalleryLayout.class
function loadLayoutTemplate
to see how to populate the $layout variable and how to assign the variable to the layout ($template->setVariable('layout', $layout);).
Posts: 35
well.. i am having some troiuble doing this... i am trying to bring the var $layout into the function but that var has npt been set yet... you said to populate it.. so would i just do a db query by itself then set the output to the var $layout?
or
is there a global var that has $layout inside?
Posts: 32509
just take a look at how it is populated in loadLayoutTemplate. there's no global var, you have to query for the values you want in $layout (you could name the variable differently) and then assign them.
Posts: 35
what i am trying to do is just get the current users ID that is logged in..
is this info in the global $gallery?
if so.. how may i access it..
thanks Valient..
Posts: 32509
global $gallery;
$activeUserId = $gallery->getActiveUserId();
Posts: 35
ok.. this is what I did...
and this works.. in the smarty debug console... the var
$activeUserId shows up and is set with the user id (me).. but when I goto edit an album.. it is not in the console box so i am assuming that template will not have the info that I need...
Posts: 8601
where did you put the above code?
Posts: 35
Posts: 35
the above code snippit was inserted into GalleryLayout.class
Posts: 8601
ok, so you should see that value in the smarty template variables on any view that calls loadLayoutTemplate.. which is layout pages (viewing albums/items)..
Posts: 35
well.. I went ahead and worked on gallerytemplate.class and brought the var in from there.. it works..
Posts: 8601
update to tomorrow's nightly snapshot or update from cvs and you can remove this.. look at $user that is now available for any view..