X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Feditpost.php;h=258585ef1c3b95cba2e9e1914bcde84014e19100;hb=6113fdc940d77fba1871463ee0c5a27e1f22eda7;hp=04caaf0a20fe2a0fa15ed192a4c03c951a7fb555;hpb=e4adaa99009356e581fb9a4a5ceacf7ae3993ef0;p=friendica.git diff --git a/mod/editpost.php b/mod/editpost.php index 04caaf0a20..258585ef1c 100644 --- a/mod/editpost.php +++ b/mod/editpost.php @@ -9,10 +9,10 @@ use Friendica\Core\Config; use Friendica\Core\L10n; use Friendica\Core\System; use Friendica\Model\Item; -use Friendica\Database\DBM; - -function editpost_content(App $a) { +use Friendica\Database\DBA; +function editpost_content(App $a) +{ $o = ''; if (!local_user()) { @@ -28,9 +28,11 @@ function editpost_content(App $a) { } $fields = ['allow_cid', 'allow_gid', 'deny_cid', 'deny_gid', - 'type', 'body', 'title', 'file']; + 'type', 'body', 'title', 'file', 'wall', 'post-type']; + $item = Item::selectFirstForUser(local_user(), $fields, ['id' => $post_id, 'uid' => local_user()]); - if (!DBM::is_result($item)) { + + if (!DBA::isResult($item)) { notice(L10n::t('Item not found') . EOL); return; } @@ -69,7 +71,7 @@ function editpost_content(App $a) { $jotplugins = ''; $jotnets = ''; - $mail_disabled = ((function_exists('imap_open') && !Config::get('system','imap_disabled')) ? 0 : 1); + $mail_disabled = ((function_exists('imap_open') && !Config::get('system', 'imap_disabled')) ? 0 : 1); $mail_enabled = false; $pubmail_enabled = false; @@ -78,8 +80,10 @@ function editpost_content(App $a) { $r = q("SELECT * FROM `mailacct` WHERE `uid` = %d AND `server` != '' LIMIT 1", intval(local_user()) ); - if (DBM::is_result($r)) { + + if (DBA::isResult($r)) { $mail_enabled = true; + if (intval($r[0]['pubmail'])) { $pubmail_enabled = true; } @@ -110,7 +114,8 @@ function editpost_content(App $a) { '$shortnoloc' => L10n::t('clear location'), '$wait' => L10n::t('Please wait'), '$permset' => L10n::t('Permission settings'), - '$ptyp' => $item['type'], + '$wall' => $item['wall'], + '$posttype' => $item['post-type'], '$content' => undo_post_tagging($item['body']), '$post_id' => $post_id, '$baseurl' => System::baseUrl(),