ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilObjPollGUI Class Reference

Class ilObjPollGUI. More...

+ Inheritance diagram for ilObjPollGUI:
+ Collaboration diagram for ilObjPollGUI:

Public Member Functions

 __construct ($a_id=0, $a_id_type=self::REPOSITORY_NODE_ID, $a_parent_node_id=0)
 Constructor.
 getType ()
 Functions that must be overwritten.
 setTabs ()
 create tabs (repository/workspace switch)
 executeCommand ()
 execute command
 render ($a_form=null)
 Render object context.
 saveQuestion ()
 showParticipants ()
 confirmDeleteAllVotes ()
 deleteAllVotes ()
 vote ()
 getHTML ()
 return user view
 addLocatorItems ()
 Functions to be overwritten.
 _goto ($a_target)
 Deep link.
- Public Member Functions inherited from ilObject2GUI
 delete ()
 Display delete confirmation form (repository/workspace switch)
 confirmedDelete ()
 Delete objects (repository/workspace switch)
 withReferences ()
 Final/Private declaration of unchanged parent methods.
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui
 getCreationMode ()
 get creation mode
 isVisible ()
 trash ()
 undelete ()
 cancelDelete ()
 removeFromSystem ()
 cloneAll ()
 view ()
 view object content (repository/workspace switch)
 create ()
 Deleted in ilObject.
 save ()
 edit ()
 update ()
 cancel ()
 importFile ()
 Import.
- Public Member Functions inherited from ilObjectGUI
 ilObjectGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor public.
 getAdminTabs (&$tabs_gui)
 administration tabs show only permissions and trash folder
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled
 cancelDeleteObject ()
 cancel deletion of object
 cancelObject ($in_rep=false)
 cancel action and go back to previous page public
 createObject ()
 create new object form
 cancelCreation ()
 cancel create action and go back to repository parent
 saveObject ()
 save object
 editObject ()
 edit object
 updateObject ()
 updates object entry in object_data
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g.
 isVisible ($a_ref_id, $a_type)
 viewObject ()
 list childs of current object
 deleteObject ($a_error=false)
 Display deletion confirmation screen.
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI.

Protected Member Functions

 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook.
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form.
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields.
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object.
 initQuestionForm ($a_read_only=false)
- Protected Member Functions inherited from ilObject2GUI
 afterConstructor ()
 Do anything that should be done after constructor in here.
 assignObject ()
 create object instance as internal property (repository/workspace switch)
 getAccessHandler ()
 Get access handler.
 setLocator ()
 set Locator
 deleteConfirmation ()
 Display delete confirmation form (workspace specific)
 deleteConfirmedObjects ()
 Delete objects (workspace specific)
 prepareOutput ()
 prepare output
 setTitleAndDescription ()
 called by prepare output
 showUpperIcon ()
 omitLocator ($a_omit=true)
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g.
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command
 getCenterColumnHTML ()
 Get center column.
 getRightColumnHTML ()
 Display right column.
 setColumnSettings ($column_gui)
 May be overwritten in subclasses.
 checkPermission ($a_perm, $a_cmd="")
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu)
 redirectToRefId ()
 fillCloneTemplate ($a_tpl_varname, $a_type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning.
 fillCloneSearchTemplate ($a_tpl_varname, $a_type)
 searchCloneSource ()
 buildCloneSelect ($existing_objs)
 addAdminLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded)
 getReturnLocation ()
 Deprecated functions.
 setReturnLocation ()
 showActions ()
 getTitlesByRefId ()
 getTabs ()
 __showButton ()
 hitsperpageObject ()
 __initTableGUI ()
 __setTableGUIBasicData ()
 __showClipboardTable ()
 initCreationForms ($a_new_type)
 Init creation froms.
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position.
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
 Check permission.
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu.
 redrawHeaderAction ()
 Updating icons after ajax call.
 getPermanentLinkWidget ($a_append=null, $a_center=false)
- Protected Member Functions inherited from ilObjectGUI
 insertHeaderAction ($a_list_gui)
 Insert header action into main template.
 addHeaderAction ()
 Add header action menu.
 redrawHeaderActionObject ()
 Ajax call: redraw action header only.
 setAdminTabs ()
 set admin tabs public
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion)
 initCreateForm ($a_new_type)
 Init object creation form.
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types.
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates.
 getDidacticTemplateVar ($a_type)
 Get didactic template setting from creation screen.
 initEditForm ()
 Init object edit form.
 getEditFormValues ()
 Get values for edit form.
 afterUpdate ()
 Post (successful) object update hook.
 initImportForm ($a_new_type)
 Init object import form.
 importFileObject ($parent_id=null)
 Import.
 afterImport (ilObject $a_new_object)
 Post (successful) object import hook.
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g.
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl.
 getTitlesByRefId ($a_ref_ids)
 get Titles of objects this method is used for error messages in methods cut/copy/paste
 getTabs (&$tabs_gui)
 get tabs abstract method.
 __showButton ($a_cmd, $a_text, $a_target= '')
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table
 __showClipboardTable ($a_result_set, $a_from="")
 redirectToRefId ($a_ref_id, $a_cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current $_GET["ref_id"] value
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error.

Additional Inherited Members

- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot ($a_raise_error=false)
 Goto repository root.
static _gotoRepositoryNode ($a_ref_id, $a_cmd="frameset")
 Goto repository root.
- Data Fields inherited from ilObject2GUI
 $tree
const OBJECT_ID = 0
const REPOSITORY_NODE_ID = 1
const WORKSPACE_NODE_ID = 2
const REPOSITORY_OBJECT_ID = 3
const WORKSPACE_OBJECT_ID = 4
- Protected Attributes inherited from ilObject2GUI
 $object_id
 $node_id
 $creation_forms = array()
 $id_type = array()
 $parent_id
 $access_handler

Detailed Description

Constructor & Destructor Documentation

ilObjPollGUI::__construct (   $a_id = 0,
  $a_id_type = self::REPOSITORY_NODE_ID,
  $a_parent_node_id = 0 
)

Constructor.

Parameters
int$a_id
int$a_id_type
int$a_parent_node_id

Reimplemented from ilObject2GUI.

Definition at line 20 of file class.ilObjPollGUI.php.

References ilObjectGUI\$lng.

{
global $lng;
parent::__construct($a_id, $a_id_type, $a_parent_node_id);
$lng->loadLanguageModule("poll");
}

Member Function Documentation

ilObjPollGUI::_goto (   $a_target)

Deep link.

Parameters
string$a_target

Definition at line 492 of file class.ilObjPollGUI.php.

References ilObject2GUI\$tree, ilLink\_getLink(), ilObject\_lookupObjId(), and ilUtil\redirect().

{
global $tree;
$id = explode("_", $a_target);
// is sideblock: so show parent instead
$container_id = $tree->getParentId($id[0]);
// #11810
include_once "Services/Link/classes/class.ilLink.php";
"#poll".ilObject::_lookupObjId($id[0]));
/*
$_GET["baseClass"] = "ilRepositoryGUI";
$_GET["ref_id"] = $container_id;
$_GET["cmd"] = "render";
include("ilias.php");
exit;
*/
}

+ Here is the call graph for this function:

ilObjPollGUI::addLocatorItems ( )

Functions to be overwritten.

Reimplemented from ilObject2GUI.

Definition at line 477 of file class.ilObjPollGUI.php.

References ilObject2GUI\$node_id.

{
global $ilLocator;
if (is_object($this->object))
{
$ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, ""), "", $this->node_id);
}
}
ilObjPollGUI::afterSave ( ilObject  $a_new_object)
protected

Post (successful) object creation hook.

Parameters
ilObject$a_new_object

Reimplemented from ilObjectGUI.

Definition at line 34 of file class.ilObjPollGUI.php.

References $ilCtrl, and ilUtil\sendSuccess().

{
global $ilCtrl;
ilUtil::sendSuccess($this->lng->txt("object_added"), true);
$ilCtrl->redirect($this, "render");
}

+ Here is the call graph for this function:

ilObjPollGUI::confirmDeleteAllVotes ( )

Definition at line 416 of file class.ilObjPollGUI.php.

References ilObjectGUI\$lng, ilObjectGUI\$tpl, ilObject2GUI\checkPermissionBool(), and ilUtil\sendInfo().

{
global $lng, $tpl, $ilTabs;
if(!$this->checkPermissionBool("write"))
{
ilUtil::sendInfo($lng->txt("no_permission"));
return;
}
$ilTabs->activateTab("participants");
include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
$cgui = new ilConfirmationGUI();
$cgui->setHeaderText($lng->txt("poll_delete_votes_sure"));
$cgui->setFormAction($this->ctrl->getFormAction($this));
$cgui->setCancel($lng->txt("cancel"), "showParticipants");
$cgui->setConfirm($lng->txt("confirm"), "deleteAllVotes");
$tpl->setContent($cgui->getHTML());
}

+ Here is the call graph for this function:

ilObjPollGUI::deleteAllVotes ( )

Definition at line 439 of file class.ilObjPollGUI.php.

References $ilCtrl, ilObjectGUI\$lng, ilObject2GUI\checkPermissionBool(), and ilUtil\sendInfo().

{
global $ilCtrl, $lng;
if(!$this->checkPermissionBool("write"))
{
ilUtil::sendInfo($lng->txt("no_permission"));
return;
}
$this->object->deleteAllVotes();
$ilCtrl->redirect($this, "showParticipants");
}

+ Here is the call graph for this function:

ilObjPollGUI::executeCommand ( )

execute command

Reimplemented from ilObject2GUI.

Definition at line 217 of file class.ilObjPollGUI.php.

References $cmd, $ilCtrl, ilObjectGUI\$tpl, ilObject2GUI\getAccessHandler(), ilObject2GUI\getCreationMode(), ilCommonActionDispatcherGUI\getInstanceFromAjaxCall(), and ilObject2GUI\prepareOutput().

{
global $ilCtrl, $tpl, $ilTabs, $ilNavigationHistory;
$next_class = $ilCtrl->getNextClass($this);
$cmd = $ilCtrl->getCmd();
$tpl->getStandardTemplate();
// add entry to navigation history
if(!$this->getCreationMode() &&
$this->getAccessHandler()->checkAccess("read", "", $this->node_id))
{
$link = $ilCtrl->getLinkTargetByClass("ilrepositorygui", "frameset");
$ilNavigationHistory->addItem($this->node_id, $link, "poll");
}
switch($next_class)
{
case "ilinfoscreengui":
$this->prepareOutput();
$this->infoScreenForward();
break;
case "ilcommonactiondispatchergui":
include_once("Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
$this->ctrl->forwardCommand($gui);
break;
case "ilpermissiongui":
$this->prepareOutput();
$ilTabs->activateTab("id_permissions");
include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
$perm_gui = new ilPermissionGUI($this);
$this->ctrl->forwardCommand($perm_gui);
break;
case "ilobjectcopygui":
include_once "./Services/Object/classes/class.ilObjectCopyGUI.php";
$cp = new ilObjectCopyGUI($this);
$cp->setType("poll");
$this->ctrl->forwardCommand($cp);
break;
case 'ilexportgui':
$this->prepareOutput();
$ilTabs->activateTab("export");
include_once("./Services/Export/classes/class.ilExportGUI.php");
$exp_gui = new ilExportGUI($this);
$exp_gui->addFormat("xml");
$ilCtrl->forwardCommand($exp_gui);
break;
default:
}
return true;
}

+ Here is the call graph for this function:

ilObjPollGUI::getEditFormCustomValues ( array &  $a_values)
protected

Add values to custom edit fields.

Parameters
array$a_values

Reimplemented from ilObjectGUI.

Definition at line 145 of file class.ilObjPollGUI.php.

{
$a_values["online"] = $this->object->IsOnline();
// $a_values["question"] = $this->object->getQuestion();
// $a_values["image"] = $this->object->getImage();
$a_values["results"] = $this->object->getViewResults();
$a_values["access_type"] = $this->object->getAccessType();
// $a_values["access_begin"] = $this->object->getAccessBegin();
// $a_values["access_end"] = $this->object->getAccessEnd();
// $a_values["access_visiblity"] = $this->object->getAccessVisibility();
$a_values["period"] = $this->object->getVotingPeriod();
$a_values["period_begin"] = $this->object->getVotingPeriodBegin();
$a_values["period_end"] = $this->object->getVotingPeriodEnd();
}
ilObjPollGUI::getHTML ( )

return user view

Returns
string

Reimplemented from ilObject2GUI.

Definition at line 472 of file class.ilObjPollGUI.php.

{
}
ilObjPollGUI::getType ( )

Functions that must be overwritten.

Reimplemented from ilObject2GUI.

Definition at line 29 of file class.ilObjPollGUI.php.

{
return "poll";
}
ilObjPollGUI::initEditCustomForm ( ilPropertyFormGUI  $a_form)
protected

Add custom fields to update form.

Parameters
ilPropertyFormGUI$a_form

Reimplemented from ilObjectGUI.

Definition at line 42 of file class.ilObjPollGUI.php.

References ilObjectGUI\$lng, $results, $section, ilObject\_getAllReferences(), ilPropertyFormGUI\addItem(), ilSubEnabledFormPropertyGUI\addSubItem(), IL_CAL_UNIX, ilRadioOption\setInfo(), ilFormPropertyGUI\setInfo(), ilDateTimeInputGUI\setShowTime(), ilObjectActivation\TIMINGS_ACTIVATION, ilObjectActivation\TIMINGS_DEACTIVATED, ilObjPoll\VIEW_RESULTS_AFTER_PERIOD, ilObjPoll\VIEW_RESULTS_AFTER_VOTE, ilObjPoll\VIEW_RESULTS_ALWAYS, and ilObjPoll\VIEW_RESULTS_NEVER.

{
global $lng;
// activation
include_once "Services/Object/classes/class.ilObjectActivation.php";
$this->lng->loadLanguageModule('rep');
$section->setTitle($this->lng->txt('rep_activation_availability'));
$a_form->addItem($section);
// additional info only with multiple references
$act_obj_info = $act_ref_info = "";
if(sizeof(ilObject::_getAllReferences($this->object->getId())) > 1)
{
$act_obj_info = ' '.$this->lng->txt('rep_activation_online_object_info');
$act_ref_info = $this->lng->txt('rep_activation_access_ref_info');
}
$online = new ilCheckboxInputGUI($this->lng->txt('rep_activation_online'),'online');
$online->setInfo($this->lng->txt('poll_activation_online_info').$act_obj_info);
$a_form->addItem($online);
$act_type = new ilRadioGroupInputGUI($this->lng->txt('rep_activation_access'),'access_type');
$act_type->setInfo($act_ref_info);
$opt = new ilRadioOption($this->lng->txt('rep_visibility_limitless'), ilObjectActivation::TIMINGS_DEACTIVATED);
$opt->setInfo($this->lng->txt('poll_availability_limitless_info'));
$act_type->addOption($opt);
$opt = new ilRadioOption($this->lng->txt('rep_visibility_until'), ilObjectActivation::TIMINGS_ACTIVATION);
$opt->setInfo($this->lng->txt('poll_availability_until_info'));
$date = $this->object->getAccessBegin();
$start = new ilDateTimeInputGUI($this->lng->txt('rep_activation_limited_start'),'access_begin');
$start->setShowTime(true);
$start->setDate(new ilDateTime($date ? $date : time(), IL_CAL_UNIX));
$opt->addSubItem($start);
$date = $this->object->getAccessEnd();
$end = new ilDateTimeInputGUI($this->lng->txt('rep_activation_limited_end'),'access_end');
$end->setShowTime(true);
$end->setDate(new ilDateTime($date ? $date : time(), IL_CAL_UNIX));
$opt->addSubItem($end);
/*
$visible = new ilCheckboxInputGUI($this->lng->txt('rep_activation_limited_visibility'), 'access_visiblity');
$visible->setInfo($this->lng->txt('poll_activation_limited_visibility_info'));
$opt->addSubItem($visible);
*/
$act_type->addOption($opt);
$a_form->addItem($act_type);
// period/results
$section->setTitle($this->lng->txt('poll_voting_period_and_results'));
$a_form->addItem($section);
$prd = new ilRadioGroupInputGUI($this->lng->txt('poll_voting_period'),'period');
$opt = new ilRadioOption($this->lng->txt('poll_voting_period_unlimited'), 0);
$prd->addOption($opt);
$opt = new ilRadioOption($this->lng->txt('poll_voting_period_limited'), 1);
$prd->addOption($opt);
$date = $this->object->getVotingPeriodBegin();
$start = new ilDateTimeInputGUI($this->lng->txt('poll_voting_period_start'),'period_begin');
$start->setShowTime(true);
$start->setDate(new ilDateTime($date ? $date : time(), IL_CAL_UNIX));
$opt->addSubItem($start);
$date = $this->object->getVotingPeriodEnd();
$end = new ilDateTimeInputGUI($this->lng->txt('poll_voting_period_end'),'period_end');
$end->setShowTime(true);
$end->setDate(new ilDateTime($date ? $date : time(), IL_CAL_UNIX));
$opt->addSubItem($end);
$a_form->addItem($prd);
$results = new ilRadioGroupInputGUI($lng->txt("poll_view_results"), "results");
$results->setRequired(true);
$results->addOption(new ilRadioOption($lng->txt("poll_view_results_always"),
$results->addOption(new ilRadioOption($lng->txt("poll_view_results_never"),
$results->addOption(new ilRadioOption($lng->txt("poll_view_results_after_vote"),
$results->addOption(new ilRadioOption($lng->txt("poll_view_results_after_period"),
$a_form->addItem($results);
}

+ Here is the call graph for this function:

ilObjPollGUI::initQuestionForm (   $a_read_only = false)
protected

Definition at line 315 of file class.ilObjPollGUI.php.

References $file, $ilCtrl, $img, ilObjectGUI\$lng, and ilFormPropertyGUI\setRequired().

Referenced by render(), and saveQuestion().

{
global $lng, $ilCtrl;
include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
$form = new ilPropertyFormGUI();
$form->setFormAction($ilCtrl->getFormAction($this, "saveQuestion"));
$form->setTitle($lng->txt("obj_poll"));
$question = new ilTextAreaInputGUI($lng->txt("poll_question"), "question");
$question->setRequired(true);
$question->setCols(40);
$question->setRows(2);
$question->setValue($this->object->getQuestion());
$question->setDisabled($a_read_only);
$form->addItem($question);
$dimensions = " (".ilObjPoll::getImageSize()."px)";
$img = new ilImageFileInputGUI($lng->txt("poll_image").$dimensions, "image");
$img->setDisabled($a_read_only);
$form->addItem($img);
// show existing file
$file = $this->object->getImageFullPath(true);
if($file)
{
$img->setImage($file);
}
$answers = new ilTextInputGUI($lng->txt("poll_answers"), "answers");
$answers->setRequired(true);
$answers->setMulti(true, true);
$answers->setDisabled($a_read_only);
$form->addItem($answers);
$multi_answers = array();
foreach($this->object->getAnswers() as $idx => $item)
{
if(!$idx)
{
$answers->setValue($item["answer"]);
}
$multi_answers[] = $item["answer"];
}
$answers->setMultiValues($multi_answers);
if(!$a_read_only)
{
$form->addCommandButton("saveQuestion", $lng->txt("save"));
}
return $form;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjPollGUI::render (   $a_form = null)

Render object context.

Definition at line 285 of file class.ilObjPollGUI.php.

References $ilCtrl, $ilUser, ilObjectGUI\$lng, ilObjectGUI\$tpl, ilObject2GUI\checkPermissionBool(), initQuestionForm(), and ilUtil\sendInfo().

Referenced by saveQuestion().

{
global $tpl, $ilTabs, $ilCtrl, $lng, $ilToolbar, $ilUser;
if(!$this->checkPermissionBool("write"))
{
ilUtil::sendInfo($lng->txt("no_permission"));
return;
}
$ilTabs->activateTab("content");
if(!$a_form)
{
if($this->object->countVotes())
{
$url = $ilCtrl->getLinkTarget($this, "showParticipants");
ilUtil::sendInfo($lng->txt("poll_votes_no_edit").
" <a href=\"".$url."\">&raquo;".$lng->txt("poll_result")."</a>");
}
$a_form = $this->initQuestionForm($this->object->countVotes());
}
include_once('Services/PermanentLink/classes/class.ilPermanentLinkGUI.php');
$plink = new ilPermanentLinkGUI('poll', $this->node_id);
$tpl->setContent($a_form->getHTML().$plink->getHTML());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjPollGUI::saveQuestion ( )

Definition at line 369 of file class.ilObjPollGUI.php.

References initQuestionForm(), render(), and ilUtil\sendSuccess().

{
$form = $this->initQuestionForm();
if($form->checkInput())
{
$this->object->setQuestion($form->getInput("question"));
$image = $form->getItemByPostVar("image");
if($_FILES["image"]["tmp_name"])
{
$this->object->uploadImage($_FILES["image"]);
}
else if($image->getDeletionFlag())
{
$this->object->deleteImage();
}
$this->object->saveAnswers($form->getInput("answers"));
if($this->object->update())
{
ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
$this->ctrl->redirect($this, "render");
}
}
$form->setValuesByPost();
$this->render($form);
}

+ Here is the call graph for this function:

ilObjPollGUI::setTabs ( )

create tabs (repository/workspace switch)

this had to be moved here because of the context-specific permission tab

Reimplemented from ilObject2GUI.

Definition at line 185 of file class.ilObjPollGUI.php.

References ilObjectGUI\$lng, and ilObject2GUI\checkPermissionBool().

{
global $lng, $ilHelp;
$ilHelp->setScreenIdComponent("poll");
if ($this->checkPermissionBool("write"))
{
$this->tabs_gui->addTab("content",
$lng->txt("content"),
$this->ctrl->getLinkTarget($this, ""));
}
if ($this->checkPermissionBool("write"))
{
$this->tabs_gui->addTab("settings",
$lng->txt("settings"),
$this->ctrl->getLinkTarget($this, "edit"));
$this->tabs_gui->addTab("participants",
$lng->txt("poll_result"),
$this->ctrl->getLinkTarget($this, "showParticipants"));
$this->tabs_gui->addTab("export",
$lng->txt("export"),
$this->ctrl->getLinkTargetByClass("ilexportgui", ""));
}
// will add permissions if needed
}

+ Here is the call graph for this function:

ilObjPollGUI::showParticipants ( )

Definition at line 399 of file class.ilObjPollGUI.php.

References ilObjectGUI\$lng, ilObjectGUI\$tpl, ilObject2GUI\checkPermissionBool(), and ilUtil\sendInfo().

{
global $lng, $ilTabs, $tpl;
if(!$this->checkPermissionBool("write"))
{
ilUtil::sendInfo($lng->txt("no_permission"));
return;
}
$ilTabs->activateTab("participants");
include_once "Modules/Poll/classes/class.ilPollAnswerTableGUI.php";
$tbl = new ilPollAnswerTableGUI($this, "showParticipants");
$tpl->setContent($tbl->getHTML());
}

+ Here is the call graph for this function:

ilObjPollGUI::updateCustom ( ilPropertyFormGUI  $a_form)
protected

Insert custom update form values into object.

Parameters
ilPropertyFormGUI$a_form

Reimplemented from ilObjectGUI.

Definition at line 160 of file class.ilObjPollGUI.php.

References $_POST, ilPropertyFormGUI\getInput(), IL_CAL_DATETIME, IL_CAL_UNIX, and ilObjectActivation\TIMINGS_ACTIVATION.

{
$this->object->setViewResults($a_form->getInput("results"));
$this->object->setOnline($a_form->getInput("online"));
include_once "Services/Object/classes/class.ilObjectActivation.php";
$this->object->setAccessType($a_form->getInput("access_type"));
if($this->object->getAccessType() == ilObjectActivation::TIMINGS_ACTIVATION)
{
$date = new ilDateTime($_POST['access_begin']['date'] . ' ' . $_POST['access_begin']['time'], IL_CAL_DATETIME);
$this->object->setAccessBegin($date->get(IL_CAL_UNIX));
$date = new ilDateTime($_POST['access_end']['date'] . ' ' . $_POST['access_end']['time'], IL_CAL_DATETIME);
$this->object->setAccessEnd($date->get(IL_CAL_UNIX));
// $this->object->setAccessVisibility($a_form->getInput("access_visiblity"));
}
$this->object->setVotingPeriod($a_form->getInput("period"));
if($this->object->getVotingPeriod())
{
$date = new ilDateTime($_POST['period_begin']['date'] . ' ' . $_POST['period_begin']['time'], IL_CAL_DATETIME);
$this->object->setVotingPeriodBegin($date->get(IL_CAL_UNIX));
$date = new ilDateTime($_POST['period_end']['date'] . ' ' . $_POST['period_end']['time'], IL_CAL_DATETIME);
$this->object->setVotingPeriodEnd($date->get(IL_CAL_UNIX));
}
}

+ Here is the call graph for this function:

ilObjPollGUI::vote ( )

Definition at line 454 of file class.ilObjPollGUI.php.

References $_POST, $ilUser, ilObject2GUI\$tree, ilLink\_getLink(), and ilUtil\redirect().

{
global $tree, $ilUser;
if($_POST["aw"])
{
$this->object->saveVote($ilUser->getId(), $_POST["aw"]);
}
include_once "Services/Link/classes/class.ilLink.php";
ilUtil::redirect(ilLink:: _getLink($tree->getParentId($this->ref_id)));
}

+ Here is the call graph for this function:


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