$deleteall = PMF_Filter::filterInput(INPUT_POST, 'deleteall', FILTER_SANITIZE_STRING);
     $delete_all = strtolower($deleteall) == 'yes' ? true : false;
     if ($category->deleteCategory($id, $lang, $delete_all) && $category->deleteCategoryRelation($id, $lang, $delete_all) && $category->deletePermission('user', array($id)) && $category->deletePermission('group', array($id))) {
         printf('<p class="alert alert-success">%s</p>', $PMF_LANG['ad_categ_deleted']);
     } else {
         printf('<p class="alert alert-error">%s</p>', $faqConfig->getDb()->error());
     }
 }
 // Moves a category
 if ($action == 'changecategory') {
     $category = new PMF_Category($faqConfig, array(), false);
     $category->setUser($currentAdminUser);
     $category->setGroups($currentAdminGroups);
     $categoryId_1 = PMF_Filter::filterInput(INPUT_POST, 'cat', FILTER_VALIDATE_INT);
     $categoryId_2 = PMF_Filter::filterInput(INPUT_POST, 'change', FILTER_VALIDATE_INT);
     if ($category->swapCategories($categoryId_1, $categoryId_2)) {
         printf('<p class="alert alert-success">%s</p>', $PMF_LANG['ad_categ_updated']);
     } else {
         printf('<p class="alert alert-error">%s<br />%s</p>', $PMF_LANG['ad_categ_paste_error'], $faqConfig->getDb()->error());
     }
 }
 // Pastes a category
 if ($action == 'pastecategory') {
     $category = new PMF_Category($faqConfig, array(), false);
     $category->setUser($currentAdminUser);
     $category->setGroups($currentAdminGroups);
     $categoryId = PMF_Filter::filterInput(INPUT_POST, 'cat', FILTER_VALIDATE_INT);
     $parentId = PMF_Filter::filterInput(INPUT_POST, 'after', FILTER_VALIDATE_INT);
     if ($category->updateParentCategory($categoryId, $parentId)) {
         printf('<p class="alert alert-success">%s</p>', $PMF_LANG['ad_categ_updated']);
     } else {