summaryrefslogtreecommitdiff
path: root/views/mods/mod_productview
diff options
context:
space:
mode:
Diffstat (limited to 'views/mods/mod_productview')
-rw-r--r--views/mods/mod_productview/mce_plugin.js46
-rw-r--r--views/mods/mod_productview/productview.phtml3
-rw-r--r--views/mods/mod_productview/shortcodegenerator.phtml114
3 files changed, 162 insertions, 1 deletions
diff --git a/views/mods/mod_productview/mce_plugin.js b/views/mods/mod_productview/mce_plugin.js
new file mode 100644
index 0000000..179e488
--- /dev/null
+++ b/views/mods/mod_productview/mce_plugin.js
@@ -0,0 +1,46 @@
+(function() {
+
+ tinymce.create('tinymce.plugins.wpsgModProductviewPlugin', {
+
+ init : function(ed, url) {
+
+ ed.addCommand('mcewpsg2', function() {
+ ed.windowManager.open({
+ file : 'admin.php?page=wpsg-Produkt&action=ajax&mod=wpsg_mod_productview&noheader=1',
+ title: 'Produktansicht generieren',
+ width : 450,
+ height : 450,
+ inline : 1
+ }, {
+ plugin_url : url
+ });
+ });
+
+ ed.addButton('wpsgModProductviewPlugin', {
+ title : 'Produkte über die Produktansicht anzeigen',
+ cmd : 'mcewpsg2',
+ image : url + '/../../gfx/table.png'
+ });
+
+ ed.onNodeChange.add(function(ed, cm, n) {
+ cm.setActive('wpsgModProductviewPlugin', n.nodeName == 'IMG');
+ });
+ },
+
+ createControl : function(n, cm) {
+ return null;
+ },
+
+ getInfo : function() {
+ return {
+ longname : 'wpShopGermany Produktauswahl',
+ author : 'maennchen1.de',
+ authorurl : 'http://maennchen1.de',
+ version : "3.0"
+ };
+ }
+ });
+
+ tinymce.PluginManager.add('wpsgModProductviewPlugin', tinymce.plugins.wpsgModProductviewPlugin);
+
+})();
diff --git a/views/mods/mod_productview/productview.phtml b/views/mods/mod_productview/productview.phtml
index 2175f48..111f774 100644
--- a/views/mods/mod_productview/productview.phtml
+++ b/views/mods/mod_productview/productview.phtml
@@ -14,7 +14,8 @@
<?php if (wpsg_isSizedArray($this->view['wpsg_mod_productview']['products'])) { ?>
<div class="col-lg-3 wpsg_mod_productview-order">
- asd
+ <?php echo __('Sortierung', 'wpsg'); ?><span class="glyphicon glyphicon-menu-down"></span>
+ <strong>Neueste zuerst</strong>
</div>
<div class="col-lg-6 wpsg_mod_productview-info">
diff --git a/views/mods/mod_productview/shortcodegenerator.phtml b/views/mods/mod_productview/shortcodegenerator.phtml
new file mode 100644
index 0000000..b68b548
--- /dev/null
+++ b/views/mods/mod_productview/shortcodegenerator.phtml
@@ -0,0 +1,114 @@
+<?php
+
+ /**
+ * Template für die Produktauswahl über den RTE
+ */
+
+?>
+<html>
+ <head>
+ <title><?php echo __('Produktansicht generieren', 'wpsg'); ?></title>
+
+ <script language="javascript" type="text/javascript" src="<?php echo get_option('siteurl'); ?>/wp-includes/js/jquery/jquery.js"></script>
+ <script language="javascript" type="text/javascript" src="<?php echo get_option('siteurl'); ?>/wp-includes/js/tinymce/tiny_mce_popup.js"></script>
+ <script language="javascript" type="text/javascript" src="<?php echo get_option('siteurl'); ?>/wp-includes/js/tinymce/utils/mctabs.js"></script>
+ <script language="javascript" type="text/javascript" src="<?php echo get_option('siteurl'); ?>/wp-includes/js/tinymce/utils/form_utils.js"></script>
+
+ <link rel="stylesheet" href="<?php echo get_option('siteurl'); ?>/wp-content/plugins/wpshopgermany/views/js/bootstrap-3.3.6-dist/css/bootstrap.css" type="text/css" media="all" />
+ <link rel="stylesheet" href="<?php echo get_option('siteurl'); ?>/wp-content/plugins/wpshopgermany/views/js/bootstrap-3.3.6-dist/css/bootstrap-theme.css" type="text/css" media="all" />
+ </head>
+ <body>
+
+ <div style="padding-top:15px; font-size:12px;" class="form-horizontal">
+
+ <div class="container-fluid">
+
+ <?php echo wpsg_drawForm_Input('title', __('Titel', 'wpsg'), ''); ?>
+ <?php echo wpsg_drawForm_Select('showswitch', __('Anzeige', 'wpsg'), $this->view['arSelect'], '-1'); ?>
+
+ <div class="showswitch showswitch_0" style="display:none;">
+ <?php echo wpsg_drawForm_Input('product_ids', __('Produkte (IDs kommagetrennt)', 'wpsg'), ''); ?>
+ </div>
+
+ <div class="showswitch showswitch_9" style="display:none;">
+ <?php echo wpsg_drawForm_Select('pg_ids', __('Produktgruppen (Mehrfachauswahl mit STRG)', 'wpsg'), $this->view['arProductgroups'], '', array('multiple' => 8)); ?>
+ </div>
+
+ <div class="showswitch showswitch_15" style="display:none;">
+ <?php echo wpsg_drawForm_Select('pg_cat', __('Produktkategorien (Mehrfachauswahl mit STRG)', 'wpsg'), $this->view['arCategories'], '', array('multiple' => 8)); ?>
+ </div>
+
+ </div>
+
+ <input onclick="return insertSC();" style="margin:15px; width:auto; display:block; padding:3px 10px 3px 10px; box-sizing:border-box;" type="button" value="<?php echo __('Shortcode einfügen', 'wpsg'); ?>" />
+
+ <script type="text/javascript">/* <![CDATA[ */
+
+ function insertSC()
+ {
+
+ var text = "[wpsg_productview ";
+
+ if (jQuery('#title').val().length > 0) text += ' title="' + jQuery('#title').val() + '"';
+ if (jQuery('#showswitch').val() == '-1') text += ' product="-1"';
+ else if (jQuery('#showswitch').val() == '0') text += ' product="' + jQuery('#product_ids').val() + '"';
+ else if (jQuery('#showswitch').val() == '9')
+ {
+
+ text += ' productgroup_ids="'; var arIDs = [];
+ jQuery('#pg_ids option:selected').each(function() { arIDs.push(jQuery(this).val()); } );
+ text += arIDs.join(',') + '"';
+
+ }
+ else if (jQuery('#showswitch').val() == '15')
+ {
+
+ text += ' cat_ids="'; var arIDs = [];
+ jQuery('#pg_cat option:selected').each(function() { arIDs.push(jQuery(this).val()); } );
+ text += arIDs.join(',') + '"';
+
+ }
+
+ text += "]";
+
+ if (window.tinyMCE)
+ {
+
+ <?php if (get_bloginfo('version') < 3.9) { ?>
+
+ window.tinyMCE.execInstanceCommand("content", "mceInsertContent", false, text);
+ tinyMCEPopup.editor.execCommand("mceRepaint");
+
+ <?php } else { ?>
+
+ parent.tinyMCE.execCommand('mceInsertContent', false, text);
+ parent.tinyMCE.activeEditor.windowManager.close();
+
+ <?php } ?>
+
+
+ tinyMCEPopup.close();
+
+ }
+
+ return false;
+
+ }
+
+ jQuery(document).ready(function() {
+
+ jQuery('#showswitch').bind('change', function() {
+
+ jQuery('.showswitch').hide();
+ jQuery('.showswitch_' + jQuery(this).val()).show();
+
+ } ).change();
+
+ } );
+
+ /* ]]> */</script>
+
+ </div>
+
+ </body>
+</html> \ No newline at end of file