if($mybb->input['action'] == "edititem")
{
if(!($iid = intval($mybb->input['iid'])))
cperror($lang->invalid_item);
$query = $db->simple_select(TABLE_PREFIX.'plaza_items', '*', "iid = $iid");
if(!($item = $db->fetch_array($query)))
cperror($lang->invalid_item);
$itemdetails = array(
$lang->edit_item_params => array(
$lang->item_name => array(
'name' => 'name',
'value' => $item['name'],
'type' => 'text'
),
$lang->item_category => array(
'name' => 'cid',
'value' => $item['cid'],
'type' => 'category'
),
$lang->item_icon => array(
'name' => 'icon',
'value' => $item['icon'],
'type' => 'text'
),
$lang->item_format => array(
'name' => 'format',
'value' => $item['format'],
'type' => 'text'
),
$lang->item_description => array(
'name' => 'description',
'value' => $item['description'],
'type' => 'textarea'
),
$lang->item_download => array(
'name' => 'download',
'value' => $item['download'],
'type' => 'textarea'
),
$lang->item_password => array(
'name' => 'password',
'value' => $item['password'],
'type' => 'textarea'
),
$lang->item_showonstats => array(
'name' => 'showonstats',
'value' => $item['showonstats'],
'type' => 'yesno'
),
$lang->item_disporder => array(
'name' => 'disporder',
'value' => $item['disporder'],
'type' => 'text'
),
$lang->item_visible => array(
'name' => 'visible',
'value' => $item['visible'],
'type' => 'yesno'
),
$lang->item_htmlextra => array(
'name' => 'htmlextra',
'value' => $item['htmlextra'],
'type' => 'textarea'
),
),
$lang->edit_item_coststock => array(
$lang->item_cost => array(
'name' => 'cost',
'value' => $item['cost'],
'type' => 'text'
),
$lang->item_infstock => array(
'name' => 'infstock',
'value' => $item['infstock'],
'type' => 'yesno'
),
$lang->item_stock => array(
'name' => 'stock',
'value' => calcStock($item['stockoffset'], $item['restockamount'], $item['restocktime']),
'type' => 'text'
),
$lang->item_restockamount => array(
'name' => 'restockamount',
'value' => $item['restockamount'],
'type' => 'text'
),
$lang->item_restocktime => array(
'name' => 'restocktime',
'value' => $item['restocktime'],
'type' => 'text'
),
$lang->item_buylimitamount => array(
'name' => 'buylimitamount',
'value' => $item['buylimitamount'],
'type' => 'text'
),
$lang->item_buylimittime => array(
'name' => 'buylimittime',
'value' => $item['buylimittime'],
'type' => 'text'
),
),
);
$plugins->run_hooks("myplaza_admin_edit_item_start");
myplaza_cpheader_inputexpander_js();
startform("myplaza.php", "", "do_edititem");
makehiddencode('iid', $iid);
starttable();
tableheader($lang->edit_item, "", 2);
makehiddencode('referrer', REFERRER);
print_form($itemdetails);
endtable();
endform($lang->submit_changes, $lang->reset_button);
$plugins->run_hooks("myplaza_admin_edit_item_code_foot");
cpfooter();
exit;
}
|