@@ -91,7 +91,7 @@ |
||
| 91 | 91 | * return the entire session superglobal. mainly for debugging purposes |
| 92 | 92 | * @return mixed |
| 93 | 93 | */ |
| 94 | - public function getAllSessionVars(){ |
|
| 94 | + public function getAllSessionVars() { |
|
| 95 | 95 | return $_SESSION; |
| 96 | 96 | } |
| 97 | 97 | |
@@ -36,7 +36,7 @@ |
||
| 36 | 36 | } |
| 37 | 37 | if ($success) { |
| 38 | 38 | $this->alertBox->setAlert('Configuration updates successfully'); |
| 39 | - } else { |
|
| 39 | + }else { |
|
| 40 | 40 | $this->alertBox->setAlert('error in configuration update', 'error'); |
| 41 | 41 | } |
| 42 | 42 | $this->container->getResponse()->redirect('admin/config'); |
@@ -38,7 +38,7 @@ |
||
| 38 | 38 | if (!$configModel->updateConfig($update->name, $update->value)) { |
| 39 | 39 | $result['success'] = false; |
| 40 | 40 | $result['errorId'][] = $update->name; |
| 41 | - } else { |
|
| 41 | + }else { |
|
| 42 | 42 | $result['successId'][] = $update->name; |
| 43 | 43 | } |
| 44 | 44 | } |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | { |
| 25 | 25 | $this->session->set('user_role_name', 'Admin'); |
| 26 | 26 | $this->session->set('user_role_level', 2); |
| 27 | - $this->session->set('user_id',1); |
|
| 27 | + $this->session->set('user_id', 1); |
|
| 28 | 28 | $this->alertBox->setAlert('Connected as admin'); |
| 29 | 29 | $this->container->getResponse()->redirect('/admin/'); |
| 30 | 30 | } |
@@ -21,11 +21,11 @@ discard block |
||
| 21 | 21 | { |
| 22 | 22 | |
| 23 | 23 | if (!$this->isAlphaNum($table)) { |
| 24 | - throw new \ErrorException("Invalid table name " . $table); |
|
| 24 | + throw new \ErrorException("Invalid table name ".$table); |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | if (!$this->isAlphaNum($columnName)) { |
| 28 | - throw new \ErrorException("Invalid Column name " . $columnName); |
|
| 28 | + throw new \ErrorException("Invalid Column name ".$columnName); |
|
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | $slugTbl = $this->getTablePrefix($table); |
@@ -49,15 +49,15 @@ discard block |
||
| 49 | 49 | public function getIdFromSlug(string $slug, string $table, string $columnName, string $idColumn): int |
| 50 | 50 | { |
| 51 | 51 | if (!$this->isAlphaNum($table)) { |
| 52 | - throw new \ErrorException("Invalid table name " . $table); |
|
| 52 | + throw new \ErrorException("Invalid table name ".$table); |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | if (!$this->isAlphaNum($columnName)) { |
| 56 | - throw new \ErrorException("Invalid Slug Column name " . $columnName); |
|
| 56 | + throw new \ErrorException("Invalid Slug Column name ".$columnName); |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | if (!$this->isAlphaNum($idColumn)) { |
| 60 | - throw new \ErrorException("Invalid ID Column name " . $columnName); |
|
| 60 | + throw new \ErrorException("Invalid ID Column name ".$columnName); |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | $slugTbl = $this->getTablePrefix($table); |
@@ -85,15 +85,15 @@ discard block |
||
| 85 | 85 | public function getSlugFromId(int $searchId, string $table, string $columnName, string $slugColumn): string |
| 86 | 86 | { |
| 87 | 87 | if (!$this->isAlphaNum($table)) { |
| 88 | - throw new \ErrorException("Invalid table name " . $table); |
|
| 88 | + throw new \ErrorException("Invalid table name ".$table); |
|
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | if (!$this->isAlphaNum($columnName)) { |
| 92 | - throw new \ErrorException("Invalid Slug Column name " . $columnName); |
|
| 92 | + throw new \ErrorException("Invalid Slug Column name ".$columnName); |
|
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | if (!$this->isAlphaNum($slugColumn)) { |
| 96 | - throw new \ErrorException("Invalid ID Column name " . $columnName); |
|
| 96 | + throw new \ErrorException("Invalid ID Column name ".$columnName); |
|
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | $slugTbl = $this->getTablePrefix($table); |
@@ -7,7 +7,7 @@ |
||
| 7 | 7 | use Core\Controller; |
| 8 | 8 | use Core\Container; |
| 9 | 9 | |
| 10 | -class Author extends Controller{ |
|
| 10 | +class Author extends Controller { |
|
| 11 | 11 | |
| 12 | 12 | |
| 13 | 13 | protected $siteConfig; |
@@ -6,7 +6,7 @@ |
||
| 6 | 6 | use Core\Controller; |
| 7 | 7 | use Core\Container; |
| 8 | 8 | |
| 9 | -class Tag extends Controller{ |
|
| 9 | +class Tag extends Controller { |
|
| 10 | 10 | |
| 11 | 11 | protected $siteConfig; |
| 12 | 12 | protected $pagination; |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | |
| 85 | 85 | //Searching for the page break tag |
| 86 | 86 | $breakTagPosition = strpos($text, "<!-- EndOfExcerptBlogOc -->"); |
| 87 | - if($breakTagPosition > 0){ |
|
| 87 | + if ($breakTagPosition > 0) { |
|
| 88 | 88 | return $this->completeDom(substr($text, 0, $breakTagPosition)); |
| 89 | 89 | } |
| 90 | 90 | |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | $string = preg_split('/(<img[^>]+\>)|(<p[^>]+\>)|(<span[^>]+\>)|\s/', $text, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE); |
| 93 | 93 | |
| 94 | 94 | //The preg split can return false, probably will never happen but just in case. |
| 95 | - if(!$string) |
|
| 95 | + if (!$string) |
|
| 96 | 96 | { |
| 97 | 97 | throw new \Error("excerpt generation failed"); |
| 98 | 98 | } |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | $trimed .= $string[$wordCounter]; |
| 106 | 106 | if ($wordCounter < $count - 1) { |
| 107 | 107 | $trimed .= " "; |
| 108 | - } else { |
|
| 108 | + }else { |
|
| 109 | 109 | $trimed .= "[...]"; |
| 110 | 110 | } |
| 111 | 111 | } |
@@ -43,13 +43,13 @@ discard block |
||
| 43 | 43 | private function getFilename(string $folder, string $file):string |
| 44 | 44 | { |
| 45 | 45 | |
| 46 | - $fileUrl = $folder . $file; |
|
| 46 | + $fileUrl = $folder.$file; |
|
| 47 | 47 | $docRoot = $this->request->getDocumentRoot(); |
| 48 | 48 | $filePath = $docRoot."/public/".$fileUrl; |
| 49 | - if(file_exists($filePath) !== 1) |
|
| 49 | + if (file_exists($filePath) !== 1) |
|
| 50 | 50 | { |
| 51 | 51 | $fileNum = 0; |
| 52 | - while(file_exists($filePath)) |
|
| 52 | + while (file_exists($filePath)) |
|
| 53 | 53 | { |
| 54 | 54 | $fileUrl = $folder.$fileNum."_".$file; |
| 55 | 55 | $filePath = $docRoot."/public/".$fileUrl; |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | |
| 77 | 77 | // Respond to the successful upload with JSON. |
| 78 | 78 | echo json_encode(array('location' => $filetowrite)); |
| 79 | - } else { |
|
| 79 | + }else { |
|
| 80 | 80 | // Notify editor that the upload failed |
| 81 | 81 | echo json_encode(array('error' => 'Upload failed, file might be too big')); |
| 82 | 82 | |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | |
| 111 | 111 | // Respond to the successful upload with JSON. |
| 112 | 112 | echo json_encode(array('location' => $filetowrite)); |
| 113 | - } else { |
|
| 113 | + }else { |
|
| 114 | 114 | // Notify editor that the upload failed |
| 115 | 115 | header("HTTP/1.1 500 Server Error"); |
| 116 | 116 | } |