diff options
Diffstat (limited to 'web/html')
-rw-r--r-- | web/html/css/aur.css | 30 | ||||
-rw-r--r-- | web/html/index.php | 3 | ||||
-rw-r--r-- | web/html/pkgbase.php | 20 | ||||
-rw-r--r-- | web/html/pkgdel.php | 3 | ||||
-rw-r--r-- | web/html/pkgmerge.php | 5 | ||||
-rw-r--r-- | web/html/pkgreq.php | 77 |
6 files changed, 118 insertions, 20 deletions
diff --git a/web/html/css/aur.css b/web/html/css/aur.css index 78fd4ce8..cbebb306 100644 --- a/web/html/css/aur.css +++ b/web/html/css/aur.css @@ -24,20 +24,6 @@ padding: 0; } -#actionlist .text-button { - color: #07b; - background: none; - border: none; - padding: 0; - cursor: pointer; - font-size: 100%; -} - -#actionlist .text-button:hover { - text-decoration: underline; - color: #666; -} - .arch-bio-entry ul { list-style: none; padding: 0; @@ -61,3 +47,19 @@ #pkg-updates td.pkg-date { text-align:right; } + +.text-button { + background: transparent; + border: none !important; + margin: 0 !important; + padding: 0 !important; + font: normal 100% sans-serif; + text-decoration: none; + color: #07b; + cursor: pointer; +} + +.text-button:hover { + text-decoration: underline; + color: #666; +} diff --git a/web/html/index.php b/web/html/index.php index 921839a8..40063f08 100644 --- a/web/html/index.php +++ b/web/html/index.php @@ -75,6 +75,9 @@ if (!empty($tokens[1]) && '/' . $tokens[1] == get_pkg_route()) { $_GET['N'] = $tokens[2]; include('voters.php'); return; + case "request": + include('pkgreq.php'); + return; default: header("HTTP/1.0 404 Not Found"); include "./404.php"; diff --git a/web/html/pkgbase.php b/web/html/pkgbase.php index 0d1b74aa..0b0f6ef9 100644 --- a/web/html/pkgbase.php +++ b/web/html/pkgbase.php @@ -59,23 +59,25 @@ if (check_token()) { } elseif (current_action("do_UnFlag")) { list($ret, $output) = pkgbase_unflag($atype, $ids); } elseif (current_action("do_Adopt")) { - list($ret, $output) = pkgbase_adopt($atype, $ids, true); + list($ret, $output) = pkgbase_adopt($atype, $ids, true, NULL); } elseif (current_action("do_Disown")) { - list($ret, $output) = pkgbase_adopt($atype, $ids, false); + $via = isset($_POST['via']) ? $_POST['via'] : NULL; + list($ret, $output) = pkgbase_adopt($atype, $ids, false, $via); } elseif (current_action("do_Vote")) { list($ret, $output) = pkgbase_vote($atype, $ids, true); } elseif (current_action("do_UnVote")) { list($ret, $output) = pkgbase_vote($atype, $ids, false); } elseif (current_action("do_Delete")) { if (isset($_POST['confirm_Delete'])) { + $via = isset($_POST['via']) ? $_POST['via'] : NULL; if (!isset($_POST['merge_Into']) || empty($_POST['merge_Into'])) { - list($ret, $output) = pkgbase_delete($atype, $ids, NULL); + list($ret, $output) = pkgbase_delete($atype, $ids, NULL, $via); unset($_GET['ID']); } else { $merge_base_id = pkgbase_from_name($_POST['merge_Into']); if ($merge_base_id) { - list($ret, $output) = pkgbase_delete($atype, $ids, $merge_base_id); + list($ret, $output) = pkgbase_delete($atype, $ids, $merge_base_id, $via); unset($_GET['ID']); } else { @@ -94,6 +96,10 @@ if (check_token()) { list($ret, $output) = pkgbase_delete_comment($atype); } elseif (current_action("do_ChangeCategory")) { list($ret, $output) = pkgbase_change_category($base_id, $atype); + } elseif (current_action("do_FileRequest")) { + list($ret, $output) = pkgbase_file_request($ids, $_POST['type'], $_POST['merge_into'], $_POST['comments']); + } elseif (current_action("do_CloseRequest")) { + list($ret, $output) = pkgbase_close_request($_POST['reqid']); } if (isset($_REQUEST['comment'])) { @@ -103,7 +109,11 @@ if (check_token()) { } if ($ret) { - if (isset($base_id)) { + if (current_action("do_CloseRequest")) { + /* Redirect back to package request page on success. */ + header('Location: ' . get_pkgreq_route()); + exit(); + } if (isset($base_id)) { /* Redirect back to package base page on success. */ header('Location: ' . get_pkgbase_uri($pkgbase_name)); exit(); diff --git a/web/html/pkgdel.php b/web/html/pkgdel.php index 39fe81a4..621c3c91 100644 --- a/web/html/pkgdel.php +++ b/web/html/pkgdel.php @@ -37,6 +37,9 @@ if ($atype == "Trusted User" || $atype == "Developer"): ?> <input type="hidden" name="IDs[<?= $base_id ?>]" value="1" /> <input type="hidden" name="ID" value="<?= $base_id ?>" /> <input type="hidden" name="token" value="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" /> + <?php if (isset($_GET['via'])): ?> + <input type="hidden" name="via" value="<?= intval($_GET['via']) ?>" /> + <?php endif; ?> <p><input type="checkbox" name="confirm_Delete" value="1" /> <?= __("Confirm package deletion") ?></p> <p><input type="submit" class="button" name="do_Delete" value="<?= __("Delete") ?>" /></p> diff --git a/web/html/pkgmerge.php b/web/html/pkgmerge.php index dbc5eac6..ba3f7424 100644 --- a/web/html/pkgmerge.php +++ b/web/html/pkgmerge.php @@ -39,8 +39,11 @@ if ($atype == "Trusted User" || $atype == "Developer"): ?> <input type="hidden" name="IDs[<?= $base_id ?>]" value="1" /> <input type="hidden" name="ID" value="<?= $base_id ?>" /> <input type="hidden" name="token" value="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" /> + <?php if (isset($_GET['via'])): ?> + <input type="hidden" name="via" value="<?= intval($_GET['via']) ?>" /> + <?php endif; ?> <p><label for="merge_Into" ><?= __("Merge into:") ?></label> - <input type="text" id="merge_Into" name="merge_Into" /></p> + <input type="text" id="merge_Into" name="merge_Into" value="<?= isset($_GET['into']) ? $_GET['into'] : '' ?>" /></p> <p><input type="checkbox" name="confirm_Delete" value="1" /> <?= __("Confirm package merge") ?></p> <p><input type="submit" class="button" name="do_Delete" value="<?= __("Merge") ?>" /></p> diff --git a/web/html/pkgreq.php b/web/html/pkgreq.php new file mode 100644 index 00000000..5d708fc9 --- /dev/null +++ b/web/html/pkgreq.php @@ -0,0 +1,77 @@ +<?php + +set_include_path(get_include_path() . PATH_SEPARATOR . '../lib'); + +include_once("aur.inc.php"); +include_once("pkgfuncs.inc.php"); + +set_lang(); +check_sid(); + +html_header(__("File Request")); + +if (!isset($base_id)) { + if (!check_user_privileges()) { + header('Location: /'); + exit(); + } + + $results = pkgbase_request_list(); + $total = count($results); + + /* Sanitize paging variables. */ + if (isset($_GET['O'])) { + $_GET['O'] = intval($_GET['O']); + if ($_GET['O'] < 0) + $_GET['O'] = 0; + } else { + $_GET['O'] = 0; + } + + if (isset($_GET["PP"])) { + $_GET["PP"] = intval($_GET["PP"]); + if ($_GET["PP"] < 50) + $_GET["PP"] = 50; + else if ($_GET["PP"] > 250) + $_GET["PP"] = 250; + } else { + $_GET["PP"] = 50; + } + + /* Calculate the results to use. */ + $first = $_GET['O'] + 1; + + /* Calculation of pagination links. */ + $per_page = ($_GET['PP'] > 0) ? $_GET['PP'] : 50; + $current = ceil($first / $per_page); + $pages = ceil($total / $per_page); + $templ_pages = array(); + + if ($current > 1) { + $templ_pages['« ' . __('First')] = 0; + $templ_pages['‹ ' . __('Previous')] = ($current - 2) * $per_page; + } + + if ($current - 5 > 1) + $templ_pages["..."] = false; + + for ($i = max($current - 5, 1); $i <= min($pages, $current + 5); $i++) { + $templ_pages[$i] = ($i - 1) * $per_page; + } + + if ($current + 5 < $pages) + $templ_pages["... "] = false; + + if ($current < $pages) { + $templ_pages[__('Next') . ' ›'] = $current * $per_page; + $templ_pages[__('Last') . ' »'] = ($pages - 1) * $per_page; + } + + $SID = $_COOKIE['AURSID']; + include('pkgreq_results.php'); +} else { + include('pkgreq_form.php'); +} + +html_footer(AUR_VERSION); + |