Code Duplication    Length = 15-16 lines in 3 locations

code/DataObjectOneFieldOneRecordUpdateController.php 1 location

@@ 55-69 (lines=15) @@
52
        }
53
    }
54
55
    public function init()
56
    {
57
        //must set this first ...
58
        Config::inst()->update('SSViewer', 'theme_enabled', Config::inst()->get('DataObjectSorterRequirements', 'run_through_theme'));
59
        // Only administrators can run this method
60
        parent::init();
61
        DataObjectSorterRequirements::popup_requirements('onefieldonerecord');
62
        $url = Director::absoluteURL(
63
            Injector::inst()->get('DataObjectOneFieldOneRecordUpdateController')->Link('updatefield')
64
        );
65
        Requirements::customScript(
66
            "var DataObjectOneFieldOneRecordUpdateURL = '".$url."'",
67
            'DataObjectOneFieldOneRecordUpdateURL'
68
        );
69
    }
70
71
    public function onefieldform()
72
    {

code/DataObjectOneFieldUpdateController.php 1 location

@@ 88-102 (lines=15) @@
85
    }
86
87
88
    public function init()
89
    {
90
        //must set this first ...
91
        Config::inst()->update('SSViewer', 'theme_enabled', Config::inst()->get('DataObjectSorterRequirements', 'run_through_theme'));
92
        parent::init();
93
        DataObjectSorterRequirements::popup_requirements('onefield');
94
        $url = Director::absoluteURL(
95
            Injector::inst()->get('DataObjectOneFieldUpdateController')
96
                ->Link('updatefield')
97
        );
98
        Requirements::customScript(
99
            "var DataObjectOneFieldUpdateURL = '".$url."'",
100
            'DataObjectOneFieldUpdateURL'
101
        );
102
    }
103
104
    public function updatefield($request = null)
105
    {

code/DataObjectOneRecordUpdateController.php 1 location

@@ 38-53 (lines=16) @@
35
        }
36
    }
37
38
    public function init()
39
    {
40
        //must set this first.
41
        Config::inst()->update('SSViewer', 'theme_enabled', Config::inst()->get('DataObjectSorterRequirements', 'run_through_theme'));
42
        parent::init();
43
        if (! Director::is_ajax()) {
44
            DataObjectSorterRequirements::popup_requirements('onerecord');
45
            $url = Director::absoluteURL(
46
                 Injector::inst()->get('DataObjectOneRecordUpdateController')->Link('onerecordform')
47
            );
48
            Requirements::customScript(
49
                "var DataObjectOneRecordUpdateURL = '".$url."'",
50
                'DataObjectOneRecordUpdateURL'
51
            );
52
        }
53
    }
54
55
    public function onerecordform()
56
    {