ILIAS  release_7 Revision v7.30-3-g800a261c036
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 @access 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...
 
 getCharacteristicsOfCurrentStyle ($a_type)
 Get characteristics of current style. 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
 
 $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
 redirectToParent ($hier_id="")
 Redirect to parent. More...
 
 getParentReturn ($hier_id="")
 
- Protected Attributes inherited from ilPageContentGUI
 $error
 
 $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 global $DIC;
26
27 $this->ctrl = $DIC->ctrl();
28 $this->tpl = $DIC["tpl"];
29 $this->lng = $DIC->language();
30 parent::__construct($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id);
31 }
global $DIC
Definition: goto.php:24
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References $DIC, and ILIAS\GlobalScreen\Provider\__construct().

+ Here is the call graph for this function:

Member Function Documentation

◆ create()

ilPCQuestionOverviewGUI::create ( )

Create new question overview.

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

118 {
119 $this->content_obj = new ilPCQuestionOverview($this->getPage());
120 $this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
121 $this->content_obj->setShortMessage(ilUtil::stripSlashes($_POST["short"]));
122 $this->content_obj->setListWrongQuestions(ilUtil::stripSlashes($_POST["wrong_questions"]));
123 $this->updated = $this->pg_obj->update();
124 if ($this->updated === true) {
125 $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
126 } else {
127 $this->insert();
128 }
129 }
$_POST["username"]
insert()
Insert new question overview.
Question overview page content element.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled

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

+ Here is the call graph for this function:

◆ edit()

ilPCQuestionOverviewGUI::edit (   $a_insert = false)

Edit question overview form.

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

66 {
67 $ilCtrl = $this->ctrl;
70
72
73 // edit form
74 include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
75 $form = new ilPropertyFormGUI();
76 $form->setFormAction($ilCtrl->getFormAction($this));
77 if ($a_insert) {
78 $form->setTitle($this->lng->txt("cont_ed_insert_qover"));
79 } else {
80 $form->setTitle($this->lng->txt("cont_edit_qover"));
81 }
82
83 // short message
84 $cb = new ilCheckboxInputGUI($this->lng->txt("cont_qover_short_message"), "short");
85 $cb->setInfo($this->lng->txt("cont_qover_short_message_info"));
86 if (!$a_insert) {
87 $cb->setChecked($this->content_obj->getShortMessage());
88 } else {
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 $cb->setChecked($this->content_obj->getListWrongQuestions());
98 }
99 $form->addItem($cb);
100
101 // save/cancel buttons
102 if ($a_insert) {
103 $form->addCommandButton("create_qover", $lng->txt("save"));
104 $form->addCommandButton("cancelCreate", $lng->txt("cancel"));
105 } else {
106 $form->addCommandButton("update", $lng->txt("save"));
107 $form->addCommandButton("cancelUpdate", $lng->txt("cancel"));
108 }
109 $html = $form->getHTML();
110 $tpl->setContent($html);
111 return $ret;
112 }
This class represents a checkbox property in a property form.
displayValidationError()
display validation errors
This class represents a property form user interface.
$ret
Definition: parser.php:6

References ilPageContentGUI\$ctrl, ilPageContentGUI\$lng, $ret, ilPageContentGUI\$tpl, and ilPageContentGUI\displayValidationError().

Referenced by insert(), and update().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilPCQuestionOverviewGUI::executeCommand ( )

Execute command.

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

38 {
39 // get next class that processes or forwards current command
40 $next_class = $this->ctrl->getNextClass($this);
41
42 // get current command
43 $cmd = $this->ctrl->getCmd();
44
45 switch ($next_class) {
46 default:
47 $ret = $this->$cmd();
48 break;
49 }
50
51 return $ret;
52 }

References $ret.

◆ insert()

ilPCQuestionOverviewGUI::insert ( )

Insert new question overview.

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

58 {
59 $this->edit(true);
60 }
edit($a_insert=false)
Edit question overview form.

References edit().

Referenced by create().

+ 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 134 of file class.ilPCQuestionOverviewGUI.php.

135 {
136 $this->content_obj->setShortMessage(ilUtil::stripSlashes($_POST["short"]));
137 $this->content_obj->setListWrongQuestions(ilUtil::stripSlashes($_POST["wrong_questions"]));
138 $this->updated = $this->pg_obj->update();
139 if ($this->updated === true) {
140 $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
141 } else {
142 $this->pg_obj->addHierIDs();
143 $this->edit();
144 }
145 }

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

+ Here is the call graph for this function:

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