CMS  Version 3.9
DocumentTotalDownloadsView Class Reference

Public Member Functions

 DocumentTotalDownloadsView ($library)
 
 writeScript ()
 
 drawView ()
 

Public Attributes

 $library
 
 $table
 

Detailed Description

Definition at line 41 of file document_stats_view.inc.

Member Function Documentation

◆ DocumentTotalDownloadsView()

DocumentTotalDownloadsView::DocumentTotalDownloadsView (   $library)

Definition at line 46 of file document_stats_view.inc.

47  {
48  $this->library = $library;
49 
50  $join = new InnerJoin();
51  $join->add(Document);
52  $join->add(DocumentDownloadTotalStats);
53  $results = $join->query("WHERE document_library_id={$this->library->document_library_id} ORDER BY title");
54 
55  $this->table = new DataListView($results, "document_download_stats_total");
56  $this->table->column("File", "<a href='#' onclick='docManager.editDocumentDetailsDialog({Document.document_id})'>{Document.title}</a>", true, "width: 80%")
57  ->column("# Downloads", "{DocumentDownloadTotalStats.download_count:0}", true, "width: 20%; text-align: right");
58 
59  $this->table->filter = true;
60  $this->table->pageSize = 25;
61  $this->table->excelFile = $library->identifier."_download_stats_".date("Y_m_d").".xls";
62  $this->table->emptyMessage = "No documents have been downloaded from this library";
63 
64  $this->table->footerText("Total")
65  ->footerTotal("{DocumentDownloadTotalStats.download_count:0}", "text-align: right");
66  }
This class maps the publication table.
Definition: document.inc:43

◆ drawView()

DocumentTotalDownloadsView::drawView ( )

Definition at line 84 of file document_stats_view.inc.

85  {
86  $this->table->drawView();
87  }

◆ writeScript()

DocumentTotalDownloadsView::writeScript ( )

Definition at line 68 of file document_stats_view.inc.

69  {
70  $script = $this->table->writeScript();
71  $script .= <<<ENDSCRIPT
72 <script type='text/javascript' src='/components/document/js/document_manager.js'></script>
73 <script type='text/javascript'>
74 var docManager;
75 window.addEvent('domready', function()
76 {
77  docManager = new DocumentManager({$this->library->document_library_id});
78 });
79 </script>
80 ENDSCRIPT;
81  return $script;
82  }
The DocumentManager class provides the core API and management functions for uploading documents and ...

Member Data Documentation

◆ $library

DocumentTotalDownloadsView::$library

Definition at line 43 of file document_stats_view.inc.

◆ $table

DocumentTotalDownloadsView::$table

Definition at line 44 of file document_stats_view.inc.


The documentation for this class was generated from the following file: