1<?php
2
3// This file is part of BOINC.
4// http://boinc.berkeley.edu
5// Copyright (C) 2016 University of California
6//
7// BOINC is free software; you can redistribute it and/or modify it
8// under the terms of the GNU Lesser General Public License
9// as published by the Free Software Foundation,
10// either version 3 of the License, or (at your option) any later version.
11//
12// BOINC is distributed in the hope that it will be useful,
13// but WITHOUT ANY WARRANTY; without even the implied warranty of
14// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15// See the GNU Lesser General Public License for more details.
16//
17// You should have received a copy of the GNU Lesser General Public License
18// along with BOINC.  If not, see <http://www.gnu.org/licenses/>.
19
20require_once("../inc/util.inc");
21
22function show_choose($is_old) {
23    panel(null,
24        function() use($is_old) {
25            if ($is_old) {
26                echo ' <a href="join.php">'.tra('I\'m new').'</a> &nbsp; |&nbsp; '.tra('I\'m a BOINC user').'
27                ';
28            } else {
29                echo tra('I\'m new')
30                    .' &nbsp; |&nbsp;  <a href="join.php?old=1">'
31                    .tra('I\'m a BOINC user')
32                    .'</a>
33                ';
34            }
35        }
36    );
37}
38
39function show_new() {
40    global $master_url;
41    panel(null,
42        function() use ($master_url) {
43            echo '
44                <ol>
45                <li> '
46                .tra('Read our %1Rules and Policies%2.', '<a href="info.php">', '</a>')
47                .'<li> <p>'
48                .tra('Download the BOINC desktop software.')
49                    .'</p><p>
50                    <a href="http://boinc.berkeley.edu/download.php" class="btn btn-success">'.tra('Download').'</a>
51                    </p><p>'
52                    .tra('For Android devices, download BOINC from the Google Play Store or Amazon App Store.')
53                    .'</p>
54                <li> '
55                .tra('Run the installer.').'
56                <li> '.tra("Choose %1 from the list, or enter %2", "<strong>".PROJECT."</strong>", "<strong>$master_url</strong>").'
57                </ol>
58            ';
59        }
60    );
61}
62
63function show_old() {
64    global $master_url;
65    panel(null,
66        function() use($master_url) {
67            echo '
68                <ul>
69                <li> '
70                .tra('Install BOINC on this device if not already present.')
71                .'<p>
72                <li> '
73                .tra('Select Tools / Add Project. Choose %1 from the list, or enter %2', "<strong>".PROJECT."</strong>", "<strong>$master_url</strong>")
74                .' <p>
75                <li> '
76                .tra('If you\'re running a command-line version of BOINC on this computer, %1create an account%2, then use %3boinccmd --project_attach%4 to add the project.',
77                    '<a href="create_account_form.php">',
78                    '</a>',
79                    '<strong><a href="http://boinc.berkeley.edu/wiki/Boinccmd_tool">',
80                    '</a></strong>'
81                )
82                .'
83                </ul>
84            ';
85        }
86    );
87}
88
89$old = get_int('old', true);
90
91page_head(tra("Join %1", PROJECT));
92show_choose($old);
93if ($old) {
94    show_old();
95} else {
96    show_new();
97}
98page_tail();
99