ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilMDCopyrightUsageGUI.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
12 {
13  const DEFAULT_CMD = 'showUsageTable';
14 
19  protected $entry_id;
20 
24  protected $tpl = null;
25 
29  protected $ctrl = null;
30 
34  protected $lng = null;
35 
39  protected $tabs = null;
40 
45  public function __construct(int $a_entry_id)
46  {
47  global $DIC;
48 
49  $this->tpl = $DIC->ui()->mainTemplate();
50 
51  $this->ctrl = $DIC->ctrl();
52  $this->lng = $DIC->language();
53  $this->tabs = $DIC->tabs();
54 
55  $this->entry_id = $a_entry_id;
56  }
57 
61  public function executeCommand()
62  {
63  // save usage id for all request
64  $this->ctrl->saveParameter($this, 'entry_id');
65 
66  $this->setTabs();
67  $next_class = $this->ctrl->getNextClass($this);
68  switch ($this->ctrl->getNextClass($this)) {
69  case 'ilpublicuserprofilegui':
70  $profile_gui = new ilPublicUserProfileGUI(ilUtil::stripSlashes($_GET['user']));
71  $profile_gui->setBackUrl(
72  $this->ctrl->getLinkTarget($this, self::DEFAULT_CMD)
73  );
74  $html = $this->ctrl->forwardCommand($profile_gui);
75  $this->tpl->setContent($html);
76  break;
77 
78  default:
79  $cmd = $this->ctrl->getCmd(self::DEFAULT_CMD);
80  $this->$cmd();
81  break;
82  }
83  }
84 
88  public function showUsageTable()
89  {
90  global $DIC;
91 
92  $tabs = $DIC->tabs();
93  $lng = $DIC->language();
94 
95  ilUtil::sendInfo($this->lng->txt("meta_info_only_repository_objects"));
96 
97  $table_gui = new ilMDCopyrightUsageTableGUI(
98  $this,
99  self::DEFAULT_CMD,
100  $this->entry_id
101  );
102  $table_gui->setFilterCommand("applyUsageFilter");
103  $table_gui->setResetCommand("resetUsageFilter");
104  $table_gui->init();
105  $table_gui->parse();
106 
107  $this->tpl->setContent($table_gui->getHTML());
108  }
109 
113  public function getEntryId()
114  {
115  return $this->entry_id;
116  }
117 
121  protected function applyUsageFilter()
122  {
123  $table_gui = new ilMDCopyrightUsageTableGUI(
124  $this,
125  self::DEFAULT_CMD,
126  $this->entry_id
127  );
128  $table_gui->init();
129  $table_gui->resetOffset(); // sets record offset to 0 (first page)
130  $table_gui->writeFilterToSession(); // writes filter to session
131 
132  $this->ctrl->redirect($this, self::DEFAULT_CMD);
133  }
134 
138  protected function resetUsageFilter()
139  {
140  $table_gui = new ilMDCopyrightUsageTableGUI(
141  $this,
142  self::DEFAULT_CMD,
143  $this->entry_id
144  );
145  $table_gui->init();
146  $table_gui->resetOffset(); // sets record offest to 0 (first page)
147  $table_gui->resetFilter(); // clears filter
148 
149  $this->ctrl->redirect($this, self::DEFAULT_CMD);
150  }
151 
155  protected function setTabs()
156  {
157  $this->tabs->clearTargets();
158  $this->tabs->setBackTarget(
159  $this->lng->txt('back'),
160  $this->ctrl->getParentReturn($this)
161  );
162  }
163 }
global $DIC
Definition: saml.php:7
__construct(int $a_entry_id)
ilMDCopyrightUsageGUI constructor.
$_GET["client_id"]
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
GUI class for public user profile presentation.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
$html
Definition: example_001.php:87