]> git.mxchange.org Git - friendica.git/blobdiff - mod/notes.php
Use short form array syntax everywhere
[friendica.git] / mod / notes.php
index b2aa5487af963e60d1b456dbf39ec1b258b20aea..a98577e546d73a4eb1289071b304796402add152 100644 (file)
@@ -1,6 +1,12 @@
 <?php
+/**
+ * @file mod/notes.php
+ */
+use Friendica\App;
+use Friendica\Database\DBM;
+use Friendica\Model\Profile;
 
-function notes_init(App &$a) {
+function notes_init(App $a) {
 
        if (! local_user()) {
                return;
@@ -12,12 +18,12 @@ function notes_init(App &$a) {
 
        nav_set_selected('home');
 
-//     profile_load($a,$which,$profile);
+       //Profile::load($a, $which, $profile);
 
 }
 
 
-function notes_content(&$a,$update = false) {
+function notes_content(App $a, $update = false) {
 
        if (! local_user()) {
                notice( t('Permission denied.') . EOL);
@@ -28,7 +34,7 @@ function notes_content(&$a,$update = false) {
        require_once('include/security.php');
        require_once('include/conversation.php');
        require_once('include/acl_selectors.php');
-       $groups = array();
+       $groups = [];
 
 
        $o = '';
@@ -41,7 +47,7 @@ function notes_content(&$a,$update = false) {
        $is_owner = true;
 
        $o ="";
-       $o .= profile_tabs($a,True);
+       $o .= Profile::getTabs($a, true);
 
        if(! $update) {
                $o .= '<h3>' . t('Personal Notes') . '</h3>';
@@ -49,7 +55,7 @@ function notes_content(&$a,$update = false) {
                $commpage = false;
                $commvisitor = false;
 
-               $x = array(
+               $x = [
                        'is_owner' => $is_owner,
                        'allow_location' => (($a->user['allow_location']) ? true : false),
                        'default_location' => $a->user['default-location'],
@@ -61,7 +67,7 @@ function notes_content(&$a,$update = false) {
                        'profile_uid' => local_user(),
                        'button' => t('Save'),
                        'acl_data' => '',
-               );
+               ];
 
                $o .= status_editor($a,$x,$a->contact['id']);
 
@@ -71,7 +77,7 @@ function notes_content(&$a,$update = false) {
 
        // default permissions - anonymous user
 
-       $sql_extra = " AND `allow_cid` = '<" . $a->contact['id'] . ">' ";
+       $sql_extra = " AND `item`.`allow_cid` = '<" . $a->contact['id'] . ">' ";
 
        $r = q("SELECT COUNT(*) AS `total`
                FROM `item` %s
@@ -83,7 +89,7 @@ function notes_content(&$a,$update = false) {
 
        );
 
-       if (dbm::is_result($r)) {
+       if (DBM::is_result($r)) {
                $a->set_pager_total($r[0]['total']);
                $a->set_pager_itemspage(40);
        }
@@ -100,10 +106,10 @@ function notes_content(&$a,$update = false) {
 
        );
 
-       $parents_arr = array();
+       $parents_arr = [];
        $parents_str = '';
 
-       if (dbm::is_result($r)) {
+       if (DBM::is_result($r)) {
                foreach($r as $rr)
                        $parents_arr[] = $rr['item_id'];
                $parents_str = implode(', ', $parents_arr);
@@ -117,7 +123,7 @@ function notes_content(&$a,$update = false) {
                        dbesc($parents_str)
                );
 
-               if (dbm::is_result($r)) {
+               if (DBM::is_result($r)) {
                        $items = conv_sort($r,"`commented`");
 
                        $o .= conversation($a,$items,'notes',$update);