FOSSology  3.2.0rc1
Open Source License Compliance by Open Source Software
ecc-hist.php
1 <?php
2 /***********************************************************
3  * Copyright (C) 2010-2014 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 require_once('HistogramBase.php');
21 
22 define("TITLE_ECCHISTOGRAM", _("Export restriction Browser"));
23 
28 class EccHistogram extends HistogramBase {
29  function __construct()
30  {
31  $this->Name = "ecc-hist";
32  $this->Title = TITLE_ECCHISTOGRAM;
33  $this->viewName = "ecc-view";
34  $this->agentName = "ecc";
35  parent::__construct();
36  }
37 
46  protected function getTableContent($upload_pk, $Uploadtree_pk, $filter, $Agent_pk)
47  {
48  $type = 'ecc';
49  $decription = _("Export restriction");
50 
51  $tableVars=array();
52  list($VEcc, $eccVars) = $this->getTableForSingleType($type, $decription, $upload_pk, $Uploadtree_pk, $filter, $Agent_pk);
53  $tableVars['ecc']=$eccVars;
54  return array($VEcc,$tableVars);
55  }
56 
61  protected function fillTables($upload_pk, $Uploadtree_pk, $filter, $agentId, $VF)
62  {
63  list($VEcc, $tableVars) = $this->getTableContent($upload_pk, $Uploadtree_pk, $filter, $agentId);
64 
65  $V = "<table border=0 width='100%'>\n";
66  $V .= "<tr><td valign='top' width='50%'>$VEcc</td><td valign='top'>$VF</td></tr>\n";
67  $V .= "</table>\n";
68  $V .= "<hr />\n";
69  return array($V,$tableVars);
70  }
71 
76  function RegisterMenus()
77  {
78  // For all other menus, permit coming back here.
79  $URI = $this->Name . Traceback_parm_keep(array("show","format","page","upload","item"));
80  $Item = GetParm("item",PARM_INTEGER);
81  $Upload = GetParm("upload",PARM_INTEGER);
82  if (!empty($Item) && !empty($Upload))
83  {
84  if (GetParm("mod",PARM_STRING) == $this->Name)
85  {
86  menu_insert("Browse::ECC",10);
87  menu_insert("Browse::[BREAK]",100);
88  }
89  else
90  {
91  $text = _("View ECC histogram");
92  menu_insert("Browse::ECC",10,$URI,$text);
93  }
94  }
95  } // RegisterMenus()
96 
101  protected function createScriptBlock()
102  {
103  return "
104 
105  $(document).ready(function() {
106  tableEcc = createTableecc();
107  } );
108 
109  ";
110 
111  }
112 
113 }
114 
115 $NewPlugin = new EccHistogram;
getTableContent($upload_pk, $Uploadtree_pk, $filter, $Agent_pk)
Get contents for ecc table.
Definition: ecc-hist.php:46
fillTables($upload_pk, $Uploadtree_pk, $filter, $agentId, $VF)
Get copyright statements and fill the main content table.
Definition: ecc-hist.php:61
createScriptBlock()
Create JavaScript block for histogram.
Definition: ecc-hist.php:101
Create UI plugin for ecc agent.
Definition: ecc-hist.php:28
getTableForSingleType($type, $description, $uploadId, $uploadTreeId, $filter, $agentId)
RegisterMenus()
While menus can be added to any time at or after the PostInitialize phase, this is the standard locat...
Definition: ecc-hist.php:76
GetParm($parameterName, $parameterType)
This function will retrieve the variables and check data types.
Definition: common-parm.php:57
const PARM_STRING
Definition: common-parm.php:29
const PARM_INTEGER
Definition: common-parm.php:25
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...
list_t type structure used to keep various lists. (e.g. there are multiple lists).
Definition: nomos.h:321
Traceback_parm_keep($List)
Create a new URI, keeping only these items.
Base class for histogram plugins.