7 use Friendica\Content\Nav;
8 use Friendica\Core\L10n;
9 use Friendica\Database\DBA;
10 use Friendica\Model\Item;
11 use Friendica\Model\Profile;
13 function notes_init(App $a)
21 $which = $a->user['nickname'];
23 Nav::setSelected('home');
25 //Profile::load($a, $which, $profile);
29 function notes_content(App $a, $update = false)
32 notice(L10n::t('Permission denied.') . EOL);
36 require_once 'include/conversation.php';
38 $o = Profile::getTabs($a, true);
41 $o .= '<h3>' . L10n::t('Personal Notes') . '</h3>';
45 'allow_location' => (($a->user['allow_location']) ? true : false),
46 'default_location' => $a->user['default-location'],
47 'nickname' => $a->user['nickname'],
48 'lockstate' => 'lock',
52 'profile_uid' => local_user(),
53 'button' => L10n::t('Save'),
57 $o .= status_editor($a, $x, $a->contact['id']);
60 $condition = ['uid' => local_user(), 'post-type' => Item::PT_PERSONAL_NOTE, 'gravity' => GRAVITY_PARENT,
61 'wall' => false, 'contact-id'=> $a->contact['id']];
63 $a->setPagerItemsPage(40);
65 $params = ['order' => ['created' => true],
66 'limit' => [$a->pager['start'], $a->pager['itemspage']]];
67 $r = Item::selectThreadForUser(local_user(), ['uri'], $condition, $params);
71 if (DBA::isResult($r)) {
72 $notes = DBA::toArray($r);
74 $count = count($notes);
76 $o .= conversation($a, $notes, 'notes', $update);
79 $o .= alt_pager($a, $count);