Subversion Repositories wpShopGermany4

Rev

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

<?php

        /**
 * Template für die Einstellungen des "Anschreiben" Moduls
 */

?>

<div>
        <ul class="nav nav-tabs" role="tablist">
                <li role="presentation" class="active"><a href="#tab1" aria-controls="home" role="tab" data-toggle="tab"><?php echo __('Vordefinierte Textfelder', 'wpsg'); ?></a></li>
        </ul>
        <div class="tab-content">
                <div role="tabpanel" class="tab-pane active" id="tab1">
                
                        <?php echo wpsg_drawForm_TextStart(); ?>
                        <div style="position:relative;">
                                <?php if ($this->view['wpsg_mod_coverletter']['bp'] === false) { ?>
                                        <p><?php echo __('Es wurde bisher kein Briefpapier hochgeladen', 'wpsg'); ?></p>
                                <?php } else { ?>
                                        <a target="_blank" href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_coverletter&do=getBp&noheader=1" target="_blank"><?php echo __('Derzeitiges Briefpapier', 'wpsg'); ?></a>
                                <?php } ?>
                                <a class="wpsg_glyphicon_right glyphicon glyphicon-question-sign form-control-feedback" href="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=mod_coverletter_bp" data-wpsg-tip="mod_coverletter_bp" rel="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=mod_coverletter_bp"></a>
                                <input type="file" name="wpsg_mod_coverletter_bp">
                                <?php $strSuffix = ''; if ($this->view['wpsg_mod_coverletter']['bp'] !== false) { $strSuffix = '
                    <label>
                                                <input type="checkbox" name="wpsg_mod_coverletter_bp_del" value="1" />&nbsp;'.__('Löschen', 'wpsg').'
                                        </label>';
                                        echo __($strSuffix);
                                } ?>
                        </div>
                        <?php echo wpsg_drawForm_TextEnd(__('Briefpapier (PDF/JPG)', 'wpsg'), array('noP' => true, 'helps' => 'wpsg_mod_coverletter_bp')); ?>
                        
                        <hr />
                        
                        <?php echo wpsg_drawForm_Input('wpsg_mod_coverletter_subject', __('Betreff', 'wpsg'),$this->get_option('wpsg_mod_coverletter_subject'), ['help' => 'wpsg_mod_coverletter_subject']); ?>
                        <?php echo wpsg_drawForm_Textarea('wpsg_mod_coverletter_text', __('Textvorgabe', 'wpsg'), $this->get_option('wpsg_mod_coverletter_text'), ['help' => 'wpsg_mod_coverletter_text']); ?>
                        
                        <?php echo wpsg_drawForm_TextStart(); ?>
                        <div style="position:relative;">
                                <?php if ($this->view['wpsg_mod_coverletter']['logo'] === false) { ?>
                                        <p><?php echo __('Es wurde bisher kein Logo hochgeladen', 'wpsg'); ?></p>
                                <?php } else { ?>
                                        <a target="_blank" href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_coverletter&do=getLogo&noheader=1" target="_blank"><?php echo __('Derzeitiges Logo', 'wpsg'); ?></a>
                                <?php } ?>
                                <a class="wpsg_glyphicon_right glyphicon glyphicon-question-sign form-control-feedback" href="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=mod_coverletter_logo" data-wpsg-tip="mod_coverletter_logo" rel="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=mod_coverletter_logo"></a>
                                <input type="file" name="wpsg_mod_coverletter_logo">
                                <?php $logo_pos = $this->get_option("wpsg_mod_coverletter_logo_position"); ?>
                                <?php $defaultAlign = !isset($logo_pos) || empty($logo_pos) ? "align-buttons-active" : ""; ?>

                                <?php $alignLeft = $logo_pos === 'left' ? "align-buttons-active" : ""; ?>
                                <?php $alignCenter = $logo_pos === 'center' ? "align-buttons-active" : ""; ?>
                                <?php $alignRight = $logo_pos === 'right' ? "align-buttons-active" : ""; ?>

                                <?php $logo_transparency = $this->get_option("wpsg_mod_coverletter_logo_transparency") ?: "0%"; ?>

                                <?php $strSuffix = ''; if ($this->view['wpsg_mod_coverletter']['logo'] !== false) { $strSuffix = '
                                        <div class="row">
                                                <div class="col-md-4">
                                                        <div class="align-buttons">
                                                                <input type="input" data-toggle="tooltip" class="logo-align-button logo-align-button-left '.$alignLeft.'" name="wpsg_mod_coverletter_logo_position_left" value="&#xf036" onclick="handleLogoAlignClick($(this))" onkeydown="return false;" onfocus="return false;" autocomplete="off" title="'.__("Logo linksbündig ausrichten").'">
                                                                <input type="input" data-toggle="tooltip" class="logo-align-button logo-align-button-center '.$alignCenter.'" name="wpsg_mod_coverletter_logo_position_center" value="&#xf037" onclick="handleLogoAlignClick($(this))" onkeydown="return false;" onfocus="return false;" autocomplete="off" title="'.__("Logo zentrieren").'">
                                                                <input type="input" data-toggle="tooltip" class="logo-align-button logo-align-button-right '.$alignRight.' '.$defaultAlign.'" name="wpsg_mod_coverletter_logo_position_right" value="&#xf038" onclick="handleLogoAlignClick($(this))" onkeydown="return false;" onfocus="return false;" autocomplete="off" title="'.__("Logo rechtsbündig ausrichten").'">
                                                        </div>
                                                </div>
                                                <div class="col-md-8 logo-transparency">
                                                        <label>
                                                                <input type="text" name="wpsg_mod_coverletter_logo_transparency" value="'.$logo_transparency.'" />&nbsp;'.__('Logodeckkraft', 'wpsg').'
                                                        </label>                
                                                </div>
                                                <div class="col-md-12">
                                                        <label>
                                                                <input type="checkbox" name="wpsg_mod_coverletter_logo_del" value="1" />&nbsp;'.__('Löschen', 'wpsg').'
                                                        </label>        
                                                </div>
                                        </div>';
                                        echo __($strSuffix);
                                } ?>
                                                
                                        
                                <button class="button wpsg_coverletter_preview" style="float:right; margin-right:10px;" name="wpsg_coverletter_preview" type="button">
                                        <?php echo __("Vorschau", "wpsg"); ?>
                                </button>

                        </div>
                        
                        <?php echo wpsg_drawForm_TextEnd(__('Logo (JPG)', 'wpsg'), array('noP' => true, 'helps' => 'wpsg_mod_coverletter_logo')); ?>

                        <hr /><br />

                        <table class="table table-body-striped wpsg_mod_coverletter_fieldtable">
                                <thead>
                                <tr>
                                        <th class="col_bezeichnung"><?php echo __('Bezeichnung', 'wpsg'); ?></th>
                                        <th class="col_freitext"><?php echo __('Freitext', 'wpsg'); ?></th>
                                        <th class="col_x"><?php echo __('X', 'wpsg'); ?></th>
                                        <th class="col_y"><?php echo __('Y', 'wpsg'); ?></th>
                                        <th class="col_color"><?php echo __('Farbe', 'wpsg'); ?></th>
                                        <th class="col_groesse"><?php echo __('Größe', 'wpsg'); ?></th>
                                        <th class="col_action"></th>
                                </tr>
                                </thead>
                                <tbody>
                                <?php foreach ($this->view['wpsg_mod_coverletter']['fields'] as $f => $field_name) { ?>
                                        <tr>
                                                <td><?php echo wpsg_hspc($field_name); ?></td>
                                                <td>
                                                        <input type="text" style="width:100%;" name="text[<?php echo $f; ?>][text]" value="<?php echo wpsg_getStr($this->view['wpsg_mod_coverletter']['arTexts'][$f]['text']); ?>" />
                                                </td>
                                                <td>
                                                        <input type="text" style="width:100%;" name="text[<?php echo $f; ?>][x]" value="<?php echo wpsg_getStr($this->view['wpsg_mod_coverletter']['arTexts'][$f]['x']); ?>" />
                                                </td>
                                                <td>
                                                        <input type="text" style="width:100%;" name="text[<?php echo $f; ?>][y]" value="<?php echo wpsg_getStr($this->view['wpsg_mod_coverletter']['arTexts'][$f]['y']); ?>" />
                                                </td>
                                                <td>
                                                        <input type="text" style="width:100%;" name="text[<?php echo $f; ?>][color]" value="<?php echo wpsg_getStr($this->view['wpsg_mod_coverletter']['arTexts'][$f]['color']); ?>" />
                                                </td>
                                                <td>
                                                        <select name="text[<?php echo $f; ?>][fontsize]" style="width:100%;">
                                                                <option <?php echo ((wpsg_getStr($this->view['wpsg_mod_coverletter']['arTexts'][$f]['fontsize']) == "8")?'selected="selected"':''); ?> value="8">8</option>
                                                                <option <?php echo ((wpsg_getStr($this->view['wpsg_mod_coverletter']['arTexts'][$f]['fontsize']) == "9")?'selected="selected"':''); ?> value="9">9</option>
                                                                <option <?php echo ((wpsg_getStr($this->view['wpsg_mod_coverletter']['arTexts'][$f]['fontsize']) == "10")?'selected="selected"':''); ?> value="10">10</option>
                                                                <option <?php echo ((wpsg_getStr($this->view['wpsg_mod_coverletter']['arTexts'][$f]['fontsize']) == "11")?'selected="selected"':''); ?> value="11">11</option>
                                                                <option <?php echo ((wpsg_getStr($this->view['wpsg_mod_coverletter']['arTexts'][$f]['fontsize']) == "12")?'selected="selected"':''); ?> value="12">12</option>
                                                                <option <?php echo ((wpsg_getStr($this->view['wpsg_mod_coverletter']['arTexts'][$f]['fontsize']) == "13")?'selected="selected"':''); ?> value="13">13</option>
                                                                <option <?php echo ((wpsg_getStr($this->view['wpsg_mod_coverletter']['arTexts'][$f]['fontsize']) == "14")?'selected="selected"':''); ?> value="14">14</option>
                                                        </select>
                                                </td>
                                                <td>
                                                        <input type="checkbox" title="<?php echo __('Diese Checkbox aktivieren, damit die Textzeile verwendet wird.', 'wpsg'); ?>" value="1" name="text[<?php echo $f; ?>][aktiv]" <?php echo ((wpsg_isSizedInt($this->view['wpsg_mod_coverletter']['arTexts'][$f]['aktiv']))?'checked="checked"':''); ?> />
                                                </td>
                                        </tr>
                                <?php } ?>
                                </tbody>
                        </table>

                        <input class="button" onclick="if (!confirm('<?php echo __('Sind Sie sich sicher? Ihre bisherigen Einstellungen gehen verloren!', 'wpsg'); ?>')) return false; else location.href = '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&amp;action=module&amp;modul=<?php echo $_REQUEST['modul']; ?>&amp;do=reset&amp;noheader=1';" type="button" value="<?php echo __('Standardeinstellungen laden', 'wpsg'); ?>" />

                        <br /><br />

                        <div class="info">
                                <p>
                                        <?php echo __('Die Angaben für X (Abstand von Links) und Y (Abstand von Oben) werden in mm eingetragen.', 'wpsg'); ?><br />
                                        <?php echo __('Die Farbe wird im Hexadezimalformat angegeben (#FFFFFF für weiß, #000000 für schwarz).', 'wpsg'); ?>
                                </p>
                        </div>

                        <br />

                </div>
        </div>
</div>

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

        /**
         * Stellt sicher, dass immer nur ein Button der align-buttons die highlight Klasse hat
         */
        function handleLogoAlignClick(pressedEl)
        {

                if(pressedEl.hasClass("align-buttons-active")) return;
                else
                {

                        pressedEl.addClass("align-buttons-active");
                        pressedEl[0].value = pressedEl[0].value + " selected";

                        jQuery.each($(".logo-align-button"), function(index, element) {
                                if(element.classList.contains("align-buttons-active") && element !== pressedEl[0]){

                                        var values = element.value.split(" ");
                                        element.value = values[0];

                                        element.classList.remove("align-buttons-active");

                                        return false;

                                }
                        });

                }

        } // function handleLogoAlignClick()

        /**
         * Wird beim Klicken auf den Vorschau Button ausgelöst
         */
        function wpsg_coverletter_preview()
        {

                var url = "<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_coverletter&do=orderAjax&noheader=1&wpsg_mod_coverletter_preview=1";

                window.open(url, '_blank');

                return false;

        } // function wpsg_coverletter_preview()



        jQuery(document).ready(function() {

                jQuery('#wpsg_tab').wpsg_tab( {
                        'cookiename': 'wpsg_mod_coverletter_tab',
                        'tab2': function() {
                                jQuery('.tablink').show();
                        }
                } );

                jQuery(".wpsg_coverletter_preview").click(function(){ wpsg_coverletter_preview(); });

        } );

        /* ]]> */</script>