Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Customising the CMS /

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba

ModelAdmin remove back button?


Go to End
Reply


2 Posts   968 Views

Avatar
swaiba

Forum Moderator, 1824 Posts

15 February 2011 at 6:14am

Edited: 15/02/2011 7:18am

Hi,

Has anyone got a quick snippet that will remove the 'back' button within ModelAdmin?
It would be very much appreciated

Avatar
swaiba

Forum Moderator, 1824 Posts

17 February 2011 at 3:24am

Edited: 17/02/2011 7:50am

thanks to a little help from simon_w on IRC...

class MyModelAdmin extends ModelAdmin {
...
	public static $record_controller_class = "MyModelAdmins_RecordController";
...
}

class MyModelAdmin_RecordController extends ModelAdmin_RecordController {
...
	public function EditForm() {
		$form = parent::EditForm();
		$fields = $form->Actions();
		$fields->removeByName('action_goBack');
		$form->setActions ($fields);
		return $form;
	}
...
}