9 require_once(
'HistogramBase.php');
11 define(
"TITLE_EMAILHISTOGRAM", _(
"Email/URL/Author Browser"));
17 $this->Name =
"email-hist";
18 $this->Title = TITLE_EMAILHISTOGRAM;
19 $this->viewName =
"email-view";
20 $this->agentName =
"copyright";
21 parent::__construct();
34 $typeDescriptionPairs = array(
35 'email' => _(
"Email"),
37 'author' => _(
"Author"),
38 'scancode_author' => _(
"Author"),
39 'scancode_url' => _(
"URL"),
40 'scancode_email' => _(
"Email")
45 foreach ($typeDescriptionPairs as $type=>$description) {
46 if ($type ==
"scancode_author" || $type ==
"scancode_email" || $type ==
"scancode_url") {
48 $this->agentName =
"scancode";
51 $tableVars[$type] = $vars;
55 $output[] = $tableVars;
64 protected function fillTables($upload_pk, $Uploadtree_pk, $filter, $agentId, $VF)
66 list($VEmail, $VUrl, $VAuthor, $VScanAuthor, $VScanUrl, $VScanEmail, $tableVars) = $this->
getTableContent($upload_pk, $Uploadtree_pk, $filter, $agentId);
69 array(
'contEmail'=>$VEmail,
71 'contAuthor'=>$VAuthor,
72 'contScanAuthor' => $VScanAuthor,
73 'contScanUrl' => $VScanUrl,
74 'contScanEmail' => $VScanEmail,
76 return array($out, $tableVars);
89 if (!empty($Item) && !empty($Upload)) {
94 $text = _(
"View email/URL/author histogram");
95 menu_insert(
"Browse::Email/URL/Author",10,$URI,$text);
109 var emailTabCookie = 'stickyEmailTab';
110 var emailTabFossCookie = 'stickyEmailFossTab';
111 var emailTabScanCookie = 'stickyEmailScanTab';
112 $(document).ready(function() {
113 tableEmail = createTableemail();
114 tableUrl = createTableurl();
115 tableAuthor = createTableauthor();
116 tableScanEmail = createTablescancode_email();
117 tableScanUrl = createTablescancode_url();
118 tableScanAuthor = createTablescancode_author();
119 $('#testReplacementemail').click(function() {
120 testReplacement(tableEmail, 'email');
122 $('#testReplacementurl').click(function() {
123 testReplacement(tableUrl, 'url');
125 $('#testReplacementauthor').click(function() {
126 testReplacement(tableAuthor, 'author');
128 $('#testReplacementScanemail').click(function() {
129 testReplacement(tableScanEmail, 'email');
131 $('#testReplacementScanurl').click(function() {
132 testReplacement(tableScanUrl, 'url');
134 $('#testReplacementScanauthor').click(function() {
135 testReplacement(tableScanAuthor, 'author');
137 $('#EmailUrlAuthorTabs').tabs({
138 active: ($.cookie(emailTabCookie) || 0),
139 activate: function(e, ui){
140 // Get active tab index and update cookie
141 var idString = $(e.currentTarget).attr('id');
142 idString = parseInt(idString.slice(-1)) - 1;
143 $.cookie(emailTabCookie, idString);
146 $('#FossEmailUrlAuthorTabs').tabs({
147 active: ($.cookie(emailTabFossCookie) || 0),
148 activate: function(e, ui){
149 // Get active tab index and update cookie
150 var tabIdFoss = $(ui.newPanel).attr('id');
151 var idStringFoss = 0;
152 if (tabIdFoss == 'FossEmailTab') {
154 } else if (tabIdFoss == 'FossUrlTab') {
156 } else if (tabIdFoss == 'FossAuthorTab') {
159 $.cookie(emailTabFossCookie, idStringFoss);
162 $('#ScanEmailUrlAuthorTabs').tabs({
163 active: ($.cookie(emailTabScanCookie) || 0),
164 activate: function(e, ui){
165 // Get active tab index and update cookie
166 var tabIdScan = $(ui.newPanel).attr('id');
167 var idStringScan = 0;
168 if (tabIdScan == 'ScanEmailTab') {
170 } else if (tabIdScan == 'ScanUrlTab') {
172 } else if (tabIdScan == 'ScanAuthorTab') {
175 $.cookie(emailTabScanCookie, idStringScan);
createScriptBlock()
Create JavaScript block for histogram.
RegisterMenus()
While menus can be added to any time at or after the PostInitialize phase, this is the standard locat...
getTableContent($upload_pk, $uploadtreeId, $filter, $agentId)
Get contents for author table.
__construct()
base constructor. Most plugins will just use this
fillTables($upload_pk, $Uploadtree_pk, $filter, $agentId, $VF)
Get copyright statements and fill the main content table.
renderString($templateName, $vars=null)
Base class for histogram plugins.
getTableForSingleType($type, $description, $uploadId, $uploadTreeId, $filter, $agentId)
LatestAgentpk($upload_pk, $arsTableName, $arsSuccess=false)
Given an upload_pk, find the latest enabled agent_pk with results.
GetParm($parameterName, $parameterType)
This function will retrieve the variables and check data types.
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).