FOSSology  4.4.0
Open Source License Compliance by Open Source Software
ecc-hist.php
1 <?php
2 /*
3  SPDX-FileCopyrightText: © 2010-2014 Hewlett-Packard Development Company, L.P.
4  SPDX-FileCopyrightText: © 2014 Siemens AG
5 
6  SPDX-License-Identifier: GPL-2.0-only
7 */
8 
9 require_once('HistogramBase.php');
10 
11 define("TITLE_ECCHISTOGRAM", _("Export restriction Browser"));
12 
18 {
19  function __construct()
20  {
21  $this->Name = "ecc-hist";
22  $this->Title = TITLE_ECCHISTOGRAM;
23  $this->viewName = "ecc-view";
24  $this->agentName = "ecc";
25  parent::__construct();
26  }
27 
36  protected function getTableContent($upload_pk, $Uploadtree_pk, $filter, $Agent_pk)
37  {
38  $type = 'ecc';
39  $decription = _("Export restriction");
40 
41  $tableVars=array();
42  list($VEcc, $eccVars) = $this->getTableForSingleType($type, $decription, $upload_pk, $Uploadtree_pk, $filter, $Agent_pk);
43  $tableVars['ecc']=$eccVars;
44  return array($VEcc,$tableVars);
45  }
46 
51  protected function fillTables($upload_pk, $Uploadtree_pk, $filter, $agentId, $VF)
52  {
53  list($VEcc, $tableVars) = $this->getTableContent($upload_pk, $Uploadtree_pk, $filter, $agentId);
54 
55  $V = "<table border=0 width='100%'>\n";
56  $V .= "<tr><td valign='top'>$VEcc</td><td valign='top'>$VF</td></tr>\n";
57  $V .= "</table>\n";
58  $V .= "<hr />\n";
59  return array($V,$tableVars);
60  }
61 
66  function RegisterMenus()
67  {
68  // For all other menus, permit coming back here.
69  $URI = $this->Name . Traceback_parm_keep(array("show","format","page","upload","item"));
70  $Item = GetParm("item",PARM_INTEGER);
71  $Upload = GetParm("upload",PARM_INTEGER);
72  if (!empty($Item) && !empty($Upload)) {
73  if (GetParm("mod",PARM_STRING) == $this->Name) {
74  menu_insert("Browse::ECC",10);
75  menu_insert("Browse::[BREAK]",100);
76  } else {
77  $text = _("View ECC histogram");
78  menu_insert("Browse::ECC",10,$URI,$text);
79  }
80  }
81  } // RegisterMenus()
82 
87  protected function createScriptBlock()
88  {
89  return "
90 
91  $(document).ready(function() {
92  tableEcc = createTableecc();
93  $('#testReplacementecc').click(function() {
94  testReplacement(tableEcc, 'ecc');
95  });
96  });
97 
98  ";
99 
100  }
101 }
102 
103 $NewPlugin = new EccHistogram;
Create UI plugin for ecc agent.
Definition: ecc-hist.php:18
createScriptBlock()
Create JavaScript block for histogram.
Definition: ecc-hist.php:87
RegisterMenus()
While menus can be added to any time at or after the PostInitialize phase, this is the standard locat...
Definition: ecc-hist.php:66
fillTables($upload_pk, $Uploadtree_pk, $filter, $agentId, $VF)
Get copyright statements and fill the main content table.
Definition: ecc-hist.php:51
getTableContent($upload_pk, $Uploadtree_pk, $filter, $Agent_pk)
Get contents for ecc table.
Definition: ecc-hist.php:36
__construct()
base constructor. Most plugins will just use this
Definition: ecc-hist.php:19
Base class for histogram plugins.
getTableForSingleType($type, $description, $uploadId, $uploadTreeId, $filter, $agentId)
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.
const PARM_INTEGER
Definition: common-parm.php:14
const PARM_STRING
Definition: common-parm.php:18
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.
list_t type structure used to keep various lists. (e.g. there are multiple lists).
Definition: nomos.h:308