Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Text Box Size Flexibility in Admin Edit


Ian-San

Recommended Posts

Posted

Change function tep_draw_input_field in admin/includes/functions/html_output.php to add a 7th field as follows:

 

Change to:

function tep_draw_input_field($name, $value = '', $parameters = '', $required = false, $type = 'text', $reinsert_value = true, $size = '') {

if ($size == '') {

$field = '<input type="' . $type . '" name="' . $name . '"' ;

} else {

$field = '<input type="' . $type . '" name="' . $name . '"' . '" size="' . $size . '"';

}

if ( ($GLOBALS[$name]) && ($reinsert_value) ) {

$field .= ' value="' . htmlspecialchars(trim($GLOBALS[$name])) . '"';

} elseif ($value != '') {

$field .= ' value="' . htmlspecialchars(trim($value)) . '"';

}

if ($parameters != '') {

$field .= ' ' . $parameters;

}

$field .= '>';

 

if ($required) $field .= TEXT_FIELD_REQUIRED;

 

return $field;

}

 

to allow custom length, text input, field sizes. e.g. in admin/catagories.php you could increase the Product name field size to 60 characters as follows:

 

<td class="main"><?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'] . ']', (($products_name[$languages[$i]['id']]) ? stripslashes($products_name[$languages[$i]['id']]) : tep_get_products_name($pInfo->products_id, $languages[$i]['id'])),'','','','','60'); ?></td>

Ian-san

Flawlessnet

Posted
to allow custom length, text input, field sizes. e.g. in admin/catagories.php you could increase the Product name field size to 60 characters as follows:

 

Why not just do the following

 

<td class="main"><?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'] . ']', (($products_name[$languages[$i]['id']]) ? stripslashes($products_name[$languages[$i]['id']]) : tep_get_products_name($pInfo->products_id, $languages[$i]['id'])), 'size=60'); ?></td>

 

:)

Mark Evans

osCommerce Monkey & Lead Guitarist for "Sparky + the Monkeys" (Album on sale in all good record shops)

 

---------------------------------------

Software is like sex: It's better when it's free. (Linus Torvalds)

Posted

Well Mark, I think that explains why you are a Team Member !

 

Thanks for the solution :D

Ian-san

Flawlessnet

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...