FOSSology  4.4.0
Open Source License Compliance by Open Source Software
KeywordView.php
1 <?php
2 /*
3  SPDX-FileCopyrightText: © 2018 Siemens AG
4 
5  SPDX-License-Identifier: GPL-2.0-only
6 */
7 
9 
12 
13 class KeywordView extends Xpview
14 {
15  const NAME = 'keyword-view';
16 
17  function __construct()
18  {
19  $this->decisionTableName = "keyword_decision";
20  $this->tableName = "keyword";
21  $this->modBack = 'keyword-hist';
22  $this->optionName = "skipFileKeyword";
23  $this->ajaxAction = "setNextPrevKeyword";
24  $this->skipOption = "noKeyword";
25  $this->highlightTypeToStringMap = array(Highlight::KEYWORDOTHERS => 'Keyword');
26  $this->typeToHighlightTypeMap = array('keyword' => Highlight::KEYWORDOTHERS);
27  $this->xptext = 'Keyword';
28  parent::__construct(self::NAME, array(
29  self::TITLE => _("Keyword Analysis")
30  ));
31  }
32 
36  function RegisterMenus()
37  {
38  $itemId = GetParm("item", PARM_INTEGER);
39  $textFormat = $this->microMenu->getFormatParameter($itemId);
40  $pageNumber = GetParm("page", PARM_INTEGER);
41  $this->microMenu->addFormatMenuEntries($textFormat, $pageNumber);
42 
43  // For all other menus, permit coming back here.
44  $uploadId = GetParm("upload", PARM_INTEGER);
45  if (!empty($itemId) && !empty($uploadId)) {
46  $menuText = "keyword";
47  $tooltipText = "keyword Analysis";
48  $menuPosition = 56;
49  $URI = KeywordView::NAME . Traceback_parm_keep(array("show", "format", "page", "upload", "item"));
50  $this->microMenu->insert(MicroMenu::TARGET_DEFAULT, $menuText, $menuPosition, $this->getName(), $URI, $tooltipText);
51  }
52  $licId = GetParm("lic", PARM_INTEGER);
53  if (!empty($licId)) {
54  $this->NoMenu = 1;
55  }
56  }
57 }
58 
59 register_plugin(new KeywordView());
const PARM_INTEGER
Definition: common-parm.php:14
GetParm($parameterName, $parameterType)
This function will retrieve the variables and check data types.
Definition: common-parm.php:46
Traceback_parm_keep($List)
Create a new URI, keeping only these items.
Namespace for Copyright agent's UI components.