ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
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
 ilBlockGUI ()
 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 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$

@ilCtrl_IsCalledBy 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.

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

References $lng, and ilBlockGUI\setRowTemplate().

+ 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 437 of file class.ilPollBlockGUI.php.

438 {
439 include_once("./Services/Notes/classes/class.ilNoteGUI.php");
440 include_once("./Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
441
442 $refId = $this->getRefId();
443 $objectId = ilObject2::_lookupObjectId($refId);
444
446 ilCommonActionDispatcherGUI::TYPE_REPOSITORY, $refId, "poll", $objectId);
447
448
449 $comment = new ilNoteGUI();
450 $jsCall = $comment->getListCommentsJSCall($ajaxHash, "ilPoll.redrawComments(".$refId.");");
451
452 return $jsCall;
453 }
$comment
Definition: buildRTE.php:83
getRefId()
Get Ref Id (only used if isRepositoryObject() is true).
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.
Notes GUI class.
static _lookupObjectId($a_ref_id)
lookup object id

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

Referenced by fillRow().

+ 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.

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 }
global $ilCtrl
Definition: ilias.php:18
$cmd
Definition: sahs_server.php:35

References $cmd, and $ilCtrl.

◆ fillRow()

ilPollBlockGUI::fillRow (   $a_poll)

Reimplemented from ilBlockGUI.

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

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 {
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 $this->tpl->setVariable("URL_IMAGE", $img);
328 }
329
330 if ($this->poll_block->showComments()) {
331 $this->tpl->setCurrentBlock("comment_link");
332 $this->tpl->setVariable("LANG_COMMENTS", $lng->txt('poll_comments'));
333 $this->tpl->setVariable("COMMENT_JSCALL", $this->commentJSCall());
334 $this->tpl->setVariable("COMMENTS_COUNT_ID", $this->getRefId());
335
336 $comments_count = $this->getNumberOfComments($this->getRefId());
337
338 if($comments_count > 0)
339 {
340 $this->tpl->setVariable("COMMENTS_COUNT", "(".$comments_count.")");
341 }
342
343 if(!self::$js_init)
344 {
345 $redraw_url = $ilCtrl->getLinkTarget($this, "getNumberOfCommentsForRedraw",
346 "", true, false);
347 $this->tpl->setVariable("COMMENTS_REDRAW_URL", $redraw_url);
348
349 $tpl->addJavaScript("Modules/Poll/js/ilPoll.js");
350 self::$js_init = true;
351 }
352 }
353
354 }
global $tpl
Definition: ilias.php:8
const IL_CAL_UNIX
static getInstanceByType($a_type, $a_id)
Get type instance.
static setUseRelativeDates($a_status)
set use relative dates
static formatDate(ilDateTime $date)
Format a date @access public.
static useRelativeDates()
check if relative dates are used
@classDescription Date and time handling
const SHOW_RESULTS_AS_PIECHART
getRepositoryObjectGUIName()
Get repository object GUI name.
getNumberOfComments($ref_id)
Get comment count.
commentJSCall()
Builds JavaScript Call to open CommentLayer via html link.
static getInstance()
Factory.
static sortArray($array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
global $ilUser
Definition: imgupload.php:15

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

+ Here is the call graph for this function:

◆ getBlockType()

static ilPollBlockGUI::getBlockType ( )
static

Get block type.

Returns
string Block type.

Reimplemented from ilBlockGUI.

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

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

References $block_type.

◆ getHTML()

ilPollBlockGUI::getHTML ( )

Get block HTML code.

Reimplemented from ilBlockGUI.

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

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

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

+ 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 480 of file class.ilPollBlockGUI.php.

481 {
482 include_once("./Services/Notes/classes/class.ilNote.php");
483
485 $number = ilNote::_countNotesAndComments($obj_id);
486
487 if(count($number) == 0)
488 {
489 return 0;
490 }
491
492 return $number[$obj_id][IL_NOTE_PUBLIC];
493 }
const IL_NOTE_PUBLIC
Definition: class.ilNote.php:5
static _countNotesAndComments($a_rep_obj_id, $a_sub_obj_id=null)
Get all notes related to a specific object.
$ref_id
Definition: sahs_server.php:39

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

Referenced by fillRow(), and getNumberOfCommentsForRedraw().

+ 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 458 of file class.ilPollBlockGUI.php.

459 {
460 $number = $this->getNumberOfComments($_GET["poll_id"]);
461
462 if($number > 0)
463 {
464 echo "(".$number.")";
465 }
466 else
467 {
468 echo "";
469 }
470
471 exit();
472 }
$_GET["client_id"]
exit
Definition: login.php:54

References $_GET, exit, and getNumberOfComments().

+ 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.

64 {
65 return "ilobjpollgui";
66 }

Referenced by fillRow(), and getHTML().

+ Here is the caller graph for this function:

◆ getScreenMode()

static ilPollBlockGUI::getScreenMode ( )
static

Get Screen Mode for current command.

Reimplemented from ilBlockGUI.

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

72 {
73 return IL_SCREEN_SIDE;
74 }
const IL_SCREEN_SIDE

References IL_SCREEN_SIDE.

◆ isRepositoryObject()

static ilPollBlockGUI::isRepositoryObject ( )
static

Is block of repository object?

Returns
string Block type.

Reimplemented from ilBlockGUI.

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.

80 {
81 $this->setBlockId($a_block->getId());
82 $this->poll_block = $a_block;
83 }
setBlockId($a_block_id=0)
Set Block Id.

References ilBlockGUI\setBlockId().

+ 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.

Referenced by getBlockType().

◆ $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: