<div class="panel panel-default css-infobox">
    <div class="panel-body">
        {if isset($cssNeedAjaxContent)}
            <div class="alert">
                <div class="row">
                    <div class="col col-12">
                        {*
                        <a  class="btn btn-info" href="links.php?kPlugin={$oPlugin->getID()}">Inhaltsseite(n) bearbeiten</a>
                        *}
                        <a class="btn btn-success" href="{$cssSprachlink}?pluginverwaltung_uebersicht=1&sprachvariablen=1&kPlugin={$oPlugin->getID()}&token={$smarty.session.jtl_token}">Sprachvariablen</a>
                        <a  class="btn btn-info" href="https://css-umsetzung.de/shop/navi.php?qs={$oPlugin->getPluginID()}&search=" target="_blank">{$oPlugin->getMeta()->getName()}</a>
                        <a  class="btn btn-info" href="https://helpdesk.css-umsetzung.de/support/solutions/articles/205000048983-funktionsweise-des-plugins" target="_blank">Dokumentation</a>
                        <a class="btn btn-info" href="https://css-umsetzung.de/shop/" target="_blank">Weitere Plugins von css-umsetzung</a>
                        <a class="btn btn-warning" href="https://css-umsetzung.de/kontakt/?plugin={$oPlugin->getPluginID()}&version={$oPlugin->getMeta()->getVersion()}" target="_blank">Fehler melden</a>
                    </div>
                </div>
            </div>
            <hr>
            <div id='pluginInfo'>Bitte haben Sie einen Moment Geduld</div>
            <script>
              $(function () {
                $.ajax({
                  url: '{$oCssPlugin->getPluginLink()}' + "",
                  type: 'GET',
                  data: 'pluginInfo=true',
                  cache: false,
                  dataType: 'json',
                  processData: false, // Don't process the files
                  contentType: false, // Set content type to false as jQuery will tell the server its a query string request
                  success: function (data, textStatus, jqXHR) {
                    if (typeof data.error === 'undefined') {
                      if (data.script) {
                        eval(data.script);
                      }
                      $("body").trigger('contentChanged');
                      // Success so call function to process the form
//                   submitForm(event, data);
                    } else {
                      // Handle errors here
                      console.log('ERRORS: ' + data.error);
                    }
                  },
                  error: function (jqXHR, textStatus, errorThrown) {
                    // Handle errors here
                    console.log('ERRORS: ' + textStatus);
                    // STOP LOADING SPINNER
                  }
                });
              });
            </script>
        {else}
            <div class="panel-group" id="Infoaccordion">
                {if !isset($ServiceOffline) || !$ServiceOffline}
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <h4 class="panel-title">
                                <a data-toggle="collapse" class="" data-parent="#Infoaccordion" href="#InfoCollapse1" aria-expanded="true">
                                    Pluginstatus</a>
                            </h4>
                        </div>
                        <div id="InfoCollapse1" class="panel-InfoCollapse  in " style="margin:10px 20px">
                            <div class="row">
                                {if isset($PluginInfo['cHinweis'])}
                                    <div class="col-12">
                                    <div class="alert {$PluginInfo['cClass']}"><em>{$PluginInfo['cHinweis']}</em></div></div>{/if}
                                {if !empty($PluginInfo['dgueltigVon'])}
                                    <div class="col-3">Subscription:</div>
                                    <div class="col-9">{$PluginInfo['dgueltigVon']} - {$PluginInfo['dgueltigBis']}</div>
                                    <div class="col-12">
                                        <hr/>
                                    </div>
                                    <div class="col-3">Ihre Version:</div>
                                    <div class="col-9">{$PluginInfo['nVersion']}</div>
                                    <div class="col-12">
                                        <hr/>
                                    </div>
                                    <div class="col-3">Aktuelle Version:</div>
                                    <div class="col-9">{$PluginInfo['nReleaseVersion']}</div>
                                {else}
                                    <div class="col-3">Subscription:</div>
                                    <div class="col-9">{if $hasExtId}Lizenzsierung über Extension Store{else}Testversion oder subscriptionfree f&uuml;r dieser Domain{/if}</div>
                                    <div class="col-12 ">
                                        <hr/>
                                    </div>
                                    <div class="col-3">Ihre Version:</div>
                                    <div class="col-9">{$PluginInfo['nVersion']}</div>
                                    <div class="col-12 ">
                                        <hr/>
                                    </div>
                                    <div class="col-3">Aktuelle Version:</div>
                                    <div class="col-9">{$PluginInfo['nReleaseVersion']}<br>&nbsp;</div>
                                {/if}

                            </div>
                        </div>
                    </div>
                {/if}
                {if isset($changelog) && $changelog}
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <h4 class="panel-title">
                                <a data-toggle="collapse" class="collapsed" data-parent="#Infoaccordion" href="#InfoCollapse2">
                                    Changelog</a>
                            </h4>
                        </div>
                        <div id="InfoCollapse2" class="panel-InfoCollapse collapse" style="margin:10px 20px">
                            <div class="row">
                                <div class="col-12" style="overflow:auto; max-height:2500px;">
                                    <div style="text-align:left; white-space:pre;">
                                        {$changelog}
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                {/if}
                {if  !isset($ServiceOffline) || !$ServiceOffline}

                {if !$hasExtId && !empty($pluginList) && is_array($pluginList) }
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <h4 class="panel-title">
                                <a data-toggle="collapse" class="collapsed" data-parent="#Infoaccordion" href="#InfoCollapse3">
                                    weitere Plugins die Sie verwenden:</a>
                            </h4>
                        </div>
                        <div id="InfoCollapse3" class="panel-InfoCollapse collapse" style="margin:10px 20px">
                            <div class="row" id="pluginList">
                                {foreach from=$pluginList item=plugin name=pluginList}
                                    {if $plugin['cPluginID'] == $oPlugin->getPluginID()}{continue}{/if}
                                    {cycle values='<div class="col-12 clear"></div>, '}
                                    <div class="col-6">
                                        <div class="row" style="border:1px solid #d1d1d1; border-radius:5px; margin:10px 0px;">
                                            <div class="col-12 headline"><h4>{$plugin['plugInName']}</h4></div>
                                            {if isset($plugin['cHinweis'])}
                                                <div class="col-12">
                                                <div class="alert {$plugin['cClass']}">
                                                    <em>{$plugin['cHinweis']}</em>
                                                </div></div>{/if}
                                            <div class="col-4">Subscription:</div>
                                            <div class="col-8">{$plugin['dgueltigVon']} - {$plugin['dgueltigBis']}</div>
                                            <div class="col-12">
                                                <hr/>
                                            </div>
                                            <div class="col-4">Ihre Version:</div>
                                            <div class="col-8">{$plugin['cPluginVersion']}</div>
                                            <div class="col-12">
                                                <hr/>
                                            </div>
                                            <div class="col-4">Aktuelle Version:</div>
                                            <div class="col-8">{$plugin['nReleaseVersion']}<br>&nbsp;</div>
                                        </div>
                                    </div>
                                {/foreach}
                            </div>

                        </div>
                    </div>
                {/if}
            </div>
        {if isset($cssNews) &&$cssNews}
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h4 class="panel-title">
                        <a data-toggle="InfoCollapse" class="InfoCollapse" href="#InfoCollapse">
                            News:</a>
                    </h4>
                </div>
                <div id="InfoCollapse3" class="panel-InfoCollapse InfoCollapsed" style="margin:10px 20px">
                    {$cssNews}
                </div>
            </div>
        {/if}

        {else}
            <div class="alert alert-danger">
                <p>Der Lizenz Server steht zur Zeit leider nicht zur verf&uuml;gung, bitte versuchen Sie es sp&auml;ter noch einmal.</p>
            </div>
        {/if}
        {/if}
    </div>
</div>
