Subversion Repositories wpShopGermany4

Rev

Rev 6475 | Rev 6484 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

<?php
        
        /**
         * Templatedatei für die Modulseite des Backend
         * Sollte nicht angepasst werden
         */

?>
<div class="wpsg_admin_submenu">
        
        <div class="wpsg_modul_search_wrap">
                <input id="wpsg_modul_search" type="text" class="wpsg_modul_search" value="<?php echo wpsg_getStr($_COOKIE['wpsg-modulfilter-search']); ?>" />  
                <label title="<?php echo __('Wenn aktiviert, werden nur aktive Module angezeigt'); ?>">
                        <input type="checkbox" <?php echo ((wpsg_isSizedString($_COOKIE['wpsg-modulfilter-check'], 'true'))?'checked="checked"':''); ?> id="wpsg_modul_onlyactive" class="wpsg_modul_onlyactive" />
                        <span class="glyphicon glyphicon-ok wpsg_modul_onlyactive_glyphicon" aria-hidden="true"></span>
                </label>
        </div>
        
        <?php foreach ($this->view['groups'] as $group_name => $g) { ?>
        <div class="list-group list-modul-group" style="display:none;" >
                <span class="list-group-item list-group-head"><?php echo $group_name; ?></span>         
                <?php foreach ($g as $mod_key => $m) { ?>
                <a class="<?php echo (($this->get_option($mod_key, $this->view['global']) > 0)?'modul_akt':''); ?> list-group-modul list-group-item <?php echo (($mod_key == wpsg_getStr($_REQUEST['modul'])?'active':'')); ?>" href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&amp;action=module&amp;modul=<?php echo $mod_key; ?>">
                        <span class="wpsg_modul_name"><?php echo $m->name; ?></span>
                        <?php if (($this->get_option($mod_key, $this->view['global']) > 0)?'modul_akt':'') { ?>
                        <span class="glyphicon glyphicon-ok" aria-hidden="true"></span>
                        <?php } ?>
                </a>
                <?php } ?>
        </div>
        <?php } ?>
         
</div>

<?php if (isset($_REQUEST['modul'])) { ?>
<div class="wpsg_admin_content form-horizontal">
        <?php echo wpsg_drawForm_AdminboxStart($this->arAllModule[$_REQUEST['modul']]->name); ?>                
        <form name="form1" action="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&amp;action=module&amp;modul=<?php echo $_REQUEST['modul']; ?>&amp;noheader=1" method="post" enctype="multipart/form-data">
                
                <!-- <h3>
                        <?php echo $this->arAllModule[$_REQUEST['modul']]->name; ?>
                        <?php if (isset($this->arAllModule[$_REQUEST['modul']]->hilfeURL) && $this->arAllModule[$_REQUEST['modul']]->hilfeURL != '') { ?>
                        <a target="_blank" href="<?php echo $this->arAllModule[$_REQUEST['modul']]->hilfeURL; ?>" class="wpsg_form_help_notip"></a>     
                        <?php } ?>
                </h3> -->
                
                <p><?php echo $this->arAllModule[$_REQUEST['modul']]->desc; ?></p><br />
                
                <?php $modul_install = $this->get_option($_REQUEST['modul'], $this->view['global']); ?>
                <?php echo wpsg_drawForm_Select('aktiv', __('Modul aktiviert', 'wpsg'), array('0' => __('Nein', 'wpsg'), '1' => __('Ja', 'wpsg')), ((wpsg_isSizedInt($modul_install))?'1':'0')); ?>
                                 
                <?php if (isset($this->arAllModule[$_REQUEST['modul']]->version)) { ?>
                <?php echo wpsg_drawForm_Input('', __('Version', 'wpsg'), $this->arAllModule[$_REQUEST['modul']]->version, array('text' => true)); ?>           
                
                <?php if (isset($this->arAllModule[$_REQUEST['modul']]->free) && $this->arAllModule[$_REQUEST['modul']]->free === true) { ?>
                <?php $strLizenz = __('Kostenfrei', 'wpsg'); ?>
                <?php } else { ?>
                <?php if (is_array($this->arLizenz) && in_array($_REQUEST['modul'], (array)$this->arLizenz['mods'])) { ?>
                <?php $strLizenz = __('Aktiviert', 'wpsg'); ?>
                <?php } else { ?>
                <?php if ($this->arAllModule[$_REQUEST['modul']]->getDemoDays() > 0) { ?>
                <?php $strLizenz = wpsg_translate(__('Demo Modus noch #1# Tage verbleibend.', 'wpsg'), $this->arAllModule[$_REQUEST['modul']]->getDemoDays()); ?>
                <?php } else { ?>
                <?php $strLizenz = __('Demo Modus abgelaufen.', 'wpsg'); ?>
                <?php } ?>
                <?php } ?>
                <?php } ?>
                <?php echo wpsg_drawForm_Text(__('Lizenz'), $strLizenz); ?>
                        
                <?php } ?>
                
                <?php if (!isset($this->arAllModule[$_REQUEST['modul']]->version) || ((wpsg_isTrue($this->arAllModule[$_REQUEST['modul']]->free) || (is_array($this->arLizenz) && in_array($_REQUEST['modul'], (array)$this->arLizenz['mods'])) || $this->arAllModule[$_REQUEST['modul']]->getDemoDays() > 0))) { ?>
                        <?php if ($this->arAllModule[$_REQUEST['modul']]->inline === true) { ?>
                        <p class="submit"><input type="submit" value="<?php echo __('Einstellungen speichern', 'wpsg'); ?>" class="button-primary" id="submit" name="submit"></p>
                        <?php } ?> 
                        
                        <input type="hidden" name="subaction" value="module" />
                                        
                        <?php if ($this->arAllModule[$_REQUEST['modul']]->inline == true) { ?>
                        </form>
                        <?php } ?>
                                        
                        <?php if ($this->get_option($_REQUEST['modul'], $this->view['global']) > 0) { ?>
                        <?php echo $this->arModule[$_REQUEST['modul']]->settings_edit(); ?>
                        <?php } ?>
                        
                        <?php if ($this->arAllModule[$_REQUEST['modul']]->inline !== true) { ?>
                        <p class="submit"><input type="submit" value="<?php echo __('Einstellungen speichern', 'wpsg'); ?>" class="button-primary" id="submit" name="submit"></p>                       
                        <?php } ?>
                <?php } else { ?>
                <p class="submit"><input type="submit" value="<?php echo __('Einstellungen speichern', 'wpsg'); ?>" class="button-primary" id="submit" name="submit"></p>
                <?php } ?>
                                                
        <?php if ($this->arAllModule[$_REQUEST['modul']]->inline !== true) { ?>
        </form>
        <?php } ?>
        
        <?php if (array_key_exists($_REQUEST['modul'], $this->arModule) && (!isset($this->arAllModule[$_REQUEST['modul']]->version) || (($this->arAllModule[$_REQUEST['modul']]->free === true || (is_array($this->arLizenz) && in_array($_REQUEST['modul'], (array)$this->arLizenz['mods'])) || $this->arAllModule[$_REQUEST['modul']]->getDemoDays() > 0)))) { ?>
        <?php echo $this->arModule[$_REQUEST['modul']]->settings_edit_afterform(); ?>
        <?php } ?>      
        
        <?php echo wpsg_drawForm_AdminboxEnd(); ?>
</div>
<?php } else { ?>

        <div class="wpsg_admin_content form-horizontal">
                <div class="panel panel-default">
                        <div class="panel-heading clearfix">
                                <h3 class="panel-title"><?php echo __('Modulverwaltung', 'wpsg'); ?></h3>
                        </div>
                        <div class="panel-body">
                
                                <form method="POST" action="<?php echo WPSG_URL_WP ?>wp-admin/admin.php?page=wpsg-Admin&action=registrierung&noheader=1&do=activatemodul">
                                                
                                        <fieldset>
                                                <legend style="padding-top:0px;"><?php echo __('Modulcode aktivieren', 'wpsg'); ?></legend>
                                                                                
                                                <div class="row">
                                                        <div class="col-xs-10">
                                                                
                                                                <input required="required" type="text" class="form-control" name="modulcode" id="modulcode" />
                                                                
                                                        </div>
                                                        <div class="col-xs-2">
                                                                
                                                                <input class="btn btn-primary btn-block" type="submit" class="form-control" value="<?php echo __('Prüfen', 'wpsg'); ?>" />
                                                                
                                                        </div>
                                                </div>
                                        </fieldset>
                                        
                                </form>
                                
                                <hr />
                                
                                <?php $wpsg_update_data = wpsg_get_update_data(); ?>
                                <?php if (wpsg_isSizedArray($wpsg_update_data)) { ?>
                                
                                        <table class="table modultable">
                                                <thead>
                                                        <tr>
                                                                <th><?php echo __('Modulname', 'wpsg'); ?></th>
                                                                <th><?php echo __('installierte Version', 'wpsg'); ?></th>
                                                                <th><?php echo __('Lizenz', 'wpsg');  ?></th>
                                                                <th><?php echo __('verfügbare Version', 'wpsg'); ?></th>
                                                        </tr>
                                                </thead>
                                                <tbody>
                                                        <?php foreach ($wpsg_update_data['modulinfo'] as $modul_key => $modul_info) { ?>
                                                        <tr style="font-style:normal;" class="
                                                        
                                                                <?php if ($modul_info['free'] === true) { ?>
                                                                        <?php echo 'active'; ?>
                                                                <?php } else if ($modul_info['active'] === true) { ?>
                                                                        <?php echo 'success'; ?>
                                                                <?php } else { ?>
                                                                        <?php echo 'info'; ?>
                                                                <?php } ?>
                                                        
                                                        ">
                                                                <td><?php echo $modul_info['label']; ?></td>
                                                                <td>
                                                                        
                                                                        <?php if ($this->hasModInstalled($modul_key)) { ?>
                                                                                <?php echo $this->arAllModule[$modul_key]->version; ?>                                                                          
                                                                        <?php } ?>
                                                                        
                                                                </td>                                                           
                                                                <td>
                                                                        
                                                                        <?php if ($modul_info['free'] === true) { ?>
                                                                                <?php echo __('kostenlos', 'wpsg'); ?>
                                                                        <?php } else if ($modul_info['active'] === true) { ?>
                                                                                <?php echo __('enthalten', 'wpsg'); ?>
                                                                        <?php } else { ?>
                                                                                
                                                                                <?php if (wpsg_isSizedString($modul_info['url_shop'])) { ?>
                                                                                <a href="<?php echo $modul_info['url_shop']; ?>" target="_blank"><?php echo __('Modulcode hier erwerben', 'wpsg'); ?></a>
                                                                                <?php } else { ?>
                                                                                <a href="https://shop.maennchen1.de" target="_blank"><?php echo __('Modulcode hier erwerben', 'wpsg'); ?></a>
                                                                                <?php } ?>
                                                                                
                                                                        <?php } ?>
                                                                        
                                                                </td>
                                                                <td><?php 
                                                                                                                                        
                                                                        echo $modul_info['version'];
                                                                         
                                                                        if ($this->hasModInstalled($modul_key) && $modul_info['version'] === $this->arAllModule[$modul_key]->version)
                                                                        {
                                                                                
                                                                                echo ' - <strong class="wpsg_message_ok">'.__('aktuell', 'wpsg').'</strong>';
                                                                                
                                                                        }
                                                                        else if (version_compare($modul_info['version'], WPSG_VERSION) > 0) 
                                                                        {
                                                                                
                                                                                echo ' - <strong class="wpsg_error">'.__('neue Version verfügbar', 'wpsg').'</strong><br />'.wpsg_translate(__('<a href="#1#">wpShopGermany Update</a> notwendig', 'wpsg'), WPSG_URL_WP.'wp-admin/plugins.php');
                                                                                
                                                                        }
                                                                        else if (version_compare($modul_info['version'], $this->arAllModule[$modul_key]->versio) > 0) 
                                                                        {
                                                                                
                                                                                echo ' - <strong class="wpsg_error">'.__('neue Version verfügbar', 'wpsg').'</strong><br />';
                                                                                echo wpsg_translate(__('Version <a href="#1#">installieren</a>.', 'wpsg'), WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=registrierung&noheader=1&do=installModul&modul='.$modul_key); 
                                                                        
                                                                        }
                                                                        
                                                                ?></td>
                                                        </tr>
                                                        <?php } ?>
                                                </tbody>
                                        </table>
                                                                                
                                <?php } else { ?>
                                
                                <p>
                                        Lizenz aktivieren
                                </p>
                                        
                                <?php } ?>
                
                        </div>
                </div>
        </div>
        
<?php } ?>

<script type="text/javascript">/* <![CDATA[ */

        function wpsg_ssh_module()
        {

                jQuery('.list-modul-group').show();
                jQuery('.wpsg_admin_submenu .list-group-item').show();

                var check = jQuery('#wpsg_modul_onlyactive').prop('checked');
                var search = jQuery('#wpsg_modul_search').val();

                jQuery.cookie('wpsg-modulfilter-check', check);
                jQuery.cookie('wpsg-modulfilter-search', search);
                
                jQuery('.wpsg_modul_name').each(function() {

                        if (!jQuery(this).parent().hasClass('active'))
                        {
                        
                                if (check && !jQuery(this).parent().hasClass('modul_akt')) jQuery(this).parent().hide();
                                else if (jQuery.trim(search) != '')
                                {
        
                                        var re = new RegExp(search, 'i');

                                        if (!jQuery(this).html().match(re)) jQuery(this).parent().hide();
                                        else jQuery(this).parent().show();
                                                
                                }

                        }
                                
                } ); 

                jQuery('.list-modul-group').each(function() {

                        if (jQuery(this).find('.list-group-modul:visible').length <= 0) jQuery(this).hide();
                        else jQuery(this).show();                               
                        
                } );
                
        }

        jQuery(document).ready(function() {

                jQuery('#wpsg_modul_onlyactive').bind('change', function(event) {

                        wpsg_ssh_module();                      
                        jQuery(this).blur();
                        
                } );

                jQuery('#wpsg_modul_search').focus().bind('blur', wpsg_ssh_module);
                jQuery('#wpsg_modul_search').focus().bind('keyup', wpsg_ssh_module);
                
                wpsg_ssh_module();
                
        } );

/* ]]> */</script>