]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/profilelist.php
Revert "If a shortened URL begins with http://, don't include it in the shortened...
[quix0rs-gnu-social.git] / lib / profilelist.php
index e2faf10af48ed16d1fcd5fb08726c90628b6a2fa..331430b3ef67b4565541e216be71ee3662967355 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 
 /**
- * Laconica, the distributed open-source microblogging tool
+ * StatusNet, the distributed open-source microblogging tool
  *
  * Widget to show a list of profiles
  *
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  *
  * @category  Public
- * @package   Laconica
- * @author    Evan Prodromou <evan@controlyourself.ca>
- * @copyright 2008-2009 Control Yourself, Inc.
+ * @package   StatusNet
+ * @author    Evan Prodromou <evan@status.net>
+ * @copyright 2008-2009 StatusNet, Inc.
  * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
- * @link      http://laconi.ca/
+ * @link      http://status.net/
  */
 
-if (!defined('LACONICA')) {
+if (!defined('STATUSNET') && !defined('LACONICA')) {
     exit(1);
 }
 
@@ -38,11 +38,11 @@ require_once INSTALLDIR.'/lib/widget.php';
  * Widget to show a list of profiles
  *
  * @category Public
- * @package  Laconica
- * @author   Zach Copley <zach@controlyourself.ca>
- * @author   Evan Prodromou <evan@controlyourself.ca>
+ * @package  StatusNet
+ * @author   Zach Copley <zach@status.net>
+ * @author   Evan Prodromou <evan@status.net>
  * @license  http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
- * @link     http://laconi.ca/
+ * @link     http://status.net/
  */
 
 class ProfileList extends Widget
@@ -61,9 +61,25 @@ class ProfileList extends Widget
     }
 
     function show()
+    {
+        $this->startList();
+        $cnt = $this->showProfiles();
+        $this->endList();
+        return $cnt;
+    }
+
+    function startList()
     {
         $this->out->elementStart('ul', 'profiles');
+    }
+
+    function endList()
+    {
+        $this->out->elementEnd('ul');
+    }
 
+    function showProfiles()
+    {
         $cnt = 0;
 
         while ($this->profile->fetch()) {
@@ -75,8 +91,6 @@ class ProfileList extends Widget
             $pli->show();
         }
 
-        $this->out->elementEnd('ul');
-
         return $cnt;
     }
 
@@ -234,8 +248,13 @@ class ProfileListItem extends Widget
                 $usf = new UnsubscribeForm($this->out, $this->profile);
                 $usf->show();
             } else {
-                $sf = new SubscribeForm($this->out, $this->profile);
-                $sf->show();
+                // Is it a local user? can't remote sub from a list
+                // XXX: make that possible!
+                $other = User::staticGet('id', $this->profile->id);
+                if (!empty($other)) {
+                    $sf = new SubscribeForm($this->out, $this->profile);
+                    $sf->show();
+                }
             }
             $this->out->elementEnd('li');
         }