7 use Friendica\Content\Nav;
8 use Friendica\Content\Pager;
9 use Friendica\Core\L10n;
10 use Friendica\Database\DBA;
12 use Friendica\Model\Item;
13 use Friendica\Model\Profile;
15 function notes_init(App $a)
21 Nav::setSelected('home');
25 function notes_content(App $a, $update = false)
28 notice(L10n::t('Permission denied.') . EOL);
32 $o = Profile::getTabs($a, 'notes', true);
35 $o .= '<h3>' . L10n::t('Personal Notes') . '</h3>';
39 'allow_location' => (($a->user['allow_location']) ? true : false),
40 'default_location' => $a->user['default-location'],
41 'nickname' => $a->user['nickname'],
42 'lockstate' => 'lock',
46 'profile_uid' => local_user(),
47 'button' => L10n::t('Save'),
51 $o .= status_editor($a, $x, $a->contact['id']);
54 $condition = ['uid' => local_user(), 'post-type' => Item::PT_PERSONAL_NOTE, 'gravity' => GRAVITY_PARENT,
55 'contact-id'=> $a->contact['id']];
57 $pager = new Pager(DI::args()->getQueryString(), 40);
59 $params = ['order' => ['created' => true],
60 'limit' => [$pager->getStart(), $pager->getItemsPerPage()]];
61 $r = Item::selectThreadForUser(local_user(), ['uri'], $condition, $params);
65 if (DBA::isResult($r)) {
66 $notes = Item::inArray($r);
68 $count = count($notes);
70 $o .= conversation($a, $notes, $pager, 'notes', $update);
73 $o .= $pager->renderMinimal($count);