mirror of
https://github.com/friendica/friendica
synced 2025-04-30 03:04:23 +02:00
old boot.php functions replaced in src/module (4)
This commit is contained in:
parent
de6eabde58
commit
d47d78f2d4
22 changed files with 140 additions and 158 deletions
|
@ -25,6 +25,7 @@ use Friendica\App;
|
|||
use Friendica\BaseModule;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\Search;
|
||||
use Friendica\Core\Session;
|
||||
use Friendica\Database\Database;
|
||||
use Friendica\DI;
|
||||
use Friendica\Module\Response;
|
||||
|
@ -50,10 +51,10 @@ class Saved extends BaseModule
|
|||
|
||||
$return_url = $_GET['return_url'] ?? Search::getSearchPath($search);
|
||||
|
||||
if (local_user() && $search) {
|
||||
if (Session::getLocalUser() && $search) {
|
||||
switch ($action) {
|
||||
case 'add':
|
||||
$fields = ['uid' => local_user(), 'term' => $search];
|
||||
$fields = ['uid' => Session::getLocalUser(), 'term' => $search];
|
||||
if (!$this->dba->exists('search', $fields)) {
|
||||
if (!$this->dba->insert('search', $fields)) {
|
||||
DI::sysmsg()->addNotice($this->t('Search term was not saved.'));
|
||||
|
@ -64,7 +65,7 @@ class Saved extends BaseModule
|
|||
break;
|
||||
|
||||
case 'remove':
|
||||
if (!$this->dba->delete('search', ['uid' => local_user(), 'term' => $search])) {
|
||||
if (!$this->dba->delete('search', ['uid' => Session::getLocalUser(), 'term' => $search])) {
|
||||
DI::sysmsg()->addNotice($this->t('Search term was not removed.'));
|
||||
}
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue