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

Class ilPCQuestionOverviewGUI. More...

+ Inheritance diagram for ilPCQuestionOverviewGUI:
+ Collaboration diagram for ilPCQuestionOverviewGUI:

Public Member Functions

 __construct (&$a_pg_obj, &$a_content_obj, $a_hier_id, $a_pc_id="")
 Constructor. More...
 
 executeCommand ()
 Execute command. More...
 
 insert ()
 Insert new question overview. More...
 
 edit ($a_insert=false)
 Edit question overview form. More...
 
 create ()
 Create new question overview. More...
 
 update ()
 Update question overview. More...
 
- Public Member Functions inherited from ilPageContentGUI
 __construct ($a_pg_obj, $a_content_obj, $a_hier_id=0, $a_pc_id="")
 Constructor public. More...
 
 setContentObject ($a_val)
 Set content object. More...
 
 getContentObject ()
 Get content object. More...
 
 setPage ($a_val)
 Set page. More...
 
 getPage ()
 Get page. More...
 
 setPageConfig ($a_val)
 Set Page Config. More...
 
 getPageConfig ()
 Get Page Config. More...
 
 setStyleId ($a_styleid)
 Set Style Id. More...
 
 getStyleId ()
 Get Style Id. More...
 
 getStyle ()
 Get style object. More...
 
 setCharacteristics ($a_chars)
 Set Characteristics. More...
 
 getCharacteristics ()
 Get characteristics. More...
 
 getHierId ()
 get hierarchical id in dom object More...
 
 setHierId ($a_hier_id)
 get hierarchical id in dom object More...
 
 getBBMenu ($a_ta_name="par_content")
 Get the bb menu incl. More...
 
 delete ()
 delete content element More...
 
 moveAfter ()
 move content element after another element More...
 
 moveBefore ()
 move content element before another element More...
 
 splitPage ()
 split page to new page at specified position More...
 
 splitPageNext ()
 split page to next page at specified position More...
 
 displayValidationError ()
 display validation errors More...
 
 cancelCreate ()
 cancel creating page content More...
 
 cancelUpdate ()
 cancel update More...
 
 cancel ()
 Cancel. More...
 
 deactivate ()
 gui function set enabled if is not enabled and vice versa More...
 
 cut ()
 Cut single element. More...
 
 copy ()
 Copy single element. More...
 
 getTemplateOptions ($a_type)
 Get table templates. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from ilPageContentGUI
static _getCommonBBButtons ()
 Get common bb buttons. More...
 
- Data Fields inherited from ilPageContentGUI
 $content_obj
 
 $ilias
 
 $tpl
 
 $lng
 
 $ctrl
 
 $pg_obj
 
 $hier_id
 
 $dom
 
 $updated
 
 $target_script
 
 $return_location
 
 $page_config = null
 
- Static Public Attributes inherited from ilPageContentGUI
static $style_selector_reset = "margin-top:2px; margin-bottom:2px; text-indent:0px; position:static; float:none; width: auto;"
 
- Protected Member Functions inherited from ilPageContentGUI
 getCharacteristicsOfCurrentStyle ($a_type)
 Get characteristics of current style. More...
 
- Protected Attributes inherited from ilPageContentGUI
 $log
 
- Static Protected Attributes inherited from ilPageContentGUI
static $common_bb_buttons
 

Detailed Description

Class ilPCQuestionOverviewGUI.

User Interface for question overview editing

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

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

Constructor & Destructor Documentation

◆ __construct()

ilPCQuestionOverviewGUI::__construct ( $a_pg_obj,
$a_content_obj,
  $a_hier_id,
  $a_pc_id = "" 
)

Constructor.

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

24  {
25  parent::__construct($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id);
26  }

Member Function Documentation

◆ create()

ilPCQuestionOverviewGUI::create ( )

Create new question overview.

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

References $_POST, ilPageContentGUI\getPage(), insert(), and ilUtil\stripSlashes().

122  {
123  $this->content_obj = new ilPCQuestionOverview($this->getPage());
124  $this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
125  $this->content_obj->setShortMessage(ilUtil::stripSlashes($_POST["short"]));
126  $this->content_obj->setListWrongQuestions(ilUtil::stripSlashes($_POST["wrong_questions"]));
127  $this->updated = $this->pg_obj->update();
128  if ($this->updated === true)
129  {
130  $this->ctrl->returnToParent($this, "jump".$this->hier_id);
131  }
132  else
133  {
134  $this->insert();
135  }
136  }
Question overview page content element.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
$_POST["username"]
insert()
Insert new question overview.
+ Here is the call graph for this function:

◆ edit()

ilPCQuestionOverviewGUI::edit (   $a_insert = false)

Edit question overview form.

Definition at line 61 of file class.ilPCQuestionOverviewGUI.php.

References $html, $ilCtrl, ilPageContentGUI\$lng, $ret, ilPageContentGUI\$tpl, ilPageContentGUI\displayValidationError(), and ilFormPropertyGUI\setInfo().

Referenced by insert(), and update().

62  {
63  global $ilCtrl, $tpl, $lng;
64 
65  $this->displayValidationError();
66 
67  // edit form
68  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
69  $form = new ilPropertyFormGUI();
70  $form->setFormAction($ilCtrl->getFormAction($this));
71  if ($a_insert)
72  {
73  $form->setTitle($this->lng->txt("cont_ed_insert_qover"));
74  }
75  else
76  {
77  $form->setTitle($this->lng->txt("cont_edit_qover"));
78  }
79 
80  // short message
81  $cb = new ilCheckboxInputGUI($this->lng->txt("cont_qover_short_message"), "short");
82  $cb->setInfo($this->lng->txt("cont_qover_short_message_info"));
83  if (!$a_insert)
84  {
85  $cb->setChecked($this->content_obj->getShortMessage());
86  }
87  else
88  {
89  $cb->setChecked(true);
90  }
91  $form->addItem($cb);
92 
93  // list wrong questions
94  $cb = new ilCheckboxInputGUI($this->lng->txt("cont_qover_list_wrong_q"), "wrong_questions");
95  $cb->setInfo($this->lng->txt("cont_qover_list_wrong_q_info"));
96  if (!$a_insert)
97  {
98  $cb->setChecked($this->content_obj->getListWrongQuestions());
99  }
100  $form->addItem($cb);
101 
102  // save/cancel buttons
103  if ($a_insert)
104  {
105  $form->addCommandButton("create_qover", $lng->txt("save"));
106  $form->addCommandButton("cancelCreate", $lng->txt("cancel"));
107  }
108  else
109  {
110  $form->addCommandButton("update", $lng->txt("save"));
111  $form->addCommandButton("cancelUpdate", $lng->txt("cancel"));
112  }
113  $html = $form->getHTML();
114  $tpl->setContent($html);
115  return $ret;
116  }
This class represents a property form user interface.
This class represents a checkbox property in a property form.
global $ilCtrl
Definition: ilias.php:18
setInfo($a_info)
Set Information Text.
displayValidationError()
display validation errors
$ret
Definition: parser.php:6
$html
Definition: example_001.php:87
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilPCQuestionOverviewGUI::executeCommand ( )

Execute command.

Definition at line 32 of file class.ilPCQuestionOverviewGUI.php.

References $cmd, and $ret.

33  {
34  // get next class that processes or forwards current command
35  $next_class = $this->ctrl->getNextClass($this);
36 
37  // get current command
38  $cmd = $this->ctrl->getCmd();
39 
40  switch($next_class)
41  {
42  default:
43  $ret = $this->$cmd();
44  break;
45  }
46 
47  return $ret;
48  }
$cmd
Definition: sahs_server.php:35
$ret
Definition: parser.php:6

◆ insert()

ilPCQuestionOverviewGUI::insert ( )

Insert new question overview.

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

References edit().

Referenced by create().

54  {
55  $this->edit(true);
56  }
edit($a_insert=false)
Edit question overview form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ update()

ilPCQuestionOverviewGUI::update ( )

Update question overview.

Definition at line 141 of file class.ilPCQuestionOverviewGUI.php.

References $_POST, edit(), and ilUtil\stripSlashes().

142  {
143  $this->content_obj->setShortMessage(ilUtil::stripSlashes($_POST["short"]));
144  $this->content_obj->setListWrongQuestions(ilUtil::stripSlashes($_POST["wrong_questions"]));
145  $this->updated = $this->pg_obj->update();
146  if ($this->updated === true)
147  {
148  $this->ctrl->returnToParent($this, "jump".$this->hier_id);
149  }
150  else
151  {
152  $this->pg_obj->addHierIDs();
153  $this->edit();
154  }
155  }
edit($a_insert=false)
Edit question overview form.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
$_POST["username"]
+ Here is the call graph for this function:

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