function event_category_edit($evname) { pagetop(gTxt('categories')); extract(doSlash(gpsa(array('id', 'parent')))); $row = safe_row("*", "txp_category", "id={$id}"); if ($row) { extract($row); $out = stackRows(fLabelCell($evname . '_category_name') . fInputCell('name', $name, 1, 20), fLabelCell('parent') . td(parent_pop($parent, $evname)), fLabelCell($evname . '_category_title') . fInputCell('title', $title, 1, 30), hInput('id', $id), tdcs(fInput('submit', '', gTxt('save_button'), 'smallerbox'), 2)); } $out .= eInput('category') . sInput($evname . '_save') . hInput('old_name', $name); echo form(startTable('edit') . $out . endTable()); }
function image_edit() { pagetop(gTxt('categories')); $name = gps('name'); extract(safe_row("*", "txp_category", "name='{$name}' and type='image'")); $out = tr(fLabelCell(gTxt('image_category_name') . ':') . fInputCell('name', $name, 1, 20)) . tr(fLabelCell('parent') . td(parent_pop($parent, 'image'))) . tr(tdcs(fInput('submit', '', gTxt('save_button'), 'smallerbox'), 2)); $out .= eInput('category') . sInput('image_save') . hInput('old_name', $name); echo form(startTable('edit') . $out . endTable()); }