Menu="Plugins"
Title="Plugin History"
Tag="puzzle-piece"
Cond="glob('/boot/config/plugins-stale/*.plg')"
---
<?PHP
/* Copyright 2005-2023, Lime Technology
 * Copyright 2012-2023, Bergware International.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License version 2,
 * as published by the Free Software Foundation.
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 */
?>
<?
require_once "$docroot/plugins/dynamix.plugin.manager/include/PluginHelpers.php";

echo "<table class='tablesorter plugins shift' id='plugin_table'><thead>";
echo "<tr><th></th><th>".('Plugin')."</th><th>"._('Author')."</th><th>"._('Version')."</th><th>"._('Status')."</th><th></th></tr>";
echo "</thead><tbody>";

foreach (glob("/boot/config/plugins-stale/*.plg", GLOB_NOSORT) as $plugin_file) {
  // plugin name
  $name = plugin("name", $plugin_file);
  if ($name === false) $name = basename($plugin_file, ".plg");

  // icon
  $icon = icon($name);

  // desc
  $readme = "plugins/{$name}/README.md";
  if (file_exists($readme))
    $desc = Markdown(file_get_contents($readme));
  else
    $desc = Markdown("**{$name}**");

  // author
  $author = plugin("author", $plugin_file);
  if ($author === false) $author = _("anonymous");

  // version
  $version = plugin("version", $plugin_file);
  if ($version === false) $version = _("unknown");

  // status info
  $status = "<span class='orange-text'><i class='fa fa-unlink'></i>&nbsp;"._('STALE')."</span>";

  // action
  $action = make_link("delete", $plugin_file);

  // echo our plugin information
  echo "<tr><td><img src='$icon'></td><td>$desc</td><td>$author</td><td>$version</td><td>$status</td><td>$action</td></tr>";
}

echo "</tbody></table>";
?>
:plugin_stale_help:
