This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use the new forum.
Home » plugins » User management plugins » sfGuardUser form template
sfGuardUser form template [message #100558] Mon, 07 June 2010 15:45 Go to next message
joemc  is currently offline joemc
Messages: 2
Registered: June 2010
Junior Member
Hi everyone, any help on this would be greatly appreciated.

I'm using the sfDoctrineGuardPlugin and I would like to customise the form for editing a user (mainly their permissions).

The page at /sf_guard_user/1/edit prompts me to edit a user's permissions by using an sfWidgetFormDoctrineChoice object, I want to display each permission with a checkbox and have the user select the permissions that way.

I'm not really sure of the best way to do this.

I was going to override sfGuardUser by creating my own module but feel like I will end up re-doing some work that has already been done for me by the plugin which goes against the DRY principle. That would involve coding a new actions.class.php and templates involved. I don't mind doing that if it is the correct way to modify the functionality but I don't feel that it is.

I think the more correct way would be to override the template that is used for that page, but I'm pretty sure the template is generated on the fly, based on the setup function in lib/form/doctrine/sfDoctrineGuardPlugin/base/BasesfGuardUser Form.class.php in which case it's not something that I can override.

Hopefully this makes sense.

Re: sfGuardUser form template [message #100566 is a reply to message #100558 ] Mon, 07 June 2010 16:41 Go to previous message
joemc  is currently offline joemc
Messages: 2
Registered: June 2010
Junior Member
Editing the setup function in BasesfGuardUserForm (lib/form/doctrine/base/) and adding 'expanded => TRUE' to 'permissions_list' => new sfWidgetFormDoctrineChoice(...) displays the permissions with checkboxes.

This is closer to what I want, but am I right to modify the above file and not override it somewhere else?

The next issue I have is that I want to split up the permission list based on the prefix of the permission name.

Or I could display the permissions based on what group they belong to, but again my problem is that I'm sure I would need to edit some sort of template to achieve this.

As it is just now it is a just a list of permissions on the same line, not very intuitive.

I would also like to be able to customise the label for each position.


[Updated on: Mon, 07 June 2010 16:42]

Previous Topic:sfGuardLoginForm in layout.php
Next Topic:[SOLVED] Is it posible to combine sfGuardUser with my own User entity?
Goto Forum:

powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software