ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilObject2GUI Class Reference

New implementation of ilObjectGUI. More...

+ Inheritance diagram for ilObject2GUI:
+ Collaboration diagram for ilObject2GUI:

Public Member Functions

 __construct ($a_id=0, $a_call_by_reference=true)
 Constructor.
executeCommand ()
 execute command
 performCommand ($cmd)
 Handles all commmands of this class, centralizes permission checks.
 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
 getHTML ()
 isVisible ()
 deleteObject ()
 trashObject ()
 Show trash content of object.
 undeleteObject ()
 Get objects back from trash.
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled
 cancelDeleteObject ()
 cancel deletion of object
 removeFromSystemObject ()
 remove objects from trash bin and all entries therefore every object needs a specific deleteObject() method
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI.
 viewObject ()
 list childs of current object
 getAdminTabs ($a)
 getTemplateFile ()
 copyWizardHasOptions ($a_mode)
 Check if there is any modules specific option.
 getType ()
 Functions that must be overwritten.
 deactivateCreationForm ($a_type)
 Deleted in ilObject.
 addCreationForm ($a_header, $a_form)
 Add creation form.
 create ()
 Create new object form.
 getCreationFormsHTML ()
 Get HTML for creation forms.
 save ()
 Save object.
 initEditForm ($a_mode="edit", $a_new_type="")
 Init object creation form.
 getEditFormValues ()
 Get values for edit form.
 cancelCreation ($in_rep=false)
 cancel action and go back to previous page public
 editObject ()
 edit object
 cancelUpdate ()
 cancel action and go back to previous page public
 updateObject ()
 updates object entry in object_data
 afterUpdate ()
 initImportForm ($a_new_type="")
 Init object import form.
 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
 createObject ()
 create new object form
 cancelObject ($in_rep=false)
 cancel action and go back to previous page public
 saveObject ()
 save object
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g.
 isVisible ($a_ref_id, $a_type)
 deleteObject ($a_error=false)
 Display deletion confirmation screen.
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl.

Data Fields

const CFORM_NEW = "new"
const CFORM_CLONE = "clone"
const CFORM_IMPORT = "import"
- Data Fields inherited from ilObjectGUI
const COPY_WIZARD_NEEDS_PAGE = 1
 $ilias
 $objDefinition
 $tpl
 $tree
 $lng
 $data
 $object
 $ref_id
 $obj_id
 $maxcount
 $formaction
 $return_location
 $target_frame
 $tab_target_script
 $actions
 $sub_objects
 $omit_locator = false

Protected Member Functions

 afterConstructor ()
 Do anything that should be done after constructor in here.
 assignObject ()
 prepareOutput ()
 prepare output
 setTitleAndDescription ()
 called by prepare output
 showUpperIcon ()
 setLocator ()
 set Locator
 omitLocator ($a_omit=true)
 getTargetFrame ()
 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)
 searchCloneSourceObject ()
 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 ()
 addLocatorItems ()
 Functions to be overwritten.
 setTabs ()
 set admin tabs public
 initCreationForms ()
 Init creation froms.
 cancel ()
 cancel action and go back to previous page public
- Protected Member Functions inherited from ilObjectGUI
 setAdminTabs ()
 set admin tabs public
 displayEditForm ($fields)
 display edit form (usually called by editObject)
 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
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g.
 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

Protected Attributes

 $creation_forms = array()

Private Member Functions

 displayList ()

Detailed Description

New implementation of ilObjectGUI.

(beta)

Differences to the ilObject implementation:

  • no $this->ilias anymore
  • no $this->tree anymore
  • no $this->formaction anymore
  • no $this->return_location anymore
  • no $this->target_frame anymore
  • no $this->actions anymore
  • no $this->sub_objects anymore
  • no $this->data anymore
  • no $this->prepare_output anymore

All new modules should derive from this class.

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

Definition at line 27 of file class.ilObject2GUI.php.

Constructor & Destructor Documentation

ilObject2GUI::__construct (   $a_id = 0,
  $a_call_by_reference = true 
)

Constructor.

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

References $_GET, $ilCtrl, $ilErr, ilObjectGUI\$lng, ilObjectGUI\$objDefinition, ilObjectGUI\$tpl, afterConstructor(), assignObject(), CFORM_CLONE, CFORM_IMPORT, CFORM_NEW, getType(), and PEAR_ERROR_CALLBACK.

{
global $objDefinition, $tpl, $ilCtrl, $ilErr, $lng, $ilTabs;
$this->creation_forms = array(
);
$this->type = $this->getType();
$this->tabs_gui =& $ilTabs;
if (!isset($ilErr))
{
$ilErr = new ilErrorHandling();
$ilErr->setErrorHandling(PEAR_ERROR_CALLBACK,array($ilErr,'errorHandler'));
}
else
{
$this->ilErr =& $ilErr;
}
$this->objDefinition = $objDefinition;
$this->tpl = $tpl;
$this->html = "";
$this->ctrl = $ilCtrl;
$params = array("ref_id");
if (!$a_call_by_reference)
{
$params = array("ref_id","obj_id");
}
$this->ctrl->saveParameter($this, $params);
$this->id = $a_id;
$this->call_by_reference = $a_call_by_reference;
$this->creation_mode = false;
$this->ref_id = ($this->call_by_reference) ? $this->id : $_GET["ref_id"];
$this->obj_id = ($this->call_by_reference) ? $_GET["obj_id"] : $this->id;
$this->lng = $lng;
$this->assignObject();
// set context
if (is_object($this->object))
{
if ($this->call_by_reference && $this->ref_id = $_GET["ref_id"])
{
$this->ctrl->setContext($this->object->getId(),
$this->object->getType());
}
}
$this->afterConstructor();
}

+ Here is the call graph for this function:

Member Function Documentation

ilObject2GUI::__initTableGUI ( )
finalprotected

Reimplemented from ilObjectGUI.

Definition at line 205 of file class.ilObject2GUI.php.

{ die("ilObject2GUI::__initTableGUI() is deprecated."); }
ilObject2GUI::__setTableGUIBasicData ( )
finalprotected

Definition at line 206 of file class.ilObject2GUI.php.

{ die("ilObject2GUI::__setTableGUIBasicData() is deprecated."); }
ilObject2GUI::__showButton ( )
finalprotected

Definition at line 203 of file class.ilObject2GUI.php.

{ die("ilObject2GUI::__showButton() is deprecated."); }
ilObject2GUI::__showClipboardTable ( )
finalprotected

Definition at line 207 of file class.ilObject2GUI.php.

{ die("ilObject2GUI::__showClipboardTable() is deprecated."); }
ilObject2GUI::addAdminLocatorItems ( )
finalprotected

should be overwritten to add object specific items (repository items are preloaded)

Reimplemented from ilObjectGUI.

Definition at line 189 of file class.ilObject2GUI.php.

Referenced by ilObjectPluginGUI\executeCommand().

+ Here is the caller graph for this function:

ilObject2GUI::addCreationForm (   $a_header,
  $a_form 
)

Add creation form.

Parameters
objectform object

Definition at line 258 of file class.ilObject2GUI.php.

{
$this->creation_forms[] = array("header" => $a_header,
"form" => $a_form);
}
ilObject2GUI::addLocatorItems ( )
protected

Functions to be overwritten.

Reimplemented from ilObjectGUI.

Reimplemented in ilObjMediaPoolGUI, and ilObjectPluginGUI.

Definition at line 212 of file class.ilObject2GUI.php.

{}
ilObject2GUI::afterConstructor ( )
protected

Do anything that should be done after constructor in here.

Reimplemented in ilObjMediaPoolGUI.

Definition at line 100 of file class.ilObject2GUI.php.

Referenced by __construct().

{
}

+ Here is the caller graph for this function:

ilObject2GUI::afterUpdate ( )

Reimplemented from ilObjectGUI.

Reimplemented in ilObjMediaPoolGUI.

Definition at line 550 of file class.ilObject2GUI.php.

Referenced by updateObject().

{
$this->ctrl->redirect($this);
}

+ Here is the caller graph for this function:

ilObject2GUI::assignObject ( )
finalprotected

Reimplemented from ilObjectGUI.

Definition at line 149 of file class.ilObject2GUI.php.

Referenced by __construct().

{ return parent::assignObject(); }

+ Here is the caller graph for this function:

ilObject2GUI::buildCloneSelect (   $existing_objs)
finalprotected

Definition at line 182 of file class.ilObject2GUI.php.

{ return parent::buildCloneSelect($existing_objs); }
ilObject2GUI::cancel ( )
protected

cancel action and go back to previous page public

Reimplemented in ilObjMediaPoolGUI.

Definition at line 488 of file class.ilObject2GUI.php.

{
$this->ctrl->returnToParent($this);
}
ilObject2GUI::cancelCreation (   $in_rep = false)
final

cancel action and go back to previous page public

Definition at line 498 of file class.ilObject2GUI.php.

References $_GET, and ilUtil\redirect().

{
ilUtil::redirect("repository.php?cmd=frameset&ref_id=".$_GET["ref_id"]);
}

+ Here is the call graph for this function:

ilObject2GUI::cancelDeleteObject ( )
final

cancel deletion of object

public

Reimplemented from ilObjectGUI.

Definition at line 173 of file class.ilObject2GUI.php.

{ return parent::cancelDeleteObject(); } // ok
ilObject2GUI::cancelUpdate ( )
final

cancel action and go back to previous page public

Definition at line 522 of file class.ilObject2GUI.php.

{
$this->ctrl->redirect($this);
}
ilObject2GUI::checkPermission (   $a_perm,
  $a_cmd = "" 
)
finalprotected

Reimplemented from ilObjectGUI.

Definition at line 163 of file class.ilObject2GUI.php.

Referenced by ilObjMediaPoolGUI\copyToClipboard(), ilObjectPluginGUI\executeCommand(), and ilObjectPluginGUI\infoScreen().

{ return parent::checkPermission($a_perm, $a_cmd); }

+ Here is the caller graph for this function:

ilObject2GUI::cloneAllObject ( )
final

Clone single (not container object) Method is overwritten in ilContainerGUI.

public

Reimplemented from ilObjectGUI.

Definition at line 181 of file class.ilObject2GUI.php.

Referenced by ilObjectPluginGUI\cloneAll().

+ Here is the caller graph for this function:

ilObject2GUI::confirmedDeleteObject ( )
final

confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled

Reimplemented from ilObjectGUI.

Definition at line 172 of file class.ilObject2GUI.php.

{ return parent::confirmedDeleteObject(); } // done
ilObject2GUI::copyWizardHasOptions (   $a_mode)

Check if there is any modules specific option.

public

Parameters
intwizard mode COPY_WIZARD_GENERAL,COPY_WIZARD_NEEDS_PAGE, COPY_WIZARD_OBJ_SPECIFIC

Reimplemented from ilObjectGUI.

Definition at line 213 of file class.ilObject2GUI.php.

{ return false; }
ilObject2GUI::create ( )

Create new object form.

public

Definition at line 269 of file class.ilObject2GUI.php.

References $_GET, $_POST, $ilCtrl, ilObjectGUI\$tpl, getCreationFormsHTML(), and initCreationForms().

{
global $rbacsystem, $tpl, $ilCtrl;
$new_type = $_POST["new_type"] ? $_POST["new_type"] : $_GET["new_type"];
$ilCtrl->setParameter($this, "new_type", $new_type);
if (!$rbacsystem->checkAccess("create", $_GET["ref_id"], $new_type))
{
$this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
}
else
{
$tpl->setContent($this->getCreationFormsHTML());
// $this->ctrl->setParameter($this, "new_type", $new_type);
// $this->initEditForm("create", $new_type);
// $tpl->setContent($this->form->getHTML());
// if ($new_type != "mep") // bad hack, should be removed (implemented!)
// {
// $clone_html = $this->fillCloneTemplate('', $new_type);
// }
// $tpl->setContent($this->form->getHTML().$clone_html);
}
}

+ Here is the call graph for this function:

ilObject2GUI::deactivateCreationForm (   $a_type)

Deleted in ilObject.

Deactivate creation form

Parameters
@return

Definition at line 241 of file class.ilObject2GUI.php.

Referenced by ilObjMediaPoolGUI\initCreationForms().

{
foreach ($this->creation_forms as $k => $v)
{
if ($v == $a_type)
{
unset($this->creation_forms[$k]);
break;
}
}
}

+ Here is the caller graph for this function:

ilObject2GUI::deleteObject ( )
final

Definition at line 168 of file class.ilObject2GUI.php.

{ return parent::deleteObject(); } // done
ilObject2GUI::displayList ( )
finalprivate

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

{ return parent::displayList(); }
ilObject2GUI::editObject ( )

edit object

public

Reimplemented from ilObjectGUI.

Reimplemented in ilObjMediaPoolGUI.

Definition at line 508 of file class.ilObject2GUI.php.

References ilObjectGUI\$tpl, getEditFormValues(), and initEditForm().

{
global $tpl;
$this->initEditForm("edit");
$tpl->setContent($this->form->getHTML());
}

+ Here is the call graph for this function:

& ilObject2GUI::executeCommand ( )

execute command

Reimplemented from ilObjectGUI.

Reimplemented in ilObjMediaPoolGUI, and ilObjectPluginGUI.

Definition at line 107 of file class.ilObject2GUI.php.

References $cmd, and performCommand().

{
global $rbacsystem;
$next_class = $this->ctrl->getNextClass($this);
$cmd = $this->ctrl->getCmd();
switch($next_class)
{
default:
if(!$cmd)
{
$cmd = "view";
}
return $this->performCommand($cmd);
break;
}
return true;
}

+ Here is the call graph for this function:

ilObject2GUI::fillCloneSearchTemplate (   $a_tpl_varname,
  $a_type 
)
finalprotected

Definition at line 179 of file class.ilObject2GUI.php.

{ return parent::fillCloneSearchTemplate($a_tpl_varname,$a_type); }
ilObject2GUI::fillCloneTemplate (   $a_tpl_varname,
  $a_type 
)
finalprotected

Fill object clone template This method can be called from any object GUI class that wants to offer object cloning.

public

Parameters
stringtemplate variable name that will be filled
stringtype of new object

Reimplemented from ilObjectGUI.

Definition at line 178 of file class.ilObject2GUI.php.

Referenced by getCreationFormsHTML().

{ return parent::fillCloneTemplate($a_tpl_varname,$a_type); }

+ Here is the caller graph for this function:

ilObject2GUI::getAdminTabs (   $a)
final

Definition at line 188 of file class.ilObject2GUI.php.

{ return parent::getAdminTabs($a); }
ilObject2GUI::getCenterColumnHTML ( )
finalprotected

Get center column.

Reimplemented from ilObjectGUI.

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

ilObject2GUI::getCreationFormsHTML ( )

Get HTML for creation forms.

Definition at line 307 of file class.ilObject2GUI.php.

References $_GET, $_POST, ilObjectGUI\$lng, CFORM_CLONE, CFORM_IMPORT, CFORM_NEW, fillCloneTemplate(), initEditForm(), and initImportForm().

Referenced by create().

{
global $lng;
$new_type = $_POST["new_type"] ? $_POST["new_type"] : $_GET["new_type"];
$lng->loadLanguageModule($new_type);
if (count($this->creation_forms) == 1)
{
$cf = $this->creation_forms[0];
if (is_array($cf))
{
return $cf["form"]->getHTML();
}
else if ($cf == ilObject2GUI::CFORM_NEW)
{
$this->initEditForm("create", $new_type);
return $this->form->getHTML();
}
else if ($cf == ilObject2GUI::CFORM_CLONE)
{
return "";
return $this->fillCloneTemplate('', $new_type);
}
{
$this->initImportForm($new_type);
return $this->form->getHTML();
}
}
else if (count($this->creation_forms) > 1)
{
include_once("./Services/Accordion/classes/class.ilAccordionGUI.php");
$html = "";
// $acc = new ilAccordionGUI();
// $acc->setBehaviour(ilAccordionGUI::FIRST_OPEN);
$cnt = 1;
foreach ($this->creation_forms as $cf)
{
// $htpl = new ilTemplate("tpl.creation_acc_head.html", true, true, "Services/Object");
// $htpl->setVariable("IMG_ARROW", ilUtil::getImagePath("accordion_arrow.gif"));
// $ot = $lng->txt("option")." ".$cnt.": ";
if (is_array($cf))
{
// $htpl->setVariable("TITLE", $ot.$cf["header"]);
// $acc->addItem($htpl->get(), $cf["form"]->getHTML());
$html.= $cf["form"]->getHTML()."<br />";
}
else if ($cf == ilObject2GUI::CFORM_NEW)
{
$this->initEditForm("create", $new_type);
// $htpl->setVariable("TITLE", $ot.$lng->txt($new_type."_create"));
// $acc->addItem($htpl->get(), $this->form->getHTML());
$html.= $this->form->getHTML()."<br />";
}
else if ($cf == ilObject2GUI::CFORM_CLONE)
{
// $clone_html = $this->fillCloneTemplate('', $new_type);
// $htpl->setVariable("TITLE", $ot.$lng->txt($new_type."_clone"));
// $acc->addItem($htpl->get(), $clone_html);
}
{
$this->initImportForm($new_type);
// $htpl->setVariable("TITLE", $ot.$lng->txt($new_type."_import"));
// $acc->addItem($htpl->get(), $this->form->getHTML());
$html.= $this->form->getHTML()."<br />";
}
$cnt++;
}
// return $acc->getHTML();
return $html;
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObject2GUI::getCreationMode ( )
final

get creation mode

Reimplemented from ilObjectGUI.

Definition at line 148 of file class.ilObject2GUI.php.

Referenced by ilObjectPluginGUI\addLocatorItems(), ilObjMediaPoolGUI\addLocatorItems(), ilObjectPluginGUI\executeCommand(), and ilObjMediaPoolGUI\executeCommand().

+ Here is the caller graph for this function:

ilObject2GUI::getEditFormValues ( )

Get values for edit form.

Reimplemented in ilObjMediaPoolGUI.

Definition at line 476 of file class.ilObject2GUI.php.

Referenced by editObject().

{
$values["title"] = $this->object->getTitle();
$values["desc"] = $this->object->getDescription();
$this->form->setValuesByArray($values);
}

+ Here is the caller graph for this function:

ilObject2GUI::getHTML ( )
final

Reimplemented from ilObjectGUI.

Definition at line 154 of file class.ilObject2GUI.php.

{ return parent::getHTML(); }
ilObject2GUI::getReturnLocation ( )
finalprotected

Deprecated functions.

Definition at line 197 of file class.ilObject2GUI.php.

{ die("ilObject2GUI::getReturnLocation() is deprecated."); }
ilObject2GUI::getRightColumnHTML ( )
finalprotected

Display right column.

Reimplemented from ilObjectGUI.

Definition at line 161 of file class.ilObject2GUI.php.

ilObject2GUI::getTabs ( )
finalprotected

Definition at line 202 of file class.ilObject2GUI.php.

{nj(); die("ilObject2GUI::getTabs() is deprecated."); }
ilObject2GUI::getTargetFrame ( )
finalprotected

Definition at line 157 of file class.ilObject2GUI.php.

ilObject2GUI::getTemplateFile ( )
final

Definition at line 200 of file class.ilObject2GUI.php.

{mk(); die("ilObject2GUI::getTemplateFile() is deprecated."); }
ilObject2GUI::getTitlesByRefId ( )
finalprotected

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

{ die("ilObject2GUI::getTitlesByRefId() is deprecated."); }
ilObject2GUI::getType ( )
abstract

Functions that must be overwritten.

Reimplemented in ilObjMediaPoolGUI.

Referenced by ilObjectPluginGUI\__construct(), __construct(), and ilObjectPluginGUI\executeCommand().

+ Here is the caller graph for this function:

ilObject2GUI::hitsperpageObject ( )
finalprotected

Reimplemented from ilObjectGUI.

Definition at line 204 of file class.ilObject2GUI.php.

{ die("ilObject2GUI::hitsperpageObject() is deprecated."); }
ilObject2GUI::importFile ( )

Import.

public

Definition at line 586 of file class.ilObject2GUI.php.

References $_GET, $_POST, ilObjectGUI\$lng, ilObjectGUI\$objDefinition, ilObjectGUI\$tpl, ilObjectFactory\getInstanceByObjId(), initImportForm(), and ilUtil\sendSuccess().

{
global $rbacsystem, $objDefinition, $tpl, $lng;
$new_type = $_POST["new_type"] ? $_POST["new_type"] : $_GET["new_type"];
// create permission is already checked in createObject. This check here is done to prevent hacking attempts
if (!$rbacsystem->checkAccess("create", $_GET["ref_id"], $new_type))
{
$this->ilias->raiseError($this->lng->txt("no_create_permission"), $this->ilias->error_obj->MESSAGE);
}
$this->ctrl->setParameter($this, "new_type", $new_type);
$this->initImportForm($new_type);
if ($this->form->checkInput())
{
// todo: make some check on manifest file
include_once("./Services/Export/classes/class.ilImport.php");
$imp = new ilImport((int) $_GET['ref_id']);
$new_id = $imp->importObject($newObj, $_FILES["importfile"]["tmp_name"],
$_FILES["importfile"]["name"], $new_type);
// put new object id into tree
if ($new_id > 0)
{
$newObj->createReference();
$newObj->putInTree($_GET["ref_id"]);
$newObj->setPermissions($_GET["ref_id"]);
ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
$this->afterSave($newObj);
}
return;
}
$this->form->setValuesByPost();
$tpl->setContent($this->form->getHtml());
}

+ Here is the call graph for this function:

ilObject2GUI::initCreationForms ( )
protected

Init creation froms.

Reimplemented in ilObjMediaPoolGUI.

Definition at line 300 of file class.ilObject2GUI.php.

Referenced by create().

{
}

+ Here is the caller graph for this function:

ilObject2GUI::initEditForm (   $a_mode = "edit",
  $a_new_type = "" 
)

Init object creation form.

Parameters
int$a_modeEdit Mode

Reimplemented in ilObjMediaPoolGUI, and ilObjectPluginGUI.

Definition at line 434 of file class.ilObject2GUI.php.

References $ilCtrl, ilObjectGUI\$lng, ilTextAreaInputGUI\setCols(), and ilTextInputGUI\setMaxLength().

Referenced by editObject(), getCreationFormsHTML(), save(), and updateObject().

{
global $lng, $ilCtrl;
include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
$this->form = new ilPropertyFormGUI();
$this->form->setTarget("_top");
// title
$ti = new ilTextInputGUI($this->lng->txt("title"), "title");
$ti->setMaxLength(128);
$ti->setSize(40);
$ti->setRequired(true);
$this->form->addItem($ti);
// description
$ta = new ilTextAreaInputGUI($this->lng->txt("description"), "desc");
$ta->setCols(40);
$ta->setRows(2);
$this->form->addItem($ta);
// save and cancel commands
if ($a_mode == "create")
{
$this->form->addCommandButton("save", $lng->txt($a_new_type."_add"));
$this->form->addCommandButton("cancelCreation", $lng->txt("cancel"));
$this->form->setTitle($lng->txt($a_new_type."_new"));
}
else
{
$this->form->addCommandButton("update", $lng->txt("save"));
$this->form->addCommandButton("cancelUpdate", $lng->txt("cancel"));
$this->form->setTitle($lng->txt("edit"));
}
$this->form->setFormAction($ilCtrl->getFormAction($this));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObject2GUI::initImportForm (   $a_new_type = "")

Init object import form.

Parameters
stringnew type

Reimplemented in ilObjectPluginGUI.

Definition at line 560 of file class.ilObject2GUI.php.

References $ilCtrl, ilObjectGUI\$lng, and ilFileInputGUI\setSuffixes().

Referenced by getCreationFormsHTML(), and importFile().

{
global $lng, $ilCtrl;
include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
$this->form = new ilPropertyFormGUI();
$this->form->setTarget("_top");
// Import file
include_once("./Services/Form/classes/class.ilFileInputGUI.php");
$fi = new ilFileInputGUI($lng->txt("import_file"), "importfile");
$fi->setSuffixes(array("zip"));
$this->form->addItem($fi);
$this->form->addCommandButton("importFile", $lng->txt("import"));
$this->form->addCommandButton("cancelCreation", $lng->txt("cancel"));
$this->form->setTitle($lng->txt($a_new_type."_import"));
$this->form->setFormAction($ilCtrl->getFormAction($this));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObject2GUI::isVisible ( )
final

Definition at line 159 of file class.ilObject2GUI.php.

{ return parent::isVisible(); }
ilObject2GUI::omitLocator (   $a_omit = true)
finalprotected

Reimplemented from ilObjectGUI.

Definition at line 156 of file class.ilObject2GUI.php.

{ return parent::omitLocator($a_omit); }
ilObject2GUI::performCommand (   $cmd)

Handles all commmands of this class, centralizes permission checks.

Definition at line 131 of file class.ilObject2GUI.php.

Referenced by ilObjectPluginGUI\executeCommand(), and executeCommand().

{
/* switch ($cmd)
{
case ...:
$this->checkPermission();
return $this->$cmd();
break;
}*/
}

+ Here is the caller graph for this function:

ilObject2GUI::prepareOutput ( )
finalprotected

prepare output

Reimplemented from ilObjectGUI.

Definition at line 150 of file class.ilObject2GUI.php.

Referenced by ilObjMediaPoolGUI\executeCommand().

{ return parent::prepareOutput(); }

+ Here is the caller graph for this function:

ilObject2GUI::redirectToRefId ( )
finalprotected

Definition at line 175 of file class.ilObject2GUI.php.

{ return parent::redirectToRefId(); } // ok
ilObject2GUI::removeFromSystemObject ( )
final

remove objects from trash bin and all entries therefore every object needs a specific deleteObject() method

public

Reimplemented from ilObjectGUI.

Definition at line 174 of file class.ilObject2GUI.php.

{ return parent::removeFromSystemObject(); } // done
ilObject2GUI::save ( )

Save object.

public

Definition at line 391 of file class.ilObject2GUI.php.

References $_GET, $_POST, ilObjectGUI\$lng, $location, ilObjectGUI\$objDefinition, ilObjectGUI\$tpl, initEditForm(), ilUtil\sendSuccess(), and ilUtil\stripSlashes().

{
global $rbacsystem, $objDefinition, $tpl, $lng;
$new_type = $_POST["new_type"] ? $_POST["new_type"] : $_GET["new_type"];
// create permission is already checked in createObject. This check here is done to prevent hacking attempts
if (!$rbacsystem->checkAccess("create", $_GET["ref_id"], $new_type))
{
$this->ilias->raiseError($this->lng->txt("no_create_permission"), $this->ilias->error_obj->MESSAGE);
}
$this->ctrl->setParameter($this, "new_type", $new_type);
$this->initEditForm("create", $new_type);
if ($this->form->checkInput())
{
$location = $objDefinition->getLocation($new_type);
// create and insert object in objecttree
$class_name = "ilObj".$objDefinition->getClassName($new_type);
include_once($location."/class.".$class_name.".php");
$newObj = new $class_name();
$newObj->setType($new_type);
$newObj->setTitle(ilUtil::stripSlashes($_POST["title"]));
$newObj->setDescription(ilUtil::stripSlashes($_POST["desc"]));
$newObj->create();
$newObj->createReference();
$newObj->putInTree($_GET["ref_id"]);
$newObj->setPermissions($_GET["ref_id"]);
ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
$this->afterSave($newObj);
return;
}
$this->form->setValuesByPost();
$tpl->setContent($this->form->getHtml());
}

+ Here is the call graph for this function:

ilObject2GUI::searchCloneSourceObject ( )
finalprotected

Definition at line 180 of file class.ilObject2GUI.php.

ilObject2GUI::setColumnSettings (   $column_gui)
finalprotected

May be overwritten in subclasses.

Reimplemented from ilObjectGUI.

Definition at line 162 of file class.ilObject2GUI.php.

{ return parent::setColumnSettings($column_gui); }
ilObject2GUI::setCreationMode (   $a_mode = true)
final

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

Reimplemented from ilObjectGUI.

Definition at line 147 of file class.ilObject2GUI.php.

Referenced by ilObjMediaPoolGUI\executeCommand().

{ return parent::setCreationMode($a_mode); }

+ Here is the caller graph for this function:

ilObject2GUI::setLocator ( )
finalprotected

set Locator

Parameters
objecttree object
integerreference id
scriptanmethat is used for linking; public

Reimplemented from ilObjectGUI.

Definition at line 155 of file class.ilObject2GUI.php.

Referenced by ilObjectPluginGUI\executeCommand(), and ilObjMediaPoolGUI\executeCommand().

{ return parent::setLocator(); }

+ Here is the caller graph for this function:

ilObject2GUI::setReturnLocation ( )
finalprotected

Definition at line 198 of file class.ilObject2GUI.php.

{ die("ilObject2GUI::setReturnLocation() is deprecated."); }
ilObject2GUI::setTabs ( )
protected

set admin tabs public

Reimplemented from ilObjectGUI.

Reimplemented in ilObjMediaPoolGUI.

Definition at line 214 of file class.ilObject2GUI.php.

Referenced by ilObjectPluginGUI\executeCommand().

{ }

+ Here is the caller graph for this function:

ilObject2GUI::setTargetFrame (   $a_cmd,
  $a_target_frame 
)
finalprotected

set specific target frame for command

Parameters
string$a_cmdcommand
string$a_target_framedefault target frame (is returned, if no special target frame was set) public

Reimplemented from ilObjectGUI.

Definition at line 158 of file class.ilObject2GUI.php.

{ return parent::setTargetFrame($a_cmd, $a_target_frame); }
ilObject2GUI::setTitleAndDescription ( )
finalprotected

called by prepare output

Reimplemented from ilObjectGUI.

Definition at line 151 of file class.ilObject2GUI.php.

ilObject2GUI::showActions ( )
finalprotected

Definition at line 199 of file class.ilObject2GUI.php.

{ die("ilObject2GUI::showActions() is deprecated."); }
ilObject2GUI::showPossibleSubObjects ( )
finalprotected

show possible subobjects (pulldown menu)

public

Reimplemented from ilObjectGUI.

Definition at line 166 of file class.ilObject2GUI.php.

ilObject2GUI::showUpperIcon ( )
finalprotected

Reimplemented from ilObjectGUI.

Definition at line 152 of file class.ilObject2GUI.php.

{ return parent::showUpperIcon(); }
ilObject2GUI::trashObject ( )
final

Show trash content of object.

public

Reimplemented from ilObjectGUI.

Definition at line 169 of file class.ilObject2GUI.php.

{ return parent::trashObject(); } // done
ilObject2GUI::undeleteObject ( )
final

Get objects back from trash.

Reimplemented from ilObjectGUI.

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

{ return parent::undeleteObject(); } // done
ilObject2GUI::updateObject ( )

updates object entry in object_data

public

Reimplemented from ilObjectGUI.

Reimplemented in ilObjMediaPoolGUI.

Definition at line 532 of file class.ilObject2GUI.php.

References $_POST, ilObjectGUI\$lng, ilObjectGUI\$tpl, afterUpdate(), initEditForm(), and ilUtil\sendSuccess().

{
global $lng, $tpl;
$this->initEditForm("edit");
if ($this->form->checkInput())
{
$this->object->setTitle($_POST["title"]);
$this->object->setDescription($_POST["desc"]);
$this->update = $this->object->update();
ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
$this->afterUpdate();
return;
}
$this->form->setValuesByPost();
$tpl->setContent($this->form->getHtml());
}

+ Here is the call graph for this function:

ilObject2GUI::viewObject ( )
final

list childs of current object

public

Reimplemented from ilObjectGUI.

Definition at line 186 of file class.ilObject2GUI.php.

Referenced by ilObjectPluginGUI\executeCommand(), and ilObjMediaPoolGUI\view().

{ return parent::viewObject(); }

+ Here is the caller graph for this function:

ilObject2GUI::withReferences ( )
final

Final/Private declaration of unchanged parent methods.

Reimplemented from ilObjectGUI.

Definition at line 146 of file class.ilObject2GUI.php.

Field Documentation

ilObject2GUI::$creation_forms = array()
protected

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

const ilObject2GUI::CFORM_CLONE = "clone"
const ilObject2GUI::CFORM_IMPORT = "import"

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

Referenced by __construct(), and getCreationFormsHTML().

const ilObject2GUI::CFORM_NEW = "new"

Definition at line 30 of file class.ilObject2GUI.php.

Referenced by __construct(), and getCreationFormsHTML().


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