FOSSology  3.2.0rc1
Open Source License Compliance by Open Source Software
upload-instructions.php
1 <?php
2 /***********************************************************
3  Copyright (C) 2008-2013 Hewlett-Packard Development Company, L.P.
4  Copyright (C) 2015 Siemens AG
5 
6  This program is free software; you can redistribute it and/or
7  modify it under the terms of the GNU General Public License
8  version 2 as published by the Free Software Foundation.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License along
16  with this program; if not, write to the Free Software Foundation, Inc.,
17  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 ***********************************************************/
24 
26 {
27  const NAME = "upload_instructions";
28 
29  public function __construct()
30  {
31  parent::__construct(self::NAME, array(
32  self::TITLE => _("Upload Instructions"),
33  self::MENU_LIST => "Upload::Instructions",
34  self::PERMISSION => Auth::PERM_WRITE
35  ));
36  }
37 
42  protected function handle(Request $request)
43  {
44  $vars['URI'] = Traceback_uri();
45  $this->renderer->clearTemplateCache();
46  $this->renderer->clearCacheFiles();
47 
48  return $this->render('upload_instructions.html.twig', $this->mergeWithDefault($vars));
49  }
50 
51  private function asciiUnrock()
52  {
53  $V= '';
54  $V .= "<P />\n";
55  $V .= _("Select the type of upload based on where the data is located:\n");
56  /* ASCII ART ROCKS! */
57  $V .= "<table border=0>\n";
58  $V .= "<tr>";
59  $V .= "<td bgcolor='white'>&nbsp;</td>";
60  $V .= "<td bgcolor='blue'>&nbsp;</td>";
61  $V .= "<td bgcolor='blue'>&nbsp;</td>";
62  $V .= "<td bgcolor='blue'>&nbsp;</td>";
63  $V .= "<td bgcolor='white'>&nbsp;</td>";
64  $V .= "<td bgcolor='blue'>&nbsp;</td>";
65  $V .= "<td bgcolor='blue'>&nbsp;</td>";
66  $V .= "<td bgcolor='blue'>&nbsp;</td>";
67  $V .= "<td bgcolor='white'>&nbsp;</td>";
68  $V .= "</tr><tr>";
69  $V .= "<td bgcolor='white'>&nbsp;</td>";
70  $V .= "<td bgcolor='blue'>&nbsp;</td>";
71  $text = _("Your computer");
72  $V .= "<td bgcolor='white' align='center'><a href='${Uri}?mod=upload_file'>$text</a></td>";
73  $V .= "<td bgcolor='blue'>&nbsp;</td>";
74  $V .= "<td bgcolor='white'> &rarr; </td>";
75  $V .= "<td bgcolor='blue'>&nbsp;</td>";
76  $text = _("FOSSology web server");
77  $V .= "<td bgcolor='white' align='center'><a href='${Uri}?mod=upload_srv_files'>$text</a></td>";
78  $V .= "<td bgcolor='blue'>&nbsp;</td>";
79  $V .= "<td bgcolor='white'>&nbsp;</td>";
80  $V .= "</tr><tr>";
81  $V .= "<td bgcolor='white'>&nbsp;</td>";
82  $V .= "<td bgcolor='blue'>&nbsp;</td>";
83  $V .= "<td bgcolor='blue'>&nbsp;</td>";
84  $V .= "<td bgcolor='blue'>&nbsp;</td>";
85  $V .= "<td bgcolor='white'>&nbsp;</td>";
86  $V .= "<td bgcolor='blue'>&nbsp;</td>";
87  $V .= "<td bgcolor='blue'>&nbsp;</td>";
88  $V .= "<td bgcolor='blue'>&nbsp;</td>";
89  $V .= "<td bgcolor='white'>&nbsp;</td>";
90  $V .= "</tr><tr>";
91  $V .= "<td bgcolor='white'>&nbsp;</td>";
92  $V .= "<td bgcolor='white'>&nbsp;</td>";
93  $V .= "<td bgcolor='white'>&nbsp;</td>";
94  $V .= "<td bgcolor='white'>&nbsp;</td>";
95  $V .= "<td bgcolor='white'>&nbsp;</td>";
96  $V .= "<td bgcolor='white'>&nbsp;</td>";
97  $V .= "<td bgcolor='white' align='center'>&darr;</td>";
98  $V .= "<td bgcolor='white'>&nbsp;</td>";
99  $V .= "<td bgcolor='white'>&nbsp;</td>";
100  $V .= "</tr><tr>";
101  $V .= "<td bgcolor='white'>&nbsp;</td>";
102  $V .= "<td bgcolor='white'>&nbsp;</td>";
103  $V .= "<td bgcolor='white'>&nbsp;</td>";
104  $V .= "<td bgcolor='white'>&nbsp;</td>";
105  $V .= "<td bgcolor='white'>&nbsp;</td>";
106  $V .= "<td bgcolor='blue'>&nbsp;</td>";
107  $V .= "<td bgcolor='blue'>&nbsp;</td>";
108  $V .= "<td bgcolor='blue'>&nbsp;</td>";
109  $V .= "<td bgcolor='white'>&nbsp;</td>";
110  $V .= "</tr><tr>";
111  $V .= "<td bgcolor='white'>&nbsp;</td>";
112  $V .= "<td bgcolor='white'>&nbsp;</td>";
113  $V .= "<td bgcolor='white'>&nbsp;</td>";
114  $V .= "<td bgcolor='white'>&nbsp;</td>";
115  $V .= "<td bgcolor='white'>&nbsp;</td>";
116  $V .= "<td bgcolor='blue'>&nbsp;</td>";
117  $text = _("Remote web or FTP server");
118  $V .= "<td bgcolor='white' align='center'><a href='${Uri}?mod=upload_url'>$text</a></td>";
119  $V .= "<td bgcolor='blue'>&nbsp;</td>";
120  $V .= "<td bgcolor='white'>&nbsp;</td>";
121  $V .= "</tr><tr>";
122  $V .= "<td bgcolor='white'>&nbsp;</td>";
123  $V .= "<td bgcolor='white'>&nbsp;</td>";
124  $V .= "<td bgcolor='white'>&nbsp;</td>";
125  $V .= "<td bgcolor='white'>&nbsp;</td>";
126  $V .= "<td bgcolor='white'>&nbsp;</td>";
127  $V .= "<td bgcolor='blue'>&nbsp;</td>";
128  $V .= "<td bgcolor='blue'>&nbsp;</td>";
129  $V .= "<td bgcolor='blue'>&nbsp;</td>";
130  $V .= "<td bgcolor='white'>&nbsp;</td>";
131  $V .= "</tr>";
132  $V .= "</table>\n";
133  return $V;
134  }
135 }
136 
137 register_plugin(new UploadInstructions());
handle(Request $request)
Traceback_uri()
Get the URI without query to this location.
render($templateName, $vars=null, $headers=null)
#define PERM_WRITE
Read-Write permission.
Definition: libfossology.h:45