Completed
Pull Request — master (#12)
by Matthew
11:11
created
src/Extensions/ManageableDataObjectExtension.php 2 patches
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -52,9 +52,9 @@  discard block
 block discarded – undo
52 52
         }
53 53
 
54 54
         return Security::permissionFailure(
55
-        	$this->owner,
56
-			"You don't have permission to add records."
57
-		);
55
+            $this->owner,
56
+            "You don't have permission to add records."
57
+        );
58 58
     }
59 59
 
60 60
     /**
@@ -78,9 +78,9 @@  discard block
 block discarded – undo
78 78
             }
79 79
 
80 80
             return Security::permissionFailure(
81
-            	$this->owner,
82
-				"You don't have permission to edit this record."
83
-			);
81
+                $this->owner,
82
+                "You don't have permission to edit this record."
83
+            );
84 84
         }
85 85
 
86 86
         return $this->owner->httpError(404);
@@ -105,9 +105,9 @@  discard block
 block discarded – undo
105 105
             }
106 106
 
107 107
             return Security::permissionFailure(
108
-            	$this->owner,
109
-				"You don't have permission to delete this record."
110
-			);
108
+                $this->owner,
109
+                "You don't have permission to delete this record."
110
+            );
111 111
         }
112 112
 
113 113
         return $this->owner->httpError(404);
@@ -144,18 +144,18 @@  discard block
 block discarded – undo
144 144
         return $form;
145 145
     }
146 146
 
147
-	/**
148
-	 * Save object
149
-	 *
150
-	 * @param $data
151
-	 * @param Form $form
152
-	 *
153
-	 * @return \SilverStripe\Control\HTTPResponse
154
-	 * @throws \SilverStripe\ORM\ValidationException
155
-	 */
147
+    /**
148
+     * Save object
149
+     *
150
+     * @param $data
151
+     * @param Form $form
152
+     *
153
+     * @return \SilverStripe\Control\HTTPResponse
154
+     * @throws \SilverStripe\ORM\ValidationException
155
+     */
156 156
     public function doSaveObject($data, Form $form)
157 157
     {
158
-		/** @var \SilverStripe\ORM\DataObject $model */
158
+        /** @var \SilverStripe\ORM\DataObject $model */
159 159
         $model = $this->owner->config()->get('managed_object');
160 160
 
161 161
         /** @var \SilverStripe\ORM\DataObject|\Dynamic\ViewableDataObject\Extensions\ViewableDataObject $object */
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
             $object = $model::create();
169 169
             if ($object->hasDatabaseField('URLSegment')) {
170 170
                 $object->URLSegment = Injector::inst()->create(SiteTree::class)
171
-					->generateURLSegment($data['Title']);
171
+                    ->generateURLSegment($data['Title']);
172 172
             }
173 173
             // write on create to relations are saved on final write (needs ID)
174 174
             $object->write();
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -39,14 +39,14 @@  discard block
 block discarded – undo
39 39
         if ($object->canCreate(Security::getCurrentUser())) {
40 40
 
41 41
             $form = $this->ManageableDataObjectForm();
42
-            if($object->config()->get('add_form_cancel_button')){
42
+            if ($object->config()->get('add_form_cancel_button')) {
43 43
                 $form->Actions()->push(new CancelFormAction($this->owner->Link(), 'Cancel'));
44 44
             }
45 45
 
46 46
             return $this->owner->customise([
47 47
                 'Title' => ($this->owner->config()->get('add_item_title'))
48 48
                     ? $this->owner->config()->get('add_item_title')
49
-                    : 'Add new ' . $object->singular_name(),
49
+                    : 'Add new '.$object->singular_name(),
50 50
                 'ManageableDataObjectForm' => $form,
51 51
             ]);
52 52
         }
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
                 $form = $this->ManageableDataObjectForm($item);
72 72
 
73 73
                 return $this->owner->customise([
74
-                    'Title' => 'Edit ' . $item->singular_name(),
74
+                    'Title' => 'Edit '.$item->singular_name(),
75 75
                     'ManageableDataObjectForm' => $form,
76 76
                     'Item' => $item,
77 77
                 ]);
Please login to merge, or discard this patch.
src/Form/ManageableDataObjectForm.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
             $object = Injector::inst()->get($object);
27 27
         }
28 28
 
29
-		/** @var \SilverStripe\ORM\DataObject|\Dynamic\ManageableDataObject\Interfaces\ManageableDataObjectInterface $object */
29
+        /** @var \SilverStripe\ORM\DataObject|\Dynamic\ManageableDataObject\Interfaces\ManageableDataObjectInterface $object */
30 30
         $fields = $object->getFrontEndFields();
31 31
         $actions = $object->getFrontEndActions();
32 32
         if (!$actions->dataFieldByName('action_doSaveObject')) {
Please login to merge, or discard this patch.