SEOToolboxAdmin::getEditForm()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
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