]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Sort ToSelector by AcctUri
authorMikael Nordfeldth <mmn@hethane.se>
Wed, 17 Feb 2016 23:05:09 +0000 (00:05 +0100)
committerMikael Nordfeldth <mmn@hethane.se>
Wed, 17 Feb 2016 23:05:09 +0000 (00:05 +0100)
lib/toselector.php
theme/base/css/display.css

index 85747b70e9724885ab89027ed3916e8d6edc7895..f29451ad9372eb0049f74b2343e2bb4259fb4b6b 100644 (file)
@@ -94,30 +94,37 @@ class ToSelector extends Widget
         $groups = $this->user->getGroups();
 
         while ($groups instanceof User_group && $groups->fetch()) {
-            $value = 'group:'.$groups->id;
+            $value = 'group:'.$groups->getID();
             if (($this->to instanceof User_group) && $this->to->id == $groups->id) {
                 $default = $value;
             }
-            $choices[$value] = $groups->getBestName();
+            $choices[$value] = "!{$groups->getNickname()} [{$groups->getBestName()}]";
         }
 
         // Add subscribed users to dropdown menu
         $users = $this->user->getSubscribed();
         while ($users->fetch()) {
-            $value = 'profile:'.$users->id;
-            if ($this->user->streamNicknames()) {
-                $choices[$value] = $users->getNickname();
-            } else {
-                $choices[$value] = $users->getBestName();
+            $value = 'profile:'.$users->getID();
+            try {
+                $choices[$value] = substr($users->getAcctUri(), 5) . " [{$users->getBestName()}]";
+            } catch (ProfileNoAcctUriException $e) {
+                $choices[$value] = "[?@?] " . $e->getBestName();
             }
         }
 
         if ($this->to instanceof Profile) {
-            $value = 'profile:'.$this->to->id;
+            $value = 'profile:'.$this->to->getID();
             $default = $value;
-            $choices[$value] = $this->to->getBestName();
+            try {
+                $choices[$value] = substr($this->to->getAcctUri(), 5) . " [{$this->to->getBestName()}]";
+            } catch (ProfileNoAcctUriException $e) {
+                $choices[$value] = "[?@?] " . $e->getBestName();
+            }
         }
 
+        // alphabetical order
+        asort($choices);
+
         $this->out->dropdown($this->id,
                              // TRANS: Label for drop-down of potential addressees.
                              _m('LABEL','To:'),
index 61696e6f11a7dbfdaa5ef45be92b8cabdc8eaa8d..295916d78ec8a2449e4b7a8a4fedf56487ae282c 100644 (file)
@@ -503,6 +503,10 @@ address .poweredby {
     z-index: 99;
 }
 
+.form_notice .to-selector > select {
+    max-width: 300px;
+}
+
 .form_settings label[for=notice_to] {
     left: 5px;
     margin-left: 0px;