ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5
ilExSubmissionObjectGUI Class Reference

Object-based submissions (ends up as static file) More...

+ Inheritance diagram for ilExSubmissionObjectGUI:
+ Collaboration diagram for ilExSubmissionObjectGUI:

Public Member Functions

 executeCommand ()
 
 submitBlog ($a_blog_id)
 Submit blog for assignment. More...
 
 submitPortfolio ($a_portfolio_id)
 Submit portfolio for assignment. More...
 
- Public Member Functions inherited from ilExSubmissionBaseGUI
 __construct (ilObjExercise $a_exercise, ilExSubmission $a_submission)
 
 returnToParentObject ()
 

Static Public Member Functions

static getOverviewContent (ilInfoScreenGUI $a_info, ilExSubmission $a_submission)
 
static initGUIForSubmit ($a_ass_id, $a_user_id=null)
 
- Static Public Member Functions inherited from ilExSubmissionBaseGUI
static getOverviewContent (ilInfoScreenGUI $a_info, ilExSubmission $a_submission)
 

Protected Member Functions

 getOverviewContentPortfolio (ilInfoScreenGUI $a_info, ilExSubmission $a_submission)
 
 renderResourceSelection ($a_title, $a_info, $a_cmd, $a_explorer_cmd, array $a_items=null)
 
 createBlogObject ()
 
 selectBlogObject ()
 
 saveBlogObject ()
 
 setSelectedBlogObject ()
 
 renderWorkspaceExplorer ($a_cmd)
 
 selectPortfolioObject ()
 
 initPortfolioTemplateForm (array $a_templates)
 
 createPortfolioTemplateObject (ilPropertyFormGUI $a_form=null)
 
 setSelectedPortfolioTemplateObject ()
 
 createPortfolioObject ()
 
 setSelectedPortfolioObject ()
 
 askDirectSubmissionObject ()
 
 directSubmitObject ()
 
- Protected Member Functions inherited from ilExSubmissionBaseGUI
 handleTabs ()
 
 handleNewUpload ($a_no_notifications=false)
 
 handleRemovedUpload ()
 

Static Protected Member Functions

static getOverviewContentBlog (ilInfoScreenGUI $a_info, ilExSubmission $a_submission)
 

Additional Inherited Members

- Protected Attributes inherited from ilExSubmissionBaseGUI
 $exercise
 
 $submission
 
 $assignment
 

Detailed Description

Object-based submissions (ends up as static file)

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om

ilExSubmissionObjectGUI:

Definition at line 12 of file class.ilExSubmissionObjectGUI.php.

Member Function Documentation

◆ askDirectSubmissionObject()

ilExSubmissionObjectGUI::askDirectSubmissionObject ( )
protected

Definition at line 545 of file class.ilExSubmissionObjectGUI.php.

References $_REQUEST, $tpl, $txt, ilExSubmissionBaseGUI\returnToParentObject(), and ilUtil\sendInfo().

546  {
547  global $tpl;
548 
549  if (!$this->submission->canSubmit())
550  {
551  ilUtil::sendInfo($this->lng->txt("exercise_time_over"), true);
552  $this->returnToParentObject();
553  }
554 
555  include_once "Services/Utilities/classes/class.ilConfirmationGUI.php";
556  $conf = new ilConfirmationGUI();
557 
558  if($_REQUEST["blog_id"])
559  {
560  $this->ctrl->setParameter($this, "blog_id", $_REQUEST["blog_id"]);
561  $txt = $this->lng->txt("exc_direct_submit_blog");
562  }
563  else
564  {
565  $this->ctrl->setParameter($this, "prtf_id", $_REQUEST["prtf_id"]);
566  $txt = $this->lng->txt("exc_direct_submit_portfolio");
567  }
568  $conf->setFormAction($this->ctrl->getFormAction($this, "directSubmit"));
569 
570  $conf->setHeaderText($txt);
571  $conf->setConfirm($this->lng->txt("exc_direct_submit"), "directSubmit");
572  $conf->setCancel($this->lng->txt("cancel"), "returnToParent");
573 
574  $tpl->setContent($conf->getHTML());
575  }
global $tpl
Definition: ilias.php:8
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
$txt
Definition: error.php:12
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
Confirmation screen class.
+ Here is the call graph for this function:

◆ createBlogObject()

ilExSubmissionObjectGUI::createBlogObject ( )
protected

Definition at line 249 of file class.ilExSubmissionObjectGUI.php.

References ilExSubmissionBaseGUI\handleTabs(), and renderResourceSelection().

Referenced by saveBlogObject().

250  {
251  $this->handleTabs();
252 
253  return $this->renderResourceSelection(
254  "exc_create_blog",
255  "exc_create_blog_select_info",
256  "saveBlog",
257  "createBlog"
258  );
259  }
renderResourceSelection($a_title, $a_info, $a_cmd, $a_explorer_cmd, array $a_items=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createPortfolioObject()

ilExSubmissionObjectGUI::createPortfolioObject ( )
protected

Definition at line 494 of file class.ilExSubmissionObjectGUI.php.

References ilExSubmissionBaseGUI\handleRemovedUpload(), ilExSubmissionBaseGUI\returnToParentObject(), ilUtil\sendInfo(), and ilUtil\sendSuccess().

Referenced by setSelectedPortfolioTemplateObject().

495  {
496  if (!$this->submission->canSubmit())
497  {
498  ilUtil::sendInfo($this->lng->txt("exercise_time_over"), true);
499  $this->returnToParentObject();
500  }
501 
502  include_once "Modules/Portfolio/classes/class.ilObjPortfolio.php";
503  $portfolio = new ilObjPortfolio();
504  $portfolio->setTitle($this->exercise->getTitle()." - ".$this->assignment->getTitle());
505  $portfolio->create();
506 
507  $this->submission->deleteAllFiles();
508  $this->handleRemovedUpload();
509 
510  $this->submission->addResourceObject($portfolio->getId());
511 
512  ilUtil::sendSuccess($this->lng->txt("exc_portfolio_created"), true);
513  $this->returnToParentObject();
514  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createPortfolioTemplateObject()

ilExSubmissionObjectGUI::createPortfolioTemplateObject ( ilPropertyFormGUI  $a_form = null)
protected

Definition at line 432 of file class.ilExSubmissionObjectGUI.php.

References ilObjPortfolioTemplate\getAvailablePortfolioTemplates(), initPortfolioTemplateForm(), ilExSubmissionBaseGUI\returnToParentObject(), and ilUtil\sendInfo().

Referenced by setSelectedPortfolioTemplateObject().

433  {
434  if (!$this->submission->canSubmit())
435  {
436  ilUtil::sendInfo($this->lng->txt("exercise_time_over"), true);
437  $this->returnToParentObject();
438  }
439 
440  include_once "Modules/Portfolio/classes/class.ilObjPortfolioTemplate.php";
442  if(!sizeof($templates))
443  {
444  $this->returnToParentObject();
445  }
446 
447  if(!$a_form)
448  {
449  $a_form = $this->initPortfolioTemplateForm($templates);
450  }
451 
452  $this->tpl->setContent($a_form->getHTML());
453  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static getAvailablePortfolioTemplates($a_permission="read")
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ directSubmitObject()

ilExSubmissionObjectGUI::directSubmitObject ( )
protected

Definition at line 577 of file class.ilExSubmissionObjectGUI.php.

References $_REQUEST, $success, ilExSubmissionBaseGUI\returnToParentObject(), ilUtil\sendFailure(), ilUtil\sendInfo(), ilUtil\sendSuccess(), submitBlog(), and submitPortfolio().

578  {
579  if (!$this->submission->canSubmit())
580  {
581  ilUtil::sendInfo($this->lng->txt("exercise_time_over"), true);
582  $this->returnToParentObject();
583  }
584 
585  $success = false;
586 
587  // submit current version of blog
588  if($_REQUEST["blog_id"])
589  {
590  $success = $this->submitBlog($_REQUEST["blog_id"]);
591  $this->ctrl->setParameter($this, "blog_id", "");
592  }
593  // submit current version of portfolio
594  else if($_REQUEST["prtf_id"])
595  {
596  $success = $this->submitPortfolio($_REQUEST["prtf_id"]);
597  $this->ctrl->setParameter($this, "prtf_id", "");
598  }
599 
600  if($success)
601  {
602  ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
603  }
604  else
605  {
606  ilUtil::sendFailure($this->lng->txt("msg_failed"), true);
607  }
608  $this->ctrl->redirect($this, "returnToParent");
609  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
submitBlog($a_blog_id)
Submit blog for assignment.
submitPortfolio($a_portfolio_id)
Submit portfolio for assignment.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
$success
Definition: Utf8Test.php:87
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
+ Here is the call graph for this function:

◆ executeCommand()

ilExSubmissionObjectGUI::executeCommand ( )

Definition at line 14 of file class.ilExSubmissionObjectGUI.php.

References $cmd, $ilCtrl, and ilExSubmissionBaseGUI\returnToParentObject().

15  {
16  global $ilCtrl;
17 
18  if(!$this->submission->canView())
19  {
20  $this->returnToParentObject();
21  }
22 
23  $class = $ilCtrl->getNextClass($this);
24  $cmd = $ilCtrl->getCmd();
25 
26  switch($class)
27  {
28  default:
29  $this->{$cmd."Object"}();
30  break;
31  }
32  }
$cmd
Definition: sahs_server.php:35
global $ilCtrl
Definition: ilias.php:18
+ Here is the call graph for this function:

◆ getOverviewContent()

static ilExSubmissionObjectGUI::getOverviewContent ( ilInfoScreenGUI  $a_info,
ilExSubmission  $a_submission 
)
static

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

References ilExSubmission\getAssignment(), ilExAssignment\TYPE_BLOG, and ilExAssignment\TYPE_PORTFOLIO.

35  {
36  switch($a_submission->getAssignment()->getType())
37  {
39  return self::getOverviewContentBlog($a_info, $a_submission);
40 
42  return self::getOverviewContentPortfolio($a_info, $a_submission);
43  }
44  }
+ Here is the call graph for this function:

◆ getOverviewContentBlog()

static ilExSubmissionObjectGUI::getOverviewContentBlog ( ilInfoScreenGUI  $a_info,
ilExSubmission  $a_submission 
)
staticprotected

Definition at line 46 of file class.ilExSubmissionObjectGUI.php.

References $ilCtrl, $lng, ilInfoScreenGUI\addProperty(), ilExSubmission\canSubmit(), ilWorkspaceTree\createTreeForUser(), ilExSubmission\deleteResourceObject(), ilLinkButton\getInstance(), ilExSubmission\getSelectedObject(), ilExSubmission\getUserId(), and ilExSubmission\hasSubmitted().

47  {
48  global $lng, $ilCtrl;
49 
50  include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
51  $wsp_tree = new ilWorkspaceTree($a_submission->getUserId());
52 
53  // #12939
54  if(!$wsp_tree->getRootId())
55  {
56  $wsp_tree->createTreeForUser($a_submission->getUserId());
57  }
58 
59  $files_str = "";
60  $valid_blog = false;
61  $selected_blog = $a_submission->getSelectedObject();
62  if($selected_blog)
63  {
64  $blog_id = (int)$selected_blog["filetitle"];
65  $node = $wsp_tree->getNodeData($blog_id);
66  if($node["title"])
67  {
68  // #10116
69  $ilCtrl->setParameterByClass("ilobjbloggui", "wsp_id", $blog_id);
70  $blog_link = $ilCtrl->getLinkTargetByClass(array("ilpersonaldesktopgui", "ilpersonalworkspacegui", "ilobjbloggui"), "");
71  $ilCtrl->setParameterByClass("ilobjbloggui", "wsp_id", "");
72  $files_str = '<a href="'.$blog_link.'">'.
73  $node["title"].'</a>';
74  $valid_blog = true;
75  }
76  // remove invalid resource if no upload yet (see download below)
77  else if(substr($selected_blog["filename"], -1) == "/")
78  {
79  // #16887
80  $a_submission->deleteResourceObject($selected_blog["returned_id"]);
81  }
82  }
83  if($a_submission->canSubmit())
84  {
85  if(!$valid_blog)
86  {
87  $button = ilLinkButton::getInstance();
88  $button->setCaption("exc_create_blog");
89  $button->setUrl($ilCtrl->getLinkTargetByClass(array("ilExSubmissionGUI", "ilExSubmissionObjectGUI"), "createBlog"));
90  $files_str.= $button->render();
91  }
92  // #10462
93  $blogs = sizeof($wsp_tree->getObjectsFromType("blog"));
94  if((!$valid_blog && $blogs)
95  || ($valid_blog && $blogs > 1))
96  {
97  $button = ilLinkButton::getInstance();
98  $button->setCaption("exc_select_blog".($valid_blog ? "_change" : ""));
99  $button->setUrl($ilCtrl->getLinkTargetByClass(array("ilExSubmissionGUI", "ilExSubmissionObjectGUI"), "selectBlog"));
100  $files_str.= " ".$button->render();
101  }
102  }
103  if($files_str)
104  {
105  $a_info->addProperty($lng->txt("exc_blog_returned"), $files_str);
106  }
107  if($a_submission->hasSubmitted())
108  {
109  $ilCtrl->setParameterByClass("ilExSubmissionFileGUI", "delivered", $selected_blog["returned_id"]);
110  $dl_link = $ilCtrl->getLinkTargetByClass(array("ilExSubmissionGUI", "ilExSubmissionFileGUI"), "download");
111  $ilCtrl->setParameterByClass("ilExSubmissionFileGUI", "delivered", "");
112 
113  $button = ilLinkButton::getInstance();
114  $button->setCaption("download");
115  $button->setUrl($dl_link);
116 
117  $a_info->addProperty($lng->txt("exc_files_returned"), $button->render());
118  }
119  }
createTreeForUser($a_user_id)
Create personal workspace tree for user.
Tree handler for personal workspace.
global $ilCtrl
Definition: ilias.php:18
addProperty($a_name, $a_value, $a_link="")
add a property to current section
global $lng
Definition: privfeed.php:40
deleteResourceObject($a_returned_id)
Remove personal resource to assigment.
+ Here is the call graph for this function:

◆ getOverviewContentPortfolio()

ilExSubmissionObjectGUI::getOverviewContentPortfolio ( ilInfoScreenGUI  $a_info,
ilExSubmission  $a_submission 
)
protected

Definition at line 121 of file class.ilExSubmissionObjectGUI.php.

References $ilCtrl, $lng, ilObject\_exists(), ilInfoScreenGUI\addProperty(), ilExSubmission\canSubmit(), ilExSubmission\deleteResourceObject(), ilObjPortfolioTemplate\getAvailablePortfolioTemplates(), ilLinkButton\getInstance(), ilObjPortfolio\getPortfoliosOfUser(), ilExSubmission\getSelectedObject(), ilExSubmission\getUserId(), and ilExSubmission\hasSubmitted().

122  {
123  global $lng, $ilCtrl;
124 
125  include_once "Modules/Portfolio/classes/class.ilObjPortfolio.php";
126 
127  $files_str = "";
128  $valid_prtf = false;
129  $selected_prtf = $a_submission->getSelectedObject();
130  if($selected_prtf)
131  {
132  $portfolio_id = (int)$selected_prtf["filetitle"];
133 
134  // #11746
135  if(ilObject::_exists($portfolio_id, false, "prtf"))
136  {
137  $portfolio = new ilObjPortfolio($portfolio_id, false);
138  if($portfolio->getTitle())
139  {
140  // #10116 / #12791
141  $ilCtrl->setParameterByClass("ilobjportfoliogui", "prt_id", $portfolio_id);
142  $prtf_link = $ilCtrl->getLinkTargetByClass(array("ilpersonaldesktopgui", "ilportfoliorepositorygui", "ilobjportfoliogui"), "view");
143  $ilCtrl->setParameterByClass("ilobjportfoliogui", "prt_id", "");
144 
145  $files_str = '<a href="'.$prtf_link.
146  '">'.$portfolio->getTitle().'</a>';
147  $valid_prtf = true;
148  }
149  }
150  // remove invalid resource if no upload yet (see download below)
151  else if(substr($selected_prtf["filename"], -1) == "/")
152  {
153  // #16887
154  $a_submission->deleteResourceObject($selected_prtf["returned_id"]);
155  }
156  }
157  if($a_submission->canSubmit())
158  {
159  if(!$valid_prtf)
160  {
161  // if there are portfolio templates available show form first
162  include_once "Modules/Portfolio/classes/class.ilObjPortfolioTemplate.php";
164  ? "Template"
165  : "";
166 
167  $button = ilLinkButton::getInstance();
168  $button->setCaption("exc_create_portfolio");
169  $button->setUrl($ilCtrl->getLinkTargetByClass(array("ilExSubmissionGUI", "ilExSubmissionObjectGUI"), "createPortfolio".$has_prtt));
170  $files_str .= $button->render();
171  }
172  // #10462
173  $prtfs = sizeof(ilObjPortfolio::getPortfoliosOfUser($a_submission->getUserId()));
174  if((!$valid_prtf && $prtfs)
175  || ($valid_prtf && $prtfs > 1))
176  {
177  $button = ilLinkButton::getInstance();
178  $button->setCaption("exc_select_portfolio".($valid_prtf ? "_change" : ""));
179  $button->setUrl($ilCtrl->getLinkTargetByClass(array("ilExSubmissionGUI", "ilExSubmissionObjectGUI"), "selectPortfolio"));
180  $files_str.= " ".$button->render();
181  }
182  }
183  if($files_str)
184  {
185  $a_info->addProperty($lng->txt("exc_portfolio_returned"), $files_str);
186  }
187  if($a_submission->hasSubmitted())
188  {
189  $ilCtrl->setParameterByClass("ilExSubmissionFileGUI", "delivered", $selected_prtf["returned_id"]);
190  $dl_link =$ilCtrl->getLinkTargetByClass(array("ilExSubmissionGUI", "ilExSubmissionFileGUI"), "download");
191  $ilCtrl->setParameterByClass("ilExSubmissionFileGUI", "delivered", "");
192 
193  $button = ilLinkButton::getInstance();
194  $button->setCaption("download");
195  $button->setUrl($dl_link);
196 
197  $a_info->addProperty($lng->txt("exc_files_returned"), $button->render());
198  }
199  }
static _exists($a_id, $a_reference=false, $a_type=null)
checks if an object exists in object_data
static getPortfoliosOfUser($a_user_id)
Get views of user.
global $ilCtrl
Definition: ilias.php:18
static getAvailablePortfolioTemplates($a_permission="read")
addProperty($a_name, $a_value, $a_link="")
add a property to current section
global $lng
Definition: privfeed.php:40
deleteResourceObject($a_returned_id)
Remove personal resource to assigment.
+ Here is the call graph for this function:

◆ initGUIForSubmit()

static ilExSubmissionObjectGUI::initGUIForSubmit (   $a_ass_id,
  $a_user_id = null 
)
static

Definition at line 691 of file class.ilExSubmissionObjectGUI.php.

References $ilUser, and ilObject\_getAllReferences().

Referenced by ilBlogExerciseGUI\finalize(), and ilPortfolioExerciseGUI\finalize().

692  {
693  global $ilUser;
694 
695  if(!$a_user_id)
696  {
697  $a_user_id = $ilUser->getId();
698  }
699 
700  include_once "Modules/Exercise/classes/class.ilObjExercise.php";
701  include_once "Modules/Exercise/classes/class.ilExAssignment.php";
702  include_once "Modules/Exercise/classes/class.ilExSubmission.php";
703 
704  $ass = new ilExAssignment($a_ass_id);
705  $sub = new ilExSubmission($ass, $a_user_id);
706  $exc_id = $ass->getExerciseId();
707 
708  // #11173 - ref_id is needed for notifications
709  $exc_ref_id = array_shift(ilObject::_getAllReferences($exc_id));
710  $exc = new ilObjExercise($exc_ref_id, true);
711 
712  return new self($exc, $sub);
713  }
Exercise assignment.
static _getAllReferences($a_id)
get all reference ids of object
Class ilObjExercise.
global $ilUser
Definition: imgupload.php:15
Exercise submission.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initPortfolioTemplateForm()

ilExSubmissionObjectGUI::initPortfolioTemplateForm ( array  $a_templates)
protected

Definition at line 409 of file class.ilExSubmissionObjectGUI.php.

References ilFormPropertyGUI\setRequired().

Referenced by createPortfolioTemplateObject(), and setSelectedPortfolioTemplateObject().

410  {
411  include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
412  $form = new ilPropertyFormGUI();
413  $form->setTitle($this->lng->txt("exc_create_portfolio").": ".$this->assignment->getTitle());
414  $form->setFormAction($this->ctrl->getFormAction($this, "setSelectedPortfolioTemplate"));
415 
416  $prtt = new ilRadioGroupInputGUI($this->lng->txt("obj_prtt"), "prtt");
417  $prtt->setRequired(true);
418  $prtt->addOption(new ilRadioOption($this->lng->txt("exc_create_portfolio_no_template"), -1));
419  foreach($a_templates as $id => $title)
420  {
421  $prtt->addOption(new ilRadioOption('"'.$title.'"', $id));
422  }
423  $prtt->setValue(-1);
424  $form->addItem($prtt);
425 
426  $form->addCommandButton("setSelectedPortfolioTemplate", $this->lng->txt("save"));
427  $form->addCommandButton("returnToParent", $this->lng->txt("cancel"));
428 
429  return $form;
430  }
This class represents an option in a radio group.
This class represents a property form user interface.
This class represents a property in a property form.
setRequired($a_required)
Set Required.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderResourceSelection()

ilExSubmissionObjectGUI::renderResourceSelection (   $a_title,
  $a_info,
  $a_cmd,
  $a_explorer_cmd,
array  $a_items = null 
)
protected

Definition at line 201 of file class.ilExSubmissionObjectGUI.php.

References $tpl, ilPanelGUI\getInstance(), renderWorkspaceExplorer(), ilExSubmissionBaseGUI\returnToParentObject(), and ilUtil\sendInfo().

Referenced by createBlogObject(), selectBlogObject(), and selectPortfolioObject().

202  {
203  if(!$this->submission->canSubmit())
204  {
205  ilUtil::sendInfo($this->lng->txt("exercise_time_over"), true);
206  $this->returnToParentObject();
207  }
208 
209  $tpl = new ilTemplate("tpl.exc_select_resource.html", true, true, "Modules/Exercise");
210 
211  if(is_array($a_items))
212  {
213  $tpl->setCurrentBlock("item");
214  foreach($a_items as $item_id => $item_title)
215  {
216  $tpl->setVariable("ITEM_ID", $item_id);
217  $tpl->setVariable("ITEM_TITLE", $item_title);
218  $tpl->parseCurrentBlock();
219  }
220  }
221  else if($a_explorer_cmd)
222  {
223  $tpl->setVariable("TREE", $this->renderWorkspaceExplorer($a_explorer_cmd));
224  }
225 
226  $tpl->setVariable("FORM_ACTION", $this->ctrl->getFormAction($this));
227  $tpl->setVariable("TXT_SUBMIT", $this->lng->txt("save"));
228  $tpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel"));
229  $tpl->setVariable("CMD_SUBMIT", $a_cmd);
230  $tpl->setVariable("CMD_CANCEL", "returnToParent");
231 
232  ilUtil::sendInfo($this->lng->txt($a_info));
233 
234  $title = $this->lng->txt($a_title).": ".$this->assignment->getTitle();
235 
236  include_once "Services/UIComponent/Panel/classes/class.ilPanelGUI.php";
237  $panel = ilPanelGUI::getInstance();
238  $panel->setBody($tpl->get());
239  $panel->setHeading($title);
240 
241  $this->tpl->setContent($panel->getHTML());
242  }
global $tpl
Definition: ilias.php:8
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
special template class to simplify handling of ITX/PEAR
static getInstance()
Get instance.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderWorkspaceExplorer()

ilExSubmissionObjectGUI::renderWorkspaceExplorer (   $a_cmd)
protected

Definition at line 343 of file class.ilExSubmissionObjectGUI.php.

References $_GET, and ilWorkspaceExplorer\SEL_TYPE_RADIO.

Referenced by renderResourceSelection().

344  {
345  include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
346  include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
347  require_once 'Services/PersonalWorkspace/classes/class.ilWorkspaceExplorer.php';
348 
349  $tree = new ilWorkspaceTree($this->submission->getUserId());
350  $access_handler = new ilWorkspaceAccessHandler($tree);
352  'exc_wspexpand', $tree, $access_handler);
353  $exp->setTargetGet('wsp_id');
354 
355  if($a_cmd == "selectBlog")
356  {
357  $exp->removeAllFormItemTypes();
358  $exp->addFilter('blog');
359  $exp->addFormItemForType('blog');
360  }
361 
362  if($_GET['exc_wspexpand'] == '')
363  {
364  // not really used as session is already set [see above]
365  $expanded = $tree->readRootId();
366  }
367  else
368  {
369  $expanded = $_GET['exc_wspexpand'];
370  }
371 
372  $exp->setExpandTarget($this->ctrl->getLinkTarget($this, $a_cmd));
373  $exp->setPostVar('node');
374  $exp->setExpand($expanded);
375  $exp->setOutput(0);
376 
377  return $exp->getOutput();
378  }
$_GET["client_id"]
Access handler for personal workspace.
Tree handler for personal workspace.
+ Here is the caller graph for this function:

◆ saveBlogObject()

ilExSubmissionObjectGUI::saveBlogObject ( )
protected

Definition at line 273 of file class.ilExSubmissionObjectGUI.php.

References $_POST, createBlogObject(), ilExSubmissionBaseGUI\handleRemovedUpload(), ilWorkspaceTree\insertObject(), ilExSubmissionBaseGUI\returnToParentObject(), ilUtil\sendFailure(), ilUtil\sendInfo(), and ilUtil\sendSuccess().

274  {
275  if (!$this->submission->canSubmit())
276  {
277  ilUtil::sendInfo($this->lng->txt("exercise_time_over"), true);
278  $this->returnToParentObject();
279  }
280 
281  if(!$_POST["node"])
282  {
283  ilUtil::sendFailure($this->lng->txt("select_one"));
284  return $this->createBlogObject();
285  }
286 
287  $parent_node = $_POST["node"];
288 
289  include_once "Modules/Blog/classes/class.ilObjBlog.php";
290  include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
291  include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
292 
293  $blog = new ilObjBlog();
294  $blog->setTitle($this->exercise->getTitle()." - ".$this->assignment->getTitle());
295  $blog->create();
296 
297  $tree = new ilWorkspaceTree($this->submission->getUserId()); // #15993
298 
299  $node_id = $tree->insertObject($parent_node, $blog->getId());
300 
301  $access_handler = new ilWorkspaceAccessHandler($tree);
302  $access_handler->setPermissions($parent_node, $node_id);
303 
304  $this->submission->deleteAllFiles();
305  $this->handleRemovedUpload();
306 
307  $this->submission->addResourceObject($node_id);
308 
309  ilUtil::sendSuccess($this->lng->txt("exc_blog_created"), true);
310  $this->returnToParentObject();
311  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
Access handler for personal workspace.
Tree handler for personal workspace.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
Class ilObjBlog.
insertObject($a_parent_node_id, $a_object_id)
Add object to tree.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:

◆ selectBlogObject()

ilExSubmissionObjectGUI::selectBlogObject ( )
protected

Definition at line 261 of file class.ilExSubmissionObjectGUI.php.

References ilExSubmissionBaseGUI\handleTabs(), and renderResourceSelection().

262  {
263  $this->handleTabs();
264 
265  return $this->renderResourceSelection(
266  "exc_select_blog",
267  "exc_select_blog_info",
268  "setSelectedBlog",
269  "selectBlog"
270  );
271  }
renderResourceSelection($a_title, $a_info, $a_cmd, $a_explorer_cmd, array $a_items=null)
+ Here is the call graph for this function:

◆ selectPortfolioObject()

ilExSubmissionObjectGUI::selectPortfolioObject ( )
protected

Definition at line 385 of file class.ilExSubmissionObjectGUI.php.

References ilObjPortfolio\getPortfoliosOfUser(), ilExSubmissionBaseGUI\handleTabs(), and renderResourceSelection().

Referenced by setSelectedBlogObject(), and setSelectedPortfolioObject().

386  {
387  $this->handleTabs();
388 
389  $items = array();
390  include_once "Modules/Portfolio/classes/class.ilObjPortfolio.php";
391  $portfolios = ilObjPortfolio::getPortfoliosOfUser($this->submission->getUserId());
392  if($portfolios)
393  {
394  foreach($portfolios as $portfolio)
395  {
396  $items[$portfolio["id"]]= $portfolio["title"];
397  }
398  }
399 
400  return $this->renderResourceSelection(
401  "exc_select_portfolio",
402  "exc_select_portfolio_info",
403  "setSelectedPortfolio",
404  null,
405  $items
406  );
407  }
static getPortfoliosOfUser($a_user_id)
Get views of user.
renderResourceSelection($a_title, $a_info, $a_cmd, $a_explorer_cmd, array $a_items=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setSelectedBlogObject()

ilExSubmissionObjectGUI::setSelectedBlogObject ( )
protected

Definition at line 313 of file class.ilExSubmissionObjectGUI.php.

References $_POST, ilTree\getNodeData(), ilExSubmissionBaseGUI\handleRemovedUpload(), ilExSubmissionBaseGUI\returnToParentObject(), selectPortfolioObject(), ilUtil\sendFailure(), ilUtil\sendInfo(), and ilUtil\sendSuccess().

314  {
315  if (!$this->submission->canSubmit())
316  {
317  ilUtil::sendInfo($this->lng->txt("exercise_time_over"), true);
318  $this->returnToParentObject();
319  }
320 
321  if($_POST["node"])
322  {
323  include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
324  $tree = new ilWorkspaceTree($this->submission->getUserId());
325  $node = $tree->getNodeData($_POST["node"]);
326  if($node && $node["type"] == "blog")
327  {
328  $this->submission->deleteAllFiles();
329  $this->handleRemovedUpload();
330 
331  $this->submission->addResourceObject($node["wsp_id"]);
332 
333  ilUtil::sendSuccess($this->lng->txt("exc_blog_selected"), true);
334  $this->ctrl->setParameter($this, "blog_id", $node["wsp_id"]);
335  $this->ctrl->redirect($this, "askDirectSubmission");
336  }
337  }
338 
339  ilUtil::sendFailure($this->lng->txt("select_one"));
340  return $this->selectPortfolioObject();
341  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
Tree handler for personal workspace.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
getNodeData($a_node_id, $a_tree_pk=null)
get all information of a node.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:

◆ setSelectedPortfolioObject()

ilExSubmissionObjectGUI::setSelectedPortfolioObject ( )
protected

Definition at line 516 of file class.ilExSubmissionObjectGUI.php.

References $_POST, ilExSubmissionBaseGUI\handleRemovedUpload(), ilExSubmissionBaseGUI\returnToParentObject(), selectPortfolioObject(), ilUtil\sendFailure(), ilUtil\sendInfo(), and ilUtil\sendSuccess().

517  {
518  if (!$this->submission->canSubmit())
519  {
520  ilUtil::sendInfo($this->lng->txt("exercise_time_over"), true);
521  $this->returnToParentObject();
522  }
523 
524  if($_POST["item"])
525  {
526  $this->submission->deleteAllFiles();
527  $this->handleRemovedUpload();
528 
529  $this->submission->addResourceObject($_POST["item"]);
530 
531  ilUtil::sendSuccess($this->lng->txt("exc_portfolio_selected"), true);
532  $this->ctrl->setParameter($this, "prtf_id", $_POST["item"]);
533  $this->ctrl->redirect($this, "askDirectSubmission");
534  }
535 
536  ilUtil::sendFailure($this->lng->txt("select_one"));
537  return $this->selectPortfolioObject();
538  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:

◆ setSelectedPortfolioTemplateObject()

ilExSubmissionObjectGUI::setSelectedPortfolioTemplateObject ( )
protected

Definition at line 455 of file class.ilExSubmissionObjectGUI.php.

References createPortfolioObject(), createPortfolioTemplateObject(), ilObjPortfolioTemplate\getAvailablePortfolioTemplates(), initPortfolioTemplateForm(), ilExSubmissionBaseGUI\returnToParentObject(), and ilUtil\sendInfo().

456  {
457  if (!$this->submission->canSubmit())
458  {
459  ilUtil::sendInfo($this->lng->txt("exercise_time_over"), true);
460  $this->returnToParentObject();
461  }
462 
463  include_once "Modules/Portfolio/classes/class.ilObjPortfolioTemplate.php";
465  if(!sizeof($templates))
466  {
467  $this->ctrl->redirect($this, "returnToParent");
468  }
469 
470  $form = $this->initPortfolioTemplateForm($templates);
471  if($form->checkInput())
472  {
473  $prtt = $form->getInput("prtt");
474  if($prtt > 0 && array_key_exists($prtt, $templates))
475  {
476  $title = $this->exercise->getTitle()." - ".$this->assignment->getTitle();
477  $this->ctrl->setParameterByClass("ilObjPortfolioGUI", "exc_id", $this->exercise->getRefId());
478  $this->ctrl->setParameterByClass("ilObjPortfolioGUI", "ass_id", $this->assignment->getId());
479  $this->ctrl->setParameterByClass("ilObjPortfolioGUI", "pt", $title);
480  $this->ctrl->setParameterByClass("ilObjPortfolioGUI", "prtt", $prtt);
481  $this->ctrl->redirectByClass(array("ilPersonalDesktopGUI", "ilPortfolioRepositoryGUI", "ilObjPortfolioGUI"), "createPortfolioFromTemplate");
482  }
483  else
484  {
485  // do not use template
486  return $this->createPortfolioObject();
487  }
488  }
489 
490  $form->setValuesByPost();
491  $this->createPortfolioTemplateObject($form);
492  }
createPortfolioTemplateObject(ilPropertyFormGUI $a_form=null)
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static getAvailablePortfolioTemplates($a_permission="read")
+ Here is the call graph for this function:

◆ submitBlog()

ilExSubmissionObjectGUI::submitBlog (   $a_blog_id)

Submit blog for assignment.

Parameters
int$a_blog_id
Returns
bool

Definition at line 617 of file class.ilExSubmissionObjectGUI.php.

References $file, $size, ilExSubmissionBaseGUI\handleNewUpload(), and ilObject2GUI\WORKSPACE_NODE_ID.

Referenced by directSubmitObject().

618  {
619  if(!$this->submission->canSubmit())
620  {
621  return;
622  }
623 
624  $blog_id = $a_blog_id;
625 
626  include_once "Modules/Blog/classes/class.ilObjBlogGUI.php";
627  $blog_gui = new ilObjBlogGUI($blog_id, ilObjBlogGUI::WORKSPACE_NODE_ID);
628  if($blog_gui->object)
629  {
630  $file = $blog_gui->buildExportFile();
631  $size = filesize($file);
632  if($size)
633  {
634  $this->submission->deleteAllFiles();
635 
636  $meta = array(
637  "name" => $blog_id,
638  "tmp_name" => $file,
639  "size" => $size
640  );
641  $this->submission->uploadFile($meta, true);
642 
643  $this->handleNewUpload();
644  return true;
645  }
646  }
647  return false;
648  }
print $file
$size
Definition: RandomTest.php:79
handleNewUpload($a_no_notifications=false)
Class ilObjBlogGUI.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ submitPortfolio()

ilExSubmissionObjectGUI::submitPortfolio (   $a_portfolio_id)

Submit portfolio for assignment.

Parameters
int$a_portfolio_id
Returns
bool

Definition at line 656 of file class.ilExSubmissionObjectGUI.php.

References $file, $size, and ilExSubmissionBaseGUI\handleNewUpload().

Referenced by directSubmitObject().

657  {
658  if(!$this->submission->canSubmit())
659  {
660  return;
661  }
662 
663  $prtf_id = $a_portfolio_id;
664 
665  include_once "Modules/Portfolio/classes/class.ilObjPortfolio.php";
666  $prtf = new ilObjPortfolio($prtf_id, false);
667  if($prtf->getTitle())
668  {
669  include_once "Modules/Portfolio/classes/class.ilPortfolioHTMLExport.php";
670  $export = new ilPortfolioHTMLExport(null, $prtf);
671  $file = $export->buildExportFile();
672  $size = filesize($file);
673  if($size)
674  {
675  $this->submission->deleteAllFiles();
676 
677  $meta = array(
678  "name" => $prtf_id,
679  "tmp_name" => $file,
680  "size" => $size
681  );
682  $this->submission->uploadFile($meta, true);
683 
684  $this->handleNewUpload();
685  return true;
686  }
687  }
688  return false;
689  }
print $file
$size
Definition: RandomTest.php:79
Portfolio HTML exporter class.
handleNewUpload($a_no_notifications=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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