File tree 2 files changed +11
-2
lines changed
2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 17
17
18
18
const IS_VALID_PHPMYFAQ = null ;
19
19
20
+ use phpMyFAQ \Bookmark ;
20
21
use phpMyFAQ \Captcha \Captcha ;
21
22
use phpMyFAQ \Category ;
22
23
use phpMyFAQ \Comments ;
1005
1006
$ response ->setData (['error ' => Translation::get ('err_sendMail ' )]);
1006
1007
}
1007
1008
break ;
1009
+
1010
+ case 'delete-bookmark ' :
1011
+ $ id = Filter::filterVar ($ postData ['faqId ' ], FILTER_VALIDATE_INT );
1012
+ $ bookmark = new Bookmark ($ faqConfig , $ user );
1013
+ $ status = $ bookmark ->remove ($ id );
1014
+ $ response ->setData (['success ' => $ status ]);
1008
1015
}
1009
1016
1010
1017
$ response ->send ();
Original file line number Diff line number Diff line change @@ -154,13 +154,15 @@ public function buildBookmarkList(): string
154
154
$ html .= sprintf (
155
155
'<li class="list-group-item d-flex justify-content-between align-items-start"> '
156
156
. '<div class="ms-2 me-auto"> '
157
- . '<div class="fw-bold">%s</div> '
157
+ . '<div class="fw-bold"><span onclick="handleDeleteBookmark(%d)"> '
158
+ . '<i class="fa fa-trash me-5"></i></span>%s</div> '
158
159
. '<div class="small">%s</div> '
159
160
. '</div> '
160
161
. '<span id="viewsPerRecord" class="badge bg-primary rounded-pill">%s</span> '
161
162
. '</li> ' ,
163
+ $ faqData ['id ' ],
162
164
$ link ->toHtmlAnchor (),
163
- strip_tags ($ faqData ['content ' ]),
165
+ htmlspecialchars_decode ($ faqData ['content ' ]),
164
166
$ plurals ->getMsg ('plmsgViews ' , $ visitsFaq )
165
167
);
166
168
}
You can’t perform that action at this time.
0 commit comments