@@ 48-63 (lines=16) @@ | ||
45 | echo $this->view->renderWithLayouts(Config::get('VIEWS_PATH') . "layout/default/", Config::get('VIEWS_PATH') . 'newsfeed/index.php', ['pageNum' => $pageNum]); |
|
46 | } |
|
47 | ||
48 | public function create(){ |
|
49 | ||
50 | $content = $this->request->data("content"); |
|
51 | ||
52 | $newsfeed = $this->newsfeed->create(Session::getUserId(), $content); |
|
53 | ||
54 | if(!$newsfeed){ |
|
55 | ||
56 | Session::set('newsfeed-errors', $this->newsfeed->errors()); |
|
57 | Redirector::root("NewsFeed"); |
|
58 | ||
59 | }else{ |
|
60 | ||
61 | Redirector::root("NewsFeed"); |
|
62 | } |
|
63 | } |
|
64 | ||
65 | public function getUpdateForm(){ |
|
66 |
@@ 73-83 (lines=11) @@ | ||
70 | Redirector::root("User/Profile"); |
|
71 | } |
|
72 | ||
73 | public function updateProfilePicture(){ |
|
74 | ||
75 | $fileData = $this->request->data("file"); |
|
76 | $image = $this->user->updateProfilePicture(Session::getUserId(), $fileData); |
|
77 | ||
78 | if(!$image){ |
|
79 | Session::set('profile-picture-errors', $this->user->errors()); |
|
80 | } |
|
81 | ||
82 | Redirector::root("User/Profile"); |
|
83 | } |
|
84 | ||
85 | /** |
|
86 | * revoke email updates |