@@ -20,7 +20,7 @@ |
||
20 | 20 | { |
21 | 21 | if (Security::getCurrentUser()) { |
22 | 22 | return true; |
23 | - } else { |
|
23 | + }else { |
|
24 | 24 | return Security::permissionFailure($this, _t( |
25 | 25 | 'AccountPage.CANNOTCONFIRMLOGGEDIN', |
26 | 26 | 'Please login to view this page.' |
@@ -329,10 +329,10 @@ discard block |
||
329 | 329 | .'$1', $input); |
330 | 330 | } |
331 | 331 | self::$log[] = '<strong>INPUT:</strong> Code: <strong>'.htmlspecialchars($prefix.$code). |
332 | - '</strong> :: Name: <strong>'.htmlspecialchars($prefix.$name[2]). |
|
333 | - '</strong> :: Value: <strong>'.htmlspecialchars($value[2]). |
|
334 | - '</strong><br />Initial input: '.htmlspecialchars($input). |
|
335 | - '<br />Signed: <span style="color:#060;">'.htmlspecialchars($input_signed).'</span>'; |
|
332 | + '</strong> :: Name: <strong>'.htmlspecialchars($prefix.$name[2]). |
|
333 | + '</strong> :: Value: <strong>'.htmlspecialchars($value[2]). |
|
334 | + '</strong><br />Initial input: '.htmlspecialchars($input). |
|
335 | + '<br />Signed: <span style="color:#060;">'.htmlspecialchars($input_signed).'</span>'; |
|
336 | 336 | $form = str_replace($input, $input_signed, $form); |
337 | 337 | } |
338 | 338 | } |
@@ -373,10 +373,10 @@ discard block |
||
373 | 373 | ); |
374 | 374 | $form_part_signed = str_replace($option[0], $option_signed, $form_part_signed); |
375 | 375 | self::$log[] = '<strong>OPTION:</strong> Code: <strong>'.htmlspecialchars($prefix.$code). |
376 | - '</strong> :: Name: <strong>'.htmlspecialchars($prefix.$list[2]). |
|
377 | - '</strong> :: Value: <strong>'.htmlspecialchars($option[2]). |
|
378 | - '</strong><br />Initial option: '.htmlspecialchars($option[0]). |
|
379 | - '<br />Signed: <span style="color:#060;">'.htmlspecialchars($option_signed).'</span>'; |
|
376 | + '</strong> :: Name: <strong>'.htmlspecialchars($prefix.$list[2]). |
|
377 | + '</strong> :: Value: <strong>'.htmlspecialchars($option[2]). |
|
378 | + '</strong><br />Initial option: '.htmlspecialchars($option[0]). |
|
379 | + '<br />Signed: <span style="color:#060;">'.htmlspecialchars($option_signed).'</span>'; |
|
380 | 380 | } |
381 | 381 | $form = str_replace($list[0], $form_part_signed, $form); |
382 | 382 | } |
@@ -407,10 +407,10 @@ discard block |
||
407 | 407 | ); |
408 | 408 | $form = str_replace($textarea[0], $textarea_signed, $form); |
409 | 409 | self::$log[] = '<strong>TEXTAREA:</strong> Code: <strong>'.htmlspecialchars($prefix.$code). |
410 | - '</strong> :: Name: <strong>'.htmlspecialchars($prefix.$textarea[2]). |
|
411 | - '</strong> :: Value: <strong>'.htmlspecialchars($textarea[3]). |
|
412 | - '</strong><br />Initial textarea: '.htmlspecialchars($textarea[0]). |
|
413 | - '<br />Signed: <span style="color:#060;">'.htmlspecialchars($textarea_signed).'</span>'; |
|
410 | + '</strong> :: Name: <strong>'.htmlspecialchars($prefix.$textarea[2]). |
|
411 | + '</strong> :: Value: <strong>'.htmlspecialchars($textarea[3]). |
|
412 | + '</strong><br />Initial textarea: '.htmlspecialchars($textarea[0]). |
|
413 | + '<br />Signed: <span style="color:#060;">'.htmlspecialchars($textarea_signed).'</span>'; |
|
414 | 414 | } |
415 | 415 | self::$log[] = '<strong>FORM after TEXTAREAS:</strong> <pre>'.htmlspecialchars($form).'</pre>'; |
416 | 416 |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | |
160 | 160 | if ($output) { |
161 | 161 | echo self::$cart_url.'?'.$qs; |
162 | - } else { |
|
162 | + }else { |
|
163 | 163 | return self::$cart_url.'?'.$qs; |
164 | 164 | } |
165 | 165 | } |
@@ -183,18 +183,18 @@ discard block |
||
183 | 183 | if ($option_value == '--OPEN--') { |
184 | 184 | $hash = hash_hmac('sha256', $product_code.$option_name.$option_value, self::getSecret()); |
185 | 185 | $value = ($urlencode) ? urlencode($option_name).'||'.$hash.'||open' : $option_name.'||'.$hash.'||open'; |
186 | - } else { |
|
186 | + }else { |
|
187 | 187 | $hash = hash_hmac('sha256', $product_code.$option_name.$option_value, self::getSecret()); |
188 | 188 | if ($method == 'name') { |
189 | 189 | $value = ($urlencode) ? urlencode($option_name).'||'.$hash : $option_name.'||'.$hash; |
190 | - } else { |
|
190 | + }else { |
|
191 | 191 | $value = ($urlencode) ? urlencode($option_value).'||'.$hash : $option_value.'||'.$hash; |
192 | 192 | } |
193 | 193 | } |
194 | 194 | |
195 | 195 | if ($output) { |
196 | 196 | echo $value; |
197 | - } else { |
|
197 | + }else { |
|
198 | 198 | return $value; |
199 | 199 | } |
200 | 200 | } |
@@ -322,7 +322,7 @@ discard block |
||
322 | 322 | .preg_quote($value[2]).'\1%', '${1}' |
323 | 323 | .self::fc_hash_value($code, $name[2], $value[2], 'value', false) |
324 | 324 | .'$1', $input); |
325 | - } else { |
|
325 | + }else { |
|
326 | 326 | $input_signed = preg_replace('%([\'"])'.$prefix.preg_quote($name[2]) |
327 | 327 | .'\1%', '${1}'.$prefix |
328 | 328 | .self::fc_hash_value($code, $name[2], $value[2], 'name', false) |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | |
216 | 216 | public function testProductDraftOptionDeletion() |
217 | 217 | { |
218 | - self::$use_draft_site = false;//make sure we can publish |
|
218 | + self::$use_draft_site = false; //make sure we can publish |
|
219 | 219 | |
220 | 220 | $this->logInWithPermission('ADMIN'); |
221 | 221 | |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | //build holder page, ProductPage can't be on root level |
224 | 224 | $holder->doPublish(); |
225 | 225 | |
226 | - $product = $this->objFromFixture(ProductPage::class, 'product1');//build product page |
|
226 | + $product = $this->objFromFixture(ProductPage::class, 'product1'); //build product page |
|
227 | 227 | $product->doPublish(); |
228 | 228 | |
229 | 229 | $productID = $product->ID; |
@@ -231,29 +231,29 @@ discard block |
||
231 | 231 | $optionGroup = $this->objFromFixture(OptionGroup::class, 'size'); |
232 | 232 | //build the group for the options |
233 | 233 | $optionGroup->write(); |
234 | - $option = $this->objFromFixture(OptionItem::class, 'small');//build first option |
|
234 | + $option = $this->objFromFixture(OptionItem::class, 'small'); //build first option |
|
235 | 235 | $option->write(); |
236 | - $option2 = $this->objFromFixture(OptionItem::class, 'large');//build second option |
|
236 | + $option2 = $this->objFromFixture(OptionItem::class, 'large'); //build second option |
|
237 | 237 | $option2->write(); |
238 | 238 | |
239 | - $this->assertTrue($product->isPublished());//check that product is published |
|
239 | + $this->assertTrue($product->isPublished()); //check that product is published |
|
240 | 240 | |
241 | - $product->deleteFromStage('Stage');//remove product from draft site |
|
241 | + $product->deleteFromStage('Stage'); //remove product from draft site |
|
242 | 242 | |
243 | - $this->assertTrue($product->isPublished());//check product is still published |
|
243 | + $this->assertTrue($product->isPublished()); //check product is still published |
|
244 | 244 | |
245 | 245 | $testOption = $this->objFromFixture(OptionItem::class, 'large'); |
246 | 246 | |
247 | 247 | $this->assertThat($testOption->ID, $this->logicalNot($this->equalTo(0))); |
248 | 248 | //make sure the first option still exists |
249 | 249 | |
250 | - $product->doRestoreToStage();//restore page to draft site |
|
251 | - $product->doUnpublish();//unpublish page |
|
252 | - $product->deleteFromStage('Stage');//remove product from draft site |
|
250 | + $product->doRestoreToStage(); //restore page to draft site |
|
251 | + $product->doUnpublish(); //unpublish page |
|
252 | + $product->deleteFromStage('Stage'); //remove product from draft site |
|
253 | 253 | |
254 | 254 | $checkDeleted = OptionItem::get()->filter(array('Title' => 'Large', 'ProductID' => $productID))->first(); |
255 | 255 | //query same option as above |
256 | 256 | |
257 | - $this->assertEquals($checkDeleted->ID, 0);//check that the ID is 0 (empty object/non-existent) |
|
257 | + $this->assertEquals($checkDeleted->ID, 0); //check that the ID is 0 (empty object/non-existent) |
|
258 | 258 | } |
259 | 259 | } |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | // Retrieve validator, if one has been setup (e.g. via data extensions). |
89 | 89 | if ($config->hasMethod('getCMSValidator')) { |
90 | 90 | $validator = $config->getCMSValidator(); |
91 | - } else { |
|
91 | + }else { |
|
92 | 92 | $validator = null; |
93 | 93 | } |
94 | 94 | |
@@ -101,13 +101,13 @@ discard block |
||
101 | 101 | $actions, |
102 | 102 | $validator |
103 | 103 | )->setHTMLID('Form_EditForm'); |
104 | - $form->setValidationResponseCallback(function (ValidationResult $errors) use ($negotiator, $form) { |
|
104 | + $form->setValidationResponseCallback(function(ValidationResult $errors) use ($negotiator, $form) { |
|
105 | 105 | $request = $this->getRequest(); |
106 | 106 | if ($request->isAjax() && $negotiator) { |
107 | 107 | $result = $form->forTemplate(); |
108 | 108 | |
109 | 109 | return $negotiator->respond($request, array( |
110 | - 'CurrentForm' => function () use ($result) { |
|
110 | + 'CurrentForm' => function() use ($result) { |
|
111 | 111 | return $result; |
112 | 112 | }, |
113 | 113 | )); |
@@ -332,7 +332,7 @@ discard block |
||
332 | 332 | FormAction::create('save_foxystripe_setting', _t('FoxyStripeSetting.SAVE', 'Save')) |
333 | 333 | ->addExtraClass('btn-primary font-icon-save') |
334 | 334 | ); |
335 | - } else { |
|
335 | + }else { |
|
336 | 336 | $actions = FieldList::create(); |
337 | 337 | } |
338 | 338 | $this->extend('updateCMSActions', $actions); |
@@ -360,7 +360,7 @@ discard block |
||
360 | 360 | } |
361 | 361 | $config->StoreKey = $key; |
362 | 362 | $config->write(); |
363 | - DB::alteration_message('Created FoxyCart Store Key ' . $key, 'created'); |
|
363 | + DB::alteration_message('Created FoxyCart Store Key '.$key, 'created'); |
|
364 | 364 | } |
365 | 365 | } |
366 | 366 | |
@@ -462,7 +462,7 @@ discard block |
||
462 | 462 | */ |
463 | 463 | private static function getSSOLink() |
464 | 464 | { |
465 | - return Director::absoluteBaseURL() . 'foxystripe/sso/'; |
|
465 | + return Director::absoluteBaseURL().'foxystripe/sso/'; |
|
466 | 466 | } |
467 | 467 | |
468 | 468 | /** |
@@ -470,7 +470,7 @@ discard block |
||
470 | 470 | */ |
471 | 471 | private static function getDataFeedLink() |
472 | 472 | { |
473 | - return Director::absoluteBaseURL() . 'foxystripe/'; |
|
473 | + return Director::absoluteBaseURL().'foxystripe/'; |
|
474 | 474 | } |
475 | 475 | |
476 | 476 | /** |
@@ -123,8 +123,7 @@ discard block |
||
123 | 123 | |
124 | 124 | // set variables from Product |
125 | 125 | $productID = ($this->ProductID != 0) ? |
126 | - $this->ProductID : |
|
127 | - Controller::curr()->getRequest()->getSession()->get('CMSMain.currentPage'); |
|
126 | + $this->ProductID : Controller::curr()->getRequest()->getSession()->get('CMSMain.currentPage'); |
|
128 | 127 | |
129 | 128 | /** @var ProductPage $product */ |
130 | 129 | $product = ProductPage::get()->byID($productID); |
@@ -134,7 +133,7 @@ discard block |
||
134 | 133 | $parentCode = $product->Code; |
135 | 134 | |
136 | 135 | // ProductOptionGroup Dropdown field w/ add new |
137 | - $groups = function () { |
|
136 | + $groups = function() { |
|
138 | 137 | return OptionGroup::get()->map()->toArray(); |
139 | 138 | }; |
140 | 139 | $groupFields = singleton(OptionGroup::class)->getCMSFields(); |
@@ -344,9 +343,9 @@ discard block |
||
344 | 343 | */ |
345 | 344 | public function getGeneratedValue() |
346 | 345 | { |
347 | - $modPrice = ($this->PriceModifier) ? (string) $this->PriceModifier : '0'; |
|
346 | + $modPrice = ($this->PriceModifier) ? (string)$this->PriceModifier : '0'; |
|
348 | 347 | $modPriceWithSymbol = self::getOptionModifierActionSymbol($this->PriceModifierAction).$modPrice; |
349 | - $modWeight = ($this->WeightModifier) ? (string) $this->WeightModifier : '0'; |
|
348 | + $modWeight = ($this->WeightModifier) ? (string)$this->WeightModifier : '0'; |
|
350 | 349 | $modWeight = self::getOptionModifierActionSymbol($this->WeightModifierAction).$modWeight; |
351 | 350 | $modCode = self::getOptionModifierActionSymbol($this->CodeModifierAction).$this->CodeModifier; |
352 | 351 | |
@@ -358,14 +357,13 @@ discard block |
||
358 | 357 | */ |
359 | 358 | public function getGeneratedTitle() |
360 | 359 | { |
361 | - $modPrice = ($this->PriceModifier) ? (string) $this->PriceModifier : '0'; |
|
360 | + $modPrice = ($this->PriceModifier) ? (string)$this->PriceModifier : '0'; |
|
362 | 361 | $title = $this->Title; |
363 | 362 | $title .= ($this->PriceModifier != 0) ? |
364 | 363 | ': ('.self::getOptionModifierActionSymbol( |
365 | 364 | $this->PriceModifierAction, |
366 | 365 | $returnWithOnlyPlusMinus = true |
367 | - ).'$'.$modPrice.')' : |
|
368 | - ''; |
|
366 | + ).'$'.$modPrice.')' : ''; |
|
369 | 367 | |
370 | 368 | return $title; |
371 | 369 | } |
@@ -18,7 +18,7 @@ |
||
18 | 18 | |
19 | 19 | if ($config->EnableSidecart) { |
20 | 20 | Requirements::javascript( |
21 | - "https://cdn.foxycart.com/" . FoxyCart::getFoxyCartStoreName() . "/loader.js", |
|
21 | + "https://cdn.foxycart.com/".FoxyCart::getFoxyCartStoreName()."/loader.js", |
|
22 | 22 | [ |
23 | 23 | "async" => true, |
24 | 24 | "defer" => true, |
@@ -226,9 +226,9 @@ discard block |
||
226 | 226 | */ |
227 | 227 | public function getCMSFields() |
228 | 228 | { |
229 | - $this->beforeUpdateCMSFields(function (FieldList $fields) { |
|
229 | + $this->beforeUpdateCMSFields(function(FieldList $fields) { |
|
230 | 230 | // Cateogry Dropdown field w/ add new |
231 | - $source = function () { |
|
231 | + $source = function() { |
|
232 | 232 | return ProductCategory::get()->map()->toArray(); |
233 | 233 | }; |
234 | 234 | $catField = DropdownField::create('CategoryID', _t('ProductPage.Category', 'FoxyCart Category'), $source()) |
@@ -368,7 +368,7 @@ discard block |
||
368 | 368 | $product = self::get()->byID($this->ID); |
369 | 369 | if (isset($product->ParentID)) { |
370 | 370 | $origParent = $product->ParentID; |
371 | - } else { |
|
371 | + }else { |
|
372 | 372 | $origParent = null; |
373 | 373 | } |
374 | 374 | $currentParent = $this->ParentID; |
@@ -448,8 +448,7 @@ discard block |
||
448 | 448 | $optionName = ($optionName !== null) ? preg_replace('/\s/', '_', $optionName) : $optionName; |
449 | 449 | |
450 | 450 | return (FoxyStripeSetting::current_foxystripe_setting()->CartValidation) |
451 | - ? \FoxyCart_Helper::fc_hash_value($productCode, $optionName, $optionValue, $method, $output, $urlEncode) : |
|
452 | - $optionValue; |
|
451 | + ? \FoxyCart_Helper::fc_hash_value($productCode, $optionName, $optionValue, $method, $output, $urlEncode) : $optionValue; |
|
453 | 452 | } |
454 | 453 | |
455 | 454 | /** |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | { |
36 | 36 | $rules = Director::config()->get('rules'); |
37 | 37 | $rule = array_search(FoxyStripeController::class, $rules); |
38 | - $myURL = Director::absoluteBaseURL() . explode('//', $rule)[0]; |
|
38 | + $myURL = Director::absoluteBaseURL().explode('//', $rule)[0]; |
|
39 | 39 | $myKey = FoxyCart::getStoreKey(); |
40 | 40 | |
41 | 41 | $this->updateConfig(); |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | $email = $emails[count($emails) - 1]; |
123 | 123 | return preg_replace_callback( |
124 | 124 | "|(\d+)|", |
125 | - function ($mathces) { |
|
125 | + function($mathces) { |
|
126 | 126 | return ++$mathces[1]; |
127 | 127 | }, |
128 | 128 |