diff options
| author | jlbeer <noreply@maennchen1.de> | 2026-09-08 10:54:25 +0200 |
|---|---|---|
| committer | jlbeer <noreply@maennchen1.de> | 2026-09-08 10:54:25 +0200 |
| commit | 4df9b7054b8356d962e15a3e803ccaeba4a42c36 (patch) | |
| tree | c2eba642108592d6c53941e7b3eeb8ae3b9c2129 /views/mods/mod_campaigns/campaign_addedit.phtml | |
| parent | c63261db426e4da06f7ed49013eda97c65cbc42f (diff) | |
- Kampagnenmodul hinzugefügt
Diffstat (limited to 'views/mods/mod_campaigns/campaign_addedit.phtml')
| -rw-r--r-- | views/mods/mod_campaigns/campaign_addedit.phtml | 210 |
1 files changed, 210 insertions, 0 deletions
diff --git a/views/mods/mod_campaigns/campaign_addedit.phtml b/views/mods/mod_campaigns/campaign_addedit.phtml new file mode 100644 index 0000000..daf1761 --- /dev/null +++ b/views/mods/mod_campaigns/campaign_addedit.phtml @@ -0,0 +1,210 @@ +<?php + $data = $this->view['campaign_data']; + $templates = isset($this->view['campaign_templates']) && is_array($this->view['campaign_templates']) ? $this->view['campaign_templates'] : array(); + $assignedTemplateId = isset($data['assigned_template_id']) ? intval($data['assigned_template_id']) : 0; + $isEdit = intval($data['id']) > 0; + $sendDateValue = ''; + if (strtotime($data['send_date']) > 0) { + $sendDateValue = date('Y-m-d\TH:i', strtotime($data['send_date'])); + } +?> +<div class="wrap columns-2 wpng_campaign_addedit"> + <div class="icon32 icon32-posts-post" id="icon-edit"><br></div> + <h2> + <?php echo __('Kampagnen', 'wpsg'); ?> - <?php echo $isEdit ? __('Bearbeiten', 'wpsg') : __('Neu hinzufügen', 'wpsg'); ?> + </h2> + + <form method="post" action="<?php echo esc_url(admin_url('admin.php?page=wpng-mod_campaign&wpng_action=save&noheader=1')); ?>"> + <?php wp_nonce_field('wpsg-campaigns-save'); ?> + <input type="hidden" name="id" value="<?php echo intval($data['id']); ?>" /> + + <div class="metabox-holder has-right-sidebar wpng_metabox-holder"> + <div id="side-info-column" class="inner-sidebar" style="width:386px;"> + <div id="side-sortables" class="meta-box-sortables ui-sortable" style="width:380px;"> + <div class="postbox"> + <h3 class="postbox-header"><?php echo __('Einstellungen', 'wpsg'); ?></h3> + <div class="inside"> + <p> + <label for="delay_value"><strong><?php echo __('Verzögerung', 'wpsg'); ?></strong></label><br /> + <input type="number" min="0" id="delay_value" name="delay_value" value="<?php echo intval($data['delay_value']); ?>" style="width:120px;" /> + <select id="delay_unit" name="delay_unit"> + <?php $units = $this->callMod('wpsg_mod_campaigns', 'getDelayUnitOptions'); if (!is_array($units)) $units = array(); foreach ($units as $unit => $unitLabel) { ?> + <option value="<?php echo esc_attr($unit); ?>" <?php selected($data['delay_unit'], $unit); ?>><?php echo esc_html($unitLabel); ?></option> + <?php } ?> + </select> + </p> + <p> + <label for="format"><strong><?php echo __('Format', 'wpsg'); ?></strong></label><br /> + <select id="format" name="format"> + <option value="0" <?php selected(intval($data['format']), 0); ?>><?php echo __('Text', 'wpsg'); ?></option> + <option value="1" selected <?php selected(intval($data['format']), 1); ?>><?php echo __('HTML und Text', 'wpsg'); ?></option> + <option value="2" <?php selected(intval($data['format']), 2); ?>><?php echo __('HTML', 'wpsg'); ?></option> + </select> + </p> + <p> + <label for="priority"><strong><?php echo __('Priorität', 'wpsg'); ?></strong></label><br /> + <?php $priority = (intval($data['priority']) >= 1) ? intval($data['priority']) : 3; ?> + <select id="priority" name="priority"> + <option value="1" <?php selected($priority, 1); ?>><?php echo __('Sehr niedrig', 'wpsg'); ?></option> + <option value="2" <?php selected($priority, 2); ?>><?php echo __('Niedrig', 'wpsg'); ?></option> + <option value="3" <?php selected($priority, 3); ?>><?php echo __('Normal', 'wpsg'); ?></option> + <option value="4" <?php selected($priority, 4); ?>><?php echo __('Hoch', 'wpsg'); ?></option> + <option value="5" <?php selected($priority, 5); ?>><?php echo __('Sehr hoch', 'wpsg'); ?></option> + </select> + </p> + <p class="submit"> + <input type="submit" class="button-primary" name="submit" value="<?php echo __('Speichern', 'wpsg'); ?>" /> + <input type="submit" class="button" name="submit_index" value="<?php echo __('Speichern und zur Übersicht', 'wpsg'); ?>" /> + </p> + </div> + </div> + + <div class="postbox"> + <h3 class="postbox-header"><?php echo __('Template-Zuordnung', 'wpsg'); ?></h3> + <div class="inside"> + <p> + <label for="template_id"><strong><?php echo __('Versandprofil', 'wpsg'); ?></strong></label><br /> + <select id="template_id" name="template_id" style="width:100%;"> + <option value="0"><?php echo __('Kein Versandprofil zugeordnet', 'wpsg'); ?></option> + <?php foreach ($templates as $template) { ?> + <?php $templateId = intval($template['id']); ?> + <option value="<?php echo $templateId; ?>" <?php selected($assignedTemplateId, $templateId); ?>> + <?php echo esc_html($template['name']); ?> + </option> + <?php } ?> + </select> + <small><?php echo __('Eine Kampagne kann genau einem Versandprofil zugeordnet werden.', 'wpsg'); ?></small> + </p> + </div> + </div> + + <div class="postbox"> + <h3 class="postbox-header"><?php echo __('Versandeinstellungen', 'wpsg'); ?></h3> + <div class="inside"> + <p> + <label for="subject"><strong><?php echo __('Betreff', 'wpsg'); ?></strong></label><br /> + <input type="text" class="widefat" id="subject" name="subject" value="<?php echo esc_attr($data['subject']); ?>" /> + </p> + <p> + <label for="from"><strong><?php echo __('Absender', 'wpsg'); ?></strong></label><br /> + <input type="text" class="widefat" id="from" name="from" value="<?php echo esc_attr($data['from']); ?>" /> + </p> + <p> + <label for="cc"><strong><?php echo __('CC', 'wpsg'); ?></strong></label><br /> + <input type="text" class="widefat" id="cc" name="cc" value="<?php echo esc_attr($data['cc']); ?>" /> + </p> + <p> + <label for="bcc"><strong><?php echo __('BCC', 'wpsg'); ?></strong></label><br /> + <input type="text" class="widefat" id="bcc" name="bcc" value="<?php echo esc_attr($data['bcc']); ?>" /> + </p> + </div> + </div> + + <div class="postbox"> + <h3 class="postbox-header"><?php echo __('Verfügbare Platzhalter', 'wpsg'); ?></h3> + <div class="inside"> + <p><small><?php echo __('Diese Platzhalter werden beim Versand automatisch mit den Bestell- und Kundendaten ersetzt. Nutzbar in Betreff, HTML- und Text-Inhalt.', 'wpsg'); ?></small></p> + <ul style="margin:0; padding-left:18px; list-style:disc;"> + <li><code>%kunde_anrede%</code> – <?php echo __('Anrede', 'wpsg'); ?></li> + <li><code>%kunde_vname%</code> – <?php echo __('Vorname', 'wpsg'); ?></li> + <li><code>%kunde_name%</code> – <?php echo __('Nachname', 'wpsg'); ?></li> + <li><code>%kunde_email%</code> – <?php echo __('E-Mail-Adresse', 'wpsg'); ?></li> + <li><code>%order_id%</code> – <?php echo __('Bestellnummer', 'wpsg'); ?></li> + <li><code>%order_cdate_format_de%</code> – <?php echo __('Bestelldatum', 'wpsg'); ?></li> + <li><code>%product_name%</code> – <?php echo __('Produktname', 'wpsg'); ?></li> + </ul> + </div> + </div> + </div> + </div> + + <div id="post-body"> + <div id="titlediv" style="margin-right:400px;"> + <div id="titlewrap"> + <input type="text" value="<?php echo esc_attr($data['name']); ?>" size="30" name="name" id="title" required /> + </div> + </div> + + <div id="normal-sortables" class="meta-box-sortables" style="margin-right:400px; width:initial !important;"> + <div class="postbox"> + <h3 class="postbox-header"><?php echo __('Inhalt (HTML)', 'wpsg'); ?></h3> + <div class="inside"> + +<!-- Einbindung TinyMCE --> + + <div id="wpng_rte_inside" class="inside wpng_rte_inside"> + + <?php if ($this->get_option('wpng_rte') == '1') { ?> + + <?php + + function wpng_tiny_mce_before_init($in) + { + $in['readonly'] = true; + return $in; + } + + function wpng_ShowTinyMCE() { + + wp_enqueue_script('common'); + wp_enqueue_script('jquery-color'); + wp_print_scripts('editor'); + if (function_exists('add_thickbox')) add_thickbox(); + wp_print_scripts('media-upload'); + if (function_exists('wp_tiny_mce')) wp_tiny_mce(); + wp_admin_css(); + wp_enqueue_script('utils'); + do_action("admin_print_styles-post-php"); + do_action('admin_print_styles'); + + } + + // Damit die qTranslate Interne Editor Übersetzung nicht aufgerufen wird + remove_filter('the_editor', 'qtrans_modifyRichEditor'); + remove_filter('the_editor', 'wpautop'); + + if ($this->view['data']->status == '1') + { + + add_filter('tiny_mce_before_init', 'wpng_tiny_mce_before_init'); + + } + + add_filter('mce_buttons', 'wpng_tinymce_button'); + add_filter('mce_external_plugins', 'wpng_tinymce_plugin'); + add_filter('admin_head','wpng_ShowTinyMCE'); + + wp_editor(@$data['content_html'], 'content_html'); + + ?> + + <?php } else if ($this->get_option('wpng_rte') == '0') { ?> + + <textarea id="content_text" name="content_text" rows="12" class="large-text code"><?php echo format_for_editor($data['content_html']); ?></textarea> + + <?php } else if ($this->get_option('wpng_rte') == '2') { $this->callMods('newsletter_addedit_rte', array($data)); } ?> + +<!-- Einbindung TinyMCE --> + +<!-- <textarea id="content_html" name="content_html" rows="12" class="large-text code">--><?php //echo esc_textarea($data['content_html']); ?><!--</textarea>--> + </div> + </div> + + <div class="postbox"> + <h3 class="postbox-header"><?php echo __('Inhalt (Text)', 'wpsg'); ?></h3> + <div class="inside"> + <textarea id="content_text" name="content_text" rows="10" class="large-text code"><?php echo esc_textarea($data['content_text']); ?></textarea> + </div> + </div> + + <div class="postbox"> + <h3 class="postbox-header"><?php echo __('Bedingungen', 'wpsg'); ?></h3> + <div class="inside"> + <?php include(WPSG_PATH_VIEW . '/mods/mod_campaigns/conditions_fields.phtml'); ?> + </div> + </div> + </div> + </div> + </div> + </form> +</div> |
