![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/cartforge.co/app/code/Xtento/StockImport/view/adminhtml/templates/widget/ |
<?php //$_htmlId = $block->getHtmlId() ? $block->getHtmlId() : '_' . uniqid(); $_htmlId = '_' . $block->mappingId; $_colspan = 2; if (!$block->isAddAfter()) { $_colspan--; } $_colspan = $_colspan > 1 ? 'colspan="' . $_colspan . '"' : ''; ?> <div class="grid" id="grid<?php echo $_htmlId ?>" style="position:relative; padding:0;"> <?php if ($block->getArrayRows()): ?> <div id="<?php echo $block->mappingId ?>DivOverlay" style="position: absolute; background-color:#000; -moz-opacity:0.85;opacity:0.85;filter:alpha(opacity=85);"> <div style="text-align:center; margin-top: 20px; padding: 20px;"> <span style="font-weight:bold;color: #fff; font-size: 120%;">Please wait until the page has finished loading. If the mapping table does not show up after 5-10 seconds or after the site has completely loaded, please refresh this site in your browser.<br/><br/>If this problem persists, please contact us at [email protected].</span> </div> </div> <?php endif; ?> <table cellpadding="0" cellspacing="0" class="border"> <tbody> <tr class="headings" id="headings<?php echo $_htmlId ?>"> <?php foreach ($block->getColumns() as $columnName => $column): ?> <th><?php echo $column['label'] ?></th> <?php endforeach; ?> <th><?php echo __('Configuration') ?></th> <th <?php echo $_colspan ?>><?= __('Actions') ?></th> </tr> <tr id="addRow<?php echo $_htmlId ?>"> <td colspan="<?php echo count($block->getColumns()) + 1 ?>"></td> <td <?php echo $_colspan ?>> <button style="margin-top:15px;" onclick="" class="scalable add" type="button" id="addToEndBtn<?php echo $_htmlId ?>"> <span><?php echo $block->getAddButtonLabel() ?></span> </button> <br/> <button style="margin-top: 3px;" onclick="" class="scalable add" type="button" id="addAllBtn<?php echo $_htmlId ?>"> <span><?php echo $block->getAddAllButtonLabel() ?></span> </button> </td> </tr> </tbody> </table> <input type="hidden" name="<?php echo $block->getElement()->getName() ?>[__empty]" value=""/> <input type="hidden" name="<?php echo $block->getElement()->getName( ) ?>[__type]" value="<?php echo $block->mappingId ?>"/> </div> <div id="empty<?php echo $_htmlId ?>"> <button style="" onclick="" class="scalable add" type="button" id="emptyAddBtn<?php echo $_htmlId ?>"> <span><?php echo $block->getAddButtonLabel() ?></span> </button> <button style="" onclick="" class="scalable add" type="button" id="emptyAddAllBtn<?php echo $_htmlId ?>"> <span><?php echo $block->getAddAllButtonLabel() ?></span> </button> </div> <?php if ($block->getArrayRows()): ?> <script> require(["jquery", "prototype"], function (jQuery) { Event.observe(window, 'load', function () { if (Position.cumulativeOffset($('grid<?php echo $_htmlId?>'))[1] !== 0) { $('<?php echo $block->mappingId?>DivOverlay').setStyle({ position: 'absolute', width: Element.getDimensions($('grid<?php echo $_htmlId?>')).width + 'px', height: Element.getDimensions($('grid<?php echo $_htmlId?>')).height + 'px' }); } }); }); </script> <?php endif; ?> <script type="text/javascript"> require(["jquery", "prototype"], function (jQuery) { // create row creator window.arrayRow<?php echo $_htmlId ?> = { // define row prototypeJS template template: new Template( '<tr id="#{_id}">' <?php foreach ($block->getColumns() as $columnName => $column):?> + '<td>' + '<?php echo $block->renderCellTemplate($columnName)?>' + '<\/td>' <?php endforeach;?> + '<td><button onclick="" class="scalable" type="button" id="configureBtn#{_id}"><span><?php echo __( 'Configure' ) ?><\/span> <!--<img id="configurationSetupImg#{_id}" src="<?php echo $block->getViewFileUrl('Xtento_StockImport::images/btn_show-hide_icon.gif' )?>" style="vertical-align: bottom; float: right; margin-top:1px;"\/>--><\/button><\/td>' <?php if ($block->isAddAfter()):?> + '<td nowrap><button onclick="" class="scalable add" type="button" id="addAfterBtn#{_id}"><span><?php echo __( 'Add after' ) ?><\/span><\/button><\/td>' <?php endif;?> + '<td><button onclick="arrayRow<?php echo $_htmlId ?>.del(\'#{_id}\')" class="scalable delete" type="button"><span><?php echo __( 'Delete' ) ?><\/span><\/button><\/td>' + '<\/tr>' ), rowsCount: 0, add: function (templateData, insertAfterId) { // generate default template data if ('' == templateData) { var d = new Date(); var templateData = { <?php foreach ($block->getColumns() as $columnName => $column):?> <?php echo $columnName ?> : '', <?php endforeach;?> _id : '_' + d.getTime() + '_' + d.getMilliseconds() } ; } // insert before last row if ('' == insertAfterId) { Element.insert($('addRow<?php echo $_htmlId ?>'), {before: this.template.evaluate(templateData)}); } // insert after specified row else { Element.insert($(insertAfterId), {after: this.template.evaluate(templateData)}); } <?php if ($block->isAddAfter()):?> Event.observe('addAfterBtn' + templateData._id, 'click', this.add.bind(this, '', templateData._id)); <?php endif;?> Event.observe('configureBtn' + templateData._id, 'click', this.showConfigurationPopup.bind(this, templateData._id)); this.rowsCount += 1; }, del: function (rowId) { $(rowId).remove(); if (<?php echo $block->mappingId?>_mapping_values[rowId]) { <?php echo $block->mappingId?>_mapping_values[rowId] = ''; } this.rowsCount -= 1; if (0 == this.rowsCount) { this.showButtonOnly(); } }, showConfigurationPopup: function (rowId) { if ($('browser_window') && typeof(Windows) != 'undefined') { Windows.focus('browser_window'); return; } fieldName = $('select_' + rowId).options[$('select_' + rowId).selectedIndex].innerHTML.replace(/ \*/, ''); var dialogWindow = Dialog.info(null, { closable: true, resizable: false, draggable: true, className: 'magento', windowClassName: 'popup-window', title: '<?php echo __('Advanced Configuration')?>: ' + fieldName, //top:100, width: 700, height: 420, zIndex: 10000, recenterAuto: false, hideEffect: Element.hide, showEffect: Element.show, id: 'browser_window', //url:url, onClose: function (param, el) { }, onShow: function (param, el) { //if ($('overlay_modal')) $('overlay_modal').observe('click', function(){ Windows.closeAll(); }); // window.parent.closeWindows(); } }); var xmlContents = '<\?xml version="1.0" encoding="UTF-8"?>\n<configuration>\n</configuration>'; if ($('<?php echo $block->getElement()->getName( )?>[' + rowId + '][xml]') && $('<?php echo $block->getElement()->getName( )?>[' + rowId + '][xml]').value != '') { xmlContents = quoteAttribute($('<?php echo $block->getElement()->getName()?>[' + rowId + '][xml]').value); } dialogWindow.getContent().update('<div style="padding: 10px;">' + //'<h3>Field Configuration: '+fieldName+'</h3>' + '<strong><?php echo __('Configuration XML')?></strong> - <?php echo __( 'Attention: This needs to be valid XML.' )?>' + '<a id="page-help-link" href="http://support.xtento.com/wiki/Magento_2_Extensions:Stock_Import_Module#.22Additional_Configuration.22" target="_blank" style="color: #EA7601; text-decoration: underline; line-height: 16px; float: right;"><?php echo __( 'Show help' ) ?></a>' + '<textarea style="width:100%; height:345px; display:none;" id="' + rowId + '_xml">' + xmlContents + '</textarea><br/>' + '<div id="' + rowId + '_editor_div" style="position:relative; width:100%; height:350px; margin-bottom: 5px;">' + '</div>' + '<button type="button" class="action-default scalable secondary save" onclick="xtSaveHiddenData(\'<?php echo $block->getElement( )->getName( )?>\', \'' + rowId + '\', \'xml\', $(\'' + rowId + '_xml\').value, false); return false;"><span><?php echo __( 'Save Configuration' )?></span></button> ' + '<button type="button" class="scalable delete" onclick="xtSaveHiddenData(\'<?php echo $block->getElement( )->getName()?>\', \'' + rowId + '\', \'xml\', \'\', true); return false;"><span><?php echo __( 'Empty Configuration' )?></span></button> ' + '<button type="button" class="scalable" onclick="Windows.closeAll(); return false;"><span>Cancel</span></button>' + '</div>'); if (typeof ace !== "undefined" && typeof ace.edit !== "undefined") { ace.config.set("basePath", "<?php echo $block->getJs('ace')?>"); ace.config.set("suffix", ".min.js"); window.editor = ace.edit(rowId + "_editor_div"); window.editor.setTheme("ace/theme/eclipse"); window.editor.getSession().setMode("ace/mode/xml"); window.editor.getSession().setUseWrapMode(true); window.editor.setBehavioursEnabled(false); window.editor.getSession().setValue($(rowId + "_xml").value); } else { $(rowId + "_editor_div").hide(); $(rowId + "_xml").show(); } dialogWindow.showCenter(); }, showButtonOnly: function () { $('grid<?php echo $_htmlId ?>').hide(); $('empty<?php echo $_htmlId ?>').show(); } } // bind add action to "Add" button in last row Event.observe('addToEndBtn<?php echo $_htmlId ?>', 'click', arrayRow<?php echo $_htmlId ?>.add.bind(arrayRow<?php echo $_htmlId ?>, '', '')); // add existing rows <?php $_addAfterId = "headings{$_htmlId}"; foreach ($block->getArrayRows() as $_rowId => $_row) { echo "arrayRow{$_htmlId}.add(" . $_row->toJson() . ", '{$_addAfterId}');\n"; $_addAfterId = $_rowId; } ?> // initialize standalone button $('empty<?php echo $_htmlId ?>').hide(); Event.observe('emptyAddBtn<?php echo $_htmlId ?>', 'click', function () { $('grid<?php echo $_htmlId ?>').show(); $('empty<?php echo $_htmlId ?>').hide(); arrayRow<?php echo $_htmlId ?>.add('', ''); }); // Add all buttons Event.observe('addAllBtn<?php echo $_htmlId ?>', 'click', function () { <?php echo $block->getElement()->getName() ?>xtAddAllFields(); }); Event.observe('emptyAddAllBtn<?php echo $_htmlId ?>', 'click', function () { $('grid<?php echo $_htmlId ?>').show(); $('empty<?php echo $_htmlId ?>').hide(); <?php echo $block->getElement()->getName() ?>xtAddAllFields(); }); function <?php echo $block->getElement()->getName() ?>xtAddAllFields() { <?php $mappingFields = $block->getMappingFields(); $fieldCounter = 0; foreach ($mappingFields as $code => $field) { if (isset($field['disabled']) && $field['disabled']) { continue; } $fieldCounter++; $fieldId = $block->getElement()->getName() . '_' . time() . '_' . $fieldCounter; $array = ['field' => $code, 'value' => '', 'default_value' => '', '_id' => $fieldId]; ?> <?php echo $block->getElement()->getName()?>_mapping_values['<?php echo $fieldId?>'] = '<?php echo $code;?>'; <?php echo $block->getElement()->getName()?>_default_values['<?php echo $fieldId?>'] = ''; arrayRow<?php echo $_htmlId ?>.add(<?php echo json_encode($array) ?>, ''); <?php } ?> } // if no rows, hide grid and show button only <?php if (!$block->getArrayRows()):?> arrayRow<?php echo $_htmlId ?>.showButtonOnly(); <?php endif;?> // toggle the grid, if element is disabled (depending on scope) <?php if ($block->getElement()->getDisabled()):?> toggleValueElements({checked: true}, $('grid<?php echo $_htmlId ?>').parentNode); <?php endif;?> function updateCustomizedConfigurationButton() { } // Load ace.js window.editor = false; if (typeof aceLoaded == 'undefined') { var aceLoaded = false; } Event.observe(window, 'load', function () { (function () { if (aceLoaded == false) { aceLoaded = true; var s = document.createElement('script'); s.type = 'text/javascript'; s.async = true; s.src = '<?php echo $block->getJs('ace/ace.min.js');?>'; var x = document.getElementsByTagName('script')[0]; x.parentNode.insertBefore(s, x); try { s.onload = function () { if (typeof ace !== 'undefined') { ace.aceBaseUrl = "<?php echo $block->getJs('ace')?>"; } } } catch (err) { } } })(); // Update "customized" button: updateCustomizedConfigurationButton(); }); }); </script> <div id="<?php echo $block->getElement()->getName() ?>_additional_config" style="display: none;"> <?php $profile = \Magento\Framework\App\ObjectManager::getInstance()->get('Magento\Framework\Registry')->registry( 'stockimport_profile' ); $configuration = $profile->getConfiguration(); if (isset($configuration[$block->getElement()->getName()])) { $mapping = $configuration[$block->getElement()->getName()]; foreach ($mapping as $rowId => $configuration) { if (isset($configuration['xml'])) { echo '<input type="hidden" id="' . $block->getElement()->getName( ) . '[' . $rowId . '][xml]" name="' . $block->getElement()->getName( ) . '[' . $rowId . '][xml]" value="' . htmlspecialchars($configuration['xml']) . '"/>' . "\n"; } } } ?> </div> <style> .grid table td { padding: 1px 3px !important; } #page-help-link { background: rgba(0, 0, 0, 0) url("<?php echo $block->getViewFileUrl('Xtento_StockImport::images/help.png')?>") no-repeat scroll 0 50%; color: #ebebff; line-height: 26px; padding-left: 20px; } .overlay_dialog { background-color: #666666; opacity: 0.6; } .overlay___invisible__ { background-color: #666666; opacity: 0; } .dialog_nw { height: 23px; width: 9px; } .dialog_n { height: 23px; } .dialog_ne { height: 23px; width: 9px; } .dialog_e { width: 2px; } .dialog_w { width: 2px; } .dialog_sw { height: 19px; width: 9px; } .dialog_s { height: 19px; } .dialog_se { height: 19px; width: 9px; } .dialog_sizer { cursor: se-resize; height: 19px; width: 9px; } .dialog_close { cursor: pointer; height: 14px; left: 8px; position: absolute; top: 5px; width: 14px; z-index: 2000; } .dialog_minimize { cursor: pointer; height: 15px; left: 28px; position: absolute; top: 5px; width: 14px; z-index: 2000; } .dialog_maximize { cursor: pointer; height: 15px; left: 49px; position: absolute; top: 5px; width: 14px; z-index: 2000; } .dialog_title { color: #000; float: left; font-family: Tahoma, Arial, sans-serif; font-size: 12px; height: 14px; text-align: center; width: 100%; } .dialog_content { background-color: #123; color: #ddd; font-family: Tahoma, Arial, sans-serif; font-size: 10px; overflow: auto; } .top_draggable, .bottom_draggable { cursor: move; } .status_bar { font-size: 12px; } .status_bar input { font-size: 12px; } .wired_frame { border: 1px dashed #000; display: block; position: absolute; } .dialog { display: block; position: absolute; } .dialog table.table_window { border-collapse: collapse; border-spacing: 0; margin: 0; padding: 0; width: 100%; } .dialog table.table_window td, .dialog table.table_window th { padding: 0; } .dialog .title_window { -moz-user-select: none; } .dialog { border: 1px solid #555; } .dialog .bot { display: none !important; } .overlay_magento { background-color: #000; filter: alpha(opacity=60); -moz-opacity: .6; opacity: .6; -webkit-opacity: .6; } .top.table_window td { background-color: #f1f1f1 !important; } .magento_nw { width: 6px; height: 28px; } .magento_n { height: 28px; } .magento_ne { width: 6px; height: 28px; } .magento_w { width: 6px; } .magento_e { width: 6px; } .magento_w, .magento_e, .magento_content { background: #fafafa; } .magento_sw { background: #deebf0; width: 5px; height: 3px; } .magento_s { background: #deebf0; height: 3px; } .magento_se, .magento_sizer { background: #deebf0; width: 5px; height: 3px; } .magento_sizer { cursor: se-resize; } .magento_close { width: 16px; height: 16px; position: absolute; top: 5px; right: 7px; cursor: pointer; z-index: 1000; } .magento_title { float: left; width: 100%; text-align: left; color: #303030; font-size: 60%; font-weight: 500; line-height: 1.2; word-wrap: break-word; } .magento_content { overflow: auto; font-size: 12px; } .magento_content, .magento_content label { color: #333; font-family: Arial, sans-serif; } .magento_buttons { padding: 10px; text-align: right; } .magento_buttons input.button { border-width: 1px; border-style: solid; border-color: #ed6502 #a04300 #a04300 #ed6502; background: #ffac47; padding: 0 7px 1px 7px; font: bold 12px/18px Arial, Helvetica, sans-serif; color: #fff; cursor: pointer; text-align: center; white-space: nowrap; } .magento_w, .magento_e, .magento_content { background: white !important; } #editor { position: absolute; top: 0; right: 0; bottom: 0; left: 0; } </style>