]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/opensearch.php
Improved type-hint for following methods:
[quix0rs-gnu-social.git] / actions / opensearch.php
index 81efcea9bfb0b9cd8da82f23047241816773454b..c3a494be1be23d65012b0da05791a3d64c619fd5 100644 (file)
@@ -1,5 +1,4 @@
 <?php
-
 /**
  * Opensearch action class.
  *
@@ -29,7 +28,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-if (!defined('LACONICA')) {
+if (!defined('STATUSNET') && !defined('LACONICA')) {
     exit(1);
 }
 
@@ -51,19 +50,21 @@ class OpensearchAction extends Action
      * Class handler.
      *
      * @param array $args query arguments
-     * 
+     *
      * @return boolean false if user doesn't exist
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
         $type       = $this->trimmed('type');
         $short_name = '';
         if ($type == 'people') {
             $type       = 'peoplesearch';
+            // TRANS: ShortName in the OpenSearch interface when trying to find users.
             $short_name = _('People Search');
         } else {
             $type       = 'noticesearch';
+            // TRANS: ShortName in the OpenSearch interface when trying to find notices.
             $short_name = _('Notice Search');
         }
         header('Content-Type: application/opensearchdescription+xml');
@@ -75,7 +76,7 @@ class OpensearchAction extends Action
         $this->element('Url', array('type' => 'text/html', 'method' => 'get',
                        'template' => str_replace('---', '{searchTerms}', common_local_url($type, array('q' => '---')))));
         $this->element('Image', array('height' => 16, 'width' => 16, 'type' => 'image/vnd.microsoft.icon'), common_path('favicon.ico'));
-        $this->element('Image', array('height' => 50, 'width' => 50, 'type' => 'image/png'), theme_path('logo.png'));
+        $this->element('Image', array('height' => 50, 'width' => 50, 'type' => 'image/png'), Theme::path('logo.png'));
         $this->element('AdultContent', null, 'false');
         $this->element('Language', null, common_language());
         $this->element('OutputEncoding', null, 'UTF-8');
@@ -84,9 +85,8 @@ class OpensearchAction extends Action
         $this->endXML();
     }
 
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
 }
-