Member
Member
bic   04-06-2009, 23:42
#1

They can't actually edit those fields, but the layout of the page is the same as for admin with edit rigths. For example printTags() gives to ALL admin users a not styled list of tags with no link to the proper search. If no tags are present they also see the (no tags) label.

Administrator
Administrator
acrylian   05-06-2009, 07:33
#2

What theme?

Member
Member
bic   05-06-2009, 07:53
#3

I've noticed it with a custom theme but it also occurs with zenpage default. I think it's not theme related.
PrintTags() function in template-functions checks for zp_loggedin():
if ($editable && zp_loggedin()) { printEditable($object, '_update_tags', true, $editclass, $tagstring);
So that also an admin user with no rights sees the editable (but not really editable) field.

I know that I can disable this using false in the proper variable field of the printTags function, but then i loose this usefull feature for admins with edit rights.

The if statement should be replaced with something like:
if ($editable && zp_loggedin(has the proper edit rights)) {

Member
Member
bic   05-06-2009, 08:25
#4

if ($editable && zp_loggedin(EDIT_RIGHTS)) {
But what happens if the given user has edit rights only on certain albums?

Edit:
I've checked. It happens that a working editable object appears in the albums where the user has edit rights and a (not editable) editable object appears in the other albums.

This seems to work in all cases:
if ($editable && zp_loggedin() && isMyAlbum($_zp_current_album->name, EDIT_RIGHTS)) {

after adding to global $_zp_current_album and modifying a few lines above:

if ( $messageIfEmpty === true && $editable && zp_loggedin()

with:

if ( $messageIfEmpty === true && $editable && zp_loggedin() && isMyAlbum($_zp_current_album->name, EDIT_RIGHTS) ) {

to prevent the 'no tags' text if there are no tags

Member
Member
bic   05-06-2009, 09:04
#5

This could be the modifyed part of printTags() function:
`
function printTags($option='links', $preText=NULL, $class='taglist', $separator=', ', $editable=TRUE, $editclass='', $messageIfEmpty = true ) {
global $_zp_current_search, $_zp_current_album ;
$editrgs = isMyAlbum($_zp_current_album->name, EDIT_RIGHTS);
$singletag = getTags();
$tagstring = implode(', ', $singletag);
if ($tagstring === '' or $tagstring === NULL ) {
$preText = '';
if ( $messageIfEmpty === true && $editable && $editrgs ) {
$tagstring = gettext('(No tags...)');
} elseif ( is_string($messageIfEmpty)) {
$tagstring = $messageIfEmpty;
}
}

$object =  in_context(ZP_IMAGE) ? 'image' : 'album' ;
if ($editable && $editrgs ) {
    printEditable($object, '_update_tags', true, $editclass, $tagstring);
} else {

...
`

Member
Member
bic   05-06-2009, 09:56
#6

Ok, I've found an easy theme based solution so don't bother with my request.
In album.php and image.php I have defined the variable:

$editrgs = isMyAlbum($_zp_current_album->name, EDIT_RIGHTS);

so that I can use it to pass the proper true or false value to all the print editable functions of the page, included album and image description.

Administrator
Administrator
acrylian   05-06-2009, 11:04
#7

Everything that works for you is fine..:-) I had no time to check on this at all yet.

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.