Skip to content

Commit

Permalink
NEW: Copy Installed Plugins List to Clipboard
Browse files Browse the repository at this point in the history
- List output shows plugin name, version and author
- fixes #38
- keep all code together to avoid whitespaces in output
  • Loading branch information
aljawaid committed Mar 31, 2023
1 parent b8f34e8 commit b5949b6
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Template/plugin/show.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,15 @@ function sortPlugins(&$arr) {
<div class="pm-page-margin">
<?php $installedCount = count($plugins) ?>
<div class="plugin-count"><?= t('You have %s plugins installed', $installedCount) ?></div>
<div class="plugin-list-clipboard">
<?php sortPlugins($plugins); ?>
<span class="copy-installed-list-format btn" title="<?= t('Copy formatted version') ?>" data-clipboard-text="<?php foreach ($plugins as $pluginFolder => $plugin): ?><?= '- '. $this->text->e($plugin->getPluginName()) .' v'. $this->text->e($plugin->getPluginVersion()) . ' ' . t('by').' ' . $this->text->e($plugin->getPluginAuthor()) . PHP_EOL ?><?php endforeach ?>">
<svg height="30px" class="clippy-icon" fill="currentColor" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg">
<title><?= t('Copy to Clipboard') ?></title>
<path xmlns="http://www.w3.org/2000/svg" d="M128 768h256v64H128v-64z m320-384H128v64h320v-64z m128 192V448L384 640l192 192V704h320V576H576z m-288-64H128v64h160v-64zM128 704h160v-64H128v64z m576 64h64v128c-1 18-7 33-19 45s-27 18-45 19H64c-35 0-64-29-64-64V192c0-35 29-64 64-64h192C256 57 313 0 384 0s128 57 128 128h192c35 0 64 29 64 64v320h-64V320H64v576h640V768zM128 256h512c0-35-29-64-64-64h-64c-35 0-64-29-64-64s-29-64-64-64-64 29-64 64-29 64-64 64h-64c-35 0-64 29-64 64z"/>
</svg> <?= t('Copy List') ?>
</span>
</div>
<form class="plugin-installed-filter">
<label for="InstalledPluginsFilterInput">
<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" fill="currentColor" class="bi bi-filter-square" viewBox="0 0 16 16">
Expand Down

0 comments on commit b5949b6

Please sign in to comment.