CMS  Version 3.9
sharing_content_manager.inc
Go to the documentation of this file.
1 <?php
9 {
10  function getDefaultPage($section) { return $section->default_page; }
11 
13  {
14  // Create Mock SectionContent object
15  $content = new SectionContent();
16  $content->section_id = $section->section_id;
17  $content->identifier = $identifier;
18  return $content;
19  }
20 
22  {
23  if (!$identifier)
24  {
25  throw new FakoliException("Missing identifier");
26  }
27 
28  Fakoli::put("share_token", $identifier);
29  $page = ComponentPage::findByIdentifier('shared_view', "WHERE enabled=1");
30  $pageView = new ComponentPageView($page, "{$page->template}.tpl");
31  echo $pageView->drawView();
32  }
33 
35  {
37  }
38 }
39 
41 {
43  {
44  parent::__construct($section);
45  }
46 
47  function handlePOST()
48  {
49  }
50 
51  function drawView()
52  {
53  global $script;
54 
55  $tokens = Query::create(ShareToken, "ORDER BY created_date")->execute();
56  $table = new DataListView($tokens, "share_tokens");
57  $table->column("Token", "<a href=''>{token}</a>", true)
58  ->column("Type", "{item_type}", true)
59  ->column("Shared By", "{User.getFullName()}", true)
60  ->column("Active", "<i class='fa-fw fas fa-{active:check/times}'></i>", true, "text-align: center")
61  ->column("# Accesses", "{countAccesses()}", true, "text-align: right");
62 
63  $table->pageSize = 20;
64  $table->filter = true;
65  $table->sortable = true;
66  $table->emptyMessage = "No items have been shared";
67  $table->excelFile = "share_tokens.xls";
68 
69  $script .= $table->writeScript();
70 
71  echo "<h3>Share Tokens</h3>";
72  $table->drawView();
73  }
74 }
75 ?>
$section
Definition: event_form.inc:44
$page
Definition: help.inc:39
static findByIdentifier($identifier, $constraint="")
ComponentPageView generates the page content for a component page, substituting page fields,...
FakoliException is the base exception class for all Fakoli errors.
Definition: core.inc:53
static put($key, $obj)
Stores a value or object at the given key.
Definition: core.inc:99
getDefaultPage($section)
Returns the identifier for the default page in the section (i.e.
getAdminView($section)
Factory method to build the view class for displaying and manipulating section content for the specif...
getContent($section, $identifier)
Returns a SectionContent object for the specified section and identifier.
sendContent($section, $identifier)
Renders and sends the specified content for the given section.
Defines the interface required by a SectionContentManager.
$identifier
Definition: rss.inc:37
if(array_key_exists("HTTP_IF_MODIFIED_SINCE", $_SERVER)) $content
Definition: styles.css.inc:24