ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilRepUtilGUI Class Reference

Repository GUI Utilities. More...

+ Collaboration diagram for ilRepUtilGUI:

Public Member Functions

 __construct ($a_parent_gui, $a_parent_cmd="")
 Constructor.
 showDeleteConfirmation ($a_ids, $a_supress_message=false)
 Show delete confirmation table.
 showTrashTable ($a_ref_id)
 Get trashed objects for a container.
 restoreObjects ($a_cur_ref_id, $a_ref_ids)
 Restore objects from trash.
 deleteObjects ($a_cur_ref_id, $a_ref_ids)
 Delete objects.
 removeObjectsFromSystem ($a_ref_ids, $a_from_recovery_folder=false)
 Remove objects from system.

Detailed Description

Repository GUI Utilities.

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

Definition at line 11 of file class.ilRepUtilGUI.php.

Constructor & Destructor Documentation

ilRepUtilGUI::__construct (   $a_parent_gui,
  $a_parent_cmd = "" 
)

Constructor.

Parameters
objectparent gui object
stringcurrent parent command (like in table2gui)

Definition at line 20 of file class.ilRepUtilGUI.php.

{
$this->parent_gui = $a_parent_gui;
$this->parent_cmd = $a_parent_cmd;
}

Member Function Documentation

ilRepUtilGUI::deleteObjects (   $a_cur_ref_id,
  $a_ref_ids 
)

Delete objects.

Definition at line 136 of file class.ilRepUtilGUI.php.

References $ilSetting, $lng, ilUtil\sendFailure(), and ilUtil\sendSuccess().

{
global $ilSetting, $lng;
if (!is_array($a_ref_ids) || count($a_ref_ids) == 0)
{
ilUtil::sendFailure($lng->txt("no_checkbox"), true);
return false;
}
else
{
include_once("./Services/Repository/classes/class.ilRepUtil.php");
try
{
ilRepUtil::deleteObjects($a_cur_ref_id, $a_ref_ids);
if ($ilSetting->get('enable_trash'))
{
ilUtil::sendSuccess($lng->txt("info_deleted"),true);
}
else
{
ilUtil::sendSuccess($lng->txt("msg_removed"),true);
}
}
catch (Exception $e)
{
ilUtil::sendFailure($e->getMessage(), true);
return false;
}
}
}

+ Here is the call graph for this function:

ilRepUtilGUI::removeObjectsFromSystem (   $a_ref_ids,
  $a_from_recovery_folder = false 
)

Remove objects from system.

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

References $lng, ilUtil\sendFailure(), and ilUtil\sendSuccess().

{
global $lng;
if (!is_array($a_ref_ids) || count($a_ref_ids) == 0)
{
ilUtil::sendFailure($lng->txt("no_checkbox"), true);
return false;
}
else
{
include_once("./Services/Repository/classes/class.ilRepUtil.php");
try
{
ilRepUtil::removeObjectsFromSystem($a_ref_ids, $a_from_recovery_folder);
ilUtil::sendSuccess($lng->txt("msg_removed"),true);
}
catch (Exception $e)
{
ilUtil::sendFailure($e->getMessage(), true);
return false;
}
}
return true;
}

+ Here is the call graph for this function:

ilRepUtilGUI::restoreObjects (   $a_cur_ref_id,
  $a_ref_ids 
)

Restore objects from trash.

Parameters
integercurrent ref id
arrayarray of ref ids to be restored

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

References $lng, ilUtil\sendFailure(), and ilUtil\sendSuccess().

{
global $lng;
if (!is_array($a_ref_ids) || count($a_ref_ids) == 0)
{
ilUtil::sendFailure($lng->txt("no_checkbox"),true);
return false;
}
else
{
try
{
include_once("./Services/Repository/classes/class.ilRepUtil.php");
ilRepUtil::restoreObjects($a_cur_ref_id, $a_ref_ids);
ilUtil::sendSuccess($lng->txt("msg_undeleted"),true);
}
catch (Exception $e)
{
ilUtil::sendFailure($e->getMessage(),true);
return false;
}
}
return true;
}

+ Here is the call graph for this function:

ilRepUtilGUI::showDeleteConfirmation (   $a_ids,
  $a_supress_message = false 
)

Show delete confirmation table.

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

References $ilCtrl, $ilSetting, $lng, $ref_id, $title, $tpl, $type, ilObject\_getIcon(), ilObject\_lookupObjId(), ilObject\_lookupType(), ilObjectFactory\getClassByType(), ilPlugin\lookupTxt(), and ilUtil\sendFailure().

{
global $lng, $ilSetting, $ilCtrl, $tpl, $objDefinition;
if (!is_array($a_ids) || count($a_ids) == 0)
{
ilUtil::sendFailure($lng->txt("no_checkbox"), true);
return false;
}
// Remove duplicate entries
$a_ids = array_unique((array) $a_ids);
include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
$cgui = new ilConfirmationGUI();
if(!$a_supress_message)
{
$msg = $lng->txt("info_delete_sure");
if (!$ilSetting->get('enable_trash'))
{
$msg .= "<br/>".$lng->txt("info_delete_warning_no_trash");
}
$cgui->setHeaderText($msg);
}
$cgui->setFormAction($ilCtrl->getFormAction($this->parent_gui));
$cgui->setCancel($lng->txt("cancel"), "cancelDelete");
$cgui->setConfirm($lng->txt("confirm"), "confirmedDelete");
foreach ($a_ids as $ref_id)
{
$obj_id = ilObject::_lookupObjId($ref_id);
$title = call_user_func(array(ilObjectFactory::getClassByType($type),'_lookupTitle'),$obj_id);
$alt = ($objDefinition->isPlugin($type))
? $lng->txt("icon")." ".ilPlugin::lookupTxt("rep_robj", $type, "obj_".$type)
: $lng->txt("icon")." ".$lng->txt("obj_".$type);
$cgui->addItem("id[]", $ref_id, $title,
ilObject::_getIcon($obj_id, "small", $type),
$alt);
}
$tpl->setContent($cgui->getHTML());
return true;
}

+ Here is the call graph for this function:

ilRepUtilGUI::showTrashTable (   $a_ref_id)

Get trashed objects for a container.

Parameters
intergerref id of container

Definition at line 83 of file class.ilRepUtilGUI.php.

References $lng, $tpl, and ilUtil\sendInfo().

{
global $tpl, $tree, $lng;
$objects = $tree->getSavedNodeData($a_ref_id);
if (count($objects) == 0)
{
ilUtil::sendInfo($lng->txt("msg_trash_empty"));
return;
}
include_once("./Services/Repository/classes/class.ilTrashTableGUI.php");
$ttab = new ilTrashTableGUI($this->parent_gui, "trash");
$ttab->setData($objects);
$tpl->setContent($ttab->getHTML());
}

+ Here is the call graph for this function:


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