FOSSology  3.2.0rc1
Open Source License Compliance by Open Source Software
KeywordView.php
1 <?php
2 /*
3  Copyright (C) 2018, Siemens AG
4 
5  This program is free software; you can redistribute it and/or
6  modify it under the terms of the GNU General Public License
7  version 2 as published by the Free Software Foundation.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License along
15  with this program; if not, write to the Free Software Foundation, Inc.,
16  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17  */
18 
20 
23 
24 class KeywordView extends Xpview
25 {
26  const NAME = 'keyword-view';
27 
28  function __construct()
29  {
30  $this->decisionTableName = "keyword_decision";
31  $this->tableName = "keyword";
32  $this->modBack = 'keyword-hist';
33  $this->optionName = "skipFileKeyword";
34  $this->ajaxAction = "setNextPrevKeyword";
35  $this->skipOption = "noKeyword";
36  $this->highlightTypeToStringMap = array(Highlight::KEYWORDOTHERS => 'Keyword');
37  $this->typeToHighlightTypeMap = array('keyword' => Highlight::KEYWORDOTHERS);
38  $this->xptext = 'Keyword';
39  parent::__construct(self::NAME, array(
40  self::TITLE => _("Keyword Analysis")
41  ));
42  }
43 
47  function RegisterMenus()
48  {
49  $itemId = GetParm("item", PARM_INTEGER);
50  $textFormat = $this->microMenu->getFormatParameter($itemId);
51  $pageNumber = GetParm("page", PARM_INTEGER);
52  $this->microMenu->addFormatMenuEntries($textFormat, $pageNumber);
53 
54  // For all other menus, permit coming back here.
55  $uploadId = GetParm("upload", PARM_INTEGER);
56  if (!empty($itemId) && !empty($uploadId)) {
57  $menuText = "keyword";
58  $tooltipText = "keyword Analysis";
59  $menuPosition = 56;
60  $URI = KeywordView::NAME . Traceback_parm_keep(array("show", "format", "page", "upload", "item"));
61  $this->microMenu->insert(MicroMenu::TARGET_DEFAULT, $menuText, $menuPosition, $this->getName(), $URI, $tooltipText);
62  }
63  $licId = GetParm("lic", PARM_INTEGER);
64  if (!empty($licId)) {
65  $this->NoMenu = 1;
66  }
67  }
68 }
69 
70 register_plugin(new KeywordView());
Namespace for Copyright agent&#39;s UI components.
GetParm($parameterName, $parameterType)
This function will retrieve the variables and check data types.
Definition: common-parm.php:57
const PARM_INTEGER
Definition: common-parm.php:25
Traceback_parm_keep($List)
Create a new URI, keeping only these items.