$manufacturer_inputs_string = '';
     $languages = xos_get_languages();
     for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
         $manufacturer_inputs_string .= '<br /><div class="input-group"><span class="input-group-addon">' . xos_image(DIR_WS_CATALOG_IMAGES . 'catalog/templates/' . DEFAULT_TPL . '/' . $languages[$i]['directory'] . '/' . $languages[$i]['image'], $languages[$i]['name']) . '</span>' . xos_draw_input_field('manufacturers_name[' . $languages[$i]['id'] . ']', xos_get_manufacturers_name($mInfo->manufacturers_id, $languages[$i]['id']), 'class="form-control"') . '</div>';
     }
     $contents[] = array('text' => '<br />' . TEXT_MANUFACTURERS_NAME . $manufacturer_inputs_string);
     $manufacturer_inputs_string = '';
     $languages = xos_get_languages();
     for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
         $manufacturer_inputs_string .= '<br /><div class="input-group"><span class="input-group-addon">' . xos_image(DIR_WS_CATALOG_IMAGES . 'catalog/templates/' . DEFAULT_TPL . '/' . $languages[$i]['directory'] . '/' . $languages[$i]['image'], $languages[$i]['name']) . '</span>' . xos_draw_input_field('manufacturers_url[' . $languages[$i]['id'] . ']', xos_get_manufacturer_url($mInfo->manufacturers_id, $languages[$i]['id']), 'class="form-control"') . '</div>';
     }
     $contents[] = array('text' => '<br />' . TEXT_MANUFACTURERS_URL . $manufacturer_inputs_string);
     if ($mInfo->manufacturers_image) {
         $contents[] = array('text' => '<br />' . xos_image(DIR_WS_CATALOG_IMAGES . 'manufacturers/' . $mInfo->manufacturers_image, $mInfo->manufacturers_name) . '<br /><b>' . $mInfo->manufacturers_image . '</b><div class="checkbox"><label>' . xos_draw_selection_field('delete_manufacturer_image', 'checkbox', 'true') . TEXT_DELETE . '</label></div>' . xos_draw_hidden_field('current_manufacturer_image', $mInfo->manufacturers_image));
     }
     $contents[] = array('text' => '<br />' . TEXT_MANUFACTURERS_IMAGE . '<br />' . xos_draw_file_field('manufacturers_image') . '<br />');
     $contents[] = array('text' => '<br /><a href="" onclick="manufacturers.submit(); return false" class="btn btn-default btn-margin-infobox" title=" ' . BUTTON_TITLE_SAVE . ' ">' . BUTTON_TEXT_SAVE . '</a><a href="' . xos_href_link(FILENAME_MANUFACTURERS, 'page=' . $_GET['page'] . '&mID=' . $mInfo->manufacturers_id) . '" class="btn btn-default btn-margin-infobox" title=" ' . BUTTON_TITLE_CANCEL . ' ">' . BUTTON_TEXT_CANCEL . '</a><br />&nbsp;');
     break;
 case 'delete':
     $heading_title = '<b>' . TEXT_HEADING_DELETE_MANUFACTURER . '</b>';
     $form_tag = xos_draw_form('manufacturers', FILENAME_MANUFACTURERS, 'page=' . $_GET['page'] . '&mID=' . $mInfo->manufacturers_id . '&action=deleteconfirm');
     $contents[] = array('text' => TEXT_DELETE_INTRO);
     $contents[] = array('text' => '<br /><b>' . $mInfo->manufacturers_name . '</b>');
     if ($mInfo->manufacturers_image) {
         $contents[] = array('text' => '<div class="checkbox"><label>' . xos_draw_checkbox_field('delete_image') . ' ' . TEXT_DELETE_IMAGE . '</label></div>');
     }
     if ($mInfo->products_count > 0) {
         $contents[] = array('text' => '<div class="checkbox"><label>' . xos_draw_checkbox_field('delete_products') . ' ' . TEXT_DELETE_PRODUCTS . '</label></div>');
         $contents[] = array('text' => '<br />' . sprintf(TEXT_DELETE_WARNING_PRODUCTS, $mInfo->products_count));
     }
     $contents[] = array('text' => '<br /><a href="" onclick="manufacturers.submit(); return false" class="btn btn-danger btn-margin-infobox" title=" ' . BUTTON_TITLE_DELETE . ' ">' . BUTTON_TEXT_DELETE . '</a><a href="' . xos_href_link(FILENAME_MANUFACTURERS, 'page=' . $_GET['page'] . '&mID=' . $mInfo->manufacturers_id) . '" class="btn btn-default btn-margin-infobox" title=" ' . BUTTON_TITLE_CANCEL . ' ">' . BUTTON_TEXT_CANCEL . '</a><br />&nbsp;');
     $contents[] = array('text' => '<br /><a href="" onclick="file.submit(); return false" class="button-default" style="margin-right: 5px; float: left" title=" ' . BUTTON_TITLE_DELETE . ' "><span>' . BUTTON_TEXT_DELETE . '</span></a><a href="' . xos_href_link(FILENAME_FILE_MANAGER, xos_not_null($fInfo->name) ? 'info=' . urlencode($fInfo->name) : '') . '" class="button-default" style="margin-right: 5px; float: left" title=" ' . BUTTON_TITLE_CANCEL . ' "><span>' . BUTTON_TEXT_CANCEL . '</span></a><br />&nbsp;');
     break;
 case 'new_folder':
     $heading_title = '<b>' . TEXT_NEW_FOLDER . '</b>';
     $form_tag = xos_draw_form('folder', FILENAME_FILE_MANAGER, 'action=insert');
     $contents[] = array('text' => TEXT_NEW_FOLDER_INTRO);
     $contents[] = array('text' => '<br />' . TEXT_FILE_NAME . '<br />' . xos_draw_input_field('folder_name'));
     $contents[] = array('text' => '<br />' . ($directory_writeable == true ? '<a href="" onclick="folder.submit(); return false" class="button-default" style="margin-right: 5px; float: left" title=" ' . BUTTON_TITLE_SAVE . ' "><span>' . BUTTON_TEXT_SAVE . '</span></a>' : '') . '<a href="' . xos_href_link(FILENAME_FILE_MANAGER, isset($_GET['info']) ? 'info=' . urlencode($_GET['info']) : '') . '" class="button-default" style="margin-right: 5px; float: left" title=" ' . BUTTON_TITLE_CANCEL . ' "><span>' . BUTTON_TEXT_CANCEL . '</span></a><br />&nbsp;');
     break;
 case 'upload':
     $heading_title = '<b>' . TEXT_INFO_HEADING_UPLOAD . '</b>';
     $form_tag = xos_draw_form('file', FILENAME_FILE_MANAGER, 'action=processuploads', 'post', 'enctype="multipart/form-data"');
     $contents[] = array('text' => TEXT_UPLOAD_INTRO);
     $file_upload = '';
     for ($i = 1; $i < 6; $i++) {
         $file_upload .= xos_draw_file_field('file_' . $i) . '<br />';
     }
     $contents[] = array('text' => '<br />' . $file_upload);
     $contents[] = array('text' => '<br />' . ($directory_writeable == true ? '<a href="" onclick="file.submit(); return false" class="button-default" style="margin-right: 5px; float: left" title=" ' . BUTTON_TITLE_UPLOAD . ' "><span>' . BUTTON_TEXT_UPLOAD . '</span></a>' : '') . '<a href="' . xos_href_link(FILENAME_FILE_MANAGER, isset($_GET['info']) ? 'info=' . urlencode($_GET['info']) : '') . '" class="button-default" style="margin-right: 5px; float: left" title=" ' . BUTTON_TITLE_CANCEL . ' "><span>' . BUTTON_TEXT_CANCEL . '</span></a><br />&nbsp;');
     break;
 default:
     if (isset($fInfo) && is_object($fInfo)) {
         $heading_title = '<b>' . $fInfo->name . '</b>';
         $ws_path = str_replace(DIR_FS_DOCUMENT_ROOT, DIR_WS_CATALOG, $_SESSION['current_path']);
         if (substr($ws_path, -1) != '/') {
             $ws_path = $ws_path . '/';
         }
         if (!($fInfo->is_dir || $fInfo->is_image)) {
             $contents[] = array('text' => '<a href="' . xos_href_link(FILENAME_FILE_MANAGER, 'info=' . urlencode($fInfo->name) . '&action=edit') . '" class="button-default" style="margin-right: 5px; float: left" title=" ' . BUTTON_TITLE_EDIT . ' "><span>' . BUTTON_TEXT_EDIT . '</span></a>');
         }
         if ($fInfo->is_image) {
Exemplo n.º 3
0
         $contents[] = array('text' => '<br /><div class="checkbox"><label>' . xos_draw_checkbox_field('download', 'yes') . ' ' . TEXT_INFO_DOWNLOAD_ONLY . '*</label></div>*' . TEXT_INFO_BEST_THROUGH_HTTPS);
     } else {
         $contents[] = array('text' => '<br /><div class="radio"><label>' . xos_draw_radio_field('download', 'yes', true) . TEXT_INFO_DOWNLOAD_ONLY . '*</label></div>*' . TEXT_INFO_BEST_THROUGH_HTTPS);
     }
     $contents[] = array('text' => '<br /><a href="" onclick="backup.submit(); return false" class="btn btn-default btn-margin-infobox" title=" ' . BUTTON_TITLE_BACKUP . ' ">' . BUTTON_TEXT_BACKUP . '</a><a href="' . xos_href_link(FILENAME_BACKUP) . '" class="btn btn-default btn-margin-infobox" title=" ' . BUTTON_TITLE_CANCEL . ' ">' . BUTTON_TEXT_CANCEL . '</a><br />&nbsp;');
     break;
 case 'restore':
     $heading_title = '<b>' . $buInfo->date . '</b>';
     $contents[] = array('text' => xos_break_string(sprintf(TEXT_INFO_RESTORE, DIR_FS_BACKUP . ($buInfo->compression != TEXT_NO_EXTENSION ? substr($buInfo->file, 0, strrpos($buInfo->file, '.')) : $buInfo->file), $buInfo->compression != TEXT_NO_EXTENSION ? TEXT_INFO_UNPACK : ''), 35, ' '));
     $contents[] = array('text' => '<br /><a href="' . xos_href_link(FILENAME_BACKUP, 'file=' . $buInfo->file . '&action=restorenow') . '" class="btn btn-default btn-margin-infobox" title=" ' . BUTTON_TITLE_RESTORE . ' ">' . BUTTON_TEXT_RESTORE . '</a><a href="' . xos_href_link(FILENAME_BACKUP, 'file=' . $buInfo->file) . '" class="btn btn-default btn-margin-infobox" title=" ' . BUTTON_TITLE_CANCEL . ' ">' . BUTTON_TEXT_CANCEL . '</a><br />&nbsp;');
     break;
 case 'restorelocal':
     $heading_title = '<b>' . TEXT_INFO_HEADING_RESTORE_LOCAL . '</b>';
     $form_tag = xos_draw_form('restore', FILENAME_BACKUP, 'action=restorelocalnow', 'post', 'enctype="multipart/form-data"');
     $contents[] = array('text' => TEXT_INFO_RESTORE_LOCAL . '<br /><br />' . TEXT_INFO_BEST_THROUGH_HTTPS);
     $contents[] = array('text' => '<br />' . xos_draw_file_field('sql_file'));
     $contents[] = array('text' => TEXT_INFO_RESTORE_LOCAL_RAW_FILE);
     $contents[] = array('text' => '<br /><a href="" onclick="restore.submit(); return false" class="btn btn-default btn-margin-infobox" title=" ' . BUTTON_TITLE_RESTORE . ' ">' . BUTTON_TEXT_RESTORE . '</a><a href="' . xos_href_link(FILENAME_BACKUP) . '" class="btn btn-default btn-margin-infobox" title=" ' . BUTTON_TITLE_CANCEL . ' ">' . BUTTON_TEXT_CANCEL . '</a><br />&nbsp;');
     break;
 case 'delete':
     $heading_title = '<b>' . $buInfo->date . '</b>';
     $form_tag = xos_draw_form('del', FILENAME_BACKUP, 'file=' . $buInfo->file . '&action=deleteconfirm');
     $contents[] = array('text' => TEXT_DELETE_INTRO);
     $contents[] = array('text' => '<br /><b>' . $buInfo->file . '</b>');
     $contents[] = array('text' => '<br /><a href="" onclick="del.submit(); return false" class="btn btn-danger btn-margin-infobox" title=" ' . BUTTON_TITLE_DELETE . ' ">' . BUTTON_TEXT_DELETE . '</a><a href="' . xos_href_link(FILENAME_BACKUP, 'file=' . $buInfo->file) . '" class="btn btn-default btn-margin-infobox" title=" ' . BUTTON_TITLE_CANCEL . ' ">' . BUTTON_TEXT_CANCEL . '</a><br />&nbsp;');
     break;
 default:
     if (isset($buInfo) && is_object($buInfo)) {
         $heading_title = '<b>' . $buInfo->date . '</b>';
         $contents[] = array('text' => '<a href="' . xos_href_link(FILENAME_BACKUP, 'file=' . $buInfo->file . '&action=restore') . '" class="btn btn-default btn-margin-infobox" title=" ' . BUTTON_TITLE_RESTORE . ' ">' . BUTTON_TEXT_RESTORE . '</a><a href="' . xos_href_link(FILENAME_BACKUP, 'file=' . $buInfo->file . '&action=delete') . '" class="btn btn-danger btn-margin-infobox" title=" ' . BUTTON_TITLE_DELETE . ' ">' . BUTTON_TEXT_DELETE . '</a>');
         $contents[] = array('text' => '<br />' . TEXT_INFO_DATE . ' ' . $buInfo->date);
Exemplo n.º 4
0
         $current_attributes_values_array[$attributes_values['products_attributes_id']] = array('value_price' => $attributes_values['options_values_price'], 'price_prefix' => $attributes_values['price_prefix']);
         $attributes_values_array[] = array('option_name' => $options_name, 'value_name' => $attributes_values['products_options_values_name'], 'input_value_price' => xos_draw_input_field('value_price_' . $attributes_values['products_attributes_id'], $attributes_values['options_values_price'], 'style="background: #fffffe;" size ="11" onkeyup="updateGross(\'value_price_' . $attributes_values['products_attributes_id'] . '\', \'value_price_gross_' . $attributes_values['products_attributes_id'] . '\')"'), 'input_value_price_gross' => xos_draw_input_field('value_price_gross_' . $attributes_values['products_attributes_id'], $attributes_values['options_values_price'], 'style="background: #fffffe;" size ="11" onkeyup="updateNet(\'value_price_gross_' . $attributes_values['products_attributes_id'] . '\', \'value_price_' . $attributes_values['products_attributes_id'] . '\')"'), 'input_price_prefix' => xos_draw_input_field('price_prefix_' . $attributes_values['products_attributes_id'], $attributes_values['price_prefix'], 'style="background: #fffffe; text-align:center;" size ="1"'));
         $update_gross_string .= 'updateGross(\'value_price_' . $attributes_values['products_attributes_id'] . '\', \'value_price_gross_' . $attributes_values['products_attributes_id'] . '\');' . "\n";
         $update_net_string .= 'updateNet(\'value_price_gross_' . $attributes_values['products_attributes_id'] . '\', \'value_price_' . $attributes_values['products_attributes_id'] . '\');' . "\n";
     }
 }
 $javascript .= "\n" . 'function toggle(targetId, iState) {' . "\n" . '  var obj = document.getElementById(targetId).style;' . "\n" . '  if (obj.display == "none" && iState != 0 && iState != 1){' . "\n" . '    obj.display="";' . "\n" . '  } else if (iState != 0 && iState != 1){' . "\n" . '    obj.display="none";' . "\n" . '  }' . "\n" . '  if (iState == 1){' . "\n" . '    obj.display="";' . "\n" . '  } else if (iState == 0){' . "\n" . '    obj.display="none";' . "\n" . '  }' . "\n" . '}' . "\n\n" . 'function updateChecked(cuID) {' . "\n" . '  var selected = document.forms["' . $form_action . '"].elements["option[" + cuID + "]"].checked;' . "\n" . '  if (selected) {' . "\n" . '    toggle("box_" + cuID,1);' . "\n" . '  } else {' . "\n" . '    toggle("box_" + cuID,0);' . "\n" . '  }' . "\n" . '}' . "\n\n" . 'function doRound(x, places) {' . "\n" . '  return Math.round(x * Math.pow(10, places)) / Math.pow(10, places);' . "\n" . '}' . "\n\n" . 'function getTaxRate() {' . "\n" . '  var selected_value = document.forms["' . $form_action . '"].tax_rates_final_id.selectedIndex;' . "\n" . '  var parameterVal = document.forms["' . $form_action . '"].tax_rates_final_id[selected_value].value;' . "\n\n" . '  if ( (parameterVal > 0) && (tax_rates[parameterVal] > 0) ) {' . "\n" . '    return tax_rates[parameterVal];' . "\n" . '  } else {' . "\n" . '    return 0;' . "\n" . '  }' . "\n" . '}' . "\n\n" . 'function updateGross(inField, setField) {' . "\n" . '  var taxRate = getTaxRate();' . "\n" . '  var grossValue = document.forms["' . $form_action . '"].elements[inField].value;' . "\n\n" . '  if (taxRate > 0) {' . "\n" . '    grossValue = grossValue * ((taxRate / 100) + 1);' . "\n" . '  }' . "\n\n" . '  document.forms["' . $form_action . '"].elements[setField].value = doRound(grossValue, 4);' . "\n" . '}' . "\n\n" . 'function updateNet(inField, setField) {' . "\n" . '  var taxRate = getTaxRate();' . "\n" . '  var netValue = document.forms["' . $form_action . '"].elements[inField].value;' . "\n\n" . '  if (taxRate > 0) {' . "\n" . '    netValue = netValue / ((taxRate / 100) + 1);' . "\n" . '  }' . "\n\n" . '  document.forms["' . $form_action . '"].elements[setField].value = doRound(netValue, 4);' . "\n" . '}' . "\n\n" . 'function updatePrices(net, gross) {' . "\n\n" . '  if (gross) {' . "\n" . '    ' . $update_gross_string . "\n" . '  }' . "\n\n" . '  if (net) {' . "\n" . '    ' . $update_net_string . "\n" . '  }' . "\n\n" . '}' . "\n\n" . 'function caching_qty(fdName) {' . "\n" . '  current_qty = document.forms["' . $form_action . '"].elements[fdName].value;' . "\n" . '}' . "\n\n" . 'function update_total_qty(fdName) {' . "\n" . '  var total_qty = parseInt(document.getElementById("total_qty").innerHTML, 10);' . "\n" . '  var new_qty = parseInt(document.forms["' . $form_action . '"].elements[fdName].value, 10);' . "\n" . '  var old_qty = parseInt(current_qty, 10);' . "\n\n" . '  if (old_qty > 0) {' . "\n" . '    total_qty = total_qty - old_qty;' . "\n" . '  }' . "\n\n" . '  if (new_qty > 0) {' . "\n" . '    total_qty = total_qty + new_qty;' . "\n" . '  }' . "\n\n" . '  document.getElementById("total_qty").innerHTML = total_qty;' . "\n" . '}' . "\n\n" . 'function getAbsoluteX (elm) {' . "\n" . '  var x = 0;' . "\n" . '  if (elm && typeof elm.offsetParent != "undefined") {' . "\n" . '    while (elm && typeof elm.offsetLeft == "number") {' . "\n" . '      x += elm.offsetLeft;' . "\n" . '      elm = elm.offsetParent;' . "\n" . '    }' . "\n" . '  }' . "\n" . '  return x;' . "\n" . '}' . "\n\n" . 'function toggleWithAbsoluteX(targetId) {' . "\n" . '  var elem = document.getElementById(targetId);' . "\n" . '  if (elem.style.display == "none"){' . "\n" . '    elem.style.display="block";' . "\n" . '    var x = getAbsoluteX(elem);' . "\n" . '    elem.style.display="none";' . "\n" . '    if (x < 0){' . "\n" . '      oldRightValue = elem.style.right;' . "\n" . '      $("#"+targetId).css({"right" : x+"px"}).show(1);' . "\n" . '    } else {' . "\n" . '      $("#"+targetId).show(1);' . "\n" . '    }' . "\n" . '  } else {' . "\n" . '    if(typeof(oldRightValue) != "undefined" && oldRightValue != ""){' . "\n" . '      elem.style.right=oldRightValue;' . "\n" . '    }' . "\n" . '    elem.style.display="none";' . "\n" . '  }' . "\n" . '}' . "\n\n" . 'function get_attributes_qty_list(url) {' . "\n\n" . '  if (typeof(isLoaded) != "undefined" && isLoaded == true) {' . "\n" . '    toggleWithAbsoluteX("box_id_attribute_qty");' . "\n" . '  } else {' . "\n\n" . '    http_request = false;' . "\n\n" . '    if (window.XMLHttpRequest) { // Mozilla, Safari,...' . "\n" . '      http_request = new XMLHttpRequest();' . "\n" . '      if (http_request.overrideMimeType) {' . "\n" . '        http_request.overrideMimeType("text/html");' . "\n" . '      }' . "\n" . '    } else if (window.ActiveXObject) { // IE' . "\n" . '      try {' . "\n" . '        http_request = new ActiveXObject("Msxml2.XMLHTTP");' . "\n" . '      } catch (e) {' . "\n" . '        try {' . "\n" . '          http_request = new ActiveXObject("Microsoft.XMLHTTP");' . "\n" . '        } catch (e) {}' . "\n" . '      }' . "\n" . '    }' . "\n\n" . '    if (!http_request) {' . "\n" . '      alert("Ende : Kann keine XMLHTTP-Instanz erzeugen");' . "\n" . '      return false;' . "\n" . '    }' . "\n" . '    http_request.onreadystatechange = response_processing_list;' . "\n" . '    http_request.open("GET", url, true);' . "\n" . '    http_request.send(null);' . "\n\n" . '  }' . "\n\n" . '}' . "\n\n" . 'function response_processing_list() {' . "\n" . '  if (http_request.readyState == 1) {' . "\n" . '        $("#loading_list").show(1);' . "\n" . '  } else if (http_request.readyState == 4) {' . "\n" . '    if (http_request.status == 200) {' . "\n" . '      document.getElementById("box_id_attribute_qty").innerHTML = http_request.responseText;' . "\n" . '      document.getElementById("loading_list").style.display = "none";' . "\n" . '      isLoaded = true;' . "\n" . '      toggleWithAbsoluteX("box_id_attribute_qty");' . "\n" . '    } else {' . "\n" . '      alert("Bei dem Request ist ein Problem aufgetreten.");' . "\n" . '    }' . "\n" . '  }' . "\n" . '}' . "\n\n" . '$(function() {' . "\n" . '  $( "#products_date_available" ).datepicker({' . "\n" . '    changeMonth: true,' . "\n" . '    changeYear: true' . "\n" . '  });' . "\n" . '});' . "\n\n" . '/* ]]> */' . "\n" . '</script>' . "\n";
 $product_images = array();
 $more_images = false;
 for ($i = 0; $i < $max_img; $i++) {
     $img_no = $i + 1;
     $large_img_size = array();
     if (!empty($products_image[$i]['name'])) {
         $large_img_size = @GetImageSize(DIR_FS_CATALOG_IMAGES . 'products/large/' . $products_image[$i]['name']);
     }
     $product_images[] = array('img_no' => $img_no, 'selection_delete_image' => xos_draw_selection_field('delete_product_image_' . $i, 'checkbox', 'true'), 'radio_large_image_default_size' => xos_draw_radio_field('large_image_size_' . $i, 'default', true), 'radio_large_image_uploaded_size' => xos_draw_radio_field('large_image_size_' . $i, 'uploaded', false), 'radio_large_image_input_size' => xos_draw_radio_field('large_image_size_' . $i, 'input', false), 'input_large_image_max_width' => xos_draw_input_field('large_image_max_width_' . $i, '', 'style="background: #fffffe;" size ="2"'), 'input_large_image_max_height' => xos_draw_input_field('large_image_max_height_' . $i, '', 'style="background: #fffffe;" size ="2"'), 'small_product_image_max_height' => SMALL_PRODUCT_IMAGE_MAX_HEIGHT, 'image' => xos_image(DIR_WS_CATALOG_IMAGES . 'products/small/' . $products_image[$i]['name'], $pInfo->products_name), 'file_image' => xos_draw_file_field('products_image_' . $i), 'image_name' => $products_image[$i]['name'], 'large_img_width' => $large_img_size[0], 'large_img_height' => $large_img_size[1], 'large_img_base' => $products_image[$i]['large_image_max_width'] == 'default' ? 'default_size' : ($products_image[$i]['large_image_max_width'] == '0' ? 'origin_size' : ((int) $products_image[$i]['large_image_max_width'] > 0 ? 'self_selected_size' : '')), 'hidden_current_image' => xos_draw_hidden_field('current_product_image_' . $i, $products_image[$i]['name']));
     if (empty($products_image[$i]['name'])) {
         $more_images = true;
     }
 }
 $product_values = array();
 if (WYSIWYG_FOR_PRODUCT == 'true') {
     $smarty->assign(array('wysiwyg' => true, 'link_filename_popup_file_manager_link_selection' => str_replace('&amp;', '&', xos_href_link(FILENAME_POPUP_FILE_MANAGER, 'action=link_entrence&goto=' . DIR_FS_DOCUMENT_ROOT . 'contents')), 'link_filename_popup_file_manager_image' => str_replace('&amp;', '&', xos_href_link(FILENAME_POPUP_FILE_MANAGER, 'action=no_link_entrence&goto=' . DIR_FS_DOCUMENT_ROOT . 'contents/image')), 'link_filename_popup_file_manager_flash' => str_replace('&amp;', '&', xos_href_link(FILENAME_POPUP_FILE_MANAGER, 'action=no_link_entrence&goto=' . DIR_FS_DOCUMENT_ROOT . 'contents/flash')), 'product_config' => (ENABLE_SSL == 'true' ? $_SESSION['disable_ssl'] ? HTTP_SERVER : HTTPS_SERVER : HTTP_SERVER) . DIR_WS_ADMIN_IMAGES . ADMIN_TPL . '/ckconfig/product_config.js', 'product_base_href' => ENABLE_SSL == 'true' ? $_SESSION['disable_ssl'] ? HTTP_SERVER : HTTPS_SERVER : HTTP_SERVER, 'lang_code' => xos_get_languages_code()));
 }
 for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
     sizeof($languages) > 1 ? $sort_order = 'products_id' : ($sort_order = 'products_p_unit');
     $products_p_units_array = array(array('id' => '', 'text' => TEXT_NONE));
     $products_p_units_query = xos_db_query("select distinct products_p_unit from " . TABLE_PRODUCTS_DESCRIPTION . " where language_id = '" . $languages[$i]['id'] . "' order by '" . $sort_order . "'");
     while ($products_p_units = xos_db_fetch_array($products_p_units_query)) {
         if (!empty($products_p_units['products_p_unit'])) {
             $products_p_units_array[] = array('id' => $products_p_units['products_p_unit'], 'text' => $products_p_units['products_p_unit']);
Exemplo n.º 5
0
//              Copyright (c) 2003 osCommerce
//              filename: categories.php
//
//              Released under the GNU General Public License
////////////////////////////////////////////////////////////////////////////////
if (!(@(include DIR_FS_SMARTY . 'admin/templates/' . ADMIN_TPL . '/php/includes/modules/new_category.php') == 'overwrite_all')) {
    $parameters = array('categories_or_pages_id' => '', 'category_name' => '', 'categories_image' => '', 'product_list_b' => '', 'sort_order' => '', 'categories_or_pages_status' => '');
    if (isset($_GET['cpID']) && $reload != true) {
        $cpID = xos_db_prepare_input($_GET['cpID']);
        $category_query = xos_db_query("select c.categories_or_pages_id, cpd.categories_or_pages_name as category_name, c.categories_image, c.product_list_b, c.sort_order, c.categories_or_pages_status from " . TABLE_CATEGORIES_OR_PAGES . " c, " . TABLE_CATEGORIES_OR_PAGES_DATA . " cpd where c.categories_or_pages_id = '" . (int) $cpID . "' and c.categories_or_pages_id = cpd.categories_or_pages_id and cpd.language_id = '" . (int) $_SESSION['used_lng_id'] . "'");
        $category = xos_db_fetch_array($category_query);
        $cInfo = new objectInfo($category);
    } elseif (xos_not_null($_POST)) {
        $cInfo = new objectInfo($_POST);
    } else {
        $cInfo = new objectInfo($parameters);
    }
    if (WYSIWYG_FOR_CATEGORY == 'true') {
        $smarty->assign(array('wysiwyg' => true, 'link_filename_popup_file_manager_link_selection' => str_replace('&amp;', '&', xos_href_link(FILENAME_POPUP_FILE_MANAGER, 'action=link_entrence&goto=' . DIR_FS_DOCUMENT_ROOT . 'contents')), 'link_filename_popup_file_manager_image' => str_replace('&amp;', '&', xos_href_link(FILENAME_POPUP_FILE_MANAGER, 'action=no_link_entrence&goto=' . DIR_FS_DOCUMENT_ROOT . 'contents/image')), 'link_filename_popup_file_manager_flash' => str_replace('&amp;', '&', xos_href_link(FILENAME_POPUP_FILE_MANAGER, 'action=no_link_entrence&goto=' . DIR_FS_DOCUMENT_ROOT . 'contents/flash')), 'category_config' => (ENABLE_SSL == 'true' ? $_SESSION['disable_ssl'] ? HTTP_SERVER : HTTPS_SERVER : HTTP_SERVER) . DIR_WS_ADMIN_IMAGES . ADMIN_TPL . '/ckconfig/category_config.js', 'category_base_href' => ENABLE_SSL == 'true' ? $_SESSION['disable_ssl'] ? HTTP_SERVER : HTTPS_SERVER : HTTP_SERVER, 'lang_code' => xos_get_languages_code()));
    }
    $languages = xos_get_languages();
    $contents_data_array = array();
    for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
        $category_data_query = xos_db_query("select categories_or_pages_name, categories_or_pages_heading_title, categories_or_pages_content from " . TABLE_CATEGORIES_OR_PAGES_DATA . " where categories_or_pages_id = '" . (int) $cInfo->categories_or_pages_id . "' and language_id = '" . (int) $languages[$i]['id'] . "'");
        $category_data = xos_db_fetch_array($category_data_query);
        $categories_data_array[] = array('languages_image' => xos_image(DIR_WS_CATALOG_IMAGES . 'catalog/templates/' . DEFAULT_TPL . '/' . $languages[$i]['directory'] . '/' . $languages[$i]['image'], $languages[$i]['name']), 'input_name' => xos_draw_input_field('categories_or_pages_name[' . $languages[$i]['id'] . ']', isset($cInfo->categories_or_pages_name[$languages[$i]['id']]) ? stripslashes(htmlspecialchars($cInfo->categories_or_pages_name[$languages[$i]['id']])) : htmlspecialchars($category_data['categories_or_pages_name']), 'maxlength="64" size="30"', true), 'input_heading_title' => xos_draw_input_field('categories_or_pages_heading_title[' . $languages[$i]['id'] . ']', isset($cInfo->categories_or_pages_heading_title[$languages[$i]['id']]) ? stripslashes($cInfo->categories_or_pages_heading_title[$languages[$i]['id']]) : $category_data['categories_or_pages_heading_title'], 'maxlength="255" size="80"'), 'category_description' => 'categories_or_pages_content[' . $languages[$i]['id'] . ']', 'category_template_file' => (ENABLE_SSL == 'true' ? $_SESSION['disable_ssl'] ? HTTP_SERVER : HTTPS_SERVER : HTTP_SERVER) . DIR_WS_ADMIN . 'includes/ckconfig/templates/' . $languages[$i]['directory'] . '/category_template.js', 'category_template_lang' => $languages[$i]['directory'] . '_default', 'category_textarea' => xos_draw_textarea_field('categories_or_pages_content[' . $languages[$i]['id'] . ']', '130', '25', isset($cInfo->categories_or_pages_content[$languages[$i]['id']]) ? stripslashes($cInfo->categories_or_pages_content[$languages[$i]['id']]) : $category_data['categories_or_pages_content']));
    }
    $smarty->assign(array('update' => isset($_GET['cpID']) ? true : false, 'form_begin' => isset($_GET['cpID']) ? xos_draw_form('update_category', FILENAME_CATEGORIES, 'action=update_category&cPath=' . $cPath . '&cpID=' . $_GET['cpID'], 'post', 'onsubmit="return confirm(\'' . JS_CONFIRM_UPDATE . '\')" enctype="multipart/form-data"') . xos_draw_hidden_field('categories_or_pages_id', $cInfo->categories_or_pages_id) : xos_draw_form('insert_category', FILENAME_CATEGORIES, 'action=insert_category&cPath=' . $cPath, 'post', 'onsubmit="return confirm(\'' . JS_CONFIRM_INSERT . '\')" enctype="multipart/form-data"'), 'hidden_fields' => xos_draw_hidden_field('current_category_image', isset($cInfo->current_category_image) ? stripslashes($cInfo->current_category_image) : $cInfo->categories_image) . xos_draw_hidden_field('category_name', $cInfo->category_name) . xos_draw_hidden_field('current_categories_or_pages_status', $cInfo->categories_or_pages_status), 'categories_data' => $categories_data_array, 'category_image' => xos_not_null($cInfo->current_category_image) || xos_not_null($cInfo->categories_image) ? xos_image(DIR_WS_CATALOG_IMAGES . 'categories/medium/' . (isset($cInfo->current_category_image) ? stripslashes($cInfo->current_category_image) : $cInfo->categories_image), $cInfo->category_name) : '', 'selection_delete_image' => xos_draw_selection_field('delete_category_image', 'checkbox', 'true'), 'image_file_name' => isset($cInfo->current_category_image) ? stripslashes($cInfo->current_category_image) : $cInfo->categories_image, 'input_upload_image' => xos_draw_file_field('categories_image'), 'radio_product_list_b_0' => xos_draw_radio_field('product_list_b', '0', $cInfo->product_list_b == 1 ? false : true), 'radio_product_list_b_1' => xos_draw_radio_field('product_list_b', '1', $cInfo->product_list_b == 1 ? true : false), 'radio_status_0' => xos_draw_radio_field('categories_or_pages_status', '0', $cInfo->categories_or_pages_status == 1 ? false : true), 'radio_status_1' => xos_draw_radio_field('categories_or_pages_status', '1', $cInfo->categories_or_pages_status == 1 ? true : false), 'input_sort_order' => xos_draw_input_field('sort_order', $cInfo->sort_order, 'maxlength="5" size="3"'), 'text_new_category' => sprintf(TEXT_NEW_CATEGORY_3, !isset($_GET['cpID']) ? TEXT_NEW_CATEGORY_1 : TEXT_NEW_CATEGORY_2, xos_output_generated_category_path($current_category_id)), 'link_filename_categories' => xos_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . (isset($_GET['cpID']) ? '&cpID=' . (int) $_GET['cpID'] : '')), 'form_end' => '</form>'));
    $smarty->configLoad('languages/' . $_SESSION['language'] . '.conf', 'categories');
    $output_new_category = $smarty->fetch(ADMIN_TPL . '/includes/modules/new_category.tpl');
}
Exemplo n.º 6
0
     } else {
         $smarty->assign('hidden_field_banners_id', xos_draw_hidden_field('banners_id', $bID));
     }
     if (WYSIWYG_FOR_BANNER_MANAGER == 'true') {
         $smarty->assign(array('wysiwyg' => true, 'link_filename_popup_file_manager_link_selection' => str_replace('&amp;', '&', xos_href_link(FILENAME_POPUP_FILE_MANAGER, 'action=link_entrence&goto=' . DIR_FS_DOCUMENT_ROOT . 'contents')), 'link_filename_popup_file_manager_image' => str_replace('&amp;', '&', xos_href_link(FILENAME_POPUP_FILE_MANAGER, 'action=no_link_entrence&goto=' . DIR_FS_DOCUMENT_ROOT . 'contents/image')), 'link_filename_popup_file_manager_flash' => str_replace('&amp;', '&', xos_href_link(FILENAME_POPUP_FILE_MANAGER, 'action=no_link_entrence&goto=' . DIR_FS_DOCUMENT_ROOT . 'contents/flash')), 'banner_manager_config' => (ENABLE_SSL == 'true' ? $_SESSION['disable_ssl'] ? HTTP_SERVER : HTTPS_SERVER : HTTP_SERVER) . DIR_WS_ADMIN_IMAGES . ADMIN_TPL . '/ckconfig/banner_manager_config.js', 'banner_manager_base_href' => ENABLE_SSL == 'true' ? $_SESSION['disable_ssl'] ? HTTP_SERVER : HTTPS_SERVER : HTTP_SERVER, 'lang_code' => xos_get_languages_code()));
     }
     $languages = xos_get_languages();
     $banners_content_array = array();
     $php_code_included = false;
     for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
         $banners_content_query = xos_db_query("select banners_title, banners_url, banners_image, banners_html_text, banners_php_source from " . TABLE_BANNERS_CONTENT . " where banners_id = '" . (int) $bInfo->banners_id . "' and language_id = '" . (int) $languages[$i]['id'] . "'");
         $banners_content = xos_db_fetch_array($banners_content_query);
         if (!empty($bInfo->banners_php_source[$languages[$i]['id']]) || !empty($banners_content['banners_php_source'])) {
             $php_code_included = true;
         }
         $banners_content_array[] = array('languages_image' => xos_image(DIR_WS_CATALOG_IMAGES . 'catalog/templates/' . DEFAULT_TPL . '/' . $languages[$i]['directory'] . '/' . $languages[$i]['image'], $languages[$i]['name']), 'link_popup_image' => xos_href_link(FILENAME_POPUP_IMAGE, 'banner=' . $bInfo->banners_id . '&lang=' . $languages[$i]['id']), 'input_banners_title' => xos_draw_input_field('banners_title[' . $languages[$i]['id'] . ']', isset($bInfo->banners_title[$languages[$i]['id']]) ? stripslashes($bInfo->banners_title[$languages[$i]['id']]) : $banners_content['banners_title'], '', true), 'input_banners_url' => xos_draw_input_field('banners_url[' . $languages[$i]['id'] . ']', isset($bInfo->banners_url[$languages[$i]['id']]) ? stripslashes($bInfo->banners_url[$languages[$i]['id']]) : $banners_content['banners_url']), 'input_banners_image' => xos_draw_file_field('banners_image_' . $languages[$i]['id']), 'current_banners_image' => isset($bInfo->banners_image[$languages[$i]['id']]) ? stripslashes($bInfo->banners_image[$languages[$i]['id']]) : $banners_content['banners_image'], 'selection_field_delete_banners_image' => xos_draw_selection_field('delete_banners_image[' . $languages[$i]['id'] . ']', 'checkbox', 'true'), 'hidden_field_current_banners_image' => xos_draw_hidden_field('current_banners_image[' . $languages[$i]['id'] . ']', isset($bInfo->banners_image[$languages[$i]['id']]) ? stripslashes($bInfo->banners_image[$languages[$i]['id']]) : $banners_content['banners_image']), 'banners_html_text_name' => 'banners_html_text[' . $languages[$i]['id'] . ']', 'banner_manager_template_file' => (ENABLE_SSL == 'true' ? $_SESSION['disable_ssl'] ? HTTP_SERVER : HTTPS_SERVER : HTTP_SERVER) . DIR_WS_ADMIN . 'includes/ckconfig/templates/' . $languages[$i]['directory'] . '/banner_manager_template.js', 'banner_manager_template_lang' => $languages[$i]['directory'] . '_default', 'textarea_banners_html_text' => xos_draw_textarea_field('banners_html_text[' . $languages[$i]['id'] . ']', '110', '18', isset($bInfo->banners_html_text[$languages[$i]['id']]) ? stripslashes($bInfo->banners_html_text[$languages[$i]['id']]) : $banners_content['banners_html_text']), 'textarea_banners_php_source' => xos_draw_textarea_field('banners_php_source[' . $languages[$i]['id'] . ']', '110', '18', isset($bInfo->banners_php_source[$languages[$i]['id']]) ? stripslashes($bInfo->banners_php_source[$languages[$i]['id']]) : $banners_content['banners_php_source'], 'class="textarea-php-code" readonly="readonly"'));
     }
     $smarty->assign(array('new_banner' => true, 'form_begin' => xos_draw_form('new_banner', FILENAME_BANNER_MANAGER, (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . 'action=' . $form_action, 'post', 'onsubmit="return confirm(\'' . ($form_action == 'insert' ? JS_CONFIRM_INSERT : JS_CONFIRM_UPDATE) . '\')" enctype="multipart/form-data"'), 'pull_down_banners_group' => xos_draw_pull_down_menu('banners_group', $groups_array, $bInfo->banners_group), 'input_new_banners_group' => xos_draw_input_field('new_banners_group', '', '', sizeof($groups_array) > 0 ? false : true), 'dir_fs_catalog_images_banners' => DIR_FS_CATALOG_IMAGES . 'banners/', 'hidden_field_current_date_scheduled' => xos_draw_hidden_field('current_date_scheduled', $bInfo->date_scheduled), 'input_date_scheduled' => xos_draw_input_field('date_scheduled', $bInfo->date_scheduled, 'id="date_scheduled" style="background: #ffffcc;" size ="10"'), 'input_expires_date' => xos_draw_input_field('expires_date', $bInfo->expires_date, 'id="expires_date" style="background: #ffffcc;" size ="10"'), 'input_expires_impressions' => xos_draw_input_field('expires_impressions', $bInfo->expires_impressions, 'maxlength="7" size="7"'), 'banners_content' => $banners_content_array, 'php_code_included' => $php_code_included, 'link_filename_banner_manager' => xos_href_link(FILENAME_BANNER_MANAGER, (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . (isset($_GET['bID']) ? 'bID=' . $_GET['bID'] : '')), 'form_end' => '</form>'));
 } else {
     $banners_query_raw = "select b.banners_id, bc.banners_title, b.banners_group, b.status, b.expires_date, b.expires_impressions, b.date_status_change, b.date_scheduled, b.date_added from " . TABLE_BANNERS . " b, " . TABLE_BANNERS_CONTENT . " bc where b.banners_id = bc.banners_id and bc.language_id = '" . (int) $_SESSION['used_lng_id'] . "' order by banners_title, banners_group";
     $banners_split = new splitPageResults($_GET['page'], MAX_DISPLAY_RESULTS, $banners_query_raw, $banners_query_numrows);
     $banners_query = xos_db_query($banners_query_raw);
     $banners_array = array();
     while ($banners = xos_db_fetch_array($banners_query)) {
         $info_query = xos_db_query("select sum(banners_shown) as banners_shown, sum(banners_clicked) as banners_clicked from " . TABLE_BANNERS_HISTORY . " where banners_id = '" . (int) $banners['banners_id'] . "'");
         $info = xos_db_fetch_array($info_query);
         if ((!isset($_GET['bID']) || isset($_GET['bID']) && $_GET['bID'] == $banners['banners_id']) && !isset($bInfo) && substr($action, 0, 3) != 'new') {
             $bInfo_array = array_merge((array) $banners, (array) $info);
             $bInfo = new objectInfo($bInfo_array);
         }
         $banners_shown = $info['banners_shown'] != '' ? $info['banners_shown'] : '0';