FOSSology  4.4.0
Open Source License Compliance by Open Source Software
GettingStartedPage.php
1 <?php
2 /*
3  SPDX-FileCopyrightText: © 2008-2013 Hewlett-Packard Development Company, L.P.
4  SPDX-FileCopyrightText: © 2014 Siemens AG
5 
6  SPDX-License-Identifier: GPL-2.0-only
7 */
8 
9 
10 namespace Fossology\UI\Page;
11 
13 use Symfony\Component\HttpFoundation\Request;
14 use Symfony\Component\HttpFoundation\Response;
15 
16 
18 {
19  const NAME = 'Getting Started';
20 
21  function __construct()
22  {
23  parent::__construct(self::NAME, array(
24  self::TITLE => _("Getting Started with FOSSology"),
25  self::REQUIRES_LOGIN => false,
26  self::MENU_LIST => "Help::Getting Started",
27  ));
28  }
29 
33  function RegisterMenus()
34  {
35  $topMenuList = "Main::" . "Help::Getting Started";
36  $menuOrder = 0;
37  menu_insert($topMenuList.'::Overview', $menuOrder-10, $this->getName()."&show=welcome");
38  menu_insert($topMenuList.'::License Browser', $menuOrder, $this->getName()."&show=licensebrowser");
39  }
40 
45  protected function handle(Request $request)
46  {
47  $show = $request->get('show');
48  if ($show == 'licensebrowser') {
49  return $this->render("getting_started_licensebrowser.html.twig");
50  }
51  $login = _("Login");
52  if (empty($_SESSION['User']) && (plugin_find_id("auth") >= 0)) {
53  $login = "<a href='".Traceback_uri()."?mod=auth'>$login</a>";
54  }
55  $vars = array('login'=>$login, 'SiteURI'=> Traceback_uri());
56 
57  return $this->render('getting_started.html.twig', $this->mergeWithDefault($vars));
58  }
59 }
60 
61 register_plugin(new GettingStartedPage());
render($templateName, $vars=null, $headers=null)
menu_insert($Path, $LastOrder=0, $URI=NULL, $Title=NULL, $Target=NULL, $HTML=NULL)
Given a Path, order level for the last item, and optional plugin name, insert the menu item.
Traceback_uri()
Get the URI without query to this location.
Definition: common-parm.php:97