You are not logged in.
Pages: 1
Hi
I made the newbie-tutorial but no editor opens. I searched in this forum, but no sulotion fit my problem.
Please look at my source and give me any hints, thanks.
IXinha_0.95_RC2
osCommerce Online Merchant v2.2 RC2a
Page Code
Xinha Page Code = Red text
textarea to be used = Blue text
<?php
// copy image only if modified
$products_image = new upload('products_image');
$products_image->set_destination(DIR_FS_CATALOG_IMAGES);
if ($products_image->parse() && $products_image->save()) {
$products_image_name = $products_image->filename;
} else {
$products_image_name = (isset($HTTP_POST_VARS['products_previous_image']) ? $HTTP_POST_VARS['products_previous_image'] : '');
}
break;
case 'new_master_preview':
// copy image only if modified
$products_image = new upload('products_image');
$products_image->set_destination(DIR_FS_CATALOG_IMAGES);
if ($products_image->parse() && $products_image->save()) {
$products_image_name = $products_image->filename;
} else {
$products_image_name = (isset($HTTP_POST_VARS['products_previous_image']) ? $HTTP_POST_VARS['products_previous_image'] : '');
}
break;
}
}
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<script language="javascript" src="includes/general.js"></script>
<script type="text/javascript">
_editor_url = "/catalog/admin/xinha/" // (preferably absolute) URL (including trailing slash) where Xinha is installed
_editor_lang = "en"; // And the language we need to use in the editor.
_editor_skin = "silva"; // If you want use a skin, add the name (of the folder) here
</script>
<script type="text/javascript" src="/catalog/admin/xinha/XinhaCore.js"></script>
<script type="text/javascript" src="/catalog/admin/xinha/xinha_config.js"></script>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
<div id="spiffycalendar" class="text"></div>
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->
<!-- body //-->
<table border="0" width="100%" cellspacing="2" cellpadding="2">
<tr>
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
</table></td>
<!-- body_text //-->
<td width="100%" valign="top">
<?php
if ($action == 'new_product') {
$parameters = array('products_name' => '',
'products_description' => '',
'products_url' => '',
'products_id' => '',
'products_quantity' => '',
'products_model' => '',
'products_image' => '',
'products_price' => '',
'products_cost' => '',
'products_price1' => '',
'products_price2' => '',
'products_price3' => '',
'products_price4' => '',
'products_price5' => '',
'products_price6' => '',
'products_price7' => '',
'products_price8' => '',
'products_price1_qty' => '',
'products_price2_qty' => '',
'products_price3_qty' => '',
'products_price4_qty' => '',
'products_price5_qty' => '',
'products_price6_qty' => '',
'products_price7_qty' => '',
'products_price8_qty' => '',
'products_qty_blocks' => '',
// next line for price break per discount category
'discount_categories_id' => '',
'products_weight' => '',
'products_date_added' => '',
'products_last_modified' => '',
'products_date_available' => '',
'products_status' => '',
//Master Products
'products_listing_status' => '',
'products_tax_class_id' => '',
'manufacturers_id' => '');
$pInfo = new objectInfo($parameters);
if (isset($HTTP_GET_VARS['pID']) && empty($HTTP_POST_VARS)) {
// adapted for QPBPP, price break per discount category
$product_query = tep_db_query("select pd.products_name, pd.products_description, pd.products_url, p.products_id, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_cost, p.products_price1, p.products_price2, p.products_price3, p.products_price4, p.products_price5, p.products_price6, p.products_price7, p.products_price8, p.products_price1_qty, p.products_price2_qty, p.products_price3_qty, p.products_price4_qty, p.products_price5_qty, p.products_price6_qty, p.products_price7_qty, p.products_price8_qty, p.products_qty_blocks, p.products_weight, p.products_date_added, p.products_last_modified, date_format(p.products_date_available, '%Y-%m-%d') as products_date_available, p.products_status, p.products_listing_status, p.products_tax_class_id, p.manufacturers_id, p.products_master, products_master_status, ptdc.discount_categories_id from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_TO_DISCOUNT_CATEGORIES . " ptdc on p.products_id = ptdc.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");
//Master Products EOF
$product = tep_db_fetch_array($product_query);
$pInfo->objectInfo($product);
} elseif (tep_not_null($HTTP_POST_VARS)) {
$pInfo->objectInfo($HTTP_POST_VARS);
$products_name = $HTTP_POST_VARS['products_name'];
$products_description = $HTTP_POST_VARS['products_description'];
$products_url = $HTTP_POST_VARS['products_url'];
}
$manufacturers_array = array(array('id' => '', 'text' => TEXT_NONE));
$manufacturers_query = tep_db_query("select manufacturers_id, manufacturers_name from " . TABLE_MANUFACTURERS . " order by manufacturers_name");
while ($manufacturers = tep_db_fetch_array($manufacturers_query)) {
$manufacturers_array[] = array('id' => $manufacturers['manufacturers_id'],
'text' => $manufacturers['manufacturers_name']);
}
// >>>> BOF Linkmatics attributes sets (3 of 5) - building attributes array - Begin
$attribute_sets_array = array(array('id' => '', 'text' => TEXT_NONE));
$attribute_sets_names_array = array();
$attribute_sets_query = tep_db_query("select products_attributes_sets_id, products_attributes_sets_name from " . TABLE_PRODUCTS_ATTRIBUTES_SETS . " order by products_attributes_sets_name");
while ($attribute_sets = tep_db_fetch_array($attribute_sets_query)) {
$attribute_sets_array[] = array('id' => $attribute_sets['products_attributes_sets_id'],
'text' => $attribute_sets['products_attributes_sets_name']);
$attribute_sets_names_array[ $attribute_sets['products_attributes_sets_id'] ] = $attribute_sets['products_attributes_sets_name'];
}
// <<<< EOF Linkmatics attributes sets plus(3 of 5) - building attributes array - End
$tax_class_array = array(array('id' => '0', 'text' => TEXT_NONE));
$tax_class_query = tep_db_query("select tax_class_id, tax_class_title from " . TABLE_TAX_CLASS . " order by tax_class_title");
while ($tax_class = tep_db_fetch_array($tax_class_query)) {
$tax_class_array[] = array('id' => $tax_class['tax_class_id'],
'text' => $tax_class['tax_class_title']);
}
// BOF QPBPP price break per category
$discount_categories_array = array(array('id' => '0', 'text' => TEXT_NONE));
$discount_categories_query = tep_db_query("select discount_categories_id, discount_categories_name from " . TABLE_DISCOUNT_CATEGORIES . " order by discount_categories_name");
while ($discount_categories = tep_db_fetch_array($discount_categories_query)) {
$discount_categories_array[] = array('id' => $discount_categories['discount_categories_id'],
'text' => $discount_categories['discount_categories_name']);
}
// EOF QPBPP price break per category
// Master Products
$products_master_array = array(array('id' => ' ', 'text' => TEXT_MASTER_SELECT));
$products_master_array[] = array('id' => '', 'text' => TEXT_NONE);
$products_master_query = tep_db_query("select p.products_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_master_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by pd.products_name");
while ($products_master = tep_db_fetch_array($products_master_query)) {
$products_master_array[] = array('id' => $products_master['products_id'],
'text' => $products_master['products_name']);
}
// Master Products EOF
$languages = tep_get_languages();
if (!isset($pInfo->products_status)) $pInfo->products_status = '1';
switch ($pInfo->products_status) {
case '0': $in_status = false; $out_status = true; break;
case '1':
default: $in_status = true; $out_status = false;
}
//Master Products
if (!isset($pInfo->products_listing_status)) $pInfo->products_listing_status = '1';
switch ($pInfo->products_listing_status) {
case '0': $in_listing_status = false; $out_listing_status = true; break;
case '1':
default: $in_listing_status = true; $out_listing_status = false;
}
if (!isset($pInfo->products_master_status)) $pInfo->products_master_status = '1';
switch ($pInfo->products_master_status) {
case '0': $in_master_status = false; $out_master_status = true; break;
case '1':
default: $in_master_status = true; $out_master_status = false;
}
//Master Products EOF
?>
<link rel="stylesheet" type="text/css" href="includes/javascript/spiffyCal/spiffyCal_v2_1.css">
<script language="JavaScript" src="includes/javascript/spiffyCal/spiffyCal_v2_1.js"></script>
<script language="javascript"><!--
var dateAvailable = new ctlSpiffyCalendarBox("dateAvailable", "new_product", "products_date_available","btnDate1","<?php echo $pInfo->products_date_available; ?>",scBTNMODE_CUSTOMBLUE);
//--></script>
<script language="javascript"><!--
var tax_rates = new Array();
<?php
for ($i=0, $n=sizeof($tax_class_array); $i<$n; $i++) {
if ($tax_class_array[$i]['id'] > 0) {
echo 'tax_rates["' . $tax_class_array[$i]['id'] . '"] = ' . tep_get_tax_rate_value($tax_class_array[$i]['id']) . ';' . "\n";
}
}
?>
function doRound(x, places) {
return Math.round(x * Math.pow(10, places)) / Math.pow(10, places);
}
function getTaxRate() {
var selected_value = document.forms["new_product"].products_tax_class_id.selectedIndex;
var parameterVal = document.forms["new_product"].products_tax_class_id[selected_value].value;
if ( (parameterVal > 0) && (tax_rates[parameterVal] > 0) ) {
return tax_rates[parameterVal];
} else {
return 0;
}
}
function updateGross() {
var taxRate = getTaxRate();
var grossValue = document.forms["new_product"].products_price.value;
if (taxRate > 0) {
grossValue = grossValue * ((taxRate / 100) + 1);
}
document.forms["new_product"].products_price_gross.value = doRound(grossValue, 4);
}
function updateNet() {
var taxRate = getTaxRate();
var netValue = document.forms["new_product"].products_price_gross.value;
if (taxRate > 0) {
netValue = netValue / ((taxRate / 100) + 1);
}
document.forms["new_product"].products_price.value = doRound(netValue, 4);
}
// Master Products
function updateProductsMaster() {
var selected_value = document.forms["new_product"].products_master_select.selectedIndex;
var masValue = document.forms["new_product"].products_master_select[selected_value].value;
var theValue = document.forms["new_product"].products_master.value;
if(theValue != '0' && theValue != '' && masValue != ''){
document.forms["new_product"].products_master.value = theValue+' '+masValue;
}else{
document.forms["new_product"].products_master.value = masValue;
}
}
// Master Products EOF
//--></script>
<?php echo tep_draw_form('new_product', FILENAME_CATEGORIES, 'cPath=' . $cPath . (isset($HTTP_GET_VARS['pID']) ? '&pID=' . $HTTP_GET_VARS['pID'] : '') . '&action=new_product_preview', 'post', 'enctype="multipart/form-data"'); ?>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<!-- Below is the JavaScript that changes the display of the
tabs and panel content. Modify the div's for the tabs
and panel content before modifying this JavaScript. Once
those are done, you'll have the necessary id names to
modify the JavaScript. -->
<script type="text/javascript" language="JavaScript"><!--
function ManageTabPanelDisplay() {
//
// Between the parenthesis, list the id's of the div's that
// will be affected when tabs are clicked. List in any
// order. Put the id's in single quotes (apostrophes)
// and separate them with a comma -- all one line.
//
var idlist = new Array('tab1focus','tab2focus','tab3focus','tab4focus','tab1ready','tab2ready','tab3ready','tab4ready','content1','content2','content3','content4');
// No other customizations are necessary.
if(arguments.length < 1) { return; }
for(var i = 0; i < idlist.length; i++) {
var block = false;
for(var ii = 0; ii < arguments.length; ii++) {
if(idlist[i] == arguments[ii]) {
block = true;
break;
}
}
if(block) { document.getElementById(idlist[i]).style.display = "block"; }
else { document.getElementById(idlist[i]).style.display = "none"; }
}
}
//--></script>
<!-- Below is the CSS for the example tab panel div tags.
You may, of course, change these according to your
design requirements.
Refer to the Creating a Tab Panel article for notes
about this CSS. -->
<style type="text/css">
.tab {
font-family: Tahoma;
font-size: 11px;
width: 80px;
white-space: nowrap;
text-align: center;
//border-style: solid;
//border-color: black;
//border-left-width: 1px;
//border-right-width: 1px;
//border-top-width: 1px;
//border-bottom-width: 0px;
padding-top: 5px;
//padding-bottom: 5px;
cursor: pointer;
}
.tabhold {
background-image: url( "images/Tabbed Panel/tab.png" );
background-repeat: no-repeat;
}
.tabfocus {
background-image: url( "images/Tabbed Panel/tab.active.png" );
background-repeat: no-repeat;
}
.tabcontent {
font-family: sans-serif;
font-size: 14px;
width: 100%;
//height: 275px;
border-style: solid;
border-color: rgb( 145, 155, 156 );
border-width: 1px;
padding-top: 15px;
padding-left: 10px;
padding-right: 10px;
}
</style> <tr>
<td class="pageHeading"><?php echo sprintf(TEXT_NEW_PRODUCT, tep_output_generated_category_path($current_category_id)); ?></td>
<td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
</tr>
</table>
</td>
</tr>
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
</tr>
<tr>
<td>
<!-- Below is the example tab panel. Notes are embedded in
the HTML, and the Creating a Tab Panel article also
contains information. -->
<table border="0" cellpadding="0" cellspacing="2">
<tr>
<td>
<div id="tab1focus" class="tab tabfocus" style="display:block;">
General
</div>
<div id="tab1ready" class="tab tabhold" style="display:none;">
<!-- Between the parenthesis, provide a list of ids that are to
be visible when this tab is clicked. The ids are between
single quotes (apostrophes) and separated with a comma. -->
<span onclick="ManageTabPanelDisplay('tab1focus','tab2ready','tab3ready','tab4ready','content1')">General</span>
</div>
</td><td>
<div id="tab2focus" class="tab tabfocus" style="display:none;">
Data
</div>
<div id="tab2ready" class="tab tabhold" style="display:block;">
<!-- Between the parenthesis, provide a list of ids that are to
be visible when this tab is clicked. The ids are between
single quotes (apostrophes) and separated with a comma. -->
<span onclick="ManageTabPanelDisplay('tab1ready','tab2focus','tab3ready','tab4ready','content2')">Data</span>
</div>
</td><td>
<div id="tab3focus" class="tab tabfocus" style="display:none;">
Images
</div>
<div id="tab3ready" class="tab tabhold" style="display:block;">
<!-- Between the parenthesis, provide a list of ids that are to
be visible when this tab is clicked. The ids are between
single quotes (apostrophes) and separated with a comma. -->
<span onclick="ManageTabPanelDisplay('tab1ready','tab2ready','tab3focus','tab4ready','content3')">Images</span>
</div>
</td><td>
<div id="tab4focus" class="tab tabfocus" style="display:none;">
Attributes
</div>
<div id="tab4ready" class="tab tabhold" style="display:block;">
<!-- Between the parenthesis, provide a list of ids that are to
be visible when this tab is clicked. The ids are between
single quotes (apostrophes) and separated with a comma. -->
<span onclick="ManageTabPanelDisplay('tab1ready','tab2ready','tab3ready','tab4focus','content4')">Attributes</span>
</div>
</td><td width="250"> </td><td>
</tr>
<tr>
<td colspan="20">
<!-- General Tab Start -->
<div id="content1" class="tabcontent" style="display:block;">
<p style="margin-top:0px" class="main">
<!-- Master Products START-->
<?php echo TEXT_PRODUCTS_MASTER; ?>
<?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . tep_draw_pull_down_menu('products_master_select', $products_master_array, ' ', 'size="5" onchange="updateProductsMaster()"'); ?><br />
<?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . tep_draw_input_field('products_master', $pInfo->products_master, "size=38"); ?>
<BR><BR>
<?php echo TEXT_PRODUCTS_LISTING_STATUS; ?>
<?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_radio_field('products_listing_status', '1', $in_listing_status) . ' ' . TEXT_LIST_PRODUCT . ' ' . tep_draw_radio_field('products_listing_status', '0', $out_listing_status) . ' ' . TEXT_HIDE_PRODUCT; ?>
<BR><BR>
<?php echo TEXT_PRODUCTS_MASTER_STATUS; ?>
<?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_checkbox_field('products_master_status', '1', $in_master_status); ?>
<BR><BR><!-- Master Products END-->
<?php
for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
?>
<?php if ($i == 0) echo TEXT_PRODUCTS_NAME; ?>
<?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . tep_draw_input_field('products_name[' . $languages[$i]['id'] . ']', (isset($products_name[$languages[$i]['id']]) ? stripslashes($products_name[$languages[$i]['id']]) : tep_get_products_name($pInfo->products_id, $languages[$i]['id']))); ?>
<?php
}
?>
<?php
for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
?>
<BR><BR><?php if ($i == 0) echo TEXT_PRODUCTS_DESCRIPTION; ?><BR><BR><table border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="main" valign="top"><?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']); ?> </td>
<td class="main"><?php echo tep_draw_textarea_field('products_description[' . $languages[$i]['id'] . ']', 'soft', '70', '15', (isset($products_description[$languages[$i]['id']]) ? stripslashes($products_description[$languages[$i]['id']]) : tep_get_products_description($pInfo->products_id, $languages[$i]['id']))); ?></td>
</tr>
</table>
<?php
}
?>
<BR><BR>
<?php echo TEXT_PRODUCTS_MODEL; ?>
<?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_model', $pInfo->products_model); ?>
<BR><BR>
<?php
for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
?>
<?php if ($i == 0) echo TEXT_PRODUCTS_URL . '<br><small>' . TEXT_PRODUCTS_URL_WITHOUT_HTTP . '</small>'; ?>
<?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . tep_draw_input_field('products_url[' . $languages[$i]['id'] . ']', (isset($products_url[$languages[$i]['id']]) ? stripslashes($products_url[$languages[$i]['id']]) : tep_get_products_url($pInfo->products_id, $languages[$i]['id']))); ?>
<?php
}
?>
</p>
</div>
<!-- General Tab End -->
<!-- Data Tab Start -->
<div id="content2" class="tabcontent" style="display:none;">
<p style="margin-top:0px" class="main">
<br><br>PRICE<br><br>
<?php echo TEXT_PRODUCTS_TAX_CLASS; ?>
<?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_pull_down_menu('products_tax_class_id', $tax_class_array, $pInfo->products_tax_class_id, 'onchange="updateGross()"'); ?>
<br><br><?php echo TEXT_PRODUCTS_PRICE_COST; ?>
<?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_cost', $pInfo->products_cost, ''); ?>
<br><br><?php echo TEXT_PRODUCTS_PRICE_NET; ?>
<?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_price', $pInfo->products_price, 'onKeyUp="updateGross()"'); ?>
<br><br><?php echo TEXT_PRODUCTS_PRICE_GROSS; ?>
<?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_price_gross', $pInfo->products_price, 'OnKeyUp="updateNet()"'); ?>
<script language="javascript"><!--
updateGross();
//--></script>
<BR><BR>
<!-- BOF QPBPP -->
<?php echo TEXT_PRODUCTS_QTY_BLOCKS; ?>
<?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_qty_blocks', $pInfo->products_qty_blocks, 'size="10"') . ' ' . TEXT_PRODUCTS_QTY_BLOCKS_INFO ?>
<BR><BR> <?php echo TEXT_PRODUCTS_PRICE1; ?>
<table border="0" cellspacing="0" cellpadding="0" width="100%"> <?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_price1', $pInfo->products_price1, 'size="10"'); ?>
<?php echo TEXT_PRODUCTS_PRICE1_QTY; ?>
<?php echo tep_draw_input_field('products_price1_qty', $pInfo->products_price1_qty, 'size="10"'); ?>
</table><BR>
<?php echo TEXT_PRODUCTS_PRICE2; ?>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_price2', $pInfo->products_price2, 'size="10"'); ?>
<?php echo TEXT_PRODUCTS_PRICE2_QTY; ?>
<?php echo tep_draw_input_field('products_price2_qty', $pInfo->products_price2_qty, 'size="10"'); ?>
</table><BR>
<?php echo TEXT_PRODUCTS_PRICE3; ?>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_price3', $pInfo->products_price3, 'size="10"'); ?>
<?php echo TEXT_PRODUCTS_PRICE3_QTY; ?>
<?php echo tep_draw_input_field('products_price3_qty', $pInfo->products_price3_qty, 'size="10"'); ?>
</table><BR>
<?php echo TEXT_PRODUCTS_PRICE4; ?>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_price4', $pInfo->products_price4, 'size="10"'); ?>
<?php echo TEXT_PRODUCTS_PRICE4_QTY; ?>
<?php echo tep_draw_input_field('products_price4_qty', $pInfo->products_price4_qty, 'size="10"'); ?>
</table><BR>
<?php echo TEXT_PRODUCTS_PRICE5; ?>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_price5', $pInfo->products_price5, 'size="10"'); ?>
<?php echo TEXT_PRODUCTS_PRICE5_QTY; ?>
<?php echo tep_draw_input_field('products_price5_qty', $pInfo->products_price5_qty, 'size="10"'); ?>
</table><BR>
<?php echo TEXT_PRODUCTS_PRICE6; ?>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_price6', $pInfo->products_price6, 'size="10"'); ?>
<?php echo TEXT_PRODUCTS_PRICE6_QTY; ?>
<?php echo tep_draw_input_field('products_price6_qty', $pInfo->products_price6_qty, 'size="10"'); ?>
</table><BR>
<?php echo TEXT_PRODUCTS_PRICE7; ?>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_price7', $pInfo->products_price7, 'size="10"'); ?>
<?php echo TEXT_PRODUCTS_PRICE7_QTY; ?>
<?php echo tep_draw_input_field('products_price7_qty', $pInfo->products_price7_qty, 'size="10"'); ?>
</table><BR>
<?php echo TEXT_PRODUCTS_PRICE8; ?>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_price8', $pInfo->products_price8, 'size="10"'); ?>
<?php echo TEXT_PRODUCTS_PRICE8_QTY; ?>
<?php echo tep_draw_input_field('products_price8_qty', $pInfo->products_price8_qty, 'size="10"'); ?>
</table><br>
<!-- added for price break per category -->
<?php echo TEXT_DISCOUNT_CATEGORY ?>
<?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_pull_down_menu('discount_categories_id', $discount_categories_array, $pInfo->discount_categories_id) . tep_draw_hidden_field('current_discount_cat_id', $pInfo->discount_categories_id); ?><br><br>
<!-- EOF QPBPP -->
<br><br><br>DATA<br><br>
<?php echo TEXT_PRODUCTS_MANUFACTURER; ?>
<?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_pull_down_menu('manufacturers_id', $manufacturers_array, $pInfo->manufacturers_id); ?><br>
<br><?php echo TEXT_PRODUCTS_QUANTITY; ?>
<?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_quantity', $pInfo->products_quantity); ?>
<br>
<br><?php echo TEXT_PRODUCTS_WEIGHT; ?>
<?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_weight', $pInfo->products_weight); ?>
<br><br><br>STATUS<br><br>
<?php echo TEXT_PRODUCTS_STATUS; ?>
<?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_radio_field('products_status', '1', $in_status) . ' ' . TEXT_PRODUCT_AVAILABLE . ' ' . tep_draw_radio_field('products_status', '0', $out_status) . ' ' . TEXT_PRODUCT_NOT_AVAILABLE; ?>
<br><br><br>INFORMATION<br><br>
<?php echo TEXT_PRODUCTS_DATE_AVAILABLE; ?><br><small>(YYYY-MM-DD)</small>
<?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' '; ?><script language="javascript">dateAvailable.writeControl(); dateAvailable.dateFormat="yyyy-MM-dd";</script>
</p>
</div>
<!-- Data Tab End -->
<!-- Images Tab Start -->
<div id="content3" class="tabcontent" style="display:none;">
<p style="margin-top:0px" class="main">
<?php echo TEXT_PRODUCTS_IMAGE; ?>
<?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_textarea_field('products_image', 'null', '70', '7') . '<br>' . tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . $pInfo->products_image . tep_draw_hidden_field('products_previous_image', $pInfo->products_image); ?>
</p>
</div>
<!-- Images Tab end -->
<!-- Attribute Tab Start -->
<div id="content4" class="tabcontent" style="display:none;">
<p style="margin-top:0px">
<?php // >>>> BOF Linkmatics attributes sets plus edit (4 of 5) - building list of Attribute Sets Used - Begin ?>
<?php
if( empty($pInfo->products_id) ){
$iteration = 0;
}else{
$getOptionsCount_query = tep_db_query('SELECT count(
DISTINCT products_attributes_sets_id ) as count
FROM '. TABLE_PRODUCTS_ATTRIBUTES_SETS_TO_PRODUCTS .'
WHERE `products_id` ='.$pInfo->products_id);
$arr_getOptionsCount = tep_db_fetch_array($getOptionsCount_query);
$arr_pas_id = jjg_db_getAttributeSetId($pInfo->products_id);
if( !empty($arr_pas_id) ){
$iteration = $arr_getOptionsCount['count'];
}
}
for($i=0; $i <= $iteration; $i++){
?>
<?php
if( isset($_GET['pID']) ){
if( $i == $iteration ){
echo "Add An " . TEXT_PRODUCTS_ATTRIBUTES_SET;
}else{
echo "Using " . TEXT_PRODUCTS_ATTRIBUTES_SET;
}
}
?>
<?php
if(isset($_GET['pID']) ){
if( $i == $iteration ){
echo tep_draw_separator('pixel_trans.gif', '30', '1').
'<a href="' . tep_href_link(
FILENAME_PRODUCTS_ATTRIBUTES_SETS_EDIT, 'pID='.$_GET['pID']) .
'" >'. tep_image_button('button_add_as.gif',
'[Click To Add And A.S.]' ) .'</a>';
}else{
echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ';
echo $attribute_sets_names_array[$arr_pas_id[$i]];
echo tep_draw_separator('pixel_trans.gif', '24', '15');
echo tep_draw_checkbox_field('remove_products_attributes_sets_id_'.$i);
echo "<font size=-3>(Remove Set)</font>";
echo tep_draw_hidden_field('products_attributes_sets_id_'.$i,
$arr_pas_id[$i]);
}
}
?>
<?php
}
?>
<?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?>
<?php echo tep_draw_hidden_field('AttributeSetCount', $arr_getOptionsCount['count']+1); ?>
<?php // >>>> EOF Linkmatics attributes sets plus edit (4 of 5) - building list of Attribute Sets Used - End ?>
</p>
</div>
<!-- Attribute Tab End -->
</td></tr>
</table>
<tr>
<td class="main" align="right"><?php echo tep_draw_hidden_field('products_date_added', (tep_not_null($pInfo->products_date_added) ? $pInfo->products_date_added : date('Y-m-d'))) . tep_image_submit('button_preview.gif', IMAGE_PREVIEW) . ' <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . (isset($HTTP_GET_VARS['pID']) ? '&pID=' . $HTTP_GET_VARS['pID'] : '')) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td>
</tr>
</table></form>
<?php
} elseif ($action == 'new_product_preview') {
if (tep_not_null($HTTP_POST_VARS)) {
$pInfo = new objectInfo($HTTP_POST_VARS);
$products_name = $HTTP_POST_VARS['products_name'];
$products_description = $HTTP_POST_VARS['products_description'];
$products_url = $HTTP_POST_VARS['products_url'];
} else {
// Master Products // adapted for QPBPP, price break per discount category
$product_query = tep_db_query("select p.products_id, pd.language_id, pd.products_name, pd.products_description, pd.products_url, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_price1, p.products_price2, p.products_price3, p.products_price4, p.products_price5, p.products_price6, p.products_price7, p.products_price8, p.products_price1_qty, p.products_price2_qty, p.products_price3_qty, p.products_price4_qty, p.products_price5_qty, p.products_price6_qty, p.products_price7_qty, p.products_price8_qty, p.products_qty_blocks, p.products_weight, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p.manufacturers_id, p.products_master, ptdc.discount_categories_id, dc.discount_categories_name from " . TABLE_PRODUCTS . " pp left join " . TABLE_PRODUCTS_TO_DISCOUNT_CATEGORIES . " ptdc on p.products_id = ptdc.products_id left join " . TABLE_DISCOUNT_CATEGORIES . " dc using(discount_categories_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "'");
// Master Products EOF
$product = tep_db_fetch_array($product_query);
$pInfo = new objectInfo($product);
$products_image_name = $pInfo->products_image;
}
$form_action = (isset($HTTP_GET_VARS['pID'])) ? 'update_product' : 'insert_product';
echo tep_draw_form($form_action, FILENAME_CATEGORIES, 'cPath=' . $cPath . (isset($HTTP_GET_VARS['pID']) ? '&pID=' . $HTTP_GET_VARS['pID'] : '') . '&action=' . $form_action, 'post', 'enctype="multipart/form-data"');
$languages = tep_get_languages();
for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
if (isset($HTTP_GET_VARS['read']) && ($HTTP_GET_VARS['read'] == 'only')) {
$pInfo->products_name = tep_get_products_name($pInfo->products_id, $languages[$i]['id']);
$pInfo->products_description = tep_get_products_description($pInfo->products_id, $languages[$i]['id']);
$pInfo->products_url = tep_get_products_url($pInfo->products_id, $languages[$i]['id']);
} else {
$pInfo->products_name = tep_db_prepare_input($products_name[$languages[$i]['id']]);
$pInfo->products_description = tep_db_prepare_input($products_description[$languages[$i]['id']]);
$pInfo->products_url = tep_db_prepare_input($products_url[$languages[$i]['id']]);
}
?>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td class="pageHeading"><?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . $pInfo->products_name; ?></td>
<td class="pageHeading" align="right"><?php
// BOF QPBPP
$pf->loadProduct((int)$HTTP_GET_VARS['pID'],(int)$languages[$i]['id']);
echo $pf->getPriceString(); // EOF QPBPP ?></td>
</tr>
</table></td>
</tr>
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
</tr>
<tr>
<td class="main"><?php echo tep_image(DIR_WS_CATALOG_IMAGES . $products_image_name, $pInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="right" hspace="5" vspace="5"') . $pInfo->products_description; ?></td>
</tr>
<?php
if ($pInfo->products_url) {
?>
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
</tr>
<tr>
<td class="main"><?php echo sprintf(TEXT_PRODUCT_MORE_INFORMATION, $pInfo->products_url); ?></td>
</tr>
<?php
}
?>
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
</tr>
<?php
if ($pInfo->products_date_available > date('Y-m-d')) {
?>
<tr>
<td align="center" class="smallText"><?php echo sprintf(TEXT_PRODUCT_DATE_AVAILABLE, tep_date_long($pInfo->products_date_available)); ?></td>
</tr>
<?php
} else {
?>
<tr>
<td align="center" class="smallText"><?php echo sprintf(TEXT_PRODUCT_DATE_ADDED, tep_date_long($pInfo->products_date_added)); ?></td>
</tr>
<?php
}
?>
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
</tr>
<?php
}
if (isset($HTTP_GET_VARS['read']) && ($HTTP_GET_VARS['read'] == 'only')) {
if (isset($HTTP_GET_VARS['origin'])) {
$pos_params = strpos($HTTP_GET_VARS['origin'], '?', 0);
if ($pos_params != false) {
$back_url = substr($HTTP_GET_VARS['origin'], 0, $pos_params);
$back_url_params = substr($HTTP_GET_VARS['origin'], $pos_params + 1);
} else {
$back_url = $HTTP_GET_VARS['origin'];
$back_url_params = '';
}
} else {
$back_url = FILENAME_CATEGORIES;
$back_url_params = 'cPath=' . $cPath . '&pID=' . $pInfo->products_id;
}
?>
<tr>
<td align="right"><?php echo '<a href="' . tep_href_link($back_url, $back_url_params, 'NONSSL') . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>
</tr>
<?php
} else {
?>
<tr>
<td align="right" class="smallText">
<?php
/* Re-Post all POST'ed variables */
reset($HTTP_POST_VARS);
while (list($key, $value) = each($HTTP_POST_VARS)) {
if (!is_array($HTTP_POST_VARS[$key])) {
echo tep_draw_hidden_field($key, htmlspecialchars(stripslashes($value)));
}
}
$languages = tep_get_languages();
for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
echo tep_draw_hidden_field('products_name[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_name[$languages[$i]['id']])));
echo tep_draw_hidden_field('products_description[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_description[$languages[$i]['id']])));
echo tep_draw_hidden_field('products_url[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_url[$languages[$i]['id']])));
}
echo tep_draw_hidden_field('products_image', stripslashes($products_image_name));
echo tep_image_submit('button_back.gif', IMAGE_BACK, 'name="edit"') . ' ';
if (isset($HTTP_GET_VARS['pID'])) {
echo tep_image_submit('button_update.gif', IMAGE_UPDATE);
} else {
echo tep_image_submit('button_insert.gif', IMAGE_INSERT);
}
echo ' <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . (isset($HTTP_GET_VARS['pID']) ? '&pID=' . $HTTP_GET_VARS['pID'] : '')) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>';
?></td>
</tr>
</table></form>
<?php
}
} else {
?>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
<td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', 1, HEADING_IMAGE_HEIGHT); ?></td>
<td align="right"><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td class="smallText" align="right">
<?php
echo tep_draw_form('search', FILENAME_CATEGORIES, '', 'get');
echo HEADING_TITLE_SEARCH . ' ' . tep_draw_input_field('search');
echo tep_hide_session_id() . '</form>';
?>
</td>
</tr>
<tr>
<td class="smallText" align="right">
<?php
echo tep_draw_form('goto', FILENAME_CATEGORIES, '', 'get');
echo HEADING_TITLE_GOTO . ' ' . tep_draw_pull_down_menu('cPath', tep_get_category_tree(), $current_category_id, 'onChange="this.form.submit();"');
echo tep_hide_session_id() . '</form>';
?>
</td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr class="dataTableHeadingRow">
<td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CATEGORIES_PRODUCTS; ?></td>
<td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_STATUS; ?></td>
<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?> </td>
</tr>
<?php
$categories_count = 0;
$rows = 0;
if (isset($HTTP_GET_VARS['search'])) {
$search = tep_db_prepare_input($HTTP_GET_VARS['search']);
$categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id, c.sort_order, c.date_added, c.last_modified from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' and cd.categories_name like '%" . tep_db_input($search) . "%' order by c.sort_order, cd.categories_name");
} else {
$categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id, c.sort_order, c.date_added, c.last_modified from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$current_category_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by c.sort_order, cd.categories_name");
}
while ($categories = tep_db_fetch_array($categories_query)) {
$categories_count++;
$rows++;
// Get parent_id for subcategories if search
if (isset($HTTP_GET_VARS['search'])) $cPath= $categories['parent_id'];
if ((!isset($HTTP_GET_VARS['cID']) && !isset($HTTP_GET_VARS['pID']) || (isset($HTTP_GET_VARS['cID']) && ($HTTP_GET_VARS['cID'] == $categories['categories_id']))) && !isset($cInfo) && (substr($action, 0, 3) != 'new')) {
$category_childs = array('childs_count' => tep_childs_in_category_count($categories['categories_id']));
$category_products = array('products_count' => tep_products_in_category_count($categories['categories_id']));
$cInfo_array = array_merge($categories, $category_childs, $category_products);
$cInfo = new objectInfo($cInfo_array);
}
if (isset($cInfo) && is_object($cInfo) && ($categories['categories_id'] == $cInfo->categories_id) ) {
echo ' <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_CATEGORIES, tep_get_path($categories['categories_id'])) . '\'">' . "\n";
} else {
echo ' <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $categories['categories_id']) . '\'">' . "\n";
}
?>
<td class="dataTableContent"><?php echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, tep_get_path($categories['categories_id'])) . '">' . tep_image(DIR_WS_ICONS . 'folder.gif', ICON_FOLDER) . '</a> <b>' . $categories['categories_name'] . '</b>'; ?></td>
<td class="dataTableContent" align="center"> </td>
<td class="dataTableContent" align="right"><?php if (isset($cInfo) && is_object($cInfo) && ($categories['categories_id'] == $cInfo->categories_id) ) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $categories['categories_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?> </td>
</tr>
<?php
}
// Get categories_id for product if search
if (isset($HTTP_GET_VARS['search'])) $cPath = $products['categories_id'];
if ( (!isset($HTTP_GET_VARS['pID']) && !isset($HTTP_GET_VARS['cID']) || (isset($HTTP_GET_VARS['pID']) && ($HTTP_GET_VARS['pID'] == $products['products_id']))) && !isset($pInfo) && !isset($cInfo) && (substr($action, 0, 3) != 'new')) {
// find out the rating average from customer reviews
$reviews_query = tep_db_query("select (avg(reviews_rating) / 5 * 100) as average_rating from " . TABLE_REVIEWS . " where products_id = '" . (int)$products['products_id'] . "'");
$reviews = tep_db_fetch_array($reviews_query);
$pInfo_array = array_merge($products, $reviews);
$pInfo = new objectInfo($pInfo_array);
}
if (isset($pInfo) && is_object($pInfo) && ($products['products_id'] == $pInfo->products_id) ) {
echo ' <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $products['products_id'] . '&action=new_product_preview&read=only') . '\'">' . "\n";
} else {
echo ' <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $products['products_id']) . '\'">' . "\n";
}
?>
<td class="dataTableContent"><?php echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $products['products_id'] . '&action=new_product_preview&read=only') . '">' . tep_image(DIR_WS_ICONS . 'preview.gif', ICON_PREVIEW) . '</a> ' . $products['products_name']; ?></td>
<?php
if ($products['products_master_status'] == "1") {
echo '<span style="color: #800080;">' . $products['products_name'] . ' ('.TEXT_MASTER.')</span></td>';
} elseif ($products['products_master'] != 0) {
echo '<span style="color: #0080C0">' . $products['products_name'] . ' ('.TEXT_SLAVE.')</span></td>';
} else {
echo $products['products_name'] . '</td>';
} ?>
<td class="dataTableContent" align="center">
<?php
if ($products['products_status'] == '1') {
echo tep_image(DIR_WS_IMAGES . 'icon_status_green.gif', IMAGE_ICON_STATUS_GREEN, 10, 10) . ' <a href="' . tep_href_link(FILENAME_CATEGORIES, 'action=setflag&flag=0&pID=' . $products['products_id'] . '&cPath=' . $cPath) . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_red_light.gif', IMAGE_ICON_STATUS_RED_LIGHT, 10, 10) . '</a>';
} else {
echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'action=setflag&flag=1&pID=' . $products['products_id'] . '&cPath=' . $cPath) . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_green_light.gif', IMAGE_ICON_STATUS_GREEN_LIGHT, 10, 10) . '</a> ' . tep_image(DIR_WS_IMAGES . 'icon_status_red.gif', IMAGE_ICON_STATUS_RED, 10, 10);
}
?></td>
<td class="dataTableContent" align="right"><?php if (isset($pInfo) && is_object($pInfo) && ($products['products_id'] == $pInfo->products_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?> </td>
<?php
// >>>> BOF Linkmatics attributes sets plus (5 of 5)
echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES_SETS_EDIT, 'pID=' . $products['products_id'].'&cPath='.$cPath) . '">' . tep_image(DIR_WS_IMAGES . 'icon_attribute_sets.gif', IMAGE_ICON_ATTRIBUTE_SETS) . '</a>';
// <<<< EOF Linkmatics attributes sets plus (5 of 5)
if (isset($pInfo) && is_object($pInfo) && ($products['products_id'] == $pInfo->products_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; }
?>
</td>
</tr>
<?php
}
$cPath_back = '';
if (sizeof($cPath_array) > 0) {
for ($i=0, $n=sizeof($cPath_array)-1; $i<$n; $i++) {
if (empty($cPath_back)) {
$cPath_back .= $cPath_array[$i];
} else {
$cPath_back .= '_' . $cPath_array[$i];
}
}
}
$cPath_back = (tep_not_null($cPath_back)) ? 'cPath=' . $cPath_back . '&' : '';
?>
<tr>
<td colspan="3"><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td class="smallText"><?php echo TEXT_CATEGORIES . ' ' . $categories_count . '<br>' . TEXT_PRODUCTS . ' ' . $products_count; ?></td>
<!-- Master Products //-->
<td align="right" class="smallText"><?php if (sizeof($cPath_array) > 0) echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, $cPath_back . 'cID=' . $current_category_id) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a> '; if (!isset($HTTP_GET_VARS['search'])) echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&action=new_category') . '">' . tep_image_button('button_new_category.gif', IMAGE_NEW_CATEGORY) . '</a> <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&action=new_master') . '">' . tep_image_button('button_new_master.gif', IMAGE_NEW_MASTER) . '</a> <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&action=new_product') . '">' . tep_image_button('button_new_product.gif', IMAGE_NEW_PRODUCT) . '</a>'; ?> </td>
<!-- Master Products EOF //-->
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
<?php
}
?>
</td>
<!-- body_text_eof //-->
</tr>
</table>
<!-- body_eof //-->
<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
Last edited by kitchen (2008-03-21 20:12:09)
Offline
my_config = Xinha_config.js
xinha_editors = null;
xinha_init = null;
xinha_config = null;
xinha_plugins = null;
// This contains the names of textareas we will make into Xinha editors
xinha_init = xinha_init ? xinha_init : function()
{
/** STEP 1 ***************************************************************
* First, specify the textareas that shall be turned into Xinhas.
* For each one add the respective id to the xinha_editors array.
* I you want add more than on textarea, keep in mind that these
* values are comma seperated BUT there is no comma after the last value.
* If you are going to use this configuration on several pages with different
* textarea ids, you can add them all. The ones that are not found on the
* current page will just be skipped.
************************************************************************/
xinha_editors = xinha_editors ? xinha_editors :
[
'products_description', 'products_image'
];
/** STEP 2 ***************************************************************
* Now, what are the plugins you will be using in the editors on this
* page. List all the plugins you will need, even if not all the editors
* will use all the plugins.
*
* The list of plugins below is a good starting point, but if you prefer
* a simpler editor to start with then you can use the following
*
* xinha_plugins = xinha_plugins ? xinha_plugins : [ ];
*
* which will load no extra plugins at all.
************************************************************************/
xinha_plugins = xinha_plugins ? xinha_plugins :
[
'CharacterMap',
'ContextMenu',
'ListType',
'Stylist',
'Linker',
'SuperClean',
'TableOperations'
];
// THIS BIT OF JAVASCRIPT LOADS THE PLUGINS, NO TOUCHING :)
if(!Xinha.loadPlugins(xinha_plugins, xinha_init)) return;
/** STEP 3 ***************************************************************
* We create a default configuration to be used by all the editors.
* If you wish to configure some of the editors differently this will be
* done in step 5.
*
* If you want to modify the default config you might do something like this.
*
* xinha_config = new Xinha.Config();
* xinha_config.width = '640px';
* xinha_config.height = '420px';
*
*************************************************************************/
xinha_config = xinha_config ? xinha_config() : new Xinha.Config();
// To adjust the styling inside the editor, we can load an external stylesheet like this
// NOTE : YOU MUST GIVE AN ABSOLUTE URL
xinha_config.pageStyleSheets = [ _editor_url + "examples/full_example.css" ];
/** STEP 4 ***************************************************************
* We first create editors for the textareas.
*
* You can do this in two ways, either
*
* xinha_editors = Xinha.makeEditors(xinha_editors, xinha_config, xinha_plugins);
*
* if you want all the editor objects to use the same set of plugins, OR;
*
* xinha_editors = Xinha.makeEditors(xinha_editors, xinha_config);
* xinha_editors.myTextArea.registerPlugins(['Stylist']);
* xinha_editors.anotherOne.registerPlugins(['CSS','SuperClean']);
*
* if you want to use a different set of plugins for one or more of the
* editors.
************************************************************************/
// xinha_editors = Xinha.makeEditors(xinha_editors, xinha_config, xinha_plugins);
xinha_editors = Xinha.makeEditors(xinha_editors, xinha_config);
xinha_editors.products_description.registerPlugins(['Stylist']);
xinha_editors.products_image.registerPlugins(['CSS','SuperClean']);
/** STEP 5 ***************************************************************
* If you want to change the configuration variables of any of the
* editors, this is the place to do that, for example you might want to
* change the width and height of one of the editors, like this...
*
* xinha_editors.myTextArea.config.width = '640px';
* xinha_editors.myTextArea.config.height = '480px';
*
************************************************************************/
xinha_editors.products_image.config.width = '640px';
xinha_editors.products_image.config.height = '480px';
/** STEP 6 ***************************************************************
* Finally we "start" the editors, this turns the textareas into
* Xinha editors.
************************************************************************/
Xinha.startEditors(xinha_editors);
}
Xinha._addEvent(window,'load', xinha_init); // this executes the xinha_init function on page load
// and does not interfere with window.onload properties set by other scripts
simon
Last edited by kitchen (2008-03-21 20:12:47)
Offline
I think it my have to do with that i have to use "tep_draw_textarea_field" and not "textarea"???
simon
Offline
Only guesswork without seeing the actual HTML, but I suppose the function tep_draw_textarea_field() produces a textarea without an id attribute? If so and you cannot change this function to do so, you have to do some javascript tricks to get get a grip on your textareas. If these are the only textareas on your page, you could for example do
xinha_editors = xinha_editors ? xinha_editors : document.getElementsByTagName('textarea');
Offline
Only guesswork without seeing the actual HTML, but I suppose the function tep_draw_textarea_field() produces a textarea without an id attribute? If so and you cannot change this function to do so, you have to do some javascript tricks to get get a grip on your textareas. If these are the only textareas on your page, you could for example do
xinha_editors = xinha_editors ? xinha_editors : document.getElementsByTagName('textarea');
Hi
"Only guesswork without seeing the actual HTML"
http://www.westonehosting.com/catalog/a … ew_product
the textareas:
General tab:
Products Description:
Images tab:
Products Image:
Offline
Only guesswork without seeing the actual HTML, but I suppose the function tep_draw_textarea_field() produces a textarea without an id attribute? If so and you cannot change this function to do so, you have to do some javascript tricks to get get a grip on your textareas. If these are the only textareas on your page, you could for example do
xinha_editors = xinha_editors ? xinha_editors : document.getElementsByTagName('textarea');
Ray,
Could you give example code that would convert textareas by their class name?
Also, is there any way that I could convert textareas by class name and then specify the extra config options for each class, the way I would normally do with ID's ?
Thanks for any help you can give.
PS. I'm considering just using the ID's as if they are classes, but that will generate warnings because the ID's won't be unique...also then I can't take advantage of the label tag in forms.
PPS. It turns out that using the ID multiple times on one page causes only the last textarea to be converted to a xinha.
Last edited by NBrepresent (2008-04-05 16:15:40)
Offline
Pages: 1