5093 Posts in 1516 Topics by 1113 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 338 Views |
-
ModelAdmin: two save buttons.

13 January 2012 at 7:45pm Last edited: 13 January 2012 7:52pm
Hi,
i have a custom Object extended from Page that i want to manage in model admin. It has a many_many relation to an other object and is placed in a page holder with a has_one <-> has_many relation. As i expect a large number of elements being held in this object in the future, i would like to manage them in model admin.
I would like to remove one of the save buttons and make the "save and publish"- button work.
I browsed this forum and others and read posts for hours but did not find anything helpful. I appreciate any ideas.
Best regads!
ramtamtam -
Re: ModelAdmin: two save buttons.

14 January 2012 at 5:30am
okay, so far i was able to remove one of the two save buttons. I inserted the following line in my MyCustomAdmin class in order to reference a record controller class:
public static $record_controller_class = 'MyCustomAdmin_RecordController';
and then created the class referenced in the same file like this:
class MyCustomAdmin_RecordController extends ModelAdmin_RecordController {
//manages everything to do with individual record
public function EditForm() {
$form = parent::EditForm();
$actions = $form->Actions();
$actions->removeByName('Save'); // remove save button from form
return $form;
}
}Fortunately, the button that did not work was removed and not the other one. No idea why this is so.
Still i am facing the problem of a not working save-and-publish button. Im am thankfull for any help on getting this button working.
Best regads!
ramtamtam
| 338 Views | ||
|
Page:
1
|
Go to Top |

