]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/groupsearch.php
change Laconica and Control Yourself to StatusNet in PHP files
[quix0rs-gnu-social.git] / actions / groupsearch.php
index 109a53ce112704a0ff6f92795fb703e1e1c53b06..947463ccb64af58485dc16c8ead47eed31c5c77a 100644 (file)
@@ -5,14 +5,14 @@
  * PHP version 5
  *
  * @category Action
- * @package  Laconica
+ * @package  StatusNet
  * @author   Evan Prodromou <evan@controlyourself.ca>
  * @author   Robin Millette <millette@controlyourself.ca>
  * @license  http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
  * @link     http://laconi.ca/
  *
- * Laconica - a distributed open-source microblogging tool
- * Copyright (C) 2008, Controlez-Vous, Inc.
+ * StatusNet - a distributed open-source microblogging tool
+ * Copyright (C) 2008, 2009, StatusNet, Inc.
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as published by
@@ -39,7 +39,7 @@ if (!defined('LACONICA')) {
  * Group search action class.
  *
  * @category Action
- * @package  Laconica
+ * @package  StatusNet
  * @author   Evan Prodromou <evan@controlyourself.ca>
  * @author   Robin Millette <millette@controlyourself.ca>
  * @license  http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
@@ -72,12 +72,24 @@ class GroupsearchAction extends SearchAction
             $terms = preg_split('/[\s,]+/', $q);
             $results = new GroupSearchResults($user_group, $terms, $this);
             $results->show();
+            $user_group->free();
+            $this->pagination($page > 1, $cnt > GROUPS_PER_PAGE,
+                          $page, 'groupsearch', array('q' => $q));
         } else {
-            $this->element('p', 'error', _('No results'));
+            $this->element('p', 'error', _('No results.'));
+            $this->searchSuggestions($q);
+            if (common_logged_in()) {
+                $message = _('If you can\'t find the group you\'re looking for, you can [create it](%%action.newgroup%%) yourself.');
+            }
+            else {
+                $message = sprintf(_('Why not [register an account](%%%%action.%s%%%%) and [create the group](%%%%action.newgroup%%%%) yourself!'),
+                                   (!common_config('site','openidonly')) ? 'register' : 'openidlogin');
+            }
+            $this->elementStart('div', 'guide');
+            $this->raw(common_markup_to_html($message));
+            $this->elementEnd('div');
+            $user_group->free();
         }
-        $user_group->free();
-        $this->pagination($page > 1, $cnt > GROUPS_PER_PAGE,
-                          $page, 'groupsearch', array('q' => $q));
     }
 }
 
@@ -98,10 +110,5 @@ class GroupSearchResults extends GroupList
     {
         return preg_replace($this->pattern, '<strong>\\1</strong>', htmlspecialchars($text));
     }
-
-    function isReadOnly()
-    {
-        return true;
-    }
 }