@@ -74,8 +74,8 @@ discard block |
||
| 74 | 74 | * Constructor |
| 75 | 75 | * @param mixed $params associative array of parameters. See README.md |
| 76 | 76 | */ |
| 77 | - function __construct($params=null) { |
|
| 78 | - $this->ci =& /** @scrutinizer ignore-call */ get_instance(); |
|
| 77 | + function __construct($params = null) { |
|
| 78 | + $this->ci = & /** @scrutinizer ignore-call */ get_instance(); |
|
| 79 | 79 | $this->ci->load->database(); |
| 80 | 80 | $this->table_name = self::TABLE_PREFIX . (isset($params["name"]) ? "_" . $params["name"] : ""); |
| 81 | 81 | $this->ci->load->database(); |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | * |
| 100 | 100 | * @return bool True on Success, False if Not. |
| 101 | 101 | */ |
| 102 | - public function install(string $blogName=null, string $adminTableName=null, string $adminIdColumnName=null, int $adminIdColumnConstraint=null): bool { |
|
| 102 | + public function install(string $blogName = null, string $adminTableName = null, string $adminIdColumnName = null, int $adminIdColumnConstraint = null): bool { |
|
| 103 | 103 | $blogName = $blogName === null ? $this->table_name : self::TABLE_PREFIX . "_" . $blogName; |
| 104 | 104 | $this->ci->load->dbforge(); |
| 105 | 105 | $this->ci->dbforge->add_field("id"); |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | * |
| 216 | 216 | * @return bool True if sucessfull without errors, false if not. |
| 217 | 217 | */ |
| 218 | - public function loadEditor(string $callback, int $postId=null, bool $w3css=true): bool { |
|
| 218 | + public function loadEditor(string $callback, int $postId = null, bool $w3css = true): bool { |
|
| 219 | 219 | $this->loadScripts($w3css); |
| 220 | 220 | $this->ci->load->helper("form"); |
| 221 | 221 | $data = array( |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | * inputs. These are public string constants declared in |
| 246 | 246 | * this file. |
| 247 | 247 | */ |
| 248 | - public function savePost(int $posterId=null): string { |
|
| 248 | + public function savePost(int $posterId = null): string { |
|
| 249 | 249 | $action = $this->ci->security->xss_clean($this->ci->input->post("action")); |
| 250 | 250 | switch ($action) { |
| 251 | 251 | case "save": |
@@ -269,7 +269,7 @@ discard block |
||
| 269 | 269 | * |
| 270 | 270 | * @return string Action taken during the pocess; Blogger::CREATE Or Blogger::EDIT |
| 271 | 271 | */ |
| 272 | - private function handleSavePost(int $posterId=null): string { |
|
| 272 | + private function handleSavePost(int $posterId = null): string { |
|
| 273 | 273 | $id = $this->ci->security->xss_clean($this->ci->input->post("id")); |
| 274 | 274 | if ($id != "") { |
| 275 | 275 | if (!$this->ci->bmanager->savePost($this->ci->input->post("id"), $this->ci->security->xss_clean($this->ci->input->post("title")), $this->ci->security->xss_clean($this->ci->input->post("editor")), $posterId)) return self::ABORT; |
@@ -287,7 +287,7 @@ discard block |
||
| 287 | 287 | |
| 288 | 288 | * @return string Action reached while processing form inputs. |
| 289 | 289 | */ |
| 290 | - private function handlePublishPost(int $posterId=null): string { |
|
| 290 | + private function handlePublishPost(int $posterId = null): string { |
|
| 291 | 291 | $id = $this->ci->security->xss_clean($this->ci->input->post("id")); |
| 292 | 292 | if ($id == "") return self::ABORT; |
| 293 | 293 | if (!$this->ci->bmanager->savePost($id, $this->ci->security->xss_clean($this->ci->input->post("title")), $this->ci->security->xss_clean($this->ci->input->post("editor")), $posterId)) return self::ABORT; |
@@ -309,7 +309,7 @@ discard block |
||
| 309 | 309 | * |
| 310 | 310 | * @return array Array of posts for a given page. |
| 311 | 311 | */ |
| 312 | - public function getPosts(int $page, int $limit, bool $filter=false, bool $hits=false): array { |
|
| 312 | + public function getPosts(int $page, int $limit, bool $filter = false, bool $hits = false): array { |
|
| 313 | 313 | return $this->ci->bmanager->getPosts($page, $limit, $filter, $hits); |
| 314 | 314 | } |
| 315 | 315 | /** |
@@ -322,7 +322,7 @@ discard block |
||
| 322 | 322 | * @param boolean $hits [description] |
| 323 | 323 | * @return [type] [description] |
| 324 | 324 | */ |
| 325 | - public function renderPostItems($view=null, $callback=null, $empty_view=null, $page=1, $limit=5, $filter=false, $hits=false, $slug=true) { |
|
| 325 | + public function renderPostItems($view = null, $callback = null, $empty_view = null, $page = 1, $limit = 5, $filter = false, $hits = false, $slug = true) { |
|
| 326 | 326 | if ($view == null || $empty_view == null) $this->ci->load->bind("francis94c/blog", $blogger); |
| 327 | 327 | $posts = $this->getPosts($page, $limit, $filter, $hits); |
| 328 | 328 | if (count($posts) == 0) { |
@@ -348,7 +348,7 @@ discard block |
||
| 348 | 348 | * @param boolean $filter [description] |
| 349 | 349 | * @return [type] [description] |
| 350 | 350 | */ |
| 351 | - public function getRecentPosts($limit=5, $filter=false) { |
|
| 351 | + public function getRecentPosts($limit = 5, $filter = false) { |
|
| 352 | 352 | return $this->ci->bmanager->getRecentPosts($limit, $filter); |
| 353 | 353 | } |
| 354 | 354 | /** |
@@ -357,7 +357,7 @@ discard block |
||
| 357 | 357 | * @param [type] $view [description] |
| 358 | 358 | * @return [type] [description] |
| 359 | 359 | */ |
| 360 | - public function renderPost($post, $view=null) { |
|
| 360 | + public function renderPost($post, $view = null) { |
|
| 361 | 361 | if (!is_array($post)) $post = $this->ci->bmanager->getPost($post); |
| 362 | 362 | if (!$post) return false; |
| 363 | 363 | $post["content"] = $this->ci->parsedown->text($post["content"]); |
@@ -393,7 +393,7 @@ discard block |
||
| 393 | 393 | * @param [type] $postId [description] |
| 394 | 394 | * @return [type] [description] |
| 395 | 395 | */ |
| 396 | - public function getPost($postId, $hit=true) { |
|
| 396 | + public function getPost($postId, $hit = true) { |
|
| 397 | 397 | return $this->ci->bmanager->getPost($postId, $hit); |
| 398 | 398 | } |
| 399 | 399 | /** |
@@ -429,7 +429,7 @@ discard block |
||
| 429 | 429 | * @param boolean $filter [description] |
| 430 | 430 | * @return [type] [description] |
| 431 | 431 | */ |
| 432 | - public function searchPosts($words, $page, $limit=0, $filter=false) { |
|
| 432 | + public function searchPosts($words, $page, $limit = 0, $filter = false) { |
|
| 433 | 433 | return $this->ci->bmanager->searchPosts($words, $page, $limit, $filter); |
| 434 | 434 | } |
| 435 | 435 | } |