FOSSology  3.2.0rc1
Open Source License Compliance by Open Source Software
EccView.php
1 <?php
2 /*
3  Copyright (C) 2014-2015, Siemens AG
4  Author: Johannes Najjar
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 
21 
24 
25 class EccView extends Xpview
26 {
27  const NAME = 'ecc-view';
28 
29  function __construct()
30  {
31  $this->decisionTableName = "ecc_decision";
32  $this->tableName = "ecc";
33  $this->modBack = 'ecc-hist';
34  $this->optionName = "skipFileEcc";
35  $this->ajaxAction = "setNextPrevEcc";
36  $this->skipOption = "noEcc";
37  $this->highlightTypeToStringMap = array(Highlight::ECC => 'Export Restriction');
38  $this->typeToHighlightTypeMap = array('ecc' => Highlight::ECC);
39  $this->xptext = 'export restriction';
40  parent::__construct(self::NAME, array(
41  self::TITLE => _("View Export Control and Customs Analysis")
42  ));
43  }
44 
49  function RegisterMenus()
50  {
51  $itemId = GetParm("item", PARM_INTEGER);
52  $textFormat = $this->microMenu->getFormatParameter($itemId);
53  $pageNumber = GetParm("page", PARM_INTEGER);
54  $this->microMenu->addFormatMenuEntries($textFormat, $pageNumber);
55 
56  // For all other menus, permit coming back here.
57  $uploadId = GetParm("upload", PARM_INTEGER);
58  if (!empty($itemId) && !empty($uploadId)) {
59  $menuText = "ECC";
60  $tooltipText = "Export Control Classification";
61  $menuPosition = 56;
62  $URI = EccView::NAME . Traceback_parm_keep(array("show", "format", "page", "upload", "item"));
63  $this->microMenu->insert(MicroMenu::TARGET_DEFAULT, $menuText, $menuPosition, $this->getName(), $URI, $tooltipText);
64  }
65  $licId = GetParm("lic", PARM_INTEGER);
66  if (!empty($licId)) {
67  $this->NoMenu = 1;
68  }
69  }
70 }
71 
72 register_plugin(new EccView());
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
RegisterMenus()
Customize submenus.
Definition: EccView.php:49
const PARM_INTEGER
Definition: common-parm.php:25
Traceback_parm_keep($List)
Create a new URI, keeping only these items.