@@ -21,6 +21,6 @@ |
||
21 | 21 | <pre><?= var_dump($session) ?></pre> |
22 | 22 | |
23 | 23 | <p> |
24 | - <a href="<?= url($mount."session/increment") ?>">Add to session and increment<a> | |
|
25 | - <a href="<?= url($mount."session/destroy") ?>">Destroy session<a> |
|
24 | + <a href="<?= url($mount . "session/increment") ?>">Add to session and increment<a> | |
|
25 | + <a href="<?= url($mount . "session/destroy") ?>">Destroy session<a> |
|
26 | 26 | </p> |
@@ -25,5 +25,5 @@ |
||
25 | 25 | <pre><?= var_dump($session) ?></pre> |
26 | 26 | |
27 | 27 | <p> |
28 | - <a href="<?= url($mount."session") ?>">Back to session<a> |
|
28 | + <a href="<?= url($mount . "session") ?>">Back to session<a> |
|
29 | 29 | </p> |
@@ -16,9 +16,9 @@ |
||
16 | 16 | <p>Here is a set of utilities to use when learning, developing, testing and debugging Anax.</p> |
17 | 17 | |
18 | 18 | <ul> |
19 | - <li><a href="<?= url($mount."di") ?>">DI (show loaded services in $di)</a></li> |
|
20 | - <li><a href="<?= url($mount."request") ?>">Request (show details on current request)</a></li> |
|
21 | - <li><a href="<?= url($mount."router") ?>">Router (show loaded routes)</a></li> |
|
22 | - <li><a href="<?= url($mount."session") ?>">Session (show session data)</a></li> |
|
23 | - <li><a href="<?= url($mount."view") ?>">View (debug and inspect views)</a></li> |
|
19 | + <li><a href="<?= url($mount . "di") ?>">DI (show loaded services in $di)</a></li> |
|
20 | + <li><a href="<?= url($mount . "request") ?>">Request (show details on current request)</a></li> |
|
21 | + <li><a href="<?= url($mount . "router") ?>">Router (show loaded routes)</a></li> |
|
22 | + <li><a href="<?= url($mount . "session") ?>">Session (show session data)</a></li> |
|
23 | + <li><a href="<?= url($mount . "view") ?>">View (debug and inspect views)</a></li> |
|
24 | 24 | </ul> |
@@ -211,7 +211,7 @@ |
||
211 | 211 | $sidebarLeft = regionHasContent("sidebar-left"); |
212 | 212 | $sidebarRight = regionHasContent("sidebar-right"); |
213 | 213 | $class = ""; |
214 | -$class .= $sidebarLeft ? "has-sidebar-left " : ""; |
|
214 | +$class .= $sidebarLeft ? "has-sidebar-left " : ""; |
|
215 | 215 | $class .= $sidebarRight ? "has-sidebar-right " : ""; |
216 | 216 | $class .= empty($class) ? "" : "has-sidebar"; |
217 | 217 | ?> |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | /** |
12 | 12 | * Custom exception handler. |
13 | 13 | */ |
14 | -set_exception_handler(function ($exception) { |
|
14 | +set_exception_handler(function($exception) { |
|
15 | 15 | errorPage( |
16 | 16 | "<p><b>img.php: Uncaught exception:</b> <p>" |
17 | 17 | . $exception->getMessage() |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | * Get configuration options from file, if the file exists, else use $config |
29 | 29 | * if its defined or create an empty $config. |
30 | 30 | */ |
31 | -$configFile = __DIR__.'/'.basename(__FILE__, '.php').'_config.php'; |
|
31 | +$configFile = __DIR__ . '/' . basename(__FILE__, '.php') . '_config.php'; |
|
32 | 32 | |
33 | 33 | if (is_file($configFile)) { |
34 | 34 | $config = require $configFile; |
@@ -404,7 +404,7 @@ discard block |
||
404 | 404 | * Manage size constants from config file, use constants to replace values |
405 | 405 | * for width and height. |
406 | 406 | */ |
407 | -$sizeConstant = getConfig('size_constant', function () { |
|
407 | +$sizeConstant = getConfig('size_constant', function() { |
|
408 | 408 | |
409 | 409 | // Set sizes to map constant to value, easier to use with width or height |
410 | 410 | $sizes = array( |
@@ -440,7 +440,7 @@ discard block |
||
440 | 440 | } |
441 | 441 | |
442 | 442 | // Support width as % of original width |
443 | -if ($newWidth[strlen($newWidth)-1] == '%') { |
|
443 | +if ($newWidth[strlen($newWidth) - 1] == '%') { |
|
444 | 444 | is_numeric(substr($newWidth, 0, -1)) |
445 | 445 | or errorPage('Width % not numeric.', 404); |
446 | 446 | } else { |
@@ -465,7 +465,7 @@ discard block |
||
465 | 465 | } |
466 | 466 | |
467 | 467 | // height |
468 | -if ($newHeight[strlen($newHeight)-1] == '%') { |
|
468 | +if ($newHeight[strlen($newHeight) - 1] == '%') { |
|
469 | 469 | is_numeric(substr($newHeight, 0, -1)) |
470 | 470 | or errorPage('Height % out of range.', 404); |
471 | 471 | } else { |
@@ -482,14 +482,14 @@ discard block |
||
482 | 482 | * aspect-ratio, ar - affecting the resulting image width, height and resize options |
483 | 483 | */ |
484 | 484 | $aspectRatio = get(array('aspect-ratio', 'ar')); |
485 | -$aspectRatioConstant = getConfig('aspect_ratio_constant', function () { |
|
485 | +$aspectRatioConstant = getConfig('aspect_ratio_constant', function() { |
|
486 | 486 | return array( |
487 | - '3:1' => 3/1, |
|
488 | - '3:2' => 3/2, |
|
489 | - '4:3' => 4/3, |
|
490 | - '8:5' => 8/5, |
|
491 | - '16:10' => 16/10, |
|
492 | - '16:9' => 16/9, |
|
487 | + '3:1' => 3 / 1, |
|
488 | + '3:2' => 3 / 2, |
|
489 | + '4:3' => 4 / 3, |
|
490 | + '8:5' => 8 / 5, |
|
491 | + '16:10' => 16 / 10, |
|
492 | + '16:9' => 16 / 9, |
|
493 | 493 | 'golden' => 1.618, |
494 | 494 | ); |
495 | 495 | }); |
@@ -568,7 +568,7 @@ discard block |
||
568 | 568 | if ($fillToFit !== null) { |
569 | 569 | |
570 | 570 | if (!empty($fillToFit)) { |
571 | - $bgColor = $fillToFit; |
|
571 | + $bgColor = $fillToFit; |
|
572 | 572 | verbose("fillToFit changed bgColor to = $bgColor"); |
573 | 573 | } |
574 | 574 |
@@ -61,28 +61,28 @@ |
||
61 | 61 | * |
62 | 62 | * @return boolean true if okey, false if something went wrong. |
63 | 63 | */ |
64 | - public function callbackSubmit() |
|
65 | - { |
|
66 | - // Get values from the submitted form |
|
67 | - $acronym = $this->form->value("acronym"); |
|
68 | - $password = $this->form->value("password"); |
|
69 | - |
|
70 | - // Try to login |
|
71 | - $user = new User(); |
|
72 | - $user->setDb($this->di->get("dbqb")); |
|
73 | - $res = $user->verifyPassword($acronym, $password); |
|
74 | - |
|
75 | - if (!$res) { |
|
64 | + public function callbackSubmit() |
|
65 | + { |
|
66 | + // Get values from the submitted form |
|
67 | + $acronym = $this->form->value("acronym"); |
|
68 | + $password = $this->form->value("password"); |
|
69 | + |
|
70 | + // Try to login |
|
71 | + $user = new User(); |
|
72 | + $user->setDb($this->di->get("dbqb")); |
|
73 | + $res = $user->verifyPassword($acronym, $password); |
|
74 | + |
|
75 | + if (!$res) { |
|
76 | 76 | $this->form->rememberValues(); |
77 | 77 | $this->form->addOutput("User or password did not match."); |
78 | 78 | $this->di->get("session")->delete("acronym"); |
79 | 79 | return false; |
80 | - } |
|
80 | + } |
|
81 | 81 | |
82 | - $this->di->get("session")->set("userId", $user->acronym); |
|
83 | - $this->di->get("session")->set("userName", $acronym); |
|
84 | - return true; |
|
85 | - } |
|
82 | + $this->di->get("session")->set("userId", $user->acronym); |
|
83 | + $this->di->get("session")->set("userName", $acronym); |
|
84 | + return true; |
|
85 | + } |
|
86 | 86 | |
87 | 87 | /** |
88 | 88 | * Redirect for create button |
@@ -71,7 +71,7 @@ |
||
71 | 71 | $password = $this->form->value("password"); |
72 | 72 | $passwordAgain = $this->form->value("password-again"); |
73 | 73 | // Check password matches |
74 | - if ($password !== $passwordAgain ) { |
|
74 | + if ($password !== $passwordAgain) { |
|
75 | 75 | $this->form->rememberValues(); |
76 | 76 | $this->form->addOutput("User or password did not match."); |
77 | 77 | return false; |
@@ -96,7 +96,7 @@ |
||
96 | 96 | $post = new Post(); |
97 | 97 | $post->setDb($this->di->get("dbqb")); |
98 | 98 | $post->find("postId", $this->form->value("postId")); |
99 | - $post->acronym = $this->form->value("acronym"); |
|
99 | + $post->acronym = $this->form->value("acronym"); |
|
100 | 100 | $post->title = $this->form->value("title"); |
101 | 101 | $post->text = $this->form->value("text"); |
102 | 102 | $post->save(); |
@@ -63,7 +63,7 @@ |
||
63 | 63 | { |
64 | 64 | $post = new Post(); |
65 | 65 | $post->setDb($this->di->get("dbqb")); |
66 | - $post->acronym = $this->form->value("acronym"); |
|
66 | + $post->acronym = $this->form->value("acronym"); |
|
67 | 67 | $post->title = $this->form->value("title"); |
68 | 68 | $post->text = $this->form->value("text"); |
69 | 69 | $post->save(); |