]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
Merge pull request #376 from ArthurHoaro/opensearch
authorVirtualTam <virtualtam@flibidi.net>
Sun, 22 Nov 2015 16:53:24 +0000 (17:53 +0100)
committerVirtualTam <virtualtam@flibidi.net>
Sun, 22 Nov 2015 16:53:24 +0000 (17:53 +0100)
Fixes #176 - Add opensearch functionality

1  2 
index.php

diff --combined index.php
index 7bcd0d15377658051835193365df7e1f6d904b8c,01816947a3727bfb30da16099f86549d75e4467b..0a64ca2188aa544ee6389c47a1131bf3d7225967
+++ b/index.php
@@@ -1,6 -1,6 +1,6 @@@
  <?php
  /**
 - * Shaarli v0.5.4 - Shaare your links...
 + * Shaarli v0.6.0 - Shaare your links...
   *
   * The personal, minimalist, super-fast, no-database Delicious clone.
   *
@@@ -115,7 -115,7 +115,7 @@@ $GLOBALS['config']['PUBSUBHUB_URL'] = '
  /*
   * PHP configuration
   */
 -define('shaarli_version', '0.5.4');
 +define('shaarli_version', '0.6.0');
  
  // http://server.com/x/shaarli --> /shaarli/
  define('WEB_PATH', substr($_SERVER["REQUEST_URI"], 0, 1+strrpos($_SERVER["REQUEST_URI"], '/', 0)));
@@@ -679,8 -679,8 +679,8 @@@ class pageBuilde
              $this->tpl->assign('pagetitle', $GLOBALS['pagetitle']);
          }
          $this->tpl->assign('shaarlititle', empty($GLOBALS['title']) ? 'Shaarli': $GLOBALS['title']);
 -        if (!empty($GLOBALS['plugins']['errors'])) {
 -            $this->tpl->assign('plugin_errors', $GLOBALS['plugins']['errors']);
 +        if (!empty($GLOBALS['plugin_errors'])) {
 +            $this->tpl->assign('plugin_errors', $GLOBALS['plugin_errors']);
          }
      }
  
@@@ -1204,6 -1204,14 +1204,14 @@@ function renderPage(
          exit;
      }
  
+     // Display openseach plugin (XML)
+     if ($targetPage == Router::$PAGE_OPENSEARCH) {
+         header('Content-Type: application/xml; charset=utf-8');
+         $PAGE->assign('serverurl', index_url($_SERVER));
+         $PAGE->renderPage('opensearch');
+         exit;
+     }
      // -------- User clicks on a tag in a link: The tag is added to the list of searched tags (searchtags=...)
      if (isset($_GET['addtag']))
      {