{if !ConfigHelper::checkPrivilege('hide_sysinfo')}
<table class="lmsbox" id="lms-ui-welcome-box-about-lms">
    <colgroup>
        <col style="width: 50%;">
        <col style="width: 50%;">
    </colgroup>
    <thead >
        <tr onclick="showOrHide('welcome_sysinfo_about_lms-{$layout.module}');">
            <td class="text-center bold nobr" colspan="2">
                <img src="img/logo-ico.png" alt=""> {t a=LMS::SOFTWARE_NAME}About $a{/t}
            </td>
        </tr>
    </thead>
    <tbody id="welcome_sysinfo_about_lms-{$layout.module}" style="display:none;">
        <tr data-clipboard-text="{t a=LMS::SOFTWARE_NAME}$a version:{/t} {$layout.lmsv}{if $layout.lmsvr} ({$layout.lmsvr}){/if}">
            <td class="text-right bold">
                <a href="{LMS::SOFTWARE_URL}" rel="external">{t a=LMS::SOFTWARE_NAME}$a version:{/t}</a>
            </td>
            <td>
                {$layout.lmsv}{if $layout.lmsvr} ({$layout.lmsvr}){/if}
            </td>
        </tr>
        <tr data-clipboard-text="{trans("LMSDB version:")} {$layout.lmsdbv}">
            <td class="text-right bold">
                <a href="{LMS::SOFTWARE_URL}" rel="external">{trans("LMSDB version:")}</a>
            </td>
            <td>
                {$layout.lmsdbv}
            </td>
        </tr>
        <tr data-clipboard-text="{if $layout.dbtype == "mysql" || $layout.dbtype == "mysqli"}{trans("MySQL version:")}{elseif $layout.dbtype == "postgres"}{trans("PostgreSQL version:")}{/if} {$layout.dbversion}">
            <td class="text-right bold">
                {if $layout.dbtype == "mysql" || $layout.dbtype == "mysqli"}
                <a href="http://www.mysql.com" rel="external">{trans("MySQL version:")}</a>
                {elseif $layout.dbtype == "postgres"}
                <a href="http://www.postgresql.org" rel="external">{trans("PostgreSQL version:")}</a>
                {/if}
            </td>
            <td>
                {$layout.dbversion}
            </td>
        </tr>
        <tr data-clipboard-text="{trans("PHP version:")} {$sysinfo.phpversion}">
            <td class="text-right bold">
                <a href="http://www.php.net/" rel="external">{trans("PHP version:")}</a>
            </td>
            <td>
                {$layout.phpversion}
            </td>
        </tr>
        <tr data-clipboard-text="{trans("Smarty version:")} {$layout.smarty_version}">
            <td class="text-right bold">
                <a href="http://www.smarty.net" rel="external">{trans("Smarty version:")}</a>
            </td>
            <td>
                {$layout.smarty_version}
            </td>
        </tr>
        {foreach $layout.plugins as $plugin_name => $plugin}
            {if $plugin.enabled}
                <tr data-clipboard-text="{"\n"}{$plugin_name}">
                    <td class="text-center bold" colspan="2">
                        {$plugin_name}
                    </td>
                </tr>
                <tr>
                    <td class="text-right">
                        {trans('Description:')}
                    </td>
                    <td>
                        {if $plugin.description}{$plugin.description}{else}-{/if}
                    </td>
                </tr>
                {if $plugin.docurl}
                    <tr>
                        <td class="text-right">
                            {trans('Documentation:')}
                        </td>
                        <td>
                            <a href="{$plugin.docurl}" rel="external">{$plugin.docurl}</a>
                        </td>
                    </tr>
                {/if}
                {if $plugin.repourl}
                    <tr>
                        <td class="text-right">
                            {trans('Repository:')}
                        </td>
                        <td>
                            <a href="{$plugin.repourl}" rel="external">{$plugin.repourl}</a>
                        </td>
                    </tr>
                {/if}
                <tr data-clipboard-text="{trans('Software version:')} {if $plugin.softwareversion}{$plugin.softwareversion}{else}-{/if}">
                    <td class="text-right">
                        {trans('Software version:')}
                    </td>
                    <td>
                        {if $plugin.softwareversion}{$plugin.softwareversion}{else}-{/if}
                    </td>
                </tr>
                <tr data-clipboard-text="{trans('Database version:')} {if $plugin.dbschversion}{$plugin.dbschversion}{else}-{/if}">
                    <td class="text-right">
                        {trans('Database version:')}
                    </td>
                    <td>
                        {if $plugin.dbschversion}{$plugin.dbschversion}{else}-{/if}
                    </td>
                </tr>
            {/if}
        {/foreach}
        <tr>
            <td class="lms-ui-box-buttons" colspan="2">
                {button icon="url" label="Copy" id="copy-sysinfo" class="lms-ui-button-clipboard" data_clipboard_text=""}
            </td>
        </tr>
    </tbody>
</table>

<script type="text/javascript">

if (getCookie('welcome_sysinfo_about_lms-{$layout.module}') == '1'){
    document.getElementById('welcome_sysinfo_about_lms-{$layout.module}').style.display = '';
}

new ClipboardJS('#copy-sysinfo', {
    text: function(trigger) {
        let data = $('#welcome_sysinfo_about_lms-' + '{$layout.module}').find('[data-clipboard-text]');
        let ClipboardText = '';
        data.each(function() {
            ClipboardText += $(this).attr('data-clipboard-text') + '\n';
        });
        $(trigger).attr('data-clipboard-text', ClipboardText);
        return $(trigger).attr('data-clipboard-text');
    }
});

</script>
{/if}
