Code Duplication    Length = 33-33 lines in 2 locations

src/Form/Field/BelongsToRelation.php 1 location

@@ 68-100 (lines=33) @@
65
    /**
66
     * @return $this
67
     */
68
    public function addHtml()
69
    {
70
        $trans = [
71
            'choose' => admin_trans('admin.choose'),
72
            'cancal' => admin_trans('admin.cancel'),
73
            'submit' => admin_trans('admin.submit'),
74
        ];
75
76
        $html = <<<HTML
77
<div class="modal fade" id="{$this->modalID}" tabindex="-1" role="dialog">
78
  <div class="modal-dialog modal-lg" role="document">
79
    <div class="modal-content" style="border-radius: 5px;">
80
      <div class="modal-header">
81
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
82
            <span aria-hidden="true">&times;</span>
83
        </button>
84
        <h4 class="modal-title">{$trans['choose']}</h4>
85
      </div>
86
      <div class="modal-body">
87
        <i class="fa fa-spinner fa-pulse fa-3x fa-fw"></i>
88
      </div>
89
      <div class="modal-footer">
90
        <button type="button" class="btn btn-default" data-dismiss="modal">{$trans['cancal']}</button>
91
        <button type="button" class="btn btn-primary submit">{$trans['submit']}</button>
92
      </div>
93
    </div>
94
  </div>
95
</div>
96
HTML;
97
        Admin::html($html);
98
99
        return $this;
100
    }
101
102
    /**
103
     * @return $this

src/Grid/Displayers/BelongsToRelation.php 1 location

@@ 39-71 (lines=33) @@
36
    /**
37
     * @return $this
38
     */
39
    public function addHtml()
40
    {
41
        $trans = [
42
            'choose' => admin_trans('admin.choose'),
43
            'cancal' => admin_trans('admin.cancel'),
44
            'submit' => admin_trans('admin.submit'),
45
        ];
46
47
        $html = <<<HTML
48
<div class="modal fade" id="{$this->modalID}" tabindex="-1" role="dialog">
49
  <div class="modal-dialog modal-lg" role="document">
50
    <div class="modal-content" style="border-radius: 5px;">
51
      <div class="modal-header">
52
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
53
            <span aria-hidden="true">&times;</span>
54
        </button>
55
        <h4 class="modal-title">{$trans['choose']}</h4>
56
      </div>
57
      <div class="modal-body">
58
        <i class="fa fa-spinner fa-pulse fa-3x fa-fw"></i>
59
      </div>
60
      <div class="modal-footer">
61
        <button type="button" class="btn btn-default" data-dismiss="modal">{$trans['cancal']}</button>
62
        <button type="button" class="btn btn-primary submit">{$trans['submit']}</button>
63
      </div>
64
    </div>
65
  </div>
66
</div>
67
HTML;
68
        Admin::html($html);
69
70
        return $this;
71
    }
72
73
    /**
74
     * @return $this