@@ -34,8 +34,8 @@ |
||
| 34 | 34 | $I->wantTo('login to admin'); |
| 35 | 35 | $I->amOnPage('admin/'); |
| 36 | 36 | $I->seeInCurrentUrl('admin/'); |
| 37 | - $I->fillField('username','tester'); |
|
| 38 | - $I->fillField('password','tester'); |
|
| 37 | + $I->fillField('username', 'tester'); |
|
| 38 | + $I->fillField('password', 'tester'); |
|
| 39 | 39 | $I->checkOption('persistent'); |
| 40 | 40 | $I->click('Přihlásit', '#content'); |
| 41 | 41 | $I->see('Úvod'); |
@@ -41,8 +41,8 @@ |
||
| 41 | 41 | { |
| 42 | 42 | $I->amOnPage('admin/'); |
| 43 | 43 | $I->seeInCurrentUrl('admin/'); |
| 44 | - $I->fillField('username','tester'); |
|
| 45 | - $I->fillField('password','tester'); |
|
| 44 | + $I->fillField('username', 'tester'); |
|
| 45 | + $I->fillField('password', 'tester'); |
|
| 46 | 46 | $I->checkOption('persistent'); |
| 47 | 47 | $I->click('Přihlásit', '#content'); |
| 48 | 48 | $I->see('Úvod'); |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | $I->see('úprava bloku'); |
| 43 | 43 | $I->click('Náhled anotace', '#content'); |
| 44 | 44 | $I->seeInCurrentUrl('/srazvs/block/annotation/382ff1c792c7980aa0b1950259a518e8'); |
| 45 | - foreach ($this->annotationBlock['fields'] as $field => $value) { |
|
| 45 | + foreach($this->annotationBlock['fields'] as $field => $value) { |
|
| 46 | 46 | $I->seeInField($field, $value); |
| 47 | 47 | } |
| 48 | 48 | } |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | $I->see('úprava programu'); |
| 56 | 56 | $I->click('Náhled anotace', '#content'); |
| 57 | 57 | $I->seeInCurrentUrl('/srazvs/program/annotation/524888c93f896f388d563f68682cf41c'); |
| 58 | - foreach ($this->annotationProgram['fields'] as $field => $value) { |
|
| 58 | + foreach($this->annotationProgram['fields'] as $field => $value) { |
|
| 59 | 59 | $I->seeInField($field, $value); |
| 60 | 60 | } |
| 61 | 61 | } |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | { |
| 65 | 65 | $I->wantTo('Ensure that blocks annotation is accesible by public'); |
| 66 | 66 | $I->amOnPage('/srazvs/block/annotation/382ff1c792c7980aa0b1950259a518e8'); |
| 67 | - foreach ($this->annotationBlock['fields'] as $field => $value) { |
|
| 67 | + foreach($this->annotationBlock['fields'] as $field => $value) { |
|
| 68 | 68 | $I->seeInField($field, $value); |
| 69 | 69 | } |
| 70 | 70 | } |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | { |
| 74 | 74 | $I->wantTo('Ensure that programs annotation is accesible by public'); |
| 75 | 75 | $I->amOnPage('/srazvs/program/annotation/524888c93f896f388d563f68682cf41c'); |
| 76 | - foreach ($this->annotationProgram['fields'] as $field => $value) { |
|
| 76 | + foreach($this->annotationProgram['fields'] as $field => $value) { |
|
| 77 | 77 | $I->seeInField($field, $value); |
| 78 | 78 | } |
| 79 | 79 | } |
@@ -30,14 +30,14 @@ discard block |
||
| 30 | 30 | public function __construct(array $configuration) |
| 31 | 31 | { |
| 32 | 32 | $this->encoding = $configuration['encoding']; |
| 33 | - $this->paperFormat = $configuration['paperFormat']; |
|
| 33 | + $this->paperFormat = $configuration['paperFormat']; |
|
| 34 | 34 | $this->fontSize = $configuration['fontSize']; |
| 35 | - $this->font = $configuration['font']; |
|
| 36 | - $this->marginLeft = $configuration['marginLeft']; |
|
| 35 | + $this->font = $configuration['font']; |
|
| 36 | + $this->marginLeft = $configuration['marginLeft']; |
|
| 37 | 37 | $this->marginRight = $configuration['marginRight']; |
| 38 | - $this->marginTop = $configuration['marginTop']; |
|
| 38 | + $this->marginTop = $configuration['marginTop']; |
|
| 39 | 39 | $this->marginBottom = $configuration['marginBottom']; |
| 40 | - $this->debugMode = $configuration['debugMode']; |
|
| 40 | + $this->debugMode = $configuration['debugMode']; |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | /** |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | ); |
| 60 | 60 | |
| 61 | 61 | // debugging on demand |
| 62 | - if($this->debugMode){ |
|
| 62 | + if($this->debugMode) { |
|
| 63 | 63 | $this->pdf->debug = true; |
| 64 | 64 | } |
| 65 | 65 | $this->pdf->useOnlyCoreFonts = true; |
@@ -76,9 +76,9 @@ discard block |
||
| 76 | 76 | */ |
| 77 | 77 | public function setMargins($left, $right, $top, $bottom) |
| 78 | 78 | { |
| 79 | - $this->marginLeft = $left; |
|
| 79 | + $this->marginLeft = $left; |
|
| 80 | 80 | $this->marginRight = $right; |
| 81 | - $this->marginTop = $top; |
|
| 81 | + $this->marginTop = $top; |
|
| 82 | 82 | $this->marginBottom = $bottom; |
| 83 | 83 | } |
| 84 | 84 | |
@@ -28,10 +28,10 @@ |
||
| 28 | 28 | //var_dump($configuration); |
| 29 | 29 | //exit; |
| 30 | 30 | $this->creator = $configuration['creator']; |
| 31 | - $this->lastModifiedBy = $configuration['lastModifiedBy']; |
|
| 32 | - $this->title = $configuration['title']; |
|
| 31 | + $this->lastModifiedBy = $configuration['lastModifiedBy']; |
|
| 32 | + $this->title = $configuration['title']; |
|
| 33 | 33 | $this->subject = $configuration['subject']; |
| 34 | - $this->description = $configuration['description']; |
|
| 34 | + $this->description = $configuration['description']; |
|
| 35 | 35 | $this->keywords = $configuration['keywords']; |
| 36 | 36 | $this->category = $configuration['category']; |
| 37 | 37 | } |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | session_unset(); |
| 15 | 15 | session_destroy(); |
| 16 | 16 | //a presmeruji na homepage |
| 17 | - header("Location: ".HTTP_DIR."login.php"); |
|
| 17 | + header("Location: " . HTTP_DIR . "login.php"); |
|
| 18 | 18 | //ukoncim |
| 19 | 19 | exit; |
| 20 | 20 | } |
@@ -25,13 +25,13 @@ discard block |
||
| 25 | 25 | $nologin = true; |
| 26 | 26 | //dd(isset($_SESSION) && (!isset($_SESSION[SESSION_PREFIX.'user'])) || !isset($_SESSION[SESSION_PREFIX.'password'])); |
| 27 | 27 | //kontrola casove existence session a delky jeji necinnosti |
| 28 | -if(isset($_SESSION) && (!isset($_SESSION[SESSION_PREFIX.'user']) || !isset($_SESSION[SESSION_PREFIX.'password']))) { |
|
| 28 | +if(isset($_SESSION) && (!isset($_SESSION[SESSION_PREFIX . 'user']) || !isset($_SESSION[SESSION_PREFIX . 'password']))) { |
|
| 29 | 29 | $_SESSION['user']["logged"] = false; |
| 30 | 30 | session_unset(); |
| 31 | 31 | if(session_id()) { |
| 32 | 32 | session_destroy(); |
| 33 | 33 | } |
| 34 | - header("Location: ".HTTP_DIR."admin/"); |
|
| 34 | + header("Location: " . HTTP_DIR . "admin/"); |
|
| 35 | 35 | exit('Session Not Exists'); |
| 36 | 36 | } |
| 37 | 37 | else $_SESSION['user']["logged"] = true; |
@@ -41,10 +41,10 @@ discard block |
||
| 41 | 41 | if(!isset($database)) { |
| 42 | 42 | $database = $this->database; |
| 43 | 43 | } |
| 44 | - $user = $database->table('sunlight-users')->where('id', $_SESSION[SESSION_PREFIX.'user'])->fetch(); |
|
| 44 | + $user = $database->table('sunlight-users')->where('id', $_SESSION[SESSION_PREFIX . 'user'])->fetch(); |
|
| 45 | 45 | |
| 46 | 46 | if($user) { |
| 47 | - if($_SESSION[SESSION_PREFIX.'password'] != $user['password']) { |
|
| 47 | + if($_SESSION[SESSION_PREFIX . 'password'] != $user['password']) { |
|
| 48 | 48 | Tracy\Debugger::log('Access: bad password!', Tracy\Debugger::ERROR); |
| 49 | 49 | } |
| 50 | 50 | else { |
@@ -53,10 +53,10 @@ discard block |
||
| 53 | 53 | $_SESSION['user']['access_time'] = time(); |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | - $uid = $_SESSION[SESSION_PREFIX.'user']; |
|
| 56 | + $uid = $_SESSION[SESSION_PREFIX . 'user']; |
|
| 57 | 57 | // 20 slunda || 19 dytta || 7 pavlik || 105 liska || 21 Pumpa || 155 jantikjanouch || 165 OVAMysak || 46 Luca || 2 hvezdar || 178 cednik || 182 tester || 179 koblizek |
| 58 | - if(($uid != 19) && ($uid != 7) && ($uid != 105) && ($uid != 21) && ($uid != 20) && ($uid != 155) && ($uid != 165) && ($uid != 46) && ($uid != 2) && ($uid != 13) && ($uid != 178) && ($uid != 182) && ($uid != 179)){ |
|
| 59 | - header("Location: ".HTTP_DIR."admin/"); |
|
| 58 | + if(($uid != 19) && ($uid != 7) && ($uid != 105) && ($uid != 21) && ($uid != 20) && ($uid != 155) && ($uid != 165) && ($uid != 46) && ($uid != 2) && ($uid != 13) && ($uid != 178) && ($uid != 182) && ($uid != 179)) { |
|
| 59 | + header("Location: " . HTTP_DIR . "admin/"); |
|
| 60 | 60 | } |
| 61 | 61 | } else { |
| 62 | 62 | Tracy\Debugger::log('Access: user data does not exist!', Tracy\Debugger::ERROR); |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | else { |
| 66 | 66 | session_unset(); |
| 67 | 67 | session_destroy(); |
| 68 | - header("Location: ".HTTP_DIR."admin/"); |
|
| 68 | + header("Location: " . HTTP_DIR . "admin/"); |
|
| 69 | 69 | exit('User Is Not Logged'); |
| 70 | 70 | } |
| 71 | 71 | |
@@ -8,7 +8,7 @@ |
||
| 8 | 8 | * @return void |
| 9 | 9 | */ |
| 10 | 10 | function dd() { |
| 11 | - array_map(function ($x){ |
|
| 11 | + array_map(function($x) { |
|
| 12 | 12 | (\Tracy\Debugger::dump($x)); |
| 13 | 13 | }, func_get_args()); |
| 14 | 14 | |
@@ -25,13 +25,13 @@ |
||
| 25 | 25 | { |
| 26 | 26 | $exception = $request->getParameter('exception'); |
| 27 | 27 | |
| 28 | - if ($exception instanceof Nette\Application\BadRequestException) { |
|
| 29 | - list($module, , $sep) = Nette\Application\Helpers::splitName($request->getPresenterName()); |
|
| 28 | + if($exception instanceof Nette\Application\BadRequestException) { |
|
| 29 | + list($module,, $sep) = Nette\Application\Helpers::splitName($request->getPresenterName()); |
|
| 30 | 30 | return new Responses\ForwardResponse($request->setPresenterName($module . $sep . 'Error4xx')); |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | $this->logger->log($exception, ILogger::EXCEPTION); |
| 34 | - return new Responses\CallbackResponse(function () { |
|
| 34 | + return new Responses\CallbackResponse(function() { |
|
| 35 | 35 | require __DIR__ . '/templates/Error/500.phtml'; |
| 36 | 36 | }); |
| 37 | 37 | } |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | ]; |
| 49 | 49 | |
| 50 | 50 | protected $hours = [ |
| 51 | - 0 => "00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23" |
|
| 51 | + 0 => "00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23" |
|
| 52 | 52 | ]; |
| 53 | 53 | |
| 54 | 54 | protected $minutes = [ |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | $this->setBacklink($backlink); |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | - if($meetingId){ |
|
| 83 | + if($meetingId) { |
|
| 84 | 84 | $_SESSION['meetingID'] = $meetingId; |
| 85 | 85 | } elseif(!isset($_SESSION['meetingID'])) { |
| 86 | 86 | $meeting = $this->getContainer()->getService('meeting'); |
@@ -121,16 +121,16 @@ discard block |
||
| 121 | 121 | $template->expDir = EXP_DIR; |
| 122 | 122 | $template->meetDir = MEET_DIR; |
| 123 | 123 | |
| 124 | - $template->categories = $this->remember('categories:all', 10, function () { |
|
| 124 | + $template->categories = $this->remember('categories:all', 10, function() { |
|
| 125 | 125 | return $this->getContainer()->getService('category')->all(); |
| 126 | 126 | }); |
| 127 | 127 | |
| 128 | - if(isset($_SESSION[SESSION_PREFIX.'user'])) { |
|
| 129 | - $template->user = $this->getSunlight()->findUser($_SESSION[SESSION_PREFIX.'user']); |
|
| 128 | + if(isset($_SESSION[SESSION_PREFIX . 'user'])) { |
|
| 129 | + $template->user = $this->getSunlight()->findUser($_SESSION[SESSION_PREFIX . 'user']); |
|
| 130 | 130 | } |
| 131 | 131 | $template->meeting = $meeting->getPlaceAndYear($_SESSION['meetingID']); |
| 132 | 132 | $template->menuItems = $meeting->getMenuItems(); |
| 133 | - $template->meeting_heading = $meeting->getRegHeading(); |
|
| 133 | + $template->meeting_heading = $meeting->getRegHeading(); |
|
| 134 | 134 | $template->meetingId = $this->getMeetingId(); |
| 135 | 135 | $template->backlinkUrl = $this->getBacklinkUrl(); |
| 136 | 136 | $template->backlink = $this->getBacklink(); |
@@ -221,7 +221,7 @@ discard block |
||
| 221 | 221 | } else { |
| 222 | 222 | $checked = ''; |
| 223 | 223 | } |
| 224 | - $html_checkbox = "<input name='".$name."' type='checkbox' value='".$value."' ".$checked." />"; |
|
| 224 | + $html_checkbox = "<input name='" . $name . "' type='checkbox' value='" . $value . "' " . $checked . " />"; |
|
| 225 | 225 | |
| 226 | 226 | return $html_checkbox; |
| 227 | 227 | } |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | $names = explode(',', $item->tutor); |
| 233 | 233 | |
| 234 | 234 | $i = 0; |
| 235 | - foreach ($mails as $mail) { |
|
| 235 | + foreach($mails as $mail) { |
|
| 236 | 236 | $mail = trim($mail); |
| 237 | 237 | $name = trim($names[$i]); |
| 238 | 238 | |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | // zaheshovane udaje, aby se nedali jen tak ziskat data z databaze |
| 246 | 246 | protected function formKeyHash($id, $meetingId) |
| 247 | 247 | { |
| 248 | - return ((int)$id . $meetingId) * 116 + 39147; |
|
| 248 | + return ((int) $id . $meetingId) * 116 + 39147; |
|
| 249 | 249 | } |
| 250 | 250 | |
| 251 | 251 | /** |
@@ -411,12 +411,12 @@ discard block |
||
| 411 | 411 | // If the item exists in the cache we will just return this immediately |
| 412 | 412 | // otherwise we will execute the given Closure and cache the result |
| 413 | 413 | // of that execution for the given number of minutes in storage. |
| 414 | - if (! is_null($data = $this->getCache()->load($key))) { |
|
| 414 | + if(!is_null($data = $this->getCache()->load($key))) { |
|
| 415 | 415 | $items = []; |
| 416 | 416 | |
| 417 | 417 | foreach($data as $item) { |
| 418 | 418 | $object = new \stdClass(); |
| 419 | - foreach ($item as $key => $value) { |
|
| 419 | + foreach($item as $key => $value) { |
|
| 420 | 420 | $object->$key = $value; |
| 421 | 421 | } |
| 422 | 422 | $items[] = $object; |
@@ -427,7 +427,7 @@ discard block |
||
| 427 | 427 | |
| 428 | 428 | $data = $callback(); |
| 429 | 429 | $serialized = []; |
| 430 | - foreach ($data as $item) { |
|
| 430 | + foreach($data as $item) { |
|
| 431 | 431 | $serialized[] = $item->toArray(); |
| 432 | 432 | } |
| 433 | 433 | |