addHeader('Redirection'); $form->addSelectAjax( 'user_id', get_lang('User'), null, [ 'url' => api_get_path(WEB_AJAX_PATH).'user_manager.ajax.php?a=get_user_like', 'id' => 'user_id', ] ); $form->addUrl('url', 'URL'); $form->addButtonSend(get_lang('Add')); if (isset($_REQUEST['id'])) { RedirectionPlugin::delete($_REQUEST['id']); Display::addFlash(Display::return_message(get_lang('Deleted'))); header('Location: admin.php'); exit; } if ($form->validate()) { $result = RedirectionPlugin::insert($_POST['user_id'], $_POST['url']); if ($result) { Display::addFlash(Display::return_message(get_lang('Added'))); } else { Display::addFlash(Display::return_message(get_lang('Error'), 'warning')); } header('Location: '.$url); exit; } $content = $form->returnForm(); $content .= '
User | URL | |
---|---|---|
'.$userName.' | '; $content.= ''.$item['url'].' | '; $content.= 'Delete | '; $content.= '