DNAdmin   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 4
dl 0
loc 42
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getEditForm() 0 14 2
1
<?php
2
3
class DNAdmin extends ModelAdmin {
0 ignored issues
show
Coding Style introduced by
The property $menu_title is not named in camelCase.

This check marks property names that have not been written in camelCase.

In camelCase names are written without any punctuation, the start of each new word being marked by a capital letter. Thus the name database connection string becomes databaseConnectionString.

Loading history...
Coding Style introduced by
The property $url_segment is not named in camelCase.

This check marks property names that have not been written in camelCase.

In camelCase names are written without any punctuation, the start of each new word being marked by a capital letter. Thus the name database connection string becomes databaseConnectionString.

Loading history...
Coding Style introduced by
The property $managed_models is not named in camelCase.

This check marks property names that have not been written in camelCase.

In camelCase names are written without any punctuation, the start of each new word being marked by a capital letter. Thus the name database connection string becomes databaseConnectionString.

Loading history...
Coding Style introduced by
The property $menu_priority is not named in camelCase.

This check marks property names that have not been written in camelCase.

In camelCase names are written without any punctuation, the start of each new word being marked by a capital letter. Thus the name database connection string becomes databaseConnectionString.

Loading history...
4
5
	/**
6
	 * @var string
7
	 */
8
	public static $menu_title = "Deploynaut Projects";
9
10
	/**
11
	 * @var string
12
	 */
13
	public static $url_segment = "naut";
14
15
	/**
16
	 * @var array
17
	 */
18
	public static $managed_models = [
19
		'DNProject' => ['title' => 'Projects'],
20
		'DNDataTransfer' => ['title' => 'Transfers'],
21
		'DNDataArchive' => ['title' => 'Archives'],
22
	];
23
24
	/**
25
	 * @var int
26
	 */
27
	private static $menu_priority = 100;
28
29
	public function getEditForm($id = null, $fields = null) {
30
		$form = parent::getEditForm($id, $fields);
31
		$gridField = $form->Fields()->dataFieldByName('DNProject');
32
		if ($gridField) {
33
			$gridField->getConfig()
34
				->removeComponentsByType('GridFieldExportButton')
35
				->removeComponentsByType('GridFieldPrintButton')
36
				->removeComponentsByType('GridFieldAddNewButton')
37
				->addComponent(new GridFieldAddNewMultiClass('buttons-before-left'))
38
				->addComponent(new GridFieldExportButton('buttons-before-right'))
39
				->addComponent(new GridFieldPrintButton('buttons-before-right'));
40
		}
41
		return $form;
42
	}
43
44
}
45