ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilPollBlockGUI Class Reference

BlockGUI class for polls. More...

+ Inheritance diagram for ilPollBlockGUI:
+ Collaboration diagram for ilPollBlockGUI:

Public Member Functions

 __construct ()
 Constructor. More...
 
 setBlock ($a_block)
 Do most of the initialisation. More...
 
 executeCommand ()
 execute command More...
 
 fillRow ($a_poll)
 
 getHTML ()
 Get block HTML code. More...
 
 getNumberOfCommentsForRedraw ()
 Returns comment count for JS Redraw. More...
 
 getNumberOfComments ($ref_id)
 Get comment count. More...
 
- Public Member Functions inherited from ilBlockGUI
 __construct ()
 Constructor. More...
 
 addHeaderLink ($a_href, $a_text, $status=true)
 
 getHeaderLinks ()
 
 setData ($a_data)
 Set Data. More...
 
 getData ()
 Get Data. More...
 
 setBigMode ($a_bigmode)
 Set Big Mode. More...
 
 getBigMode ()
 Get Big Mode. More...
 
 setBlockId ($a_block_id=0)
 Set Block Id. More...
 
 getBlockId ()
 Get Block Id. More...
 
 setAvailableDetailLevels ($a_max, $a_min=0)
 Set Available Detail Levels. More...
 
 setCurrentDetailLevel ($a_currentdetaillevel)
 Set Current Detail Level. More...
 
 setGuiObject (&$a_gui_object)
 Set GuiObject. More...
 
 getGuiObject ()
 Get GuiObject. More...
 
 getCurrentDetailLevel ()
 Get Current Detail Level. More...
 
 setTitle ($a_title)
 Set Title. More...
 
 getTitle ()
 Get Title. More...
 
 setImage ($a_image)
 Set Image. More...
 
 getImage ()
 Get Image. More...
 
 setOffset ($a_offset)
 Set Offset. More...
 
 getOffset ()
 Get Offset. More...
 
 correctOffset ()
 
 setLimit ($a_limit)
 Set Limit. More...
 
 getLimit ()
 Get Limit. More...
 
 setEnableEdit ($a_enableedit)
 Set EnableEdit. More...
 
 getEnableEdit ()
 Get EnableEdit. More...
 
 setRepositoryMode ($a_repositorymode)
 Set RepositoryMode. More...
 
 getRepositoryMode ()
 Get RepositoryMode. More...
 
 setFooterInfo ($a_footerinfo, $a_hide_and_icon=false)
 Set Footer Info. More...
 
 getFooterInfo ($a_hide_and_icon=false)
 Get Footer Info. More...
 
 setSubtitle ($a_subtitle)
 Set Subtitle. More...
 
 getSubtitle ()
 Get Subtitle. More...
 
 setRefId ($a_refid)
 Set Ref Id (only used if isRepositoryObject() is true). More...
 
 getRefId ()
 Get Ref Id (only used if isRepositoryObject() is true). More...
 
 setAdminCommands ($a_admincommands)
 Set Administration Commmands. More...
 
 getAdminCommands ()
 Get Administration Commmands. More...
 
 setColSpan ($a_colspan)
 Set Columns Span. More...
 
 getColSpan ()
 Get Columns Span. More...
 
 setEnableDetailRow ($a_enabledetailrow)
 Set EnableDetailRow. More...
 
 getEnableDetailRow ()
 Get EnableDetailRow. More...
 
 setEnableNumInfo ($a_enablenuminfo)
 Set Enable Item Number Info. More...
 
 getEnableNumInfo ()
 Get Enable Item Number Info. More...
 
 setProperties ($a_properties)
 This function is supposed to be used for block type specific properties, that should be inherited through ilColumnGUI->setBlockProperties. More...
 
 getProperty ($a_property)
 
 setProperty ($a_property, $a_value)
 
 setRowTemplate ($a_rowtemplatename, $a_rowtemplatedir="")
 Set Row Template Name. More...
 
 getNavParameter ()
 
 getDetailParameter ()
 
 getConfigParameter ()
 
 getMoveParameter ()
 
 getRowTemplateName ()
 Get Row Template Name. More...
 
 getRowTemplateDir ()
 Get Row Template Directory. More...
 
 addBlockCommand ($a_href, $a_text, $a_target="", $a_img="", $a_right_aligned=false, $a_checked=false, $a_html="")
 Add Block Command. More...
 
 getBlockCommands ()
 Get Block commands. More...
 
 addHeaderCommand ($a_href, $a_text, $a_as_close=false)
 Add Header Block Command. More...
 
 getHeaderCommands ()
 Get Header Block commands. More...
 
 addFooterLink ($a_text, $a_href="", $a_onclick="", $a_block_id="", $a_top=false, $a_omit_separator=false, $a_checked=false)
 Add a footer text/link. More...
 
 getFooterLinks ()
 Get footer links. More...
 
 clearFooterLinks ()
 Clear footer links. More...
 
 handleDetailLevel ()
 Handle read/write current detail level. More...
 
 getHTML ()
 Handle config status. More...
 
 fillHeaderCommands ()
 Fill header commands block. More...
 
 fillHeaderTitleBlock ()
 Fill header title block (title and. More...
 
 setDataSection ($a_content)
 Call this from overwritten fillDataSection(), if standard row based data is not used. More...
 
 fillDataSection ()
 Standard implementation for row based data. More...
 
 fillRow ($a_set)
 
 fillFooter ()
 
 fillPreviousNext ()
 Fill previous/next row. More...
 
 setPreviousNextLinks ()
 Get previous/next linkbar. More...
 
 fillFooterLinks ($a_top=false, $a_numinfo="")
 Fill footer links. More...
 
 fillDetailRow ()
 Fill Detail Setting Row. More...
 

Static Public Member Functions

static getBlockType ()
 Get block type. More...
 
static isRepositoryObject ()
 Is block of repository object? More...
 
static getScreenMode ()
 Get Screen Mode for current command. More...
 
- Static Public Member Functions inherited from ilBlockGUI
static getBlockType ()
 
static isRepositoryObject ()
 
static getScreenMode ()
 Get Screen Mode for current command. More...
 

Static Public Attributes

static $block_type = "poll"
 
static $js_init = false
 

Protected Member Functions

 getRepositoryObjectGUIName ()
 Get repository object GUI name. More...
 
- Protected Member Functions inherited from ilBlockGUI
 fillRowColor ($a_placeholder="CSS_ROW")
 
 preloadData (array $data)
 Can be overwritten in subclasses. More...
 

Protected Attributes

 $poll_block
 
- Protected Attributes inherited from ilBlockGUI
 $data = array()
 
 $colspan = 1
 
 $enablenuminfo = true
 
 $detail_min = 0
 
 $detail_max = 0
 
 $bigmode = false
 
 $footer_links = array()
 
 $block_id = 0
 
 $header_commands = array()
 
 $allow_moving = true
 
 $move = array("left" => false, "right" => false, "up" => false, "down" => false)
 
 $enabledetailrow = true
 
 $header_links = array()
 
 $footerinfo = false
 
 $footerinfo_icon = false
 
 $block_commands = array()
 
 $max_count = false
 
 $close_command = false
 
 $image = false
 
 $property = false
 
 $nav_value = ""
 
 $css_row = ""
 
 $dropdown
 

Private Member Functions

 commentJSCall ()
 Builds JavaScript Call to open CommentLayer via html link. More...
 

Detailed Description

BlockGUI class for polls.

Author
Jörg Lützenkirchen
Version
$Id$

ilPollBlockGUI: ilColumnGUI

Definition at line 17 of file class.ilPollBlockGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilPollBlockGUI::__construct ( )

Constructor.

Definition at line 28 of file class.ilPollBlockGUI.php.

References $lng, and ilBlockGUI\setRowTemplate().

29  {
30  global $lng;
31 
32  parent::__construct();
33 
34  $lng->loadLanguageModule("poll");
35  $this->setRowTemplate("tpl.block.html", "Modules/Poll");
36  }
global $lng
Definition: privfeed.php:17
setRowTemplate($a_rowtemplatename, $a_rowtemplatedir="")
Set Row Template Name.
+ Here is the call graph for this function:

Member Function Documentation

◆ commentJSCall()

ilPollBlockGUI::commentJSCall ( )
private

Builds JavaScript Call to open CommentLayer via html link.

Returns
string jsCall

Definition at line 438 of file class.ilPollBlockGUI.php.

References $comment, ilObject2\_lookupObjectId(), ilCommonActionDispatcherGUI\buildAjaxHash(), ilBlockGUI\getRefId(), and ilCommonActionDispatcherGUI\TYPE_REPOSITORY.

Referenced by fillRow().

439  {
440  include_once("./Services/Notes/classes/class.ilNoteGUI.php");
441  include_once("./Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
442 
443  $refId = $this->getRefId();
444  $objectId = ilObject2::_lookupObjectId($refId);
445 
447  ilCommonActionDispatcherGUI::TYPE_REPOSITORY, $refId, "poll", $objectId);
448 
449 
450  $comment = new ilNoteGUI();
451  $jsCall = $comment->getListCommentsJSCall($ajaxHash, "ilPoll.redrawComments(".$refId.");");
452 
453  return $jsCall;
454  }
static _lookupObjectId($a_ref_id)
Notes GUI class.
static buildAjaxHash($a_node_type, $a_node_id, $a_obj_type, $a_obj_id, $a_sub_type=null, $a_sub_id=null)
Build ajax hash.
$comment
Definition: buildRTE.php:83
getRefId()
Get Ref Id (only used if isRepositoryObject() is true).
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilPollBlockGUI::executeCommand ( )

execute command

Definition at line 88 of file class.ilPollBlockGUI.php.

References $cmd, and $ilCtrl.

89  {
90  global $ilCtrl;
91 
92  $next_class = $ilCtrl->getNextClass();
93  $cmd = $ilCtrl->getCmd("getHTML");
94 
95  switch ($next_class)
96  {
97  default:
98  return $this->$cmd();
99  }
100  }
$cmd
Definition: sahs_server.php:35
global $ilCtrl
Definition: ilias.php:18

◆ fillRow()

ilPollBlockGUI::fillRow (   $a_poll)

Definition at line 102 of file class.ilPollBlockGUI.php.

References $_SESSION, $chart, $error, $ilCtrl, $ilUser, $img, $info, $legend, $lng, $total, $tpl, $url, array, commentJSCall(), ilDatePresentation\formatDate(), ilProgressBar\getInstance(), ilChart\getInstanceByType(), getNumberOfComments(), ilBlockGUI\getRefId(), getRepositoryObjectGUIName(), IL_CAL_UNIX, ilDatePresentation\setUseRelativeDates(), ilObjPoll\SHOW_RESULTS_AS_PIECHART, ilWACSignedPath\signFile(), ilUtil\sortArray(), and ilDatePresentation\useRelativeDates().

103  {
104  global $ilCtrl, $lng, $ilUser, $tpl;
105 
106 
107  // handle messages
108 
109  $mess = $this->poll_block->getMessage($ilUser->getId());
110  if($mess)
111  {
112  $this->tpl->setVariable("TXT_QUESTION", $mess);
113  return;
114  }
115 
116 
117  // nested form problem
118  if(!$_SESSION["il_cont_admin_panel"])
119  {
120  // vote
121 
122  if($this->poll_block->mayVote($ilUser->getId()))
123  {
124  $this->tpl->setCurrentBlock("mode_info_bl");
125  if($this->poll_block->getPoll()->getNonAnonymous())
126  {
127  $mode_info = $lng->txt("poll_non_anonymous_warning");
128  }
129  else
130  {
131  $mode_info = $lng->txt("poll_anonymous_warning");
132  }
133  $this->tpl->setVariable("MODE_INFO", $mode_info);
134  $this->tpl->parseCurrentBlock();
135 
136  $is_multi_answer = ($this->poll_block->getPoll()->getMaxNumberOfAnswers() > 1);
137 
138  if(isset($_SESSION["last_poll_vote"][$this->poll_block->getPoll()->getId()]))
139  {
140  $last_vote = $_SESSION["last_poll_vote"][$this->poll_block->getPoll()->getId()];
141  unset($_SESSION["last_poll_vote"][$this->poll_block->getPoll()->getId()]);
142 
143  if($is_multi_answer)
144  {
145  $error = sprintf($lng->txt("poll_vote_error_multi"),
146  $this->poll_block->getPoll()->getMaxNumberOfAnswers());
147  }
148  else
149  {
150  $error = $lng->txt("poll_vote_error_single");
151  }
152 
153  $this->tpl->setCurrentBlock("error_bl");
154  $this->tpl->setVariable("FORM_ERROR", $error);
155  $this->tpl->parseCurrentBlock();
156  }
157 
158  $this->tpl->setCurrentBlock("answer");
159  foreach($a_poll->getAnswers() as $item)
160  {
161  if(!$is_multi_answer)
162  {
163  $this->tpl->setVariable("ANSWER_INPUT", "radio");
164  $this->tpl->setVariable("ANSWER_NAME", "aw");
165  }
166  else
167  {
168  $this->tpl->setVariable("ANSWER_INPUT", "checkbox");
169  $this->tpl->setVariable("ANSWER_NAME", "aw[]");
170 
171  if(is_array($last_vote) && in_array($item["id"], $last_vote))
172  {
173  $this->tpl->setVariable("ANSWER_STATUS", 'checked="checked"');
174  }
175  }
176  $this->tpl->setVariable("VALUE_ANSWER", $item["id"]);
177  $this->tpl->setVariable("TXT_ANSWER_VOTE", nl2br($item["answer"]));
178  $this->tpl->parseCurrentBlock();
179  }
180 
181  $ilCtrl->setParameterByClass($this->getRepositoryObjectGUIName(),
182  "ref_id", $this->getRefId());
183  $url = $ilCtrl->getLinkTargetByClass(array("ilrepositorygui", $this->getRepositoryObjectGUIName()),
184  "vote");
185  $ilCtrl->clearParametersByClass($this->getRepositoryObjectGUIName());
186 
187  $url .= "#poll".$a_poll->getID();
188 
189  $this->tpl->setVariable("URL_FORM", $url);
190  $this->tpl->setVariable("CMD_FORM", "vote");
191  $this->tpl->setVariable("TXT_SUBMIT", $lng->txt("poll_vote"));
192 
193  if($this->poll_block->getPoll()->getVotingPeriod())
194  {
195  $this->tpl->setVariable("TXT_VOTING_PERIOD",
196  sprintf($lng->txt("poll_voting_period_info"),
197  ilDatePresentation::formatDate(new ilDateTime($this->poll_block->getPoll()->getVotingPeriodEnd(), IL_CAL_UNIX))));
198  }
199  }
200 
201 
202  // result
203  if ($this->poll_block->maySeeResults($ilUser->getId()))
204  {
205  if (!$this->poll_block->mayNotResultsYet($ilUser->getId()))
206  {
207  $answers = array();
208  foreach ($a_poll->getAnswers() as $item)
209  {
210  $answers[$item["id"]] = $item["answer"];
211  }
212 
213  $perc = $this->poll_block->getPoll()->getVotePercentages();
214  $total = $perc["total"];
215  $perc = $perc["perc"];
216 
217  $this->tpl->setVariable("TOTAL_ANSWERS", sprintf($lng->txt("poll_population"), $total));
218 
219  if($total)
220  {
221  // sort results by votes / original position
222  if ($this->poll_block->getPoll()->getSortResultByVotes())
223  {
224  $order = array_keys(ilUtil::sortArray($perc, "abs", "desc", true, true));
225 
226  foreach (array_keys($answers) as $answer_id)
227  {
228  if (!in_array($answer_id, $order))
229  {
230  $order[] = $answer_id;
231  }
232  }
233  }
234  else
235  {
236  $order = array_keys($answers);
237  }
238 
239  // pie chart
240  if ($this->poll_block->showResultsAs() == ilObjPoll::SHOW_RESULTS_AS_PIECHART)
241  {
242 
243  include_once("./Services/Chart/classes/class.ilChart.php");
244 
245  $chart = ilChart::getInstanceByType(ilCHart::TYPE_PIE, "poll_results_pie_". $this->getRefId());
246  $chart->setSize("100%", 200);
247  $chart->setAutoResize(true);
248 
249  $chart_data = $chart->getDataInstance();
250 
251  foreach ($order as $answer_id)
252  {
253  $chart_data->addPoint(
254  round($perc[$answer_id]["perc"]),
255  nl2br($answers[$answer_id])
256  );
257  }
258 
259  // disable legend, use inner labels - currently not preferred
260  // $chart_data->setLabelRadius(0.8);
261 
262  $chart->addData($chart_data);
263 
264  $pie_legend_id = "poll_legend_".$this->getRefId();
265  $legend = new ilChartLegend();
266  $legend->setContainer($pie_legend_id);
267  $chart->setLegend($legend);
268 
269  $this->tpl->setVariable("PIE_LEGEND_ID", $pie_legend_id);
270  $this->tpl->setVariable("PIE_CHART", $chart->getHTML());
271  }
272  // bar chart
273  else
274  {
275  include_once "Services/UIComponent/ProgressBar/classes/class.ilProgressBar.php";
276 
277  $this->tpl->setCurrentBlock("answer_result");
278  foreach ($order as $answer_id)
279  {
280  $pbar = ilProgressBar::getInstance();
281  $pbar->setCurrent(round($perc[$answer_id]["perc"]));
282  $this->tpl->setVariable("PERC_ANSWER_RESULT", $pbar->render());
283  $this->tpl->setVariable("TXT_ANSWER_RESULT", nl2br($answers[$answer_id]));
284  $this->tpl->parseCurrentBlock();
285  }
286  }
287  }
288  }
289  else
290  {
293  $end = $this->poll_block->getPoll()->getVotingPeriodEnd();
296 
297  // #14607
298  $info = "";
299  if($this->poll_block->getPoll()->hasUserVoted($ilUser->getId()))
300  {
301  $info .= $lng->txt("poll_block_message_already_voted")." ";
302  }
303 
304  $this->tpl->setVariable("TOTAL_ANSWERS", $info.
305  sprintf($lng->txt("poll_block_results_available_on"), $end));
306  }
307  }
308  else if($this->poll_block->getPoll()->hasUserVoted($ilUser->getId()))
309  {
310  $this->tpl->setVariable("TOTAL_ANSWERS", $lng->txt("poll_block_message_already_voted"));
311  }
312  }
313 
314 
315  $this->tpl->setVariable("ANCHOR_ID", $a_poll->getID());
316  $this->tpl->setVariable("TXT_QUESTION", nl2br(trim($a_poll->getQuestion())));
317 
318  $desc = trim($a_poll->getDescription());
319  if($desc)
320  {
321  $this->tpl->setVariable("TXT_DESC", nl2br($desc));
322  }
323 
324  $img = $a_poll->getImageFullPath();
325  if($img)
326  {
327  require_once('./Services/WebAccessChecker/classes/class.ilWACSignedPath.php');
328  $this->tpl->setVariable("URL_IMAGE", ilWACSignedPath::signFile($img));
329  }
330 
331  if ($this->poll_block->showComments()) {
332  $this->tpl->setCurrentBlock("comment_link");
333  $this->tpl->setVariable("LANG_COMMENTS", $lng->txt('poll_comments'));
334  $this->tpl->setVariable("COMMENT_JSCALL", $this->commentJSCall());
335  $this->tpl->setVariable("COMMENTS_COUNT_ID", $this->getRefId());
336 
337  $comments_count = $this->getNumberOfComments($this->getRefId());
338 
339  if($comments_count > 0)
340  {
341  $this->tpl->setVariable("COMMENTS_COUNT", "(".$comments_count.")");
342  }
343 
344  if(!self::$js_init)
345  {
346  $redraw_url = $ilCtrl->getLinkTarget($this, "getNumberOfCommentsForRedraw",
347  "", true, false);
348  $this->tpl->setVariable("COMMENTS_REDRAW_URL", $redraw_url);
349 
350  $tpl->addJavaScript("Modules/Poll/js/ilPoll.js");
351  self::$js_init = true;
352  }
353  }
354 
355  }
$error
Definition: Error.php:17
commentJSCall()
Builds JavaScript Call to open CommentLayer via html link.
$_SESSION["AccountId"]
Chart legend.
getNumberOfComments($ref_id)
Get comment count.
const SHOW_RESULTS_AS_PIECHART
getRepositoryObjectGUIName()
Get repository object GUI name.
static setUseRelativeDates($a_status)
set use relative dates
$url
Definition: shib_logout.php:72
const IL_CAL_UNIX
static sortArray($array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
$total
Definition: Utf8Test.php:87
static useRelativeDates()
check if relative dates are used
global $tpl
Definition: ilias.php:8
global $ilCtrl
Definition: ilias.php:18
$info
Definition: example_052.php:80
static getInstance()
Factory.
static formatDate(ilDateTime $date)
Format a date public.
Date and time handling
$ilUser
Definition: imgupload.php:18
static signFile($path_to_file)
Create styles array
The data for the language used.
getRefId()
Get Ref Id (only used if isRepositoryObject() is true).
global $lng
Definition: privfeed.php:17
static getInstanceByType($a_type, $a_id)
Get type instance.
+ Here is the call graph for this function:

◆ getBlockType()

static ilPollBlockGUI::getBlockType ( )
static

Get block type.

Returns
string Block type.

Definition at line 43 of file class.ilPollBlockGUI.php.

44  {
45  return self::$block_type;
46  }

◆ getHTML()

ilPollBlockGUI::getHTML ( )

Get block HTML code.

Definition at line 360 of file class.ilPollBlockGUI.php.

References $ilCtrl, $ilUser, $lng, ilBlockGUI\addBlockCommand(), array, ilBlockGUI\getRefId(), getRepositoryObjectGUIName(), ilNotification\hasNotification(), ilBlockGUI\setData(), ilBlockGUI\setTitle(), and ilNotification\TYPE_POLL.

361  {
362  global $ilCtrl, $lng, $ilAccess, $ilUser;
363 
364  $this->poll_block->setRefId($this->getRefId());
365  $this->may_write = $ilAccess->checkAccess("write", "", $this->getRefId());
366  $this->has_content = $this->poll_block->hasAnyContent($ilUser->getId(), $this->getRefId());
367 
368  if(!$this->may_write && !$this->has_content)
369  {
370  return "";
371  }
372 
373  $poll_obj = $this->poll_block->getPoll();
374  $this->setTitle($poll_obj->getTitle());
375  $this->setData(array($poll_obj));
376 
377  $ilCtrl->setParameterByClass($this->getRepositoryObjectGUIName(),
378  "ref_id", $this->getRefId());
379 
380  if(!$this->poll_block->getMessage($ilUser->getId()))
381  {
382  // notification
383  include_once "./Services/Notification/classes/class.ilNotification.php";
384  if(ilNotification::hasNotification(ilNotification::TYPE_POLL, $ilUser->getId(), $this->poll_block->getPoll()->getId()))
385  {
386  $this->addBlockCommand(
387  $ilCtrl->getLinkTargetByClass(array("ilrepositorygui", $this->getRepositoryObjectGUIName()),
388  "unsubscribe"),
389  $lng->txt("poll_notification_unsubscribe"));
390  }
391  else
392  {
393  $this->addBlockCommand(
394  $ilCtrl->getLinkTargetByClass(array("ilrepositorygui", $this->getRepositoryObjectGUIName()),
395  "subscribe"),
396  $lng->txt("poll_notification_subscribe"));
397  }
398  }
399 
400  if ($this->may_write)
401  {
402  // edit
403  $this->addBlockCommand(
404  $ilCtrl->getLinkTargetByClass(array("ilrepositorygui", $this->getRepositoryObjectGUIName()),
405  "render"),
406  $lng->txt("edit_content"));
407  $this->addBlockCommand(
408  $ilCtrl->getLinkTargetByClass(array("ilrepositorygui", $this->getRepositoryObjectGUIName()),
409  "edit"),
410  $lng->txt("settings"));
411 
412  /* delete (#10993 - see ilBlockGUI)
413  $parent_id = $tree->getParentId($this->getRefId());
414  $type = ilObject::_lookupType($parent_id, true);
415  $class = $objDefinition->getClassName($type);
416  if($class)
417  {
418  $class = "ilobj".strtolower($class)."gui";
419  $ilCtrl->setParameterByClass($class, "ref_id", $parent_id);
420  $ilCtrl->setParameterByClass($class, "item_ref_id", $this->getRefId());
421  $this->addBlockCommand(
422  $ilCtrl->getLinkTargetByClass($class, "delete"),
423  $lng->txt("delete"));
424  }
425  */
426  }
427 
428  $ilCtrl->clearParametersByClass($this->getRepositoryObjectGUIName());
429 
430  return parent::getHTML();
431  }
static hasNotification($type, $user_id, $id)
Check notification status for object and user.
getRepositoryObjectGUIName()
Get repository object GUI name.
addBlockCommand($a_href, $a_text, $a_target="", $a_img="", $a_right_aligned=false, $a_checked=false, $a_html="")
Add Block Command.
global $ilCtrl
Definition: ilias.php:18
setTitle($a_title)
Set Title.
setData($a_data)
Set Data.
$ilUser
Definition: imgupload.php:18
Create styles array
The data for the language used.
getRefId()
Get Ref Id (only used if isRepositoryObject() is true).
global $lng
Definition: privfeed.php:17
+ Here is the call graph for this function:

◆ getNumberOfComments()

ilPollBlockGUI::getNumberOfComments (   $ref_id)

Get comment count.

Parameters
int$ref_id
Returns
int

Definition at line 481 of file class.ilPollBlockGUI.php.

References $ref_id, ilNote\_countNotesAndComments(), ilObject2\_lookupObjectId(), and IL_NOTE_PUBLIC.

Referenced by fillRow(), and getNumberOfCommentsForRedraw().

482  {
483  include_once("./Services/Notes/classes/class.ilNote.php");
484 
486  $number = ilNote::_countNotesAndComments($obj_id);
487 
488  if(count($number) == 0)
489  {
490  return 0;
491  }
492 
493  return $number[$obj_id][IL_NOTE_PUBLIC];
494  }
static _countNotesAndComments($a_rep_obj_id, $a_sub_obj_id=null)
Get all notes related to a specific object.
static _lookupObjectId($a_ref_id)
const IL_NOTE_PUBLIC
Definition: class.ilNote.php:5
$ref_id
Definition: sahs_server.php:39
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getNumberOfCommentsForRedraw()

ilPollBlockGUI::getNumberOfCommentsForRedraw ( )

Returns comment count for JS Redraw.

Definition at line 459 of file class.ilPollBlockGUI.php.

References $_GET, exit, and getNumberOfComments().

460  {
461  $number = $this->getNumberOfComments($_GET["poll_id"]);
462 
463  if($number > 0)
464  {
465  echo "(".$number.")";
466  }
467  else
468  {
469  echo "";
470  }
471 
472  exit();
473  }
$_GET["client_id"]
getNumberOfComments($ref_id)
Get comment count.
+ Here is the call graph for this function:

◆ getRepositoryObjectGUIName()

ilPollBlockGUI::getRepositoryObjectGUIName ( )
protected

Get repository object GUI name.

Returns
string

Definition at line 63 of file class.ilPollBlockGUI.php.

Referenced by fillRow(), and getHTML().

64  {
65  return "ilobjpollgui";
66  }
+ Here is the caller graph for this function:

◆ getScreenMode()

static ilPollBlockGUI::getScreenMode ( )
static

Get Screen Mode for current command.

Definition at line 71 of file class.ilPollBlockGUI.php.

References IL_SCREEN_SIDE.

72  {
73  return IL_SCREEN_SIDE;
74  }
const IL_SCREEN_SIDE

◆ isRepositoryObject()

static ilPollBlockGUI::isRepositoryObject ( )
static

Is block of repository object?

Returns
string Block type.

Definition at line 53 of file class.ilPollBlockGUI.php.

54  {
55  return true;
56  }

◆ setBlock()

ilPollBlockGUI::setBlock (   $a_block)

Do most of the initialisation.

Definition at line 79 of file class.ilPollBlockGUI.php.

References ilBlockGUI\setBlockId().

80  {
81  $this->setBlockId($a_block->getId());
82  $this->poll_block = $a_block;
83  }
setBlockId($a_block_id=0)
Set Block Id.
+ Here is the call graph for this function:

Field Documentation

◆ $block_type

ilPollBlockGUI::$block_type = "poll"
static

Definition at line 19 of file class.ilPollBlockGUI.php.

◆ $js_init

ilPollBlockGUI::$js_init = false
static

Definition at line 23 of file class.ilPollBlockGUI.php.

◆ $poll_block

ilPollBlockGUI::$poll_block
protected

Definition at line 21 of file class.ilPollBlockGUI.php.


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