]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
Explicitly define base and asset path in templates
authorArthurHoaro <arthur@hoa.ro>
Sat, 13 Jun 2020 09:22:14 +0000 (11:22 +0200)
committerArthurHoaro <arthur@hoa.ro>
Thu, 23 Jul 2020 19:19:21 +0000 (21:19 +0200)
With the new routes, all pages are not all at the same folder level anymore
(e.g. /shaare and /shaare/123), so we can't just use './' everywhere.
The most consistent way to handle this is to prefix all path with the proper variable,
and handle the actual path in controllers.

51 files changed:
application/container/ShaarliContainer.php
application/front/ShaarliMiddleware.php
application/front/controller/visitor/ShaarliVisitorController.php
application/render/PageBuilder.php
assets/common/js/thumbnails-update.js
assets/default/js/base.js
tests/front/ShaarliMiddlewareTest.php
tests/front/controller/admin/PostBookmarkControllerTest.php
tests/front/controller/admin/SessionFilterControllerTest.php
tests/front/controller/visitor/FrontControllerMockHelper.php
tests/front/controller/visitor/ShaarliVisitorControllerTest.php [moved from tests/front/controller/visitor/ShaarliPublicControllerTest.php with 92% similarity]
tpl/default/404.html
tpl/default/addlink.html
tpl/default/changepassword.html
tpl/default/changetag.html
tpl/default/configure.html
tpl/default/daily.html
tpl/default/editlink.html
tpl/default/error.html
tpl/default/export.html
tpl/default/import.html
tpl/default/includes.html
tpl/default/install.html
tpl/default/linklist.html
tpl/default/linklist.paging.html
tpl/default/page.footer.html
tpl/default/page.header.html
tpl/default/picwall.html
tpl/default/pluginsadmin.html
tpl/default/tag.cloud.html
tpl/default/tag.list.html
tpl/default/tag.sort.html
tpl/default/thumbnails.html
tpl/default/tools.html
tpl/vintage/404.html
tpl/vintage/addlink.html
tpl/vintage/configure.html
tpl/vintage/daily.html
tpl/vintage/editlink.html
tpl/vintage/error.html
tpl/vintage/import.html
tpl/vintage/includes.html
tpl/vintage/linklist.html
tpl/vintage/linklist.paging.html
tpl/vintage/page.footer.html
tpl/vintage/page.header.html
tpl/vintage/picwall.html
tpl/vintage/pluginsadmin.html
tpl/vintage/tag.cloud.html
tpl/vintage/thumbnails.html
tpl/vintage/tools.html

index fec398d098a95d4ae9b8c0918d795086cba161c0..a95393cd450461fb137ccf24c0814d4ad86d9b81 100644 (file)
@@ -22,6 +22,7 @@ use Slim\Container;
  * Extension of Slim container to document the injected objects.
  *
  * @property mixed[]                  $environment     $_SERVER automatically injected by Slim
+ * @property string                   $basePath        Shaarli's instance base path (e.g. `/shaarli/`)
  * @property ConfigManager            $conf
  * @property SessionManager           $sessionManager
  * @property LoginManager             $loginManager
index f8992e0b333fa8e3ebeb853c5ceb8ea8e423625c..47aa61bbfb6f9d05f6dff325501d45d3b4b82b81 100644 (file)
@@ -39,6 +39,8 @@ class ShaarliMiddleware
     public function __invoke(Request $request, Response $response, callable $next)
     {
         try {
+            $this->container->basePath = rtrim($request->getUri()->getBasePath(), '/');
+
             $response = $next($request, $response);
         } catch (ShaarliFrontException $e) {
             $this->container->pageBuilder->assign('message', $e->getMessage());
index 98423d9000cfdca2958fcd685173974701074a49..b90b1e8f2f8396ef3eff59221b15db749a7be516 100644 (file)
@@ -60,6 +60,19 @@ abstract class ShaarliVisitorController
         $this->assignView('privateLinkcount', $this->container->bookmarkService->count(BookmarkFilter::$PRIVATE));
         $this->assignView('plugin_errors', $this->container->pluginManager->getErrors());
 
+        /*
+         * Define base path (if Shaarli is installed in a domain's subfolder, e.g. `/shaarli`)
+         * and the asset path (subfolder/tpl/default for default theme).
+         * These MUST be used to create an internal link or to include an asset in templates.
+         */
+        $this->assignView('base_path', $this->container->basePath);
+        $this->assignView(
+            'asset_path',
+            $this->container->basePath . '/' .
+            rtrim($this->container->conf->get('resource.raintpl_tpl', 'tpl'), '/') . '/' .
+            $this->container->conf->get('resource.theme', 'default')
+        );
+
         $this->executeDefaultHooks($template);
 
         return $this->container->pageBuilder->render($template);
@@ -105,7 +118,7 @@ abstract class ShaarliVisitorController
         array $clearParams = [],
         string $anchor = null
     ): Response {
-        $defaultPath = rtrim($request->getUri()->getBasePath(), '/') . '/';
+        $defaultPath = $this->container->basePath . '/';
         $referer = $this->container->environment['HTTP_REFERER'] ?? null;
 
         if (null !== $referer) {
index d90ed58ba279d3e4f7a33a16cf8485fc5ef02481..2779eb90ddcea62c0637f551f7caee319207d3bf 100644 (file)
@@ -149,6 +149,10 @@ class PageBuilder
      */
     protected function finalize(): void
     {
+        //FIXME - DEV _ REMOVE ME
+        $this->assign('base_path', '/Shaarli');
+        $this->assign('asset_path', '/Shaarli/tpl/default');
+
         // TODO: use the SessionManager
         $messageKeys = [
             SessionManager::KEY_SUCCESS_MESSAGES,
index 060a730e50005c9c5fae413ed1f4d58c8c257c6d..35608169aa52d6aa9bef1834651b09f9f5d5f8ab 100644 (file)
  * It contains a recursive call to retrieve the thumb of the next link when it succeed.
  * It also update the progress bar and other visual feedback elements.
  *
+ * @param {string} basePath Shaarli subfolder for XHR requests
  * @param {array}  ids      List of LinkID to update
  * @param {int}    i        Current index in ids
  * @param {object} elements List of DOM element to avoid retrieving them at each iteration
  */
-function updateThumb(ids, i, elements) {
+function updateThumb(basePath, ids, i, elements) {
   const xhr = new XMLHttpRequest();
-  xhr.open('POST', './?do=ajax_thumb_update');
+  xhr.open('POST', `${basePath}/?do=ajax_thumb_update`);
   xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
   xhr.responseType = 'json';
   xhr.onload = () => {
@@ -40,6 +41,7 @@ function updateThumb(ids, i, elements) {
 }
 
 (() => {
+  const basePath = document.querySelector('input[name="js_base_path"]').value;
   const ids = document.getElementsByName('ids')[0].value.split(',');
   const elements = {
     progressBar: document.querySelector('.progressbar > div'),
@@ -47,5 +49,5 @@ function updateThumb(ids, i, elements) {
     thumbnail: document.querySelector('.thumbnail-placeholder'),
     title: document.querySelector('.thumbnail-link-title'),
   };
-  updateThumb(ids, 0, elements);
+  updateThumb(basePath, ids, 0, elements);
 })();
index 8cc7eed59f735f87a1935e712de5e3a27e29740e..b428a42061fecf64801c4b8180c2671822b12fc4 100644 (file)
@@ -25,9 +25,9 @@ function findParent(element, tagName, attributes) {
 /**
  * Ajax request to refresh the CSRF token.
  */
-function refreshToken() {
+function refreshToken(basePath) {
   const xhr = new XMLHttpRequest();
-  xhr.open('GET', './?do=token');
+  xhr.open('GET', `${basePath}/?do=token`);
   xhr.onload = () => {
     const token = document.getElementById('token');
     token.setAttribute('value', xhr.responseText);
@@ -215,6 +215,8 @@ function init(description) {
 }
 
 (() => {
+  const basePath = document.querySelector('input[name="js_base_path"]').value;
+
   /**
    * Handle responsive menu.
    * Source: http://purecss.io/layouts/tucked-menu-vertical/
@@ -461,7 +463,7 @@ function init(description) {
       });
 
       if (window.confirm(message)) {
-        window.location = `?delete_link&lf_linkdate=${ids.join('+')}&token=${token.value}`;
+        window.location = `${basePath}/?delete_link&lf_linkdate=${ids.join('+')}&token=${token.value}`;
       }
     });
   }
@@ -483,7 +485,8 @@ function init(description) {
         });
 
         const ids = links.map(item => item.id);
-        window.location = `?change_visibility&token=${token.value}&newVisibility=${visibility}&ids=${ids.join('+')}`;
+        window.location =
+          `${basePath}/?change_visibility&token=${token.value}&newVisibility=${visibility}&ids=${ids.join('+')}`;
       });
     });
   }
@@ -546,7 +549,7 @@ function init(description) {
       const refreshedToken = document.getElementById('token').value;
       const fromtag = block.getAttribute('data-tag');
       const xhr = new XMLHttpRequest();
-      xhr.open('POST', './manage-tags');
+      xhr.open('POST', `${basePath}/manage-tags`);
       xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
       xhr.onload = () => {
         if (xhr.status !== 200) {
@@ -558,8 +561,12 @@ function init(description) {
           input.setAttribute('value', totag);
           findParent(input, 'div', { class: 'rename-tag-form' }).style.display = 'none';
           block.querySelector('a.tag-link').innerHTML = htmlEntities(totag);
-          block.querySelector('a.tag-link').setAttribute('href', `./?searchtags=${encodeURIComponent(totag)}`);
-          block.querySelector('a.rename-tag').setAttribute('href', `./manage-tags?fromtag=${encodeURIComponent(totag)}`);
+          block
+            .querySelector('a.tag-link')
+            .setAttribute('href', `${basePath}/?searchtags=${encodeURIComponent(totag)}`);
+          block
+            .querySelector('a.rename-tag')
+            .setAttribute('href', `${basePath}/manage-tags?fromtag=${encodeURIComponent(totag)}`);
 
           // Refresh awesomplete values
           existingTags = existingTags.map(tag => (tag === fromtag ? totag : tag));
@@ -567,7 +574,7 @@ function init(description) {
         }
       };
       xhr.send(`renametag=1&fromtag=${encodeURIComponent(fromtag)}&totag=${encodeURIComponent(totag)}&token=${refreshedToken}`);
-      refreshToken();
+      refreshToken(basePath);
     });
   });
 
@@ -593,13 +600,13 @@ function init(description) {
 
       if (confirm(`Are you sure you want to delete the tag "${tag}"?`)) {
         const xhr = new XMLHttpRequest();
-        xhr.open('POST', './manage-tags');
+        xhr.open('POST', `${basePath}/manage-tags`);
         xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
         xhr.onload = () => {
           block.remove();
         };
         xhr.send(encodeURI(`deletetag=1&fromtag=${tag}&token=${refreshedToken}`));
-        refreshToken();
+        refreshToken(basePath);
 
         existingTags = existingTags.filter(tagItem => tagItem !== tag);
         awesomepletes = updateAwesompleteList('.rename-tag-input', existingTags, awesomepletes);
index 80974f373f3f7ad3a28b344961e067c21ab5a272..57be10026a90795308776e8e37e13b03795c768b 100644 (file)
@@ -11,6 +11,7 @@ use Shaarli\Front\Exception\LoginBannedException;
 use Shaarli\Render\PageBuilder;
 use Slim\Http\Request;
 use Slim\Http\Response;
+use Slim\Http\Uri;
 
 class ShaarliMiddlewareTest extends TestCase
 {
@@ -29,6 +30,13 @@ class ShaarliMiddlewareTest extends TestCase
     public function testMiddlewareExecution(): void
     {
         $request = $this->createMock(Request::class);
+        $request->method('getUri')->willReturnCallback(function (): Uri {
+            $uri = $this->createMock(Uri::class);
+            $uri->method('getBasePath')->willReturn('/subfolder');
+
+            return $uri;
+        });
+
         $response = new Response();
         $controller = function (Request $request, Response $response): Response {
             return $response->withStatus(418); // I'm a tea pot
@@ -44,6 +52,13 @@ class ShaarliMiddlewareTest extends TestCase
     public function testMiddlewareExecutionWithException(): void
     {
         $request = $this->createMock(Request::class);
+        $request->method('getUri')->willReturnCallback(function (): Uri {
+            $uri = $this->createMock(Uri::class);
+            $uri->method('getBasePath')->willReturn('/subfolder');
+
+            return $uri;
+        });
+        
         $response = new Response();
         $controller = function (): void {
             $exception = new LoginBannedException();
index f00a15c96dcfd2d16b2c932dc72272d34fb1ca67..69673bd2371d5d68fdb3e2e3acabdf9a7c5ace6b 100644 (file)
@@ -13,7 +13,6 @@ use Shaarli\Security\SessionManager;
 use Shaarli\Thumbnailer;
 use Slim\Http\Request;
 use Slim\Http\Response;
-use Slim\Http\Uri;
 
 class PostBookmarkControllerTest extends TestCase
 {
@@ -406,12 +405,6 @@ class PostBookmarkControllerTest extends TestCase
                 return $parameters[$key] ?? null;
             })
         ;
-        $request->method('getUri')->willReturnCallback(function (): Uri {
-            $uri = $this->createMock(Uri::class);
-            $uri->method('getBasePath')->willReturn('/subfolder');
-
-            return $uri;
-        });
         $response = new Response();
 
         $checkBookmark = function (Bookmark $bookmark) use ($parameters) {
@@ -493,12 +486,6 @@ class PostBookmarkControllerTest extends TestCase
                 return $parameters[$key] ?? null;
             })
         ;
-        $request->method('getUri')->willReturnCallback(function (): Uri {
-            $uri = $this->createMock(Uri::class);
-            $uri->method('getBasePath')->willReturn('/subfolder');
-
-            return $uri;
-        });
         $response = new Response();
 
         $checkBookmark = function (Bookmark $bookmark) use ($parameters, $id) {
@@ -575,12 +562,6 @@ class PostBookmarkControllerTest extends TestCase
                 return $parameters[$key] ?? null;
             })
         ;
-        $request->method('getUri')->willReturnCallback(function (): Uri {
-            $uri = $this->createMock(Uri::class);
-            $uri->method('getBasePath')->willReturn('/subfolder');
-
-            return $uri;
-        });
         $response = new Response();
 
         $this->container->conf = $this->createMock(ConfigManager::class);
index 096963cf46d041b2cd4d45b919e94b4d27459086..ea07edeea1ff5f6eb98bd3f246b0bf427cc756b1 100644 (file)
@@ -9,7 +9,6 @@ use Shaarli\Security\LoginManager;
 use Shaarli\Security\SessionManager;
 use Slim\Http\Request;
 use Slim\Http\Response;
-use Slim\Http\Uri;
 
 class SessionFilterControllerTest extends TestCase
 {
@@ -33,12 +32,6 @@ class SessionFilterControllerTest extends TestCase
         $this->container->environment = ['HTTP_REFERER' => 'http://shaarli/subfolder/controller/?searchtag=abc'];
 
         $request = $this->createMock(Request::class);
-        $request->method('getUri')->willReturnCallback(function (): Uri {
-            $uri = $this->createMock(Uri::class);
-            $uri->method('getBasePath')->willReturn('/subfolder');
-
-            return $uri;
-        });
         $request->method('getParam')->with('nb')->willReturn('8');
         $response = new Response();
 
@@ -61,12 +54,6 @@ class SessionFilterControllerTest extends TestCase
     public function testLinksPerPageNotValid(): void
     {
         $request = $this->createMock(Request::class);
-        $request->method('getUri')->willReturnCallback(function (): Uri {
-            $uri = $this->createMock(Uri::class);
-            $uri->method('getBasePath')->willReturn('/subfolder');
-
-            return $uri;
-        });
         $request->method('getParam')->with('nb')->willReturn('test');
         $response = new Response();
 
@@ -80,7 +67,7 @@ class SessionFilterControllerTest extends TestCase
 
         static::assertInstanceOf(Response::class, $result);
         static::assertSame(302, $result->getStatusCode());
-        static::assertSame(['/subfolder'], $result->getHeader('location'));
+        static::assertSame(['/subfolder/'], $result->getHeader('location'));
     }
 
     /**
@@ -100,12 +87,6 @@ class SessionFilterControllerTest extends TestCase
         ;
 
         $request = $this->createMock(Request::class);
-        $request->method('getUri')->willReturnCallback(function (): Uri {
-            $uri = $this->createMock(Uri::class);
-            $uri->method('getBasePath')->willReturn('/subfolder');
-
-            return $uri;
-        });
         $response = new Response();
 
         $result = $this->controller->visibility($request, $response, $arg);
@@ -141,12 +122,6 @@ class SessionFilterControllerTest extends TestCase
         ;
 
         $request = $this->createMock(Request::class);
-        $request->method('getUri')->willReturnCallback(function (): Uri {
-            $uri = $this->createMock(Uri::class);
-            $uri->method('getBasePath')->willReturn('/subfolder');
-
-            return $uri;
-        });
         $response = new Response();
 
         $result = $this->controller->visibility($request, $response, $arg);
@@ -176,19 +151,13 @@ class SessionFilterControllerTest extends TestCase
         ;
 
         $request = $this->createMock(Request::class);
-        $request->method('getUri')->willReturnCallback(function (): Uri {
-            $uri = $this->createMock(Uri::class);
-            $uri->method('getBasePath')->willReturn('/subfolder');
-
-            return $uri;
-        });
         $response = new Response();
 
         $result = $this->controller->visibility($request, $response, $arg);
 
         static::assertInstanceOf(Response::class, $result);
         static::assertSame(302, $result->getStatusCode());
-        static::assertSame(['/subfolder'], $result->getHeader('location'));
+        static::assertSame(['/subfolder/'], $result->getHeader('location'));
     }
 
     /**
@@ -212,12 +181,6 @@ class SessionFilterControllerTest extends TestCase
         ;
 
         $request = $this->createMock(Request::class);
-        $request->method('getUri')->willReturnCallback(function (): Uri {
-            $uri = $this->createMock(Uri::class);
-            $uri->method('getBasePath')->willReturn('/subfolder');
-
-            return $uri;
-        });
         $response = new Response();
 
         $result = $this->controller->visibility($request, $response, $arg);
@@ -249,12 +212,6 @@ class SessionFilterControllerTest extends TestCase
         ;
 
         $request = $this->createMock(Request::class);
-        $request->method('getUri')->willReturnCallback(function (): Uri {
-            $uri = $this->createMock(Uri::class);
-            $uri->method('getBasePath')->willReturn('/subfolder');
-
-            return $uri;
-        });
         $response = new Response();
 
         $result = $this->controller->visibility($request, $response, $arg);
@@ -272,12 +229,6 @@ class SessionFilterControllerTest extends TestCase
         $this->container->environment = ['HTTP_REFERER' => 'http://shaarli/subfolder/controller/?searchtag=abc'];
 
         $request = $this->createMock(Request::class);
-        $request->method('getUri')->willReturnCallback(function (): Uri {
-            $uri = $this->createMock(Uri::class);
-            $uri->method('getBasePath')->willReturn('/subfolder');
-
-            return $uri;
-        });
         $response = new Response();
 
         $this->container->sessionManager
@@ -301,13 +252,6 @@ class SessionFilterControllerTest extends TestCase
         $this->container->environment = ['HTTP_REFERER' => 'http://shaarli/subfolder/controller/?searchtag=abc'];
 
         $request = $this->createMock(Request::class);
-        $request->method('getUri')->willReturnCallback(function (): Uri {
-            $uri = $this->createMock(Uri::class);
-            $uri->method('getBasePath')->willReturn('/subfolder');
-
-            return $uri;
-        });
-
         $response = new Response();
 
         $this->container->sessionManager
index fecd0c82ffde465c81fcd8eca65ffd76953d0d51..7f5606622b866f7ccca0e4d7ed153959102a7718 100644 (file)
@@ -81,6 +81,8 @@ trait FrontControllerMockHelper
             'SERVER_PORT' => '80',
             'REQUEST_URI' => '/daily-rss',
         ];
+
+        $this->container->basePath = '/subfolder';
     }
 
     /**
similarity index 92%
rename from tests/front/controller/visitor/ShaarliPublicControllerTest.php
rename to tests/front/controller/visitor/ShaarliVisitorControllerTest.php
index 899b280b15499f118cc705b92f164e6a7ec61e0f..83d0835850a664f893997e4ea9b1d502ae4e3f5c 100644 (file)
@@ -8,15 +8,14 @@ use PHPUnit\Framework\TestCase;
 use Shaarli\Bookmark\BookmarkFilter;
 use Slim\Http\Request;
 use Slim\Http\Response;
-use Slim\Http\Uri;
 
 /**
  * Class ShaarliControllerTest
  *
- * This class is used to test default behavior of ShaarliController abstract class.
+ * This class is used to test default behavior of ShaarliVisitorController abstract class.
  * It uses a dummy non abstract controller.
  */
-class ShaarliPublicControllerTest extends TestCase
+class ShaarliVisitorControllerTest extends TestCase
 {
     use FrontControllerMockHelper;
 
@@ -49,20 +48,15 @@ class ShaarliPublicControllerTest extends TestCase
                 Request $request,
                 Response $response,
                 array $loopTerms = [],
-                array $clearParams = []
+                array $clearParams = [],
+                string $anchor = null
             ): Response {
-                return parent::redirectFromReferer($request, $response, $loopTerms, $clearParams);
+                return parent::redirectFromReferer($request, $response, $loopTerms, $clearParams, $anchor);
             }
         };
         $this->assignedValues = [];
 
         $this->request = $this->createMock(Request::class);
-        $this->request->method('getUri')->willReturnCallback(function (): Uri {
-            $uri = $this->createMock(Uri::class);
-            $uri->method('getBasePath')->willReturn('/subfolder');
-
-            return $uri;
-        });
     }
 
     public function testAssignView(): void
@@ -102,6 +96,8 @@ class ShaarliPublicControllerTest extends TestCase
         static::assertSame(10, $this->assignedValues['linkcount']);
         static::assertSame(5, $this->assignedValues['privateLinkcount']);
         static::assertSame(['error'], $this->assignedValues['plugin_errors']);
+        static::assertSame('/subfolder', $this->assignedValues['base_path']);
+        static::assertSame('/subfolder/tpl/default', $this->assignedValues['asset_path']);
 
         static::assertSame('templateName', $this->assignedValues['plugins_includes']['render_includes']['target']);
         static::assertTrue($this->assignedValues['plugins_includes']['render_includes']['loggedin']);
@@ -153,7 +149,7 @@ class ShaarliPublicControllerTest extends TestCase
         $result = $this->controller->redirectFromReferer($this->request, $response, ['nope', 'controller']);
 
         static::assertSame(302, $result->getStatusCode());
-        static::assertSame(['/subfolder'], $result->getHeader('location'));
+        static::assertSame(['/subfolder/'], $result->getHeader('location'));
     }
 
     /**
@@ -168,7 +164,7 @@ class ShaarliPublicControllerTest extends TestCase
         $result = $this->controller->redirectFromReferer($this->request, $response, ['nope', 'other']);
 
         static::assertSame(302, $result->getStatusCode());
-        static::assertSame(['/subfolder'], $result->getHeader('location'));
+        static::assertSame(['/subfolder/'], $result->getHeader('location'));
     }
 
     /**
index 09737b4b0a7850686e72dacbb726d0d7757cd9de..7b696e4c480f77e2831093e91cd7a63e56f208c2 100644 (file)
@@ -8,7 +8,7 @@
   {include="page.header"}
 <div id="pageError" class="page-error-container center">
   <h2>{'Sorry, nothing to see here.'|t}</h2>
-  <img src="img/sad_star.png" alt="">
+  <img src="{$asset_path}/img/sad_star.png#" alt="">
   <p>{$error_message}</p>
 </div>
 {include="page.footer"}
index 999d2f4d2f3e657d1255bb8dabbab7962d6bd990..c37827f4c126c60dad89943658ab390bb3365882 100644 (file)
@@ -9,7 +9,7 @@
   <div class="pure-u-lg-1-3 pure-u-1-24"></div>
   <div id="addlink-form" class="page-form  page-form-light pure-u-lg-1-3 pure-u-22-24">
     <h2 class="window-title">{"Shaare a new link"|t}</h2>
-    <form method="GET" action="./shaare" name="addform" class="addform">
+    <form method="GET" action="{$base_path}/shaare" name="addform" class="addform">
       <div>
         <label for="shaare">{'URL or leave empty to post a note'|t}</label>
         <input type="text" name="post" id="shaare" class="autofocus">
index ab57943334c600d63f35871c84ea0e3cad7516b7..80d2f2e115e9005930a0551ba4ecbae74141c11a 100644 (file)
@@ -9,7 +9,7 @@
   <div class="pure-u-lg-1-3 pure-u-1-24"></div>
   <div id="addlink-form" class="page-form page-form-light pure-u-lg-1-3 pure-u-22-24">
     <h2 class="window-title">{"Change password"|t}</h2>
-    <form method="POST" action="#" name="changepasswordform" id="changepasswordform">
+    <form method="POST" action="{$base_path}/password" name="changepasswordform" id="changepasswordform">
       <div>
         <input type="password" name="oldpassword" aria-label="{'Current password'|t}" placeholder="{'Current password'|t}" class="autofocus">
       </div>
index a1a572ca580d09538f7f8c820edaf32210abe5d4..4e3059d3655e6e506e151d3c829ef4cc0d838ba5 100644 (file)
@@ -9,7 +9,7 @@
   <div class="pure-u-lg-1-3 pure-u-1-24"></div>
   <div id="addlink-form" class="page-form page-form-light pure-u-lg-1-3 pure-u-22-24">
     <h2 class="window-title">{"Manage tags"|t}</h2>
-    <form method="POST" action="#" name="changetag" id="changetag">
+    <form method="POST" action="{$base_path}/manage-tags" name="changetag" id="changetag">
       <div>
         <input type="text" name="fromtag" aria-label="{'Tag'|t}" placeholder="{'Tag'|t}" value="{$fromtag}"
                list="tagsList" autocomplete="off" class="awesomplete autofocus" data-minChars="1">
@@ -32,7 +32,7 @@
       </div>
     </form>
 
-    <p>{'You can also edit tags in the'|t} <a href="./tag-list?sort=usage">{'tag list'|t}</a>.</p>
+    <p>{'You can also edit tags in the'|t} <a href="{$base_path}/tag-list?sort=usage">{'tag list'|t}</a>.</p>
   </div>
 </div>
 {include="page.footer"}
index 46bef05207b1d39ff07e437d2e9faa5d8ecfe9ac..9b4401a429178f68f43f96750e5cca6934abaa2c 100644 (file)
@@ -11,7 +11,7 @@
 {$ratioInput='7-12'}
 {$ratioInputMobile='1-8'}
 
-<form method="POST" action="#" name="configform" id="configform">
+<form method="POST" action="{$base_path}/configure" name="configform" id="configform">
   <div class="pure-g">
     <div class="pure-u-lg-1-8 pure-u-1-24"></div>
     <div class="pure-u-lg-3-4 pure-u-22-24 page-form page-form-complete">
@@ -35,7 +35,7 @@
           <div class="form-label">
             <label for="titleLink">
               <span class="label-name">{'Home link'|t}</span><br>
-              <span class="label-desc">{'Default value'|t}: ./</span>
+              <span class="label-desc">{'Default value'|t}: {$base_path}</span>
             </label>
           </div>
         </div>
                 {if="! $gd_enabled"}
                   {'You need to enable the extension <code>php-gd</code> to use thumbnails.'|t}
                 {elseif="$thumbnails_enabled"}
-                  <a href="./?do=thumbs_update">{'Synchronize thumbnails'|t}</a>
+                  <a href="{$base_path}/?do=thumbs_update">{'Synchronize thumbnails'|t}</a>
                 {/if}
               </span>
             </label>
index 9ccd1e61836af2ed640d599a793641f008a0a154..aa34bd1c5d66bf2e1fc19679e32b85f02ba19d40 100644 (file)
@@ -11,7 +11,7 @@
   <div class="pure-u-lg-2-3 pure-u-22-24 page-form page-visitor" id="daily">
     <h2 class="window-title">
       {'The Daily Shaarli'|t}
-      <a href="./daily-rss" title="{'1 RSS entry per day'|t}"><i class="fa fa-rss"></i></a>
+      <a href="{$base_path}/daily-rss" title="{'1 RSS entry per day'|t}"><i class="fa fa-rss"></i></a>
     </h2>
 
     <div id="plugin_zone_start_daily" class="plugin_zone">
@@ -25,7 +25,7 @@
       <div class="pure-g">
         <div class="pure-u-lg-1-3 pure-u-1 center">
           {if="$previousday"}
-            <a href="./daily?day={$previousday}">
+            <a href="{$base_path}/daily?day={$previousday}">
               <i class="fa fa-arrow-left"></i>
               {'Previous day'|t}
             </a>
@@ -36,7 +36,7 @@
         </div>
         <div class="pure-u-lg-1-3 pure-u-1 center">
           {if="$nextday"}
-            <a href="./daily?day={$nextday}">
+            <a href="{$base_path}/daily?day={$nextday}">
               {'Next day'|t}
               <i class="fa fa-arrow-right"></i>
             </a>
@@ -69,7 +69,7 @@
                 {$link=$value}
                 <div class="daily-entry">
                   <div class="daily-entry-title center">
-                    <a href="./?{$link.shorturl}" title="{'Permalink'|t}">
+                    <a href="{$base_path}/?{$link.shorturl}" title="{'Permalink'|t}">
                       <i class="fa fa-link"></i>
                     </a>
                     <a href="{$link.real_url}">{$link.title}</a>
   </div>
 </div>
 {include="page.footer"}
-<script src="js/thumbnails.min.js?v={$version_hash}"></script>
+<script src="{$asset_path}/js/thumbnails.min.js?v={$version_hash}#"></script>
 </body>
 </html>
 
index 9f6d6b74dbf672a329edeb066918c28fb48e9989..f3adcbb0728771135512213f9f574d09a940931e 100644 (file)
@@ -9,7 +9,7 @@
     <div class="pure-u-lg-1-5 pure-u-1-24"></div>
     <form method="post"
           name="linkform"
-          action="./shaare"
+          action="{$base_path}/shaare"
           class="page-form pure-u-lg-3-5 pure-u-22-24 page-form page-form-light"
     >
       <h2 class="window-title">
@@ -73,7 +73,7 @@
         <input type="submit" name="save_edit" class="" id="button-save-edit"
                value="{if="$link_is_new"}{'Save'|t}{else}{'Apply Changes'|t}{/if}">
         {if="!$link_is_new"}
-        <a href="?delete_link&amp;lf_linkdate={$link.id}&amp;token={$token}"
+        <a href="{$base_path}/?delete_link&amp;lf_linkdate={$link.id}&amp;token={$token}"
            title="" name="delete_link" class="button button-red confirm-delete">
           {'Delete'|t}
         </a>
index ef1dfd73e1759ea7f60f3dc3ec503133bdd415a4..4abac9cae02dfb841b4a45ddebb743d2e423fbfb 100644 (file)
@@ -15,7 +15,7 @@
       </pre>
   {/if}
 
-  <img src="img/sad_star.png" alt="">
+  <img src="{asset_path}/img/sad_star.png#" alt="">
 </div>
 {include="page.footer"}
 </body>
index 99c01b11523a39fa72bc7da02e3b4582d01faa7f..91cf78b6eb1cae84138d6e8a1111c126e752c39d 100644 (file)
@@ -6,7 +6,7 @@
 <body>
 {include="page.header"}
 
-<form method="GET" action="#" name="exportform" id="exportform">
+<form method="GET" action="{$base_path}/?do=export" name="exportform" id="exportform">
   <div class="pure-g">
     <div class="pure-u-lg-1-4 pure-u-1-24"></div>
     <div class="pure-u-lg-1-2 pure-u-22-24 page-form page-form-complete">
index 3d8610f0d7022c1f58a6630ed29cb8279f4ecafe..97203d93073a780554d908559861b2136ac7102e 100644 (file)
@@ -6,7 +6,7 @@
 <body>
 {include="page.header"}
 
-<form method="POST" action="./?do=import" enctype="multipart/form-data" name="uploadform" id="uploadform">
+<form method="POST" action="{$base_path}/?do=import" enctype="multipart/form-data" name="uploadform" id="uploadform">
   <div class="pure-g">
     <div class="pure-u-lg-1-4 pure-u-1-24"></div>
     <div class="pure-u-lg-1-2 pure-u-22-24 page-form page-form-complete">
index 07a487bb03ae0249d64ecf24a98664444218307c..0f6a66280fa99c6686cb4f9d50f6866979265a7e 100644 (file)
@@ -5,11 +5,11 @@
 <meta name="referrer" content="same-origin">
 <link rel="alternate" type="application/atom+xml" href="{$feedurl}feed-atom?{$searchcrits}#" title="ATOM Feed" />
 <link rel="alternate" type="application/rss+xml" href="{$feedurl}feed-rss?{$searchcrits}#" title="RSS Feed" />
-<link href="img/favicon.png" rel="shortcut icon" type="image/png" />
-<link href="img/apple-touch-icon.png" rel="apple-touch-icon" sizes="180x180" />
-<link type="text/css" rel="stylesheet" href="css/shaarli.min.css?v={$version_hash}" />
+<link href="{$asset_path}/img/favicon.png#" rel="shortcut icon" type="image/png" />
+<link href="{$asset_path}/img/apple-touch-icon.png#" rel="apple-touch-icon" sizes="180x180" />
+<link type="text/css" rel="stylesheet" href="{$asset_path}/css/shaarli.min.css?v={$version_hash}#" />
 {if="$formatter==='markdown'"}
-  <link type="text/css" rel="stylesheet" href="css/markdown.min.css?v={$version_hash}" />
+  <link type="text/css" rel="stylesheet" href="{$asset_path}/css/markdown.min.css?v={$version_hash}#" />
 {/if}
 {loop="$plugins_includes.css_files"}
   <link type="text/css" rel="stylesheet" href="{$value}?v={$version_hash}#"/>
@@ -17,7 +17,7 @@
 {if="is_file('data/user.css')"}
   <link type="text/css" rel="stylesheet" href="data/user.css#" />
 {/if}
-<link rel="search" type="application/opensearchdescription+xml" href="./open-search#"
+<link rel="search" type="application/opensearchdescription+xml" href="{$base_path}/open-search#"
       title="Shaarli search - {$shaarlititle}" />
 {if="! empty($links) && count($links) === 1"}
   {$link=reset($links)}
index c6f501f0aa25c30c1dae2df8bab256027d89b838..6f96c01915df69f53d80225e0b1328083e676edb 100644 (file)
@@ -10,7 +10,7 @@
 {$ratioLabelMobile='7-8'}
 {$ratioInputMobile='1-8'}
 
-<form method="POST" action="#" name="installform" id="installform">
+<form method="POST" action="{$base_path}/?do=install" name="installform" id="installform">
 <div class="pure-g">
   <div class="pure-u-lg-1-6 pure-u-1-24"></div>
   <div class="pure-u-lg-2-3 pure-u-22-24 page-form page-form-complete">
index e574a109678cc1d03b40c738f6ea8a7e776728e2..8951359501ad46297e082d9dff0882663cf7a05c 100644 (file)
@@ -94,7 +94,7 @@
           {'tagged'|t}
           {loop="$exploded_tags"}
               <span class="label label-tag" title="{'Remove tag'|t}">
-                <a href="./remove-tag/{function="urlencode($value)"}" aria-label="{'Remove tag'|t}">
+                <a href="{$base_path}/remove-tag/{function="urlencode($value)"}" aria-label="{'Remove tag'|t}">
                   {$value}<span class="remove"><i class="fa fa-times" aria-hidden="true"></i></span>
                 </a>
               </span>
                 {$tag_counter=count($value.taglist)}
                 {loop="value.taglist"}
                   <span class="label label-tag" title="{$strAddTag}">
-                    <a href="./add-tag/{$value|urlencode}">{$value}</a>
+                    <a href="{$base_path}/add-tag/{$value|urlencode}">{$value}</a>
                   </span>
                   {if="$tag_counter - 1 != $counter"}&middot;{/if}
                 {/loop}
                       <input type="checkbox" class="link-checkbox" value="{$value.id}">
                     </span>
                     <span class="linklist-item-infos-controls-item ctrl-edit">
-                      <a href="?edit_link={$value.id}" aria-label="{$strEdit}" title="{$strEdit}"><i class="fa fa-pencil-square-o edit-link" aria-hidden="true"></i></a>
+                      <a href="{$base_path}/?edit_link={$value.id}" aria-label="{$strEdit}" title="{$strEdit}"><i class="fa fa-pencil-square-o edit-link" aria-hidden="true"></i></a>
                     </span>
                     <span class="linklist-item-infos-controls-item ctrl-delete">
-                      <a href="?delete_link&amp;lf_linkdate={$value.id}&amp;token={$token}" aria-label="{$strDelete}"
+                      <a href="{$base_path}/?delete_link&amp;lf_linkdate={$value.id}&amp;token={$token}" aria-label="{$strDelete}"
                          title="{$strDelete}" class="delete-link pure-u-0 pure-u-lg-visible confirm-delete">
                         <i class="fa fa-trash" aria-hidden="true"></i>
                       </a>
                     </span>
                     <span class="linklist-item-infos-controls-item ctrl-pin">
-                      <a href="./?do=pin&amp;id={$value.id}&amp;token={$token}"
+                      <a href="{$base_path}/?do=pin&amp;id={$value.id}&amp;token={$token}"
                          title="{$strToggleSticky}" aria-label="{$strToggleSticky}" class="pin-link {if="$value.sticky"}pinned-link{/if} pure-u-0 pure-u-lg-visible">
                         <i class="fa fa-thumb-tack" aria-hidden="true"></i>
                       </a>
                     </div>
                   {/if}
                 {/if}
-                <a href="?{$value.shorturl}" title="{$strPermalink}">
+                <a href="{$base_path}/?{$value.shorturl}" title="{$strPermalink}">
                   {if="!$hide_timestamps || $is_logged_in"}
                     {$updated=$value.updated_timestamp ? $strEdited. format_date($value.updated) : $strPermalink}
                     <span class="linkdate" title="{$updated}">
                 {/if}
                 {if="$is_logged_in"}
                   &middot;
-                  <a href="?delete_link&amp;lf_linkdate={$value.id}&amp;token={$token}" aria-label="{$strDelete}"
+                  <a href="{$base_path}/?delete_link&amp;lf_linkdate={$value.id}&amp;token={$token}" aria-label="{$strDelete}"
                      title="{$strDelete}" class="delete-link confirm-delete">
                     <i class="fa fa-trash" aria-hidden="true"></i>
                   </a>
                   &middot;
-                  <a href="?edit_link={$value.id}" aria-label="{$strEdit}" title="{$strEdit}"><i class="fa fa-pencil-square-o edit-link" aria-hidden="true"></i></a>
+                  <a href="{$base_path}/?edit_link={$value.id}" aria-label="{$strEdit}" title="{$strEdit}"><i class="fa fa-pencil-square-o edit-link" aria-hidden="true"></i></a>
                 {/if}
               </div>
             </div>
 </div>
 
 {include="page.footer"}
-<script src="js/thumbnails.min.js?v={$version_hash}"></script>
+<script src="{$asset_path}/js/thumbnails.min.js?v={$version_hash}#"></script>
 </body>
 </html>
index 2b60172565c353c063a0b0ddfb40fc2a48e1963b..e1952b799d6113e10834f89e61a22811b86e91b3 100644 (file)
@@ -6,14 +6,14 @@
           {'Filters'|t}
         </span>
         {if="$is_logged_in"}
-        <a href="./visibility/private" aria-label="{'Only display private links'|t}" title="{'Only display private links'|t}"
+        <a href="{$base_path}/visibility/private" aria-label="{'Only display private links'|t}" title="{'Only display private links'|t}"
            class="{if="$visibility==='private'"}filter-on{else}filter-off{/if}"
         ><i class="fa fa-user-secret" aria-hidden="true"></i></a>
-        <a href="./visibility/public" aria-label="{'Only display public links'|t}" title="{'Only display public links'|t}"
+        <a href="{$base_path}/visibility/public" aria-label="{'Only display public links'|t}" title="{'Only display public links'|t}"
            class="{if="$visibility==='public'"}filter-on{else}filter-off{/if}"
         ><i class="fa fa-globe" aria-hidden="true"></i></a>
         {/if}
-        <a href="./untagged-only" aria-label="{'Filter untagged links'|t}" title="{'Filter untagged links'|t}"
+        <a href="{$base_path}/untagged-only" aria-label="{'Filter untagged links'|t}" title="{'Filter untagged links'|t}"
            class={if="$untaggedonly"}"filter-on"{else}"filter-off"{/if}
         ><i class="fa fa-tag" aria-hidden="true"></i></a>
         <a href="#" aria-label="{'Select all'|t}" title="{'Select all'|t}"
 
     <div class="linksperpage pure-u-1-3">
       <div class="pure-u-0 pure-u-lg-visible">{'Links per page'|t}</div>
-      <a href="./links-per-page?nb=20">20</a>
-      <a href="./links-per-page?nb=50">50</a>
-      <a href="./links-per-page?nb=100">100</a>
-      <form method="GET" class="pure-u-0 pure-u-lg-visible" action="./links-per-page">
+      <a href="{$base_path}/links-per-page?nb=20">20</a>
+      <a href="{$base_path}/links-per-page?nb=50">50</a>
+      <a href="{$base_path}/links-per-page?nb=100">100</a>
+      <form method="GET" class="pure-u-0 pure-u-lg-visible" action="{$base_path}/links-per-page">
         <input type="text" name="nb" placeholder="133">
       </form>
       <a href="#" class="filter-off fold-all pure-u-0 pure-u-lg-visible" aria-label="{'Fold all'|t}" title="{'Fold all'|t}">
index 0899826b66f7b2f73d1437f2e4c49a27e47f8cbd..d72917de52f880b4a7516f44dd072eb596e21c31 100644 (file)
@@ -10,7 +10,7 @@
     {/if}
     &middot;
     {'The personal, minimalist, super-fast, database free, bookmarking service'|t} {'by the Shaarli community'|t} &middot;
-    <a href="doc/html/index.html" rel="nofollow">{'Documentation'|t}</a>
+    <a href="{$base_path}/doc/html/index.html" rel="nofollow">{'Documentation'|t}</a>
       {loop="$plugins_footer.text"}
           {$value}
       {/loop}
@@ -39,4 +39,5 @@
   </span>
 </div>
 
-<script src="js/shaarli.min.js?v={$version_hash}"></script>
+<input type="hidden" name="js_base_path" value="{$base_path}" />
+<script src="{$asset_path}/js/shaarli.min.js?v={$version_hash}#"></script>
index cf59e89deab5c1031edd84646d715e40d62a6877..7117e3ca2f0e879a5809143f9d15ecf73b30c646 100644 (file)
         </li>
         {if="$is_logged_in || $openshaarli"}
           <li class="pure-menu-item">
-            <a href="./add-shaare" class="pure-menu-link" id="shaarli-menu-shaare">
+            <a href="{$base_path}/add-shaare" class="pure-menu-link" id="shaarli-menu-shaare">
               <i class="fa fa-plus" aria-hidden="true"></i> {'Shaare'|t}
             </a>
           </li>
           <li class="pure-menu-item" id="shaarli-menu-tools">
-            <a href="./tools" class="pure-menu-link">{'Tools'|t}</a>
+            <a href="{$base_path}/tools" class="pure-menu-link">{'Tools'|t}</a>
           </li>
         {/if}
         <li class="pure-menu-item" id="shaarli-menu-tags">
-          <a href="./tag-cloud" class="pure-menu-link">{'Tag cloud'|t}</a>
+          <a href="{$base_path}/tag-cloud" class="pure-menu-link">{'Tag cloud'|t}</a>
         </li>
         {if="$thumbnails_enabled"}
           <li class="pure-menu-item" id="shaarli-menu-picwall">
-            <a href="./picture-wall?{function="ltrim($searchcrits, '&')"}" class="pure-menu-link">{'Picture wall'|t}</a>
+            <a href="{$base_path}/picture-wall?{function="ltrim($searchcrits, '&')"}" class="pure-menu-link">{'Picture wall'|t}</a>
           </li>
         {/if}
         <li class="pure-menu-item" id="shaarli-menu-daily">
-          <a href="./daily" class="pure-menu-link">{'Daily'|t}</a>
+          <a href="{$base_path}/daily" class="pure-menu-link">{'Daily'|t}</a>
         </li>
         {loop="$plugins_header.buttons_toolbar"}
           <li class="pure-menu-item shaarli-menu-plugin">
           </li>
         {/loop}
         <li class="pure-menu-item pure-u-lg-0 shaarli-menu-mobile" id="shaarli-menu-mobile-rss">
-            <a href="./feed-{$feed_type}?{$searchcrits}" class="pure-menu-link">{'RSS Feed'|t}</a>
+            <a href="{$base_path}/feed-{$feed_type}?{$searchcrits}" class="pure-menu-link">{'RSS Feed'|t}</a>
         </li>
         {if="$is_logged_in"}
           <li class="pure-menu-item pure-u-lg-0 shaarli-menu-mobile" id="shaarli-menu-mobile-logout">
-            <a href="./logout" class="pure-menu-link">{'Logout'|t}</a>
+            <a href="{$base_path}/logout" class="pure-menu-link">{'Logout'|t}</a>
           </li>
         {else}
           <li class="pure-menu-item pure-u-lg-0 shaarli-menu-mobile" id="shaarli-menu-mobile-login">
-            <a href="./login" class="pure-menu-link">{'Login'|t}</a>
+            <a href="{$base_path}/login" class="pure-menu-link">{'Login'|t}</a>
           </li>
         {/if}
       </ul>
             </a>
           </li>
           <li class="pure-menu-item" id="shaarli-menu-desktop-rss">
-            <a href="./feed-{$feed_type}?{$searchcrits}" class="pure-menu-link" title="{'RSS Feed'|t}" aria-label="{'RSS Feed'|t}">
+            <a href="{$base_path}/feed-{$feed_type}?{$searchcrits}" class="pure-menu-link" title="{'RSS Feed'|t}" aria-label="{'RSS Feed'|t}">
               <i class="fa fa-rss" aria-hidden="true"></i>
             </a>
           </li>
           {if="!$is_logged_in"}
             <li class="pure-menu-item" id="shaarli-menu-desktop-login">
-              <a href="./login" class="pure-menu-link"
+              <a href="{$base_path}/login" class="pure-menu-link"
                  data-open-id="header-login-form"
                  id="login-button" aria-label="{'Login'|t}" title="{'Login'|t}">
                 <i class="fa fa-user" aria-hidden="true"></i>
@@ -88,7 +88,7 @@
             </li>
           {else}
             <li class="pure-menu-item" id="shaarli-menu-desktop-logout">
-              <a href="./logout" class="pure-menu-link" aria-label="{'Logout'|t}" title="{'Logout'|t}">
+              <a href="{$base_path}/logout" class="pure-menu-link" aria-label="{'Logout'|t}" title="{'Logout'|t}">
                 <i class="fa fa-sign-out" aria-hidden="true"></i>
               </a>
             </li>
index 5343abd6a7421131b6f7aca004c171d770d0de79..1e97b36634e371422d335781d0a56df01a0b4fd9 100644 (file)
@@ -9,7 +9,7 @@
 {if="count($linksToDisplay)===0 && $is_logged_in"}
   <div class="pure-g pure-alert pure-alert-warning page-single-alert">
     <div class="pure-u-1 center">
-      {'There is no cached thumbnail. Try to <a href="./?do=thumbs_update">synchronize them</a>.'|t}
+      {'There is no cached thumbnail. Try to <a href="{$base_path}/do=thumbs_update">synchronize them</a>.'|t}
     </div>
   </div>
 {/if}
@@ -52,7 +52,7 @@
 </div>
 
 {include="page.footer"}
-<script src="js/thumbnails.min.js?v={$version_hash}"></script>
+<script src="{$asset_path}/js/thumbnails.min.js?v={$version_hash}#"></script>
 </body>
 </html>
 
index a017a2cea021a946c64c3fa03c077a9077e6fc84..1536c31132b0f811389ab54e353b3e415af1d8ef 100644 (file)
@@ -16,7 +16,7 @@
   <div class="clear"></div>
 </noscript>
 
-<form method="POST" action="./?do=save_pluginadmin" name="pluginform" id="pluginform" class="pluginform-container">
+<form method="POST" action="{$base_path}/?do=save_pluginadmin" name="pluginform" id="pluginform" class="pluginform-container">
   <div class="pure-g">
     <div class="pure-u-lg-1-8 pure-u-1-24"></div>
     <div class="pure-u-lg-3-4 pure-u-22-24 page-form page-form-complete">
   <input type="hidden" name="token" value="{$token}">
 </form>
 
-<form action="./?do=save_pluginadmin" method="POST">
+<form action="{$base_path}/?do=save_pluginadmin" method="POST">
   <div class="pure-g">
     <div class="pure-u-lg-1-8 pure-u-1-24"></div>
     <div class="pure-u-lg-3-4 pure-u-22-24 page-form page-form-light">
 </form>
 
 {include="page.footer"}
-<script src="js/pluginsadmin.min.js?v={$version_hash}"></script>
+<script src="{$asset_path}/js/pluginsadmin.min.js?v={$version_hash}#"></script>
 
 </body>
 </html>
index bf5433573179cce250661fb45329525449d9ec2a..024882ec723db3310b145466f750a1eb1269a4d4 100644 (file)
@@ -15,7 +15,7 @@
     <h2 class="window-title">{'Tag cloud'|t} - {$countTags} {'tags'|t}</h2>
     {if="!empty($search_tags)"}
     <p class="center">
-      <a href="./?searchtags={$search_tags|urlencode}" class="pure-button pure-button-shaarli">
+      <a href="{$base_path}/?searchtags={$search_tags|urlencode}" class="pure-button pure-button-shaarli">
         {'List all links with those tags'|t}
       </a>
     </p>
@@ -48,8 +48,8 @@
 
     <div id="cloudtag" class="cloudtag-container">
       {loop="tags"}
-        <a href="./?searchtags={$key|urlencode} {$search_tags|urlencode}" style="font-size:{$value.size}em;">{$key}</a
-        ><a href="./add-tag/{$key|urlencode}" title="{'Filter by tag'|t}" class="count">{$value.count}</a>
+        <a href="{$base_path}/?searchtags={$key|urlencode} {$search_tags|urlencode}" style="font-size:{$value.size}em;">{$key}</a
+        ><a href="{$base_path}/add-tag/{$key|urlencode}" title="{'Filter by tag'|t}" class="count">{$value.count}</a>
         {loop="$value.tag_plugin"}
           {$value}
         {/loop}
index 3adcfd1f19b6f8a0e3e6fbbc7d2ce52e772ee46b..51f42333669273b635ce542533f368da97a6f9e5 100644 (file)
@@ -15,7 +15,7 @@
     <h2 class="window-title">{'Tag list'|t} - {$countTags} {'tags'|t}</h2>
     {if="!empty($search_tags)"}
       <p class="center">
-        <a href="./?searchtags={$search_tags|urlencode}" class="pure-button pure-button-shaarli">
+        <a href="{$base_path}/?searchtags={$search_tags|urlencode}" class="pure-button pure-button-shaarli">
           {'List all links with those tags'|t}
         </a>
       </p>
           <div class="pure-u-1">
             {if="$is_logged_in===true"}
               <a href="#" class="delete-tag" aria-label="{'Delete'|t}"><i class="fa fa-trash" aria-hidden="true"></i></a>&nbsp;&nbsp;
-              <a href="./manage-tags?fromtag={$key|urlencode}" class="rename-tag" aria-label="{'Rename tag'|t}">
+              <a href="{$base_path}/manage-tags?fromtag={$key|urlencode}" class="rename-tag" aria-label="{'Rename tag'|t}">
                 <i class="fa fa-pencil-square-o {$key}" aria-hidden="true"></i>
               </a>
             {/if}
 
-            <a href="./add-tag/{$key|urlencode}" title="{'Filter by tag'|t}" class="count">{$value}</a>
-            <a href="./?searchtags={$key|urlencode} {$search_tags|urlencode}" class="tag-link">{$key}</a>
+            <a href="{$base_path}/add-tag/{$key|urlencode}" title="{'Filter by tag'|t}" class="count">{$value}</a>
+            <a href="{$base_path}/?searchtags={$key|urlencode} {$search_tags|urlencode}" class="tag-link">{$key}</a>
 
             {loop="$value.tag_plugin"}
               {$value}
index f467e34a5b92016a768870d2ae55b2b84a40bf98..6cb1a1143ab31d4d8a9d00b1ed7dc6bac2bd26b2 100644 (file)
@@ -1,8 +1,8 @@
 <div class="pure-g">
   <div class="pure-u-1 pure-alert pure-alert-success tag-sort">
     {'Sort by:'|t}
-    <a href="./tag-cloud">{'Cloud'|t}</a> &middot;
-    <a href="./tag-list?sort=usage">{'Most used'|t}</a> &middot;
-    <a href="./tag-list?sort=alpha">{'Alphabetical'|t}</a>
+    <a href="{$base_path}/tag-cloud">{'Cloud'|t}</a> &middot;
+    <a href="{$base_path}/tag-list?sort=usage">{'Most used'|t}</a> &middot;
+    <a href="{$base_path}/tag-list?sort=alpha">{'Alphabetical'|t}</a>
   </div>
 </div>
index 5f9bef08e48b91b806c03894bcb19dc7d7bf1253..504644ca84fa00d60ccca5fe2f5be98bc3b3ebcf 100644 (file)
@@ -43,6 +43,6 @@
 </div>
 
 {include="page.footer"}
-<script src="js/thumbnails_update.min.js?v={$version_hash}"></script>
+<script src="{$asset_path}/js/thumbnails_update.min.js?v={$version_hash}#"></script>
 </body>
 </html>
index 6e432e00a9bbfd9dd859c1df64601d2afc4b7e26..296abed1afad57f641783b71c7333a8f4aea99ab 100644 (file)
   <div class="pure-u-lg-1-3 pure-u-22-24 page-form page-form-light">
     <h2 class="window-title">{'Settings'|t}</h2>
     <div class="tools-item">
-      <a href="./configure" title="{'Change Shaarli settings: title, timezone, etc.'|t}">
+      <a href="{$base_path}/configure" title="{'Change Shaarli settings: title, timezone, etc.'|t}">
         <span class="pure-button pure-u-lg-2-3 pure-u-3-4">{'Configure your Shaarli'|t}</span>
       </a>
     </div>
     <div class="tools-item">
-      <a href="./?do=pluginadmin" title="{'Enable, disable and configure plugins'|t}">
+      <a href="{$base_path}/?do=pluginadmin" title="{'Enable, disable and configure plugins'|t}">
         <span class="pure-button pure-u-lg-2-3 pure-u-3-4">{'Plugin administration'|t}</span>
       </a>
     </div>
     {if="!$openshaarli"}
       <div class="tools-item">
-        <a href="./?do=changepasswd" title="{'Change your password'|t}">
+        <a href="{$base_path}/?do=changepasswd" title="{'Change your password'|t}">
           <span class="pure-button pure-u-lg-2-3 pure-u-3-4">{'Change password'|t}</span>
         </a>
       </div>
     {/if}
     <div class="tools-item">
-      <a href="./manage-tags" title="{'Rename or delete a tag in all links'|t}">
+      <a href="{$base_path}/manage-tags" title="{'Rename or delete a tag in all links'|t}">
         <span class="pure-button pure-u-lg-2-3 pure-u-3-4">{'Manage tags'|t}</span>
       </a>
     </div>
     <div class="tools-item">
-      <a href="./?do=import"
+      <a href="{$base_path}/?do=import"
          title="{'Import Netscape HTML bookmarks (as exported from Firefox, Chrome, Opera, delicious...)'|t}">
         <span class="pure-button pure-u-lg-2-3 pure-u-3-4">{'Import links'|t}</span>
       </a>
     </div>
     <div class="tools-item">
-      <a href="./?do=export"
+      <a href="{$base_path}/?do=export"
          title="{'Export Netscape HTML bookmarks (which can be imported in Firefox, Chrome, Opera, delicious...)'|t}">
         <span class="pure-button pure-u-lg-2-3 pure-u-3-4">{'Export database'|t}</span>
       </a>
@@ -47,7 +47,7 @@
 
     {if="$thumbnails_enabled"}
       <div class="tools-item">
-        <a href="./?do=thumbs_update" title="{'Synchronize all link thumbnails'|t}">
+        <a href="{$base_path}/?do=thumbs_update" title="{'Synchronize all link thumbnails'|t}">
           <span class="pure-button pure-u-lg-2-3 pure-u-3-4">{'Synchronize thumbnails'|t}</span>
         </a>
       </div>
index 53e98e2e0f36ffb61135122fea42f9461930b9b0..0fef0f08be9a3b3e1ca7035a5b564a8247647c51 100644 (file)
@@ -10,7 +10,7 @@
 <div class="error-container">
     <h1>404 Not found <small>Oh crap!</small></h1>
     <p>{$error_message}</p>
-    <p>Would you mind <a href="?">clicking here</a>?</p>
+    <p>Would you mind <a href="{$base_path}/">clicking here</a>?</p>
 </div>
 {include="page.footer"}
 </body>
index 13dbb36e8963de201753540eef7fea2f7f119e2b..e1d652255763833b784bc06aa8c40e59cd175af4 100644 (file)
@@ -5,7 +5,7 @@
 <div id="pageheader">
        {include="page.header"}
        <div id="headerform">
-               <form method="GET" action="./shaare" name="addform" class="addform">
+               <form method="GET" action="{$base_path}/shaare" name="addform" class="addform">
                        <input type="text" name="post" class="linkurl">
                        <input type="submit" value="Add link" class="bigbutton">
                </form>
index a87fdce70e7e1679977283f9fd89e4952f330da3..d04c69a90a829e901c4d0f10567fd7a8bb3a4eff 100644 (file)
@@ -16,7 +16,7 @@
       <tr>
         <td><b>Home link:</b></td>
         <td><input type="text" name="titleLink" id="titleLink" size="50" value="{$titleLink}"><br/><label
-            for="titleLink">(default value is: ./)</label></td>
+            for="titleLink">(default value is: {$base_path}/)</label></td>
       </tr>
 
       <tr>
             {if="! $gd_enabled"}
               {'You need to enable the extension <code>php-gd</code> to use thumbnails.'|t}
             {elseif="$thumbnails_enabled"}
-              <a href="./?do=thumbs_update">{'Synchonize thumbnails'|t}</a>
+              <a href="{$base_path}/?do=thumbs_update">{'Synchonize thumbnails'|t}</a>
             {/if}
           </label>
         </td>
index a459e21afe662c2c02e92f8df771d332e6b3c807..74f6cdc74417194f9931a1ceabdd51b701575b4f 100644 (file)
@@ -14,9 +14,9 @@
 
     <div class="dailyAbout">
         All links of one day<br>in a single page.<br>
-        {if="$previousday"} <a href="./daily&amp;day={$previousday}"><b>&lt;</b>Previous day</a>{else}<b>&lt;</b>Previous day{/if}
+        {if="$previousday"} <a href="{$base_path}/daily&amp;day={$previousday}"><b>&lt;</b>Previous day</a>{else}<b>&lt;</b>Previous day{/if}
         -
-        {if="$nextday"}<a href="./daily&amp;day={$nextday}">Next day<b>&gt;</b></a>{else}Next day<b>&gt;</b>{/if}
+        {if="$nextday"}<a href="{$base_path}/daily&amp;day={$nextday}">Next day<b>&gt;</b></a>{else}Next day<b>&gt;</b>{/if}
         <br>
 
         {loop="$daily_about_plugin"}
         {/loop}
 
         <br>
-        <a href="./daily-rss" title="1 RSS entry per day"><img src="img/feed-icon-14x14.png" alt="rss_feed">Daily RSS Feed</a>
+        <a href="{$base_path}/daily-rss" title="1 RSS entry per day"><img src="{$asset_path}/img/feed-icon-14x14.png#" alt="rss_feed">Daily RSS Feed</a>
     </div>
 
     <div class="dailyTitle">
-        <img src="img/floral_left.png" width="51" height="50" class="nomobile" alt="floral_left">
+        <img src="{$asset_path}/img/floral_left.png#" width="51" height="50" class="nomobile" alt="floral_left">
         The Daily Shaarli
-        <img src="img/floral_right.png" width="51" height="50" class="nomobile" alt="floral_right">
+        <img src="{$asset_path}/img/floral_right.png#" width="51" height="50" class="nomobile" alt="floral_right">
     </div>
 
     <div class="dailyDate">
                     {$link=$value}
                     <div class="dailyEntry">
                         <div class="dailyEntryPermalink">
-                            <a href="?{$value.shorturl}">
-                                <img src="img/squiggle.png" width="25" height="26" title="permalink" alt="permalink">
+                            <a href="{$base_path}/?{$value.shorturl}">
+                                <img src="{$asset_path}/img/squiggle.png#" width="25" height="26" title="permalink" alt="permalink">
                             </a>
                         </div>
                         {if="!$hide_timestamps || $is_logged_in"}
                             <div class="dailyEntryLinkdate">
-                                <a href="?{$value.shorturl}">{function="strftime('%c', $link.timestamp)"}</a>
+                                <a href="{$base_path}/?{$value.shorturl}">{function="strftime('%c', $link.timestamp)"}</a>
                             </div>
                         {/if}
                         {if="$link.tags"}
             {$value}
         {/loop}
     </div>
-    <div id="closing"><img src="img/squiggle_closing.png" width="66" height="61" alt="-"></div>
+    <div id="closing"><img src="{$asset_path}/img/squiggle_closing.png#" width="66" height="61" alt="-"></div>
 </div>
 {include="page.footer"}
-<script src="js/thumbnails.min.js?v={$version_hash}"></script>
+<script src="{$asset_path}/js/thumbnails.min.js?v={$version_hash}#"></script>
 </body>
 </html>
index 6f7a330f4f979ab1f044f482f3a56dc26f24adae..593fe71a25a424cc27a1eaee345885056ed03ce1 100644 (file)
@@ -48,7 +48,7 @@
             {/if}
             <input type="submit" value="Save" name="save_edit" class="bigbutton">
             {if="!$link_is_new && isset($link.id)"}
-              <a href="?delete_link&amp;lf_linkdate={$link.id}&amp;token={$token}"
+              <a href="{$base_path}/?delete_link&amp;lf_linkdate={$link.id}&amp;token={$token}"
                  name="delete_link" class="bigbutton"
                  onClick="return confirmDeleteLink();">
                 {'Delete'|t}
index b6e62be09e9ff6f404c388c82c8c15e08413b496..64f54cd287be2d44f956eaa234d19bda0c13a419 100644 (file)
@@ -18,7 +18,7 @@
         </pre>
     {/if}
 
-    <p>Would you mind <a href="?">clicking here</a>?</p>
+    <p>Would you mind <a href="{$base_path}/">clicking here</a>?</p>
 </div>
 {include="page.footer"}
 </body>
index 2ab2cc0a898b34e74b9189339f63a217770cd46d..a2e377510d43a5d333d215e03d24f2e55b433155 100644 (file)
@@ -6,7 +6,7 @@
   {include="page.header"}
   <div id="uploaddiv">
     Import Netscape HTML bookmarks (as exported from Firefox/Chrome/Opera/Delicious/Diigo...) (Max: {$maxfilesize}).
-    <form method="POST" action="./?do=import" enctype="multipart/form-data"
+    <form method="POST" action="{$base_path}/?do=import" enctype="multipart/form-data"
           name="uploadform" id="uploadform">
       <input type="hidden" name="token" value="{$token}">
       <input type="hidden" name="MAX_FILE_SIZE" value="{$maxfilesize}">
index 61448eafabeea49dc8a92c9410b477979cbce6d3..7c4d9311d60d3dbdccbcaa7d1a558eedc2aa4c94 100644 (file)
@@ -8,13 +8,13 @@
 <link href="img/favicon.ico" rel="shortcut icon" type="image/x-icon" />
 <link type="text/css" rel="stylesheet" href="css/shaarli.min.css" />
 {if="$formatter==='markdown'"}
-  <link type="text/css" rel="stylesheet" href="css/markdown.min.css?v={$version_hash}" />
+  <link type="text/css" rel="stylesheet" href="{$asset_path}/css/markdown.min.css?v={$version_hash}#" />
 {/if}
 {loop="$plugins_includes.css_files"}
 <link type="text/css" rel="stylesheet" href="{$value}#"/>
 {/loop}
 {if="is_file('data/user.css')"}<link type="text/css" rel="stylesheet" href="data/user.css#" />{/if}
-<link rel="search" type="application/opensearchdescription+xml" href="./open-search#"
+<link rel="search" type="application/opensearchdescription+xml" href="{$base_path}/open-search#"
       title="Shaarli search - {$shaarlititle|htmlspecialchars}" />
 {if="! empty($links) && count($links) === 1"}
   {$link=reset($links)}
index 502abcf9e878003365fac33bce19f8b9021e7d63..8db8f70b902778b4ba67eb9a1c689559a2bedcf4 100644 (file)
                 tagged
                 {loop="$exploded_tags"}
                     <span class="linktag" title="Remove tag">
-                        <a href="./remove-tag/{function="urlencode($value)"}">{$value} <span class="remove">x</span></a>
+                        <a href="{$base_path}/remove-tag/{function="urlencode($value)"}">{$value} <span class="remove">x</span></a>
                     </span>
                 {/loop}
             {elseif="$search_tags === false"}
                 <span class="linktag" title="Remove tag">
-                    <a href="?">untagged <span class="remove">x</span></a>
+                    <a href="{$base_path}/">untagged <span class="remove">x</span></a>
                 </span>
             {/if}
         </div>
                     <div class="linkeditbuttons">
                         <form method="GET" class="buttoneditform">
                             <input type="hidden" name="edit_link" value="{$value.id}">
-                            <input type="image" alt="Edit" src="img/edit_icon.png" title="Edit" class="button_edit">
+                            <input type="image" alt="Edit" src="{$asset_path}/img/edit_icon.png#" title="Edit" class="button_edit">
                         </form><br>
                         <form method="GET" class="buttoneditform">
                             <input type="hidden" name="lf_linkdate" value="{$value.id}">
                             <input type="hidden" name="token" value="{$token}">
                             <input type="hidden" name="delete_link">
-                            <input type="image" alt="Delete" src="img/delete_icon.png" title="Delete"
+                            <input type="image" alt="Delete" src="{$asset_path}/img/delete_icon.png#" title="Delete"
                                    class="button_delete" onClick="return confirmDeleteLink();">
                         </form>
                     </div>
                 {if="!$hide_timestamps || $is_logged_in"}
                     {$updated=$value.updated_timestamp ? 'Edited: '. format_date($value.updated) : 'Permalink'}
                     <span class="linkdate" title="Permalink">
-                        <a href="?{$value.shorturl}">
+                        <a href="{$base_path}/?{$value.shorturl}">
                             <span title="{$updated}">
                                 {$value.created|format_date}
                                 {if="$value.updated_timestamp"}*{/if}
                         </a> -
                     </span>
                 {else}
-                    <span class="linkdate" title="Short link here"><a href="?{$value.shorturl}">permalink</a> - </span>
+                    <span class="linkdate" title="Short link here"><a href="{$base_path}/?{$value.shorturl}">permalink</a> - </span>
                 {/if}
 
                 {loop="$value.link_plugin"}
                 <a href="{$value.real_url}"><span class="linkurl" title="Short link">{$value.url}</span></a><br>
                 {if="$value.tags"}
                     <div class="linktaglist">
-                    {loop="$value.taglist"}<span class="linktag" title="Add tag"><a href="./add-tag/{$value|urlencode}">{$value}</a></span> {/loop}
+                    {loop="$value.taglist"}<span class="linktag" title="Add tag"><a href="{$base_path}/add-tag/{$value|urlencode}">{$value}</a></span> {/loop}
                     </div>
                 {/if}
 
 </div>
 
     {include="page.footer"}
-<script src="js/thumbnails.min.js"></script>
+<script src="{$asset_path}/js/thumbnails.min.js#"></script>
 
 </body>
 </html>
index 797104dc10f0dcef20aeabddece86ec5232b8fce..ea6a5ea20201e2bbdb19f8cdd008f2f19e9a9aa6 100644 (file)
@@ -1,11 +1,11 @@
 <div class="paging">
 {if="$is_logged_in"}
     <div class="paging_privatelinks">
-      <a href="./visibility/private">
+      <a href="{$base_path}/visibility/private">
                {if="$visibility=='private'"}
-      <img src="img/private_16x16_active.png" width="16" height="16" title="Click to see all links" alt="Click to see all links">
+      <img src="{$asset_path}/img/private_16x16_active.png#" width="16" height="16" title="Click to see all links" alt="Click to see all links">
     {else}
-      <img src="img/private_16x16.png" width="16" height="16" title="Click to see only private links" alt="Click to see only private links">
+      <img src="{$asset_path}/img/private_16x16.png#" width="16" height="16" title="Click to see only private links" alt="Click to see only private links">
                {/if}
                </a>
 
     {/loop}
     <div class="paging_linksperpage">
         Links per page:
-        <a href="./links-per-page?nb=20">20</a>
-        <a href="./links-per-page?nb=50">50</a>
-        <a href="./links-per-page?nb=100">100</a>
-        <form method="GET" class="linksperpage" action="./links-per-page">
+        <a href="{$base_path}/links-per-page?nb=20">20</a>
+        <a href="{$base_path}/links-per-page?nb=50">50</a>
+        <a href="{$base_path}/links-per-page?nb=100">100</a>
+        <form method="GET" class="linksperpage" action="{$base_path}/links-per-page">
           <input type="text" name="nb" size="2">
         </form>
     </div>
index a3380841b5d35e00dccbafa2e7949c99ece0793a..6d9021e3678c25cfa09d6b5a897db07ba929b448 100644 (file)
@@ -23,7 +23,7 @@
 </div>
 {/if}
 
-<script src="js/shaarli.min.js"></script>
+<script src="{$asset_path}/js/shaarli.min.js#"></script>
 
 {if="$is_logged_in"}
 <script>function confirmDeleteLink() { var agree=confirm("Are you sure you want to delete this link ?"); if (agree) return true ; else return false ; }</script>
index 8f9b6cc5aec2f7e124e209102d600b9b6f8ed363..0f79d321736000d715eef8c959907f87bc99ad12 100644 (file)
 {else}
 <li><a href="{$titleLink}" class="nomobile">Home</a></li>
     {if="$is_logged_in"}
-    <li><a href="./logout">Logout</a></li>
-    <li><a href="./tools">Tools</a></li>
-    <li><a href="./add-shaare">Add link</a></li>
+    <li><a href="{$base_path}/logout">Logout</a></li>
+    <li><a href="{$base_path}/tools">Tools</a></li>
+    <li><a href="{$base_path}/add-shaare">Add link</a></li>
     {elseif="$openshaarli"}
-    <li><a href="./tools">Tools</a></li>
-    <li><a href="./add-shaare">Add link</a></li>
+    <li><a href="{$base_path}/tools">Tools</a></li>
+    <li><a href="{$base_path}/add-shaare">Add link</a></li>
     {else}
-    <li><a href="./login">Login</a></li>
+    <li><a href="{$base_path}/login">Login</a></li>
     {/if}
     <li><a href="{$feedurl}/feed-rss?{$searchcrits}" class="nomobile">RSS Feed</a></li>
     {if="$showatom"}
     <li><a href="{$feedurl}/feed-atom?{$searchcrits}" class="nomobile">ATOM Feed</a></li>
     {/if}
-    <li><a href="./tag-cloud">Tag cloud</a></li>
-    <li><a href="./picture-wall{function="ltrim($searchcrits, '&')"}">Picture wall</a></li>
-    <li><a href="./daily">Daily</a></li>
+    <li><a href="{$base_path}/tag-cloud">Tag cloud</a></li>
+    <li><a href="{$base_path}/picture-wall{function="ltrim($searchcrits, '&')"}">Picture wall</a></li>
+    <li><a href="{$base_path}/daily">Daily</a></li>
     {loop="$plugins_header.buttons_toolbar"}
         <li><a
             {loop="$value.attr"}
index b3a16791b679a06dc8cadea773d299f3cf0e701f..da3aa36c4096d2b601931c9ad88c96766690a5ac 100644 (file)
@@ -38,6 +38,6 @@
 
 {include="page.footer"}
 
-<script src="js/thumbnails.min.js"></script>
+<script src="{$asset_path}/js/thumbnails.min.js#"></script>
 </body>
 </html>
index fdc7d95ed5ba957bb78bc866f229566b95a93492..c94dc2119b8d2caacb61bbb091519da30ddb8ea8 100644 (file)
@@ -16,7 +16,7 @@
 </noscript>
 
 <div id="pluginsadmin">
-  <form action="./?do=save_pluginadmin" method="POST">
+  <form action="{$base_path}/?do=save_pluginadmin" method="POST">
     <section id="enabled_plugins">
       <h1>Enabled Plugins</h1>
 
@@ -88,7 +88,7 @@
     </section>
   </form>
 
-  <form action="./?do=save_pluginadmin" method="POST">
+  <form action="{$base_path}/?do=save_pluginadmin" method="POST">
     <section id="plugin_parameters">
       <h1>Enabled Plugin Parameters</h1>
 
index 4bc4bf88aaa69772863b4c04cf82b07767d6e6d4..5d21f2395549a27de7de4d1ebd28395589b41592 100644 (file)
@@ -12,8 +12,8 @@
 
     <div id="cloudtag">
         {loop="$tags"}
-            <a href="./add-tag/{$key|urlencode}" class="count">{$value.count}</a><a
-                href="./?searchtags={$key|urlencode}" style="font-size:{$value.size}em;">{$key}</a>
+            <a href="{$base_path}/add-tag/{$key|urlencode}" class="count">{$value.count}</a><a
+                href="{$base_path}/?searchtags={$key|urlencode}" style="font-size:{$value.size}em;">{$key}</a>
             {loop="$value.tag_plugin"}
                 {$value}
             {/loop}
index 5cad845b62d91b45dc4dd3109cfda1ee0593bea3..a1537f9c0b5864f62b5606951547caad07dbaf00 100644 (file)
@@ -23,6 +23,7 @@
 <input type="hidden" name="ids" value="{function="implode(',', $ids)"}" />
 
 {include="page.footer"}
-<script src="js/thumbnails_update.min.js?v={$version_hash}"></script>
+<input type="hidden" name="js_base_path" value="{$base_path}" />
+<script src="{$asset_path}/js/thumbnails_update.min.js?v={$version_hash}#"></script>
 </body>
 </html>
index 8f606efbd347058f1dc244a5bbec5c7d79dc6e9d..9caea9cf5b4b6344359357147a89e33f10098cd7 100644 (file)
@@ -5,17 +5,17 @@
 <div id="pageheader">
        {include="page.header"}
        <div id="toolsdiv">
-               <a href="./configure"><b>Configure your Shaarli</b><span>: Change Title, timezone...</span></a>
+               <a href="{$base_path}/configure"><b>Configure your Shaarli</b><span>: Change Title, timezone...</span></a>
                <br><br>
-               <a href="./?do=pluginadmin"><b>Plugin administration</b><span>: Enable, disable and configure plugins.</span></a>
+               <a href="{$base_path}/?do=pluginadmin"><b>Plugin administration</b><span>: Enable, disable and configure plugins.</span></a>
     <br><br>
-               {if="!$openshaarli"}<a href="?do=changepasswd"><b>Change password</b><span>: Change your password.</span></a>
+               {if="!$openshaarli"}<a href="{$base_path}/?do=changepasswd"><b>Change password</b><span>: Change your password.</span></a>
     <br><br>{/if}
-               <a href="./manage-tags"><b>Rename/delete tags</b><span>: Rename or delete a tag in all links</span></a>
+               <a href="{$base_path}/manage-tags"><b>Rename/delete tags</b><span>: Rename or delete a tag in all links</span></a>
     <br><br>
-               <a href="./?do=import"><b>Import</b><span>: Import Netscape html bookmarks (as exported from Firefox, Chrome, Opera, delicious...)</span></a>
+               <a href="{$base_path}/?do=import"><b>Import</b><span>: Import Netscape html bookmarks (as exported from Firefox, Chrome, Opera, delicious...)</span></a>
     <br><br>
-               <a href="./?do=export"><b>Export</b><span>: Export Netscape html bookmarks (which can be imported in Firefox, Chrome, Opera, delicious...)</span></a>
+               <a href="{$base_path}/?do=export"><b>Export</b><span>: Export Netscape html bookmarks (which can be imported in Firefox, Chrome, Opera, delicious...)</span></a>
     <br><br>
                <a class="smallbutton"
                   onclick="return alertBookmarklet();"