mirror of
https://github.com/FreshRSS/FreshRSS.git
synced 2026-10-20 10:14:33 -04:00
First commit
This commit is contained in:
commit
fb57be5a5a
47 files changed
+17118
No files matched your search
Executable
+58
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
class entryController extends ActionController {
|
||||
public function readAction () {
|
||||
$id = Request::param ('id');
|
||||
$is_read = Request::param ('is_read');
|
||||
|
||||
if ($is_read) {
|
||||
$is_read = true;
|
||||
} else {
|
||||
$is_read = false;
|
||||
}
|
||||
|
||||
$entryDAO = new EntryDAO ();
|
||||
if ($id == false) {
|
||||
$entries = $entryDAO->listNotReadEntries ();
|
||||
} else {
|
||||
$entry = $entryDAO->searchById ($id);
|
||||
$entries = $entry !== false ? array ($entry) : array ();
|
||||
}
|
||||
|
||||
foreach ($entries as $entry) {
|
||||
$values = array (
|
||||
'is_read' => $is_read,
|
||||
);
|
||||
|
||||
$entryDAO->updateEntry ($entry->id (), $values);
|
||||
}
|
||||
|
||||
Request::forward (array (), true);
|
||||
}
|
||||
|
||||
public function bookmarkAction () {
|
||||
$id = Request::param ('id');
|
||||
$is_fav = Request::param ('is_favorite');
|
||||
|
||||
if ($is_fav) {
|
||||
$is_fav = true;
|
||||
} else {
|
||||
$is_fav = false;
|
||||
}
|
||||
|
||||
$entryDAO = new EntryDAO ();
|
||||
if ($id != false) {
|
||||
$entry = $entryDAO->searchById ($id);
|
||||
|
||||
if ($entry != false) {
|
||||
$values = array (
|
||||
'is_favorite' => $is_fav,
|
||||
);
|
||||
|
||||
$entryDAO->updateEntry ($entry->id (), $values);
|
||||
}
|
||||
}
|
||||
|
||||
Request::forward (array (), true);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user