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

Class ilPCVerificationGUI. More...

+ Inheritance diagram for ilPCVerificationGUI:
+ Collaboration diagram for ilPCVerificationGUI:

Public Member Functions

 __construct (&$a_pg_obj, &$a_content_obj, $a_hier_id, $a_pc_id="")
 Constructor public. More...
 
 executeCommand ()
 execute command More...
 
 insert (ilPropertyFormGUI $a_form=null)
 Insert new verification form. More...
 
 edit (ilPropertyFormGUI $a_form=null)
 Edit verification form. More...
 
 create ()
 Create new verification. More...
 
 update ()
 Update verification. 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...
 

Protected Member Functions

 initForm ($a_insert=false)
 Init verification form. More...
 
- Protected Member Functions inherited from ilPageContentGUI
 getCharacteristicsOfCurrentStyle ($a_type)
 Get characteristics of current style. 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 Attributes inherited from ilPageContentGUI
 $log
 
- Static Protected Attributes inherited from ilPageContentGUI
static $common_bb_buttons
 

Detailed Description

Class ilPCVerificationGUI.

Handles user commands on verifications

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

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

Constructor & Destructor Documentation

◆ __construct()

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

Constructor public.

Definition at line 44 of file class.ilPCVerificationGUI.php.

45  {
46  parent::__construct($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id);
47  }

Member Function Documentation

◆ create()

ilPCVerificationGUI::create ( )

Create new verification.

Definition at line 171 of file class.ilPCVerificationGUI.php.

References ilObject\_lookupType(), ilPageContentGUI\getPage(), initForm(), and insert().

172  {
173  $form = $this->initForm(true);
174  if($form->checkInput())
175  {
176  $type = ilObject::_lookupType($form->getInput("object"));
177  if($type)
178  {
179  $this->content_obj = new ilPCVerification($this->getPage());
180  $this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
181  $this->content_obj->setData($type, $form->getInput("object"));
182  $this->updated = $this->pg_obj->update();
183  if ($this->updated === true)
184  {
185  $this->ctrl->returnToParent($this, "jump".$this->hier_id);
186  }
187  }
188  }
189 
190  $this->insert($form);
191  }
insert(ilPropertyFormGUI $a_form=null)
Insert new verification form.
initForm($a_insert=false)
Init verification form.
Class ilPCVerification.
static _lookupType($a_id, $a_reference=false)
lookup object type
+ Here is the call graph for this function:

◆ edit()

ilPCVerificationGUI::edit ( ilPropertyFormGUI  $a_form = null)

Edit verification form.

Parameters
ilPropertyFormGUI$a_form

Definition at line 93 of file class.ilPCVerificationGUI.php.

References ilPageContentGUI\$tpl, ilPageContentGUI\displayValidationError(), and initForm().

Referenced by update().

94  {
95  global $tpl;
96 
97  $this->displayValidationError();
98 
99  if(!$a_form)
100  {
101  $a_form = $this->initForm();
102  }
103  $tpl->setContent($a_form->getHTML());
104  }
initForm($a_insert=false)
Init verification form.
displayValidationError()
display validation errors
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilPCVerificationGUI::executeCommand ( )

execute command

Definition at line 52 of file class.ilPCVerificationGUI.php.

References $cmd, and $ret.

53  {
54  // get next class that processes or forwards current command
55  $next_class = $this->ctrl->getNextClass($this);
56 
57  // get current command
58  $cmd = $this->ctrl->getCmd();
59 
60  switch($next_class)
61  {
62  default:
63  $ret = $this->$cmd();
64  break;
65  }
66 
67  return $ret;
68  }
$cmd
Definition: sahs_server.php:35
$ret
Definition: parser.php:6

◆ initForm()

ilPCVerificationGUI::initForm (   $a_insert = false)
protected

Init verification form.

Parameters
bool$a_insert
Returns
ilPropertyFormGUI

Definition at line 112 of file class.ilPCVerificationGUI.php.

References $data, $ilCtrl, $ilUser, ilPageContentGUI\$lng, $options, array, ilTree\getNodeData(), ilTree\getRootId(), and ilFormPropertyGUI\setRequired().

Referenced by create(), edit(), insert(), and update().

113  {
114  global $ilCtrl, $ilUser, $lng;
115 
116  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
117  $form = new ilPropertyFormGUI();
118  $form->setFormAction($ilCtrl->getFormAction($this));
119  if ($a_insert)
120  {
121  $form->setTitle($this->lng->txt("cont_insert_verification"));
122  }
123  else
124  {
125  $form->setTitle($this->lng->txt("cont_update_verification"));
126  }
127 
128  $lng->loadLanguageModule("wsp");
129  $options = array();
130  include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
131  $tree = new ilWorkspaceTree($ilUser->getId());
132  $root = $tree->getRootId();
133  if($root)
134  {
135  $root = $tree->getNodeData($root);
136  foreach ($tree->getSubTree($root) as $node)
137  {
138  if (in_array($node["type"], array("excv", "tstv", "crsv", "scov")))
139  {
140  $options[$node["obj_id"]] = $node["title"]." (".$lng->txt("wsp_type_".$node["type"]).")";
141  }
142  }
143  asort($options);
144  }
145  $obj = new ilSelectInputGUI($this->lng->txt("cont_verification_object"), "object");
146  $obj->setRequired(true);
147  $obj->setOptions($options);
148  $form->addItem($obj);
149 
150  if ($a_insert)
151  {
152 
153  $form->addCommandButton("create_verification", $this->lng->txt("save"));
154  $form->addCommandButton("cancelCreate", $this->lng->txt("cancel"));
155  }
156  else
157  {
158  $data = $this->content_obj->getData();
159  $obj->setValue($data["id"]);
160 
161  $form->addCommandButton("update", $this->lng->txt("save"));
162  $form->addCommandButton("cancelUpdate", $this->lng->txt("cancel"));
163  }
164 
165  return $form;
166  }
This class represents a selection list property in a property form.
This class represents a property form user interface.
Tree handler for personal workspace.
global $ilCtrl
Definition: ilias.php:18
if(!is_array($argv)) $options
getRootId()
get the root id of tree public
getNodeData($a_node_id, $a_tree_pk=null)
get all information of a node.
$ilUser
Definition: imgupload.php:18
Create styles array
The data for the language used.
setRequired($a_required)
Set Required.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ insert()

ilPCVerificationGUI::insert ( ilPropertyFormGUI  $a_form = null)

Insert new verification form.

Parameters
ilPropertyFormGUI$a_form

Definition at line 75 of file class.ilPCVerificationGUI.php.

References ilPageContentGUI\$tpl, ilPageContentGUI\displayValidationError(), and initForm().

Referenced by create().

76  {
77  global $tpl;
78 
79  $this->displayValidationError();
80 
81  if(!$a_form)
82  {
83  $a_form = $this->initForm(true);
84  }
85  $tpl->setContent($a_form->getHTML());
86  }
initForm($a_insert=false)
Init verification form.
displayValidationError()
display validation errors
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ update()

ilPCVerificationGUI::update ( )

Update verification.

Definition at line 196 of file class.ilPCVerificationGUI.php.

References ilObject\_lookupType(), edit(), and initForm().

197  {
198  $form = $this->initForm(true);
199  if($form->checkInput())
200  {
201  $type = ilObject::_lookupType($form->getInput("object"));
202  if($type)
203  {
204  $this->content_obj->setData($type, $form->getInput("object"));
205  $this->updated = $this->pg_obj->update();
206  if ($this->updated === true)
207  {
208  $this->ctrl->returnToParent($this, "jump".$this->hier_id);
209  }
210  }
211  }
212 
213  $this->pg_obj->addHierIDs();
214  $this->edit($form);
215  }
initForm($a_insert=false)
Init verification form.
static _lookupType($a_id, $a_reference=false)
lookup object type
edit(ilPropertyFormGUI $a_form=null)
Edit verification form.
+ Here is the call graph for this function:

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