$result = restrictedArea($user, 'categorie', $id, '&category'); $object = new Categorie($db); if ($id > 0) { $result = $object->fetch($id); $upload_dir = $conf->categorie->multidir_output[$object->entity]; } /* * Actions */ if (isset($_FILES['userfile']) && $_FILES['userfile']['size'] > 0 && $_POST["sendit"] && !empty($conf->global->MAIN_UPLOAD_DOC)) { if ($object->id) { $result = $object->add_photo($upload_dir, $_FILES['userfile']); } } if ($action == 'confirm_delete' && $_GET["file"] && $confirm == 'yes' && $user->rights->categorie->creer) { $object->delete_photo($upload_dir . "/" . $_GET["file"]); } if ($action == 'addthumb' && $_GET["file"]) { $object->add_thumb($upload_dir . "/" . $_GET["file"]); } /* * View */ llxHeader("", "", $langs->trans("Categories")); $form = new Form($db); if ($object->id) { $title = $langs->trans("ProductsCategoryShort"); if ($type == 0) { $title = $langs->trans("ProductsCategoryShort"); } elseif ($type == 1) { $title = $langs->trans("SuppliersCategoryShort");
* Actions */ if ($_FILES['userfile']['size'] > 0 && $_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC)) { if ($id) { $result = $object->fetch($id); $result = $object->add_photo($conf->categorie->dir_output, $_FILES['userfile']); } } if ($action == 'confirm_delete' && $_GET["file"] && $confirm == 'yes' && $user->rights->categorie->creer) { $object->delete_photo($conf->categorie->dir_output."/".$_GET["file"]); } if ($action == 'addthumb' && $_GET["file"]) { $object->add_thumb($conf->categorie->dir_output."/".$_GET["file"]); } /* * View */ llxHeader ("","",$langs->trans("Categories")); $html = new Form($db);