22
33namespace controllers ;
44
5+ use Base ;
6+
57/**
68 * Controller for item handling
79 *
@@ -14,13 +16,16 @@ class Items extends BaseController {
1416 * mark items as read. Allows one id or an array of ids
1517 * json
1618 *
19+ * @param Base $f3 fatfree base instance
20+ * @param array $params query string parameters
21+ *
1722 * @return void
1823 */
19- public function mark () {
24+ public function mark (Base $ f3 , array $ params ) {
2025 $ this ->needsLoggedIn ();
2126
22- if (\ F3 :: get ( ' PARAMS[" item"] ' ) !== null ) {
23- $ lastid = \ F3 :: get ( ' PARAMS[" item"] ' ) ;
27+ if (isset ( $ params [ ' item ' ]) ) {
28+ $ lastid = $ params [ ' item ' ] ;
2429 } elseif (isset ($ _POST ['ids ' ])) {
2530 $ lastid = $ _POST ['ids ' ];
2631 }
@@ -45,12 +50,15 @@ public function mark() {
4550 * mark item as unread
4651 * json
4752 *
53+ * @param Base $f3 fatfree base instance
54+ * @param array $params query string parameters
55+ *
4856 * @return void
4957 */
50- public function unmark () {
58+ public function unmark (Base $ f3 , array $ params ) {
5159 $ this ->needsLoggedIn ();
5260
53- $ lastid = \ F3 :: get ( ' PARAMS[" item"] ' ) ;
61+ $ lastid = $ params [ ' item ' ] ;
5462
5563 $ itemDao = new \daos \Items ();
5664
@@ -69,12 +77,15 @@ public function unmark() {
6977 * starr item
7078 * json
7179 *
80+ * @param Base $f3 fatfree base instance
81+ * @param array $params query string parameters
82+ *
7283 * @return void
7384 */
74- public function starr () {
85+ public function starr (Base $ f3 , array $ params ) {
7586 $ this ->needsLoggedIn ();
7687
77- $ id = \ F3 :: get ( ' PARAMS[" item"] ' ) ;
88+ $ id = $ params [ ' item ' ] ;
7889
7990 $ itemDao = new \daos \Items ();
8091
@@ -92,12 +103,15 @@ public function starr() {
92103 * unstarr item
93104 * json
94105 *
106+ * @param Base $f3 fatfree base instance
107+ * @param array $params query string parameters
108+ *
95109 * @return void
96110 */
97- public function unstarr () {
111+ public function unstarr (Base $ f3 , array $ params ) {
98112 $ this ->needsLoggedIn ();
99113
100- $ id = \ F3 :: get ( ' PARAMS[" item"] ' ) ;
114+ $ id = $ params [ ' item ' ] ;
101115
102116 $ itemDao = new \daos \Items ();
103117
0 commit comments