menu_get_object() ought to do it. On Mon, Sep 6, 2010 at 12:02 PM, Earl Miles <[email protected]> wrote:
> On 9/6/2010 5:56 AM, Jerad Bitner wrote: > > One problem with the views filter I've had is that when you limit it > > by uid, and you try to edit someone else's content as admin, the > > nodereference is no longer available, because you are not the original > > user. Has anyone found a reliable way to filter by current user OR > > admin? I was unsuccessful last time I tried using views_or to try to > > do this. > > Assuming the nodereference filter can receive the nid of the node being > edited as an argument (that's the part I'm unclear on, but you can't do > this if you can't somehow get the node) then you need some PHP argument > code that attempts to load the node. If lot loads, return $node->uid; if > not, return $GLOBALS['user']->uid. >
