New basePath: fix officiel plugin paths and vintage template
This commit is contained in:
parent
bc583903ad
commit
9fbc42294e
39 changed files with 169 additions and 244 deletions
plugins/archiveorg
|
@ -1,5 +1,5 @@
|
|||
<span>
|
||||
<a href="https://web.archive.org/web/%s">
|
||||
<img class="linklist-plugin-icon" src="plugins/archiveorg/internetarchive.png" title="%s" alt="archive.org" />
|
||||
<img class="linklist-plugin-icon" src="%s/archiveorg/internetarchive.png" title="%s" alt="archive.org" />
|
||||
</a>
|
||||
</span>
|
||||
|
|
|
@ -17,12 +17,13 @@ use Shaarli\Plugin\PluginManager;
|
|||
function hook_archiveorg_render_linklist($data)
|
||||
{
|
||||
$archive_html = file_get_contents(PluginManager::$PLUGINS_PATH . '/archiveorg/archiveorg.html');
|
||||
$path = ($data['_BASE_PATH_'] ?? '') . '/' . PluginManager::$PLUGINS_PATH;
|
||||
|
||||
foreach ($data['links'] as &$value) {
|
||||
if ($value['private'] && preg_match('/^\?[a-zA-Z0-9-_@]{6}($|&|#)/', $value['real_url'])) {
|
||||
continue;
|
||||
}
|
||||
$archive = sprintf($archive_html, $value['url'], t('View on archive.org'));
|
||||
$archive = sprintf($archive_html, $value['url'], $path, t('View on archive.org'));
|
||||
$value['link_plugin'][] = $archive;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue