$errors = 0; foreach ($linkids as $key => $link) { if (!$article->addLink($modules[$key], $links[$key], $titles[$key], $_POST['position'])) { $errors = 1; } } if ($errors == 1) { $xoopsTpl->assign('message', $article->renderErrors()); } } break; case 'dellink': if (isset($_POST['linkids'])) { $errors = 0; foreach ($_POST['linkids'] as $linkid) { if (!$article->deleteLink($linkid)) { $errors = 1; } } if ($errors == 1) { $xoopsTpl->assign('message', $article->renderErrors()); } } else { $xoopsTpl->assign('message', "No link selected"); } break; } $existing_links = $article->getLinks(); include 'include/searchform.php'; $search_form->assign($xoopsTpl); if (count($existing_links) > 0) {