Data Manager customization: getCloneRecordActionButtons

Data Manager customization: getCloneRecordActionButtons

The getCloneRecordActionButtons customization allows you to completely override the set of buttons and links that appears below the clone record form. It must return an array of structs that describe the buttons to display and is provided objectName and recordId in the args struct.

Note, if you simply want to add, or tweak, the buttons, you may wish to use Data Manager customization: getExtraCloneRecordActionButtons.

For example:

// /application/handlers/admin/datamanager/blog.cfc

component {

	private array function getCloneRecordActionButtons( event, rc, prc, args={} ) {
		var actions = [{
			  type      = "link"
			, href      = event.buildAdminLink( objectName="blog" )
			, class     = "btn-default"
			, globalKey = "c"
			, iconClass = "fa-reply"
			, label     = translateResource( uri="cms:cancel.btn" )
		}];

		actions.append({
			  type      = "button"
			, class     = "btn-info"
			, iconClass = "fa-save"
			, name      = "_saveAction"
			, value     = "publish"
			, label     = translateResource( uri="cms:datamanager.addrecord.btn", data=[ prc.objectTitle ?: "" ] )
		} );

		actions.append({
			  type      = "button"
			, class     = "btn-plus"
			, iconClass = "fa-save"
			, name      = "_saveAction"
			, value     = "publishAndClone"
			, label     = translateResource( uri="cms:presideobjects.blog:addrecord.and.clone.btn", data=[ prc.objectTitle ?: "" ] )
		} );

		return actions;
	}

}

Info

See Reference: Data Manager action buttons array for add and edit forms for detailed documentation on the format of the action items.