FOSSology  3.2.0rc1
Open Source License Compliance by Open Source Software
GettingStartedPage.php
1 <?php
2 /***********************************************************
3  Copyright (C) 2008-2013 Hewlett-Packard Development Company, L.P.
4  Copyright (C) 2014, 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  ***********************************************************/
19 
20 
21 namespace Fossology\UI\Page;
22 
26 
27 
29 {
30  const NAME = 'Getting Started';
31 
32  function __construct()
33  {
34  parent::__construct(self::NAME, array(
35  self::TITLE => _("Getting Started with FOSSology"),
36  self::REQUIRES_LOGIN => false,
37  self::MENU_LIST => "Help::Getting Started",
38  ));
39  }
40 
44  function RegisterMenus()
45  {
46  $topMenuList = "Main::" . "Help::Getting Started";
47  $menuOrder = 0;
48  menu_insert($topMenuList.'::Overview', $menuOrder-10, $this->getName()."&show=welcome");
49  menu_insert($topMenuList.'::License Browser', $menuOrder, $this->getName()."&show=licensebrowser");
50  }
51 
56  protected function handle(Request $request)
57  {
58  $show = $request->get('show');
59  if ($show == 'licensebrowser') {
60  return $this->render("getting_started_licensebrowser.html.twig");
61  }
62  $login = _("Login");
63  if (empty($_SESSION['User']) && (plugin_find_id("auth") >= 0)) {
64  $login = "<a href='".Traceback_uri()."?mod=auth'>$login</a>";
65  }
66  $vars = array('login'=>$login, 'SiteURI'=> Traceback_uri());
67 
68  return $this->render('getting_started.html.twig', $this->mergeWithDefault($vars));
69  }
70 }
71 
72 register_plugin(new GettingStartedPage());
Traceback_uri()
Get the URI without query to this location.
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...