} else {
    if (isset($params['submit'])) {
        // submit pressed.
        // get the parameters
        if (isset($params['category_name'])) {
            $dest_catname = trim($params['category_name']);
        }
        if (isset($params['category_desc'])) {
            $dest_catdesc = trim($params['category_desc']);
        }
        if (isset($params['category_path'])) {
            $dest_catpath = trim($params['category_path']);
        }
        $copyfiles = $params['copyfiles'];
        Uploads::load_admin();
        $error = _uploads_CopyCategory($this, $category_id, $dest_catname, $dest_catpath, $dest_catdesc, true, true);
        if (empty($error)) {
            $this->SetMessage($this->Lang('category_copied'));
            $this->RedirectToTab($id);
        }
        echo $this->ShowErrors($error);
    }
}
// on submit
//
// give everything to smarty
//
$smarty->assign('category', $category);
$smarty->assign('formstart', $this->CGCreateFormStart($id, 'admin_copycategory', $returnid, $params));
$smarty->assign('formend', $this->CreateFormEnd());
//
     }
     break;
 case 'copy':
     if (isset($params['bulkcopy_submit'])) {
         // do data validation
         $error = '';
         if (!isset($params['copycategory'])) {
             $error = $this->Lang('error_missing_invalid', 'copycategory');
         }
         if (empty($error)) {
             foreach ($params['copycategory'] as $category_id => &$onecat) {
                 $onecat['name'] = trim($onecat['name']);
                 $onecat['description'] = trim($onecat['description']);
                 $onecat['path'] = trim($onecat['path']);
                 Uploads::load_admin();
                 $error = _uploads_CopyCategory($this, $category_id, $onecat['name'], $onecat['path'], $onecat['description'], $onecat['dofiles'], true);
                 if ($error) {
                     break;
                 }
             }
         }
         if (!empty($error)) {
             $this->SetError($error);
         }
         $this->RedirectToTab($id);
     }
     // submit
     $query = 'SELECT * FROM ' . cms_db_prefix() . 'module_uploads_categories
              WHERE upload_category_id IN (' . implode(',', $params['cat_multiselect']) . ')';
     $tmp = $db->GetArray($query);
     $smarty->assign('categories', $tmp);