Rename the AUR software to aurweb
[aur.git] / web / html / pkgmerge.php
blob5fbdbd82d17c32344b19d85b342330b429d9683d
1 <?php
3 set_include_path(get_include_path() . PATH_SEPARATOR . '../lib');
5 include_once("aur.inc.php");
6 include_once("pkgfuncs.inc.php");
8 set_lang();
9 check_sid();
11 html_header(__("Package Merging"));
13 if (has_credential(CRED_PKGBASE_DELETE)): ?>
14 <div class="box">
15 <h2><?= __('Merge Package: %s', htmlspecialchars($pkgbase_name)) ?></h2>
16 <p>
17 <?= __('Use this form to merge the package base %s%s%s into another package. ',
18 '<strong>', htmlspecialchars($pkgbase_name), '</strong>'); ?>
19 <?= __('The following packages will be deleted: '); ?>
20 </p>
21 <ul>
22 <?php foreach(pkgbase_get_pkgnames($base_id) as $pkgname): ?>
23 <li><?= htmlspecialchars($pkgname) ?></li>
24 <?php endforeach; ?>
25 </ul>
26 <p>
27 <?= __('Once the package has been merged it cannot be reversed. '); ?>
28 <?= __('Enter the package name you wish to merge the package into. '); ?>
29 <?= __('Select the checkbox to confirm action.') ?>
30 </p>
31 <form action="<?= get_uri('/pkgbase/'); ?>" method="post">
32 <fieldset>
33 <input type="hidden" name="IDs[<?= $base_id ?>]" value="1" />
34 <input type="hidden" name="ID" value="<?= $base_id ?>" />
35 <input type="hidden" name="token" value="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
36 <?php if (isset($_GET['via'])): ?>
37 <input type="hidden" name="via" value="<?= intval($_GET['via']) ?>" />
38 <?php endif; ?>
39 <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
40 <script type="text/javascript" src="/js/bootstrap-typeahead.min.js"></script>
41 <script type="text/javascript">
42 $(document).ready(function() {
43 $('#merge_Into').typeahead({
44 source: function(query, callback) {
45 $.getJSON('<?= get_uri('/rpc'); ?>', {type: "suggest-pkgbase", arg: query}, function(data) {
46 callback(data);
47 });
49 matcher: function(item) { return true; },
50 sorter: function(items) { return items; },
51 menu: '<ul class="pkgsearch-typeahead"></ul>',
52 items: 20
53 }).attr('autocomplete', 'off');
54 });
55 </script>
56 <p><label for="merge_Into" ><?= __("Merge into:") ?></label>
57 <input type="text" id="merge_Into" name="merge_Into" value="<?= isset($_GET['into']) ? $_GET['into'] : '' ?>" /></p>
58 <p><input type="checkbox" name="confirm_Delete" value="1" />
59 <?= __("Confirm package merge") ?></p>
60 <p><input type="submit" class="button" name="do_Delete" value="<?= __("Merge") ?>" /></p>
61 </fieldset>
62 </form>
63 </div>
65 <?php else:
66 print __("Only Trusted Users and Developers can merge packages.");
67 endif;
69 html_footer(AURWEB_VERSION);