SEOToolboxAdmin   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 2
dl 0
loc 17
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getEditForm() 0 8 1
1
<?php
2
/**
3
 * Plugin: SEOToolbox
4
 * Author: Dylan Grech
5
 * Copyright: 2016
6
 *
7
 * SEO Tool box Admin is a model admin used to control
8
 * all the automated links and automated link global settings
9
 * for this site
10
 */
11
class SEOToolboxAdmin extends ModelAdmin{
12
13
	private static $menu_title      = 'SEO Tool box';
14
	private static $url_segment     = 'seo-tool-box';
15
	private static $managed_models  = array( 'AutomatedLink' );
16
    private static $menu_priority   = 10;
17
18
19
	public function getEditForm($id = null, $fields = null) {
20
		$form = parent::getEditForm( $id, $fields );
21
		$class = $this->sanitiseClassName($this->modelClass);
22
		$grid   = $form->Fields()->fieldByName($class);
23
		$grid->getConfig()->addComponent( new GridFieldSortableRows( 'Priority' ) );
24
25
		return $form;
26
	}
27
}
28