Template variable difficulty

Brandon Sussman

Joined: 2005-10-24
Posts: 82
Posted: Wed, 2008-07-16 10:36

I have the following in ItemEditItem.inc:

if (GalleryCoreApi::hasPermission($myItemID, GROUP_EVERYBODY, 'core.viewAll'))
	{
		$template->setVariable('isPublic', 1);
	}
else	{
		$template->setVariable('isPublic', 0);
	}

This allows the presetting of a radio button in ItemEditItem.tpl based on current item permissions. The user may change the setting in the edit screen.

After I alter the permissions per user choice, I try to re-execute the above block but I get a white screen (of death) on '$template->setVariable('isPublic', 1);' as if I have either lost addressability to the variable or I am not allowed to alter it.

How do I modify the value of this variable prior to the redisplay?